Skip to content

Commit b243fa5

Browse files
committed
test
1 parent cdee61d commit b243fa5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.github/workflows/train_model.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ jobs:
99
train_model:
1010
runs-on: ubuntu-latest
1111
steps:
12+
- name: Set up environment variables
13+
run: echo "MLFLOW_TRACKING_URI=${{ secrets.MLFLOW_TRACKING_URI }}" >> $GITHUB_ENV
14+
1215
- uses: actions/checkout@v3
1316

1417
- name: Install uv

src/make_api/app/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
mlflow.set_tracking_uri(os.getenv("MLFLOW_TRACKING_URI"))
6161
print(os.getenv("ASD"))
6262
model_uri = "models:/taxi_fare_prediction.taxi_fare_model@latest-model"
63-
pipe = mlflow.sklearn.load_model(model_uri)
6463

6564
app = FastAPI()
6665

@@ -82,6 +81,7 @@ async def read_root():
8281

8382
@app.post("/predict")
8483
async def predict_one(data: InferenceInput) -> dict[str, float]:
84+
pipe = mlflow.sklearn.load_model(model_uri)
8585
df_input = pd.DataFrame([data.dict()])
8686

8787
prediction = pipe.predict(df_input)

0 commit comments

Comments
 (0)