bobfu commited on
Commit
2237841
·
verified ·
1 Parent(s): 7f45d1d

Add HF_TOKEN to App.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -1,6 +1,10 @@
1
  from huggingface_hub import snapshot_download, hf_hub_download
2
  import importlib.util
3
  from pathlib import Path
 
 
 
 
4
 
5
  # 1. Download a snapshot of the private Space’s repo into a local cache directory
6
  cache_dir = Path("private_space_cache")
 
1
  from huggingface_hub import snapshot_download, hf_hub_download
2
  import importlib.util
3
  from pathlib import Path
4
+ import os
5
+
6
+ # 0. Immediately set the HF token from the secret
7
+ os.environ["HUGGINGFACE_TOKEN"] = os.getenv("HF_TOKEN")
8
 
9
  # 1. Download a snapshot of the private Space’s repo into a local cache directory
10
  cache_dir = Path("private_space_cache")