Ankitja commited on
Commit
8a2e24e
·
verified ·
1 Parent(s): e316a71

(Trained with Unsloth)

Browse files
chat_template.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "chat_template": "{{ bos_token }}\n{%- if messages[0]['role'] == 'system' -%}\n {%- if messages[0]['content'] is string -%}\n {%- set first_user_prefix = messages[0]['content'] + '\n\n' -%}\n {%- else -%}\n {%- set first_user_prefix = messages[0]['content'][0]['text'] + '\n\n' -%}\n {%- endif -%}\n {%- set loop_messages = messages[1:] -%}\n{%- else -%}\n {%- set first_user_prefix = \"\" -%}\n {%- set loop_messages = messages -%}\n{%- endif -%}\n{%- for message in loop_messages -%}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}\n {{ raise_exception(\"Conversation roles must alternate user/assistant/user/assistant/...\") }}\n {%- endif -%}\n {%- if (message['role'] == 'assistant') -%}\n {%- set role = \"model\" -%}\n {%- else -%}\n {%- set role = message['role'] -%}\n {%- endif -%}\n {{ '<start_of_turn>' + role + '\n' + (first_user_prefix if loop.first else \"\") }}\n {%- if message['content'] is string -%}\n {{ message['content'] | trim }}\n {%- elif message['content'] is iterable -%}\n {%- for item in message['content'] -%}\n {%- if item['type'] == 'image' -%}\n {{ '<start_of_image>' }}\n {%- elif item['type'] == 'text' -%}\n {{ item['text'] | trim }}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {{ raise_exception(\"Invalid content type\") }}\n {%- endif -%}\n {{ '<end_of_turn>\n' }}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n {{ '<start_of_turn>model\n' }}\n{%- endif -%}\n"
3
+ }
config.json CHANGED
@@ -1,36 +1,37 @@
1
  {
2
- "architectures": [
3
- "Gemma3ForCausalLM"
4
- ],
5
- "attention_bias": false,
6
- "attention_dropout": 0.0,
7
- "attn_logit_softcapping": null,
8
- "bos_token_id": 2,
9
- "cache_implementation": "hybrid",
10
- "eos_token_id": 106,
11
- "final_logit_softcapping": null,
12
- "head_dim": 256,
13
- "hidden_activation": "gelu_pytorch_tanh",
14
- "hidden_size": 1152,
15
- "initializer_range": 0.02,
16
- "intermediate_size": 6912,
17
- "max_position_embeddings": 32768,
18
- "model_type": "gemma3_text",
19
- "num_attention_heads": 4,
20
- "num_hidden_layers": 26,
21
- "num_key_value_heads": 1,
22
- "pad_token_id": 0,
23
- "query_pre_attn_scalar": 256,
24
- "rms_norm_eps": 1e-06,
25
- "rope_local_base_freq": 10000,
26
- "rope_scaling": null,
27
- "rope_theta": 1000000,
28
- "sliding_window": 512,
29
- "sliding_window_pattern": 6,
30
- "torch_dtype": "float16",
31
- "transformers_version": "4.50.0.dev0",
32
- "unsloth_fixed": true,
33
- "unsloth_version": "2025.3.19",
34
- "use_cache": true,
35
- "vocab_size": 262144
36
- }
 
 
1
  {
2
+ "architectures": [
3
+ "Gemma3ForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "attn_logit_softcapping": null,
8
+ "bos_token_id": 2,
9
+ "cache_implementation": "hybrid",
10
+ "eos_token_id": 1,
11
+ "final_logit_softcapping": null,
12
+ "head_dim": 256,
13
+ "hidden_activation": "gelu_pytorch_tanh",
14
+ "hidden_size": 2560,
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 10240,
17
+ "max_position_embeddings": 131072,
18
+ "model_type": "gemma3_text",
19
+ "num_attention_heads": 8,
20
+ "num_hidden_layers": 34,
21
+ "num_key_value_heads": 4,
22
+ "pad_token_id": 0,
23
+ "query_pre_attn_scalar": 256,
24
+ "rms_norm_eps": 1e-06,
25
+ "rope_local_base_freq": 10000.0,
26
+ "rope_scaling": {
27
+ "factor": 8.0,
28
+ "rope_type": "linear"
29
+ },
30
+ "rope_theta": 1000000.0,
31
+ "sliding_window": 1024,
32
+ "sliding_window_pattern": 6,
33
+ "torch_dtype": "float32",
34
+ "transformers_version": "4.51.3",
35
+ "use_cache": true,
36
+ "vocab_size": 262208
37
+ }
generation_config.json CHANGED
@@ -1,14 +1,8 @@
1
  {
 
2
  "bos_token_id": 2,
3
  "cache_implementation": "hybrid",
4
- "do_sample": true,
5
- "eos_token_id": [
6
- 1,
7
- 106
8
- ],
9
- "max_length": 32768,
10
  "pad_token_id": 0,
11
- "top_k": 64,
12
- "top_p": 0.95,
13
- "transformers_version": "4.50.0.dev0"
14
  }
 
1
  {
2
+ "_from_model_config": true,
3
  "bos_token_id": 2,
4
  "cache_implementation": "hybrid",
5
+ "eos_token_id": 1,
 
 
 
 
 
6
  "pad_token_id": 0,
7
+ "transformers_version": "4.51.3"
 
 
8
  }
preprocessor_config.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_convert_rgb": null,
3
+ "do_normalize": true,
4
+ "do_pan_and_scan": null,
5
+ "do_rescale": true,
6
+ "do_resize": true,
7
+ "image_mean": [
8
+ 0.5,
9
+ 0.5,
10
+ 0.5
11
+ ],
12
+ "image_processor_type": "Gemma3ImageProcessor",
13
+ "image_seq_length": 256,
14
+ "image_std": [
15
+ 0.5,
16
+ 0.5,
17
+ 0.5
18
+ ],
19
+ "pan_and_scan_max_num_crops": null,
20
+ "pan_and_scan_min_crop_size": null,
21
+ "pan_and_scan_min_ratio_to_activate": null,
22
+ "processor_class": "Gemma3Processor",
23
+ "resample": 2,
24
+ "rescale_factor": 0.00392156862745098,
25
+ "size": {
26
+ "height": 896,
27
+ "width": 896
28
+ }
29
+ }
processor_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "image_seq_length": 256,
3
+ "processor_class": "Gemma3Processor"
4
+ }
tokenizer_config.json CHANGED
@@ -51325,7 +51325,7 @@
51325
  },
