Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meowlflow/serve: reuse app to inherit config #31

Merged
merged 1 commit into from
Dec 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions meowlflow/serve.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import logging

import click
from fastapi import FastAPI
import json
from mlflow.models.container import MODEL_PATH
from mlflow.pyfunc import load_model, scoring_server
Expand All @@ -10,7 +9,7 @@
import uvicorn

from meowlflow.api import api, info
from meowlflow.sidecar import register_infer_endpoint
from meowlflow.sidecar import app, register_infer_endpoint


@click.option("--endpoint", default="/infer", type=click.Path(), show_default=True)
Expand Down Expand Up @@ -40,7 +39,6 @@ def serve(endpoint, schema_path, model_path, host, port):
model = load_model(path_to_local_file_uri(model_path))
model_schema = model.metadata.get_input_schema()

app = FastAPI()
register_infer_endpoint(
logger, app, api.router, endpoint, get_infer(model, model_schema), schema_path
)
Expand Down