File tree Expand file tree Collapse file tree 4 files changed +7
-8
lines changed
configs/recipes/vision/phi4/sft Expand file tree Collapse file tree 4 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 32
32
33
33
data :
34
34
train :
35
- collator_name : " vision_language_with_padding "
35
+ collator_name : " vision_language_sft "
36
36
use_torchdata : true
37
37
datasets :
38
38
- dataset_name : " merve/vqav2-small"
@@ -71,7 +71,7 @@ training:
71
71
output_dir : " output/vlm_finetuned"
72
72
trainer_type : " TRL_SFT"
73
73
enable_gradient_checkpointing : True
74
- per_device_train_batch_size : 1 # Due to processor's handling of variable sized img-features.
74
+ per_device_train_batch_size : 2
75
75
gradient_accumulation_steps : 8
76
76
max_steps : 20
77
77
Original file line number Diff line number Diff line change @@ -161,9 +161,10 @@ def build_collator_from_config(
161
161
collator_kwargs ["allow_multi_image_inputs" ] = (
162
162
model_config .visual_config .supports_multiple_images
163
163
)
164
- collator_kwargs ["main_image_feature" ] = (
165
- model_config .visual_config .main_image_feature
166
- )
164
+ if collator_name == "vision_language_with_padding" :
165
+ collator_kwargs ["main_image_feature" ] = (
166
+ model_config .visual_config .main_image_feature
167
+ )
167
168
168
169
if collator_name == "vision_language_sft" :
169
170
processor_name = collator_kwargs .get (
Original file line number Diff line number Diff line change 21
21
from oumi .core .tokenizers .base_tokenizer import BaseTokenizer
22
22
from oumi .core .types import Conversation
23
23
24
- _PIXEL_VALUES_KEY = "pixel_values"
25
-
26
24
27
25
class VisionLanguageSftCollator :
28
26
def __init__ (
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ def test_build_collator_from_config_no_collator(mock_tokenizer):
154
154
assert collator is None
155
155
156
156
157
- def test_build_collator_from_config_no_collator_no_tokenzier ():
157
+ def test_build_collator_from_config_no_collator_no_tokenizer ():
158
158
training_config = TrainingConfig (
159
159
data = DataParams (
160
160
train = DatasetSplitParams (
You can’t perform that action at this time.
0 commit comments