Views
No views yet
| Model | Wildbench v2 | Arena Hard v2 | IF (Internal; accuracy) |
|---|---|---|---|
| Small 3.1 24B Instruct | 55.6% | 19.56% | 82.75% |
| Small 3.2 24B Instruct | 65.33% | 43.1% | 84.78% |
| Model | Infinite Generations (Internal; Lower is better) |
|---|---|
| Small 3.1 24B Instruct | 2.11% |
| Small 3.2 24B Instruct | 1.29% |
| Model | MMLU | MMLU Pro (5-shot CoT) | MATH | GPQA Main (5-shot CoT) | GPQA Diamond (5-shot CoT ) | MBPP Plus - Pass@5 | HumanEval Plus - Pass@5 | SimpleQA (TotalAcc) |
|---|---|---|---|---|---|---|---|---|
| Small 3.1 24B Instruct | 80.62% | 66.76% | 69.30% | 44.42% | 45.96% | 74.63% | 88.99% | 10.43% |
| Small 3.2 24B Instruct | 80.50% | 69.06% | 69.42% | 44.22% | 46.13% | 78.33% | 92.90% | 12.10% |
| Model | MMMU | Mathvista | ChartQA | DocVQA | AI2D |
|---|---|---|---|---|---|
| Small 3.1 24B Instruct | 64.00% | 68.91% | 86.24% | 94.08% | 93.72% |
| Small 3.2 24B Instruct | 62.50% | 67.09% | 87.4% | 94.86% | 92.91% |
vllm (recommended): See heretransformers: See heretemperature=0.15.vLLM >= 0.9.1:pip install vllm --upgrademistral_common >= 1.6.2.python -c "import mistral_common; print(mistral_common.__version__)"vllm serve mistralai/Mistral-Small-3.2-24B-Instruct-2506 --tokenizer_mode mistral --config_format mistral --load_format mistral --tool-call-parser mistral --enable-auto-tool-choice --limit_mm_per_prompt 'image=10' --tensor-parallel-size 21from datetime import datetime, timedelta
2from openai import OpenAI
3from huggingface_hub import hf_hub_download
4# Modify OpenAI's API key and API base to use vLLM's API server.
5openai_api_key = "EMPTY"
6openai_api_base = "http://localhost:8000/v1"
7TEMP = 0.15
8MAX_TOK = 131072
9client = OpenAI(
10 api_key=openai_api_key,
11 base_url=openai_api_base,
12)
13models = client.models.list()
14model = models.data[0].id
15def load_system_prompt(repo_id: str, filename: str) -> str:
16 file_path = hf_hub_download(repo_id=repo_id, filename=filename)
17 with open(file_path, "r") as file:
18 system_prompt = file.read()
19 today = datetime.today().strftime("%Y-%m-%d")
20 yesterday = (datetime.today() - timedelta(days=1)).strftime("%Y-%m-%d")
21 model_name = repo_id.split("/")[-1]
22 return system_prompt.format(name=model_name, today=today, yesterday=yesterday)
23model_id = "mistralai/Mistral-Small-3.2-24B-Instruct-2506"
24SYSTEM_PROMPT = load_system_prompt(model_id, "SYSTEM_PROMPT.txt")
25image_url = "https://static.wikia.nocookie.net/essentialsdocs/images/7/70/Battle.png/revision/latest?cb=20220523172438"
26messages = [
27 {"role": "system", "content": SYSTEM_PROMPT},
28 {
29 "role": "user",
30 "content": [
31 {
32 "type": "text",
33 "text": "What action do you think I should take in this situation? List all the possible actions and explain why you think they are good or bad.",
34 },
35 {"type": "image_url", "image_url": {"url": image_url}},
36 ],
37 },
38]
39response = client.chat.completions.create(
40 model=model,
41 messages=messages,
42 temperature=TEMP,
43 max_tokens=MAX_TOK,
44)
45print(response.choices[0].message.content)
46# In this situation, you are playing a Pokémon game where your Pikachu (Level 42) is facing a wild Pidgey (Level 17). Here are the possible actions you can take and an analysis of each:
47# 1. **FIGHT**:
48# - **Pros**: Pikachu is significantly higher level than the wild Pidgey, which suggests that it should be able to defeat Pidgey easily. This could be a good opportunity to gain experience points and possibly items or money.
49# - **Cons**: There is always a small risk of Pikachu fainting, especially if Pidgey has a powerful move or a status effect that could hinder Pikachu. However, given the large level difference, this risk is minimal.
50# 2. **BAG**:
51# - **Pros**: You might have items in your bag that could help in this battle, such as Potions, Poké Balls, or Berries. Using an item could help you capture the Pidgey or heal your Pikachu if needed.
52# - **Cons**: Using items might not be necessary given the level difference. It could be more efficient to just fight and defeat the Pidgey quickly.
53# 3. **POKÉMON**:
54# - **Pros**: You might have another Pokémon in your party that is better suited for this battle or that you want to gain experience. Switching Pokémon could also be a strategic move if you want to train a lower-level Pokémon.
55# - **Cons**: Switching Pokémon might not be necessary since Pikachu is at a significant advantage. It could also waste time and potentially give Pidgey a turn to attack.
56# 4. **RUN**:
57# - **Pros**: Running away could save time and conserve your Pokémon's health and resources. If you are in a hurry or do not need the experience or items, running away is a safe option.
58# - **Cons**: Running away means you miss out on the experience points and potential items or money that you could gain from defeating the Pidgey. It also means you do not get the chance to capture the Pidgey if you wanted to.
59# ### Recommendation:
60# Given the significant level advantage, the best action is likely to **FIGHT**. This will allow you to quickly defeat the Pidgey, gain experience points, and potentially earn items or money. If you are concerned about Pikachu's health, you could use an item from your **BAG** to heal it before or during the battle. Running away or switching Pokémon does not seem necessary in this situation.1from openai import OpenAI
2from huggingface_hub import hf_hub_download
3# Modify OpenAI's API key and API base to use vLLM's API server.
4openai_api_key = "EMPTY"
5openai_api_base = "http://localhost:8000/v1"
6TEMP = 0.15
7MAX_TOK = 131072
8client = OpenAI(
9 api_key=openai_api_key,
10 base_url=openai_api_base,
11)
12models = client.models.list()
13model = models.data[0].id
14def load_system_prompt(repo_id: str, filename: str) -> str:
15 file_path = hf_hub_download(repo_id=repo_id, filename=filename)
16 with open(file_path, "r") as file:
17 system_prompt = file.read()
18 return system_prompt
19model_id = "mistralai/Mistral-Small-3.2-24B-Instruct-2506"
20SYSTEM_PROMPT = load_system_prompt(model_id, "SYSTEM_PROMPT.txt")
21image_url = "https://huggingface.co/datasets/patrickvonplaten/random_img/resolve/main/europe.png"
22tools = [
23 {
24 "type": "function",
25 "function": {
26 "name": "get_current_population",
27 "description": "Get the up-to-date population of a given country.",
28 "parameters": {
29 "type": "object",
30 "properties": {
31 "country": {
32 "type": "string",
33 "description": "The country to find the population of.",
34 },
35 "unit": {
36 "type": "string",
37 "description": "The unit for the population.",
38 "enum": ["millions", "thousands"],
39 },
40 },
41 "required": ["country", "unit"],
42 },
43 },
44 },
45 {
46 "type": "function",
47 "function": {
48 "name": "rewrite",
49 "description": "Rewrite a given text for improved clarity",
50 "parameters": {
51 "type": "object",
52 "properties": {
53 "text": {
54 "type": "string",
55 "description": "The input text to rewrite",
56 }
57 },
58 },
59 },
60 },
61]
62messages = [
63 {"role": "system", "content": SYSTEM_PROMPT},
64 {
65 "role": "user",
66 "content": "Could you please make the below article more concise?\n\nOpenAI is an artificial intelligence research laboratory consisting of the non-profit OpenAI Incorporated and its for-profit subsidiary corporation OpenAI Limited Partnership.",
67 },
68 {
69 "role": "assistant",
70 "content": "",
71 "tool_calls": [
72 {
73 "id": "bbc5b7ede",
74 "type": "function",
75 "function": {
76 "name": "rewrite",
77 "arguments": '{"text": "OpenAI is an artificial intelligence research laboratory consisting of the non-profit OpenAI Incorporated and its for-profit subsidiary corporation OpenAI Limited Partnership."}',
78 },
79 }
80 ],
81 },
82 {
83 "role": "tool",
84 "content": '{"action":"rewrite","outcome":"OpenAI is a FOR-profit company."}',
85 "tool_call_id": "bbc5b7ede",
86 "name": "rewrite",
87 },
88 {
89 "role": "assistant",
90 "content": "---\n\nOpenAI is a FOR-profit company.",
91 },
92 {
93 "role": "user",
94 "content": [
95 {
96 "type": "text",
97 "text": "Can you tell me what is the biggest country depicted on the map?",
98 },
99 {
100 "type": "image_url",
101 "image_url": {
102 "url": image_url,
103 },
104 },
105 ],
106 }
107]
108response = client.chat.completions.create(
109 model=model,
110 messages=messages,
111 temperature=TEMP,
112 max_tokens=MAX_TOK,
113 tools=tools,
114 tool_choice="auto",
115)
116assistant_message = response.choices[0].message.content
117print(assistant_message)
118# The biggest country depicted on the map is Russia.
119messages.extend([
120 {"role": "assistant", "content": assistant_message},
121 {"role": "user", "content": "What is the population of that country in millions?"},
122])
123response = client.chat.completions.create(
124 model=model,
125 messages=messages,
126 temperature=TEMP,
127 max_tokens=MAX_TOK,
128 tools=tools,
129 tool_choice="auto",
130)
131print(response.choices[0].message.tool_calls)
132# [ChatCompletionMessageToolCall(id='3e92V6Vfo', function=Function(arguments='{"country": "Russia", "unit": "millions"}', name='get_current_population'), type='function')]1import json
2from openai import OpenAI
3from huggingface_hub import hf_hub_download
4# Modify OpenAI's API key and API base to use vLLM's API server.
5openai_api_key = "EMPTY"
6openai_api_base = "http://localhost:8000/v1"
7TEMP = 0.15
8MAX_TOK = 131072
9client = OpenAI(
10 api_key=openai_api_key,
11 base_url=openai_api_base,
12)
13models = client.models.list()
14model = models.data[0].id
15def load_system_prompt(repo_id: str, filename: str) -> str:
16 file_path = hf_hub_download(repo_id=repo_id, filename=filename)
17 with open(file_path, "r") as file:
18 system_prompt = file.read()
19 return system_prompt
20model_id = "mistralai/Mistral-Small-3.2-24B-Instruct-2506"
21SYSTEM_PROMPT = load_system_prompt(model_id, "SYSTEM_PROMPT.txt")
22image_url = "https://math-coaching.com/img/fiche/46/expressions-mathematiques.jpg"
23def my_calculator(expression: str) -> str:
24 return str(eval(expression))
25tools = [
26 {
27 "type": "function",
28 "function": {
29 "name": "my_calculator",
30 "description": "A calculator that can evaluate a mathematical expression.",
31 "parameters": {
32 "type": "object",
33 "properties": {
34 "expression": {
35 "type": "string",
36 "description": "The mathematical expression to evaluate.",
37 },
38 },
39 "required": ["expression"],
40 },
41 },
42 },
43 {
44 "type": "function",
45 "function": {
46 "name": "rewrite",
47 "description": "Rewrite a given text for improved clarity",
48 "parameters": {
49 "type": "object",
50 "properties": {
51 "text": {
52 "type": "string",
53 "description": "The input text to rewrite",
54 }
55 },
56 },
57 },
58 },
59]
60messages = [
61 {"role": "system", "content": SYSTEM_PROMPT},
62 {
63 "role": "user",
64 "content": [
65 {
66 "type": "text",
67 "text": "Can you calculate the results for all the equations displayed in the image? Only compute the ones that involve numbers.",
68 },
69 {
70 "type": "image_url",
71 "image_url": {
72 "url": image_url,
73 },
74 },
75 ],
76 },
77]
78response = client.chat.completions.create(
79 model=model,
80 messages=messages,
81 temperature=TEMP,
82 max_tokens=MAX_TOK,
83 tools=tools,
84 tool_choice="auto",
85)
86tool_calls = response.choices[0].message.tool_calls
87print(tool_calls)
88# [ChatCompletionMessageToolCall(id='CyQBSAtGh', function=Function(arguments='{"expression": "6 + 2 * 3"}', name='my_calculator'), type='function'), ChatCompletionMessageToolCall(id='KQqRCqvzc', function=Function(arguments='{"expression": "19 - (8 + 2) + 1"}', name='my_calculator'), type='function')]
89results = []
90for tool_call in tool_calls:
91 function_name = tool_call.function.name
92 function_args = tool_call.function.arguments
93 if function_name == "my_calculator":
94 result = my_calculator(**json.loads(function_args))
95 results.append(result)
96messages.append({"role": "assistant", "tool_calls": tool_calls})
97for tool_call, result in zip(tool_calls, results):
98 messages.append(
99 {
100 "role": "tool",
101 "tool_call_id": tool_call.id,
102 "name": tool_call.function.name,
103 "content": result,
104 }
105 )
106response = client.chat.completions.create(
107 model=model,
108 messages=messages,
109 temperature=TEMP,
110 max_tokens=MAX_TOK,
111)
112print(response.choices[0].message.content)
113# Here are the results for the equations that involve numbers:
114# 1. \( 6 + 2 \times 3 = 12 \)
115# 3. \( 19 - (8 + 2) + 1 = 10 \)
116# For the other equations, you need to substitute the variables with specific values to compute the results.1from openai import OpenAI
2from huggingface_hub import hf_hub_download
3# Modify OpenAI's API key and API base to use vLLM's API server.
4openai_api_key = "EMPTY"
5openai_api_base = "http://localhost:8000/v1"
6TEMP = 0.15
7MAX_TOK = 131072
8client = OpenAI(
9 api_key=openai_api_key,
10 base_url=openai_api_base,
11)
12models = client.models.list()
13model = models.data[0].id
14def load_system_prompt(repo_id: str, filename: str) -> str:
15 file_path = hf_hub_download(repo_id=repo_id, filename=filename)
16 with open(file_path, "r") as file:
17 system_prompt = file.read()
18 return system_prompt
19model_id = "mistralai/Mistral-Small-3.2-24B-Instruct-2506"
20SYSTEM_PROMPT = load_system_prompt(model_id, "SYSTEM_PROMPT.txt")
21messages = [
22 {"role": "system", "content": SYSTEM_PROMPT},
23 {
24 "role": "user",
25 "content": "Write me a sentence where every word starts with the next letter in the alphabet - start with 'a' and end with 'z'.",
26 },
27]
28response = client.chat.completions.create(
29 model=model,
30 messages=messages,
31 temperature=TEMP,
32 max_tokens=MAX_TOK,
33)
34assistant_message = response.choices[0].message.content
35print(assistant_message)
36# Here's a sentence where each word starts with the next letter of the alphabet, starting from 'a' and ending with 'z':
37# "Always brave cats dance elegantly, fluffy giraffes happily ignore jungle kites, lovingly munching nuts, observing playful quails racing swiftly, tiny unicorns vaulting while xylophones yodel zealously."
38# This sentence follows the sequence from A to Z without skipping any letters.Transformers !Transformers make sure to have installed mistral-common >= 1.6.2 to use our tokenizer.pip install mistral-common --upgrade1from datetime import datetime, timedelta
2import torch
3from mistral_common.protocol.instruct.request import ChatCompletionRequest
4from mistral_common.tokens.tokenizers.mistral import MistralTokenizer
5from huggingface_hub import hf_hub_download
6from transformers import Mistral3ForConditionalGeneration
7def load_system_prompt(repo_id: str, filename: str) -> str:
8 file_path = hf_hub_download(repo_id=repo_id, filename=filename)
9 with open(file_path, "r") as file:
10 system_prompt = file.read()
11 today = datetime.today().strftime("%Y-%m-%d")
12 yesterday = (datetime.today() - timedelta(days=1)).strftime("%Y-%m-%d")
13 model_name = repo_id.split("/")[-1]
14 return system_prompt.format(name=model_name, today=today, yesterday=yesterday)
15model_id = "mistralai/Mistral-Small-3.2-24B-Instruct-2506"
16SYSTEM_PROMPT = load_system_prompt(model_id, "SYSTEM_PROMPT.txt")
17tokenizer = MistralTokenizer.from_hf_hub(model_id)
18model = Mistral3ForConditionalGeneration.from_pretrained(
19 model_id, torch_dtype=torch.bfloat16
20)
21image_url = "https://static.wikia.nocookie.net/essentialsdocs/images/7/70/Battle.png/revision/latest?cb=20220523172438"
22messages = [
23 {"role": "system", "content": SYSTEM_PROMPT},
24 {
25 "role": "user",
26 "content": [
27 {
28 "type": "text",
29 "text": "What action do you think I should take in this situation? List all the possible actions and explain why you think they are good or bad.",
30 },
31 {"type": "image_url", "image_url": {"url": image_url}},
32 ],
33 },
34]
35tokenized = tokenizer.encode_chat_completion(ChatCompletionRequest(messages=messages))
36input_ids = torch.tensor([tokenized.tokens])
37attention_mask = torch.ones_like(input_ids)
38pixel_values = torch.tensor(tokenized.images[0], dtype=torch.bfloat16).unsqueeze(0)
39image_sizes = torch.tensor([pixel_values.shape[-2:]])
40output = model.generate(
41 input_ids=input_ids,
42 attention_mask=attention_mask,
43 pixel_values=pixel_values,
44 image_sizes=image_sizes,
45 max_new_tokens=1000,
46)[0]
47decoded_output = tokenizer.decode(output[len(tokenized.tokens) :])
48print(decoded_output)
49# In this situation, you are playing a Pokémon game where your Pikachu (Level 42) is facing a wild Pidgey (Level 17). Here are the possible actions you can take and an analysis of each:
50# 1. **FIGHT**:
51# - **Pros**: Pikachu is significantly higher level than the wild Pidgey, which suggests that it should be able to defeat Pidgey easily. This could be a good opportunity to gain experience points and possibly items or money.
52# - **Cons**: There is always a small risk of Pikachu fainting, especially if Pidgey has a powerful move or a status effect that could hinder Pikachu. However, given the large level difference, this risk is minimal.
53# 2. **BAG**:
54# - **Pros**: You might have items in your bag that could help in this battle, such as Potions, Poké Balls, or Berries. Using an item could help you capture Pidgey or heal Pikachu if needed.
55# - **Cons**: Using items might not be necessary given the level difference. It could be more efficient to just fight and defeat Pidgey quickly.
56# 3. **POKÉMON**:
57# - **Pros**: You might have another Pokémon in your party that is better suited for this battle or that you want to gain experience. Switching Pokémon could also be strategic if you want to train a lower-level Pokémon.
58# - **Cons**: Switching Pokémon might not be necessary since Pikachu is at a significant advantage. It could also waste time and potentially give Pidgey a turn to attack.
59# 4. **RUN**:
60# - **Pros**: Running away could be a quick way to avoid the battle altogether. This might be useful if you are trying to conserve resources or if you are in a hurry to get to another location.
61# - **Cons**: Running away means you miss out on the experience points, items, or money that you could gain from defeating Pidgey. It also might not be the most efficient use of your time if you are trying to train your Pokémon.
62# ### Recommendation:
63# Given the significant level advantage, the best action to take is likely **FIGHT**. This will allow you to quickly defeat Pidgey and gain experience points for Pikachu. If you are concerned about Pikachu's health, you could use the **BAG** to heal Pikachu before or during the battle. Running away or switching Pokémon does not seem necessary in this situation.