We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9cbb027 commit 23d1d92Copy full SHA for 23d1d92
src/make_api/app/main.py
@@ -39,7 +39,9 @@ async def read_root():
39
async def predict_one(data: InferenceInput) -> dict[str, float]:
40
try:
41
df_input = pd.DataFrame([data.dict()]) # pd df might be overkill
42
- prediction = get_model(model_uri).predict(df_input)
+ # prediction = get_model(model_uri).predict(df_input)
43
+ pipe = mlflow.sklearn.load_model(model_uri)
44
+ prediction = pipe.predict(df_input)
45
return {"prediction": prediction[0]}
46
except Exception as e:
47
raise HTTPException(status_code=400, detail=f"Prediction failed: {str(e)}") from e
0 commit comments