hf-scripts / create new branch.py
Anthonyg5005's picture
Upload create new branch.py
117c7e8 verified
raw
history blame
304 Bytes
import os
import huggingface_hub
from huggingface_hub import create_branch
#get user variables
repo = input("Repository name: ")
branch = input("New branch name: ")
#login
huggingface_hub.login(os.environ['HF_TOKEN'])
#create the branch
create_branch(f"{repo}", repo_type="model", branch=f"{branch}")