Instructions to use intel-ai/Muse-Spark-Open-816B-A42B-INT4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use intel-ai/Muse-Spark-Open-816B-A42B-INT4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="intel-ai/Muse-Spark-Open-816B-A42B-INT4") 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/Muse-Spark-Open-816B-A42B-INT4") model = AutoModelForMultimodalLM.from_pretrained("intel-ai/Muse-Spark-Open-816B-A42B-INT4", 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/Muse-Spark-Open-816B-A42B-INT4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "intel-ai/Muse-Spark-Open-816B-A42B-INT4" # 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/Muse-Spark-Open-816B-A42B-INT4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/intel-ai/Muse-Spark-Open-816B-A42B-INT4
- SGLang
How to use intel-ai/Muse-Spark-Open-816B-A42B-INT4 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/Muse-Spark-Open-816B-A42B-INT4" \ --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/Muse-Spark-Open-816B-A42B-INT4", "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/Muse-Spark-Open-816B-A42B-INT4" \ --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/Muse-Spark-Open-816B-A42B-INT4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use intel-ai/Muse-Spark-Open-816B-A42B-INT4 with Docker Model Runner:
docker model run hf.co/intel-ai/Muse-Spark-Open-816B-A42B-INT4
Model Details
This model is a W4A16 (int4, group_size 128, symmetric) model of meta-models/Muse-Spark-Open-816B-A42B generated by intel/auto-round using RTN. Please follow the license of the original model.
- Quantized (W4A16): routed experts
- Kept in BF16: attention, router, pooler, unpooler, embeddings, lm_head, vision tower, audio tower
How to Use
Environment
pip install vllm==0.29.0
vLLM Usage
vllm serve intel-ai/Muse-Spark-Open-816B-A42B-INT4 \
--reasoning-parser musespark1x
Evaluation
| Benchmark | Base Model | W4A16 | Recovery |
|---|---|---|---|
| GSM8K | 92.87 | 96.36 | 103.76% |
| MMLU | 87.66 | 89.38 | 101.96% |
| PIQA | 71.10 | 84.77 | 119.23% |
| HellaSwag | 84.22 | 72.77 | 86.40% |
| Average | 83.96 | 85.82 | 102.22% |
Generate the Model
auto-round \
--model_name meta-models/Muse-Spark-Open-816B-A42B \
--scheme W4A16 \
--model_free \
--disable_torch_compile \
--ignore_layers "self_attn,pre_expert_proj,post_expert_proj,mlp.gate,vision_tower,vision_adapter,vision_projection,audio_tower,embed_tokens,lm_head" \
--format auto_round \
--output_dir Muse-Spark-Open-816B-A42B-INT4
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:
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}
}
Signed-off-by: Lv, Kaokao kaokao.lv@intel.com
- Downloads last month
- 306
Model tree for intel-ai/Muse-Spark-Open-816B-A42B-INT4
Base model
meta-models/Muse-Spark-Open-816B-A42B