debisoft commited on
Commit
6ef1acd
·
1 Parent(s): 0ea5676
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -167,8 +167,9 @@ def greet(input):
167
  #response2 = transform2(transform(np.moveaxis(samples.detach().cpu().numpy(),1,3)[1]))
168
  #response = im.fromarray(intermediate[24][0][1]).convert("RGB")
169
  response = transform2(transform(np.moveaxis(intermediate,2,4)[0][0]))
170
- response2 = transform2(transform(np.moveaxis(intermediate,2,4)[24][0]))
171
- return response, response2
 
172
 
173
  transform2 = transforms.ToPILImage()
174
 
@@ -176,6 +177,6 @@ transform2 = transforms.ToPILImage()
176
  #iface.launch()
177
 
178
  #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"])
179
- 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="Output2 Image")])
180
  #iface = gr.Interface(fn=greet, inputs=[gr.Textbox(label="Co-Retailing Business")], outputs=[gr.Textbox()])
181
  iface.launch()
 
167
  #response2 = transform2(transform(np.moveaxis(samples.detach().cpu().numpy(),1,3)[1]))
168
  #response = im.fromarray(intermediate[24][0][1]).convert("RGB")
169
  response = transform2(transform(np.moveaxis(intermediate,2,4)[0][0]))
170
+ response2 = transform2(transform(np.moveaxis(intermediate,2,4)[12][0]))
171
+ response3 = transform2(transform(np.moveaxis(intermediate,2,4)[24][0]))
172
+ return response, response2, response3
173
 
174
  transform2 = transforms.ToPILImage()
175
 
 
177
  #iface.launch()
178
 
179
  #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"])
180
+ iface = gr.Interface(fn=greet, inputs=[gr.Textbox(label="Co-Retailing Business")], outputs=[gr.outputs.Image(type="pil", width=64, label="Output Image"), gr.outputs.Image(type="pil", width=64, label="Output Image2"), gr.outputs.Image(type="pil", width=64, label="Output2 Image3")])
181
  #iface = gr.Interface(fn=greet, inputs=[gr.Textbox(label="Co-Retailing Business")], outputs=[gr.Textbox()])
182
  iface.launch()