Skip to content

Commit 2682c9b

Browse files
committed
Merge branch 'main' into nightly
2 parents 3f4033e + 204fc46 commit 2682c9b

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

unsloth-cli.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def run(args):
3838
from unsloth import FastLanguageModel
3939
from datasets import load_dataset
4040
from transformers.utils import strtobool
41-
from trl import SFTTrainer
41+
from trl import SFTTrainer, SFTConfig
4242
from transformers import TrainingArguments
4343
from unsloth import is_bfloat16_supported
4444
import logging
@@ -100,7 +100,7 @@ def formatting_prompts_func(examples):
100100
print("Data is formatted and ready!")
101101

102102
# Configure training arguments
103-
training_args = TrainingArguments(
103+
training_args = SFTConfig(
104104
per_device_train_batch_size=args.per_device_train_batch_size,
105105
gradient_accumulation_steps=args.gradient_accumulation_steps,
106106
warmup_steps=args.warmup_steps,
@@ -115,17 +115,16 @@ def formatting_prompts_func(examples):
115115
seed=args.seed,
116116
output_dir=args.output_dir,
117117
report_to=args.report_to,
118+
max_length=args.max_seq_length,
119+
dataset_num_proc=2,
120+
packing=False,
118121
)
119122

120123
# Initialize trainer
121124
trainer = SFTTrainer(
122125
model=model,
123-
tokenizer=tokenizer,
126+
processing_class=tokenizer,
124127
train_dataset=dataset,
125-
dataset_text_field="text",
126-
max_seq_length=args.max_seq_length,
127-
dataset_num_proc=2,
128-
packing=False,
129128
args=training_args,
130129
)
131130

unsloth/models/loader.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -320,15 +320,15 @@ def from_pretrained(
320320
f"to obtain the latest transformers build, then restart this session."\
321321
)
322322
dispatch_model = FastQwen3Model if model_type == "qwen3" else FastQwen3MoeModel
323-
elif model_type == "falcon_h1":
324-
dispatch_model = FastFalconH1Model
325-
if not SUPPORTS_FALCON_H1:
326-
raise ImportError(
327-
f"Unsloth: Your transformers version of {transformers_version} does not support FalconH1.\n"\
328-
f"The minimum required version is 4.50.3.\n"\
329-
f'Try `pip install --upgrade "transformers>=4.50.3"`\n'\
330-
f"to obtain the latest transformers build, then restart this session."\
331-
)
323+
# elif model_type == "falcon_h1":
324+
# dispatch_model = FastFalconH1Model
325+
# if not SUPPORTS_FALCON_H1:
326+
# raise ImportError(
327+
# f"Unsloth: Your transformers version of {transformers_version} does not support FalconH1.\n"\
328+
# f"The minimum required version is 4.50.3.\n"\
329+
# f'Try `pip install --upgrade "transformers>=4.50.3"`\n'\
330+
# f"to obtain the latest transformers build, then restart this session."\
331+
# )
332332
# Temporary disable optimized Cohere until errors match
333333
# elif model_type == "cohere":
334334
# dispatch_model = FastCohereModel

0 commit comments

Comments
 (0)