File size: 614 Bytes
3487048
21d4b07
3487048
 
 
a7219e0
 
 
 
3487048
 
a7219e0
3487048
 
7112a9c
 
3487048
 
21d4b07
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
import subprocess

from huggingface_hub import login, snapshot_download

HF_TOKEN = os.getenv("HF_TOKEN")
if HF_TOKEN is None:
    raise RuntimeError("HF_TOKEN is not set")

CODE_REPO_ID = "elsamueldev/confia-backend-code"

login(HF_TOKEN)

snapshot_download(
    repo_id=CODE_REPO_ID,
    repo_type="dataset",
    local_dir=".",
    local_dir_use_symlinks=False
)

local_dir = subprocess.run(["ls"], stdout=subprocess.PIPE).stdout.decode("utf-8")
print(local_dir)
if "main.py" not in local_dir:
    raise RuntimeError("main.py not found in the downloaded dataset")

subprocess.run(["python", "main.py"])