Add CPU support with less than 16G memory

pull/15/head
songxxzp 2023-03-14 18:35:35 +08:00
parent 0c6d1750ef
commit a10fbd88e1
1 changed files with 6 additions and 0 deletions

View File

@ -101,6 +101,12 @@ model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).fl
``` ```
CPU上推理速度可能会比较慢。 CPU上推理速度可能会比较慢。
以上方法需要32G内存。如果你只有16G内存可以尝试
```python
model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).bfloat16()
```
需保证空闲内存接近16G并且推理速度会很慢。
## ChatGLM-6B示例 ## ChatGLM-6B示例
以下是一些使用`web_demo.py`得到的示例截图。更多ChatGLM-6B的可能等待你来探索发现 以下是一些使用`web_demo.py`得到的示例截图。更多ChatGLM-6B的可能等待你来探索发现