Skip to content

Commit 9e5db58

Browse files
fix: hub_strategy, warmup_ratio, total_steps=0 bug, eval_steps
1 parent d0fe953 commit 9e5db58

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

training/train_extended_context.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def tokenize(example):
273273
# ── 5. Training Args ──────────────────────────────────────────────
274274
print("\n[5/6] Setting up training...")
275275
total_steps = (len(train_ds) // (args.batch_size * args.grad_accum)) * args.epochs
276-
warmup = max(10, int(total_steps * 0.05))
276+
warmup = max(10, int(total_steps * 0.03))
277277
print(f" Total steps: {total_steps} | Warmup: {warmup}")
278278

279279
training_args = TrainingArguments(
@@ -284,8 +284,7 @@ def tokenize(example):
284284
num_train_epochs=args.epochs,
285285
warmup_steps=warmup,
286286
lr_scheduler_type="cosine",
287-
warmup_ratio=0.05,
288-
max_grad_norm=0.3,
287+
max_grad_norm=0.3,
289288
weight_decay=0.01,
290289
fp16=True,
291290
bf16=False,
@@ -302,7 +301,7 @@ def tokenize(example):
302301
seed=42,
303302
push_to_hub=args.push_to_hub,
304303
hub_model_id=args.hub_model_id,
305-
hub_strategy="save",
304+
hub_strategy="every_save",
306305
)
307306

308307
trainer = Trainer(

0 commit comments

Comments
 (0)