mirror of
https://github.com/SakanaAI/doc-to-lora.git
synced 2026-07-23 17:01:04 +02:00
gemma 3
This commit is contained in:
parent
2d6f08397e
commit
b218df0feb
2 changed files with 74 additions and 9 deletions
|
|
@ -27,9 +27,11 @@
|
|||
' + (first_user_prefix if loop.first else "") }}
|
||||
{%- if message['content'] is string -%}
|
||||
{%- if message['role'] == 'assistant' -%}
|
||||
{% generation %}{{ message['content'] | trim }}
|
||||
{% generation %}{{ message['content'] | trim + '<end_of_turn>
|
||||
' }}{% endgeneration %}
|
||||
{%- else -%}
|
||||
{{ message['content'] | trim }}
|
||||
{{ message['content'] | trim + '<end_of_turn>
|
||||
' }}
|
||||
{%- endif -%}
|
||||
{# {%- elif message['content'] is iterable -%}
|
||||
{%- for item in message['content'] -%}
|
||||
|
|
@ -38,15 +40,10 @@
|
|||
{%- elif item['type'] == 'text' -%}
|
||||
{{ item['text'] | trim }}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- else -%} #}
|
||||
{%- endfor -%} #}
|
||||
{%- else -%}
|
||||
{{ raise_exception("Invalid content type") }}
|
||||
{%- endif -%}
|
||||
{{ '<end_of_turn>
|
||||
' }}
|
||||
{%- if (message['role'] == 'assistant') -%}
|
||||
{% endgeneration %}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- if add_generation_prompt -%}
|
||||
{{'<start_of_turn>model
|
||||
|
|
|
|||
68
configs/context_numbers_10.yaml
Normal file
68
configs/context_numbers_10.yaml
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
output_dir: "" # just a placeholder
|
||||
bf16: true
|
||||
model_name_or_path: meta-llama/Llama-3.2-1B-Instruct
|
||||
label_names: ["labels"]
|
||||
add_repeat_prompt: false
|
||||
add_negative_prompt: false
|
||||
# eval_on_start: True
|
||||
# eval_strategy: "steps"
|
||||
# eval_steps: 500
|
||||
# save_strategy: "no"
|
||||
# # save_steps: 500
|
||||
# logging_strategy: "steps"
|
||||
# logging_steps: 100
|
||||
# use_liger_kernel: true
|
||||
# remove_unused_columns: false
|
||||
|
||||
# needed to avoid OOM by compute the metrics batch by batch
|
||||
# w/o this the trainer stores logits of all sample in memory...
|
||||
# batch_eval_metrics: true
|
||||
|
||||
per_device_train_batch_size: 64
|
||||
per_device_eval_batch_size: 128
|
||||
max_new_tokens: 64
|
||||
gen_per_device_eval_batch_size: 128
|
||||
max_val_samples_per_ds: 500
|
||||
# optim: schedule_free_adamw
|
||||
learning_rate: 0.0001
|
||||
# lr_scheduler_type: "constant_with_warmup"
|
||||
neftune_noise_alpha: 1
|
||||
weight_decay: 0.01
|
||||
|
||||
# LoRA
|
||||
lora_r: 16
|
||||
lora_dropout: 0.05
|
||||
target_modules:
|
||||
- down_proj
|
||||
- up_proj
|
||||
- gate_proj
|
||||
|
||||
# data
|
||||
train_ds_names:
|
||||
- data/raw_datasets/context_numbers_2
|
||||
- data/raw_datasets/context_numbers_3
|
||||
- data/raw_datasets/context_numbers_4
|
||||
- data/raw_datasets/context_numbers_5
|
||||
- data/raw_datasets/context_numbers_6
|
||||
- data/raw_datasets/context_numbers_7
|
||||
- data/raw_datasets/context_numbers_8
|
||||
- data/raw_datasets/context_numbers_9
|
||||
- data/raw_datasets/context_numbers_10
|
||||
|
||||
val_ds_names:
|
||||
- data/raw_datasets/context_numbers_2
|
||||
- data/raw_datasets/context_numbers_3
|
||||
- data/raw_datasets/context_numbers_4
|
||||
- data/raw_datasets/context_numbers_5
|
||||
- data/raw_datasets/context_numbers_6
|
||||
- data/raw_datasets/context_numbers_7
|
||||
- data/raw_datasets/context_numbers_8
|
||||
- data/raw_datasets/context_numbers_9
|
||||
- data/raw_datasets/context_numbers_10
|
||||
|
||||
test_ds_names:
|
||||
- data/raw_datasets/context_numbers_11
|
||||
- data/raw_datasets/context_numbers_12
|
||||
- data/raw_datasets/context_numbers_13
|
||||
- data/raw_datasets/context_numbers_14
|
||||
- data/raw_datasets/context_numbers_15
|
||||
Loading…
Add table
Add a link
Reference in a new issue