51326
  "boi_token": "<start_of_image>",
51327
  "bos_token": "<bos>",
51328
- "chat_template": "{{ bos_token }}\n{%- if messages[0]['role'] == 'system' -%}\n {%- if messages[0]['content'] is string -%}\n {%- set first_user_prefix = messages[0]['content'] + '\n\n' -%}\n {%- else -%}\n {%- set first_user_prefix = messages[0]['content'][0]['text'] + '\n\n' -%}\n {%- endif -%}\n {%- set loop_messages = messages[1:] -%}\n{%- else -%}\n {%- set first_user_prefix = \"\" -%}\n {%- set loop_messages = messages -%}\n{%- endif -%}\n{%- for message in loop_messages -%}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}\n {{ raise_exception(\"Conversation roles must alternate user/assistant/user/assistant/...\") }}\n {%- endif -%}\n {%- if (message['role'] == 'assistant') -%}\n {%- set role = \"model\" -%}\n {%- else -%}\n {%- set role = message['role'] -%}\n {%- endif -%}\n {{ '<start_of_turn>' + role + '\n' + (first_user_prefix if loop.first else \"\") }}\n {%- if message['content'] is string -%}\n {{ message['content'] | trim }}\n {%- elif message['content'] is iterable -%}\n {%- for item in message['content'] -%}\n {%- if item['type'] == 'image' -%}\n {{ '<start_of_image>' }}\n {%- elif item['type'] == 'text' -%}\n {{ item['text'] | trim }}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {{ raise_exception(\"Invalid content type\") }}\n {%- endif -%}\n {{ '<end_of_turn>\n' }}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n {{ '<start_of_turn>model\n' }}\n{%- endif -%}\n",
51329
  "clean_up_tokenization_spaces": false,
51330
  "eoi_token": "<end_of_image>",
51331
  "eos_token": "<end_of_turn>",
@@ -51335,7 +51335,7 @@
51335
  "image_token": "<image_soft_token>"
51336
  },
51337
  "image_token": "<image_soft_token>",
51338
- "model_max_length": 32768,
51339
  "pad_token": "<pad>",
51340
  "padding_side": "right",
51341
  "processor_class": "Gemma3Processor",
 
51325
  },
51326
  "boi_token": "<start_of_image>",
51327
  "bos_token": "<bos>",
51328
+ "chat_template": "{{ bos_token }}\n{%- if messages[0]['role'] == 'system' -%}\n {%- if messages[0]['content'] is string -%}\n {%- set first_user_prefix = messages[0]['content'] + '\n\n' -%}\n {%- else -%}\n {%- set first_user_prefix = messages[0]['content'][0]['text'] + '\n\n' -%}\n {%- endif -%}\n {%- set loop_messages = messages[1:] -%}\n{%- else -%}\n {%- set first_user_prefix = \"\" -%}\n {%- set loop_messages = messages -%}\n{%- endif -%}\n{%- for message in loop_messages -%}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}\n {{ raise_exception(\"Conversation roles must alternate user/assistant/user/assistant/...\") }}\n {%- endif -%}\n {%- if (message['role'] == 'assistant') -%}\n {%- set role = \"model\" -%}\n {%- else -%}\n {%- set role = message['role'] -%}\n {%- endif -%}\n {{ '<start_of_turn>' + role + '\n' + (first_user_prefix if loop.first else \"\") }}\n {%- if message['content'] is string -%}\n {{ message['content'] | trim }}\n {%- elif message['content'] is iterable -%}\n {%- for item in message['content'] -%}\n {%- if item['type'] == 'image' -%}\n {{ '<start_of_image>' }}\n {%- elif item['type'] == 'text' -%}\n {{ item['text'] | trim }}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {{ raise_exception(\"Invalid content type\") }}\n {%- endif -%}\n {{ '<end_of_turn>\n' }}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n {{'<start_of_turn>model\n'}}\n{%- endif -%}\n",
51329
  "clean_up_tokenization_spaces": false,
51330
  "eoi_token": "<end_of_image>",
51331
  "eos_token": "<end_of_turn>",
 
51335
  "image_token": "<image_soft_token>"
51336
  },
51337
  "image_token": "<image_soft_token>",
51338
+ "model_max_length": 131072,
51339
  "pad_token": "<pad>",
51340
  "padding_side": "right",
51341
  "processor_class": "Gemma3Processor",