AminFaraji commited on
Commit
f2e11f5
·
verified ·
1 Parent(s): 177e2bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -89,25 +89,25 @@ def get_llama_response(message: str, history: list) -> str:
89
  context_text = "\n\n---\n\n".join([doc.page_content for doc, _score in results])
90
 
91
 
92
-
93
 
94
  template = """
95
- فقط بر اساس محتوای داده شده، به سوال مطرح شده جواب بده. جواب باید به زبان فارسی باشه. اگه سوال مطرح شده خارج از محتوای داده شده هست، بگو که من فقط به سوالات مرتبط با تحصیلات تکمیلی جواب میدم
96
  محتوا:
97
  {history}
98
-
99
  """
100
  s="""
101
  \n سوال: {input}
102
 
103
  \n جواب:""".strip()
104
  prompt = PromptTemplate(input_variables=["history", "input"], template=template+context_text+'\n'+s)
 
105
 
106
  #print(template)
107
  chain.prompt=prompt
108
  res = chain.predict(input=query_text)
109
  return res
110
- #return response.strip()
111
 
112
 
113
 
 
89
  context_text = "\n\n---\n\n".join([doc.page_content for doc, _score in results])
90
 
91
 
92
+
93
 
94
  template = """
95
+ فقط بر اساس محتوای داده شده، به سوال مطرح شده جواب بده. جواب باید به زبان فارسی باشه. اگه سوال مطرح شده خارج از محتوای داده شده هست، بگو که من فقط به سوالات مرتبط با تحصبلات تکمیلی جواب میدم
96
  محتوا:
97
  {history}
98
+
99
  """
100
  s="""
101
  \n سوال: {input}
102
 
103
  \n جواب:""".strip()
104
  prompt = PromptTemplate(input_variables=["history", "input"], template=template+context_text+'\n'+s)
105
+
106
 
107
  #print(template)
108
  chain.prompt=prompt
109
  res = chain.predict(input=query_text)
110
  return res
 
111
 
112
 
113