Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -83,7 +83,6 @@ def extract_info(json_data):
|
|
83 |
"SD 2.0 768": "stabilityai/stable-diffusion-2"
|
84 |
}
|
85 |
base_model = model_mapping[model_version["baseModel"]]
|
86 |
-
print(json_data)
|
87 |
info = {
|
88 |
"urls_to_download": urls_to_download,
|
89 |
"id": model_version["id"],
|
@@ -329,19 +328,20 @@ def list_civit_models(username):
|
|
329 |
def upload_civit_to_hf(profile: Optional[gr.OAuthProfile], oauth_token: gr.OAuthToken, url, link_civit=False):
|
330 |
if not profile.name:
|
331 |
return gr.Error("Are you sure you are logged in?")
|
|
|
|
|
332 |
|
333 |
folder = str(uuid.uuid4())
|
334 |
os.makedirs(folder, exist_ok=False)
|
335 |
info, downloaded_files = process_url(url, profile, folder=folder)
|
336 |
-
|
337 |
username = {profile.username}
|
338 |
slug_name = slugify(info["name"])
|
339 |
user_repo_id = f"{profile.username}/{slug_name}"
|
340 |
create_readme(info, downloaded_files, user_repo_id, link_civit, folder=folder)
|
341 |
try:
|
342 |
-
|
343 |
create_repo(repo_id=user_repo_id, private=True, exist_ok=True, token=oauth_token.token)
|
344 |
-
|
345 |
upload_folder(
|
346 |
folder_path=folder,
|
347 |
repo_id=user_repo_id,
|
|
|
83 |
"SD 2.0 768": "stabilityai/stable-diffusion-2"
|
84 |
}
|
85 |
base_model = model_mapping[model_version["baseModel"]]
|
|
|
86 |
info = {
|
87 |
"urls_to_download": urls_to_download,
|
88 |
"id": model_version["id"],
|
|
|
328 |
def upload_civit_to_hf(profile: Optional[gr.OAuthProfile], oauth_token: gr.OAuthToken, url, link_civit=False):
|
329 |
if not profile.name:
|
330 |
return gr.Error("Are you sure you are logged in?")
|
331 |
+
|
332 |
+
gr.Info(f"Starting uploading {url}")
|
333 |
|
334 |
folder = str(uuid.uuid4())
|
335 |
os.makedirs(folder, exist_ok=False)
|
336 |
info, downloaded_files = process_url(url, profile, folder=folder)
|
337 |
+
gr.Info(f"Model {info['name']} found, starting download...")
|
338 |
username = {profile.username}
|
339 |
slug_name = slugify(info["name"])
|
340 |
user_repo_id = f"{profile.username}/{slug_name}"
|
341 |
create_readme(info, downloaded_files, user_repo_id, link_civit, folder=folder)
|
342 |
try:
|
|
|
343 |
create_repo(repo_id=user_repo_id, private=True, exist_ok=True, token=oauth_token.token)
|
344 |
+
gr.Info("Starting to upload repo to Hugging Face...")
|
345 |
upload_folder(
|
346 |
folder_path=folder,
|
347 |
repo_id=user_repo_id,
|