Spaces:
Sleeping
Sleeping
Yousef Awad commited on
Dropdown: bertv1/robertav1/bertv2/robertav2 from Hub repos
Browse files15 unmodified lines161718192021225 unmodified lines28293031323334353615 unmodified lines# Hugging Face owner + the canonical "best model" repo the app loads by default# and that the Manage Model page overwrites.HF_OWNER = os.environ.get("HF_OWNER", "Zeqhx")PRIMARY_MODEL_ID = os.environ.get("DASHBOARD_MODEL_ID", f"{HF_OWNER}/cv-parser-ner")# Back-compat single-ref overrides (used by load_model()'s config path).MODEL_PATH = os.environ.get("DASHBOARD_MODEL_PATH", "")5 unmodified lines# Toggle registry. Each entry: (label, kind, ref). "local" entries are only# offered when the folder exists (dev machines); "hub" entries are always offered.MODEL_REGISTRY = [(f"⭐ Best model (Hub: {PRIMARY_MODEL_ID})", "hub", PRIMARY_MODEL_ID),("RoBERTa — local export", "local", "exported_models/roberta-base-ner"),("BERT — local export", "local", "exported_models/bert-base-uncased-ner"),]15 unmodified lines1617181920212223242526272829305 unmodified lines3637383940414243444515 unmodified lines# Hugging Face owner + the canonical "best model" repo the app loads by default# and that the Manage Model page overwrites.HF_OWNER = os.environ.get("HF_OWNER", "Zeqhx")# Four published models, selectable in the UI:# v1 = earlier (dataset-2) models, v2 = latest (dataset-4) retrains.BERT_V1_ID = os.environ.get("DASHBOARD_BERT_V1_ID", f"{HF_OWNER}/cv-parser-bert-v1")ROBERTA_V1_ID = os.environ.get("DASHBOARD_ROBERTA_V1_ID", f"{HF_OWNER}/cv-parser-roberta-v1")BERT_V2_ID = os.environ.get("DASHBOARD_BERT_V2_ID", f"{HF_OWNER}/cv-parser-bert-v2")ROBERTA_V2_ID = os.environ.get("DASHBOARD_ROBERTA_V2_ID", f"{HF_OWNER}/cv-parser-roberta-v2")# Default model the app loads and the Manage Model page overwrites: best = robertav2.PRIMARY_MODEL_ID = os.environ.get("DASHBOARD_MODEL_ID", ROBERTA_V2_ID)# Back-compat single-ref overrides (used by load_model()'s config path).MODEL_PATH = os.environ.get("DASHBOARD_MODEL_PATH", "")5 unmodified lines# Toggle registry. Each entry: (label, kind, ref). "local" entries are only# offered when the folder exists (dev machines); "hub" entries are always offered.MODEL_REGISTRY = [("bertv1", "hub", BERT_V1_ID),("robertav1", "hub", ROBERTA_V1_ID),("bertv2", "hub", BERT_V2_ID),("robertav2", "hub", ROBERTA_V2_ID),]
config.py+13-4