Commit 62905ee
committed
FIX Error in VLM fine-tuning notebook
In the notebook, get_peft_model(model) is called, which mutates the base
model. Then the same model is passed to SFTTrainer with a PEFT config,
which leads to another call to get_peft_model under the hood and thus to
PEFT being applied twice.
This fix removes the manual get_peft_model call and lets trl handle
this. We lose the ability to inspect the number of trainable parameters
but IMO this is the simplest solution.1 parent 0126a7a commit 62905ee
File tree
2 files changed
+6
-34
lines changed- notebooks
- en
- zh-CN
2 files changed
+6
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
607 | 607 | | |
608 | 608 | | |
609 | 609 | | |
610 | | - | |
611 | 610 | | |
612 | 611 | | |
613 | 612 | | |
| |||
738 | 737 | | |
739 | 738 | | |
740 | 739 | | |
741 | | - | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
| 740 | + | |
748 | 741 | | |
749 | 742 | | |
750 | 743 | | |
751 | | - | |
| 744 | + | |
752 | 745 | | |
753 | 746 | | |
754 | 747 | | |
| |||
758 | 751 | | |
759 | 752 | | |
760 | 753 | | |
761 | | - | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
767 | | - | |
| 754 | + | |
768 | 755 | | |
769 | 756 | | |
770 | 757 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1120 | 1120 | | |
1121 | 1121 | | |
1122 | 1122 | | |
1123 | | - | |
1124 | 1123 | | |
1125 | 1124 | | |
1126 | 1125 | | |
| |||
1243 | 1242 | | |
1244 | 1243 | | |
1245 | 1244 | | |
1246 | | - | |
1247 | | - | |
1248 | | - | |
1249 | | - | |
1250 | | - | |
1251 | | - | |
1252 | | - | |
1253 | | - | |
1254 | | - | |
| 1245 | + | |
1255 | 1246 | | |
1256 | | - | |
| 1247 | + | |
1257 | 1248 | | |
1258 | 1249 | | |
1259 | 1250 | | |
| |||
1263 | 1254 | | |
1264 | 1255 | | |
1265 | 1256 | | |
1266 | | - | |
1267 | | - | |
1268 | | - | |
1269 | | - | |
1270 | | - | |
1271 | | - | |
1272 | | - | |
| 1257 | + | |
1273 | 1258 | | |
1274 | 1259 | | |
1275 | 1260 | | |
| |||
0 commit comments