Felladrin commited on
Commit
423413d
·
1 Parent(s): 9f538bd

Add environment variable fallback for HF_TOKEN before checking secrets

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -34,7 +34,7 @@ class Config:
34
  @classmethod
35
  def from_env(cls) -> "Config":
36
  """Create config from environment variables and secrets."""
37
- system_token = st.secrets.get("HF_TOKEN")
38
  user_token = st.session_state.get("user_hf_token")
39
 
40
  if user_token:
 
34
  @classmethod
35
  def from_env(cls) -> "Config":
36
  """Create config from environment variables and secrets."""
37
+ system_token = os.getenv("HF_TOKEN") or st.secrets.get("HF_TOKEN")
38
  user_token = st.session_state.get("user_hf_token")
39
 
40
  if user_token: