multimodalart HF staff commited on
Commit
7468c99
1 Parent(s): cd0dc2e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -328,13 +328,11 @@ def list_civit_models(username):
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}"
@@ -419,12 +417,14 @@ By uploading your LoRAs to Hugging Face you get diffusers compatibility, a free
419
  output = gr.Markdown(label="Output progress", visible=False)
420
 
421
  demo.load(fn=swap_fill, outputs=[disabled_area, enabled_area], queue=False)
422
- submit_source_civit.change(fn=check_civit_link, inputs=[submit_source_civit], outputs=[instructions, submit_button_civit, try_again_button, submit_button_civit], queue=False)
423
- civit_username_to_bulk.change(fn=list_civit_models, inputs=[civit_username_to_bulk], outputs=[submit_bulk_civit], queue=False)
424
- try_again_button.click(fn=check_civit_link, inputs=[submit_source_civit], outputs=[instructions, submit_button_civit, try_again_button, submit_button_civit], queue=False)
425
- submit_button_civit.click(fn=show_output, inputs=[], outputs=[output]).then(fn=upload_civit_to_hf, inputs=[submit_source_civit, link_civit], outputs=[output], queue=False)
426
- bulk_button.click(fn=show_output, inputs=[], outputs=[output]).then(fn=bulk_upload, inputs=[submit_bulk_civit, link_civit], outputs=[output], queue=False)
 
 
427
  #gr.LogoutButton(elem_id="logout")
428
 
429
  demo.queue()
430
- demo.launch()
 
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
  folder = str(uuid.uuid4())
333
  os.makedirs(folder, exist_ok=False)
 
334
  gr.Info(f"Model {info['name']} found, starting download...")
335
+ info, downloaded_files = process_url(url, profile, folder=folder)
336
  username = {profile.username}
337
  slug_name = slugify(info["name"])
338
  user_repo_id = f"{profile.username}/{slug_name}"
 
417
  output = gr.Markdown(label="Output progress", visible=False)
418
 
419
  demo.load(fn=swap_fill, outputs=[disabled_area, enabled_area], queue=False)
420
+
421
+ submit_source_civit.change(fn=check_civit_link, inputs=[submit_source_civit], outputs=[instructions, submit_button_civit, try_again_button, submit_button_civit])
422
+ civit_username_to_bulk.change(fn=list_civit_models, inputs=[civit_username_to_bulk], outputs=[submit_bulk_civit])
423
+ try_again_button.click(fn=check_civit_link, inputs=[submit_source_civit], outputs=[instructions, submit_button_civit, try_again_button, submit_button_civit])
424
+
425
+ submit_button_civit.click(fn=show_output, inputs=[], outputs=[output]).then(fn=upload_civit_to_hf, inputs=[submit_source_civit, link_civit], outputs=[output])
426
+ bulk_button.click(fn=show_output, inputs=[], outputs=[output]).then(fn=bulk_upload, inputs=[submit_bulk_civit, link_civit], outputs=[output])
427
  #gr.LogoutButton(elem_id="logout")
428
 
429
  demo.queue()
430
+ demo.launch(concurrency_limit=50)