fastapi_mlflow/applications.py
def build_app(pyfunc_model: PyFuncModel) -> FastAPI:
    """Build and return a FastAPI app for the mlflow model."""
    app = FastAPI()
    predictor = build_predictor(pyfunc_model)
    response_model = signature(predictor).return_annotation
    app.add_api_route(
        "/predictions",
        predictor,
        response_model=response_model,
        methods=["POST"],
    )
    return app
Build and return a FastAPI app for the mlflow model.
Build and return a FastAPI app for the mlflow model.
Build and return a FastAPI app for the mlflow model .
def build_app(pyfunc_model: PyFuncModel) -> FastAPI:
    app = FastAPI()
    predictor = build_predictor(pyfunc_model)
    response_model = signature(predictor).return_annotation
    app.add_api_route(
        "/predictions",
        predictor,
        response_model=response_model,
        methods=["POST"],
    )
    return app
def build_app ( pyfunc_model : PyFuncModel ) -> FastAPI : app = FastAPI ( ) predictor = build_predictor ( pyfunc_model ) response_model = signature ( predictor ) . return_annotation app . add_api_route ( "/predictions" , predictor , response_model = response_model , methods = [ "POST" ] , ) return app
Build and return a FastAPI app for the mlflow model.
Build and return a FastAPI app for the mlflow model .
"""Build and return a FastAPI app for the mlflow model."""
pyfunc_model
PyFuncModel