INC4AI commited on
Commit
72da91f
·
verified ·
1 Parent(s): ada679d

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +64 -0
README.md ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - deepseek-ai/DeepSeek-V3.2
4
+ pipeline_tag: text-generation
5
+ ---
6
+ ## Model Details
7
+
8
+ This model is an int4 model with group_size 128 and symmetric quantization of [deepseek-ai/DeepSeek-V3.2](https://huggingface.co/deepseek-ai/DeepSeek-V3.2) generated by [intel/auto-round](https://github.com/intel/auto-round). Please follow the license of the original model.
9
+ ## How to Use
10
+
11
+ ### Environment
12
+ ```bash
13
+ git clone -b 457-ds32 https://github.com/yiliu30/transformers.git
14
+ cd transformers && pip install -e .
15
+
16
+ git clone -b ds-v32 https://github.com/intel/auto-round.git
17
+ cd auto-round && pip install .
18
+ ```
19
+ ###
20
+
21
+ ### HF Usage
22
+ ```python
23
+ import torch
24
+ from transformers import AutoModelForCausalLM, AutoTokenizer
25
+
26
+ MODEL_PATH = "Intel/DeepSeek-V3.2-int4-AutoRound"
27
+ messages = "Give me a short introduction to large language model."
28
+ tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
29
+ inputs = tokenizer(
30
+ messages,
31
+ return_tensors="pt",
32
+ )
33
+ model = AutoModelForCausalLM.from_pretrained(
34
+ pretrained_model_name_or_path=MODEL_PATH,
35
+ torch_dtype=torch.bfloat16,
36
+ device_map="auto",
37
+ )
38
+ inputs = inputs.to(model.device)
39
+ generated_ids = model.generate(**inputs, max_new_tokens=512, do_sample=False)
40
+ output_text = tokenizer.decode(generated_ids[0][inputs.input_ids.shape[1] :])
41
+ print(output_text)
42
+ ```
43
+
44
+ ## Generate the Model
45
+ ```bash
46
+ git clone -b ds-v32 https://github.com/intel/auto-round.git
47
+ cd auto-round/ds32
48
+ python quant_ds_v32.py --model_name deepseek-ai/DeepSeek-V3.2 --output_dir DeepSeek-V3.2-int4-autoround
49
+ ```
50
+ ## Ethical Considerations and Limitations
51
+ 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.
52
+ Therefore, before deploying any applications of the model, developers should perform safety testing.
53
+ ## Caveats and Recommendations
54
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
55
+ Here are a couple of useful links to learn more about Intel's AI software:
56
+ - [Intel Neural Compressor](https://github.com/intel/neural-compressor)
57
+ - [AutoRound](https://github.com/intel/auto-round)
58
+ ## Disclaimer
59
+ 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.
60
+ ## Cite
61
+ ```
62
+ @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} }
63
+ [arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round)
64
+ ```