Spaces:
Runtime error
Runtime error
temp-9384289
commited on
Commit
·
42b1be9
1
Parent(s):
3aaf803
tweaks
Browse files
app.py
CHANGED
@@ -78,7 +78,7 @@ def getModel(model):
|
|
78 |
if 'diffusion' in model_id:
|
79 |
pipe = DiffusionPipeline.from_pretrained(model_id)
|
80 |
pipe = pipe.to("cpu")
|
81 |
-
image = pipe(generator= torch.manual_seed(42), num_inference_steps=
|
82 |
else:
|
83 |
pipe = DiffusionPipeline.from_pretrained('nathanReitinger/MNIST-diffusion')
|
84 |
pipe = pipe.to("cpu")
|
@@ -186,9 +186,9 @@ def getModel(model):
|
|
186 |
|
187 |
|
188 |
############################################ return image that you just generated
|
189 |
-
return
|
190 |
|
191 |
|
192 |
import gradio as gr
|
193 |
-
interface = gr.Interface(fn=getModel, inputs=[gr.Dropdown(modellist)], css="#output_image{width: 256px !important; height: 256px !important;}", outputs="image", title='Model Problems (infringement)')
|
194 |
interface.launch()
|
|
|
78 |
if 'diffusion' in model_id:
|
79 |
pipe = DiffusionPipeline.from_pretrained(model_id)
|
80 |
pipe = pipe.to("cpu")
|
81 |
+
image = pipe(generator= torch.manual_seed(42), num_inference_steps=1).images[0]
|
82 |
else:
|
83 |
pipe = DiffusionPipeline.from_pretrained('nathanReitinger/MNIST-diffusion')
|
84 |
pipe = pipe.to("cpu")
|
|
|
186 |
|
187 |
|
188 |
############################################ return image that you just generated
|
189 |
+
return [image, lowest_image]
|
190 |
|
191 |
|
192 |
import gradio as gr
|
193 |
+
interface = gr.Interface(fn=getModel, inputs=[gr.Dropdown(modellist)], css="#output_image{width: 256px !important; height: 256px !important;}", outputs=gr.outputs.Carousel("image"), title='Model Problems (infringement)') # outputs="image",
|
194 |
interface.launch()
|