update readme
Browse files
README.md
CHANGED
@@ -1,3 +1,92 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
datasets:
|
4 |
+
- NeelNanda/pile-10k
|
5 |
+
language:
|
6 |
+
- en
|
7 |
+
---
|
8 |
+
|
9 |
+
|
10 |
+
## Model Details
|
11 |
+
|
12 |
+
This model is an int4 model with group_size 128 of [THUDM/chatglm3-6b](https://huggingface.co/THUDM/chatglm3-6b) generated by [intel/auto-round](https://github.com/intel/auto-round).
|
13 |
+
|
14 |
+
|
15 |
+
|
16 |
+
### INT4 Inference with AutoGPTQ's Kernel
|
17 |
+
|
18 |
+
```python
|
19 |
+
##pip install auto-gptq[triton]
|
20 |
+
##pip install triton==2.2.0
|
21 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
22 |
+
quantized_model_dir = "Intel/chatglm3-6b-int4-inc"
|
23 |
+
model = AutoModelForCausalLM.from_pretrained(quantized_model_dir,
|
24 |
+
device_map="auto",
|
25 |
+
trust_remote_code=False,
|
26 |
+
)
|
27 |
+
tokenizer = AutoTokenizer.from_pretrained(quantized_model_dir, use_fast=True)
|
28 |
+
print(tokenizer.decode(model.generate(**tokenizer("There is a girl who likes adventure,", return_tensors="pt").to(model.device),max_new_tokens=50)[0]))
|
29 |
+
```
|
30 |
+
|
31 |
+
|
32 |
+
|
33 |
+
### Evaluate the model
|
34 |
+
|
35 |
+
Install [lm-eval-harness](https://github.com/EleutherAI/lm-evaluation-harness.git) from source, we used the git id 96d185fa6232a5ab685ba7c43e45d1dbb3bb906d
|
36 |
+
|
37 |
+
```bash
|
38 |
+
lm_eval --model hf --model_args pretrained="Intel/chatglm3-6b-int4-inc",autogptq=True,gptq_use_triton=True --device cuda:0 --tasks lambada_openai,hellaswag,piqa,winogrande,truthfulqa_mc1,openbookqa,boolq,rte,arc_easy,arc_challenge,mmlu --batch_size 32
|
39 |
+
```
|
40 |
+
|
41 |
+
|
42 |
+
|
43 |
+
### Reproduce the model
|
44 |
+
|
45 |
+
Here is the sample command to reproduce the model
|
46 |
+
|
47 |
+
```bash
|
48 |
+
git clone https://github.com/intel/auto-round
|
49 |
+
cd auto-round/examples/language-modeling
|
50 |
+
pip install -r requirements.txt
|
51 |
+
python3 main.py \
|
52 |
+
--model_name THUDM/chatglm3-6b \
|
53 |
+
--device 0 \
|
54 |
+
--group_size 128 \
|
55 |
+
--bits 4 \
|
56 |
+
--iters 200 \
|
57 |
+
--disable_quanted_input \
|
58 |
+
--deployment_device 'gpu' \
|
59 |
+
--output_dir "./tmp_autoround" \
|
60 |
+
|
61 |
+
```
|
62 |
+
|
63 |
+
## Ethical Considerations and Limitations
|
64 |
+
|
65 |
+
The model can produce factually incorrect output, and should not be relied on to produce factually accurate information. Because of the limitations of the pretrained model and the finetuning datasets, it is possible that this model could generate lewd, biased or otherwise offensive outputs.
|
66 |
+
|
67 |
+
Therefore, before deploying any applications of the model, developers should perform safety testing.
|
68 |
+
|
69 |
+
|
70 |
+
|
71 |
+
## Caveats and Recommendations
|
72 |
+
|
73 |
+
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
|
74 |
+
|
75 |
+
Here are a couple of useful links to learn more about Intel's AI software:
|
76 |
+
|
77 |
+
* Intel Neural Compressor [link](https://github.com/intel/neural-compressor)
|
78 |
+
* Intel Extension for Transformers [link](https://github.com/intel/intel-extension-for-transformers)
|
79 |
+
|
80 |
+
|
81 |
+
|
82 |
+
## Disclaimer
|
83 |
+
|
84 |
+
The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. Please consult an attorney before using this model for commercial purposes.
|
85 |
+
|
86 |
+
|
87 |
+
|
88 |
+
## Cite
|
89 |
+
|
90 |
+
@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}, journal={arXiv preprint arXiv:2309.05516}, year={2023} }
|
91 |
+
|
92 |
+
[arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round)
|