-
-
Notifications
You must be signed in to change notification settings - Fork 103
Expand file tree
/
Copy pathconfig.ini.example
More file actions
185 lines (167 loc) · 5.79 KB
/
Copy pathconfig.ini.example
File metadata and controls
185 lines (167 loc) · 5.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# config.ini.example — copy this file to config.ini and customise for your setup.
#
# config.ini is gitignored (it may contain GCP project IDs written by the wizard).
# This example file is the committed template; keep it clean of user-specific values.
#
# Quick start:
# cp config.ini.example config.ini
# # Edit [dataset:*] and [profile:*] sections for your data and training run.
[DEFAULT]
num_train_epochs = 3
logging_steps = 25
save_steps = 1000
save_total_limit = 1
gradient_accumulation_steps = 1
learning_rate = 1e-5
warmup_steps = 50
output_dir = output
# Text-only fine-tuning (optional). Default is speech/audio; omit these or use modality = audio.
# modality = text
# text_sub_mode = instruction
# prompt_column = prompt
# max_seq_length = 2048
# Image + text fine-tuning (optional). CSV with image paths; see README/Datasets.md.
# modality = image
# image_sub_mode = caption
# image_path_column = image_path
# image_token_budget = 280
# For VQA: image_sub_mode = vqa and set prompt_column to the question column.
[dataset_defaults]
text_column = text_perfect
max_label_length = 256
max_duration = 30.0
id_column = id
streaming_enabled = false
preprocessing_num_workers = 0
dataloader_num_workers = 4
[group:gemma]
dtype = bfloat16
attn_implementation = eager
optim = adamw_torch
# Gemma 4 — primary targets (pre-trained base, recommended for audio LoRA fine-tuning)
[model:gemma-4-e2b]
base_model = google/gemma-4-E2B
group = gemma
per_device_train_batch_size = 2
per_device_eval_batch_size = 2
[model:gemma-4-e4b]
base_model = google/gemma-4-E4B
group = gemma
per_device_train_batch_size = 1
per_device_eval_batch_size = 1
# Gemma 4 — instruction-tuned variants (alternative starting point)
[model:gemma-4-e2b-it]
base_model = google/gemma-4-E2B-it
group = gemma
per_device_train_batch_size = 2
per_device_eval_batch_size = 2
[model:gemma-4-e4b-it]
base_model = google/gemma-4-E4B-it
group = gemma
per_device_train_batch_size = 1
per_device_eval_batch_size = 1
# Gemma 3n — retained for backwards compatibility
[model:gemma-3n-e2b-it]
base_model = google/gemma-3n-E2B-it
group = gemma
per_device_train_batch_size = 2
per_device_eval_batch_size = 2
[model:gemma-3n-e4b-it]
base_model = google/gemma-3n-E4B-it
group = gemma
per_device_train_batch_size = 1
per_device_eval_batch_size = 1
# ----------------------------------------------------------------------------
# Happy-path sample (text instruction tuning).
#
# These two sections point at the bundled CSVs in data/datasets/sample-text/
# (16 train rows, 5 validation rows, columns: id,prompt,response). After
# `cp config/config.ini.example config/config.ini` you can run:
#
# gemma-macos-tuner finetune sample-text
#
# end-to-end without any extra data wrangling. Delete or rename them once you
# have your own data.
# ----------------------------------------------------------------------------
[dataset:sample-text]
source = sample-text
train_split = train
validation_split = validation
[profile:sample-text]
model = gemma-3n-e2b-it
dataset = sample-text
modality = text
text_sub_mode = instruction
prompt_column = prompt
text_column = response
max_seq_length = 512
num_train_epochs = 1
per_device_train_batch_size = 1
per_device_eval_batch_size = 1
gradient_accumulation_steps = 4
learning_rate = 2e-4
logging_steps = 1
save_strategy = epoch
eval_strategy = epoch
lora_r = 8
lora_alpha = 16
lora_dropout = 0.05
target_modules = q_proj,k_proj,v_proj,o_proj
# ----------------------------------------------------------------------------
# 16 GB Mac memory-budget knobs
# ----------------------------------------------------------------------------
# Stock defaults assume 32 GB+ unified memory. On 16 GB Macs the model + KV cache
# + optimizer state usually doesn't fit, and macOS jetsam-kills the process
# (you'll see "MPS backend out of memory" or exit code -9 with "leaked
# semaphore objects"). Add these to your [profile:...] block on a 16 GB Mac:
#
# per_device_train_batch_size = 1
# per_device_eval_batch_size = 1
# gradient_accumulation_steps = 16
# gradient_checkpointing = true
# bf16 = true
# max_seq_length = 1024 # drop to 512 if still OOM
# # image / audiovisual modalities:
# # image_token_budget = 70
#
# Also: use gemma-4-e2b(-it), not e4b. If MPS still complains, try
# export PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.85
# (do NOT set this to 0.0 — bootstrap rejects it).
# See README/guides/apple-silicon/gemma4-guide.md for the full table.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Template LoRA profile + dataset (edit and rename for your own data).
# ----------------------------------------------------------------------------
[profile:my-lora-run]
model = gemma-3n-e2b-it
# Optional: pin to a specific HuggingFace revision for reproducibility.
# model_revision = abc123def456 # commit hash or git ref
dataset = my-dataset
train_split = train
validation_split = validation
learning_rate = 2e-4
num_train_epochs = 3
gradient_accumulation_steps = 8
logging_steps = 25
save_strategy = epoch
eval_strategy = epoch
text_column = text
lora_r = 16
lora_alpha = 32
lora_dropout = 0.05
target_modules = q_proj,k_proj,v_proj,o_proj
# Example dataset section.
# The section name (e.g. "my-dataset") is the key used in profile "dataset =" lines.
# "source" is the underlying dataset identifier: a local CSV directory name, a
# HuggingFace dataset repo slug (e.g. "username/my-asr-dataset"), or a BigQuery
# export name created by the wizard. Adjust splits and filters for your data.
[dataset:my-dataset]
source = my-dataset
train_split = train
validation_split = validation
max_duration = 30.0
# [bigquery] section: populated automatically by the wizard.
# Do NOT commit real project or dataset IDs here.
[bigquery]
last_project_id =
last_dataset_id =