uripper commited on
Commit
195f198
1 Parent(s): 88a9b91

should fix issues with not loading, got rid of cuda calls and changed how it generates

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -21,7 +21,10 @@ def generate_img():
21
  filename = ran_word_1 + "_" + ran_num + "_" + ran_word_2 + "_" + ran_num2 + "_" + ran_word_3
22
 
23
 
24
- pipeline.to("cuda")
 
 
 
25
  images= pipeline().images
26
  im = images[0]
27
  im.save(f"GIANNIS\stored_images\{filename}.png")
@@ -36,8 +39,8 @@ def show_random_image(num_imgs = num_imgs, imgs = imgs):
36
  # generate_img()
37
  # When a user clicks button, pipeline will generate an image
38
 
39
- iface = gr.Interface(fn=show_random_image, inputs=[], outputs="image")
40
 
41
- # iface = gr.Interface(fn=generate_img, inputs=[], outputs="image")
42
 
43
  iface.launch()
 
21
  filename = ran_word_1 + "_" + ran_num + "_" + ran_word_2 + "_" + ran_num2 + "_" + ran_word_3
22
 
23
 
24
+ try:
25
+ pipeline.to("cuda")
26
+ except:
27
+ pass
28
  images= pipeline().images
29
  im = images[0]
30
  im.save(f"GIANNIS\stored_images\{filename}.png")
 
39
  # generate_img()
40
  # When a user clicks button, pipeline will generate an image
41
 
42
+ # iface = gr.Interface(fn=show_random_image, inputs=[], outputs="image")
43
 
44
+ iface = gr.Interface(fn=generate_img, inputs=[], outputs="image")
45
 
46
  iface.launch()