Update README.md
This commit is contained in:
parent
7424d1fead
commit
0772a2f0c8
10
README.md
10
README.md
|
@ -56,10 +56,14 @@ print(history)
|
||||||
model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).half().cuda()
|
model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).half().cuda()
|
||||||
```
|
```
|
||||||
|
|
||||||
替换为
|
替换为(8-bit 量化)
|
||||||
|
|
||||||
```python
|
```python
|
||||||
model = AutoModel.from_pretrained("THUDM/chatglm-6b", device_map="auto", load_in_8bit=True, trust_remote_code=True)
|
model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).half().quantize(8).cuda()
|
||||||
|
```
|
||||||
|
|
||||||
|
或者(4-bit 量化)
|
||||||
|
```python
|
||||||
|
model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).half().quantize(4).cuda()
|
||||||
```
|
```
|
||||||
|
|
||||||
进行 2 至 3 轮对话后,8-bit 量化下约占用 10GB 的 GPU 显存,4-bit 量化仅需占用 6GB 的 GPU 显存。随着对话轮数的增多,对应消耗显存也随之增长。
|
进行 2 至 3 轮对话后,8-bit 量化下约占用 10GB 的 GPU 显存,4-bit 量化仅需占用 6GB 的 GPU 显存。随着对话轮数的增多,对应消耗显存也随之增长。
|
||||||
|
|
Loading…
Reference in New Issue