Anthonyg5005 commited on
Commit
117c7e8
·
verified ·
1 Parent(s): 743b9b8

Upload create new branch.py

Browse files
Files changed (1) hide show
  1. create new branch.py +13 -0
create new branch.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import huggingface_hub
3
+ from huggingface_hub import create_branch
4
+
5
+ #get user variables
6
+ repo = input("Repository name: ")
7
+ branch = input("New branch name: ")
8
+
9
+ #login
10
+ huggingface_hub.login(os.environ['HF_TOKEN'])
11
+
12
+ #create the branch
13
+ create_branch(f"{repo}", repo_type="model", branch=f"{branch}")