gyung commited on
Commit
00231d0
·
verified ·
1 Parent(s): 860fcb5

Upload folder using huggingface_hub

Browse files
.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 ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: dllm-hub/Qwen3-0.6B-diffusion-bd3lm-v0.1
4
+ tags:
5
+ - diffusion-language-model
6
+ - block-diffusion
7
+ - bd3lm
8
+ - grpo
9
+ - rlvr
10
+ - lora
11
+ - qwen3
12
+ language:
13
+ - en
14
+ ---
15
+
16
+ # Qwen3-0.6B-diffusion-bd3lm-justgrpo-run1-gsm8k-lora
17
+
18
+ **JustGRPO-style RL (LoRA)** applied to the tiny block-diffusion LM
19
+ [`dllm-hub/Qwen3-0.6B-diffusion-bd3lm-v0.1`](https://huggingface.co/dllm-hub/Qwen3-0.6B-diffusion-bd3lm-v0.1).
20
+ Trained on **GSM8K train split (7.4k grade-school math problems)** with verifiable rewards.
21
+
22
+ - Method & code: [https://github.com/LLM-OS-Models/JustGRPO](https://github.com/LLM-OS-Models/JustGRPO)
23
+ - Papers this work builds on:
24
+ [JustGRPO (arXiv:2601.15165)](https://arxiv.org/abs/2601.15165) ·
25
+ [dLLM (arXiv:2602.22661)](https://arxiv.org/abs/2602.22661) ·
26
+ [BD3LM (arXiv:2503.09573)](https://arxiv.org/abs/2503.09573)
27
+
28
+ ## How it was trained
29
+
30
+ - Rollouts: native block-diffusion sampling (block_size 32, temperature 1.0,
31
+ 256 denoising steps, gen length 256) — AR-order rollout collapses on this base
32
+ model, see the repo's ADAPTATION.md for the full analysis.
33
+ - Loss: exact autoregressive log-likelihood of each sampled token, computed in a
34
+ single forward pass via the BD3LM `[x0 || xt]` concat-attention trick
35
+ (mathematically identical to the per-token loop; verified to 2e-5 in fp32),
36
+ weighted by GRPO group-normalized advantages with PPO-style clipping.
37
+ - LoRA r=128, alpha=64, dropout 0.05 on q/k/v/o/up/down/gate projections,
38
+ lr 5e-5, 200 steps, 8 prompts x 16 rollouts per step, 1x H100.
39
+ - Rewards: +1 correct / -1 incorrect (final-answer match)
40
+
41
+ ## Results
42
+
43
+ Evaluation in progress — see the GitHub repo's BENCHMARKS.md for the live table.
44
+
45
+ ## Usage
46
+
47
+ This repo contains the merged full model (base + LoRA). Generation uses block diffusion (NOT vanilla
48
+ `model.generate`); the easiest path is the [dllm](https://github.com/ZHZisZZ/dllm)
49
+ sampler:
50
+
51
+ ```python
52
+ import torch
53
+ from transformers import AutoTokenizer, AutoModelForMaskedLM
54
+ from dllm.core.samplers import BD3LMSampler, BD3LMSamplerConfig
55
+
56
+ tok = AutoTokenizer.from_pretrained("LLM-OS-Models2/Qwen3-0.6B-diffusion-bd3lm-justgrpo-run1-gsm8k-lora")
57
+ model = AutoModelForMaskedLM.from_pretrained(
58
+ "LLM-OS-Models2/Qwen3-0.6B-diffusion-bd3lm-justgrpo-run1-gsm8k-lora", trust_remote_code=True, torch_dtype=torch.bfloat16
59
+ ).cuda().eval()
60
+
61
+ sampler = BD3LMSampler(model=model, tokenizer=tok)
62
+ prompt = tok.apply_chat_template(
63
+ [[{"role": "user", "content": "Natalia sold clips to 48 friends in April, "
64
+ "then half as many in May. How many altogether?"}]],
65
+ add_generation_prompt=True, tokenize=True)
66
+ seqs = sampler.sample(prompt, config=BD3LMSamplerConfig(
67
+ max_new_tokens=256, steps=256, block_size=32, temperature=0.0))
68
+ print(tok.decode(seqs[0], skip_special_tokens=True))
69
+ ```
70
+
71
+ To evaluate: use the dllm eval harness
72
+ (`--model a2d_bd3lm`, `max_new_tokens=256,steps=256,block_size=32`) as described in
73
+ [https://github.com/LLM-OS-Models/JustGRPO](https://github.com/LLM-OS-Models/JustGRPO).
added_tokens.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "</think>": 151668,
3
+ "</tool_call>": 151658,
4
+ "</tool_response>": 151666,
5
+ "<think>": 151667,
6
+ "<tool_call>": 151657,
7
+ "<tool_response>": 151665,
8
+ "<|box_end|>": 151649,
9
+ "<|box_start|>": 151648,
10
+ "<|endoftext|>": 151643,
11
+ "<|file_sep|>": 151664,
12
+ "<|fim_middle|>": 151660,
13
+ "<|fim_pad|>": 151662,
14
+ "<|fim_prefix|>": 151659,
15
+ "<|fim_suffix|>": 151661,
16
+ "<|im_end|>": 151645,
17
+ "<|im_start|>": 151644,
18
+ "<|image_pad|>": 151655,
19
+ "<|mask|>": 151669,
20
+ "<|object_ref_end|>": 151647,
21
+ "<|object_ref_start|>": 151646,
22
+ "<|quad_end|>": 151651,
23
+ "<|quad_start|>": 151650,
24
+ "<|repo_name|>": 151663,
25
+ "<|video_pad|>": 151656,
26
+ "<|vision_end|>": 151653,
27
+ "<|vision_pad|>": 151654,
28
+ "<|vision_start|>": 151652
29
+ }
chat_template.jinja ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if tools %}
2
+ {{- '<|im_start|>system\n' }}
3
+ {%- if messages[0].role == 'system' %}
4
+ {{- messages[0].content + '\n\n' }}
5
+ {%- endif %}
6
+ {{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
7
+ {%- for tool in tools %}
8
+ {{- "\n" }}
9
+ {{- tool | tojson }}
10
+ {%- endfor %}
11
+ {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
12
+ {%- else %}
13
+ {%- if messages[0].role == 'system' %}
14
+ {{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
15
+ {%- endif %}
16
+ {%- endif %}
17
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
18
+ {%- for message in messages[::-1] %}
19
+ {%- set index = (messages|length - 1) - loop.index0 %}
20
+ {%- if ns.multi_step_tool and message.role == "user" and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
21
+ {%- set ns.multi_step_tool = false %}
22
+ {%- set ns.last_query_index = index %}
23
+ {%- endif %}
24
+ {%- endfor %}
25
+ {%- for message in messages %}
26
+ {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
27
+ {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
28
+ {%- elif message.role == "assistant" %}
29
+ {%- set content = message.content %}
30
+ {%- set reasoning_content = '' %}
31
+ {%- if message.reasoning_content is defined and message.reasoning_content is not none %}
32
+ {%- set reasoning_content = message.reasoning_content %}
33
+ {%- else %}
34
+ {%- if '</think>' in message.content %}
35
+ {%- set content = message.content.split('</think>')[-1].lstrip('\n') %}
36
+ {%- set reasoning_content = message.content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
37
+ {%- endif %}
38
+ {%- endif %}
39
+ {%- if loop.index0 > ns.last_query_index %}
40
+ {%- if loop.last or (not loop.last and reasoning_content) %}
41
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
42
+ {%- else %}
43
+ {{- '<|im_start|>' + message.role + '\n' + content }}
44
+ {%- endif %}
45
+ {%- else %}
46
+ {{- '<|im_start|>' + message.role + '\n' + content }}
47
+ {%- endif %}
48
+ {%- if message.tool_calls %}
49
+ {%- for tool_call in message.tool_calls %}
50
+ {%- if (loop.first and content) or (not loop.first) %}
51
+ {{- '\n' }}
52
+ {%- endif %}
53
+ {%- if tool_call.function %}
54
+ {%- set tool_call = tool_call.function %}
55
+ {%- endif %}
56
+ {{- '<tool_call>\n{"name": "' }}
57
+ {{- tool_call.name }}
58
+ {{- '", "arguments": ' }}
59
+ {%- if tool_call.arguments is string %}
60
+ {{- tool_call.arguments }}
61
+ {%- else %}
62
+ {{- tool_call.arguments | tojson }}
63
+ {%- endif %}
64
+ {{- '}\n</tool_call>' }}
65
+ {%- endfor %}
66
+ {%- endif %}
67
+ {{- '<|im_end|>\n' }}
68
+ {%- elif message.role == "tool" %}
69
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
70
+ {{- '<|im_start|>user' }}
71
+ {%- endif %}
72
+ {{- '\n<tool_response>\n' }}
73
+ {{- message.content }}
74
+ {{- '\n</tool_response>' }}
75
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
76
+ {{- '<|im_end|>\n' }}
77
+ {%- endif %}
78
+ {%- endif %}
79
+ {%- endfor %}
80
+ {%- if add_generation_prompt %}
81
+ {{- '<|im_start|>assistant\n' }}
82
+ {%- if enable_thinking is defined and enable_thinking is false %}
83
+ {{- '<think>\n\n</think>\n\n' }}
84
+ {%- endif %}
85
+ {%- endif %}
config.json ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "A2DQwen3LMHeadModel"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "auto_map": {
8
+ "AutoConfig": "modeling_qwen3.A2DQwen3Config",
9
+ "AutoModel": "modeling_qwen3.A2DQwen3Model",
10
+ "AutoModelForMaskedLM": "modeling_qwen3.A2DQwen3LMHeadModel"
11
+ },
12
+ "bos_token_id": 151643,
13
+ "dtype": "bfloat16",
14
+ "eos_token_id": 151645,
15
+ "head_dim": 128,
16
+ "hidden_act": "silu",
17
+ "hidden_size": 1024,
18
+ "initializer_range": 0.02,
19
+ "intermediate_size": 3072,
20
+ "layer_types": [
21
+ "full_attention",
22
+ "full_attention",
23
+ "full_attention",
24
+ "full_attention",
25
+ "full_attention",
26
+ "full_attention",
27
+ "full_attention",
28
+ "full_attention",
29
+ "full_attention",
30
+ "full_attention",
31
+ "full_attention",
32
+ "full_attention",
33
+ "full_attention",
34
+ "full_attention",
35
+ "full_attention",
36
+ "full_attention",
37
+ "full_attention",
38
+ "full_attention",
39
+ "full_attention",
40
+ "full_attention",
41
+ "full_attention",
42
+ "full_attention",
43
+ "full_attention",
44
+ "full_attention",
45
+ "full_attention",
46
+ "full_attention",
47
+ "full_attention",
48
+ "full_attention"
49
+ ],
50
+ "max_position_embeddings": 40960,
51
+ "max_window_layers": 28,
52
+ "model_type": "a2d-qwen3",
53
+ "num_attention_heads": 16,
54
+ "num_hidden_layers": 28,
55
+ "num_key_value_heads": 8,
56
+ "pad_token_id": 151643,
57
+ "rms_norm_eps": 1e-06,
58
+ "rope_scaling": null,
59
+ "rope_theta": 1000000,
60
+ "sliding_window": null,
61
+ "tie_word_embeddings": true,
62
+ "transformers_version": "4.57.0",
63
+ "use_cache": true,
64
+ "use_sliding_window": false,
65
+ "vocab_size": 151936
66
+ }
generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 151643,
4
+ "eos_token_id": [
5
+ 151645
6
+ ],
7
+ "pad_token_id": 151643,
8
+ "transformers_version": "4.57.0"
9
+ }
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:6b8a9ee6d5dd04de5100757bebf2cd637bb7caee3adc2998070ddfb8983b4faa
3
+ size 1192135096
modeling_qwen3.py ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from typing import Optional
2
+
3
+ import torch
4
+ from torch import nn
5
+
6
+ import transformers
7
+ from transformers.cache_utils import Cache, DynamicCache
8
+ from transformers.modeling_outputs import BaseModelOutputWithPast
9
+ from transformers.processing_utils import Unpack
10
+ from transformers.utils import TransformersKwargs
11
+ from transformers.modeling_attn_mask_utils import _prepare_4d_attention_mask
12
+
13
+ if transformers.utils.is_torch_flex_attn_available():
14
+ from torch.nn.attention.flex_attention import _DEFAULT_SPARSE_BLOCK_SIZE as flex_default_block_size
15
+ from torch.nn.attention.flex_attention import BlockMask, create_block_mask
16
+ else:
17
+ # Register a fake type to avoid crashing for annotations and `isinstance` checks
18
+ BlockMask = torch.Tensor
19
+
20
+ class A2DQwen3Config(transformers.Qwen3Config):
21
+ model_type = "a2d-qwen3" # <- NEW model_type
22
+
23
+
24
+ class A2DQwen3Model(transformers.Qwen3Model):
25
+
26
+ def forward(
27
+ self,
28
+ input_ids: Optional[torch.LongTensor] = None,
29
+ attention_mask: Optional[torch.Tensor] = None,
30
+ position_ids: Optional[torch.LongTensor] = None,
31
+ past_key_values: Optional[Cache] = None,
32
+ inputs_embeds: Optional[torch.FloatTensor] = None,
33
+ use_cache: Optional[bool] = None,
34
+ cache_position: Optional[torch.LongTensor] = None,
35
+ **kwargs: Unpack[TransformersKwargs],
36
+ ) -> BaseModelOutputWithPast:
37
+ if (input_ids is None) ^ (inputs_embeds is not None):
38
+ raise ValueError("You must specify exactly one of input_ids or inputs_embeds")
39
+
40
+ if inputs_embeds is None:
41
+ inputs_embeds = self.embed_tokens(input_ids)
42
+
43
+ if use_cache and past_key_values is None:
44
+ past_key_values = DynamicCache(config=self.config)
45
+
46
+ if cache_position is None:
47
+ past_seen_tokens = past_key_values.get_seq_length() if past_key_values is not None else 0
48
+ cache_position = torch.arange(
49
+ past_seen_tokens, past_seen_tokens + inputs_embeds.shape[1], device=inputs_embeds.device
50
+ )
51
+
52
+ if position_ids is None:
53
+ position_ids = cache_position.unsqueeze(0)
54
+
55
+ """
56
+ # -------------------------------------------------------------
57
+ # ORIGINAL CODE (causal mask)
58
+ # -------------------------------------------------------------
59
+ # It may already have been prepared by e.g. `generate`
60
+ if not isinstance(causal_mask_mapping := attention_mask, dict):
61
+ # Prepare mask arguments
62
+ mask_kwargs = {
63
+ "config": self.config,
64
+ "input_embeds": inputs_embeds,
65
+ "attention_mask": attention_mask,
66
+ "cache_position": cache_position,
67
+ "past_key_values": past_key_values,
68
+ "position_ids": position_ids,
69
+ }
70
+ # Create the masks
71
+ causal_mask_mapping = {
72
+ "full_attention": create_causal_mask(**mask_kwargs),
73
+ }
74
+ # The sliding window alternating layers are not always activated depending on the config
75
+ if self.has_sliding_layers:
76
+ causal_mask_mapping["sliding_attention"] = create_sliding_window_causal_mask(**mask_kwargs)
77
+ # -------------------------------------------------------------
78
+ # ORIGINAL CODE (causal mask)
79
+ # -------------------------------------------------------------
80
+ """
81
+ # -------------------------------------------------------------
82
+ # NEW CODE (bidirectional, padding-only mask)
83
+ # -------------------------------------------------------------
84
+ if not isinstance(causal_mask_mapping := attention_mask, dict):
85
+ batch_size, seq_len = inputs_embeds.shape[:2]
86
+ device = inputs_embeds.device
87
+
88
+ # 1) If no mask is provided → treat all tokens as valid (no padding)
89
+ if attention_mask is None:
90
+ attention_mask = torch.ones(
91
+ batch_size, seq_len, device=device, dtype=torch.long
92
+ )
93
+
94
+ # 2) If mask is not already a 4D attention mask → convert it
95
+ if not (
96
+ isinstance(attention_mask, BlockMask)
97
+ or (isinstance(attention_mask, torch.Tensor) and attention_mask.ndim == 4)
98
+ ):
99
+ attention_mask = _prepare_4d_attention_mask(attention_mask, self.dtype)
100
+
101
+ # 3) Build causal mask mapping used by the attention layers
102
+ causal_mask_mapping = {"full_attention": attention_mask}
103
+
104
+ # Sliding-window layers share the same non-causal mask
105
+ if self.has_sliding_layers:
106
+ causal_mask_mapping["sliding_attention"] = attention_mask
107
+ # -------------------------------------------------------------
108
+ # NEW CODE (bidirectional, padding-only mask)
109
+ # -------------------------------------------------------------
110
+
111
+ hidden_states = inputs_embeds
112
+
113
+ # create position embeddings to be shared across the decoder layers
114
+ position_embeddings = self.rotary_emb(hidden_states, position_ids)
115
+
116
+ for decoder_layer in self.layers[: self.config.num_hidden_layers]:
117
+ hidden_states = decoder_layer(
118
+ hidden_states,
119
+ attention_mask=causal_mask_mapping[decoder_layer.attention_type],
120
+ position_ids=position_ids,
121
+ past_key_values=past_key_values,
122
+ use_cache=use_cache,
123
+ cache_position=cache_position,
124
+ position_embeddings=position_embeddings,
125
+ **kwargs,
126
+ )
127
+
128
+ hidden_states = self.norm(hidden_states)
129
+ return BaseModelOutputWithPast(
130
+ last_hidden_state=hidden_states,
131
+ past_key_values=past_key_values if use_cache else None,
132
+ )
133
+
134
+
135
+ class A2DQwen3LMHeadModel(transformers.Qwen3ForCausalLM):
136
+ config: A2DQwen3Config
137
+
138
+ def __init__(self, config):
139
+ transformers.Qwen3PreTrainedModel.__init__(self, config)
140
+ self.model = A2DQwen3Model(config)
141
+ self.vocab_size = config.vocab_size
142
+ self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
143
+
144
+ # Initialize weights and apply final processing
145
+ self.post_init()
146
+
147
+
148
+ transformers.AutoConfig.register("a2d-qwen3", A2DQwen3Config)
149
+ transformers.AutoModel.register(A2DQwen3Config, A2DQwen3LMHeadModel)
150
+ transformers.AutoModelForMaskedLM.register(A2DQwen3Config, A2DQwen3LMHeadModel)
151
+
152
+
153
+ if __name__ == "__main__":
154
+ import dllm
155
+ import torch
156
+ from transformers import AutoModel
157
+
158
+ # Load a config from a local path (either a directory containing config.json, or the file itself)
159
+ config_path = dllm.utils.resolve_with_base_env(
160
+ "Qwen/Qwen3-0.6B-Base", "BASE_MODELS_DIR"
161
+ )
162
+ config = A2DQwen3Config.from_pretrained(config_path)
163
+ if hasattr(config, "auto_map"):
164
+ delattr(config, "auto_map")
165
+ if hasattr(config, "architectures"):
166
+ delattr(config, "architectures")
167
+
168
+ torch.set_default_device("cuda")
169
+ model = A2DQwen3LMHeadModel(config)
170
+ model.save_pretrained("models-tmp/a2d-qwen3")
171
+ auto_model = AutoModel.from_pretrained("models-tmp/a2d-qwen3")
172
+
special_tokens_map.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|im_start|>",
4
+ "<|im_end|>",
5
+ "<|object_ref_start|>",
6
+ "<|object_ref_end|>",
7
+ "<|box_start|>",
8
+ "<|box_end|>",
9
+ "<|quad_start|>",
10
+ "<|quad_end|>",
11
+ "<|vision_start|>",
12
+ "<|vision_end|>",
13
+ "<|vision_pad|>",
14
+ "<|image_pad|>",
15
+ "<|video_pad|>"
16
+ ],
17
+ "bos_token": {
18
+ "content": "<|endoftext|>",
19
+ "lstrip": false,
20
+ "normalized": false,
21
+ "rstrip": false,
22
+ "single_word": false
23
+ },
24
+ "eos_token": {
25
+ "content": "<|im_end|>",
26
+ "lstrip": false,
27
+ "normalized": false,
28
+ "rstrip": false,
29
+ "single_word": false
30
+ },
31
+ "mask_token": {
32
+ "content": "<|mask|>",
33
+ "lstrip": false,
34
+ "normalized": false,
35
+ "rstrip": false,
36
+ "single_word": false
37
+ },
38
+ "pad_token": {
39
+ "content": "<|endoftext|>",
40
+ "lstrip": false,
41
+ "normalized": false,
42
+ "rstrip": false,
43
+ "single_word": false
44
+ }
45
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6d55810de1daf81d1d1259355b4b85810385022ab745be68029295935a4eacf0
3
+ size 11422839
tokenizer_config.json ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "151669": {
214
+ "content": "<|mask|>",
215
+ "lstrip": false,
216
+ "normalized": false,
217
+ "rstrip": false,
218
+ "single_word": false,
219
+ "special": true
220
+ }
221
+ },
222
+ "additional_special_tokens": [
223
+ "<|im_start|>",
224
+ "<|im_end|>",
225
+ "<|object_ref_start|>",
226
+ "<|object_ref_end|>",
227
+ "<|box_start|>",
228
+ "<|box_end|>",
229
+ "<|quad_start|>",
230
+ "<|quad_end|>",
231
+ "<|vision_start|>",
232
+ "<|vision_end|>",
233
+ "<|vision_pad|>",
234
+ "<|image_pad|>",
235
+ "<|video_pad|>"
236
+ ],
237
+ "bos_token": "<|endoftext|>",
238
+ "clean_up_tokenization_spaces": false,
239
+ "eos_token": "<|im_end|>",
240
+ "errors": "replace",
241
+ "extra_special_tokens": {},
242
+ "mask_token": "<|mask|>",
243
+ "model_max_length": 131072,
244
+ "pad_token": "<|endoftext|>",
245
+ "padding_side": "right",
246
+ "split_special_tokens": false,
247
+ "tokenizer_class": "Qwen2Tokenizer",
248
+ "unk_token": null
249
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff