noooop9527 commited on
Commit
583eda1
·
verified ·
1 Parent(s): 2c723ee

upstream tomaarsen/Qwen3-Reranker-0.6B-seq-cls (#1)

Browse files

- upstream tomaarsen/Qwen3-Reranker-0.6B-seq-cls (af8735ad593b7355b95433165d72a87aca397528)

.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
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,3 +1,370 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model:
4
+ - Qwen/Qwen3-0.6B-Base
5
+ tags:
6
+ - transformers
7
+ - sentence-transformers
8
+ pipeline_tag: text-ranking
9
+ ---
10
+ # Qwen3-Reranker-0.6B
11
+
12
+ <p align="center">
13
+ <img src="https://qianwen-res.oss-accelerate-overseas.aliyuncs.com/logo_qwen3.png" width="400"/>
14
+ <p>
15
+
16
+ > [!NOTE]
17
+ > This is a copy of the [Qwen3-Reranker-0.6B](https://huggingface.co/Qwen/Qwen3-Reranker-0.6B) model, part of the [Qwen3 Reranker series](https://huggingface.co/collections/Qwen/qwen3-reranker-6841b22d0192d7ade9cdefea), modified as a sequence classification model instead. See [Updated Usage](#updated-usage) for details on how to use it, or [Original Usage](#original-usage) for the original usage.
18
+ >
19
+ > See [this discussion](https://huggingface.co/Qwen/Qwen3-Reranker-0.6B/discussions/3) for details on the conversion approach.
20
+
21
+ ## Highlights
22
+
23
+ The Qwen3 Embedding model series is the latest proprietary model of the Qwen family, specifically designed for text embedding and ranking tasks. Building upon the dense foundational models of the Qwen3 series, it provides a comprehensive range of text embeddings and reranking models in various sizes (0.6B, 4B, and 8B). This series inherits the exceptional multilingual capabilities, long-text understanding, and reasoning skills of its foundational model. The Qwen3 Embedding series represents significant advancements in multiple text embedding and ranking tasks, including text retrieval, code retrieval, text classification, text clustering, and bitext mining.
24
+
25
+ **Exceptional Versatility**: The embedding model has achieved state-of-the-art performance across a wide range of downstream application evaluations. The 8B size embedding model ranks No.1 in the MTEB multilingual leaderboard (as of June 5, 2025, score 70.58), while the reranking model excels in various text retrieval scenarios.
26
+
27
+ **Comprehensive Flexibility**: The Qwen3 Embedding series offers a full spectrum of sizes (from 0.6B to 8B) for both embedding and reranking models, catering to diverse use cases that prioritize efficiency and effectiveness. Developers can seamlessly combine these two modules. Additionally, the embedding model allows for flexible vector definitions across all dimensions, and both embedding and reranking models support user-defined instructions to enhance performance for specific tasks, languages, or scenarios.
28
+
29
+ **Multilingual Capability**: The Qwen3 Embedding series offer support for over 100 languages, thanks to the multilingual capabilites of Qwen3 models. This includes various programming languages, and provides robust multilingual, cross-lingual, and code retrieval capabilities.
30
+
31
+ ## Model Overview
32
+
33
+ **Qwen3-Reranker-0.6B** has the following features:
34
+
35
+ - Model Type: Text Reranking
36
+ - Supported Languages: 100+ Languages
37
+ - Number of Paramaters: 0.6B
38
+ - Context Length: 32k
39
+
40
+ For more details, including benchmark evaluation, hardware requirements, and inference performance, please refer to our [blog](https://qwenlm.github.io/blog/qwen3-embedding/), [GitHub](https://github.com/QwenLM/Qwen3-Embedding).
41
+
42
+ ## Qwen3 Embedding Series Model list
43
+
44
+ | Model Type | Models | Size | Layers | Sequence Length | Embedding Dimension | MRL Support | Instruction Aware |
45
+ |------------------|----------------------|------|--------|-----------------|---------------------|-------------|----------------|
46
+ | Text Embedding | [Qwen3-Embedding-0.6B](https://huggingface.co/Qwen/Qwen3-Embedding-0.6B) | 0.6B | 28 | 32K | 1024 | Yes | Yes |
47
+ | Text Embedding | [Qwen3-Embedding-4B](https://huggingface.co/Qwen/Qwen3-Embedding-4B) | 4B | 36 | 32K | 2560 | Yes | Yes |
48
+ | Text Embedding | [Qwen3-Embedding-8B](https://huggingface.co/Qwen/Qwen3-Embedding-8B) | 8B | 36 | 32K | 4096 | Yes | Yes |
49
+ | Text Reranking | [Qwen3-Reranker-0.6B](https://huggingface.co/Qwen/Qwen3-Reranker-0.6B) | 0.6B | 28 | 32K | - | - | Yes |
50
+ | Text Reranking | [Qwen3-Reranker-4B](https://huggingface.co/Qwen/Qwen3-Reranker-4B) | 4B | 36 | 32K | - | - | Yes |
51
+ | Text Reranking | [Qwen3-Reranker-8B](https://huggingface.co/Qwen/Qwen3-Reranker-8B) | 8B | 36 | 32K | - | - | Yes |
52
+
53
+ > **Note**:
54
+ > - `MRL Support` indicates whether the embedding model supports custom dimensions for the final embedding.
55
+ > - `Instruction Aware` notes whether the embedding or reranking model supports customizing the input instruction according to different tasks.
56
+ > - Our evaluation indicates that, for most downstream tasks, using instructions (instruct) typically yields an improvement of 1% to 5% compared to not using them. Therefore, we recommend that developers create tailored instructions specific to their tasks and scenarios. In multilingual contexts, we also advise users to write their instructions in English, as most instructions utilized during the model training process were originally written in English.
57
+
58
+
59
+ ## Usage
60
+
61
+ With Transformers versions earlier than 4.51.0, you may encounter the following error:
62
+ ```
63
+ KeyError: 'qwen3'
64
+ ```
65
+
66
+ ### Updated Usage
67
+
68
+ #### Updated Sentence Transformers Usage
69
+
70
+ ```python
71
+ # Requires transformers>=4.51.0
72
+ from sentence_transformers import CrossEncoder
73
+
74
+
75
+ def format_queries(query, instruction=None):
76
+ prefix = '<|im_start|>system\nJudge whether the Document meets the requirements based on the Query and the Instruct provided. Note that the answer can only be "yes" or "no".<|im_end|>\n<|im_start|>user\n'
77
+ if instruction is None:
78
+ instruction = (
79
+ "Given a web search query, retrieve relevant passages that answer the query"
80
+ )
81
+ return f"{prefix}<Instruct>: {instruction}\n<Query>: {query}\n"
82
+
83
+
84
+ def format_document(document):
85
+ suffix = "<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n"
86
+ return f"<Document>: {document}{suffix}"
87
+
88
+
89
+ model = CrossEncoder("tomaarsen/Qwen3-Reranker-0.6B-seq-cls")
90
+
91
+ task = "Given a web search query, retrieve relevant passages that answer the query"
92
+
93
+ queries = [
94
+ "Which planet is known as the Red Planet?",
95
+ "Which planet is known as the Red Planet?",
96
+ "Which planet is known as the Red Planet?",
97
+ "Which planet is known as the Red Planet?",
98
+ ]
99
+
100
+ documents = [
101
+ "Venus is often called Earth's twin because of its similar size and proximity.",
102
+ "Mars, known for its reddish appearance, is often referred to as the Red Planet.",
103
+ "Jupiter, the largest planet in our solar system, has a prominent red spot.",
104
+ "Saturn, famous for its rings, is sometimes mistaken for the Red Planet.",
105
+ ]
106
+
107
+ pairs = [
108
+ [format_queries(query, task), format_document(doc)]
109
+ for query, doc in zip(queries, documents)
110
+ ]
111
+ scores = model.predict(pairs)
112
+ print(scores.tolist())
113
+ # [0.04272603616118431, 0.9991921782493591, 0.40642625093460083, 0.9718492031097412]
114
+ ```
115
+
116
+ #### Updated Transformers Usage
117
+
118
+ ```python
119
+ # Requires transformers>=4.51.0
120
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer
121
+
122
+
123
+ def format_instruction(instruction, query, doc):
124
+ prefix = '<|im_start|>system\nJudge whether the Document meets the requirements based on the Query and the Instruct provided. Note that the answer can only be "yes" or "no".<|im_end|>\n<|im_start|>user\n'
125
+ suffix = "<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n"
126
+ if instruction is None:
127
+ instruction = (
128
+ "Given a web search query, retrieve relevant passages that answer the query"
129
+ )
130
+ output = f"{prefix}<Instruct>: {instruction}\n<Query>: {query}\n<Document>: {doc}{suffix}"
131
+ return output
132
+
133
+
134
+ tokenizer = AutoTokenizer.from_pretrained("tomaarsen/Qwen3-Reranker-0.6B-seq-cls", padding_side="left")
135
+ model = AutoModelForSequenceClassification.from_pretrained("tomaarsen/Qwen3-Reranker-0.6B-seq-cls").eval()
136
+ # We recommend enabling flash_attention_2 for better acceleration and memory saving.
137
+ # model = AutoModelForSequenceClassification.from_pretrained("tomaarsen/Qwen3-Reranker-0.6B-seq-cls", torch_dtype=torch.float16, attn_implementation="flash_attention_2").cuda().eval()
138
+ max_length = 8192
139
+
140
+ task = "Given a web search query, retrieve relevant passages that answer the query"
141
+
142
+ queries = [
143
+ "Which planet is known as the Red Planet?",
144
+ "Which planet is known as the Red Planet?",
145
+ "Which planet is known as the Red Planet?",
146
+ "Which planet is known as the Red Planet?",
147
+ ]
148
+
149
+ documents = [
150
+ "Venus is often called Earth's twin because of its similar size and proximity.",
151
+ "Mars, known for its reddish appearance, is often referred to as the Red Planet.",
152
+ "Jupiter, the largest planet in our solar system, has a prominent red spot.",
153
+ "Saturn, famous for its rings, is sometimes mistaken for the Red Planet.",
154
+ ]
155
+
156
+ pairs = [format_instruction(task, query, doc) for query, doc in zip(queries, documents)]
157
+ inputs = tokenizer(
158
+ pairs,
159
+ padding=True,
160
+ truncation=True,
161
+ max_length=max_length,
162
+ return_tensors="pt",
163
+ )
164
+ logits = model(**inputs).logits.squeeze()
165
+ print(logits.tolist())
166
+ # [-3.109282970428467, 7.120373725891113, -0.37874650955200195, 3.5416228771209717]
167
+
168
+ scores = logits.sigmoid()
169
+ print(scores.tolist())
170
+ # [0.04272596165537834, 0.9991921782493591, 0.406429260969162, 0.9718491435050964]
171
+ ```
172
+
173
+ ### Original Usage
174
+
175
+ #### Original Transformers Usage
176
+
177
+ ```python
178
+ # Requires transformers>=4.51.0
179
+ import torch
180
+ from transformers import AutoModel, AutoTokenizer, AutoModelForCausalLM
181
+
182
+ def format_instruction(instruction, query, doc):
183
+ if instruction is None:
184
+ instruction = 'Given a web search query, retrieve relevant passages that answer the query'
185
+ output = "<Instruct>: {instruction}\n<Query>: {query}\n<Document>: {doc}".format(instruction=instruction,query=query, doc=doc)
186
+ return output
187
+
188
+ def process_inputs(pairs):
189
+ inputs = tokenizer(
190
+ pairs, padding=False, truncation='longest_first',
191
+ return_attention_mask=False, max_length=max_length - len(prefix_tokens) - len(suffix_tokens)
192
+ )
193
+ for i, ele in enumerate(inputs['input_ids']):
194
+ inputs['input_ids'][i] = prefix_tokens + ele + suffix_tokens
195
+ inputs = tokenizer.pad(inputs, padding=True, return_tensors="pt", max_length=max_length)
196
+ for key in inputs:
197
+ inputs[key] = inputs[key].to(model.device)
198
+ return inputs
199
+
200
+ @torch.no_grad()
201
+ def compute_logits(inputs, **kwargs):
202
+ batch_scores = model(**inputs).logits[:, -1, :]
203
+ true_vector = batch_scores[:, token_true_id]
204
+ false_vector = batch_scores[:, token_false_id]
205
+ batch_scores = torch.stack([false_vector, true_vector], dim=1)
206
+ batch_scores = torch.nn.functional.log_softmax(batch_scores, dim=1)
207
+ scores = batch_scores[:, 1].exp().tolist()
208
+ return scores
209
+
210
+ tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-Reranker-0.6B", padding_side='left')
211
+ model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-Reranker-0.6B").eval()
212
+ # We recommend enabling flash_attention_2 for better acceleration and memory saving.
213
+ # model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-Reranker-0.6B", torch_dtype=torch.float16, attn_implementation="flash_attention_2").cuda().eval()
214
+ token_false_id = tokenizer.convert_tokens_to_ids("no")
215
+ token_true_id = tokenizer.convert_tokens_to_ids("yes")
216
+ max_length = 8192
217
+
218
+ prefix = "<|im_start|>system\nJudge whether the Document meets the requirements based on the Query and the Instruct provided. Note that the answer can only be \"yes\" or \"no\".<|im_end|>\n<|im_start|>user\n"
219
+ suffix = "<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n"
220
+ prefix_tokens = tokenizer.encode(prefix, add_special_tokens=False)
221
+ suffix_tokens = tokenizer.encode(suffix, add_special_tokens=False)
222
+
223
+ task = 'Given a web search query, retrieve relevant passages that answer the query'
224
+
225
+ queries = [
226
+ "Which planet is known as the Red Planet?",
227
+ "Which planet is known as the Red Planet?",
228
+ "Which planet is known as the Red Planet?",
229
+ "Which planet is known as the Red Planet?",
230
+ ]
231
+
232
+ documents = [
233
+ "Venus is often called Earth's twin because of its similar size and proximity.",
234
+ "Mars, known for its reddish appearance, is often referred to as the Red Planet.",
235
+ "Jupiter, the largest planet in our solar system, has a prominent red spot.",
236
+ "Saturn, famous for its rings, is sometimes mistaken for the Red Planet.",
237
+ ]
238
+
239
+ pairs = [format_instruction(task, query, doc) for query, doc in zip(queries, documents)]
240
+
241
+ # Tokenize the input texts
242
+ inputs = process_inputs(pairs)
243
+ scores = compute_logits(inputs)
244
+
245
+ print("scores: ", scores)
246
+ # scores: [0.04272589832544327, 0.9991921782493591, 0.40642935037612915, 0.9718492031097412]
247
+ ```
248
+
249
+
250
+ #### Original vLLM Usage
251
+
252
+ ```python
253
+ # Requires vllm>=0.8.5
254
+ import logging
255
+ from typing import Dict, Optional, List
256
+
257
+ import json
258
+ import logging
259
+
260
+ import torch
261
+
262
+ from transformers import AutoTokenizer, is_torch_npu_available
263
+ from vllm import LLM, SamplingParams
264
+ from vllm.distributed.parallel_state import destroy_model_parallel
265
+ import gc
266
+ import math
267
+ from vllm.inputs.data import TokensPrompt
268
+
269
+
270
+
271
+ def format_instruction(instruction, query, doc):
272
+ text = [
273
+ {"role": "system", "content": "Judge whether the Document meets the requirements based on the Query and the Instruct provided. Note that the answer can only be \"yes\" or \"no\"."},
274
+ {"role": "user", "content": f"<Instruct>: {instruction}\n\n<Query>: {query}\n\n<Document>: {doc}"}
275
+ ]
276
+ return text
277
+
278
+ def process_inputs(pairs, instruction, max_length, suffix_tokens):
279
+ messages = [format_instruction(instruction, query, doc) for query, doc in pairs]
280
+ messages = tokenizer.apply_chat_template(
281
+ messages, tokenize=True, add_generation_prompt=False, enable_thinking=False
282
+ )
283
+ messages = [ele[:max_length] + suffix_tokens for ele in messages]
284
+ messages = [TokensPrompt(prompt_token_ids=ele) for ele in messages]
285
+ return messages
286
+
287
+ def compute_logits(model, messages, sampling_params, true_token, false_token):
288
+ outputs = model.generate(messages, sampling_params, use_tqdm=False)
289
+ scores = []
290
+ for i in range(len(outputs)):
291
+ final_logits = outputs[i].outputs[0].logprobs[-1]
292
+ token_count = len(outputs[i].outputs[0].token_ids)
293
+ if true_token not in final_logits:
294
+ true_logit = -10
295
+ else:
296
+ true_logit = final_logits[true_token].logprob
297
+ if false_token not in final_logits:
298
+ false_logit = -10
299
+ else:
300
+ false_logit = final_logits[false_token].logprob
301
+ true_score = math.exp(true_logit)
302
+ false_score = math.exp(false_logit)
303
+ score = true_score / (true_score + false_score)
304
+ scores.append(score)
305
+ return scores
306
+
307
+ number_of_gpu = torch.cuda.device_count()
308
+ tokenizer = AutoTokenizer.from_pretrained('Qwen/Qwen3-Reranker-0.6B')
309
+ model = LLM(model='Qwen/Qwen3-Reranker-0.6B', tensor_parallel_size=number_of_gpu, max_model_len=10000, enable_prefix_caching=True, gpu_memory_utilization=0.8)
310
+ tokenizer.padding_side = "left"
311
+ tokenizer.pad_token = tokenizer.eos_token
312
+ suffix = "<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n"
313
+ max_length=8192
314
+ suffix_tokens = tokenizer.encode(suffix, add_special_tokens=False)
315
+ true_token = tokenizer("yes", add_special_tokens=False).input_ids[0]
316
+ false_token = tokenizer("no", add_special_tokens=False).input_ids[0]
317
+ sampling_params = SamplingParams(temperature=0,
318
+ max_tokens=1,
319
+ logprobs=20,
320
+ allowed_token_ids=[true_token, false_token],
321
+ )
322
+
323
+
324
+ task = 'Given a web search query, retrieve relevant passages that answer the query'
325
+ queries = ["What is the capital of China?",
326
+ "Explain gravity",
327
+ ]
328
+ documents = [
329
+ "The capital of China is Beijing.",
330
+ "Gravity is a force that attracts two bodies towards each other. It gives weight to physical objects and is responsible for the movement of planets around the sun.",
331
+ ]
332
+
333
+ pairs = list(zip(queries, documents))
334
+ inputs = process_inputs(pairs, task, max_length-len(suffix_tokens), suffix_tokens)
335
+ scores = compute_logits(model, inputs, sampling_params, true_token, false_token)
336
+ print('scores', scores)
337
+
338
+ destroy_model_parallel()
339
+ ```
340
+
341
+ 📌 **Tip**: We recommend that developers customize the `instruct` according to their specific scenarios, tasks, and languages. Our tests have shown that in most retrieval scenarios, not using an `instruct` on the query side can lead to a drop in retrieval performance by approximately 1% to 5%.
342
+
343
+ ## Evaluation
344
+
345
+ | Model | Param | MTEB-R | CMTEB-R | MMTEB-R | MLDR | MTEB-Code | FollowIR |
346
+ |------------------------------------|--------|---------|---------|---------|--------|-----------|----------|
347
+ | **Qwen3-Embedding-0.6B** | 0.6B | 61.82 | 71.02 | 64.64 | 50.26 | 75.41 | 5.09 |
348
+ | Jina-multilingual-reranker-v2-base | 0.3B | 58.22 | 63.37 | 63.73 | 39.66 | 58.98 | -0.68 |
349
+ | gte-multilingual-reranker-base | 0.3B | 59.51 | 74.08 | 59.44 | 66.33 | 54.18 | -1.64 |
350
+ | BGE-reranker-v2-m3 | 0.6B | 57.03 | 72.16 | 58.36 | 59.51 | 41.38 | -0.01 |
351
+ | **Qwen3-Reranker-0.6B** | 0.6B | 65.80 | 71.31 | 66.36 | 67.28 | 73.42 | 5.41 |
352
+ | **Qwen3-Reranker-4B** | 1.7B | **69.76** | 75.94 | 72.74 | 69.97 | 81.20 | **14.84** |
353
+ | **Qwen3-Reranker-8B** | 8B | 69.02 | **77.45** | **72.94** | **70.19** | **81.22** | 8.05 |
354
+
355
+ > **Note**:
356
+ > - Evaluation results for reranking models. We use the retrieval subsets of MTEB(eng, v2), MTEB(cmn, v1), MMTEB and MTEB (Code), which are MTEB-R, CMTEB-R, MMTEB-R and MTEB-Code.
357
+ > - All scores are our runs based on the top-100 candidates retrieved by dense embedding model [Qwen3-Embedding-0.6B](https://huggingface.co/Qwen/Qwen3-Embedding-0.6B).
358
+
359
+ ## Citation
360
+ If you find our work helpful, feel free to give us a cite.
361
+
362
+ ```
363
+ @misc{qwen3-embedding,
364
+ title = {Qwen3-Embedding},
365
+ url = {https://qwenlm.github.io/blog/qwen3/},
366
+ author = {Qwen Team},
367
+ month = {May},
368
+ year = {2025}
369
+ }
370
+ ```
config.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3ForSequenceClassification"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 151643,
8
+ "eos_token_id": 151645,
9
+ "head_dim": 128,
10
+ "hidden_act": "silu",
11
+ "hidden_size": 1024,
12
+ "id2label": {
13
+ "0": "LABEL_0"
14
+ },
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 3072,
17
+ "label2id": {
18
+ "LABEL_0": 0
19
+ },
20
+ "max_position_embeddings": 40960,
21
+ "max_window_layers": 28,
22
+ "model_type": "qwen3",
23
+ "num_attention_heads": 16,
24
+ "num_hidden_layers": 28,
25
+ "num_key_value_heads": 8,
26
+ "pad_token_id": 151643,
27
+ "rms_norm_eps": 1e-06,
28
+ "rope_scaling": null,
29
+ "rope_theta": 1000000,
30
+ "sliding_window": null,
31
+ "tie_word_embeddings": true,
32
+ "torch_dtype": "float32",
33
+ "transformers_version": "4.52.4",
34
+ "use_cache": true,
35
+ "use_sliding_window": false,
36
+ "vocab_size": 151669
37
+ }
generation_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 151643,
3
+ "do_sample": true,
4
+ "eos_token_id": [
5
+ 151645,
6
+ 151643
7
+ ],
8
+ "pad_token_id": 151643,
9
+ "temperature": 0.6,
10
+ "top_k": 20,
11
+ "top_p": 0.95,
12
+ "transformers_version": "4.51.3"
13
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b223e576dc70d8832372a538d4c8458dc25ce9daf209ac47cec4799c85e4da7
3
+ size 2383145520
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aeb13307a71acd8fe81861d94ad54ab689df773318809eed3cbe794b4492dae4
3
+ size 11422654
tokenizer_config.json ADDED
@@ -0,0 +1,239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_prefix_space": false,
4
+ "added_tokens_decoder": {
5
+ "151643": {
6
+ "content": "<|endoftext|>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "151644": {
14
+ "content": "<|im_start|>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "151645": {
22
+ "content": "<|im_end|>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "151646": {
30
+ "content": "<|object_ref_start|>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "151647": {
38
+ "content": "<|object_ref_end|>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ },
45
+ "151648": {
46
+ "content": "<|box_start|>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": true
52
+ },
53
+ "151649": {
54
+ "content": "<|box_end|>",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": true
60
+ },
61
+ "151650": {
62
+ "content": "<|quad_start|>",
63
+ "lstrip": false,
64
+ "normalized": false,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": true
68
+ },
69
+ "151651": {
70
+ "content": "<|quad_end|>",
71
+ "lstrip": false,
72
+ "normalized": false,
73
+ "rstrip": false,
74
+ "single_word": false,
75
+ "special": true
76
+ },
77
+ "151652": {
78
+ "content": "<|vision_start|>",
79
+ "lstrip": false,
80
+ "normalized": false,
81
+ "rstrip": false,
82
+ "single_word": false,
83
+ "special": true
84
+ },
85
+ "151653": {
86
+ "content": "<|vision_end|>",
87
+ "lstrip": false,
88
+ "normalized": false,
89
+ "rstrip": false,
90
+ "single_word": false,
91
+ "special": true
92
+ },
93
+ "151654": {
94
+ "content": "<|vision_pad|>",
95
+ "lstrip": false,
96
+ "normalized": false,
97
+ "rstrip": false,
98
+ "single_word": false,
99
+ "special": true
100
+ },
101
+ "151655": {
102
+ "content": "<|image_pad|>",
103
+ "lstrip": false,
104
+ "normalized": false,
105
+ "rstrip": false,
106
+ "single_word": false,
107
+ "special": true
108
+ },
109
+ "151656": {
110
+ "content": "<|video_pad|>",
111
+ "lstrip": false,
112
+ "normalized": false,
113
+ "rstrip": false,
114
+ "single_word": false,
115
+ "special": true
116
+ },
117
+ "151657": {
118
+ "content": "<tool_call>",
119
+ "lstrip": false,
120
+ "normalized": false,
121
+ "rstrip": false,
122
+ "single_word": false,
123
+ "special": false
124
+ },
125
+ "151658": {
126
+ "content": "</tool_call>",
127
+ "lstrip": false,
128
+ "normalized": false,
129
+ "rstrip": false,
130
+ "single_word": false,
131
+ "special": false
132
+ },
133
+ "151659": {
134
+ "content": "<|fim_prefix|>",
135
+ "lstrip": false,
136
+ "normalized": false,
137
+ "rstrip": false,
138
+ "single_word": false,
139
+ "special": false
140
+ },
141
+ "151660": {
142
+ "content": "<|fim_middle|>",
143
+ "lstrip": false,
144
+ "normalized": false,
145
+ "rstrip": false,
146
+ "single_word": false,
147
+ "special": false
148
+ },
149
+ "151661": {
150
+ "content": "<|fim_suffix|>",
151
+ "lstrip": false,
152
+ "normalized": false,
153
+ "rstrip": false,
154
+ "single_word": false,
155
+ "special": false
156
+ },
157
+ "151662": {
158
+ "content": "<|fim_pad|>",
159
+ "lstrip": false,
160
+ "normalized": false,
161
+ "rstrip": false,
162
+ "single_word": false,
163
+ "special": false
164
+ },
165
+ "151663": {
166
+ "content": "<|repo_name|>",
167
+ "lstrip": false,
168
+ "normalized": false,
169
+ "rstrip": false,
170
+ "single_word": false,
171
+ "special": false
172
+ },
173
+ "151664": {
174
+ "content": "<|file_sep|>",
175
+ "lstrip": false,
176
+ "normalized": false,
177
+ "rstrip": false,
178
+ "single_word": false,
179
+ "special": false
180
+ },
181
+ "151665": {
182
+ "content": "<tool_response>",
183
+ "lstrip": false,
184
+ "normalized": false,
185
+ "rstrip": false,
186
+ "single_word": false,
187
+ "special": false
188
+ },
189
+ "151666": {
190
+ "content": "</tool_response>",
191
+ "lstrip": false,
192
+ "normalized": false,
193
+ "rstrip": false,
194
+ "single_word": false,
195
+ "special": false
196
+ },
197
+ "151667": {
198
+ "content": "<think>",
199
+ "lstrip": false,
200
+ "normalized": false,
201
+ "rstrip": false,
202
+ "single_word": false,
203
+ "special": false
204
+ },
205
+ "151668": {
206
+ "content": "</think>",
207
+ "lstrip": false,
208
+ "normalized": false,
209
+ "rstrip": false,
210
+ "single_word": false,
211
+ "special": false
212
+ }
213
+ },
214
+ "additional_special_tokens": [
215
+ "<|im_start|>",
216
+ "<|im_end|>",
217
+ "<|object_ref_start|>",
218
+ "<|object_ref_end|>",
219
+ "<|box_start|>",
220
+ "<|box_end|>",
221
+ "<|quad_start|>",
222
+ "<|quad_end|>",
223
+ "<|vision_start|>",
224
+ "<|vision_end|>",
225
+ "<|vision_pad|>",
226
+ "<|image_pad|>",
227
+ "<|video_pad|>"
228
+ ],
229
+ "bos_token": null,
230
+ "clean_up_tokenization_spaces": false,
231
+ "eos_token": "<|im_end|>",
232
+ "errors": "replace",
233
+ "extra_special_tokens": {},
234
+ "model_max_length": 131072,
235
+ "pad_token": "<|endoftext|>",
236
+ "split_special_tokens": false,
237
+ "tokenizer_class": "Qwen2Tokenizer",
238
+ "unk_token": null
239
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff