unify production app configuration and ML routes
This commit is contained in:
@@ -9,14 +9,10 @@ from app.ml.feature_store import FeatureStore, FeatureVector
|
||||
def create_app() -> FastAPI:
|
||||
application = FastAPI(title="SillyHome Next ML")
|
||||
init_ml_routes(application)
|
||||
_seed_default_model(application.state if hasattr(application, "state") else application)
|
||||
_seed_default_model(application.state)
|
||||
return application
|
||||
|
||||
|
||||
def _app_state(): # noqa: ANN001
|
||||
return app.state
|
||||
|
||||
|
||||
def _seed_default_model(state) -> None: # noqa: ANN001
|
||||
registry = getattr(state, "registry", None)
|
||||
if registry is None:
|
||||
@@ -34,4 +30,4 @@ def _seed_default_model(state) -> None: # noqa: ANN001
|
||||
registry.register(artifact)
|
||||
|
||||
|
||||
app = create_app()
|
||||
app = create_app()
|
||||
|
||||
Reference in New Issue
Block a user