awacke1 commited on
Commit
a94a648
·
1 Parent(s): 3df3156

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -18,7 +18,7 @@ OPENAI_API_KEY= os.environ["HF_TOKEN"] # Add a token to this space . Then copy
18
  def get_pagetext(page):
19
  s=str(page).replace("/t","")
20
 
21
- def get_wiki_summary(inputs, search):
22
  wiki_wiki = wikipediaapi.Wikipedia('en')
23
  page = wiki_wiki.page(search)
24
 
@@ -60,8 +60,10 @@ def get_wiki_summary(inputs, search):
60
  }
61
 
62
  df = pd.DataFrame(ex_dic)
63
-
64
- return df
 
 
65
 
66
  # ChatGPT
67
 
@@ -270,8 +272,8 @@ with gr.Blocks(css = """#col_container {width: 1280px; margin-left: auto; margin
270
  appendFile.click(append_file, inputs=[fileName, fileContent], outputs=completedMessage )
271
 
272
  # Wikipedia events
273
- b4.click(get_wiki_summary, [inputs, inp], [out_DF] )
274
- inputs.submit(get_wiki_summary, [inputs, inp], [out_DF])
275
 
276
 
277
  # Chatbot
 
18
  def get_pagetext(page):
19
  s=str(page).replace("/t","")
20
 
21
+ def get_wiki_summary(inputs, search, history=[]):
22
  wiki_wiki = wikipediaapi.Wikipedia('en')
23
  page = wiki_wiki.page(search)
24
 
 
60
  }
61
 
62
  df = pd.DataFrame(ex_dic)
63
+
64
+ yield df, history
65
+
66
+ #return df
67
 
68
  # ChatGPT
69
 
 
272
  appendFile.click(append_file, inputs=[fileName, fileContent], outputs=completedMessage )
273
 
274
  # Wikipedia events
275
+ b4.click(get_wiki_summary, [inputs, inp, state], [out_DF, state] )
276
+ inputs.submit(get_wiki_summary, [inputs, inp, state], [out_DF, state])
277
 
278
 
279
  # Chatbot