Spaces:
Sleeping
Sleeping
Commit ·
6286030
1
Parent(s): 924ec70
Update app.py with HF model repo path
Browse files
app.py
CHANGED
|
@@ -6,11 +6,18 @@ import glob
|
|
| 6 |
app = FastAPI()
|
| 7 |
|
| 8 |
# Load model
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
model_data = joblib.load(model_path)
|
| 11 |
model = model_data["model"]
|
| 12 |
columns = model_data["columns"]
|
| 13 |
|
|
|
|
| 14 |
@app.get("/")
|
| 15 |
def home():
|
| 16 |
return {"status": "API is running"}
|
|
|
|
| 6 |
app = FastAPI()
|
| 7 |
|
| 8 |
# Load model
|
| 9 |
+
from huggingface_hub import hf_hub_download
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
model_path = hf_hub_download(
|
| 13 |
+
repo_id="danialsiddiqui/nexus-task6-model",
|
| 14 |
+
filename="model.joblib"
|
| 15 |
+
)
|
| 16 |
model_data = joblib.load(model_path)
|
| 17 |
model = model_data["model"]
|
| 18 |
columns = model_data["columns"]
|
| 19 |
|
| 20 |
+
|
| 21 |
@app.get("/")
|
| 22 |
def home():
|
| 23 |
return {"status": "API is running"}
|