Langchain-Chatchat 0.3.1.1版本+ollama 知识库初始化无响应

ars1skjm  于 2个月前  发布在  其他
关注(0)|答案(4)|浏览(37)

根据您提供的信息,这个问题可能是由于在运行chatchat kb -r时,程序遇到了一些问题。具体来说,这个警告信息表示GuardrailsOutputParserlangchain.output_parsers中被弃用,建议使用langchain_community.output_parsers.rail_parser中的GuardrailsOutputParser替代。

要解决这个问题,您可以尝试以下步骤:

  1. 打开/usr/local/lib/python3.11/site-packages/langchain/_api/module_import.py文件。
  2. 将第87行的代码:
from langchain.output_parsers import GuardrailsOutputParser

替换为:

from langchain_community.output_parsers.rail_parser import GuardrailsOutputParser
  1. 保存文件并重新运行chatchat kb -r

如果问题仍然存在,请检查您的Docker容器是否正常运行,以及是否有足够的资源(如内存和CPU)来执行此操作。此外,您还可以查看Docker容器的日志以获取更多关于错误的详细信息。

dvtswwa3

dvtswwa31#

模型配置文件如下:


# 模型配置项

# 默认选用的 LLM 名称

DEFAULT_LLM_MODEL: qwen2-7b-instruct

# 默认选用的 Embedding 名称

DEFAULT_EMBEDDING_MODEL: bge-large-zh-v1.5

# AgentLM模型的名称 (可以不指定,指定之后就锁定进入Agent之后的Chain的模型,不指定就是 DEFAULT_LLM_MODEL)

Agent_MODEL: ''

# 默认历史对话轮数

HISTORY_LEN: 3

# 大模型最长支持的长度,如果不填写,则使用模型默认的最大长度,如果填写,则为用户设定的最大长度

MAX_TOKENS:

# LLM通用对话参数

TEMPERATURE: 0.7

# 支持的Agent模型

SUPPORT_AGENT_MODELS:

* chatglm3-6b
* glm-4
* openai-api
* Qwen-2
* qwen2-instruct
* gpt-3.5-turbo
* gpt-4o

# LLM模型配置,包括了不同模态初始化参数。

# `model`  如果留空则自动使用 DEFAULT_LLM_MODEL

LLM_MODEL_CONFIG:
preprocess_model:
model: 'qwen2-7b-instruct'
temperature: 0.05
max_tokens: 4096
history_len: 10
prompt_name: default
callbacks: false
llm_model:
model: 'qwen2-7b-instruct'
temperature: 0.9
max_tokens: 4096
history_len: 10
prompt_name: default
callbacks: true
action_model:
model: 'qwen2-7b-instruct'
temperature: 0.01
max_tokens: 4096
history_len: 10
prompt_name: qwen
callbacks: true
postprocess_model:
model: 'qwen2-7b-instruct'
temperature: 0.01
max_tokens: 4096
history_len: 10
prompt_name: default
callbacks: true
image_model:
model: sd-turbo
size: 256*256
MODEL_PLATFORMS:

* platform_name: ollama

platform_type: ollama
api_base_url:  [http://172.17.0.1:8000/v1](http://172.17.0.1:8000/v1) 
api_key: EMPTY
api_proxy: ''
api_concurrencies: 5
auto_detect_model: false
llm_models:

* qwen2-7b-instruct

embed_models:

* bge-large-zh-v1.5

text2image_models: []
image2text_models: []
rerank_models: []
speech2text_models: []
text2speech_models: []
basic_settings.yaml和kb_settings.yaml没动
pdtvr36n

pdtvr36n2#

ollama配置如下
root@86ee9f449bc5:/# ollama list
NAME ID SIZE MODIFIED
bge-large-zh-v1.5:latest bc8ca0995fcd 651 MB 26 hours ago
qwen2-7b-instruct:latest 3f5a2ad726c9 8.1 GB 3 days ago
目前用chatchat的聊天功能正常,但是一涉及到知识库的操作就无响应。

egdjgwm8

egdjgwm83#

请检查 Embedding 模型是否已正确配置并启动。

oxf4rvwz

oxf4rvwz4#

我也有点怀疑是Embedding模型这边的问题,不知道ollma下应该如何配置Embedding模型?
我看网上说Embedding是不能用ollma run来直接跑的,因此就保持只是pull下来的那个状态,用ollma run跑的是qwen2的那个模型。

相关问题