Spaces:
Running
Running
Update: Use model file from settings
Browse files
app.py
CHANGED
|
@@ -39,17 +39,17 @@ from lib.examples import EXAMPLES
|
|
| 39 |
|
| 40 |
MODEL_BASE = "microsoft/deberta-v3-base"
|
| 41 |
REPO_ID = "ziem-io/deberta_flavour_regressor_multi_head"
|
| 42 |
-
FILENAME = "deberta_flavour_regressor_multi_head_20250914_1020.safetensors"
|
| 43 |
|
| 44 |
# (optional) falls das Model-Repo privat ist:
|
| 45 |
HF_TOKEN = os.getenv("HF_TOKEN") # in Space-Secrets hinterlegen
|
|
|
|
| 46 |
|
| 47 |
##################################################################################
|
| 48 |
|
| 49 |
# --- Download Weights ---
|
| 50 |
weights_path = hf_hub_download(
|
| 51 |
repo_id=REPO_ID,
|
| 52 |
-
filename=
|
| 53 |
token=HF_TOKEN
|
| 54 |
)
|
| 55 |
|
|
@@ -159,7 +159,7 @@ def predict(review: str):
|
|
| 159 |
for name, score in prediction_flavours.items()
|
| 160 |
],
|
| 161 |
"review": review,
|
| 162 |
-
"model":
|
| 163 |
"device": device,
|
| 164 |
"duration": round((t_end_flavours - t_start_flavours), 3),
|
| 165 |
}
|
|
|
|
| 39 |
|
| 40 |
MODEL_BASE = "microsoft/deberta-v3-base"
|
| 41 |
REPO_ID = "ziem-io/deberta_flavour_regressor_multi_head"
|
|
|
|
| 42 |
|
| 43 |
# (optional) falls das Model-Repo privat ist:
|
| 44 |
HF_TOKEN = os.getenv("HF_TOKEN") # in Space-Secrets hinterlegen
|
| 45 |
+
MODEL_FILE = os.getenv("MODEL_FILE") # in Space-Secrets hinterlegen
|
| 46 |
|
| 47 |
##################################################################################
|
| 48 |
|
| 49 |
# --- Download Weights ---
|
| 50 |
weights_path = hf_hub_download(
|
| 51 |
repo_id=REPO_ID,
|
| 52 |
+
filename=MODEL_FILE,
|
| 53 |
token=HF_TOKEN
|
| 54 |
)
|
| 55 |
|
|
|
|
| 159 |
for name, score in prediction_flavours.items()
|
| 160 |
],
|
| 161 |
"review": review,
|
| 162 |
+
"model": MODEL_FILE,
|
| 163 |
"device": device,
|
| 164 |
"duration": round((t_end_flavours - t_start_flavours), 3),
|
| 165 |
}
|