diff --git a/docs/source/grpo_trainer.md b/docs/source/grpo_trainer.md index a8d058d41..3dce352a3 100644 --- a/docs/source/grpo_trainer.md +++ b/docs/source/grpo_trainer.md @@ -567,8 +567,14 @@ accelerate launch \ ### Configuration Tips -> [!WARNING] -> VLM training may fail if image tokens are truncated. We highly recommend disabling truncation by setting `max_prompt_length` to `None`. +> [!TIP] +> For VLMs, truncating may remove image tokens, leading to errors during training. To avoid this, set `max_length=None` in the [`GRPOConfig`]. This allows the model to process the full sequence length without truncating image tokens. +> +> ```python +> GRPOConfig(max_length=None, ...) +> ``` +> +> Only use `max_length` when you've verified that truncation won't remove image tokens for the entire dataset. - Use LoRA on vision-language projection layers - Enable 4-bit quantization to reduce memory usage diff --git a/docs/source/rloo_trainer.md b/docs/source/rloo_trainer.md index 891a0bcb0..814c77620 100644 --- a/docs/source/rloo_trainer.md +++ b/docs/source/rloo_trainer.md @@ -549,8 +549,14 @@ accelerate launch \ ### Configuration Tips -> [!WARNING] -> VLM training may fail if image tokens are truncated. We highly recommend disabling truncation by setting `max_prompt_length` to `None`. +> [!TIP] +> For VLMs, truncating may remove image tokens, leading to errors during training. To avoid this, set `max_length=None` in the [`RLOOConfig`]. This allows the model to process the full sequence length without truncating image tokens. +> +> ```python +> RLOOConfig(max_length=None, ...) +> ``` +> +> Only use `max_length` when you've verified that truncation won't remove image tokens for the entire dataset. - Use LoRA on vision-language projection layers - Enable 4-bit quantization to reduce memory usage