EricGEGE commited on
Commit
b7608d5
·
verified ·
1 Parent(s): 83beb09

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -37,7 +37,7 @@ def savevectorstore():
37
  np.save('embeddings.npy', embedding_arr)
38
  # savevectorstore()
39
  # load embed vectors
40
- def rag_chain(question):
41
  embedding_arr = np.load('embeddings.npy')
42
  # print(embedding_arr.shape)
43
 
@@ -80,7 +80,7 @@ def rag_chain(question):
80
  # print(ans2)
81
  # with open('questions.txt', 'a',encoding='utf-8') as file:
82
  # file.write(f"\n\n{question}\n\n{country}\n\n{whatsapp}\n\n{name}||{sales}||{profit}||{product}")
83
- message = f"\n\n{question}\n\n{ans}"
84
  asyncio.run(send_telegram_message(token, chat_id, message))
85
  return que,ans
86
  # rag_chain('I am very hungry.')
@@ -89,7 +89,7 @@ desc = "This is an awesome ML App. I'm really excited to show you"
89
  long_desc = "如果我没有回答你的问题,把问题发给Eric吧。"
90
  search_interface = gr.Interface(
91
  fn=rag_chain,
92
- inputs=[gr.Textbox(label="Question")],
93
  outputs=[gr.Markdown(label="Most relevant question"),gr.Markdown(label="Answer ideas")],
94
  title="Ask Eric",
95
  description="Hi,我是数字分身,欢迎提问!",
 
37
  np.save('embeddings.npy', embedding_arr)
38
  # savevectorstore()
39
  # load embed vectors
40
+ def rag_chain(question,name):
41
  embedding_arr = np.load('embeddings.npy')
42
  # print(embedding_arr.shape)
43
 
 
80
  # print(ans2)
81
  # with open('questions.txt', 'a',encoding='utf-8') as file:
82
  # file.write(f"\n\n{question}\n\n{country}\n\n{whatsapp}\n\n{name}||{sales}||{profit}||{product}")
83
+ message = f"{name}\n\n{question}\n\n{ans}"
84
  asyncio.run(send_telegram_message(token, chat_id, message))
85
  return que,ans
86
  # rag_chain('I am very hungry.')
 
89
  long_desc = "如果我没有回答你的问题,把问题发给Eric吧。"
90
  search_interface = gr.Interface(
91
  fn=rag_chain,
92
+ inputs=[gr.Textbox(label="Question"),gr.Textbox(label="Name")],
93
  outputs=[gr.Markdown(label="Most relevant question"),gr.Markdown(label="Answer ideas")],
94
  title="Ask Eric",
95
  description="Hi,我是数字分身,欢迎提问!",