biranchi125 commited on
Commit
c7cc4b1
1 Parent(s): bec3ade

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -7,7 +7,10 @@ def greet(name):
7
  return "Hello " + name + "!!"
8
 
9
  def gen_text(text):
10
- return pipeline(text)[0]
 
 
 
11
 
12
  iface = gr.Interface(fn=gen_text, inputs="text", outputs="text")
13
  iface.launch()
 
7
  return "Hello " + name + "!!"
8
 
9
  def gen_text(text):
10
+ if len(text) > 0:
11
+ return pipeline(text)[0]
12
+ else:
13
+ return "Enter text"
14
 
15
  iface = gr.Interface(fn=gen_text, inputs="text", outputs="text")
16
  iface.launch()