ldb / app.py
peymoon's picture
Update app.py
332aad2 verified
raw
history blame
622 Bytes
# 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)