Update app.py
Browse files
app.py
CHANGED
@@ -1,22 +1,17 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
# # Access Hugging Face secret from the environment
|
5 |
-
# hf_token = os.environ.get('pass') # 'pass' is the name of the secret you set
|
6 |
-
|
7 |
-
# # Load the private Space using the secret
|
8 |
-
# demo = gr.load("peymoon/test", hf_token=hf_token, src="spaces")
|
9 |
-
|
10 |
-
# # Launch the public-facing interface
|
11 |
-
# demo.launch()
|
12 |
from huggingface_hub import HfApi
|
13 |
|
14 |
# Use the token from the Secrets Manager
|
15 |
token = os.environ.get('pass') # Retrieve your stored secret
|
16 |
|
17 |
-
#
|
18 |
api = HfApi()
|
19 |
repo_info = api.repo_info(repo_id="peymoon/test", token=token)
|
20 |
-
print(repo_info)
|
21 |
|
|
|
|
|
22 |
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
from huggingface_hub import HfApi
|
4 |
|
5 |
# Use the token from the Secrets Manager
|
6 |
token = os.environ.get('pass') # Retrieve your stored secret
|
7 |
|
8 |
+
# Check access to the private Space using the token
|
9 |
api = HfApi()
|
10 |
repo_info = api.repo_info(repo_id="peymoon/test", token=token)
|
11 |
+
print(repo_info) # This will print out information about the private Space
|
12 |
|
13 |
+
# Load the private Space using the Hugging Face token
|
14 |
+
demo = gr.load("peymoon/test", hf_token=token, src="spaces")
|
15 |
|
16 |
+
# Launch the public-facing interface
|
17 |
+
demo.launch()
|