Update README.md
Browse files
README.md
CHANGED
@@ -10,95 +10,41 @@ tags:
|
|
10 |
license: mit
|
11 |
---
|
12 |
# ChatGLM3-6B-GGML
|
13 |
-
<p align="center">
|
14 |
-
💻 <a href="https://github.com/THUDM/ChatGLM" target="_blank">Github Repo</a> • 🐦 <a href="https://twitter.com/thukeg" target="_blank">Twitter</a> • 📃 <a href="https://arxiv.org/abs/2103.10360" target="_blank">[GLM@ACL 22]</a> <a href="https://github.com/THUDM/GLM" target="_blank">[GitHub]</a> • 📃 <a href="https://arxiv.org/abs/2210.02414" target="_blank">[GLM-130B@ICLR 23]</a> <a href="https://github.com/THUDM/GLM-130B" target="_blank">[GitHub]</a> <br>
|
15 |
-
</p>
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
</p>
|
20 |
-
<p align="center">
|
21 |
-
📍Experience the larger-scale ChatGLM model at <a href="https://www.chatglm.cn">chatglm.cn</a>
|
22 |
-
</p>
|
23 |
|
24 |
-
|
25 |
-
ChatGLM3-6B 是 ChatGLM 系列最新一代的开源模型,在保留了前两代模型对话流畅、部署门槛低等众多优秀特性的基础上,ChatGLM3-6B 引入了如下特性:
|
26 |
-
|
27 |
-
1. **更强大的基础模型:** ChatGLM3-6B 的基础模型 ChatGLM3-6B-Base 采用了更多样的训练数据、更充分的训练步数和更合理的训练策略。在语义、数学、推理、代码、知识等不同角度的数据集上测评显示,ChatGLM3-6B-Base 具有在 10B 以下的预训练模型中最强的性能。
|
28 |
-
2. **更完整的功能支持:** ChatGLM3-6B 采用了全新设计的 [Prompt 格式](https://github.com/THUDM/ChatGLM3/blob/main/PROMPT.md),除正常的多轮对话外。同时原生支持[工具调用](https://github.com/THUDM/ChatGLM3/blob/main/tool_using/README.md)(Function Call)、代码执行(Code Interpreter)和 Agent 任务等复杂场景。
|
29 |
-
3. **更全面的开源序列:** 除了对话模型 ChatGLM3-6B 外,还开源了基础模型 ChatGLM-6B-Base、长文本对话模型 ChatGLM3-6B-32K。以上所有权重对学术研究**完全开放**,在填写[问卷](https://open.bigmodel.cn/mla/form)进行登记后**亦允许免费商业使用**。
|
30 |
-
|
31 |
-
ChatGLM3-6B is the latest open-source model in the ChatGLM series. While retaining many excellent features such as smooth dialogue and low deployment threshold from the previous two generations, ChatGLM3-6B introduces the following features:
|
32 |
-
|
33 |
-
1. **More Powerful Base Model:** The base model of ChatGLM3-6B, ChatGLM3-6B-Base, employs a more diverse training dataset, more sufficient training steps, and a more reasonable training strategy. Evaluations on datasets such as semantics, mathematics, reasoning, code, knowledge, etc., show that ChatGLM3-6B-Base has the strongest performance among pre-trained models under 10B.
|
34 |
-
2. **More Comprehensive Function Support:** ChatGLM3-6B adopts a newly designed [Prompt format](https://github.com/THUDM/ChatGLM3/blob/main/PROMPT_en.md), in addition to the normal multi-turn dialogue. It also natively supports [function call](https://github.com/THUDM/ChatGLM3/blob/main/tool_using/README_en.md), code interpreter, and complex scenarios such as agent tasks.
|
35 |
-
3. **More Comprehensive Open-source Series:** In addition to the dialogue model ChatGLM3-6B, the base model ChatGLM-6B-Base and the long-text dialogue model ChatGLM3-6B-32K are also open-sourced. All the weights are **fully open** for academic research, and after completing the [questionnaire](https://open.bigmodel.cn/mla/form) registration, they are also **allowed for free commercial use**.
|
36 |
|
37 |
## 软件依赖 (Dependencies)
|
38 |
|
39 |
```shell
|
40 |
-
|
|
|
|
|
|
|
41 |
```
|
42 |
|
43 |
-
##
|
44 |
|
45 |
-
可以通过如下代码调用 ChatGLM3-6B 模型来生成对话:
|
46 |
|
47 |
You can generate dialogue by invoking the ChatGLM3-6B model with the following code:
|
48 |
|
49 |
```ipython
|
50 |
-
>>>
|
51 |
-
>>>
|
52 |
-
>>>
|
53 |
-
>>>
|
54 |
-
|
55 |
-
>>> print(response)
|
56 |
-
你好👋!我是人工智能助手 ChatGLM-6B,很高兴见到你,欢迎问我任何问题。
|
57 |
-
>>> response, history = model.chat(tokenizer, "晚上睡不着应该怎么办", history=history)
|
58 |
-
>>> print(response)
|
59 |
-
晚上睡不着可能会让你感到焦虑或不舒服,但以下是一些可以帮助你入睡的方法:
|
60 |
-
|
61 |
-
1. 制定规律的睡眠时间表:保持规律的睡眠时间表可以帮助你建立健康的睡眠习惯,使你更容易入睡。尽量在每天的相同时间上床,并在同一时间起床。
|
62 |
-
2. 创造一个舒适的睡眠环境:确保睡眠环境舒适,安静,黑暗且温度适宜。可以使用舒适的床上用品,并保持房间通风。
|
63 |
-
3. 放松身心:在睡前做些放松的活动,例如泡个热水澡,听些轻柔的音乐,阅读一些有趣的书籍等,有助于缓解紧张和焦虑,使你更容易入睡。
|
64 |
-
4. 避免饮用含有咖啡因的饮料:咖啡因是一种刺激性物质,会影响你的睡眠质量。尽量避免在睡前饮用含有咖啡因的饮料,例如咖啡,茶和可乐。
|
65 |
-
5. 避免在床上做与睡眠无关的事情:在床上做些与睡眠无关的事情,例如看电影,玩游戏或工作等,可能会干扰你的睡眠。
|
66 |
-
6. 尝试呼吸技巧:深呼吸是一种放松技巧,可以帮助你缓解紧张和焦虑,使你更容易入睡。试着慢慢吸气,保持几秒钟,然后缓慢呼气。
|
67 |
-
|
68 |
-
如果这些方法无法帮助你入睡,你可以考虑咨询医生或睡眠专家,寻求进一步的建议。
|
69 |
```
|
70 |
|
71 |
-
关于更多的使用说明,包括如何运行命令行和网页版本的 DEMO
|
72 |
-
|
73 |
-
For more instructions, including how to run CLI and web demos, and model quantization, please refer to our [Github Repo](https://github.com/THUDM/ChatGLM).
|
74 |
|
|
|
75 |
|
76 |
## 协议 (License)
|
77 |
|
78 |
-
本仓库的代码依照
|
79 |
|
80 |
-
The code in this repository is open-sourced under the
|
81 |
-
|
82 |
-
## 引用 (Citation)
|
83 |
-
|
84 |
-
如果你觉得我们的工作有帮助的话,请考虑引用下列论文。
|
85 |
-
|
86 |
-
If you find our work helpful, please consider citing the following papers.
|
87 |
-
|
88 |
-
```
|
89 |
-
@article{zeng2022glm,
|
90 |
-
title={Glm-130b: An open bilingual pre-trained model},
|
91 |
-
author={Zeng, Aohan and Liu, Xiao and Du, Zhengxiao and Wang, Zihan and Lai, Hanyu and Ding, Ming and Yang, Zhuoyi and Xu, Yifan and Zheng, Wendi and Xia, Xiao and others},
|
92 |
-
journal={arXiv preprint arXiv:2210.02414},
|
93 |
-
year={2022}
|
94 |
-
}
|
95 |
-
```
|
96 |
-
```
|
97 |
-
@inproceedings{du2022glm,
|
98 |
-
title={GLM: General Language Model Pretraining with Autoregressive Blank Infilling},
|
99 |
-
author={Du, Zhengxiao and Qian, Yujie and Liu, Xiao and Ding, Ming and Qiu, Jiezhong and Yang, Zhilin and Tang, Jie},
|
100 |
-
booktitle={Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
|
101 |
-
pages={320--335},
|
102 |
-
year={2022}
|
103 |
-
}
|
104 |
-
```
|
|
|
10 |
license: mit
|
11 |
---
|
12 |
# ChatGLM3-6B-GGML
|
|
|
|
|
|
|
13 |
|
14 |
+
## 介绍 (Introduction
|
15 |
+
ChatGLM3-6B-GGML 是 ChatGLM3-6B 的量化版本,可以在 CPU 服务器上运行。
|
|
|
|
|
|
|
|
|
16 |
|
17 |
+
ChatGLM3-6B-GGML is a quantized version of ChatGLM3-6B that can run on CPU servers.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
## 软件依赖 (Dependencies)
|
20 |
|
21 |
```shell
|
22 |
+
git clone --recursive https://github.com/li-plus/chatglm.cpp.git
|
23 |
+
|
24 |
+
python3 -m pip install torch tabulate tqdm transformers accelerate sentencepiece
|
25 |
+
pip install -U 'chatglm-cpp[api]'
|
26 |
```
|
27 |
|
28 |
+
## 模型调用 (Model Usage)
|
29 |
|
30 |
+
可以通过如下代码调用 ChatGLM3-6B-GGML 模型来生成对话:
|
31 |
|
32 |
You can generate dialogue by invoking the ChatGLM3-6B model with the following code:
|
33 |
|
34 |
```ipython
|
35 |
+
>>> import chatglm_cpp
|
36 |
+
>>>
|
37 |
+
>>> pipeline = chatglm_cpp.Pipeline("./chatglm-ggml.bin")
|
38 |
+
>>> pipeline.chat([chatglm_cpp.ChatMessage(role="user", content="你好")])
|
39 |
+
ChatMessage(role="assistant", content="你好!我是人工智能助手 ChatGLM-6B,很高兴见到你,欢迎问我任何问题。", tool_calls=[])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
```
|
41 |
|
42 |
+
关于更多的使用说明,包括如何运行命令行和网页版本的 DEMO,请参考我的 [文章](https://zhaozhiming.github.io/2023/12/18/quantification-chatglm3-6b-and-deploy-on-colab/)。
|
|
|
|
|
43 |
|
44 |
+
For more usage instructions, including how to run the command line and web versions of the DEMO, please refer to my [article](https://zhaozhiming.github.io/2023/12/18/quantification-chatglm3-6b-and-deploy-on-colab/).
|
45 |
|
46 |
## 协议 (License)
|
47 |
|
48 |
+
本仓库的代码依照 MIT 协议开源,ChatGLM3-6B 模型的权重的使用则需要遵循 [Model License](MODEL_LICENSE)。
|
49 |
|
50 |
+
The code in this repository is open-sourced under the MIT LICENSE, while the use of the ChatGLM3-6B model weights needs to comply with the [Model License](MODEL_LICENSE).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|