Download model.py from arnie23/blud2: direct link, hf CLI and curl.
- Browser
- Download file 443 Bytes
-
https://huggingface.co/spaces/arnie23/blud2/resolve/main/model.py
- Command line
-
hf download hf://spaces/arnie23/blud2/model.py
-
curl -L -o model.py https://huggingface.co/spaces/arnie23/blud2/resolve/main/model.py
443 Bytes
| # model.py | |
| def predict_metals(input_df): | |
| import joblib | |
| # Load the trained model | |
| model = joblib.load("geo_metals_model_fixed.joblib") | |
| # Predict using the model | |
| preds = model.predict(input_df)[0] | |
| # Return results with expected keys | |
| return { | |
| "Fe_ppm": preds[0], | |
| "Cr_ppm": preds[1], | |
| "Mn_ppm": preds[2], | |
| "Mo_ppm": preds[3], | |
| "In_ppm": preds[4], | |
| "Ta_ppm": preds[5], | |
| } | |