INC4AI commited on
Commit
bbc8c53
·
verified ·
1 Parent(s): d047cc7

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +72 -0
README.md ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - MiniMaxAI/MiniMax-M2.1
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 [MiniMaxAI/MiniMax-M2.1](https://huggingface.co/MiniMaxAI/MiniMax-M2.1) 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 AutoModelForCausalLM, AutoTokenizer
18
+
19
+ MODEL_PATH = "Intel/MiniMax-M2.1-int4-AutoRound"
20
+
21
+ model = AutoModelForCausalLM.from_pretrained(
22
+ MODEL_PATH,
23
+ device_map="auto",
24
+ trust_remote_code=True,
25
+ )
26
+ tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
27
+
28
+ messages = [
29
+ {"role": "user", "content": [{"type": "text", "text": "What is your favourite condiment?"}]},
30
+ {"role": "assistant", "content": [{"type": "text", "text": "Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!"}]},
31
+ {"role": "user", "content": [{"type": "text", "text": "Do you have mayonnaise recipes?"}]}
32
+ ]
33
+
34
+ model_inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to("cuda")
35
+
36
+ generated_ids = model.generate(model_inputs, max_new_tokens=100, generation_config=model.generation_config)
37
+
38
+ response = tokenizer.batch_decode(generated_ids)[0]
39
+
40
+ print(response)
41
+ ```
42
+
43
+ ## Generate the Model
44
+
45
+ ```bash
46
+ uv pip install transformers==4.57.1 torch accelerate --torch-backend=auto
47
+ auto-round --bits 4 --iters 200 --model_name MiniMaxAI/MiniMax-M2.1
48
+ ```
49
+
50
+ ## Ethical Considerations and Limitations
51
+
52
+ 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.
53
+
54
+ Therefore, before deploying any applications of the model, developers should perform safety testing.
55
+
56
+ ## Caveats and Recommendations
57
+
58
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
59
+
60
+ Here are a couple of useful links to learn more about Intel's AI software:
61
+
62
+ - [Intel Neural Compressor](https://github.com/intel/neural-compressor)
63
+
64
+ ## Disclaimer
65
+
66
+ 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.
67
+
68
+ ## Cite
69
+
70
+ @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} }
71
+
72
+ [arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round)