Skip to content

Commit 9cbb027

Browse files
committed
fix tests
1 parent 3f80b1c commit 9cbb027

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/make_api/app/main.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ def get_model(model_uri):
1717
return mlflow.sklearn.load_model(model_uri)
1818

1919

20-
pipe = get_model(model_uri)
21-
2220
app = FastAPI()
2321

2422

@@ -41,7 +39,7 @@ async def read_root():
4139
async def predict_one(data: InferenceInput) -> dict[str, float]:
4240
try:
4341
df_input = pd.DataFrame([data.dict()]) # pd df might be overkill
44-
prediction = pipe.predict(df_input)
42+
prediction = get_model(model_uri).predict(df_input)
4543
return {"prediction": prediction[0]}
4644
except Exception as e:
4745
raise HTTPException(status_code=400, detail=f"Prediction failed: {str(e)}") from e

0 commit comments

Comments
 (0)