Add embedded Hugging Face token fallback
This commit is contained in:
4
main.py
4
main.py
@@ -9,7 +9,7 @@ import time
|
||||
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
||||
from pathlib import Path
|
||||
|
||||
from modelhub_submmit_api.defaults import EMBEDDED_MODELHUB_XC_TOKEN
|
||||
from modelhub_submmit_api.defaults import EMBEDDED_HF_TOKEN, EMBEDDED_MODELHUB_XC_TOKEN
|
||||
|
||||
|
||||
HOST = "0.0.0.0"
|
||||
@@ -75,7 +75,7 @@ def _worker_command() -> list[str]:
|
||||
def _config() -> dict[str, object]:
|
||||
return {
|
||||
"strategy_id_present": bool(os.getenv("STRATEGY_ID")),
|
||||
"hf_token_present": bool(os.getenv("HF_TOKEN")),
|
||||
"hf_token_present": bool(os.getenv("HF_TOKEN") or EMBEDDED_HF_TOKEN),
|
||||
"modelhub_auth_present": _has_modelhub_auth(),
|
||||
"config_error": config_error,
|
||||
"worker_running": worker is not None and worker.poll() is None,
|
||||
|
||||
Reference in New Issue
Block a user