Spaces:
Running
Running
Dropdown: bertv1/robertav1/bertv2/robertav2 from Hub repos
Browse files
config.py
CHANGED
|
@@ -16,7 +16,15 @@ import os
|
|
| 16 |
# Hugging Face owner + the canonical "best model" repo the app loads by default
|
| 17 |
# and that the Manage Model page overwrites.
|
| 18 |
HF_OWNER = os.environ.get("HF_OWNER", "Zeqhx")
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
# Back-compat single-ref overrides (used by load_model()'s config path).
|
| 22 |
MODEL_PATH = os.environ.get("DASHBOARD_MODEL_PATH", "")
|
|
@@ -28,9 +36,10 @@ DEMO_LABEL = "Demo — untrained roberta-base"
|
|
| 28 |
# Toggle registry. Each entry: (label, kind, ref). "local" entries are only
|
| 29 |
# offered when the folder exists (dev machines); "hub" entries are always offered.
|
| 30 |
MODEL_REGISTRY = [
|
| 31 |
-
(
|
| 32 |
-
("
|
| 33 |
-
("
|
|
|
|
| 34 |
]
|
| 35 |
|
| 36 |
|
|
|
|
| 16 |
# Hugging Face owner + the canonical "best model" repo the app loads by default
|
| 17 |
# and that the Manage Model page overwrites.
|
| 18 |
HF_OWNER = os.environ.get("HF_OWNER", "Zeqhx")
|
| 19 |
+
# Four published models, selectable in the UI:
|
| 20 |
+
# v1 = earlier (dataset-2) models, v2 = latest (dataset-4) retrains.
|
| 21 |
+
BERT_V1_ID = os.environ.get("DASHBOARD_BERT_V1_ID", f"{HF_OWNER}/cv-parser-bert-v1")
|
| 22 |
+
ROBERTA_V1_ID = os.environ.get("DASHBOARD_ROBERTA_V1_ID", f"{HF_OWNER}/cv-parser-roberta-v1")
|
| 23 |
+
BERT_V2_ID = os.environ.get("DASHBOARD_BERT_V2_ID", f"{HF_OWNER}/cv-parser-bert-v2")
|
| 24 |
+
ROBERTA_V2_ID = os.environ.get("DASHBOARD_ROBERTA_V2_ID", f"{HF_OWNER}/cv-parser-roberta-v2")
|
| 25 |
+
|
| 26 |
+
# Default model the app loads and the Manage Model page overwrites: best = robertav2.
|
| 27 |
+
PRIMARY_MODEL_ID = os.environ.get("DASHBOARD_MODEL_ID", ROBERTA_V2_ID)
|
| 28 |
|
| 29 |
# Back-compat single-ref overrides (used by load_model()'s config path).
|
| 30 |
MODEL_PATH = os.environ.get("DASHBOARD_MODEL_PATH", "")
|
|
|
|
| 36 |
# Toggle registry. Each entry: (label, kind, ref). "local" entries are only
|
| 37 |
# offered when the folder exists (dev machines); "hub" entries are always offered.
|
| 38 |
MODEL_REGISTRY = [
|
| 39 |
+
("bertv1", "hub", BERT_V1_ID),
|
| 40 |
+
("robertav1", "hub", ROBERTA_V1_ID),
|
| 41 |
+
("bertv2", "hub", BERT_V2_ID),
|
| 42 |
+
("robertav2", "hub", ROBERTA_V2_ID),
|
| 43 |
]
|
| 44 |
|
| 45 |
|