Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +693 -0
- SYSTEM_PROMPT.txt +29 -0
- config.json +46 -0
- consolidated.safetensors +3 -0
- generation_config.json +7 -0
- params.json +29 -0
- tekken.json +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
tekken.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,693 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
- fr
|
5 |
+
- de
|
6 |
+
- es
|
7 |
+
- pt
|
8 |
+
- it
|
9 |
+
- ja
|
10 |
+
- ko
|
11 |
+
- ru
|
12 |
+
- zh
|
13 |
+
- ar
|
14 |
+
- fa
|
15 |
+
- id
|
16 |
+
- ms
|
17 |
+
- ne
|
18 |
+
- pl
|
19 |
+
- ro
|
20 |
+
- sr
|
21 |
+
- sv
|
22 |
+
- tr
|
23 |
+
- uk
|
24 |
+
- vi
|
25 |
+
- hi
|
26 |
+
- bn
|
27 |
+
license: apache-2.0
|
28 |
+
library_name: vllm
|
29 |
+
inference: false
|
30 |
+
base_model:
|
31 |
+
- mistralai/Mistral-Small-3.1-24B-Base-2503
|
32 |
+
extra_gated_description: >-
|
33 |
+
If you want to learn more about how we process your personal data, please read
|
34 |
+
our <a href="https://mistral.ai/terms/">Privacy Policy</a>.
|
35 |
+
pipeline_tag: image-text-to-text
|
36 |
+
---
|
37 |
+
|
38 |
+
# Mistral-Small-3.2-24B-Instruct-2506
|
39 |
+
|
40 |
+
Mistral-Small-3.2-24B-Instruct-2506 is a minor update of [Mistral-Small-3.1-24B-Instruct-2503](https://huggingface.co/mistralai/Mistral-Small-3.1-24B-Base-2503).
|
41 |
+
|
42 |
+
Small-3.2 improves in the following categories:
|
43 |
+
- **Instruction following**: Small-3.2 is better at following precise instructions
|
44 |
+
- **Repetition errors**: Small-3.2 produces less infinite generations or repetitive answers
|
45 |
+
- **Function calling**: Small-3.2's function calling template is more robust (see [here](https://github.com/mistralai/mistral-common/blob/535b4d0a0fc94674ea17db6cf8dc2079b81cbcfa/src/mistral_common/tokens/tokenizers/instruct.py#L778) and [examples](#function-calling))
|
46 |
+
|
47 |
+
In all other categories Small-3.2 should match or slightly improve compared to [Mistral-Small-3.1-24B-Instruct-2503](https://huggingface.co/mistralai/Mistral-Small-3.1-24B-Base-2503).
|
48 |
+
|
49 |
+
## Key Features
|
50 |
+
- same as [Mistral-Small-3.1-24B-Instruct-2503](https://huggingface.co/mistralai/Mistral-Small-3.1-24B-Base-2503#key-features)
|
51 |
+
|
52 |
+
## Benchmark Results
|
53 |
+
|
54 |
+
We compare Mistral-Small-3.2-24B to [Mistral-Small-3.1-24B-Instruct-2503](https://huggingface.co/mistralai/Mistral-Small-3.1-24B-Base-2503).
|
55 |
+
For more comparison against other models of similar size, please check [Mistral-Small-3.1's Benchmarks'](https://huggingface.co/mistralai/Mistral-Small-3.1-24B-Base-2503#benchmark-results)
|
56 |
+
|
57 |
+
### Text
|
58 |
+
|
59 |
+
#### Instruction Following / Chat / Tone
|
60 |
+
|
61 |
+
| Model | Wildbench v2 | Arena Hard v2 | IF (Internal; accuracy) |
|
62 |
+
|-------|---------------|---------------|------------------------|
|
63 |
+
| Small 3.1 24B Instruct | 55.6% | 19.56% | 82.75% |
|
64 |
+
| **Small 3.2 24B Instruct** | **65.33%** | **43.1%** | **84.78%** |
|
65 |
+
|
66 |
+
#### Infinite Generations
|
67 |
+
|
68 |
+
Small 3.2 reduces infitine generations by 2x on challenging, long and repetitive prompts.
|
69 |
+
|
70 |
+
| Model | Infinite Generations (Internal; Lower is better) |
|
71 |
+
|-------|-------|
|
72 |
+
| Small 3.1 24B Instruct | 2.11% |
|
73 |
+
| **Small 3.2 24B Instruct** | **1.29%** |
|
74 |
+
|
75 |
+
#### STEM
|
76 |
+
|
77 |
+
| 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)|
|
78 |
+
|--------------------------------|-----------|-----------------------|------------------------|------------------------|---------------------------|--------------------|-------------------------|--------------------|
|
79 |
+
| Small 3.1 24B Instruct | 80.62% | 66.76% | 69.30% | 44.42% | 45.96% | 74.63% | 88.99% | 10.43% |
|
80 |
+
| **Small 3.2 24B Instruct** | 80.50% | **69.06%** | 69.42% | 44.22% | 46.13% | **78.33%** | **92.90%** | **12.10%** |
|
81 |
+
|
82 |
+
### Vision
|
83 |
+
|
84 |
+
| Model | MMMU | Mathvista | ChartQA | DocVQA | AI2D |
|
85 |
+
|--------------------------------|------------|-----------|-----------|-----------|-----------|
|
86 |
+
| Small 3.1 24B Instruct | **64.00%** | **68.91%**| 86.24% | 94.08% | 93.72% |
|
87 |
+
| **Small 3.2 24B Instruct** | 62.50% | 67.09% | **87.4%** | 94.86% | 92.91% |
|
88 |
+
|
89 |
+
|
90 |
+
## Usage
|
91 |
+
|
92 |
+
The model can be used with the following frameworks;
|
93 |
+
- [`vllm (recommended)`](https://github.com/vllm-project/vllm): See [here](#vllm-recommended)
|
94 |
+
- [`transformers`](https://github.com/huggingface/transformers): See [here](#transformers)
|
95 |
+
|
96 |
+
**Note 1**: We recommend using a relatively low temperature, such as `temperature=0.15`.
|
97 |
+
|
98 |
+
**Note 2**: Make sure to add a system prompt to the model to best tailer it for your needs. If you want to use the model as a general assistant, we recommend to use the one provided in the [SYSTEM_PROMPT.txt](https://huggingface.co/mistralai/Mistral-Small-3.2-24B-Instruct-2506/blob/main/SYSTEM_PROMPT.txt) file.
|
99 |
+
|
100 |
+
### vLLM (recommended)
|
101 |
+
|
102 |
+
We recommend using this model with [vLLM](https://github.com/vllm-project/vllm).
|
103 |
+
|
104 |
+
#### Installation
|
105 |
+
|
106 |
+
Make sure to install [`vLLM >= 0.9.1`](https://github.com/vllm-project/vllm/releases/tag/v0.9.1):
|
107 |
+
|
108 |
+
```
|
109 |
+
pip install vllm --upgrade
|
110 |
+
```
|
111 |
+
|
112 |
+
Doing so should automatically install [`mistral_common >= 1.6.2`](https://github.com/mistralai/mistral-common/releases/tag/v1.6.2).
|
113 |
+
|
114 |
+
To check:
|
115 |
+
```
|
116 |
+
python -c "import mistral_common; print(mistral_common.__version__)"
|
117 |
+
```
|
118 |
+
|
119 |
+
You can also make use of a ready-to-go [docker image](https://github.com/vllm-project/vllm/blob/main/Dockerfile) or on the [docker hub](https://hub.docker.com/layers/vllm/vllm-openai/latest/images/sha256-de9032a92ffea7b5c007dad80b38fd44aac11eddc31c435f8e52f3b7404bbf39).
|
120 |
+
|
121 |
+
#### Serve
|
122 |
+
|
123 |
+
We recommand that you use Mistral-Small-3.2-24B-Instruct-2506 in a server/client setting.
|
124 |
+
|
125 |
+
1. Spin up a server:
|
126 |
+
|
127 |
+
```
|
128 |
+
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 2
|
129 |
+
```
|
130 |
+
|
131 |
+
**Note:** Running Mistral-Small-3.2-24B-Instruct-2506 on GPU requires ~55 GB of GPU RAM in bf16 or fp16.
|
132 |
+
|
133 |
+
|
134 |
+
2. To ping the client you can use a simple Python snippet. See the following examples.
|
135 |
+
|
136 |
+
|
137 |
+
#### Vision reasoning
|
138 |
+
|
139 |
+
Take leverage of the vision capabilities of Mistral-Small-3.2-24B-Instruct-2506 to take the best choice given a scenario, go catch them all !
|
140 |
+
|
141 |
+
<details>
|
142 |
+
<summary>Python snippet</summary>
|
143 |
+
|
144 |
+
```py
|
145 |
+
from datetime import datetime, timedelta
|
146 |
+
|
147 |
+
from openai import OpenAI
|
148 |
+
from huggingface_hub import hf_hub_download
|
149 |
+
|
150 |
+
# Modify OpenAI's API key and API base to use vLLM's API server.
|
151 |
+
openai_api_key = "EMPTY"
|
152 |
+
openai_api_base = "http://localhost:8000/v1"
|
153 |
+
|
154 |
+
TEMP = 0.15
|
155 |
+
MAX_TOK = 131072
|
156 |
+
|
157 |
+
client = OpenAI(
|
158 |
+
api_key=openai_api_key,
|
159 |
+
base_url=openai_api_base,
|
160 |
+
)
|
161 |
+
|
162 |
+
models = client.models.list()
|
163 |
+
model = models.data[0].id
|
164 |
+
|
165 |
+
|
166 |
+
def load_system_prompt(repo_id: str, filename: str) -> str:
|
167 |
+
file_path = hf_hub_download(repo_id=repo_id, filename=filename)
|
168 |
+
with open(file_path, "r") as file:
|
169 |
+
system_prompt = file.read()
|
170 |
+
today = datetime.today().strftime("%Y-%m-%d")
|
171 |
+
yesterday = (datetime.today() - timedelta(days=1)).strftime("%Y-%m-%d")
|
172 |
+
model_name = repo_id.split("/")[-1]
|
173 |
+
return system_prompt.format(name=model_name, today=today, yesterday=yesterday)
|
174 |
+
|
175 |
+
|
176 |
+
model_id = "mistralai/Mistral-Small-3.2-24B-Instruct-2506"
|
177 |
+
SYSTEM_PROMPT = load_system_prompt(model_id, "SYSTEM_PROMPT.txt")
|
178 |
+
image_url = "https://static.wikia.nocookie.net/essentialsdocs/images/7/70/Battle.png/revision/latest?cb=20220523172438"
|
179 |
+
|
180 |
+
messages = [
|
181 |
+
{"role": "system", "content": SYSTEM_PROMPT},
|
182 |
+
{
|
183 |
+
"role": "user",
|
184 |
+
"content": [
|
185 |
+
{
|
186 |
+
"type": "text",
|
187 |
+
"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.",
|
188 |
+
},
|
189 |
+
{"type": "image_url", "image_url": {"url": image_url}},
|
190 |
+
],
|
191 |
+
},
|
192 |
+
]
|
193 |
+
|
194 |
+
|
195 |
+
response = client.chat.completions.create(
|
196 |
+
model=model,
|
197 |
+
messages=messages,
|
198 |
+
temperature=TEMP,
|
199 |
+
max_tokens=MAX_TOK,
|
200 |
+
)
|
201 |
+
|
202 |
+
print(response.choices[0].message.content)
|
203 |
+
# 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:
|
204 |
+
|
205 |
+
# 1. **FIGHT**:
|
206 |
+
# - **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.
|
207 |
+
# - **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.
|
208 |
+
|
209 |
+
# 2. **BAG**:
|
210 |
+
# - **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.
|
211 |
+
# - **Cons**: Using items might not be necessary given the level difference. It could be more efficient to just fight and defeat the Pidgey quickly.
|
212 |
+
|
213 |
+
# 3. **POKÉMON**:
|
214 |
+
# - **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.
|
215 |
+
# - **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.
|
216 |
+
|
217 |
+
# 4. **RUN**:
|
218 |
+
# - **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.
|
219 |
+
# - **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.
|
220 |
+
|
221 |
+
# ### Recommendation:
|
222 |
+
# 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.
|
223 |
+
```
|
224 |
+
</details>
|
225 |
+
|
226 |
+
#### Function calling
|
227 |
+
|
228 |
+
Mistral-Small-3.2-24B-Instruct-2506 is excellent at function / tool calling tasks via vLLM. *E.g.:*
|
229 |
+
|
230 |
+
<details>
|
231 |
+
<summary>Python snippet - easy</summary>
|
232 |
+
|
233 |
+
```py
|
234 |
+
from openai import OpenAI
|
235 |
+
from huggingface_hub import hf_hub_download
|
236 |
+
|
237 |
+
# Modify OpenAI's API key and API base to use vLLM's API server.
|
238 |
+
openai_api_key = "EMPTY"
|
239 |
+
openai_api_base = "http://localhost:8000/v1"
|
240 |
+
|
241 |
+
TEMP = 0.15
|
242 |
+
MAX_TOK = 131072
|
243 |
+
|
244 |
+
client = OpenAI(
|
245 |
+
api_key=openai_api_key,
|
246 |
+
base_url=openai_api_base,
|
247 |
+
)
|
248 |
+
|
249 |
+
models = client.models.list()
|
250 |
+
model = models.data[0].id
|
251 |
+
|
252 |
+
def load_system_prompt(repo_id: str, filename: str) -> str:
|
253 |
+
file_path = hf_hub_download(repo_id=repo_id, filename=filename)
|
254 |
+
with open(file_path, "r") as file:
|
255 |
+
system_prompt = file.read()
|
256 |
+
return system_prompt
|
257 |
+
|
258 |
+
model_id = "mistralai/Mistral-Small-3.2-24B-Instruct-2506"
|
259 |
+
SYSTEM_PROMPT = load_system_prompt(model_id, "SYSTEM_PROMPT.txt")
|
260 |
+
|
261 |
+
image_url = "https://huggingface.co/datasets/patrickvonplaten/random_img/resolve/main/europe.png"
|
262 |
+
|
263 |
+
tools = [
|
264 |
+
{
|
265 |
+
"type": "function",
|
266 |
+
"function": {
|
267 |
+
"name": "get_current_population",
|
268 |
+
"description": "Get the up-to-date population of a given country.",
|
269 |
+
"parameters": {
|
270 |
+
"type": "object",
|
271 |
+
"properties": {
|
272 |
+
"country": {
|
273 |
+
"type": "string",
|
274 |
+
"description": "The country to find the population of.",
|
275 |
+
},
|
276 |
+
"unit": {
|
277 |
+
"type": "string",
|
278 |
+
"description": "The unit for the population.",
|
279 |
+
"enum": ["millions", "thousands"],
|
280 |
+
},
|
281 |
+
},
|
282 |
+
"required": ["country", "unit"],
|
283 |
+
},
|
284 |
+
},
|
285 |
+
},
|
286 |
+
{
|
287 |
+
"type": "function",
|
288 |
+
"function": {
|
289 |
+
"name": "rewrite",
|
290 |
+
"description": "Rewrite a given text for improved clarity",
|
291 |
+
"parameters": {
|
292 |
+
"type": "object",
|
293 |
+
"properties": {
|
294 |
+
"text": {
|
295 |
+
"type": "string",
|
296 |
+
"description": "The input text to rewrite",
|
297 |
+
}
|
298 |
+
},
|
299 |
+
},
|
300 |
+
},
|
301 |
+
},
|
302 |
+
]
|
303 |
+
|
304 |
+
messages = [
|
305 |
+
{"role": "system", "content": SYSTEM_PROMPT},
|
306 |
+
{
|
307 |
+
"role": "user",
|
308 |
+
"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.",
|
309 |
+
},
|
310 |
+
{
|
311 |
+
"role": "assistant",
|
312 |
+
"content": "",
|
313 |
+
"tool_calls": [
|
314 |
+
{
|
315 |
+
"id": "bbc5b7ede",
|
316 |
+
"type": "function",
|
317 |
+
"function": {
|
318 |
+
"name": "rewrite",
|
319 |
+
"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."}',
|
320 |
+
},
|
321 |
+
}
|
322 |
+
],
|
323 |
+
},
|
324 |
+
{
|
325 |
+
"role": "tool",
|
326 |
+
"content": '{"action":"rewrite","outcome":"OpenAI is a FOR-profit company."}',
|
327 |
+
"tool_call_id": "bbc5b7ede",
|
328 |
+
"name": "rewrite",
|
329 |
+
},
|
330 |
+
{
|
331 |
+
"role": "assistant",
|
332 |
+
"content": "---\n\nOpenAI is a FOR-profit company.",
|
333 |
+
},
|
334 |
+
{
|
335 |
+
"role": "user",
|
336 |
+
"content": [
|
337 |
+
{
|
338 |
+
"type": "text",
|
339 |
+
"text": "Can you tell me what is the biggest country depicted on the map?",
|
340 |
+
},
|
341 |
+
{
|
342 |
+
"type": "image_url",
|
343 |
+
"image_url": {
|
344 |
+
"url": image_url,
|
345 |
+
},
|
346 |
+
},
|
347 |
+
],
|
348 |
+
}
|
349 |
+
]
|
350 |
+
|
351 |
+
response = client.chat.completions.create(
|
352 |
+
model=model,
|
353 |
+
messages=messages,
|
354 |
+
temperature=TEMP,
|
355 |
+
max_tokens=MAX_TOK,
|
356 |
+
tools=tools,
|
357 |
+
tool_choice="auto",
|
358 |
+
)
|
359 |
+
|
360 |
+
assistant_message = response.choices[0].message.content
|
361 |
+
print(assistant_message)
|
362 |
+
# The biggest country depicted on the map is Russia.
|
363 |
+
|
364 |
+
messages.extend([
|
365 |
+
{"role": "assistant", "content": assistant_message},
|
366 |
+
{"role": "user", "content": "What is the population of that country in millions?"},
|
367 |
+
])
|
368 |
+
|
369 |
+
response = client.chat.completions.create(
|
370 |
+
model=model,
|
371 |
+
messages=messages,
|
372 |
+
temperature=TEMP,
|
373 |
+
max_tokens=MAX_TOK,
|
374 |
+
tools=tools,
|
375 |
+
tool_choice="auto",
|
376 |
+
)
|
377 |
+
|
378 |
+
print(response.choices[0].message.tool_calls)
|
379 |
+
# [ChatCompletionMessageToolCall(id='3e92V6Vfo', function=Function(arguments='{"country": "Russia", "unit": "millions"}', name='get_current_population'), type='function')]
|
380 |
+
```
|
381 |
+
|
382 |
+
</details>
|
383 |
+
|
384 |
+
<details>
|
385 |
+
<summary>Python snippet - complex</summary>
|
386 |
+
|
387 |
+
```python
|
388 |
+
import json
|
389 |
+
from openai import OpenAI
|
390 |
+
from huggingface_hub import hf_hub_download
|
391 |
+
|
392 |
+
# Modify OpenAI's API key and API base to use vLLM's API server.
|
393 |
+
openai_api_key = "EMPTY"
|
394 |
+
openai_api_base = "http://localhost:8000/v1"
|
395 |
+
|
396 |
+
TEMP = 0.15
|
397 |
+
MAX_TOK = 131072
|
398 |
+
|
399 |
+
client = OpenAI(
|
400 |
+
api_key=openai_api_key,
|
401 |
+
base_url=openai_api_base,
|
402 |
+
)
|
403 |
+
|
404 |
+
models = client.models.list()
|
405 |
+
model = models.data[0].id
|
406 |
+
|
407 |
+
|
408 |
+
def load_system_prompt(repo_id: str, filename: str) -> str:
|
409 |
+
file_path = hf_hub_download(repo_id=repo_id, filename=filename)
|
410 |
+
with open(file_path, "r") as file:
|
411 |
+
system_prompt = file.read()
|
412 |
+
return system_prompt
|
413 |
+
|
414 |
+
|
415 |
+
model_id = "mistralai/Mistral-Small-3.2-24B-Instruct-2506"
|
416 |
+
SYSTEM_PROMPT = load_system_prompt(model_id, "SYSTEM_PROMPT.txt")
|
417 |
+
|
418 |
+
image_url = "https://math-coaching.com/img/fiche/46/expressions-mathematiques.jpg"
|
419 |
+
|
420 |
+
|
421 |
+
def my_calculator(expression: str) -> str:
|
422 |
+
return str(eval(expression))
|
423 |
+
|
424 |
+
|
425 |
+
tools = [
|
426 |
+
{
|
427 |
+
"type": "function",
|
428 |
+
"function": {
|
429 |
+
"name": "my_calculator",
|
430 |
+
"description": "A calculator that can evaluate a mathematical expression.",
|
431 |
+
"parameters": {
|
432 |
+
"type": "object",
|
433 |
+
"properties": {
|
434 |
+
"expression": {
|
435 |
+
"type": "string",
|
436 |
+
"description": "The mathematical expression to evaluate.",
|
437 |
+
},
|
438 |
+
},
|
439 |
+
"required": ["expression"],
|
440 |
+
},
|
441 |
+
},
|
442 |
+
},
|
443 |
+
{
|
444 |
+
"type": "function",
|
445 |
+
"function": {
|
446 |
+
"name": "rewrite",
|
447 |
+
"description": "Rewrite a given text for improved clarity",
|
448 |
+
"parameters": {
|
449 |
+
"type": "object",
|
450 |
+
"properties": {
|
451 |
+
"text": {
|
452 |
+
"type": "string",
|
453 |
+
"description": "The input text to rewrite",
|
454 |
+
}
|
455 |
+
},
|
456 |
+
},
|
457 |
+
},
|
458 |
+
},
|
459 |
+
]
|
460 |
+
|
461 |
+
messages = [
|
462 |
+
{"role": "system", "content": SYSTEM_PROMPT},
|
463 |
+
{
|
464 |
+
"role": "user",
|
465 |
+
"content": [
|
466 |
+
{
|
467 |
+
"type": "text",
|
468 |
+
"text": "Can you calculate the results for all the equations displayed in the image? Only compute the ones that involve numbers.",
|
469 |
+
},
|
470 |
+
{
|
471 |
+
"type": "image_url",
|
472 |
+
"image_url": {
|
473 |
+
"url": image_url,
|
474 |
+
},
|
475 |
+
},
|
476 |
+
],
|
477 |
+
},
|
478 |
+
]
|
479 |
+
|
480 |
+
response = client.chat.completions.create(
|
481 |
+
model=model,
|
482 |
+
messages=messages,
|
483 |
+
temperature=TEMP,
|
484 |
+
max_tokens=MAX_TOK,
|
485 |
+
tools=tools,
|
486 |
+
tool_choice="auto",
|
487 |
+
)
|
488 |
+
|
489 |
+
tool_calls = response.choices[0].message.tool_calls
|
490 |
+
print(tool_calls)
|
491 |
+
# [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')]
|
492 |
+
|
493 |
+
results = []
|
494 |
+
for tool_call in tool_calls:
|
495 |
+
function_name = tool_call.function.name
|
496 |
+
function_args = tool_call.function.arguments
|
497 |
+
if function_name == "my_calculator":
|
498 |
+
result = my_calculator(**json.loads(function_args))
|
499 |
+
results.append(result)
|
500 |
+
|
501 |
+
messages.append({"role": "assistant", "tool_calls": tool_calls})
|
502 |
+
for tool_call, result in zip(tool_calls, results):
|
503 |
+
messages.append(
|
504 |
+
{
|
505 |
+
"role": "tool",
|
506 |
+
"tool_call_id": tool_call.id,
|
507 |
+
"name": tool_call.function.name,
|
508 |
+
"content": result,
|
509 |
+
}
|
510 |
+
)
|
511 |
+
|
512 |
+
|
513 |
+
response = client.chat.completions.create(
|
514 |
+
model=model,
|
515 |
+
messages=messages,
|
516 |
+
temperature=TEMP,
|
517 |
+
max_tokens=MAX_TOK,
|
518 |
+
)
|
519 |
+
|
520 |
+
print(response.choices[0].message.content)
|
521 |
+
# Here are the results for the equations that involve numbers:
|
522 |
+
|
523 |
+
# 1. \( 6 + 2 \times 3 = 12 \)
|
524 |
+
# 3. \( 19 - (8 + 2) + 1 = 10 \)
|
525 |
+
|
526 |
+
# For the other equations, you need to substitute the variables with specific values to compute the results.
|
527 |
+
```
|
528 |
+
|
529 |
+
</details>
|
530 |
+
|
531 |
+
#### Instruction following
|
532 |
+
|
533 |
+
Mistral-Small-3.2-24B-Instruct-2506 will follow your instructions down to the last letter !
|
534 |
+
|
535 |
+
<details>
|
536 |
+
<summary>Python snippet</summary>
|
537 |
+
|
538 |
+
```python
|
539 |
+
from openai import OpenAI
|
540 |
+
from huggingface_hub import hf_hub_download
|
541 |
+
|
542 |
+
# Modify OpenAI's API key and API base to use vLLM's API server.
|
543 |
+
openai_api_key = "EMPTY"
|
544 |
+
openai_api_base = "http://localhost:8000/v1"
|
545 |
+
|
546 |
+
TEMP = 0.15
|
547 |
+
MAX_TOK = 131072
|
548 |
+
|
549 |
+
client = OpenAI(
|
550 |
+
api_key=openai_api_key,
|
551 |
+
base_url=openai_api_base,
|
552 |
+
)
|
553 |
+
|
554 |
+
models = client.models.list()
|
555 |
+
model = models.data[0].id
|
556 |
+
|
557 |
+
|
558 |
+
def load_system_prompt(repo_id: str, filename: str) -> str:
|
559 |
+
file_path = hf_hub_download(repo_id=repo_id, filename=filename)
|
560 |
+
with open(file_path, "r") as file:
|
561 |
+
system_prompt = file.read()
|
562 |
+
return system_prompt
|
563 |
+
|
564 |
+
|
565 |
+
model_id = "mistralai/Mistral-Small-3.2-24B-Instruct-2506"
|
566 |
+
SYSTEM_PROMPT = load_system_prompt(model_id, "SYSTEM_PROMPT.txt")
|
567 |
+
|
568 |
+
messages = [
|
569 |
+
{"role": "system", "content": SYSTEM_PROMPT},
|
570 |
+
{
|
571 |
+
"role": "user",
|
572 |
+
"content": "Write me a sentence where every word starts with the next letter in the alphabet - start with 'a' and end with 'z'.",
|
573 |
+
},
|
574 |
+
]
|
575 |
+
|
576 |
+
response = client.chat.completions.create(
|
577 |
+
model=model,
|
578 |
+
messages=messages,
|
579 |
+
temperature=TEMP,
|
580 |
+
max_tokens=MAX_TOK,
|
581 |
+
)
|
582 |
+
|
583 |
+
assistant_message = response.choices[0].message.content
|
584 |
+
print(assistant_message)
|
585 |
+
|
586 |
+
# Here's a sentence where each word starts with the next letter of the alphabet, starting from 'a' and ending with 'z':
|
587 |
+
|
588 |
+
# "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."
|
589 |
+
|
590 |
+
# This sentence follows the sequence from A to Z without skipping any letters.
|
591 |
+
```
|
592 |
+
</details>
|
593 |
+
|
594 |
+
### Transformers
|
595 |
+
|
596 |
+
You can also use Mistral-Small-3.2-24B-Instruct-2506 with `Transformers` !
|
597 |
+
|
598 |
+
To make the best use of our model with `Transformers` make sure to have [installed](https://github.com/mistralai/mistral-common) `mistral-common >= 1.6.2` to use our tokenizer.
|
599 |
+
|
600 |
+
```bash
|
601 |
+
pip install mistral-common --upgrade
|
602 |
+
```
|
603 |
+
|
604 |
+
Then load our tokenizer along with the model and generate:
|
605 |
+
|
606 |
+
<details>
|
607 |
+
<summary>Python snippet</summary>
|
608 |
+
|
609 |
+
```python
|
610 |
+
from datetime import datetime, timedelta
|
611 |
+
import torch
|
612 |
+
|
613 |
+
from mistral_common.protocol.instruct.request import ChatCompletionRequest
|
614 |
+
from mistral_common.tokens.tokenizers.mistral import MistralTokenizer
|
615 |
+
from huggingface_hub import hf_hub_download
|
616 |
+
from transformers import Mistral3ForConditionalGeneration
|
617 |
+
|
618 |
+
|
619 |
+
def load_system_prompt(repo_id: str, filename: str) -> str:
|
620 |
+
file_path = hf_hub_download(repo_id=repo_id, filename=filename)
|
621 |
+
with open(file_path, "r") as file:
|
622 |
+
system_prompt = file.read()
|
623 |
+
today = datetime.today().strftime("%Y-%m-%d")
|
624 |
+
yesterday = (datetime.today() - timedelta(days=1)).strftime("%Y-%m-%d")
|
625 |
+
model_name = repo_id.split("/")[-1]
|
626 |
+
return system_prompt.format(name=model_name, today=today, yesterday=yesterday)
|
627 |
+
|
628 |
+
|
629 |
+
model_id = "mistralai/Mistral-Small-3.2-24B-Instruct-2506"
|
630 |
+
SYSTEM_PROMPT = load_system_prompt(model_id, "SYSTEM_PROMPT.txt")
|
631 |
+
|
632 |
+
tokenizer = MistralTokenizer.from_hf_hub(model_id)
|
633 |
+
|
634 |
+
model = Mistral3ForConditionalGeneration.from_pretrained(
|
635 |
+
model_id, torch_dtype=torch.bfloat16
|
636 |
+
)
|
637 |
+
|
638 |
+
image_url = "https://static.wikia.nocookie.net/essentialsdocs/images/7/70/Battle.png/revision/latest?cb=20220523172438"
|
639 |
+
|
640 |
+
messages = [
|
641 |
+
{"role": "system", "content": SYSTEM_PROMPT},
|
642 |
+
{
|
643 |
+
"role": "user",
|
644 |
+
"content": [
|
645 |
+
{
|
646 |
+
"type": "text",
|
647 |
+
"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.",
|
648 |
+
},
|
649 |
+
{"type": "image_url", "image_url": {"url": image_url}},
|
650 |
+
],
|
651 |
+
},
|
652 |
+
]
|
653 |
+
|
654 |
+
tokenized = tokenizer.encode_chat_completion(ChatCompletionRequest(messages=messages))
|
655 |
+
|
656 |
+
input_ids = torch.tensor([tokenized.tokens])
|
657 |
+
attention_mask = torch.ones_like(input_ids)
|
658 |
+
pixel_values = torch.tensor(tokenized.images[0], dtype=torch.bfloat16).unsqueeze(0)
|
659 |
+
image_sizes = torch.tensor([pixel_values.shape[-2:]])
|
660 |
+
|
661 |
+
output = model.generate(
|
662 |
+
input_ids=input_ids,
|
663 |
+
attention_mask=attention_mask,
|
664 |
+
pixel_values=pixel_values,
|
665 |
+
image_sizes=image_sizes,
|
666 |
+
max_new_tokens=1000,
|
667 |
+
)[0]
|
668 |
+
|
669 |
+
decoded_output = tokenizer.decode(output[len(tokenized.tokens) :])
|
670 |
+
print(decoded_output)
|
671 |
+
# 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:
|
672 |
+
|
673 |
+
# 1. **FIGHT**:
|
674 |
+
# - **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.
|
675 |
+
# - **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.
|
676 |
+
|
677 |
+
# 2. **BAG**:
|
678 |
+
# - **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.
|
679 |
+
# - **Cons**: Using items might not be necessary given the level difference. It could be more efficient to just fight and defeat Pidgey quickly.
|
680 |
+
|
681 |
+
# 3. **POKÉMON**:
|
682 |
+
# - **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.
|
683 |
+
# - **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.
|
684 |
+
|
685 |
+
# 4. **RUN**:
|
686 |
+
# - **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.
|
687 |
+
# - **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.
|
688 |
+
|
689 |
+
# ### Recommendation:
|
690 |
+
# 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.
|
691 |
+
```
|
692 |
+
|
693 |
+
</details>
|
SYSTEM_PROMPT.txt
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
You are {name}, a Large Language Model (LLM) created by Mistral AI, a French startup headquartered in Paris.
|
2 |
+
You power an AI assistant called Le Chat.
|
3 |
+
Your knowledge base was last updated on 2023-10-01.
|
4 |
+
The current date is {today}.
|
5 |
+
|
6 |
+
When you're not sure about some information or when the user's request requires up-to-date or specific data, you must use the available tools to fetch the information. Do not hesitate to use tools whenever they can provide a more accurate or complete response. If no relevant tools are available, then clearly state that you don't have the information and avoid making up anything.
|
7 |
+
If the user's question is not clear, ambiguous, or does not provide enough context for you to accurately answer the question, you do not try to answer it right away and you rather ask the user to clarify their request (e.g. "What are some good restaurants around me?" => "Where are you?" or "When is the next flight to Tokyo" => "Where do you travel from?").
|
8 |
+
You are always very attentive to dates, in particular you try to resolve dates (e.g. "yesterday" is {yesterday}) and when asked about information at specific dates, you discard information that is at another date.
|
9 |
+
You follow these instructions in all languages, and always respond to the user in the language they use or request.
|
10 |
+
Next sections describe the capabilities that you have.
|
11 |
+
|
12 |
+
# WEB BROWSING INSTRUCTIONS
|
13 |
+
|
14 |
+
You cannot perform any web search or access internet to open URLs, links etc. If it seems like the user is expecting you to do so, you clarify the situation and ask the user to copy paste the text directly in the chat.
|
15 |
+
|
16 |
+
# MULTI-MODAL INSTRUCTIONS
|
17 |
+
|
18 |
+
You have the ability to read images, but you cannot generate images. You also cannot transcribe audio files or videos.
|
19 |
+
You cannot read nor transcribe audio files or videos.
|
20 |
+
|
21 |
+
TOOL CALLING INSTRUCTIONS
|
22 |
+
|
23 |
+
You may have access to tools that you can use to fetch information or perform actions. You must use these tools in the following situations:
|
24 |
+
|
25 |
+
1. When the request requires up-to-date information.
|
26 |
+
2. When the request requires specific data that you do not have in your knowledge base.
|
27 |
+
3. When the request involves actions that you cannot perform without tools.
|
28 |
+
|
29 |
+
Always prioritize using tools to provide the most accurate and helpful response. If tools are not available, inform the user that you cannot perform the requested action at the moment.
|
config.json
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"Mistral3ForConditionalGeneration"
|
4 |
+
],
|
5 |
+
"image_token_index": 10,
|
6 |
+
"model_type": "mistral3",
|
7 |
+
"multimodal_projector_bias": false,
|
8 |
+
"projector_hidden_act": "gelu",
|
9 |
+
"spatial_merge_size": 2,
|
10 |
+
"text_config": {
|
11 |
+
"attention_dropout": 0.0,
|
12 |
+
"head_dim": 128,
|
13 |
+
"hidden_act": "silu",
|
14 |
+
"hidden_size": 5120,
|
15 |
+
"initializer_range": 0.02,
|
16 |
+
"intermediate_size": 32768,
|
17 |
+
"max_position_embeddings": 131072,
|
18 |
+
"model_type": "mistral",
|
19 |
+
"num_attention_heads": 32,
|
20 |
+
"num_hidden_layers": 40,
|
21 |
+
"num_key_value_heads": 8,
|
22 |
+
"rms_norm_eps": 1e-05,
|
23 |
+
"rope_theta": 1000000000.0,
|
24 |
+
"sliding_window": null,
|
25 |
+
"use_cache": true,
|
26 |
+
"vocab_size": 131072
|
27 |
+
},
|
28 |
+
"torch_dtype": "bfloat16",
|
29 |
+
"transformers_version": "4.52.4",
|
30 |
+
"vision_config": {
|
31 |
+
"attention_dropout": 0.0,
|
32 |
+
"head_dim": 64,
|
33 |
+
"hidden_act": "silu",
|
34 |
+
"hidden_size": 1024,
|
35 |
+
"image_size": 1540,
|
36 |
+
"initializer_range": 0.02,
|
37 |
+
"intermediate_size": 4096,
|
38 |
+
"model_type": "pixtral",
|
39 |
+
"num_attention_heads": 16,
|
40 |
+
"num_channels": 3,
|
41 |
+
"num_hidden_layers": 24,
|
42 |
+
"patch_size": 14,
|
43 |
+
"rope_theta": 10000.0
|
44 |
+
},
|
45 |
+
"vision_feature_layer": -1
|
46 |
+
}
|
consolidated.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2cc4cc283a4bf3820f77ddb73bef3128b7159057c240b94a72b663d97af86f89
|
3 |
+
size 48022792280
|
generation_config.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"bos_token_id": 1,
|
4 |
+
"eos_token_id": 2,
|
5 |
+
"transformers_version": "4.52.4",
|
6 |
+
"temperature": 0.15,
|
7 |
+
}
|
params.json
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"dim": 5120,
|
3 |
+
"n_layers": 40,
|
4 |
+
"head_dim": 128,
|
5 |
+
"hidden_dim": 32768,
|
6 |
+
"n_heads": 32,
|
7 |
+
"n_kv_heads": 8,
|
8 |
+
"rope_theta": 1000000000.0,
|
9 |
+
"norm_eps": 1e-05,
|
10 |
+
"vocab_size": 131072,
|
11 |
+
"vision_encoder": {
|
12 |
+
"hidden_size": 1024,
|
13 |
+
"num_channels": 3,
|
14 |
+
"max_image_size": 1540,
|
15 |
+
"patch_size": 14,
|
16 |
+
"rope_theta": 10000.0,
|
17 |
+
"intermediate_size": 4096,
|
18 |
+
"num_hidden_layers": 24,
|
19 |
+
"num_attention_heads": 16,
|
20 |
+
"adapter_bias": false,
|
21 |
+
"mm_projector_id": "patch_merge",
|
22 |
+
"spatial_merge_size": 2,
|
23 |
+
"add_pre_mm_projector_layer_norm": true,
|
24 |
+
"image_token_id": 10,
|
25 |
+
"image_break_token_id": 12,
|
26 |
+
"image_end_token_id": 13,
|
27 |
+
"image_size": 1540
|
28 |
+
}
|
29 |
+
}
|
tekken.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6e2501687ccd0e1f30f36319eaf2b46958b897811e246cd8eb5d385b9e3de7d1
|
3 |
+
size 19399895
|