1. 下载chatchat代码库

chttps://github.com/chatchat-space/Langchain-Chatchat.git

2. 配置保存数据的路径

将如下脚本:

export CHATCHAT_ROOT=/path/to/chatchat_data

改成:

export CHATCHAT_ROOT=/你自己的路径/chatchat_data

如:

3. 生成配置文件

    

4. 用ollama拉取相应的模型

语言模型:

ollama run qwen:1.8b

向量模型:

ollama pull quentinz/bge-base-zh-v1.5

获得如下模型:

(base) [Langchain-Chatchat]$ ollama list
NAME                                    ID              SIZE    MODIFIED          
quentinz/bge-base-zh-v1.5:latest        cd232613fa6f    204 MB  About an hour ago
qwen:1.8b                               b6e8ec2e7126    1.1 GB  25 hours ago 

5. 修改配置文件

# 默认选用的 LLM 名称
DEFAULT_LLM_MODEL: qwen:1.8b

# 默认选用的 Embedding 名称
DEFAULT_EMBEDDING_MODEL: quentinz/bge-base-zh-v1.5:latest 
MODEL_PLATFORMS:
  # - platform_name: xinference
  #   platform_type: xinference
  #   api_base_url: http://127.0.0.1:9997/v1
  #   api_key: EMPTY
  #   api_proxy: ''
  #   api_concurrencies: 5
  #   auto_detect_model: true
  #   llm_models: []
  #   embed_models: []
  #   text2image_models: []
  #   image2text_models: []
  #   rerank_models: []
  #   speech2text_models: []
  #   text2speech_models: []
  - platform_name: ollama
    platform_type: ollama
    api_base_url: http://127.0.0.1:11434/v1
    api_key: EMPTY
    api_proxy: ''
    api_concurrencies: 5
    auto_detect_model: false
    llm_models:
      - qwen:1.8b
    embed_models:
      - quentinz/bge-base-zh-v1.5:latest 
    text2image_models: []
    image2text_models: []
    rerank_models: []
    speech2text_models: []
    text2speech_models: []
  # - platform_name: oneapi
  #   platform_type: oneapi
  #   api_base_url: http://127.0.0.1:3000/v1

将其他平台的配置注释掉,仅保留ollama配置

6. 初始化知识库与项目启动

chatchat kb -r
chatchat start -a

这里localhost也可以换成你linux服务器的ip

7. 参考文章

https://github.com/chatchat-space/Langchain-Chatchat/issues/4417

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