Spaces:
Runtime error
Runtime error
Commit
•
010c9e3
1
Parent(s):
ee7af39
Update app.py
Browse files
app.py
CHANGED
@@ -158,9 +158,9 @@ def push(model_name, where_to_upload, hf_token):
|
|
158 |
from huggingface_hub import HfApi, HfFolder, CommitOperationAdd
|
159 |
from huggingface_hub import create_repo
|
160 |
model_name_slug = slugify(model_name)
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
model_id = f"{your_username}/{model_name_slug}"
|
165 |
else:
|
166 |
model_id = f"sd-dreambooth-library/{model_name_slug}"
|
|
|
158 |
from huggingface_hub import HfApi, HfFolder, CommitOperationAdd
|
159 |
from huggingface_hub import create_repo
|
160 |
model_name_slug = slugify(model_name)
|
161 |
+
api = HfApi()
|
162 |
+
your_username = api.whoami(token=hf_token)["name"]
|
163 |
+
if(where_to_upload == "My personal profile"):
|
164 |
model_id = f"{your_username}/{model_name_slug}"
|
165 |
else:
|
166 |
model_id = f"sd-dreambooth-library/{model_name_slug}"
|