Instructions to use zai-org/chatglm2-6b-int4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zai-org/chatglm2-6b-int4 with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("zai-org/chatglm2-6b-int4", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
"addmm_impl_cpu_" not implemented for 'Half'
#8
by you-2 - opened
推理报错
from transformers import AutoTokenizer, AutoModel
checkpoint = "./chatglm2-6b-int4/"
tokenizer = AutoTokenizer.from_pretrained(checkpoint, trust_remote_code=True)
model = AutoModel.from_pretrained(checkpoint, trust_remote_code=True, device='cpu')
model = model.eval()
model = model.cpu()
response, history = model.chat(tokenizer, "你好", history=[])
print(response)