awacke1 commited on
Commit
946910d
·
1 Parent(s): 9e6abff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -12,6 +12,11 @@ OPENAI_API_KEY= os.environ["HF_TOKEN"] # Add a token to this space . Then copy
12
  # Keys for Open AI ChatGPT API usage are created from here: https://platform.openai.com/account/api-keys
13
 
14
 
 
 
 
 
 
15
  def get_wiki_summary(search):
16
  wiki_wiki = wikipediaapi.Wikipedia('en')
17
  page = wiki_wiki.page(search)
@@ -57,6 +62,8 @@ def get_wiki_summary(search):
57
 
58
  return df
59
 
 
 
60
  def predict(inputs, top_p, temperature, chat_counter, chatbot=[], history=[]): #repetition_penalty, top_k
61
 
62
  # 1. Set up a payload
 
12
  # Keys for Open AI ChatGPT API usage are created from here: https://platform.openai.com/account/api-keys
13
 
14
 
15
+ #Wikipedia API:
16
+
17
+ def get_pagetext(page):
18
+ s=str(page).replace("/t","")
19
+
20
  def get_wiki_summary(search):
21
  wiki_wiki = wikipediaapi.Wikipedia('en')
22
  page = wiki_wiki.page(search)
 
62
 
63
  return df
64
 
65
+ # ChatGPT
66
+
67
  def predict(inputs, top_p, temperature, chat_counter, chatbot=[], history=[]): #repetition_penalty, top_k
68
 
69
  # 1. Set up a payload