Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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)
|