debisoft commited on
Commit
0f852e5
·
1 Parent(s): 9779c21
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -164,7 +164,8 @@ def sample_ddim(n_sample, n=20):
164
  def greet(input):
165
  samples, intermediate = sample_ddim(32, n=1)
166
  response = transform2(transform(np.moveaxis(samples.detach().cpu().numpy(),1,3)[-1]))
167
- return response
 
168
 
169
  transform2 = transforms.ToPILImage()
170
 
@@ -172,6 +173,6 @@ transform2 = transforms.ToPILImage()
172
  #iface.launch()
173
 
174
  #iface = gr.Interface(fn=greet, inputs=[gr.Textbox(label="Text to find entities", lines=2)], outputs=[gr.HighlightedText(label="Text with entities")], title="NER with dslim/bert-base-NER", description="Find entities using the `dslim/bert-base-NER` model under the hood!", allow_flagging="never", examples=["My name is Andrew and I live in California", "My name is Poli and work at HuggingFace"])
175
- iface = gr.Interface(fn=greet, inputs=[gr.Textbox(label="Co-Retailing Business")], outputs=gr.outputs.Image(type="pil", label="Output Image"))
176
  #iface = gr.Interface(fn=greet, inputs=[gr.Textbox(label="Co-Retailing Business")], outputs=[gr.Textbox()])
177
  iface.launch()
 
164
  def greet(input):
165
  samples, intermediate = sample_ddim(32, n=1)
166
  response = transform2(transform(np.moveaxis(samples.detach().cpu().numpy(),1,3)[-1]))
167
+ response2 = transform2(transform(np.moveaxis(samples.detach().cpu().numpy(),1,3)[1]))
168
+ return response, response2
169
 
170
  transform2 = transforms.ToPILImage()
171
 
 
173
  #iface.launch()
174
 
175
  #iface = gr.Interface(fn=greet, inputs=[gr.Textbox(label="Text to find entities", lines=2)], outputs=[gr.HighlightedText(label="Text with entities")], title="NER with dslim/bert-base-NER", description="Find entities using the `dslim/bert-base-NER` model under the hood!", allow_flagging="never", examples=["My name is Andrew and I live in California", "My name is Poli and work at HuggingFace"])
176
+ iface = gr.Interface(fn=greet, inputs=[gr.Textbox(label="Co-Retailing Business")], outputs=[gr.outputs.Image(type="pil", label="Output Image"), gr.outputs.Image(type="pil", label="Output Image2"))]
177
  #iface = gr.Interface(fn=greet, inputs=[gr.Textbox(label="Co-Retailing Business")], outputs=[gr.Textbox()])
178
  iface.launch()