Model Details
This model is an int4 model with group_size 128 and symmetric quantization of mistralai/Mistral-Small-3.2-24B-Instruct-2506 generated by intel/auto-round algorithm.
Please follow the license of the original model.
How To Use
This model could not run on vLLM.
INT4 Inference
import os
from datetime import datetime, timedelta
import torch
from huggingface_hub import hf_hub_download
from transformers import AutoProcessor, Mistral3ForConditionalGeneration, AutoTokenizer
def load_system_prompt(repo_id: str, filename: str) -> str:
if os.path.isdir(repo_id):
file_path = os.path.join(repo_id, filename)
else:
file_path = hf_hub_download(repo_id=repo_id, filename=filename)
with open(file_path, "r") as file:
system_prompt = file.read()
today = datetime.today().strftime("%Y-%m-%d")
yesterday = (datetime.today() - timedelta(days=1)).strftime("%Y-%m-%d")
model_name = repo_id.split("/")[-1]
return system_prompt.format(name=model_name, today=today, yesterday=yesterday)
model_id = "Intel/Mistral-Small-3.2-24B-Instruct-2506-int4-AutoRound"
SYSTEM_PROMPT = load_system_prompt(model_id, "SYSTEM_PROMPT.txt")
processor = AutoProcessor.from_pretrained(model_id)
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = Mistral3ForConditionalGeneration.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto")
url = "https://huggingface.co/datasets/patrickvonplaten/random_img/resolve/main/europe.png"
prompt = "Which of the depicted countries has the best food? Which the second and third and fourth? Name the country, its color on the map and one its city that is visible on the map, but is not the capital. Make absolutely sure to only name a city that can be seen on the map."
messages = [
{"role": "system", "content": SYSTEM_PROMPT},
{
"role": "user",
"content": [
{
"type": "text",
"text": prompt,
},
{"type": "image"}
],
},
]
inputs = processor.apply_chat_template(
messages, add_generation_prompt=True, tokenize=False,
return_dict=True
)
inputs =processor(images=url,
text=inputs,
add_special_tokens=False,
return_tensors="pt").to(model.device).to(torch.bfloat16)
input_len = inputs["input_ids"].shape[-1]
with torch.inference_mode():
generation = model.generate(**inputs, max_new_tokens=512, do_sample=True)
generation = generation[0][input_len:]
decoded = processor.decode(generation, skip_special_tokens=True)
print(decoded)
"""
To determine which countries have the best food, I'll consider popular opinions and rankings. Here are the top four countries known for their cuisine, along with their color on the map and a visible city (that is not the capital):
1. **Italy (Green)**
- City: Naples
2. **France (Brown)**
- City: Lyon
3. **Spain (Yellow)**
- City: Barcelona
4. **Greece (Light Green)**
- City: Thessaloniki
These countries are renowned for their unique and delicious cuisines, and the cities mentioned are visible on the map.
"""
Generate the model
https://github.com/intel/auto-round/pull/713 is required.
auto_round --mllm --model /models/Mistral-Small-3.2-24B-Instruct-2506/ --iters 200 --seqlen 1024 --output_dir tmp_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 link
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} }
- Downloads last month
- 43
Model tree for Intel/Mistral-Small-3.2-24B-Instruct-2506-int4-AutoRound
Base model
mistralai/Mistral-Small-3.1-24B-Base-2503