manu commited on
Commit
366615a
β€’
1 Parent(s): 4872383

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -14,13 +14,14 @@ def set_default_passage():
14
  return sum
15
 
16
  def update_passage(passage_name):
17
- try:
18
-
19
- sum = wikipedia.summary(wikipedia.search(passage_name)[0], sentences=2, auto_suggest=False)
 
20
  # print(sum, wikipedia.search(passage_name))
21
- passage.value = sum
22
- except:
23
- sum = "Please specify your article theme differently"
24
 
25
  return sum, "", gr.update(visible=False), gr.update(visible=False), gr.update(visible=False)
26
 
 
14
  return sum
15
 
16
  def update_passage(passage_name):
17
+ sum = "Please specify your article theme differently"
18
+ if passage_name :
19
+ try:
20
+ sum = wikipedia.summary(wikipedia.search(passage_name)[0], sentences=2, auto_suggest=False)
21
  # print(sum, wikipedia.search(passage_name))
22
+ passage.value = sum
23
+ except:
24
+ sum = "Please specify your article theme differently"
25
 
26
  return sum, "", gr.update(visible=False), gr.update(visible=False), gr.update(visible=False)
27