rairo commited on
Commit
93d8bb2
1 Parent(s): 5511399

Update demo.py

Browse files
Files changed (1) hide show
  1. demo.py +3 -3
demo.py CHANGED
@@ -124,10 +124,10 @@ prompt = PromptTemplate(
124
  template=template
125
  )
126
  chat_history= ""
127
- def answer(user_question):
128
  llm = GooglePalm(temperature=0, google_api_key=os.environ['PALM'])
129
  chain = LLMChain(llm=llm, prompt=prompt)
130
- keywords = chain.run({'user_question':user_question, 'chat_history':chat_history})
131
 
132
  topK=3
133
  #vectorize the query
@@ -152,7 +152,7 @@ def answer(user_question):
152
  )
153
 
154
  #ans2 = llm_chain.predict(full_result_string)
155
- ans = llm_chain.predict(user_msg= f"{full_result_string} ---\n\n {prompt}")
156
 
157
  return ans
158
 
 
124
  template=template
125
  )
126
  chat_history= ""
127
+ def answer(user_input):
128
  llm = GooglePalm(temperature=0, google_api_key=os.environ['PALM'])
129
  chain = LLMChain(llm=llm, prompt=prompt)
130
+ keywords = chain.run({'user_question':user_input, 'chat_history':chat_history})
131
 
132
  topK=3
133
  #vectorize the query
 
152
  )
153
 
154
  #ans2 = llm_chain.predict(full_result_string)
155
+ ans = llm_chain.predict(user_question= f"{full_result_string} ---\n\n {user_input}")
156
 
157
  return ans
158