Spaces:
Runtime error
Runtime error
import os | |
import glob | |
from huggingface_hub import snapshot_download | |
REPO_ID = os.environ.get("REPO_ID") | |
TOKEN = os.environ.get("TOKEN") | |
folder = snapshot_download( | |
repo_id=REPO_ID, | |
revision="main", | |
allow_regex="*.py", | |
repo_type="space", | |
use_auth_token=TOKEN, | |
) | |
# copy all *.py files in folder to . | |
for file in glob.glob(os.path.join(folder, "*.py")): | |
os.system(f"cp {file} .") | |
from app import demo | |
demo.launch() | |