File size: 622 Bytes
332aad2 dac2574 332aad2 dac2574 938bcee |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# import os
# import gradio as gr
# # Access Hugging Face secret from the environment
# hf_token = os.environ.get('pass') # 'pass' is the name of the secret you set
# # Load the private Space using the secret
# demo = gr.load("peymoon/test", hf_token=hf_token, src="spaces")
# # Launch the public-facing interface
# demo.launch()
from huggingface_hub import HfApi
# Use the token from the Secrets Manager
token = os.environ.get('pass') # Retrieve your stored secret
# Use the token to check access to the private Space
api = HfApi()
repo_info = api.repo_info(repo_id="peymoon/test", token=token)
print(repo_info)
|