The-Best-Codes commited on
Commit
f9871b8
1 Parent(s): 532a147

Fix methods

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -12,16 +12,18 @@ def generate_shap_e_gif(prompt, progress=gr.Progress()):
12
  progress(0, desc="Starting...")
13
  images = []
14
 
15
- for i in progress.tqdm(range(num_inference_steps), desc="Generating GIF"):
16
  image = pipe(prompt, guidance_scale=guidance_scale, num_inference_steps=1).images[0]
17
  images.append(image)
18
- progress(i+1, total=num_inference_steps, desc="Processing")
19
-
 
20
  gif_path = export_to_gif(images, f"{prompt}_3d.gif")
 
21
  progress(1, desc="Completed")
22
  return gif_path
23
 
24
- # Create the Gradio interface
25
  demo = gr.Interface(
26
  fn=generate_shap_e_gif,
27
  inputs=gr.Textbox(lines=2, placeholder="Enter a prompt"),
 
12
  progress(0, desc="Starting...")
13
  images = []
14
 
15
+ for i in range(num_inference_steps):
16
  image = pipe(prompt, guidance_scale=guidance_scale, num_inference_steps=1).images[0]
17
  images.append(image)
18
+ # Update the progress tracker
19
+ progress((i+1)/num_inference_steps)
20
+
21
  gif_path = export_to_gif(images, f"{prompt}_3d.gif")
22
+ # Ensure the progress is set to complete
23
  progress(1, desc="Completed")
24
  return gif_path
25
 
26
+ # Create the Gradio interface with queue enabled
27
  demo = gr.Interface(
28
  fn=generate_shap_e_gif,
29
  inputs=gr.Textbox(lines=2, placeholder="Enter a prompt"),