Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions nb/AMD-Gemma3N_(4B)-Vision.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@
"id": "FY-9u-OD6_gE"
},
"source": [
"Let's convert the dataset into the \"correct\" format for finetuning:"
"We don't convert the whole dataset up front, since a list of converted examples would keep every decoded image in memory. Instead, `UnslothVisionDataCollator` calls `convert_to_conversation` on each batch during training (see `formatting_func` below). Let's convert one example to check the format:"
]
},
{
Expand All @@ -713,7 +713,7 @@
},
"outputs": [],
"source": [
"converted_dataset = [convert_to_conversation(sample) for sample in dataset]"
"converted_example = convert_to_conversation(dataset[0])"
]
},
{
Expand Down Expand Up @@ -755,7 +755,7 @@
}
],
"source": [
"converted_dataset[0]"
"converted_example"
]
},
{
Expand Down Expand Up @@ -896,9 +896,9 @@
"\n",
"trainer = SFTTrainer(\n",
" model = model,\n",
" train_dataset = converted_dataset,\n",
" train_dataset = dataset,\n",
" processing_class = processor.tokenizer,\n",
" data_collator = UnslothVisionDataCollator(model, processor),\n",
" data_collator = UnslothVisionDataCollator(model, processor, formatting_func = convert_to_conversation),\n",
" args = SFTConfig(\n",
" per_device_train_batch_size = 1,\n",
" gradient_accumulation_steps = 4,\n",
Expand Down
10 changes: 5 additions & 5 deletions nb/AMD-Gemma3_(4B)-Vision.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@
"id": "FY-9u-OD6_gE"
},
"source": [
"Let's convert the dataset into the \"correct\" format for finetuning:"
"We don't convert the whole dataset up front, since a list of converted examples would keep every decoded image in memory. Instead, `UnslothVisionDataCollator` calls `convert_to_conversation` on each batch during training (see `formatting_func` below). Let's convert one example to check the format:"
]
},
{
Expand All @@ -778,7 +778,7 @@
},
"outputs": [],
"source": [
"converted_dataset = [convert_to_conversation(sample) for sample in dataset]"
"converted_example = convert_to_conversation(dataset[0])"
]
},
{
Expand Down Expand Up @@ -820,7 +820,7 @@
}
],
"source": [
"converted_dataset[0]"
"converted_example"
]
},
{
Expand Down Expand Up @@ -1007,9 +1007,9 @@
"\n",
"trainer = SFTTrainer(\n",
" model = model,\n",
" train_dataset = converted_dataset,\n",
" train_dataset = dataset,\n",
" processing_class = processor.tokenizer,\n",
" data_collator = UnslothVisionDataCollator(model, processor),\n",
" data_collator = UnslothVisionDataCollator(model, processor, formatting_func = convert_to_conversation),\n",
" args = SFTConfig(\n",
" per_device_train_batch_size = 1,\n",
" gradient_accumulation_steps = 4,\n",
Expand Down
10 changes: 5 additions & 5 deletions nb/AMD-Gemma4_(12B)_Vision.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@
"id": "FY-9u-OD6_gE"
},
"source": [
"Let's convert the dataset into the \"correct\" format for finetuning:"
"We don't convert the whole dataset up front, since a list of converted examples would keep every decoded image in memory. Instead, `UnslothVisionDataCollator` calls `convert_to_conversation` on each batch during training (see `formatting_func` below). Let's convert one example to check the format:"
]
},
{
Expand All @@ -710,7 +710,7 @@
},
"outputs": [],
"source": [
"converted_dataset = [convert_to_conversation(sample) for sample in dataset]"
"converted_example = convert_to_conversation(dataset[0])"
]
},
{
Expand Down Expand Up @@ -752,7 +752,7 @@
}
],
"source": [
"converted_dataset[0]"
"converted_example"
]
},
{
Expand Down Expand Up @@ -894,9 +894,9 @@
"\n",
"trainer = SFTTrainer(\n",
" model = model,\n",
" train_dataset = converted_dataset,\n",
" train_dataset = dataset,\n",
" processing_class = processor.tokenizer,\n",
" data_collator = UnslothVisionDataCollator(model, processor),\n",
" data_collator = UnslothVisionDataCollator(model, processor, formatting_func = convert_to_conversation),\n",
" args = SFTConfig(\n",
" per_device_train_batch_size = 1,\n",
" gradient_accumulation_steps = 4,\n",
Expand Down
10 changes: 5 additions & 5 deletions nb/AMD-Gemma4_(26B_A4B)-Vision.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@
"id": "FY-9u-OD6_gE"
},
"source": [
"Let's convert the dataset into the \"correct\" format for finetuning:"
"We don't convert the whole dataset up front, since a list of converted examples would keep every decoded image in memory. Instead, `UnslothVisionDataCollator` calls `convert_to_conversation` on each batch during training (see `formatting_func` below). Let's convert one example to check the format:"
]
},
{
Expand All @@ -776,7 +776,7 @@
},
"outputs": [],
"source": [
"converted_dataset = [convert_to_conversation(sample) for sample in dataset]"
"converted_example = convert_to_conversation(dataset[0])"
]
},
{
Expand Down Expand Up @@ -818,7 +818,7 @@
}
],
"source": [
"converted_dataset[0]"
"converted_example"
]
},
{
Expand Down Expand Up @@ -961,9 +961,9 @@
"\n",
"trainer = SFTTrainer(\n",
" model = model,\n",
" train_dataset = converted_dataset,\n",
" train_dataset = dataset,\n",
" processing_class = processor.tokenizer,\n",
" data_collator = UnslothVisionDataCollator(model, processor),\n",
" data_collator = UnslothVisionDataCollator(model, processor, formatting_func = convert_to_conversation),\n",
" args = SFTConfig(\n",
" per_device_train_batch_size = 1,\n",
" gradient_accumulation_steps = 4,\n",
Expand Down
10 changes: 5 additions & 5 deletions nb/AMD-Gemma4_(31B)-Vision.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@
"id": "FY-9u-OD6_gE"
},
"source": [
"Let's convert the dataset into the \"correct\" format for finetuning:"
"We don't convert the whole dataset up front, since a list of converted examples would keep every decoded image in memory. Instead, `UnslothVisionDataCollator` calls `convert_to_conversation` on each batch during training (see `formatting_func` below). Let's convert one example to check the format:"
]
},
{
Expand All @@ -762,7 +762,7 @@
},
"outputs": [],
"source": [
"converted_dataset = [convert_to_conversation(sample) for sample in dataset]"
"converted_example = convert_to_conversation(dataset[0])"
]
},
{
Expand Down Expand Up @@ -804,7 +804,7 @@
}
],
"source": [
"converted_dataset[0]"
"converted_example"
]
},
{
Expand Down Expand Up @@ -947,9 +947,9 @@
"\n",
"trainer = SFTTrainer(\n",
" model = model,\n",
" train_dataset = converted_dataset,\n",
" train_dataset = dataset,\n",
" processing_class = processor.tokenizer,\n",
" data_collator = UnslothVisionDataCollator(model, processor),\n",
" data_collator = UnslothVisionDataCollator(model, processor, formatting_func = convert_to_conversation),\n",
" args = SFTConfig(\n",
" per_device_train_batch_size = 1,\n",
" gradient_accumulation_steps = 4,\n",
Expand Down
10 changes: 5 additions & 5 deletions nb/AMD-Gemma4_(E2B)-Vision.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@
"id": "FY-9u-OD6_gE"
},
"source": [
"Let's convert the dataset into the \"correct\" format for finetuning:"
"We don't convert the whole dataset up front, since a list of converted examples would keep every decoded image in memory. Instead, `UnslothVisionDataCollator` calls `convert_to_conversation` on each batch during training (see `formatting_func` below). Let's convert one example to check the format:"
]
},
{
Expand All @@ -724,7 +724,7 @@
},
"outputs": [],
"source": [
"converted_dataset = [convert_to_conversation(sample) for sample in dataset]"
"converted_example = convert_to_conversation(dataset[0])"
]
},
{
Expand Down Expand Up @@ -766,7 +766,7 @@
}
],
"source": [
"converted_dataset[0]"
"converted_example"
]
},
{
Expand Down Expand Up @@ -903,9 +903,9 @@
"\n",
"trainer = SFTTrainer(\n",
" model = model,\n",
" train_dataset = converted_dataset,\n",
" train_dataset = dataset,\n",
" processing_class = processor.tokenizer,\n",
" data_collator = UnslothVisionDataCollator(model, processor),\n",
" data_collator = UnslothVisionDataCollator(model, processor, formatting_func = convert_to_conversation),\n",
" args = SFTConfig(\n",
" per_device_train_batch_size = 1,\n",
" gradient_accumulation_steps = 4,\n",
Expand Down
10 changes: 5 additions & 5 deletions nb/AMD-Gemma4_(E4B)-Vision.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@
"id": "FY-9u-OD6_gE"
},
"source": [
"Let's convert the dataset into the \"correct\" format for finetuning:"
"We don't convert the whole dataset up front, since a list of converted examples would keep every decoded image in memory. Instead, `UnslothVisionDataCollator` calls `convert_to_conversation` on each batch during training (see `formatting_func` below). Let's convert one example to check the format:"
]
},
{
Expand All @@ -723,7 +723,7 @@
},
"outputs": [],
"source": [
"converted_dataset = [convert_to_conversation(sample) for sample in dataset]"
"converted_example = convert_to_conversation(dataset[0])"
]
},
{
Expand Down Expand Up @@ -765,7 +765,7 @@
}
],
"source": [
"converted_dataset[0]"
"converted_example"
]
},
{
Expand Down Expand Up @@ -902,9 +902,9 @@
"\n",
"trainer = SFTTrainer(\n",
" model = model,\n",
" train_dataset = converted_dataset,\n",
" train_dataset = dataset,\n",
" processing_class = processor.tokenizer,\n",
" data_collator = UnslothVisionDataCollator(model, processor),\n",
" data_collator = UnslothVisionDataCollator(model, processor, formatting_func = convert_to_conversation),\n",
" args = SFTConfig(\n",
" per_device_train_batch_size = 1,\n",
" gradient_accumulation_steps = 4,\n",
Expand Down
10 changes: 5 additions & 5 deletions nb/AMD-LFM2.5_VL_(1.6B)-Vision.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@
"id": "RUcF7_3DwT7H"
},
"source": [
"Let's convert the dataset into the \"correct\" format for finetuning:"
"We don't convert the whole dataset up front, since a list of converted examples would keep every decoded image in memory. Instead, `UnslothVisionDataCollator` calls `convert_to_conversation` on each batch during training (see `formatting_func` below). Let's convert one example to check the format:"
]
},
{
Expand All @@ -458,7 +458,7 @@
},
"outputs": [],
"source": [
"converted_dataset = [convert_to_conversation(sample) for sample in dataset]"
"converted_example = convert_to_conversation(dataset[0])"
]
},
{
Expand Down Expand Up @@ -500,7 +500,7 @@
}
],
"source": [
"converted_dataset[0]"
"converted_example"
]
},
{
Expand Down Expand Up @@ -605,8 +605,8 @@
"trainer = SFTTrainer(\n",
" model = model,\n",
" tokenizer = tokenizer,\n",
" data_collator = UnslothVisionDataCollator(model, tokenizer), # Must use!\n",
" train_dataset = converted_dataset,\n",
" data_collator = UnslothVisionDataCollator(model, tokenizer, formatting_func = convert_to_conversation), # Must use!\n",
" train_dataset = dataset,\n",
" args = SFTConfig(\n",
" per_device_train_batch_size = 2,\n",
" gradient_accumulation_steps = 4,\n",
Expand Down
10 changes: 5 additions & 5 deletions nb/AMD-Llama3.2_(11B)-Vision.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@
"id": "FY-9u-OD6_gE"
},
"source": [
"Let's convert the dataset into the \"correct\" format for finetuning:"
"We don't convert the whole dataset up front, since a list of converted examples would keep every decoded image in memory. Instead, `UnslothVisionDataCollator` calls `convert_to_conversation` on each batch during training (see `formatting_func` below). Let's convert one example to check the format:"
]
},
{
Expand All @@ -761,7 +761,7 @@
},
"outputs": [],
"source": [
"converted_dataset = [convert_to_conversation(sample) for sample in dataset]"
"converted_example = convert_to_conversation(dataset[0])"
]
},
{
Expand Down Expand Up @@ -803,7 +803,7 @@
}
],
"source": [
"converted_dataset[0]"
"converted_example"
]
},
{
Expand Down Expand Up @@ -909,8 +909,8 @@
"trainer = SFTTrainer(\n",
" model = model,\n",
" tokenizer = tokenizer,\n",
" data_collator = UnslothVisionDataCollator(model, tokenizer), # Must use!\n",
" train_dataset = converted_dataset,\n",
" data_collator = UnslothVisionDataCollator(model, tokenizer, formatting_func = convert_to_conversation), # Must use!\n",
" train_dataset = dataset,\n",
" args = SFTConfig(\n",
" per_device_train_batch_size = 2,\n",
" gradient_accumulation_steps = 4,\n",
Expand Down
10 changes: 5 additions & 5 deletions nb/AMD-Ministral_3_VL_(3B)_Vision.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@
"id": "FY-9u-OD6_gE"
},
"source": [
"Let's convert the dataset into the \"correct\" format for finetuning:"
"We don't convert the whole dataset up front, since a list of converted examples would keep every decoded image in memory. Instead, `UnslothVisionDataCollator` calls `convert_to_conversation` on each batch during training (see `formatting_func` below). Let's convert one example to check the format:"
]
},
{
Expand All @@ -818,7 +818,7 @@
},
"outputs": [],
"source": [
"converted_dataset = [convert_to_conversation(sample) for sample in dataset]"
"converted_example = convert_to_conversation(dataset[0])"
]
},
{
Expand Down Expand Up @@ -860,7 +860,7 @@
}
],
"source": [
"converted_dataset[0]"
"converted_example"
]
},
{
Expand Down Expand Up @@ -995,8 +995,8 @@
"trainer = SFTTrainer(\n",
" model = model,\n",
" tokenizer = tokenizer,\n",
" data_collator = UnslothVisionDataCollator(model, tokenizer), # Must use!\n",
" train_dataset = converted_dataset,\n",
" data_collator = UnslothVisionDataCollator(model, tokenizer, formatting_func = convert_to_conversation), # Must use!\n",
" train_dataset = dataset,\n",
" args = SFTConfig(\n",
" per_device_train_batch_size = 4,\n",
" gradient_accumulation_steps = 2,\n",
Expand Down
Loading