fix: comprehensive prompt diagnostics for debugging garbage output#248
Merged
Conversation
Adds detailed one-time logging to help debug the persistent garbage output issue: 1. Raw messages (role, content types, text preview) before chat template 2. Full rendered text_input (2000 chars, not 300) 3. Image metadata (mode, size, format) 4. Generation config (max_new_tokens, temperature, constrained, model type) 5. First generation output (500 chars + token count) 6. Input tensor shapes (input_ids, attention_mask, pixel_values, image_grid_thw) The tensor shape logging is critical: if pixel_values is MISSING, the model isn't seeing the screenshot — which would explain degenerate output regardless of prompt correctness. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
The garbage output persists after #247. Need more diagnostic data to isolate the root cause. This adds comprehensive one-time logging:
Key hypothesis: If
pixel_valuesis MISSING from the inputs, the model isn't seeing the screenshot. This would explain degenerate output regardless of prompt correctness — the model is effectively blind.What to look for in the logs
If pixel_values shows
MISSING, that's the bug.🤖 Generated with Claude Code