Upload create new branch.py
Browse files- 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}")
|