Using HuggingFace without sharing your code!

I share my academic life!

Using HuggingFace without sharing your code!

from git import Repo
import os

# Retrieve the environment variables
GITHUB_PAT = os.getenv('GITHUB_PAT')
GIT_id = os.getenv('GIT_id')
GIT_repo = os.getenv('GIT_repo')

if GITHUB_PAT:
    print("GITHUB_PAT set")

# Ensure the cloned_repo directory does not already exist
if not os.path.exists('cloned_repo'):  
    # Clone the repository using the Personal Access Token for authentication
    Repo.clone_from(f'https://{GIT_id}:{GITHUB_PAT}@github.com/{GIT_id}/{GIT_repo}.git', './cloned_repo')

# Import the main module from the cloned repository
import cloned_repo.main as main
from cloned_repo.main import *