You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
args = dict(
stage="sft", # do supervised fine-tuning
do_train=True,
model_name_or_path="Qwen/Qwen2-VL-2B-Instruct", # use bnb-4bit-quantized Llama-3-8B-Instruct model
dataset="small_ferrari", # use alpaca and identity datasets
template="qwen2_vl", # use llama3 prompt template
finetuning_type="lora", # use LoRA adapters to save memory
lora_target="all", # attach LoRA adapters to all linear layers
output_dir="qwen2vl_lora_25im_ds2_4", # the path to save LoRA adapters
per_device_train_batch_size=1, # the batch size
gradient_accumulation_steps=1, # the gradient accumulation steps
lr_scheduler_type="cosine", # use cosine learning rate scheduler
logging_steps=10, # log every 10 steps
warmup_ratio=0.1, # use warmup scheduler
save_steps=1000, # save checkpoint every 1000 steps
learning_rate=5e-5, # the learning rate
num_train_epochs=3.0, # the epochs of training
max_samples=500, # use 500 examples in each dataset
max_grad_norm=1.0, # clip gradient norm to 1.0
loraplus_lr_ratio=16.0, # use LoRA+ algorithm with lambda=16.0
bf16=True, # use float16 mixed precision training
use_liger_kernel=True, # use liger kernel for efficient training
cutoff_len=20000, # maximum sequence length
plot_loss=True, # plot loss during training
preprocessing_num_workers=4,
ddp_timeout=9000, # timeout for distributed data parallel
)
Reminder
System Info
[2024-09-17 10:58:53,418] [INFO] [real_accelerator.py:203:get_accelerator] Setting ds_accelerator to cuda (auto detect)
llamafactory
version: 0.9.1.dev0Reproduction
args = dict(
stage="sft", # do supervised fine-tuning
do_train=True,
model_name_or_path="Qwen/Qwen2-VL-2B-Instruct", # use bnb-4bit-quantized Llama-3-8B-Instruct model
dataset="small_ferrari", # use alpaca and identity datasets
template="qwen2_vl", # use llama3 prompt template
finetuning_type="lora", # use LoRA adapters to save memory
lora_target="all", # attach LoRA adapters to all linear layers
output_dir="qwen2vl_lora_25im_ds2_4", # the path to save LoRA adapters
per_device_train_batch_size=1, # the batch size
gradient_accumulation_steps=1, # the gradient accumulation steps
lr_scheduler_type="cosine", # use cosine learning rate scheduler
logging_steps=10, # log every 10 steps
warmup_ratio=0.1, # use warmup scheduler
save_steps=1000, # save checkpoint every 1000 steps
learning_rate=5e-5, # the learning rate
num_train_epochs=3.0, # the epochs of training
max_samples=500, # use 500 examples in each dataset
max_grad_norm=1.0, # clip gradient norm to 1.0
loraplus_lr_ratio=16.0, # use LoRA+ algorithm with lambda=16.0
bf16=True, # use float16 mixed precision training
use_liger_kernel=True, # use liger kernel for efficient training
cutoff_len=20000, # maximum sequence length
plot_loss=True, # plot loss during training
preprocessing_num_workers=4,
ddp_timeout=9000, # timeout for distributed data parallel
)
# Save args to JSON file
json.dump(args, open("train_qwen2.json", "w", encoding="utf-8"), indent=2)
!llamafactory-cli train train_qwen2.json
Expected behavior
How can we add max_pixels, min_pixels parameters in the args for finetuning qwen2vl in order to control the amount of token per image?
Others
No response
The text was updated successfully, but these errors were encountered: