lampongyuen commited on
Commit
5847ba4
·
verified ·
1 Parent(s): ef88c1e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -7,7 +7,11 @@ private_space_repo = "lampongyuen/gradio-app1"
7
 
8
  # Your Hugging Face API token with access to the private Space (set as a secret in the Space settings)
9
  hf_token = os.getenv("HF_TOKEN")
10
- print(hf_token)
 
 
 
 
11
 
12
  # Specify src="spaces" and pass hf_token for authentication
13
  iface = gr.load(private_space_repo, src="spaces", token=hf_token)
 
7
 
8
  # Your Hugging Face API token with access to the private Space (set as a secret in the Space settings)
9
  hf_token = os.getenv("HF_TOKEN")
10
+ print(f"Token loaded: {'Yes' if hf_token else 'No'}")
11
+
12
+ if not hf_token:
13
+ raise ValueError("HF_TOKEN environment variable not set!")
14
+
15
 
16
  # Specify src="spaces" and pass hf_token for authentication
17
  iface = gr.load(private_space_repo, src="spaces", token=hf_token)