Image-Text-to-Text
PEFT
Safetensors
English
gemma4
lora
adapter
math
code
reasoning
step-by-step
verified-data
autoscientist
adaption
negative-result
conversational
Eval Results (legacy)
Instructions to use manifesta/adaption_verified_math_code_instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use manifesta/adaption_verified_math_code_instruct with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/gemma-4-31B-it") model = PeftModel.from_pretrained(base_model, "manifesta/adaption_verified_math_code_instruct") - Notebooks
- Google Colab
- Kaggle
Add 11 files
Browse files- .gitattributes +1 -0
- README.md +99 -0
- adapter_config.json +34 -0
- adapter_model.safetensors +3 -0
- chat_template.jinja +347 -0
- config.json +178 -0
- special_tokens_map.json +25 -0
- tokenizer.json +3 -0
- tokenizer_config.json +96 -0
- trainer_state.json +487 -0
- training-metrics.png +0 -0
- win-rates.png +0 -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 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: google/gemma-4-31B-it
|
| 3 |
+
library_name: peft
|
| 4 |
+
license: other
|
| 5 |
+
tags:
|
| 6 |
+
- lora
|
| 7 |
+
- peft
|
| 8 |
+
- adapter
|
| 9 |
+
- adaption
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# adaption_verified_math_code_instruct
|
| 13 |
+
|
| 14 |
+
## Model Training
|
| 15 |
+
|
| 16 |
+
A LORA adapter for `google/gemma-4-31B-it`. This model was trained with SFT using [Adaption](https://adaptionlabs.ai)'s AutoScientist on the verified_math_code_instruct dataset.
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
|
| 21 |
+
### AutoScientist Config
|
| 22 |
+
|
| 23 |
+
```json
|
| 24 |
+
{
|
| 25 |
+
"job_id": "9f46e2b9-ac73-4b97-ad13-cc6ccd1501cf",
|
| 26 |
+
"training_experiment_id": "3ce14a29-6d5d-48ea-849f-372a6102c360",
|
| 27 |
+
"original_model_name": "google/gemma-4-31B-it",
|
| 28 |
+
"trained_model_name": "adaption_verified_math_code_instruct",
|
| 29 |
+
"training_method": "sft",
|
| 30 |
+
"training_type": "lora",
|
| 31 |
+
"data_format": "chat",
|
| 32 |
+
"hyperparams": {
|
| 33 |
+
"lora": "true",
|
| 34 |
+
"lora_r": 8,
|
| 35 |
+
"n_evals": 5,
|
| 36 |
+
"n_epochs": 1,
|
| 37 |
+
"batch_size": "max",
|
| 38 |
+
"lora_alpha": 8,
|
| 39 |
+
"lora_dropout": 0,
|
| 40 |
+
"min_lr_ratio": 0.1,
|
| 41 |
+
"warmup_ratio": 0.1,
|
| 42 |
+
"weight_decay": 0,
|
| 43 |
+
"learning_rate": 0.0001,
|
| 44 |
+
"max_grad_norm": 2,
|
| 45 |
+
"base_model_size": "31B",
|
| 46 |
+
"train_on_inputs": "false",
|
| 47 |
+
"training_method": "sft",
|
| 48 |
+
"lr_scheduler_type": "cosine",
|
| 49 |
+
"scheduler_num_cycles": 0.5,
|
| 50 |
+
"lora_trainable_modules": "q_proj,v_proj"
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
## Training Data
|
| 56 |
+
|
| 57 |
+
The model was trained on 21,063 rows of adapted data with the following domain distribution: math (56%), code (25%), science (3%), other (1%), technology (1%), history (1%), writing-editing-communication (1%), medical (1%), cooking (1%), games (1%), music (1%), entertainment (1%), language (1%), sports (1%), culture (1%), animal-nature (0%), religion (0%), geography (0%), travel (0%), how-to (0%), governance (0%), academic-education (0%), corporate-business (0%), art (0%), transportation (0%), fitness-sports (0%), personal-growth (0%), career-workplace (0%), personal-finance (0%), product-advice (0%), legal (0%), roleplay (0%), architecture-design (0%), agriculture (0%), marketing (0%), parenting-family (0%), dating (0%), news (0%), data-analysis-visualization (0%), fashion-beauty (0%), market-analysis (0%), social (0%), hr (0%), finance (0%).
|
| 58 |
+
|
| 59 |
+
## Model Evaluation
|
| 60 |
+
|
| 61 |
+
The model was evaluated on an in-distribution held-out test set as well as a broader domain-specific test set to measure generalization.
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
## How to use
|
| 68 |
+
|
| 69 |
+
```bash
|
| 70 |
+
pip install torch transformers peft
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
```python
|
| 74 |
+
import torch
|
| 75 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 76 |
+
from peft import PeftModel
|
| 77 |
+
|
| 78 |
+
BASE = "google/gemma-4-31B-it"
|
| 79 |
+
ADAPTER = "<this-repo-id>"
|
| 80 |
+
|
| 81 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 82 |
+
dtype = torch.float32 if device == "cpu" else torch.bfloat16
|
| 83 |
+
|
| 84 |
+
base = AutoModelForCausalLM.from_pretrained(BASE, dtype=dtype).to(device)
|
| 85 |
+
model = PeftModel.from_pretrained(base, ADAPTER)
|
| 86 |
+
# Optional: merge the LoRA weights into the base for faster inference
|
| 87 |
+
model = model.merge_and_unload()
|
| 88 |
+
model.eval()
|
| 89 |
+
|
| 90 |
+
tokenizer = AutoTokenizer.from_pretrained(BASE)
|
| 91 |
+
messages = [{"role": "user", "content": "Hello!"}]
|
| 92 |
+
text = tokenizer.apply_chat_template(
|
| 93 |
+
messages, tokenize=False, add_generation_prompt=True)
|
| 94 |
+
inputs = tokenizer(text, return_tensors="pt").to(device)
|
| 95 |
+
|
| 96 |
+
with torch.inference_mode():
|
| 97 |
+
out = model.generate(**inputs, max_new_tokens=512)
|
| 98 |
+
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
|
| 99 |
+
```
|
adapter_config.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": "google/gemma-4-31B-it",
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"corda_config": null,
|
| 7 |
+
"eva_config": null,
|
| 8 |
+
"exclude_modules": [],
|
| 9 |
+
"fan_in_fan_out": false,
|
| 10 |
+
"inference_mode": true,
|
| 11 |
+
"init_lora_weights": true,
|
| 12 |
+
"layer_replication": null,
|
| 13 |
+
"layers_pattern": null,
|
| 14 |
+
"layers_to_transform": null,
|
| 15 |
+
"loftq_config": {},
|
| 16 |
+
"lora_alpha": 8,
|
| 17 |
+
"lora_bias": false,
|
| 18 |
+
"lora_dropout": 0.0,
|
| 19 |
+
"megatron_config": null,
|
| 20 |
+
"megatron_core": "megatron.core",
|
| 21 |
+
"modules_to_save": null,
|
| 22 |
+
"peft_type": "LORA",
|
| 23 |
+
"r": 8,
|
| 24 |
+
"rank_pattern": {},
|
| 25 |
+
"revision": null,
|
| 26 |
+
"target_modules": [
|
| 27 |
+
"q_proj",
|
| 28 |
+
"v_proj"
|
| 29 |
+
],
|
| 30 |
+
"task_type": "CAUSAL_LM",
|
| 31 |
+
"trainable_token_indices": null,
|
| 32 |
+
"use_dora": false,
|
| 33 |
+
"use_rslora": false
|
| 34 |
+
}
|
adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3efb30e9f06457a9dde4acb1c596c5f4f6fa754ab5395e67a3bdbc1db8e06e12
|
| 3 |
+
size 43856576
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,347 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- macro format_parameters(properties, required) -%}
|
| 2 |
+
{%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%}
|
| 3 |
+
{%- set ns = namespace(found_first=false) -%}
|
| 4 |
+
{%- for key, value in properties | dictsort -%}
|
| 5 |
+
{%- set add_comma = false -%}
|
| 6 |
+
{%- if key not in standard_keys -%}
|
| 7 |
+
{%- if ns.found_first %},{% endif -%}
|
| 8 |
+
{%- set ns.found_first = true -%}
|
| 9 |
+
{{ key }}:{
|
| 10 |
+
{%- if value['description'] -%}
|
| 11 |
+
description:<|"|>{{ value['description'] }}<|"|>
|
| 12 |
+
{%- set add_comma = true -%}
|
| 13 |
+
{%- endif -%}
|
| 14 |
+
{%- if value['type'] | upper == 'STRING' -%}
|
| 15 |
+
{%- if value['enum'] -%}
|
| 16 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 17 |
+
enum:{{ format_argument(value['enum']) }}
|
| 18 |
+
{%- endif -%}
|
| 19 |
+
{%- elif value['type'] | upper == 'ARRAY' -%}
|
| 20 |
+
{%- if value['items'] is mapping and value['items'] -%}
|
| 21 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 22 |
+
items:{
|
| 23 |
+
{%- set ns_items = namespace(found_first=false) -%}
|
| 24 |
+
{%- for item_key, item_value in value['items'] | dictsort -%}
|
| 25 |
+
{%- if item_value is not none -%}
|
| 26 |
+
{%- if ns_items.found_first %},{% endif -%}
|
| 27 |
+
{%- set ns_items.found_first = true -%}
|
| 28 |
+
{%- if item_key == 'properties' -%}
|
| 29 |
+
properties:{
|
| 30 |
+
{%- if item_value is mapping -%}
|
| 31 |
+
{{- format_parameters(item_value, value['items']['required'] | default([])) -}}
|
| 32 |
+
{%- endif -%}
|
| 33 |
+
}
|
| 34 |
+
{%- elif item_key == 'required' -%}
|
| 35 |
+
required:[
|
| 36 |
+
{%- for req_item in item_value -%}
|
| 37 |
+
<|"|>{{- req_item -}}<|"|>
|
| 38 |
+
{%- if not loop.last %},{% endif -%}
|
| 39 |
+
{%- endfor -%}
|
| 40 |
+
]
|
| 41 |
+
{%- elif item_key == 'type' -%}
|
| 42 |
+
{%- if item_value is string -%}
|
| 43 |
+
type:{{ format_argument(item_value | upper) }}
|
| 44 |
+
{%- else -%}
|
| 45 |
+
type:{{ format_argument(item_value | map('upper') | list) }}
|
| 46 |
+
{%- endif -%}
|
| 47 |
+
{%- else -%}
|
| 48 |
+
{{ item_key }}:{{ format_argument(item_value) }}
|
| 49 |
+
{%- endif -%}
|
| 50 |
+
{%- endif -%}
|
| 51 |
+
{%- endfor -%}
|
| 52 |
+
}
|
| 53 |
+
{%- endif -%}
|
| 54 |
+
{%- endif -%}
|
| 55 |
+
{%- if value['nullable'] %}
|
| 56 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 57 |
+
nullable:true
|
| 58 |
+
{%- endif -%}
|
| 59 |
+
{%- if value['type'] | upper == 'OBJECT' -%}
|
| 60 |
+
{%- if value['properties'] is defined and value['properties'] is mapping -%}
|
| 61 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 62 |
+
properties:{
|
| 63 |
+
{{- format_parameters(value['properties'], value['required'] | default([])) -}}
|
| 64 |
+
}
|
| 65 |
+
{%- elif value is mapping -%}
|
| 66 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 67 |
+
properties:{
|
| 68 |
+
{{- format_parameters(value, value['required'] | default([])) -}}
|
| 69 |
+
}
|
| 70 |
+
{%- endif -%}
|
| 71 |
+
{%- if value['required'] -%}
|
| 72 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 73 |
+
required:[
|
| 74 |
+
{%- for item in value['required'] | default([]) -%}
|
| 75 |
+
<|"|>{{- item -}}<|"|>
|
| 76 |
+
{%- if not loop.last %},{% endif -%}
|
| 77 |
+
{%- endfor -%}
|
| 78 |
+
]
|
| 79 |
+
{%- endif -%}
|
| 80 |
+
{%- endif -%}
|
| 81 |
+
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 82 |
+
type:<|"|>{{ value['type'] | upper }}<|"|>}
|
| 83 |
+
{%- endif -%}
|
| 84 |
+
{%- endfor -%}
|
| 85 |
+
{%- endmacro -%}
|
| 86 |
+
{%- macro format_function_declaration(tool_data) -%}
|
| 87 |
+
declaration:{{- tool_data['function']['name'] -}}{description:<|"|>{{- tool_data['function']['description'] -}}<|"|>
|
| 88 |
+
{%- set params = tool_data['function']['parameters'] -%}
|
| 89 |
+
{%- if params -%}
|
| 90 |
+
,parameters:{
|
| 91 |
+
{%- if params['properties'] -%}
|
| 92 |
+
properties:{ {{- format_parameters(params['properties'], params['required']) -}} },
|
| 93 |
+
{%- endif -%}
|
| 94 |
+
{%- if params['required'] -%}
|
| 95 |
+
required:[
|
| 96 |
+
{%- for item in params['required'] -%}
|
| 97 |
+
<|"|>{{- item -}}<|"|>
|
| 98 |
+
{{- ',' if not loop.last -}}
|
| 99 |
+
{%- endfor -%}
|
| 100 |
+
],
|
| 101 |
+
{%- endif -%}
|
| 102 |
+
{%- if params['type'] -%}
|
| 103 |
+
type:<|"|>{{- params['type'] | upper -}}<|"|>}
|
| 104 |
+
{%- endif -%}
|
| 105 |
+
{%- endif -%}
|
| 106 |
+
{%- if 'response' in tool_data['function'] -%}
|
| 107 |
+
{%- set response_declaration = tool_data['function']['response'] -%}
|
| 108 |
+
,response:{
|
| 109 |
+
{%- if response_declaration['description'] -%}
|
| 110 |
+
description:<|"|>{{- response_declaration['description'] -}}<|"|>,
|
| 111 |
+
{%- endif -%}
|
| 112 |
+
{%- if response_declaration['type'] | upper == 'OBJECT' -%}
|
| 113 |
+
type:<|"|>{{- response_declaration['type'] | upper -}}<|"|>}
|
| 114 |
+
{%- endif -%}
|
| 115 |
+
{%- endif -%}
|
| 116 |
+
}
|
| 117 |
+
{%- endmacro -%}
|
| 118 |
+
{%- macro format_argument(argument, escape_keys=True) -%}
|
| 119 |
+
{%- if argument is string -%}
|
| 120 |
+
{{- '<|"|>' + argument + '<|"|>' -}}
|
| 121 |
+
{%- elif argument is boolean -%}
|
| 122 |
+
{{- 'true' if argument else 'false' -}}
|
| 123 |
+
{%- elif argument is mapping -%}
|
| 124 |
+
{{- '{' -}}
|
| 125 |
+
{%- set ns = namespace(found_first=false) -%}
|
| 126 |
+
{%- for key, value in argument | dictsort -%}
|
| 127 |
+
{%- if ns.found_first %},{% endif -%}
|
| 128 |
+
{%- set ns.found_first = true -%}
|
| 129 |
+
{%- if escape_keys -%}
|
| 130 |
+
{{- '<|"|>' + key + '<|"|>' -}}
|
| 131 |
+
{%- else -%}
|
| 132 |
+
{{- key -}}
|
| 133 |
+
{%- endif -%}
|
| 134 |
+
:{{- format_argument(value, escape_keys=escape_keys) -}}
|
| 135 |
+
{%- endfor -%}
|
| 136 |
+
{{- '}' -}}
|
| 137 |
+
{%- elif argument is sequence -%}
|
| 138 |
+
{{- '[' -}}
|
| 139 |
+
{%- for item in argument -%}
|
| 140 |
+
{{- format_argument(item, escape_keys=escape_keys) -}}
|
| 141 |
+
{%- if not loop.last %},{% endif -%}
|
| 142 |
+
{%- endfor -%}
|
| 143 |
+
{{- ']' -}}
|
| 144 |
+
{%- else -%}
|
| 145 |
+
{{- argument -}}
|
| 146 |
+
{%- endif -%}
|
| 147 |
+
{%- endmacro -%}
|
| 148 |
+
{%- macro strip_thinking(text) -%}
|
| 149 |
+
{%- set ns = namespace(result='') -%}
|
| 150 |
+
{%- for part in text.split('<channel|>') -%}
|
| 151 |
+
{%- if '<|channel>' in part -%}
|
| 152 |
+
{%- set ns.result = ns.result + part.split('<|channel>')[0] -%}
|
| 153 |
+
{%- else -%}
|
| 154 |
+
{%- set ns.result = ns.result + part -%}
|
| 155 |
+
{%- endif -%}
|
| 156 |
+
{%- endfor -%}
|
| 157 |
+
{{- ns.result | trim -}}
|
| 158 |
+
{%- endmacro -%}
|
| 159 |
+
|
| 160 |
+
{%- macro format_tool_response_block(tool_name, response) -%}
|
| 161 |
+
{{- '<|tool_response>' -}}
|
| 162 |
+
{%- if response is mapping -%}
|
| 163 |
+
{{- 'response:' + tool_name + '{' -}}
|
| 164 |
+
{%- for key, value in response | dictsort -%}
|
| 165 |
+
{{- key -}}:{{- format_argument(value, escape_keys=False) -}}
|
| 166 |
+
{%- if not loop.last %},{% endif -%}
|
| 167 |
+
{%- endfor -%}
|
| 168 |
+
{{- '}' -}}
|
| 169 |
+
{%- else -%}
|
| 170 |
+
{{- 'response:' + tool_name + '{value:' + format_argument(response, escape_keys=False) + '}' -}}
|
| 171 |
+
{%- endif -%}
|
| 172 |
+
{{- '<tool_response|>' -}}
|
| 173 |
+
{%- endmacro -%}
|
| 174 |
+
|
| 175 |
+
{%- set ns = namespace(prev_message_type=None) -%}
|
| 176 |
+
{%- set loop_messages = messages -%}
|
| 177 |
+
{{- bos_token -}}
|
| 178 |
+
{#- Handle System/Tool Definitions Block -#}
|
| 179 |
+
{%- if (enable_thinking is defined and enable_thinking) or tools or messages[0]['role'] in ['system', 'developer'] -%}
|
| 180 |
+
{{- '<|turn>system\n' -}}
|
| 181 |
+
|
| 182 |
+
{#- Inject Thinking token at the very top of the FIRST system turn -#}
|
| 183 |
+
{%- if enable_thinking is defined and enable_thinking -%}
|
| 184 |
+
{{- '<|think|>\n' -}}
|
| 185 |
+
{%- set ns.prev_message_type = 'think' -%}
|
| 186 |
+
{%- endif -%}
|
| 187 |
+
|
| 188 |
+
{%- if messages[0]['role'] in ['system', 'developer'] -%}
|
| 189 |
+
{{- messages[0]['content'] | trim -}}
|
| 190 |
+
{%- set loop_messages = messages[1:] -%}
|
| 191 |
+
{%- endif -%}
|
| 192 |
+
|
| 193 |
+
{%- if tools -%}
|
| 194 |
+
{%- for tool in tools %}
|
| 195 |
+
{{- '<|tool>' -}}
|
| 196 |
+
{{- format_function_declaration(tool) | trim -}}
|
| 197 |
+
{{- '<tool|>' -}}
|
| 198 |
+
{%- endfor %}
|
| 199 |
+
{%- set ns.prev_message_type = 'tool' -%}
|
| 200 |
+
{%- endif -%}
|
| 201 |
+
|
| 202 |
+
{{- '<turn|>\n' -}}
|
| 203 |
+
{%- endif %}
|
| 204 |
+
|
| 205 |
+
{#- Pre-scan: find last user message index for reasoning guard -#}
|
| 206 |
+
{%- set ns_turn = namespace(last_user_idx=-1) -%}
|
| 207 |
+
{%- for i in range(loop_messages | length) -%}
|
| 208 |
+
{%- if loop_messages[i]['role'] == 'user' -%}
|
| 209 |
+
{%- set ns_turn.last_user_idx = i -%}
|
| 210 |
+
{%- endif -%}
|
| 211 |
+
{%- endfor -%}
|
| 212 |
+
|
| 213 |
+
{#- Loop through messages -#}
|
| 214 |
+
{%- for message in loop_messages -%}
|
| 215 |
+
{%- if message['role'] != 'tool' -%}
|
| 216 |
+
{%- set ns.prev_message_type = None -%}
|
| 217 |
+
{%- set role = 'model' if message['role'] == 'assistant' else message['role'] -%}
|
| 218 |
+
{#- Detect continuation: suppress duplicate <|turn>model when previous non-tool message was also assistant -#}
|
| 219 |
+
{%- set prev_nt = namespace(role=None, found=false) -%}
|
| 220 |
+
{%- if loop.index0 > 0 -%}
|
| 221 |
+
{%- for j in range(loop.index0 - 1, -1, -1) -%}
|
| 222 |
+
{%- if not prev_nt.found -%}
|
| 223 |
+
{%- if loop_messages[j]['role'] != 'tool' -%}
|
| 224 |
+
{%- set prev_nt.role = loop_messages[j]['role'] -%}
|
| 225 |
+
{%- set prev_nt.found = true -%}
|
| 226 |
+
{%- endif -%}
|
| 227 |
+
{%- endif -%}
|
| 228 |
+
{%- endfor -%}
|
| 229 |
+
{%- endif -%}
|
| 230 |
+
{%- set continue_same_model_turn = (role == 'model' and prev_nt.role == 'assistant') -%}
|
| 231 |
+
{%- if not continue_same_model_turn -%}
|
| 232 |
+
{{- '<|turn>' + role + '\n' }}
|
| 233 |
+
{%- endif -%}
|
| 234 |
+
|
| 235 |
+
{#- Render reasoning/reasoning_content as thinking channel -#}
|
| 236 |
+
{%- set thinking_text = message.get('reasoning') or message.get('reasoning_content') -%}
|
| 237 |
+
{%- if thinking_text and loop.index0 > ns_turn.last_user_idx and message.get('tool_calls') -%}
|
| 238 |
+
{{- '<|channel>thought\n' + thinking_text + '\n<channel|>' -}}
|
| 239 |
+
{%- endif -%}
|
| 240 |
+
|
| 241 |
+
{%- if message['tool_calls'] -%}
|
| 242 |
+
{%- for tool_call in message['tool_calls'] -%}
|
| 243 |
+
{%- set function = tool_call['function'] -%}
|
| 244 |
+
{{- '<|tool_call>call:' + function['name'] + '{' -}}
|
| 245 |
+
{%- if function['arguments'] is mapping -%}
|
| 246 |
+
{%- set ns_args = namespace(found_first=false) -%}
|
| 247 |
+
{%- for key, value in function['arguments'] | dictsort -%}
|
| 248 |
+
{%- if ns_args.found_first %},{% endif -%}
|
| 249 |
+
{%- set ns_args.found_first = true -%}
|
| 250 |
+
{{- key -}}:{{- format_argument(value, escape_keys=False) -}}
|
| 251 |
+
{%- endfor -%}
|
| 252 |
+
{%- elif function['arguments'] is string -%}
|
| 253 |
+
{{- function['arguments'] -}}
|
| 254 |
+
{%- endif -%}
|
| 255 |
+
{{- '}<tool_call|>' -}}
|
| 256 |
+
{%- endfor -%}
|
| 257 |
+
{%- set ns.prev_message_type = 'tool_call' -%}
|
| 258 |
+
{%- endif -%}
|
| 259 |
+
|
| 260 |
+
{%- set ns_tr_out = namespace(flag=false) -%}
|
| 261 |
+
{%- if message.get('tool_responses') -%}
|
| 262 |
+
{#- Legacy: tool_responses embedded on the assistant message (Google/Gemma native) -#}
|
| 263 |
+
{%- for tool_response in message['tool_responses'] -%}
|
| 264 |
+
{{- format_tool_response_block(tool_response['name'] | default('unknown'), tool_response['response']) -}}
|
| 265 |
+
{%- set ns_tr_out.flag = true -%}
|
| 266 |
+
{%- set ns.prev_message_type = 'tool_response' -%}
|
| 267 |
+
{%- endfor -%}
|
| 268 |
+
{%- elif message.get('tool_calls') -%}
|
| 269 |
+
{#- OpenAI Chat Completions: forward-scan consecutive role:tool messages -#}
|
| 270 |
+
{%- set ns_tool_scan = namespace(stopped=false) -%}
|
| 271 |
+
{%- for k in range(loop.index0 + 1, loop_messages | length) -%}
|
| 272 |
+
{%- if ns_tool_scan.stopped -%}
|
| 273 |
+
{%- elif loop_messages[k]['role'] != 'tool' -%}
|
| 274 |
+
{%- set ns_tool_scan.stopped = true -%}
|
| 275 |
+
{%- else -%}
|
| 276 |
+
{%- set follow = loop_messages[k] -%}
|
| 277 |
+
{#- Resolve tool_call_id to function name -#}
|
| 278 |
+
{%- set ns_tname = namespace(name=follow.get('name') | default('unknown')) -%}
|
| 279 |
+
{%- for tc in message['tool_calls'] -%}
|
| 280 |
+
{%- if tc.get('id') == follow.get('tool_call_id') -%}
|
| 281 |
+
{%- set ns_tname.name = tc['function']['name'] -%}
|
| 282 |
+
{%- endif -%}
|
| 283 |
+
{%- endfor -%}
|
| 284 |
+
{#- Handle content as string or content-parts array -#}
|
| 285 |
+
{%- set tool_body = follow.get('content') -%}
|
| 286 |
+
{%- if tool_body is string -%}
|
| 287 |
+
{{- format_tool_response_block(ns_tname.name, tool_body) -}}
|
| 288 |
+
{%- elif tool_body is sequence and tool_body is not string -%}
|
| 289 |
+
{%- set ns_txt = namespace(s='') -%}
|
| 290 |
+
{%- for part in tool_body -%}
|
| 291 |
+
{%- if part.get('type') == 'text' -%}
|
| 292 |
+
{%- set ns_txt.s = ns_txt.s + (part.get('text') | default('')) -%}
|
| 293 |
+
{%- endif -%}
|
| 294 |
+
{%- endfor -%}
|
| 295 |
+
{{- format_tool_response_block(ns_tname.name, ns_txt.s) -}}
|
| 296 |
+
{%- else -%}
|
| 297 |
+
{{- format_tool_response_block(ns_tname.name, tool_body) -}}
|
| 298 |
+
{%- endif -%}
|
| 299 |
+
{%- set ns_tr_out.flag = true -%}
|
| 300 |
+
{%- set ns.prev_message_type = 'tool_response' -%}
|
| 301 |
+
{%- endif -%}
|
| 302 |
+
{%- endfor -%}
|
| 303 |
+
{%- endif -%}
|
| 304 |
+
|
| 305 |
+
{%- if message['content'] is string -%}
|
| 306 |
+
{%- if role == 'model' -%}
|
| 307 |
+
{{- strip_thinking(message['content']) -}}
|
| 308 |
+
{%- else -%}
|
| 309 |
+
{{- message['content'] | trim -}}
|
| 310 |
+
{%- endif -%}
|
| 311 |
+
{%- elif message['content'] is sequence -%}
|
| 312 |
+
{%- for item in message['content'] -%}
|
| 313 |
+
{%- if item['type'] == 'text' -%}
|
| 314 |
+
{%- if role == 'model' -%}
|
| 315 |
+
{{- strip_thinking(item['text']) -}}
|
| 316 |
+
{%- else -%}
|
| 317 |
+
{{- item['text'] | trim -}}
|
| 318 |
+
{%- endif -%}
|
| 319 |
+
{%- elif item['type'] == 'image' -%}
|
| 320 |
+
{{- '<|image|>' -}}
|
| 321 |
+
{%- set ns.prev_message_type = 'image' -%}
|
| 322 |
+
{%- elif item['type'] == 'audio' -%}
|
| 323 |
+
{{- '<|audio|>' -}}
|
| 324 |
+
{%- set ns.prev_message_type = 'audio' -%}
|
| 325 |
+
{%- elif item['type'] == 'video' -%}
|
| 326 |
+
{{- '<|video|>' -}}
|
| 327 |
+
{%- set ns.prev_message_type = 'video' -%}
|
| 328 |
+
{%- endif -%}
|
| 329 |
+
{%- endfor -%}
|
| 330 |
+
{%- endif -%}
|
| 331 |
+
|
| 332 |
+
{%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
|
| 333 |
+
{{- '<|tool_response>' -}}
|
| 334 |
+
{%- elif not (ns_tr_out.flag and not message.get('content')) -%}
|
| 335 |
+
{{- '<turn|>\n' -}}
|
| 336 |
+
{%- endif -%}
|
| 337 |
+
{%- endif -%}
|
| 338 |
+
{%- endfor -%}
|
| 339 |
+
|
| 340 |
+
{%- if add_generation_prompt -%}
|
| 341 |
+
{%- if ns.prev_message_type != 'tool_response' and ns.prev_message_type != 'tool_call' -%}
|
| 342 |
+
{{- '<|turn>model\n' -}}
|
| 343 |
+
{%- if not enable_thinking | default(false) -%}
|
| 344 |
+
{{- '<|channel>thought\n<channel|>' -}}
|
| 345 |
+
{%- endif -%}
|
| 346 |
+
{%- endif -%}
|
| 347 |
+
{%- endif -%}
|
config.json
ADDED
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Gemma4ForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"audio_config": null,
|
| 6 |
+
"audio_token_id": 258881,
|
| 7 |
+
"boa_token_id": 256000,
|
| 8 |
+
"boi_token_id": 255999,
|
| 9 |
+
"bos_token_id": 2,
|
| 10 |
+
"dtype": "bfloat16",
|
| 11 |
+
"eoa_token_id": 258883,
|
| 12 |
+
"eoa_token_index": 258883,
|
| 13 |
+
"eoi_token_id": 258882,
|
| 14 |
+
"eos_token_id": 1,
|
| 15 |
+
"image_token_id": 258880,
|
| 16 |
+
"initializer_range": 0.02,
|
| 17 |
+
"model_type": "gemma4",
|
| 18 |
+
"pad_token_id": 0,
|
| 19 |
+
"text_config": {
|
| 20 |
+
"attention_bias": false,
|
| 21 |
+
"attention_dropout": 0.0,
|
| 22 |
+
"attention_k_eq_v": true,
|
| 23 |
+
"bos_token_id": 2,
|
| 24 |
+
"dtype": "bfloat16",
|
| 25 |
+
"enable_moe_block": false,
|
| 26 |
+
"eos_token_id": 1,
|
| 27 |
+
"expert_intermediate_size": null,
|
| 28 |
+
"final_logit_softcapping": 30.0,
|
| 29 |
+
"global_head_dim": 512,
|
| 30 |
+
"head_dim": 256,
|
| 31 |
+
"hidden_activation": "gelu_pytorch_tanh",
|
| 32 |
+
"hidden_size": 5376,
|
| 33 |
+
"hidden_size_per_layer_input": 0,
|
| 34 |
+
"initializer_range": 0.02,
|
| 35 |
+
"intermediate_size": 21504,
|
| 36 |
+
"layer_types": [
|
| 37 |
+
"sliding_attention",
|
| 38 |
+
"sliding_attention",
|
| 39 |
+
"sliding_attention",
|
| 40 |
+
"sliding_attention",
|
| 41 |
+
"sliding_attention",
|
| 42 |
+
"full_attention",
|
| 43 |
+
"sliding_attention",
|
| 44 |
+
"sliding_attention",
|
| 45 |
+
"sliding_attention",
|
| 46 |
+
"sliding_attention",
|
| 47 |
+
"sliding_attention",
|
| 48 |
+
"full_attention",
|
| 49 |
+
"sliding_attention",
|
| 50 |
+
"sliding_attention",
|
| 51 |
+
"sliding_attention",
|
| 52 |
+
"sliding_attention",
|
| 53 |
+
"sliding_attention",
|
| 54 |
+
"full_attention",
|
| 55 |
+
"sliding_attention",
|
| 56 |
+
"sliding_attention",
|
| 57 |
+
"sliding_attention",
|
| 58 |
+
"sliding_attention",
|
| 59 |
+
"sliding_attention",
|
| 60 |
+
"full_attention",
|
| 61 |
+
"sliding_attention",
|
| 62 |
+
"sliding_attention",
|
| 63 |
+
"sliding_attention",
|
| 64 |
+
"sliding_attention",
|
| 65 |
+
"sliding_attention",
|
| 66 |
+
"full_attention",
|
| 67 |
+
"sliding_attention",
|
| 68 |
+
"sliding_attention",
|
| 69 |
+
"sliding_attention",
|
| 70 |
+
"sliding_attention",
|
| 71 |
+
"sliding_attention",
|
| 72 |
+
"full_attention",
|
| 73 |
+
"sliding_attention",
|
| 74 |
+
"sliding_attention",
|
| 75 |
+
"sliding_attention",
|
| 76 |
+
"sliding_attention",
|
| 77 |
+
"sliding_attention",
|
| 78 |
+
"full_attention",
|
| 79 |
+
"sliding_attention",
|
| 80 |
+
"sliding_attention",
|
| 81 |
+
"sliding_attention",
|
| 82 |
+
"sliding_attention",
|
| 83 |
+
"sliding_attention",
|
| 84 |
+
"full_attention",
|
| 85 |
+
"sliding_attention",
|
| 86 |
+
"sliding_attention",
|
| 87 |
+
"sliding_attention",
|
| 88 |
+
"sliding_attention",
|
| 89 |
+
"sliding_attention",
|
| 90 |
+
"full_attention",
|
| 91 |
+
"sliding_attention",
|
| 92 |
+
"sliding_attention",
|
| 93 |
+
"sliding_attention",
|
| 94 |
+
"sliding_attention",
|
| 95 |
+
"sliding_attention",
|
| 96 |
+
"full_attention"
|
| 97 |
+
],
|
| 98 |
+
"max_position_embeddings": 262144,
|
| 99 |
+
"model_type": "gemma4_text",
|
| 100 |
+
"moe_intermediate_size": null,
|
| 101 |
+
"num_attention_heads": 32,
|
| 102 |
+
"num_experts": null,
|
| 103 |
+
"num_global_key_value_heads": 4,
|
| 104 |
+
"num_hidden_layers": 60,
|
| 105 |
+
"num_key_value_heads": 16,
|
| 106 |
+
"num_kv_shared_layers": 0,
|
| 107 |
+
"pad_token_id": 0,
|
| 108 |
+
"rms_norm_eps": 1e-06,
|
| 109 |
+
"rope_parameters": {
|
| 110 |
+
"full_attention": {
|
| 111 |
+
"partial_rotary_factor": 0.25,
|
| 112 |
+
"rope_theta": 1000000.0,
|
| 113 |
+
"rope_type": "proportional"
|
| 114 |
+
},
|
| 115 |
+
"sliding_attention": {
|
| 116 |
+
"rope_theta": 10000.0,
|
| 117 |
+
"rope_type": "default"
|
| 118 |
+
}
|
| 119 |
+
},
|
| 120 |
+
"sliding_window": 1024,
|
| 121 |
+
"tie_word_embeddings": true,
|
| 122 |
+
"top_k_experts": null,
|
| 123 |
+
"use_bidirectional_attention": "vision",
|
| 124 |
+
"use_cache": false,
|
| 125 |
+
"use_double_wide_mlp": false,
|
| 126 |
+
"vocab_size": 262144,
|
| 127 |
+
"vocab_size_per_layer_input": 262144,
|
| 128 |
+
"torch_dtype": "bfloat16"
|
| 129 |
+
},
|
| 130 |
+
"tie_word_embeddings": true,
|
| 131 |
+
"transformers_version": "5.13.0",
|
| 132 |
+
"use_cache": false,
|
| 133 |
+
"video_token_id": 258884,
|
| 134 |
+
"vision_config": {
|
| 135 |
+
"_name_or_path": "",
|
| 136 |
+
"architectures": null,
|
| 137 |
+
"attention_bias": false,
|
| 138 |
+
"attention_dropout": 0.0,
|
| 139 |
+
"chunk_size_feed_forward": 0,
|
| 140 |
+
"default_output_length": 280,
|
| 141 |
+
"global_head_dim": 72,
|
| 142 |
+
"head_dim": 72,
|
| 143 |
+
"hidden_activation": "gelu_pytorch_tanh",
|
| 144 |
+
"hidden_size": 1152,
|
| 145 |
+
"id2label": {
|
| 146 |
+
"0": "LABEL_0",
|
| 147 |
+
"1": "LABEL_1"
|
| 148 |
+
},
|
| 149 |
+
"initializer_range": 0.02,
|
| 150 |
+
"intermediate_size": 4304,
|
| 151 |
+
"is_encoder_decoder": false,
|
| 152 |
+
"label2id": {
|
| 153 |
+
"LABEL_0": 0,
|
| 154 |
+
"LABEL_1": 1
|
| 155 |
+
},
|
| 156 |
+
"max_position_embeddings": 131072,
|
| 157 |
+
"model_type": "gemma4_vision",
|
| 158 |
+
"num_attention_heads": 16,
|
| 159 |
+
"num_hidden_layers": 27,
|
| 160 |
+
"num_key_value_heads": 16,
|
| 161 |
+
"output_attentions": false,
|
| 162 |
+
"output_hidden_states": false,
|
| 163 |
+
"patch_size": 16,
|
| 164 |
+
"pooling_kernel_size": 3,
|
| 165 |
+
"position_embedding_size": 10240,
|
| 166 |
+
"problem_type": null,
|
| 167 |
+
"return_dict": true,
|
| 168 |
+
"rms_norm_eps": 1e-06,
|
| 169 |
+
"rope_parameters": {
|
| 170 |
+
"rope_theta": 100.0,
|
| 171 |
+
"rope_type": "default"
|
| 172 |
+
},
|
| 173 |
+
"standardize": true,
|
| 174 |
+
"use_clipped_linears": false
|
| 175 |
+
},
|
| 176 |
+
"vision_soft_tokens_per_image": 280,
|
| 177 |
+
"torch_dtype": "bfloat16"
|
| 178 |
+
}
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"audio_token": "<|audio|>",
|
| 3 |
+
"boa_token": "<|audio>",
|
| 4 |
+
"boi_token": "<|image>",
|
| 5 |
+
"bos_token": "<bos>",
|
| 6 |
+
"eoa_token": "<audio|>",
|
| 7 |
+
"eoc_token": "<channel|>",
|
| 8 |
+
"eoi_token": "<image|>",
|
| 9 |
+
"eos_token": "<eos>",
|
| 10 |
+
"eot_token": "<turn|>",
|
| 11 |
+
"escape_token": "<|\"|>",
|
| 12 |
+
"etc_token": "<tool_call|>",
|
| 13 |
+
"etd_token": "<tool|>",
|
| 14 |
+
"etr_token": "<tool_response|>",
|
| 15 |
+
"image_token": "<|image|>",
|
| 16 |
+
"mask_token": "<mask>",
|
| 17 |
+
"pad_token": "<pad>",
|
| 18 |
+
"soc_token": "<|channel>",
|
| 19 |
+
"sot_token": "<|turn>",
|
| 20 |
+
"stc_token": "<|tool_call>",
|
| 21 |
+
"std_token": "<|tool>",
|
| 22 |
+
"str_token": "<|tool_response>",
|
| 23 |
+
"think_token": "<|think|>",
|
| 24 |
+
"unk_token": "<unk>"
|
| 25 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cc8d3a0ce36466ccc1278bf987df5f71db1719b9ca6b4118264f45cb627bfe0f
|
| 3 |
+
size 32169626
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"additional_special_tokens": [
|
| 3 |
+
"<|video|>"
|
| 4 |
+
],
|
| 5 |
+
"audio_token": "<|audio|>",
|
| 6 |
+
"backend": "tokenizers",
|
| 7 |
+
"boa_token": "<|audio>",
|
| 8 |
+
"boi_token": "<|image>",
|
| 9 |
+
"bos_token": "<bos>",
|
| 10 |
+
"eoa_token": "<audio|>",
|
| 11 |
+
"eoc_token": "<channel|>",
|
| 12 |
+
"eoi_token": "<image|>",
|
| 13 |
+
"eos_token": "<eos>",
|
| 14 |
+
"eot_token": "<turn|>",
|
| 15 |
+
"escape_token": "<|\"|>",
|
| 16 |
+
"etc_token": "<tool_call|>",
|
| 17 |
+
"etd_token": "<tool|>",
|
| 18 |
+
"etr_token": "<tool_response|>",
|
| 19 |
+
"image_token": "<|image|>",
|
| 20 |
+
"is_local": false,
|
| 21 |
+
"local_files_only": true,
|
| 22 |
+
"mask_token": "<mask>",
|
| 23 |
+
"model_max_length": 49152,
|
| 24 |
+
"model_specific_special_tokens": {
|
| 25 |
+
"audio_token": "<|audio|>",
|
| 26 |
+
"boa_token": "<|audio>",
|
| 27 |
+
"boi_token": "<|image>",
|
| 28 |
+
"eoa_token": "<audio|>",
|
| 29 |
+
"eoc_token": "<channel|>",
|
| 30 |
+
"eoi_token": "<image|>",
|
| 31 |
+
"eot_token": "<turn|>",
|
| 32 |
+
"escape_token": "<|\"|>",
|
| 33 |
+
"etc_token": "<tool_call|>",
|
| 34 |
+
"etd_token": "<tool|>",
|
| 35 |
+
"etr_token": "<tool_response|>",
|
| 36 |
+
"image_token": "<|image|>",
|
| 37 |
+
"soc_token": "<|channel>",
|
| 38 |
+
"sot_token": "<|turn>",
|
| 39 |
+
"stc_token": "<|tool_call>",
|
| 40 |
+
"std_token": "<|tool>",
|
| 41 |
+
"str_token": "<|tool_response>",
|
| 42 |
+
"think_token": "<|think|>"
|
| 43 |
+
},
|
| 44 |
+
"pad_token": "<pad>",
|
| 45 |
+
"padding_side": "right",
|
| 46 |
+
"processor_class": "Gemma4Processor",
|
| 47 |
+
"response_schema": {
|
| 48 |
+
"properties": {
|
| 49 |
+
"content": {
|
| 50 |
+
"type": "string"
|
| 51 |
+
},
|
| 52 |
+
"role": {
|
| 53 |
+
"const": "assistant"
|
| 54 |
+
},
|
| 55 |
+
"thinking": {
|
| 56 |
+
"type": "string"
|
| 57 |
+
},
|
| 58 |
+
"tool_calls": {
|
| 59 |
+
"items": {
|
| 60 |
+
"properties": {
|
| 61 |
+
"function": {
|
| 62 |
+
"properties": {
|
| 63 |
+
"arguments": {
|
| 64 |
+
"additionalProperties": {},
|
| 65 |
+
"type": "object",
|
| 66 |
+
"x-parser": "gemma4-tool-call"
|
| 67 |
+
},
|
| 68 |
+
"name": {
|
| 69 |
+
"type": "string"
|
| 70 |
+
}
|
| 71 |
+
},
|
| 72 |
+
"type": "object",
|
| 73 |
+
"x-regex": "call\\:(?P<name>\\w+)(?P<arguments>\\{.*\\})"
|
| 74 |
+
},
|
| 75 |
+
"type": {
|
| 76 |
+
"const": "function"
|
| 77 |
+
}
|
| 78 |
+
},
|
| 79 |
+
"type": "object"
|
| 80 |
+
},
|
| 81 |
+
"type": "array",
|
| 82 |
+
"x-regex-iterator": "<\\|tool_call>(.*?)<tool_call\\|>"
|
| 83 |
+
}
|
| 84 |
+
},
|
| 85 |
+
"type": "object",
|
| 86 |
+
"x-regex": "(\\<\\|channel\\>thought\\n(?P<thinking>.*?)\\<channel\\|\\>)?(?P<tool_calls>\\<\\|tool_call\\>.*\\<tool_call\\|\\>)?(?P<content>(?:(?!\\<turn\\|\\>)(?!\\<\\|tool_response\\>).)+)?(?:\\<turn\\|\\>|\\<\\|tool_response\\>)?"
|
| 87 |
+
},
|
| 88 |
+
"soc_token": "<|channel>",
|
| 89 |
+
"sot_token": "<|turn>",
|
| 90 |
+
"stc_token": "<|tool_call>",
|
| 91 |
+
"std_token": "<|tool>",
|
| 92 |
+
"str_token": "<|tool_response>",
|
| 93 |
+
"think_token": "<|think|>",
|
| 94 |
+
"tokenizer_class": "GemmaTokenizer",
|
| 95 |
+
"unk_token": "<unk>"
|
| 96 |
+
}
|
trainer_state.json
ADDED
|
@@ -0,0 +1,487 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"best_global_step": null,
|
| 3 |
+
"best_metric": null,
|
| 4 |
+
"best_model_checkpoint": null,
|
| 5 |
+
"epoch": 1.0,
|
| 6 |
+
"eval_steps": 11,
|
| 7 |
+
"global_step": 59,
|
| 8 |
+
"is_hyper_param_search": false,
|
| 9 |
+
"is_local_process_zero": true,
|
| 10 |
+
"is_world_process_zero": true,
|
| 11 |
+
"log_history": [
|
| 12 |
+
{
|
| 13 |
+
"epoch": 0.01694915254237288,
|
| 14 |
+
"grad_norm": 3.206836223602295,
|
| 15 |
+
"learning_rate": 0.0,
|
| 16 |
+
"loss": 3.482421875,
|
| 17 |
+
"step": 1
|
| 18 |
+
},
|
| 19 |
+
{
|
| 20 |
+
"epoch": 0.03389830508474576,
|
| 21 |
+
"grad_norm": 2.847381353378296,
|
| 22 |
+
"learning_rate": 1.6666666666666667e-05,
|
| 23 |
+
"loss": 3.3974609375,
|
| 24 |
+
"step": 2
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"epoch": 0.05084745762711865,
|
| 28 |
+
"grad_norm": 1.4680771827697754,
|
| 29 |
+
"learning_rate": 3.3333333333333335e-05,
|
| 30 |
+
"loss": 3.1318359375,
|
| 31 |
+
"step": 3
|
| 32 |
+
},
|
| 33 |
+
{
|
| 34 |
+
"epoch": 0.06779661016949153,
|
| 35 |
+
"grad_norm": 2.6396775245666504,
|
| 36 |
+
"learning_rate": 5e-05,
|
| 37 |
+
"loss": 3.4658203125,
|
| 38 |
+
"step": 4
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"epoch": 0.0847457627118644,
|
| 42 |
+
"grad_norm": 23.652711868286133,
|
| 43 |
+
"learning_rate": 6.666666666666667e-05,
|
| 44 |
+
"loss": 3.5107421875,
|
| 45 |
+
"step": 5
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"epoch": 0.1016949152542373,
|
| 49 |
+
"grad_norm": 48.07037353515625,
|
| 50 |
+
"learning_rate": 8.333333333333334e-05,
|
| 51 |
+
"loss": 2.72869873046875,
|
| 52 |
+
"step": 6
|
| 53 |
+
},
|
| 54 |
+
{
|
| 55 |
+
"epoch": 0.11864406779661017,
|
| 56 |
+
"grad_norm": 4.403927803039551,
|
| 57 |
+
"learning_rate": 0.0001,
|
| 58 |
+
"loss": 3.408203125,
|
| 59 |
+
"step": 7
|
| 60 |
+
},
|
| 61 |
+
{
|
| 62 |
+
"epoch": 0.13559322033898305,
|
| 63 |
+
"grad_norm": 9.01473331451416,
|
| 64 |
+
"learning_rate": 9.992096792939448e-05,
|
| 65 |
+
"loss": 3.171875,
|
| 66 |
+
"step": 8
|
| 67 |
+
},
|
| 68 |
+
{
|
| 69 |
+
"epoch": 0.15254237288135594,
|
| 70 |
+
"grad_norm": 3.0288233757019043,
|
| 71 |
+
"learning_rate": 9.968414932060826e-05,
|
| 72 |
+
"loss": 3.2919921875,
|
| 73 |
+
"step": 9
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
"epoch": 0.1694915254237288,
|
| 77 |
+
"grad_norm": 6.546408176422119,
|
| 78 |
+
"learning_rate": 9.929037600764186e-05,
|
| 79 |
+
"loss": 2.862548828125,
|
| 80 |
+
"step": 10
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"epoch": 0.1864406779661017,
|
| 84 |
+
"grad_norm": 13.21324634552002,
|
| 85 |
+
"learning_rate": 9.874103113361849e-05,
|
| 86 |
+
"loss": 3.15625,
|
| 87 |
+
"step": 11
|
| 88 |
+
},
|
| 89 |
+
{
|
| 90 |
+
"epoch": 0.2033898305084746,
|
| 91 |
+
"grad_norm": 4.1443328857421875,
|
| 92 |
+
"learning_rate": 9.80380442924435e-05,
|
| 93 |
+
"loss": 2.89453125,
|
| 94 |
+
"step": 12
|
| 95 |
+
},
|
| 96 |
+
{
|
| 97 |
+
"epoch": 0.22033898305084745,
|
| 98 |
+
"grad_norm": 2.7522470951080322,
|
| 99 |
+
"learning_rate": 9.718388475103545e-05,
|
| 100 |
+
"loss": 2.748046875,
|
| 101 |
+
"step": 13
|
| 102 |
+
},
|
| 103 |
+
{
|
| 104 |
+
"epoch": 0.23728813559322035,
|
| 105 |
+
"grad_norm": 172.51380920410156,
|
| 106 |
+
"learning_rate": 9.618155277593583e-05,
|
| 107 |
+
"loss": 2.4990234375,
|
| 108 |
+
"step": 14
|
| 109 |
+
},
|
| 110 |
+
{
|
| 111 |
+
"epoch": 0.2542372881355932,
|
| 112 |
+
"grad_norm": 645.0208129882812,
|
| 113 |
+
"learning_rate": 9.503456909476364e-05,
|
| 114 |
+
"loss": 2.1456298828125,
|
| 115 |
+
"step": 15
|
| 116 |
+
},
|
| 117 |
+
{
|
| 118 |
+
"epoch": 0.2542372881355932,
|
| 119 |
+
"eval_loss": 2.36572265625,
|
| 120 |
+
"eval_runtime": 8.5667,
|
| 121 |
+
"eval_samples_per_second": 0.584,
|
| 122 |
+
"eval_steps_per_second": 0.117,
|
| 123 |
+
"step": 15
|
| 124 |
+
},
|
| 125 |
+
{
|
| 126 |
+
"epoch": 0.2711864406779661,
|
| 127 |
+
"grad_norm": 2.9692535400390625,
|
| 128 |
+
"learning_rate": 9.374696252953101e-05,
|
| 129 |
+
"loss": 2.47412109375,
|
| 130 |
+
"step": 16
|
| 131 |
+
},
|
| 132 |
+
{
|
| 133 |
+
"epoch": 0.288135593220339,
|
| 134 |
+
"grad_norm": 4.023967266082764,
|
| 135 |
+
"learning_rate": 9.23232558452591e-05,
|
| 136 |
+
"loss": 2.4521484375,
|
| 137 |
+
"step": 17
|
| 138 |
+
},
|
| 139 |
+
{
|
| 140 |
+
"epoch": 0.3050847457627119,
|
| 141 |
+
"grad_norm": 2.6005005836486816,
|
| 142 |
+
"learning_rate": 9.07684498636009e-05,
|
| 143 |
+
"loss": 2.07373046875,
|
| 144 |
+
"step": 18
|
| 145 |
+
},
|
| 146 |
+
{
|
| 147 |
+
"epoch": 0.3220338983050847,
|
| 148 |
+
"grad_norm": 2.6452620029449463,
|
| 149 |
+
"learning_rate": 8.90880058972729e-05,
|
| 150 |
+
"loss": 2.11328125,
|
| 151 |
+
"step": 19
|
| 152 |
+
},
|
| 153 |
+
{
|
| 154 |
+
"epoch": 0.3389830508474576,
|
| 155 |
+
"grad_norm": 2.769963026046753,
|
| 156 |
+
"learning_rate": 8.72878265669949e-05,
|
| 157 |
+
"loss": 1.9404296875,
|
| 158 |
+
"step": 20
|
| 159 |
+
},
|
| 160 |
+
{
|
| 161 |
+
"epoch": 0.3559322033898305,
|
| 162 |
+
"grad_norm": 1.5048216581344604,
|
| 163 |
+
"learning_rate": 8.537423506831948e-05,
|
| 164 |
+
"loss": 1.5035400390625,
|
| 165 |
+
"step": 21
|
| 166 |
+
},
|
| 167 |
+
{
|
| 168 |
+
"epoch": 0.3728813559322034,
|
| 169 |
+
"grad_norm": 2.622932195663452,
|
| 170 |
+
"learning_rate": 8.335395296117701e-05,
|
| 171 |
+
"loss": 1.643157958984375,
|
| 172 |
+
"step": 22
|
| 173 |
+
},
|
| 174 |
+
{
|
| 175 |
+
"epoch": 0.3898305084745763,
|
| 176 |
+
"grad_norm": 2.5172510147094727,
|
| 177 |
+
"learning_rate": 8.123407656015125e-05,
|
| 178 |
+
"loss": 1.89501953125,
|
| 179 |
+
"step": 23
|
| 180 |
+
},
|
| 181 |
+
{
|
| 182 |
+
"epoch": 0.4067796610169492,
|
| 183 |
+
"grad_norm": 1.6744011640548706,
|
| 184 |
+
"learning_rate": 7.902205200841559e-05,
|
| 185 |
+
"loss": 1.7744140625,
|
| 186 |
+
"step": 24
|
| 187 |
+
},
|
| 188 |
+
{
|
| 189 |
+
"epoch": 0.423728813559322,
|
| 190 |
+
"grad_norm": 3.4982826709747314,
|
| 191 |
+
"learning_rate": 7.672564912288352e-05,
|
| 192 |
+
"loss": 1.69921875,
|
| 193 |
+
"step": 25
|
| 194 |
+
},
|
| 195 |
+
{
|
| 196 |
+
"epoch": 0.4406779661016949,
|
| 197 |
+
"grad_norm": 138.6426544189453,
|
| 198 |
+
"learning_rate": 7.435293410244342e-05,
|
| 199 |
+
"loss": 1.6044921875,
|
| 200 |
+
"step": 26
|
| 201 |
+
},
|
| 202 |
+
{
|
| 203 |
+
"epoch": 0.4406779661016949,
|
| 204 |
+
"eval_loss": 1.561767578125,
|
| 205 |
+
"eval_runtime": 8.5591,
|
| 206 |
+
"eval_samples_per_second": 0.584,
|
| 207 |
+
"eval_steps_per_second": 0.117,
|
| 208 |
+
"step": 26
|
| 209 |
+
},
|
| 210 |
+
{
|
| 211 |
+
"epoch": 0.4576271186440678,
|
| 212 |
+
"grad_norm": 1.965626835823059,
|
| 213 |
+
"learning_rate": 7.191224119514072e-05,
|
| 214 |
+
"loss": 1.5244140625,
|
| 215 |
+
"step": 27
|
| 216 |
+
},
|
| 217 |
+
{
|
| 218 |
+
"epoch": 0.4745762711864407,
|
| 219 |
+
"grad_norm": 1.6944293975830078,
|
| 220 |
+
"learning_rate": 6.94121434238277e-05,
|
| 221 |
+
"loss": 1.533203125,
|
| 222 |
+
"step": 28
|
| 223 |
+
},
|
| 224 |
+
{
|
| 225 |
+
"epoch": 0.4915254237288136,
|
| 226 |
+
"grad_norm": 3.656485080718994,
|
| 227 |
+
"learning_rate": 6.686142247310805e-05,
|
| 228 |
+
"loss": 1.517822265625,
|
| 229 |
+
"step": 29
|
| 230 |
+
},
|
| 231 |
+
{
|
| 232 |
+
"epoch": 0.5084745762711864,
|
| 233 |
+
"grad_norm": 0.9953148365020752,
|
| 234 |
+
"learning_rate": 6.426903784334943e-05,
|
| 235 |
+
"loss": 1.4697265625,
|
| 236 |
+
"step": 30
|
| 237 |
+
},
|
| 238 |
+
{
|
| 239 |
+
"epoch": 0.5254237288135594,
|
| 240 |
+
"grad_norm": 0.8330620527267456,
|
| 241 |
+
"learning_rate": 6.164409538011167e-05,
|
| 242 |
+
"loss": 1.4814453125,
|
| 243 |
+
"step": 31
|
| 244 |
+
},
|
| 245 |
+
{
|
| 246 |
+
"epoch": 0.5423728813559322,
|
| 247 |
+
"grad_norm": 0.7230986952781677,
|
| 248 |
+
"learning_rate": 5.899581528953207e-05,
|
| 249 |
+
"loss": 1.2818603515625,
|
| 250 |
+
"step": 32
|
| 251 |
+
},
|
| 252 |
+
{
|
| 253 |
+
"epoch": 0.559322033898305,
|
| 254 |
+
"grad_norm": 1.0042716264724731,
|
| 255 |
+
"learning_rate": 5.633349975201519e-05,
|
| 256 |
+
"loss": 1.5009765625,
|
| 257 |
+
"step": 33
|
| 258 |
+
},
|
| 259 |
+
{
|
| 260 |
+
"epoch": 0.576271186440678,
|
| 261 |
+
"grad_norm": 7.553008556365967,
|
| 262 |
+
"learning_rate": 5.366650024798482e-05,
|
| 263 |
+
"loss": 1.47021484375,
|
| 264 |
+
"step": 34
|
| 265 |
+
},
|
| 266 |
+
{
|
| 267 |
+
"epoch": 0.5932203389830508,
|
| 268 |
+
"grad_norm": 0.7747316956520081,
|
| 269 |
+
"learning_rate": 5.100418471046794e-05,
|
| 270 |
+
"loss": 1.36279296875,
|
| 271 |
+
"step": 35
|
| 272 |
+
},
|
| 273 |
+
{
|
| 274 |
+
"epoch": 0.6101694915254238,
|
| 275 |
+
"grad_norm": 0.7788944840431213,
|
| 276 |
+
"learning_rate": 4.835590461988836e-05,
|
| 277 |
+
"loss": 1.51953125,
|
| 278 |
+
"step": 36
|
| 279 |
+
},
|
| 280 |
+
{
|
| 281 |
+
"epoch": 0.6271186440677966,
|
| 282 |
+
"grad_norm": 0.8589951992034912,
|
| 283 |
+
"learning_rate": 4.573096215665058e-05,
|
| 284 |
+
"loss": 1.33056640625,
|
| 285 |
+
"step": 37
|
| 286 |
+
},
|
| 287 |
+
{
|
| 288 |
+
"epoch": 0.6271186440677966,
|
| 289 |
+
"eval_loss": 1.320556640625,
|
| 290 |
+
"eval_runtime": 8.5885,
|
| 291 |
+
"eval_samples_per_second": 0.582,
|
| 292 |
+
"eval_steps_per_second": 0.116,
|
| 293 |
+
"step": 37
|
| 294 |
+
},
|
| 295 |
+
{
|
| 296 |
+
"epoch": 0.6440677966101694,
|
| 297 |
+
"grad_norm": 677.2100219726562,
|
| 298 |
+
"learning_rate": 4.3138577526891964e-05,
|
| 299 |
+
"loss": 1.2919921875,
|
| 300 |
+
"step": 38
|
| 301 |
+
},
|
| 302 |
+
{
|
| 303 |
+
"epoch": 0.6610169491525424,
|
| 304 |
+
"grad_norm": 0.5605570077896118,
|
| 305 |
+
"learning_rate": 4.058785657617232e-05,
|
| 306 |
+
"loss": 1.18408203125,
|
| 307 |
+
"step": 39
|
| 308 |
+
},
|
| 309 |
+
{
|
| 310 |
+
"epoch": 0.6779661016949152,
|
| 311 |
+
"grad_norm": 389.38153076171875,
|
| 312 |
+
"learning_rate": 3.8087758804859295e-05,
|
| 313 |
+
"loss": 1.28271484375,
|
| 314 |
+
"step": 40
|
| 315 |
+
},
|
| 316 |
+
{
|
| 317 |
+
"epoch": 0.6949152542372882,
|
| 318 |
+
"grad_norm": 0.6740171909332275,
|
| 319 |
+
"learning_rate": 3.5647065897556596e-05,
|
| 320 |
+
"loss": 1.31640625,
|
| 321 |
+
"step": 41
|
| 322 |
+
},
|
| 323 |
+
{
|
| 324 |
+
"epoch": 0.711864406779661,
|
| 325 |
+
"grad_norm": 0.5668186545372009,
|
| 326 |
+
"learning_rate": 3.327435087711649e-05,
|
| 327 |
+
"loss": 1.2705078125,
|
| 328 |
+
"step": 42
|
| 329 |
+
},
|
| 330 |
+
{
|
| 331 |
+
"epoch": 0.7288135593220338,
|
| 332 |
+
"grad_norm": 0.6506308913230896,
|
| 333 |
+
"learning_rate": 3.097794799158444e-05,
|
| 334 |
+
"loss": 1.35009765625,
|
| 335 |
+
"step": 43
|
| 336 |
+
},
|
| 337 |
+
{
|
| 338 |
+
"epoch": 0.7457627118644068,
|
| 339 |
+
"grad_norm": 1.9056968688964844,
|
| 340 |
+
"learning_rate": 2.8765923439848764e-05,
|
| 341 |
+
"loss": 1.0797576904296875,
|
| 342 |
+
"step": 44
|
| 343 |
+
},
|
| 344 |
+
{
|
| 345 |
+
"epoch": 0.7627118644067796,
|
| 346 |
+
"grad_norm": 3.448936939239502,
|
| 347 |
+
"learning_rate": 2.6646047038823007e-05,
|
| 348 |
+
"loss": 1.28173828125,
|
| 349 |
+
"step": 45
|
| 350 |
+
},
|
| 351 |
+
{
|
| 352 |
+
"epoch": 0.7796610169491526,
|
| 353 |
+
"grad_norm": 0.5010473728179932,
|
| 354 |
+
"learning_rate": 2.4625764931680536e-05,
|
| 355 |
+
"loss": 1.1314711570739746,
|
| 356 |
+
"step": 46
|
| 357 |
+
},
|
| 358 |
+
{
|
| 359 |
+
"epoch": 0.7966101694915254,
|
| 360 |
+
"grad_norm": 0.5115064382553101,
|
| 361 |
+
"learning_rate": 2.271217343300509e-05,
|
| 362 |
+
"loss": 1.20849609375,
|
| 363 |
+
"step": 47
|
| 364 |
+
},
|
| 365 |
+
{
|
| 366 |
+
"epoch": 0.8135593220338984,
|
| 367 |
+
"grad_norm": 0.4829571545124054,
|
| 368 |
+
"learning_rate": 2.0911994102727095e-05,
|
| 369 |
+
"loss": 1.28466796875,
|
| 370 |
+
"step": 48
|
| 371 |
+
},
|
| 372 |
+
{
|
| 373 |
+
"epoch": 0.8135593220338984,
|
| 374 |
+
"eval_loss": 1.24169921875,
|
| 375 |
+
"eval_runtime": 8.578,
|
| 376 |
+
"eval_samples_per_second": 0.583,
|
| 377 |
+
"eval_steps_per_second": 0.117,
|
| 378 |
+
"step": 48
|
| 379 |
+
},
|
| 380 |
+
{
|
| 381 |
+
"epoch": 0.8305084745762712,
|
| 382 |
+
"grad_norm": 0.3891683518886566,
|
| 383 |
+
"learning_rate": 1.9231550136399102e-05,
|
| 384 |
+
"loss": 1.206298828125,
|
| 385 |
+
"step": 49
|
| 386 |
+
},
|
| 387 |
+
{
|
| 388 |
+
"epoch": 0.847457627118644,
|
| 389 |
+
"grad_norm": 0.39190465211868286,
|
| 390 |
+
"learning_rate": 1.7676744154740922e-05,
|
| 391 |
+
"loss": 1.257568359375,
|
| 392 |
+
"step": 50
|
| 393 |
+
},
|
| 394 |
+
{
|
| 395 |
+
"epoch": 0.864406779661017,
|
| 396 |
+
"grad_norm": 0.6265923380851746,
|
| 397 |
+
"learning_rate": 1.6253037470469e-05,
|
| 398 |
+
"loss": 1.22509765625,
|
| 399 |
+
"step": 51
|
| 400 |
+
},
|
| 401 |
+
{
|
| 402 |
+
"epoch": 0.8813559322033898,
|
| 403 |
+
"grad_norm": 1.132917881011963,
|
| 404 |
+
"learning_rate": 1.4965430905236377e-05,
|
| 405 |
+
"loss": 1.23193359375,
|
| 406 |
+
"step": 52
|
| 407 |
+
},
|
| 408 |
+
{
|
| 409 |
+
"epoch": 0.8983050847457628,
|
| 410 |
+
"grad_norm": 1.4995769262313843,
|
| 411 |
+
"learning_rate": 1.381844722406417e-05,
|
| 412 |
+
"loss": 1.137939453125,
|
| 413 |
+
"step": 53
|
| 414 |
+
},
|
| 415 |
+
{
|
| 416 |
+
"epoch": 0.9152542372881356,
|
| 417 |
+
"grad_norm": 0.8267571330070496,
|
| 418 |
+
"learning_rate": 1.281611524896456e-05,
|
| 419 |
+
"loss": 1.262939453125,
|
| 420 |
+
"step": 54
|
| 421 |
+
},
|
| 422 |
+
{
|
| 423 |
+
"epoch": 0.9322033898305084,
|
| 424 |
+
"grad_norm": 0.4488615393638611,
|
| 425 |
+
"learning_rate": 1.1961955707556493e-05,
|
| 426 |
+
"loss": 1.243896484375,
|
| 427 |
+
"step": 55
|
| 428 |
+
},
|
| 429 |
+
{
|
| 430 |
+
"epoch": 0.9491525423728814,
|
| 431 |
+
"grad_norm": 0.7780895233154297,
|
| 432 |
+
"learning_rate": 1.1258968866381517e-05,
|
| 433 |
+
"loss": 1.293701171875,
|
| 434 |
+
"step": 56
|
| 435 |
+
},
|
| 436 |
+
{
|
| 437 |
+
"epoch": 0.9661016949152542,
|
| 438 |
+
"grad_norm": 0.5684336423873901,
|
| 439 |
+
"learning_rate": 1.0709623992358144e-05,
|
| 440 |
+
"loss": 1.24169921875,
|
| 441 |
+
"step": 57
|
| 442 |
+
},
|
| 443 |
+
{
|
| 444 |
+
"epoch": 0.9830508474576272,
|
| 445 |
+
"grad_norm": 1.7781082391738892,
|
| 446 |
+
"learning_rate": 1.031585067939174e-05,
|
| 447 |
+
"loss": 1.258056640625,
|
| 448 |
+
"step": 58
|
| 449 |
+
},
|
| 450 |
+
{
|
| 451 |
+
"epoch": 1.0,
|
| 452 |
+
"grad_norm": 40.05562973022461,
|
| 453 |
+
"learning_rate": 1.007903207060554e-05,
|
| 454 |
+
"loss": 1.238037109375,
|
| 455 |
+
"step": 59
|
| 456 |
+
},
|
| 457 |
+
{
|
| 458 |
+
"epoch": 1.0,
|
| 459 |
+
"eval_loss": 1.219970703125,
|
| 460 |
+
"eval_runtime": 8.5876,
|
| 461 |
+
"eval_samples_per_second": 0.582,
|
| 462 |
+
"eval_steps_per_second": 0.116,
|
| 463 |
+
"step": 59
|
| 464 |
+
}
|
| 465 |
+
],
|
| 466 |
+
"logging_steps": 1.0,
|
| 467 |
+
"max_steps": 59,
|
| 468 |
+
"num_input_tokens_seen": 0,
|
| 469 |
+
"num_train_epochs": 1,
|
| 470 |
+
"save_steps": 0,
|
| 471 |
+
"stateful_callbacks": {
|
| 472 |
+
"TrainerControl": {
|
| 473 |
+
"args": {
|
| 474 |
+
"should_epoch_stop": false,
|
| 475 |
+
"should_evaluate": false,
|
| 476 |
+
"should_log": false,
|
| 477 |
+
"should_save": true,
|
| 478 |
+
"should_training_stop": true
|
| 479 |
+
},
|
| 480 |
+
"attributes": {}
|
| 481 |
+
}
|
| 482 |
+
},
|
| 483 |
+
"total_flos": 4.0731125942761554e+18,
|
| 484 |
+
"train_batch_size": 1,
|
| 485 |
+
"trial_name": null,
|
| 486 |
+
"trial_params": null
|
| 487 |
+
}
|
training-metrics.png
ADDED
|
win-rates.png
ADDED
|