Commit
•
f6b4a60
1
Parent(s):
425b7e1
Update app.py
Browse files
app.py
CHANGED
@@ -7,12 +7,12 @@ from slugify import slugify
|
|
7 |
def clone(profile: gr.OAuthProfile, oauth_token: gr.OAuthToken, repo_git, repo_hf):
|
8 |
folder = str(uuid.uuid4())
|
9 |
cloned_repo = Repo.clone_from(repo_git, folder)
|
10 |
-
|
11 |
-
print(cloned_repo)
|
12 |
#Upload to HF
|
13 |
api = HfApi(token=oauth_token)
|
14 |
api.create_repo(
|
15 |
-
f"{profile.username}/{slugify(repo_hf)}"
|
|
|
16 |
)
|
17 |
api.upload_folder(
|
18 |
folder_path=folder,
|
|
|
7 |
def clone(profile: gr.OAuthProfile, oauth_token: gr.OAuthToken, repo_git, repo_hf):
|
8 |
folder = str(uuid.uuid4())
|
9 |
cloned_repo = Repo.clone_from(repo_git, folder)
|
10 |
+
|
|
|
11 |
#Upload to HF
|
12 |
api = HfApi(token=oauth_token)
|
13 |
api.create_repo(
|
14 |
+
f"{profile.username}/{slugify(repo_hf)}",
|
15 |
+
repo_type="space",
|
16 |
)
|
17 |
api.upload_folder(
|
18 |
folder_path=folder,
|