- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for predict (0.25 sec)
-
tests/test_tutorial/test_events/test_tutorial003.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 3.6K bytes - Viewed (0) -
docs_src/events/tutorial003.py
yield # Clean up the ML models and release the resources ml_models.clear() app = FastAPI(lifespan=lifespan) @app.get("/predict") async def predict(x: float): result = ml_models["answer_to_everything"](x)
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Tue Mar 07 15:46:00 GMT 2023 - 569 bytes - Viewed (0) -
tests/test_request_body_parameters_media_type.py
# NOTE: These are not valid JSON:API resources # but they are fine for testing requestBody with custom media_type class Product(BaseModel): name: str price: float class Shop(BaseModel): name: str @app.post("/products") async def create_product(data: Product = Body(media_type=media_type, embed=True)): pass # pragma: no cover @app.post("/shops") async def create_shop(
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 6.4K bytes - Viewed (0) -
tests/test_get_request_body.py
from fastapi import FastAPI from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() class Product(BaseModel): name: str description: str = None # type: ignore price: float @app.get("/product") async def create_item(product: Product): return product client = TestClient(app) def test_get_with_body():
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 3.7K bytes - Viewed (0)