erwold commited on
Commit
7ef91cf
·
1 Parent(s): 8e99946

Initial Commit

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -364,15 +364,14 @@ with gr.Blocks(
364
  # Set up the generation function
365
  def generate_with_error_handling(*args):
366
  try:
367
- with gr.Status() as status:
368
- status.update(value="Loading models...", visible=True)
369
- results = interface.generate(*args)
370
- status.update(value="Generation complete!", visible=False)
371
- return [results, None]
372
  except Exception as e:
373
  error_msg = str(e)
374
  print(f"Error in generate_with_error_handling: {error_msg}")
375
- return [None, gr.Error(error_msg)]
376
 
377
  submit_btn.click(
378
  fn=generate_with_error_handling,
@@ -389,9 +388,9 @@ with gr.Blocks(
389
  output_gallery,
390
  error_message
391
  ],
392
- show_progress="minimal"
393
  )
394
 
395
  # Launch the app
396
  if __name__ == "__main__":
397
- demo.launch()
 
364
  # Set up the generation function
365
  def generate_with_error_handling(*args):
366
  try:
367
+ gr.Info("Starting image generation...")
368
+ results = interface.generate(*args)
369
+ gr.Info("Generation complete!")
370
+ return [results, None]
 
371
  except Exception as e:
372
  error_msg = str(e)
373
  print(f"Error in generate_with_error_handling: {error_msg}")
374
+ return [None, error_msg]
375
 
376
  submit_btn.click(
377
  fn=generate_with_error_handling,
 
388
  output_gallery,
389
  error_message
390
  ],
391
+ show_progress=True
392
  )
393
 
394
  # Launch the app
395
  if __name__ == "__main__":
396
+ demo.launch(share=True)