Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- chat_template.jinja +4 -0
- initial_latent_z.safetensors +3 -0
- metrics.json +48 -0
- model.safetensors +3 -0
- pre_sft_b200.yaml +98 -0
- sft_config.json +105 -0
- tokenizer.json +3 -0
- tokenizer_config.json +17 -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
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% if messages[0]['role'] == 'system' %}{{ raise_exception('System role not supported') }}{% endif %}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if (message['role'] == 'assistant') %}{% set role = 'model' %}{% else %}{% set role = message['role'] %}{% endif %}{{ '<start_of_turn>' + role + '
|
| 2 |
+
' + message['content'] | trim + '<end_of_turn>
|
| 3 |
+
' }}{% endfor %}{% if add_generation_prompt %}{{'<start_of_turn>model
|
| 4 |
+
'}}{% endif %}
|
initial_latent_z.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3d7823e0de7fb4f4912eba7d87d824bca161adc3fc9d895da4d7f124971e1aa7
|
| 3 |
+
size 4194392
|
metrics.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"phase_results": [
|
| 3 |
+
{
|
| 4 |
+
"phase": "phase0a",
|
| 5 |
+
"skipped": true
|
| 6 |
+
},
|
| 7 |
+
{
|
| 8 |
+
"phase": "phase0b",
|
| 9 |
+
"best_validation_loss": 1.5834965487284522,
|
| 10 |
+
"best_metrics": {
|
| 11 |
+
"loss": 1.5834965487284522,
|
| 12 |
+
"token_count": 60099.0,
|
| 13 |
+
"example_count": 1109.0,
|
| 14 |
+
"first_token_correct": 527.0,
|
| 15 |
+
"first_token_count": 1109.0,
|
| 16 |
+
"first_token_exact_match": 0.47520288548241657,
|
| 17 |
+
"phase": "phase0b"
|
| 18 |
+
},
|
| 19 |
+
"global_step": 398,
|
| 20 |
+
"run_step_end": 398,
|
| 21 |
+
"train_dataset": {
|
| 22 |
+
"example_count": 50865,
|
| 23 |
+
"observation_steps_mean": 1.0,
|
| 24 |
+
"observation_steps_max": 1,
|
| 25 |
+
"input_tokens_mean": 25.618814508994397,
|
| 26 |
+
"input_tokens_max": 540,
|
| 27 |
+
"target_tokens_mean": 56.929185097807924,
|
| 28 |
+
"target_tokens_max": 1024,
|
| 29 |
+
"dataset_counts": {
|
| 30 |
+
"alpaca": 50865
|
| 31 |
+
}
|
| 32 |
+
},
|
| 33 |
+
"validation_dataset": {
|
| 34 |
+
"example_count": 1109,
|
| 35 |
+
"observation_steps_mean": 1.0,
|
| 36 |
+
"observation_steps_max": 1,
|
| 37 |
+
"input_tokens_mean": 25.237150586113614,
|
| 38 |
+
"input_tokens_max": 274,
|
| 39 |
+
"target_tokens_mean": 54.19206492335437,
|
| 40 |
+
"target_tokens_max": 534,
|
| 41 |
+
"dataset_counts": {
|
| 42 |
+
"alpaca": 1109
|
| 43 |
+
}
|
| 44 |
+
},
|
| 45 |
+
"wandb_enabled": true
|
| 46 |
+
}
|
| 47 |
+
]
|
| 48 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3173dc05f72c701bd9a4346a626dece3cfdf3c2d161fb6d79a5e991199832a1a
|
| 3 |
+
size 2521506708
|
pre_sft_b200.yaml
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
datasets:
|
| 2 |
+
- name: alpaca
|
| 3 |
+
repo_id: tatsu-lab/alpaca
|
| 4 |
+
format: alpaca_single_turn
|
| 5 |
+
source_split: train
|
| 6 |
+
validation_ratio: 0.02
|
| 7 |
+
split_seed: 17
|
| 8 |
+
use_base_chat_template: true
|
| 9 |
+
|
| 10 |
+
model:
|
| 11 |
+
base_model_name: google/t5gemma-l-l-prefixlm-it
|
| 12 |
+
dtype: bfloat16
|
| 13 |
+
attn_implementation: sdpa
|
| 14 |
+
magicnorm_eps: 1.0e-6
|
| 15 |
+
z_slots: 1024
|
| 16 |
+
num_time_tokens: 0
|
| 17 |
+
use_explicit_time_features: false
|
| 18 |
+
gate_attention_heads: 4
|
| 19 |
+
max_observation_tokens: 1024
|
| 20 |
+
max_decoder_tokens: 1024
|
| 21 |
+
thought_loop_proposal_mode: observation_hidden_compression
|
| 22 |
+
preserve_observation_encoder_manifold: true
|
| 23 |
+
observation_encoder_use_state_context: true
|
| 24 |
+
latent_attention_mask_mode: full
|
| 25 |
+
initial_update_gate_bias: 999.0
|
| 26 |
+
|
| 27 |
+
training:
|
| 28 |
+
seed: 17
|
| 29 |
+
num_workers: 4
|
| 30 |
+
gradient_checkpointing: true
|
| 31 |
+
mixed_precision: bf16
|
| 32 |
+
max_grad_norm: 1.0
|
| 33 |
+
weight_decay: 0.01
|
| 34 |
+
backbone_learning_rate: 1.0e-5
|
| 35 |
+
new_module_learning_rate: 3.0e-4
|
| 36 |
+
adam_beta1: 0.9
|
| 37 |
+
adam_beta2: 0.95
|
| 38 |
+
adam_epsilon: 1.0e-8
|
| 39 |
+
fused_adamw: true
|
| 40 |
+
freeze_gate_head: true
|
| 41 |
+
log_every_steps: 1
|
| 42 |
+
eval_every_steps: 100
|
| 43 |
+
checkpoint_every_steps: 1000
|
| 44 |
+
max_train_examples:
|
| 45 |
+
max_validation_examples:
|
| 46 |
+
latent_bridge_mode: thought_loop
|
| 47 |
+
decoder_training_mode: teacher_forced
|
| 48 |
+
freeze_decoder_first_fraction: 1.0
|
| 49 |
+
probe_extra_new_tokens: 16
|
| 50 |
+
identity_control_target_slots: 256
|
| 51 |
+
identity_control_use_chat_template: false
|
| 52 |
+
|
| 53 |
+
phases:
|
| 54 |
+
phase0a:
|
| 55 |
+
enabled: false
|
| 56 |
+
micro_batch_size: 32
|
| 57 |
+
eval_batch_size: 32
|
| 58 |
+
gradient_accumulation_steps: 2
|
| 59 |
+
num_train_epochs: 1
|
| 60 |
+
warmup_ratio: 0.03
|
| 61 |
+
shuffle_train: true
|
| 62 |
+
instruction_prefix: "Recover the original text from the corrupted text through the latent bottleneck."
|
| 63 |
+
corruption:
|
| 64 |
+
span_mask_fraction: 0.22
|
| 65 |
+
min_span_words: 1
|
| 66 |
+
max_span_words: 8
|
| 67 |
+
max_mask_spans: 6
|
| 68 |
+
word_dropout_prob: 0.12
|
| 69 |
+
placeholder_text: "[blank]"
|
| 70 |
+
|
| 71 |
+
phase0b:
|
| 72 |
+
enabled: true
|
| 73 |
+
micro_batch_size: 32
|
| 74 |
+
eval_batch_size: 32
|
| 75 |
+
gradient_accumulation_steps: 4
|
| 76 |
+
num_train_epochs: 1
|
| 77 |
+
warmup_ratio: 0.03
|
| 78 |
+
shuffle_train: true
|
| 79 |
+
instruction_prefix: "You are a helpful assistant. Reply to the user with the best of your capabilities."
|
| 80 |
+
|
| 81 |
+
cache:
|
| 82 |
+
preprocessed_root: cache/preprocessed_pre_sft
|
| 83 |
+
|
| 84 |
+
paths:
|
| 85 |
+
run_root: runs_pre_sft
|
| 86 |
+
export_root: exports
|
| 87 |
+
|
| 88 |
+
inference:
|
| 89 |
+
format: alpaca_single_turn
|
| 90 |
+
|
| 91 |
+
wandb:
|
| 92 |
+
enabled: true
|
| 93 |
+
project: samantha-pre-sft
|
| 94 |
+
run_name: t5gemma2-thoughtloop-pre-sft-alpaca
|
| 95 |
+
|
| 96 |
+
hub:
|
| 97 |
+
model_repo_id: BRlkl/test_1024
|
| 98 |
+
private: false
|
sft_config.json
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"datasets": [
|
| 3 |
+
{
|
| 4 |
+
"name": "alpaca",
|
| 5 |
+
"repo_id": "tatsu-lab/alpaca",
|
| 6 |
+
"format": "alpaca_single_turn",
|
| 7 |
+
"source_split": "train",
|
| 8 |
+
"validation_ratio": 0.02,
|
| 9 |
+
"split_seed": 17,
|
| 10 |
+
"use_base_chat_template": true
|
| 11 |
+
}
|
| 12 |
+
],
|
| 13 |
+
"model": {
|
| 14 |
+
"base_model_name": "google/t5gemma-l-l-prefixlm-it",
|
| 15 |
+
"dtype": "bfloat16",
|
| 16 |
+
"attn_implementation": "sdpa",
|
| 17 |
+
"magicnorm_eps": 1e-06,
|
| 18 |
+
"z_slots": 1024,
|
| 19 |
+
"num_time_tokens": 0,
|
| 20 |
+
"use_explicit_time_features": false,
|
| 21 |
+
"gate_attention_heads": 4,
|
| 22 |
+
"max_observation_tokens": 1024,
|
| 23 |
+
"max_decoder_tokens": 1024,
|
| 24 |
+
"thought_loop_proposal_mode": "observation_hidden_compression",
|
| 25 |
+
"preserve_observation_encoder_manifold": true,
|
| 26 |
+
"observation_encoder_use_state_context": true,
|
| 27 |
+
"latent_attention_mask_mode": "full",
|
| 28 |
+
"initial_update_gate_bias": 999.0
|
| 29 |
+
},
|
| 30 |
+
"training": {
|
| 31 |
+
"seed": 17,
|
| 32 |
+
"num_workers": 4,
|
| 33 |
+
"gradient_checkpointing": true,
|
| 34 |
+
"mixed_precision": "bf16",
|
| 35 |
+
"max_grad_norm": 1.0,
|
| 36 |
+
"weight_decay": 0.01,
|
| 37 |
+
"backbone_learning_rate": 1e-05,
|
| 38 |
+
"new_module_learning_rate": 0.0003,
|
| 39 |
+
"adam_beta1": 0.9,
|
| 40 |
+
"adam_beta2": 0.95,
|
| 41 |
+
"adam_epsilon": 1e-08,
|
| 42 |
+
"fused_adamw": true,
|
| 43 |
+
"freeze_gate_head": true,
|
| 44 |
+
"log_every_steps": 1,
|
| 45 |
+
"eval_every_steps": 100,
|
| 46 |
+
"checkpoint_every_steps": 1000,
|
| 47 |
+
"max_train_examples": null,
|
| 48 |
+
"max_validation_examples": null,
|
| 49 |
+
"latent_bridge_mode": "thought_loop",
|
| 50 |
+
"decoder_training_mode": "teacher_forced",
|
| 51 |
+
"freeze_decoder_first_fraction": 1.0,
|
| 52 |
+
"probe_extra_new_tokens": 16,
|
| 53 |
+
"identity_control_target_slots": 256,
|
| 54 |
+
"identity_control_use_chat_template": false
|
| 55 |
+
},
|
| 56 |
+
"phases": {
|
| 57 |
+
"phase0a": {
|
| 58 |
+
"enabled": false,
|
| 59 |
+
"micro_batch_size": 32,
|
| 60 |
+
"eval_batch_size": 32,
|
| 61 |
+
"gradient_accumulation_steps": 2,
|
| 62 |
+
"num_train_epochs": 1,
|
| 63 |
+
"warmup_ratio": 0.03,
|
| 64 |
+
"shuffle_train": true,
|
| 65 |
+
"instruction_prefix": "Recover the original text from the corrupted text through the latent bottleneck.",
|
| 66 |
+
"corruption": {
|
| 67 |
+
"span_mask_fraction": 0.22,
|
| 68 |
+
"min_span_words": 1,
|
| 69 |
+
"max_span_words": 8,
|
| 70 |
+
"max_mask_spans": 6,
|
| 71 |
+
"word_dropout_prob": 0.12,
|
| 72 |
+
"placeholder_text": "[blank]"
|
| 73 |
+
}
|
| 74 |
+
},
|
| 75 |
+
"phase0b": {
|
| 76 |
+
"enabled": true,
|
| 77 |
+
"micro_batch_size": 32,
|
| 78 |
+
"eval_batch_size": 32,
|
| 79 |
+
"gradient_accumulation_steps": 4,
|
| 80 |
+
"num_train_epochs": 1,
|
| 81 |
+
"warmup_ratio": 0.03,
|
| 82 |
+
"shuffle_train": true,
|
| 83 |
+
"instruction_prefix": "You are a helpful assistant. Reply to the user with the best of your capabilities."
|
| 84 |
+
}
|
| 85 |
+
},
|
| 86 |
+
"cache": {
|
| 87 |
+
"preprocessed_root": "cache/preprocessed_pre_sft"
|
| 88 |
+
},
|
| 89 |
+
"paths": {
|
| 90 |
+
"run_root": "runs_pre_sft",
|
| 91 |
+
"export_root": "exports"
|
| 92 |
+
},
|
| 93 |
+
"inference": {
|
| 94 |
+
"format": "alpaca_single_turn"
|
| 95 |
+
},
|
| 96 |
+
"wandb": {
|
| 97 |
+
"enabled": true,
|
| 98 |
+
"project": "samantha-pre-sft",
|
| 99 |
+
"run_name": "t5gemma2-thoughtloop-pre-sft-alpaca"
|
| 100 |
+
},
|
| 101 |
+
"hub": {
|
| 102 |
+
"model_repo_id": "BRlkl/test_1024",
|
| 103 |
+
"private": false
|
| 104 |
+
}
|
| 105 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:923de64f4705efd22f6880dc5e6a9b2993de2706a03d0d48773e0173e32a074f
|
| 3 |
+
size 34362428
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"bos_token": "<bos>",
|
| 4 |
+
"clean_up_tokenization_spaces": false,
|
| 5 |
+
"eos_token": "<eos>",
|
| 6 |
+
"is_local": false,
|
| 7 |
+
"local_files_only": false,
|
| 8 |
+
"mask_token": "<mask>",
|
| 9 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 10 |
+
"pad_token": "<pad>",
|
| 11 |
+
"padding_side": "right",
|
| 12 |
+
"sp_model_kwargs": {},
|
| 13 |
+
"spaces_between_special_tokens": false,
|
| 14 |
+
"tokenizer_class": "GemmaTokenizer",
|
| 15 |
+
"unk_token": "<unk>",
|
| 16 |
+
"use_default_system_prompt": false
|
| 17 |
+
}
|