ChatBot-TGLM6B
ChatBot-TGLM6B copied to clipboard
ChatGLM-6B Bot for Telegram
ChatBot-TGLM6B
ChatBot-TGLM6B is a chatbot utilizing the Telegram API and the ChatGLM-6B.
- [x] Private Chat
- [x] Group Chat (requires mention or reply)
- [x] Chat Context (up to 16384 tokens per user)
- [x] Invitation Mode (see admin commands)
- [x] Independent Chat Session
- [x] Auto CUDA Memory Management
- [x] Auto Error Handling
Requirements
- Python 3+
- Git LFS
- ChatGLM (you can use compressed models)
- https://huggingface.co/THUDM/chatglm-6b
- https://huggingface.co/THUDM/chatglm-6b-int4
- PyTorch with CUDA (at least 8G of GPU memory)
- Transformers
- Telegram API Token
Usage
- Clone this repository
git clone https://github.com/Lakr233/ChatBot-TGLM6B
cd ChatBot-TGLM6B
- Download the model
# disable lfs when pull, change to int4 if needed
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/THUDM/chatglm-6b model
# inside model dir
git lfs fetch --all
git lfs checkout
- Install requirements
pip install -r requirements.txt
- Edit the config inside code
token = 'aaaaaaaaaa:88888888888888888888888888888888888'
admin_id = ['000000000']
Note: You need to disable Telegram-Bot 'Privacy Mode' to enable reply to talk in group chat.
- Run the bot
python3 ./main.py
License
This project is licensed under the WTFPL.
2023.3.23