mechark commited on
Commit
df42d83
·
1 Parent(s): fd107a3

fix: again try to fix HF_TOKEN problem

Browse files
Files changed (1) hide show
  1. src/core/config.py +5 -0
src/core/config.py CHANGED
@@ -31,4 +31,9 @@ class Settings(BaseSettings):
31
  env_file = ".env"
32
 
33
 
 
 
 
 
 
34
  settings = Settings()
 
31
  env_file = ".env"
32
 
33
 
34
+ # Try to read HF_TOKEN from HuggingFace Spaces secrets first, then fall back to env
35
+ hf_token_from_file = read_secret_from_file("HF_TOKEN")
36
+ if hf_token_from_file:
37
+ os.environ["HF_TOKEN"] = hf_token_from_file
38
+
39
  settings = Settings()