Skip to content

Commit

Permalink
force mlflow value
Browse files Browse the repository at this point in the history
  • Loading branch information
linogaliana committed Jan 31, 2025
1 parent 255f53c commit 4306135
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions api/main.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
"""A simple API to expose our trained RandomForest model for Tutanic survival."""
from fastapi import FastAPI
from joblib import load
import mlflow

import pandas as pd

model = load('model.joblib')
# Preload model -------------------

model_name = "production"
model_version = "latest"

# Load the model from the Model Registry
model_uri = f"models:/{model_name}/{model_version}"
model = mlflow.sklearn.load_model(model_uri)

# Define app -------------------------


app = FastAPI(
title="Prédiction de survie sur le Titanic",
Expand All @@ -23,7 +33,7 @@ def show_welcome_page():
return {
"Message": "API de prédiction de survie sur le Titanic",
"Model_name": 'Titanic ML',
"Model_version": "0.2",
"Model_version": "0.3",
}


Expand Down

0 comments on commit 4306135

Please sign in to comment.