Instructions to use zai-org/chatglm2-6b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zai-org/chatglm2-6b with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("zai-org/chatglm2-6b", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
如何在创建模型时就使用int4?
#73
by shamankk - opened
在创建int4版本时内存不够。
只找到了ChatGLM版本的int4创建方式:
model = AutoModel.from_pretrained('./chatglm', trust_remote_code=True)
model = model.half().quantize(4).cuda()
现在ChatGLM2依然是这样吗?
电脑内存较小时,无法创建,是否可以在创建模型时就使用int4?而不是在权重加载完以后再变成int4
这样是不是可以
model = AutoModel.from_pretrained(model_name, trust_remote_code=True, cache_dir=cache_dir, device_map="auto", load_in_4bit=True).cuda()
社区有量化后的模型下载