import os import subprocess import runpy REPO_NAME = "careertwin" # Clone repo if not exists if not os.path.exists(REPO_NAME): token = os.environ.get("HF_GITHUB_TOKEN") GITHUB_USER = "andy-ang" REPO_URL = f"https://{token}:x-oauth-basic@github.com/{GITHUB_USER}/{REPO_NAME}.git" subprocess.run(["git", "clone", REPO_URL], check=True) else: subprocess.run(["git", "-C", REPO_NAME, "pull"], check=True) # Install dependencies from requirements.txt req_file = os.path.join(REPO_NAME, "requirements.txt") if os.path.exists(req_file): subprocess.run(["pip", "install", "--upgrade", "-r", req_file], check=True) os.chdir(REPO_NAME) # Run the app runpy.run_path("app.py", run_name="__main__")