Giter VIP home page Giter VIP logo

chatkbs's Introduction

ChatKBS

完全离线的智能聊天知识库系统(ChatGLM-6B+Milvus)

硬件需求参照:https://github.com/THUDM/ChatGLM-6B#%E7%A1%AC%E4%BB%B6%E9%9C%80%E6%B1%82

1. Install

必须确保全部准备工作完成后才能正常启动该项目

1.1 创建python环境

安装Anaconda python: 3.9+ https://www.anaconda.com/download/

配置Anaconda镜像(如果网络没问题也可以不配置)https://mirror.tuna.tsinghua.edu.cn/help/anaconda/

创建虚拟环境

# 使用anaconda虚拟环境
conda create -n chatkbs python=3.9
conda activate chatkbs

# 或者使用venv虚拟环境
python -m venv myenv
# - 在windows上
venv\Scripts\activate
# - 在macOS/Linux上
source venv/bin/activate

pip install -r requirements.txt

# 如果是macos
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
# 如果是windows/Linux
pip install torch

1.2 下载ChatGLM-6B模型

请按照https://github.com/THUDM/ChatGLM-6B#%E4%BB%8E%E6%9C%AC%E5%9C%B0%E5%8A%A0%E8%BD%BD%E6%A8%A1%E5%9E%8B 的步骤手动下载全部文件,放到THUDM/chatglm-6b目录下

1.3 安装Docker并启动milvus

请从官网安装Docker:https://docs.docker.com/get-docker/

安装完Docker后启动milvus

sudo docker compose up -d

1.4 运行

python main.py

# 如需指定使用第n个cuda
python main.py --cuda=1

# 获取命令行参数帮助
python main.py --help

Milvus运行介绍

Start Milvus In the same directory as the docker-compose.yml file, start up Milvus by running:

sudo docker compose up -d

If your system has Docker Compose V2 installed instead of V1, use docker compose instead of docker-compose. Check if this is the case with $ docker compose version. Read here for more information. Creating milvus-etcd ... done Creating milvus-minio ... done Creating milvus-standalone ... done

Now check if the containers are up and running.

$ sudo docker-compose ps

After Milvus standalone starts, there will be three docker containers running, including the Milvus standalone service and its two dependencies.

      Name                     Command                  State                            Ports
--------------------------------------------------------------------------------------------------------------------
milvus-etcd         etcd -advertise-client-url ...   Up             2379/tcp, 2380/tcp
milvus-minio        /usr/bin/docker-entrypoint ...   Up (healthy)   9000/tcp
milvus-standalone   /tini -- milvus run standalone   Up             0.0.0.0:19530->19530/tcp, 0.0.0.0:9091->9091/tcp

Stop Milvus To stop Milvus standalone, run:

sudo docker compose down

To delete data after stopping Milvus, run:

sudo rm -rf  volumes

chatkbs's People

Contributors

jayscoder avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

chatkbs's Issues

[Feature Request] Support InternLM

Dear chatkbs developer,

我是 InternLM 社区开发者&志愿者尖米, 大佬开源的工作对我的启发很大,希望可以探讨使用 InternLM 实现 chatkbs 的可能性和实现路径,我的微信是 mzm312,希望可以取得联系进行更深度的交流;

Best regards,
尖米

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.