File size: 440 Bytes
acc62e6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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()