duzx16 commited on
Commit ·
4ca7055
1
Parent(s): c132406
Update README
Browse files
README.md
CHANGED
|
@@ -7,9 +7,9 @@ tags:
|
|
| 7 |
- chatglm
|
| 8 |
- thudm
|
| 9 |
---
|
| 10 |
-
#
|
| 11 |
<p align="center">
|
| 12 |
-
|
| 13 |
</p>
|
| 14 |
|
| 15 |
<p align="center">
|
|
@@ -17,51 +17,38 @@ tags:
|
|
| 17 |
</p>
|
| 18 |
|
| 19 |
## 介绍
|
| 20 |
-
|
| 21 |
|
| 22 |
-
|
| 23 |
|
| 24 |
## 软件依赖
|
| 25 |
|
| 26 |
```shell
|
| 27 |
-
pip install
|
| 28 |
```
|
| 29 |
|
| 30 |
## 代码调用
|
| 31 |
|
| 32 |
-
可以通过如下代码调用
|
| 33 |
|
| 34 |
```ipython
|
| 35 |
>>> from transformers import AutoTokenizer, AutoModel
|
| 36 |
>>> tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True)
|
| 37 |
>>> model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).half().cuda()
|
| 38 |
-
>>>
|
|
|
|
| 39 |
>>> print(response)
|
| 40 |
-
|
| 41 |
-
>>> response, history = model.chat(tokenizer, "晚上睡不着应该怎么办", history=history)
|
| 42 |
>>> print(response)
|
| 43 |
-
晚上睡不着可能会让你感到焦虑或不舒服,但以下是一些可以帮助你入睡的方法:
|
| 44 |
-
|
| 45 |
-
1. 制定规律的睡眠时间表:保持规律的睡眠时间表可以帮助你建立健康的睡眠习惯,使你更容易入睡。尽量在每天的相同时间上床,并在同一时间起床。
|
| 46 |
-
2. 创造一个舒适的睡眠环境:确保睡眠环境舒适,安静,黑暗且温度适宜。可以使用舒适的床上用品,并保持房间通风。
|
| 47 |
-
3. 放松身心:在睡前做些放松的活动,例如泡个热水澡,听些轻柔的音乐,阅读一些有趣的书籍等,有助于缓解紧张和焦虑,使你更容易入睡。
|
| 48 |
-
4. 避免饮用含有咖啡因的饮料:���啡因是一种刺激性物质,会影响你的睡眠质量。尽量避免在睡前饮用含有咖啡因的饮料,例如咖啡,茶和可乐。
|
| 49 |
-
5. 避免在床上做与睡眠无关的事情:在床上做些与睡眠无关的事情,例如看电影,玩游戏或工作等,可能会干扰你的睡眠。
|
| 50 |
-
6. 尝试呼吸技巧:深呼吸是一种放松技巧,可以帮助你缓解紧张和焦虑,使你更容易入睡。试着慢慢吸气,保持几秒钟,然后缓慢呼气。
|
| 51 |
-
|
| 52 |
-
如果这些方法无法帮助你入睡,你可以考虑咨询医生或睡眠专家,寻求进一步的建议。
|
| 53 |
```
|
| 54 |
|
| 55 |
-
关于更多的使用说明,包括如何运行命令行和网页版本的 DEMO,以及使用模型量化以节省显存,请参考我们的 [Github Repo](https://github.com/THUDM/
|
| 56 |
-
|
| 57 |
-
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-6B).
|
| 58 |
|
| 59 |
-
|
| 60 |
-
* v0.1.0 ([f83182](https://huggingface.co/THUDM/chatglm-6b/commit/f83182484538e663a03d3f73647f10f89878f438))
|
| 61 |
|
| 62 |
## 协议
|
| 63 |
|
| 64 |
-
本仓库的代码依照 [Apache-2.0](LICENSE) 协议开源,
|
| 65 |
|
| 66 |
## 引用
|
| 67 |
|
|
|
|
| 7 |
- chatglm
|
| 8 |
- thudm
|
| 9 |
---
|
| 10 |
+
# VisualGLM-6B
|
| 11 |
<p align="center">
|
| 12 |
+
💻 <a href="https://github.com/THUDM/VisualGLM-6B" 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>
|
| 13 |
</p>
|
| 14 |
|
| 15 |
<p align="center">
|
|
|
|
| 17 |
</p>
|
| 18 |
|
| 19 |
## 介绍
|
| 20 |
+
CVisualGLM-6B 是一个开源的,支持**图像、中文和英文**的多模态对话语言模型,语言模型基于 [ChatGLM-6B](https://github.com/THUDM/ChatGLM-6B),具有 62 亿参数;图像部分通过训练 [BLIP2-Qformer](https://arxiv.org/abs/2301.12597) 构建起视觉模型与语言模型的桥梁,整体模型共78亿参数。
|
| 21 |
|
| 22 |
+
VisualGLM-6B 依靠来自于 [CogView](https://arxiv.org/abs/2105.13290) 数据集的30M高质量中文图文对,与300M经过筛选的英文图文对进行预训练,中英文权重相同。该训练方式较好地将视觉信息对齐到ChatGLM的语义空间;之后的微调阶段,模型在长视觉问答数据上训练,以生成符合人类偏好的答案。
|
| 23 |
|
| 24 |
## 软件依赖
|
| 25 |
|
| 26 |
```shell
|
| 27 |
+
pip install SwissArmyTransformer>=0.3.6 torch>1.10.0 torchvision transformers>=4.27.1 cpm_kernels
|
| 28 |
```
|
| 29 |
|
| 30 |
## 代码调用
|
| 31 |
|
| 32 |
+
可以通过如下代码调用 VisualGLM-6B 模型来生成对话:
|
| 33 |
|
| 34 |
```ipython
|
| 35 |
>>> from transformers import AutoTokenizer, AutoModel
|
| 36 |
>>> tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True)
|
| 37 |
>>> model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).half().cuda()
|
| 38 |
+
>>> image_path = "your image path"
|
| 39 |
+
>>> response, history = model.chat(tokenizer, image_path, "描述这张图片。", history=[])
|
| 40 |
>>> print(response)
|
| 41 |
+
>>> response, history = model.chat(tokenizer, "这张图片可能是在什么场所拍摄的?", history=history)
|
|
|
|
| 42 |
>>> print(response)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
```
|
| 44 |
|
| 45 |
+
关于更多的使用说明,包括如何运行命令行和网页版本的 DEMO,以及使用模型量化以节省显存,请参考我们的 [Github Repo](https://github.com/THUDM/VisualGLM-6B)。
|
|
|
|
|
|
|
| 46 |
|
| 47 |
+
For more instructions, including how to run CLI and web demos, and model quantization, please refer to our [Github Repo](https://github.com/THUDM/VisualGLM-6B).
|
|
|
|
| 48 |
|
| 49 |
## 协议
|
| 50 |
|
| 51 |
+
本仓库的代码依照 [Apache-2.0](LICENSE) 协议开源,VisualGLM-6B 模型的权重的使用则需要遵循 [Model License](MODEL_LICENSE)。
|
| 52 |
|
| 53 |
## 引用
|
| 54 |
|