- Sort Score
- Result 10 results
- Languages All
Results 1 - 1 of 1 for and (0.44 sec)
-
docs_src/events/tutorial003.py
ml_models = {} @asynccontextmanager async def lifespan(app: FastAPI): # Load the ML model ml_models["answer_to_everything"] = fake_answer_to_everything_ml_model 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 May 05 07:19:11 GMT 2024 - Last Modified: Tue Mar 07 15:46:00 GMT 2023 - 569 bytes - Viewed (0)