ysharma HF staff commited on
Commit
dc6aef0
·
1 Parent(s): e7a2048
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -23,20 +23,21 @@ def engine(text_input):
23
  print(type(img[1]))
24
  print(len(img[1]))
25
  print(type(img[1][0][0]))
26
- print(img[1])
27
  #img = img[0]
28
  #inputs=['George',50,256,256,1,10]
29
  #run(prompt, steps, width, height, images, scale)
30
 
31
  #speech = text2speech(text_input)
32
- return img[1][0][0] #entities, speech, img
33
 
 
34
  app = gr.Interface(fn=engine,
35
  inputs=gr.inputs.Textbox(lines=5, label="Input Text"),
36
  #live=True,
37
  description="Takes a text as input and reads it out to you.",
38
  #outputs=[#gr.outputs.Textbox(type="auto", label="Text"),gr.outputs.Audio(type="file", label="Speech Answer"),
39
- outputs= gr.outputs.Image(type="pil", label="output image"), #, gr.outputs.Carousel(label="Individual images",components=["image"]), gr.outputs.Textbox(label="Error")],
40
  examples = ['Apple']
41
  #examples=["On April 17th Sunday George celebrated Easter. He is staying at Empire State building with his parents. He is a citizen of Canada and speaks English and French fluently. His role model is former president Obama. He got 1000 dollar from his mother to visit Disney World and to buy new iPhone mobile. George likes watching Game of Thrones."]
42
  ).launch(debug=True) #(enable_queue=True)
 
23
  print(type(img[1]))
24
  print(len(img[1]))
25
  print(type(img[1][0][0]))
26
+ #print(img[1])
27
  #img = img[0]
28
  #inputs=['George',50,256,256,1,10]
29
  #run(prompt, steps, width, height, images, scale)
30
 
31
  #speech = text2speech(text_input)
32
+ return img[0] #entities, speech, img
33
 
34
+ image = gr.outputs.Image(type="pil", label="output image")
35
  app = gr.Interface(fn=engine,
36
  inputs=gr.inputs.Textbox(lines=5, label="Input Text"),
37
  #live=True,
38
  description="Takes a text as input and reads it out to you.",
39
  #outputs=[#gr.outputs.Textbox(type="auto", label="Text"),gr.outputs.Audio(type="file", label="Speech Answer"),
40
+ outputs= image, #, gr.outputs.Carousel(label="Individual images",components=["image"]), gr.outputs.Textbox(label="Error")],
41
  examples = ['Apple']
42
  #examples=["On April 17th Sunday George celebrated Easter. He is staying at Empire State building with his parents. He is a citizen of Canada and speaks English and French fluently. His role model is former president Obama. He got 1000 dollar from his mother to visit Disney World and to buy new iPhone mobile. George likes watching Game of Thrones."]
43
  ).launch(debug=True) #(enable_queue=True)