Merge branch 'main' into nightly

This commit is contained in:
Daniel Han 2025-07-17 15:36:24 -07:00
commit c3763d5ec3
2 changed files with 15 additions and 16 deletions

View file

@ -38,7 +38,7 @@ def run(args):
from unsloth import FastLanguageModel
from datasets import load_dataset
from transformers.utils import strtobool
from trl import SFTTrainer
from trl import SFTTrainer, SFTConfig
from transformers import TrainingArguments
from unsloth import is_bfloat16_supported
import logging
@ -100,7 +100,7 @@ def run(args):
print("Data is formatted and ready!")
# Configure training arguments
training_args = TrainingArguments(
training_args = SFTConfig(
per_device_train_batch_size=args.per_device_train_batch_size,
gradient_accumulation_steps=args.gradient_accumulation_steps,
warmup_steps=args.warmup_steps,
@ -115,17 +115,16 @@ def run(args):
seed=args.seed,
output_dir=args.output_dir,
report_to=args.report_to,
max_length=args.max_seq_length,
dataset_num_proc=2,
packing=False,
)
# Initialize trainer
trainer = SFTTrainer(
model=model,
tokenizer=tokenizer,
processing_class=tokenizer,
train_dataset=dataset,
dataset_text_field="text",
max_seq_length=args.max_seq_length,
dataset_num_proc=2,
packing=False,
args=training_args,
)

View file

@ -320,15 +320,15 @@ class FastLanguageModel(FastLlamaModel):
f"to obtain the latest transformers build, then restart this session."\
)
dispatch_model = FastQwen3Model if model_type == "qwen3" else FastQwen3MoeModel
elif model_type == "falcon_h1":
dispatch_model = FastFalconH1Model
if not SUPPORTS_FALCON_H1:
raise ImportError(
f"Unsloth: Your transformers version of {transformers_version} does not support FalconH1.\n"\
f"The minimum required version is 4.50.3.\n"\
f'Try `pip install --upgrade "transformers>=4.50.3"`\n'\
f"to obtain the latest transformers build, then restart this session."\
)
# elif model_type == "falcon_h1":
# dispatch_model = FastFalconH1Model
# if not SUPPORTS_FALCON_H1:
# raise ImportError(
# f"Unsloth: Your transformers version of {transformers_version} does not support FalconH1.\n"\
# f"The minimum required version is 4.50.3.\n"\
# f'Try `pip install --upgrade "transformers>=4.50.3"`\n'\
# f"to obtain the latest transformers build, then restart this session."\
# )
# Temporary disable optimized Cohere until errors match
# elif model_type == "cohere":
# dispatch_model = FastCohereModel