INC4AI commited on
Commit
075d3c5
·
verified ·
1 Parent(s): 6698540

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +66 -0
README.md ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - tencent/WeDLM-8B-Instruct
4
+ pipeline_tag: text-generation
5
+ ---
6
+
7
+ ## Model Details
8
+
9
+ This model is an int4 model with group_size 128 and symmetric quantization of [tencent/WeDLM-8B-Instruct](https://huggingface.co/tencent/WeDLM-8B-Instruct) generated by [intel/auto-round](https://github.com/intel/auto-round). Please follow the license of the original model.
10
+
11
+ ## How to Use
12
+
13
+ ### HF Usage
14
+
15
+ ```python
16
+ # transformers==4.57.1
17
+ from transformers import AutoTokenizer, AutoModelForCausalLM
18
+
19
+ MODEL_PATH = "Intel/WeDLM-8B-Instruct-int4-AutoRound"
20
+
21
+ tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH, trust_remote_code=True)
22
+ model = AutoModelForCausalLM.from_pretrained(
23
+ MODEL_PATH,
24
+ trust_remote_code=True,
25
+ torch_dtype="auto",
26
+ device_map="auto"
27
+ )
28
+
29
+ messages = [{"role": "user", "content": "Hello!"}]
30
+ model_inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to("cuda")
31
+ generated_ids = model.generate(model_inputs, max_new_tokens=100, generation_config=model.generation_config)
32
+ response = tokenizer.batch_decode(generated_ids)[0]
33
+
34
+ print(response)
35
+ ```
36
+
37
+ ## Generate the Model
38
+
39
+ ```bash
40
+ pip install transformers==4.57.1
41
+ auto-round --bits 4 --iters 200 --model_name tencent/WeDLM-8B-Instruct
42
+ ```
43
+
44
+ ## Ethical Considerations and Limitations
45
+
46
+ 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.
47
+
48
+ Therefore, before deploying any applications of the model, developers should perform safety testing.
49
+
50
+ ## Caveats and Recommendations
51
+
52
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
53
+
54
+ Here are a couple of useful links to learn more about Intel's AI software:
55
+
56
+ - [Intel Neural Compressor](https://github.com/intel/neural-compressor)
57
+
58
+ ## Disclaimer
59
+
60
+ 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.
61
+
62
+ ## Cite
63
+
64
+ @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} }
65
+
66
+ [arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round)