INC4AI commited on
Commit
e60475b
·
verified ·
1 Parent(s): 8af882e

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +82 -0
README.md ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - meituan-longcat/LongCat-Flash-Lite
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 [meituan-longcat/LongCat-Flash-Lite](https://huggingface.co/meituan-longcat/LongCat-Flash-Lite) 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
+ ### Environment
14
+
15
+ ```bash
16
+ uv pip install -U transformers==4.57.6 accelerate==1.10.0
17
+ ```
18
+
19
+ ### HF Usage
20
+
21
+ ```python
22
+ from transformers import AutoModelForCausalLM, AutoTokenizer
23
+
24
+ model_name = "Intel/LongCat-Flash-Lite-int4-AutoRound"
25
+ model = AutoModelForCausalLM.from_pretrained(
26
+ model_name,
27
+ torch_dtype="auto",
28
+ device_map="auto",
29
+ trust_remote_code=True
30
+ )
31
+ tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
32
+
33
+ messages = [
34
+ {"role": "system", "content": "You are a helpful assistant."},
35
+ {"role": "user", "content": "Give me a brief introduction to large language models."}
36
+ ]
37
+ input_ids = tokenizer.apply_chat_template(
38
+ messages,
39
+ add_generation_prompt=True,
40
+ return_tensors="pt"
41
+ ).to(model.device)
42
+ generated_ids = model.generate(inputs=input_ids, max_new_tokens=256)
43
+ output_ids = generated_ids[0][len(input_ids[0]):].tolist()
44
+ response = tokenizer.decode(output_ids, skip_special_tokens=True).strip("\n")
45
+ print(response)
46
+ ```
47
+
48
+ ## Generate the Model
49
+
50
+ ```bash
51
+ auto-round --model_name meituan-longcat/LongCat-Flash-Lite --bits 4 --iters 200 --output_dir LongCat-Flash-Lite-int4-AutoRound
52
+ ```
53
+
54
+ ## Ethical Considerations and Limitations
55
+
56
+ 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.
57
+ Therefore, before deploying any applications of the model, developers should perform safety testing.
58
+
59
+ ## Caveats and Recommendations
60
+
61
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
62
+ Here are a couple of useful links to learn more about Intel's AI software:
63
+
64
+ - [Intel Neural Compressor](https://github.com/intel/neural-compressor)
65
+ - [AutoRound](https://github.com/intel/auto-round)
66
+
67
+ ## Disclaimer
68
+
69
+ 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.
70
+
71
+ ## Cite
72
+
73
+ ```
74
+ @article{cheng2023optimize,
75
+ title={Optimize weight rounding via signed gradient descent for the quantization of llms},
76
+ author={Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao and Liu, Yi},
77
+ journal={arXiv preprint arXiv:2309.05516},
78
+ year={2023}
79
+ }
80
+ ```
81
+
82
+ [arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round)