Git Product home page Git Product logo

chat2anything's Introduction

Chat2Anything

| github |

Chat2Anything是面向企业内部环境的大模型(LLM)知识库问答系统,它具备以下功能:

  • 包含客户端(Chat2Anything)与后台管理系统(Chat2Anything Admin),其中后台管理系统负责大模型知识库的创建与管理,用户可通过上传Excel、Word、PDF等文件向大模型添加企业内部知识(Langchain机制);管理系统包含完整的用户权限、角色、组织、数据字典管理等功能

  • 支持ChatGPT、ChatGLM、Vicuna等主流大模型,用户可随时切换大模型;当使用ChatGLM、Vicuna时,整套系统可实现完全私域部署,企业数据100%内部流转

  • 支持业务系统数据库接入,手动/自动选择查询分析涉及的表,根据用户问题描述Text2SQL(待完善),查询结果自动执行并可视化(待开发)


部署

Chat2Anything (客户端)

  1. 本地配置ChatGLM (https://github.com/THUDM/ChatGLM-6B) / Vicuna (https://github.com/lm-sys/FastChat) 等大模型,如使用ChatGPT,在Chat2Anything/configs/openai_config.py文件中配置OPENAI_API_KEY和OPENAI_API_BASE

  2. 运行controller:

    python3 -m fastchat.serve.controller
  3. 运行model_worker (ChatGLM-6B, 推荐ChatGLM2-6B (https://github.com/THUDM/ChatGLM2-6B)):

    python3 -m fastchat.serve.model_worker_chatglm --model-path /path/to/model/weights

    or

    运行model_worker (vicuna):

    python3 -m fastchat.serve.model_worker --model-path /path/to/model/weights
  4. 运行client web server

    python3 -m fastchat.serve.chat2anything_web_server

    如使用ChatGPT, 添加启动参数 --add-chatgpt

  5. 基本测试环境

    Ubuntu 20.04 CUDA 11.7 Python 3.9 PyTorch 1.13
    Tesla V100 32GB * 1

Chat2Anything Admin (后台管理端)

  1. 数据库(MySQL)配置:

    # MySql配置信息
      MYSQL_HOST=数据库地址
      MYSQL_PORT=数据库端口
      MYSQL_DATABASE=chat2anything_db
      MYSQL_USERNAME=账户
      MYSQL_PASSWORD=密码
      
    # 密钥配置
      SECRET_KEY='一定要改'
  2. 模型相关配置:

    # model_config.py
      embedding_model_dict = {
      'text2vec": "/Path/to/text2vec-large-chinese',
     }
      
    # 密钥配置
      VECTOR_ROOT_PATH = os.path.join('/Path/to/Chat2Anything', 'vector_stores')
  3. 数据库初始化:

      flask db init
      flask db migrate
      flask db upgrade
      flask admin init
  4. 运行:

      # Windows
      run.bat
    
      # Linux
      chmod +x run.sh
      ./run.sh
    
      # 管理员默写账户密码
      admin 123456

相关项目

Appreciate the following contributions:

chat2anything's People

Contributors

demogit4liang avatar

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.