Commit 17f4ddd
committed
Fix MPS SFT training: Use TrainingArguments instead of SFTConfig
The working MPS finetuning test uses TrainingArguments from transformers,
not SFTConfig from trl. Key changes:
- Changed from SFTConfig to TrainingArguments
- Added fp16/bf16 flags based on model dtype detection
- Moved dataset_text_field and max_seq_length to SFTTrainer constructor
- Keep existing MPS-specific handling (no 4-bit, adamw_torch optimizer)
This aligns with test_mps_finetuning.py which successfully trains on MPS.1 parent 859c5eb commit 17f4ddd
1 file changed
+17
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| 63 | + | |
62 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
63 | 72 | | |
64 | 73 | | |
65 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
66 | 77 | | |
67 | 78 | | |
68 | 79 | | |
| |||
71 | 82 | | |
72 | 83 | | |
73 | 84 | | |
74 | | - | |
75 | | - | |
76 | | - | |
| 85 | + | |
| 86 | + | |
77 | 87 | | |
78 | 88 | | |
79 | 89 | | |
80 | 90 | | |
81 | 91 | | |
82 | 92 | | |
83 | 93 | | |
| 94 | + | |
| 95 | + | |
84 | 96 | | |
85 | 97 | | |
86 | 98 | | |
| |||
0 commit comments