Views
No views yet
| Attribute | Value |
|---|---|
| Base Model | sapientinc/HRM-Text-1B |
| Quantization Tool | AutoRound |
| Quantization Scheme | W4A16 |
| Original Size | 2350 MB |
| Quantized Size | 870 MB |
| Task | Accuracy |
|---|---|
| hellaswag | 0.3504 |
| mmlu | 0.2695 |
| piqa | 0.6240 |
pip install auto-round1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "HRM-Text-1B-autoround-W4A16"
4
5# load the tokenizer and the model
6tokenizer = AutoTokenizer.from_pretrained(model_name)
7model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="auto", device_map="auto")
8
9# prepare the model input
10prompt = "Write a quick sort algorithm."
11messages = [{"role": "user", "content": prompt}]
12text = tokenizer.apply_chat_template(
13 messages,
14 tokenize=False,
15 add_generation_prompt=True,
16)
17model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
18
19# conduct text completion
20generated_ids = model.generate(**model_inputs, max_new_tokens=512)
21output_ids = generated_ids[0][len(model_inputs.input_ids[0]) :].tolist()
22
23content = tokenizer.decode(output_ids, skip_special_tokens=True)
24print("content:", content)1vllm serve HRM-Text-1B-autoround-W4A16 \
2 --trust-remote-code \
3 --dtype bfloat16 \
4 --tensor_parallel_size 1@article{cheng2023optimize,
title={Optimize weight rounding via signed gradient descent for the quantization of llms},
author={Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao and Liu, Yi},
journal={arXiv preprint arXiv:2309.05516},
year={2023}
}