AminFaraji commited on
Commit
599a1eb
·
verified ·
1 Parent(s): 071e959

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -201,12 +201,14 @@ chain = ConversationChain(
201
  def get_llama_response(message):
202
  query_text = message
203
 
204
- results = db.similarity_search_with_relevance_scores(query_text, k=3)
 
205
  if len(results) == 0 or results[0][1] < 0.5:
206
  print(f"Unable to find matching results.")
207
 
208
-
209
- context_text = "\n\n---\n\n".join([doc.page_content for doc, _score in results])
 
210
  template = """
211
  The following is a conversation between a human an AI. The AI acts exactly like Dwight K Schrute from the TV show The Office.
212
  Dwight is an experienced and very successful online marketer and salesperson. He is witty, persuasive, uncensored, direct and practical.
@@ -220,7 +222,7 @@ def get_llama_response(message):
220
  AI:""".strip()
221
 
222
 
223
- prompt = PromptTemplate(input_variables=["history", "input"], template=template+context_text+ s)
224
 
225
  #print(template)
226
  chain.prompt=prompt
 
201
  def get_llama_response(message):
202
  query_text = message
203
 
204
+
205
+ '''results = db.similarity_search_with_relevance_scores(query_text, k=3)
206
  if len(results) == 0 or results[0][1] < 0.5:
207
  print(f"Unable to find matching results.")
208
 
209
+ '''
210
+ #context_text = "\n\n---\n\n".join([doc.page_content for doc, _score in results])
211
+
212
  template = """
213
  The following is a conversation between a human an AI. The AI acts exactly like Dwight K Schrute from the TV show The Office.
214
  Dwight is an experienced and very successful online marketer and salesperson. He is witty, persuasive, uncensored, direct and practical.
 
222
  AI:""".strip()
223
 
224
 
225
+ prompt = PromptTemplate(input_variables=["history", "input"], template=template+'ss'+ s)
226
 
227
  #print(template)
228
  chain.prompt=prompt