File size: 624 Bytes
5056127
 
332aad2
 
 
 
 
43377cd
332aad2
43377cd
ad1f1bd
5056127
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import os  # Make sure to import os module
import gradio as gr
from huggingface_hub import HfApi

# Use the token from the Secrets Manager
token = os.environ.get('pass')  # Retrieve your stored secret

# Check access to the private Space using the token, specifying repo_type="space"
api = HfApi()
repo_info = api.repo_info(repo_id="peymoon/test", token=token, repo_type="space")
print(repo_info)  # This will print out information about the private Space

# Load the private Space using the Hugging Face token
demo = gr.load("peymoon/test", hf_token=token, src="spaces")

# Launch the public-facing interface
demo.launch()