Run this model with HF Jobs
Run zai-org/chatglm2-6b on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/zai-org/chatglm2-6b. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/zai-org/chatglm2-6b on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
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:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("zai-org/chatglm2-6b", trust_remote_code=True, device_map="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()
社区有量化后的模型下载