Go to file
myml bed03a6ff1 fix: 修复chatglm模型被复制,显存占用过多
model作为类成员会在类实例化时进行一次复制
这导致每询问一个问题显存占用就会翻倍
通过将model改成全局变量修复这个问题
2023-04-05 01:17:26 +08:00
README.md first commit 2023-03-31 20:23:49 +08:00
README_en.md first commit 2023-03-31 20:09:40 +08:00
chatglm_llm.py fix: 修复chatglm模型被复制,显存占用过多 2023-04-05 01:17:26 +08:00
knowledge_based_chatglm.py update function name and requirements.txt 2023-04-03 19:13:34 +08:00
requirements.txt update requirements.txt 2023-04-03 21:07:41 +08:00

README_en.md

ChatGLM Application Based on Local Knowledge

Introduction

🌍 中文文档

🤖 A local knowledge based LLM Application with ChatGLM-6B and langchain.

💡 Inspired by document.ai by GanymedeNil and ChatGLM-6B Pull Request by AlexZhangji.

In this project, GanymedeNil/text2vec-large-chinese is used as Embedding Modeland ChatGLM-6B used as LLM。Based on those modelsthis project can be deployed offline with all open source models。

Usage

1. install python packages

pip install -r requirements

Attention: With langchain.document_loaders.UnstructuredFileLoader used to connect with local knowledge file, you may need some other dependencies as mentioned in langchain documentation

2. Run knowledge_based_chatglm.py script

python knowledge_based_chatglm.py

Roadmap

  • local knowledge based application with langchain + ChatGLM-6B
  • unstructured files loaded with langchain
  • more different file format loaded with langchain
  • implement web ui DEMO with gradio/streamlit
  • implement API with fastapiand web ui DEMO with API