Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

max pixels argument #5456

Open
1 task done
sharonsalabiglossai opened this issue Sep 17, 2024 · 0 comments
Open
1 task done

max pixels argument #5456

sharonsalabiglossai opened this issue Sep 17, 2024 · 0 comments
Labels
pending This problem is yet to be addressed

Comments

@sharonsalabiglossai
Copy link

Reminder

  • I have read the README and searched the existing issues.

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.dev0
  • Platform: Linux-5.15.0-94-generic-x86_64-with-glibc2.35
  • Python version: 3.8.18
  • PyTorch version: 2.3.1+cu121 (GPU)
  • Transformers version: 4.45.0.dev0
  • Datasets version: 2.21.0
  • Accelerate version: 0.34.0
  • PEFT version: 0.12.0
  • TRL version: 0.9.6
  • GPU type: NVIDIA A40
  • DeepSpeed version: 0.15.1
  • Bitsandbytes version: 0.43.3

Reproduction

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

@github-actions github-actions bot added the pending This problem is yet to be addressed label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending This problem is yet to be addressed
Projects
None yet
Development

No branches or pull requests

1 participant