from huggingface_hub import snapshot_download import glob import os HF_TOKEN = os.environ.get("HF_TOKEN") REPO_ID = os.environ.get("REPO_ID") USER_ACKER = os.environ.get("USER_ACKER") PWD_ACKER = os.environ.get("PWD_ACKER") USER_MAGIC = os.environ.get("USER_MAGIC") PWD_MAGIC = os.environ.get("PWD_MAGIC") magic_snapshot = snapshot_download(repo_id=REPO_ID, revision="main", allow_patterns="*.py", repo_type= "space", use_auth_token=os.environ['HF_TOKEN']) for file in glob.glob(os.path.join(magic_snapshot, "*.py")): os.system(f"cp {file} .") from app import demo demo.launch() #(share=True, auth=[(USER_ACKER, PWD_ACKER), (USER_MAGIC, PWD_MAGIC)], allowed_paths=["."], ssr_mode=False)