Text Generation
Transformers
Safetensors
minimax_m3_vl
image-text-to-text
auto-round
mxfp8
compressed-tensors
conversational
custom_code
8-bit precision
Instructions to use intel-ai/MiniMax-M3-MXFP4-CT-AutoRound with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use intel-ai/MiniMax-M3-MXFP4-CT-AutoRound with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="intel-ai/MiniMax-M3-MXFP4-CT-AutoRound", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("intel-ai/MiniMax-M3-MXFP4-CT-AutoRound", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("intel-ai/MiniMax-M3-MXFP4-CT-AutoRound", trust_remote_code=True, device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use intel-ai/MiniMax-M3-MXFP4-CT-AutoRound with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "intel-ai/MiniMax-M3-MXFP4-CT-AutoRound" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "intel-ai/MiniMax-M3-MXFP4-CT-AutoRound", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/intel-ai/MiniMax-M3-MXFP4-CT-AutoRound
- SGLang
How to use intel-ai/MiniMax-M3-MXFP4-CT-AutoRound with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "intel-ai/MiniMax-M3-MXFP4-CT-AutoRound" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "intel-ai/MiniMax-M3-MXFP4-CT-AutoRound", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "intel-ai/MiniMax-M3-MXFP4-CT-AutoRound" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "intel-ai/MiniMax-M3-MXFP4-CT-AutoRound", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use intel-ai/MiniMax-M3-MXFP4-CT-AutoRound with Docker Model Runner:
docker model run hf.co/intel-ai/MiniMax-M3-MXFP4-CT-AutoRound
|
Download README.md from intel-ai/MiniMax-M3-MXFP4-CT-AutoRound: direct link, hf CLI and curl.
- Browser
- Download file 2.67 kB
-
https://huggingface.co/intel-ai/MiniMax-M3-MXFP4-CT-AutoRound/resolve/main/README.md
- Command line
-
hf download hf://intel-ai/MiniMax-M3-MXFP4-CT-AutoRound/README.md
-
curl -L -o README.md https://huggingface.co/intel-ai/MiniMax-M3-MXFP4-CT-AutoRound/resolve/main/README.md
2.67 kB
| base_model: | |
| - MiniMaxAI/MiniMax-M3 | |
| license: other | |
| pipeline_tag: text-generation | |
| library_name: transformers | |
| tags: | |
| - auto-round | |
| - mxfp8 | |
| - compressed-tensors | |
| ## Model Details | |
| This model is an MXFP8 model of [MiniMaxAI/MiniMax-M3](https://huggingface.co/MiniMaxAI/MiniMax-M3) generated by [intel/auto-round](https://github.com/intel/auto-round) with 200 tuning iterations. Please follow the license of the original model. | |
| - **Quantized (MXFP8)**: linear layers | |
| - **Kept in BF16**: lm_head / embed_tokens | |
| ## How to Use | |
| ### Environment | |
| ```bash | |
| pip install vllm==0.29.0 | |
| ``` | |
| ### vLLM Usage | |
| ```bash | |
| vllm serve intel-ai/MiniMax-M3-MXFP4-CT-AutoRound \ | |
| --trust-remote-code | |
| ``` | |
| ## Evaluation | |
| | Benchmark | BF16 | MXFP8 | Recovery | | |
| |---|---:|---:|---:| | |
| | GSM8K | 94.60 | 94.10 | 99.47% | | |
| | MMLU | 86.20 | 85.80 | 99.54% | | |
| | PIQA | 83.10 | 82.90 | 99.76% | | |
| | HellaSwag | 75.40 | 74.80 | 99.20% | | |
| | **Average** | **84.83** | **84.40** | **99.49%** | | |
| ## Generate the Model | |
| ```bash | |
| auto-round \ | |
| --model_name MiniMaxAI/MiniMax-M3 \ | |
| --iters 200 \ | |
| --scheme MXFP8 \ | |
| --ignore_layers "lm_head,embed_tokens" \ | |
| --format llm_compressor \ | |
| --output_dir MiniMax-M3-MXFP4-CT-AutoRound | |
| ``` | |
| ## Ethical Considerations and Limitations | |
| 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. | |
| Therefore, before deploying any applications of the model, developers should perform safety testing. | |
| ## Caveats and Recommendations | |
| Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. | |
| Here are a couple of useful links to learn more about Intel's AI software: | |
| - [Intel Neural Compressor](https://github.com/intel/neural-compressor) | |
| - [AutoRound](https://github.com/intel/auto-round) | |
| ## Disclaimer | |
| 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. | |
| ## Cite | |
| ``` | |
| @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} | |
| } | |
| ``` | |
| [arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round) | |
| Signed-off-by: Lv, Kaokao <kaokao.lv@intel.com> | |