Browse Source

模型更新

gushoubang 6 months ago
parent
commit
21653a6b6c
4 changed files with 6 additions and 4 deletions
  1. BIN
      __pycache__/query.cpython-310.pyc
  2. 5 3
      app.py
  3. BIN
      chroma/16bd6e0f-28e4-4954-b30b-5f7d995bee54/length.bin
  4. 1 1
      query.py

BIN
__pycache__/query.cpython-310.pyc


+ 5 - 3
app.py

@@ -280,7 +280,7 @@ def update_chat_history(user_message):
 
     # 生成回复,并加入聊天上下文
     res = ollama.generate(
-        model="qwen2:7b",
+        model="qwen2.5:7b",
         stream=False,
         system=sys_xuanzhi,
         prompt=prompt,
@@ -304,7 +304,7 @@ def update_chat_history_simple(user_message):
 
     # 生成回复,并加入聊天上下文
     res = ollama.generate(
-        model="qwen2:7b",
+        model="qwen2.5:7b",
         stream=False,
         system=sys_question,
         prompt=prompt,
@@ -384,7 +384,9 @@ def inputMsg():
             json_res = jsonResToDict_wrong(json_res)
     elif type == 'answer':
         # json_res = route_query(msg)
-        # json_res = chain.invoke(msg)
+        # json_res = jsonResToDict_questions(json_res)
+        # print(json_res)  # 打印生成的回复
+
         json_res = update_chat_history_simple(msg)
         json_res = jsonResToDict_questions(json_res)
         print(json_res)  # 打印生成的回复

BIN
chroma/16bd6e0f-28e4-4954-b30b-5f7d995bee54/length.bin


+ 1 - 1
query.py

@@ -12,7 +12,7 @@ LLM_MODEL = os.getenv('LLM_MODEL', 'qwen2:7b')
 def get_prompt():
     QUERY_PROMPT = PromptTemplate(
         input_variables=["question"],
-        template="""你是一名AI语言模型助理。你的任务是生成
+        template="""你是一名AI语言模型助理。你的任务是生成
         从中检索相关文档的给定用户问题的不同版本
         矢量数据库。通过对用户问题生成多个视角
         目标是帮助用户克服基于距离的一些局限性