Commit
·
e33603e
1
Parent(s):
8f3777c
Add civitai-to-hf-uploader
Browse files
app.py
CHANGED
@@ -93,7 +93,7 @@ def process_url(url, profile, user_repo_id, oauth_token, folder):
|
|
93 |
folder_path=os.path.join(folder, os.path.dirname(dl_path)),
|
94 |
repo_id=user_repo_id,
|
95 |
repo_type="model",
|
96 |
-
|
97 |
token=oauth_token
|
98 |
)
|
99 |
downloaded_files[dl_path] = download_url
|
@@ -149,7 +149,7 @@ def upload_civit_to_hf(profile: Optional[gr.OAuthProfile], oauth_token: gr.OAuth
|
|
149 |
gr.Info(f"Repository {user_repo_id} already exists, will update it")
|
150 |
update_repo_visibility(repo_id=user_repo_id, private=False, token=oauth_token.token)
|
151 |
|
152 |
-
files = process_url(url, profile, user_repo_id, oauth_token, folder)
|
153 |
if not files or len(files.keys()) == 0:
|
154 |
return gr.Error("No files were copied. Something went wrong.")
|
155 |
|
|
|
93 |
folder_path=os.path.join(folder, os.path.dirname(dl_path)),
|
94 |
repo_id=user_repo_id,
|
95 |
repo_type="model",
|
96 |
+
path_in_repo=os.path.dirname(dl_path),
|
97 |
token=oauth_token
|
98 |
)
|
99 |
downloaded_files[dl_path] = download_url
|
|
|
149 |
gr.Info(f"Repository {user_repo_id} already exists, will update it")
|
150 |
update_repo_visibility(repo_id=user_repo_id, private=False, token=oauth_token.token)
|
151 |
|
152 |
+
files = process_url(url, profile, user_repo_id, oauth_token.token, folder)
|
153 |
if not files or len(files.keys()) == 0:
|
154 |
return gr.Error("No files were copied. Something went wrong.")
|
155 |
|