Repository navigation
Fix VLM GRPO notebook for modern TRL (conversational prompts, reward functions, dependencies) - #377
Open
ahmedshahrukhali wants to merge 6 commits into
Conversation
) - Update make_conversation to return raw conversational messages expected by modern TRL GRPOTrainer - Update markdown explanation regarding native multimodal prompt handling - Remove deprecated max_prompt_length parameter from GRPOConfig and markdown guide - Fix broken link to TRL GRPO VLM visual math example
…tions (for current GRPOTrainer multimodal/VLM parameter support)
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes the
fine_tuning_vlm_grpo_trlnotebook so it runs end-to-end on Google Colab with current TRL.The root cause of #363 is that
GRPOTrainernow requires raw conversational prompts (list[dict]) for multimodal training and applies the chat template internally. The notebook was callingprocessor.apply_chat_template()beforehand, which collapsed the structured messages into a plain string and triggered:Changes
make_conversation— return the raw message list instead of a pre-formatted string; let the trainer handle templating.format_reward/accuracy_reward— extract the text content from the conversational completion (list[dict]) before passing it tore.match()/parse(), fixing aTypeError: expected string or bytes-like object, got 'list'.GRPOConfig— remove deprecatedmax_prompt_length(same fix as Remove max_prompt_length #345 for the LLM notebook).pip install— addtorchao(Colab ships 0.10.0, TRL/PEFT need ≥0.16.0) and pin--extra-index-urlto the CUDA 12.1 index to avoid annvrtccompilation error.examples/reorganization (same fix as Fix TRL GRPO VLM example link #367).Tested on Google Colab A100.
Fixes #363
Who can review?
@sergiopaniego @merveenoyan @stevhliu