Spaces:
Runtime error
Runtime error
Download src/inference/predict.py from SparshSG/AQI_Predictor: direct link, hf CLI and curl.
- Browser
- Download file 302 Bytes
-
https://huggingface.co/spaces/SparshSG/AQI_Predictor/resolve/main/src/inference/predict.py
- Command line
-
hf download hf://spaces/SparshSG/AQI_Predictor/src/inference/predict.py
-
curl -L -o predict.py https://huggingface.co/spaces/SparshSG/AQI_Predictor/resolve/main/src/inference/predict.py
302 Bytes
| import mlflow | |
| import mlflow.sklearn | |
| def load_model_from_run(run_id: str): | |
| mlflow.set_tracking_uri("file:./mlruns") # FIXED | |
| model_uri = f"runs:/{run_id}/model" | |
| model = mlflow.sklearn.load_model(model_uri) | |
| return model | |
| def predict(model, X): | |
| return model.predict(X) |