[https://nvbugs/6157892][fix] Restore the pre-#12743 AutoProcessor.from_pretrained(...) assignment for `text#13905
Conversation
…only path MistralCommonImageProcessor.__call__ always applies apply_chat_template, which corrupts raw text prompts (e.g. MMLU/GSM8K) and requires an images positional argument. Revert the text_processor assignment so the text-only branch uses AutoProcessor.from_pretrained as before, matching the intent documented in the adjacent comment. Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
📝 WalkthroughWalkthroughThe ChangesProcessor Initialization Refactoring
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tensorrt_llm/_torch/models/modeling_mistral.py (1)
1-1:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAdd/update the NVIDIA copyright header in this modified file.
This source file is modified but does not include the required NVIDIA copyright header/current modification year.
As per coding guidelines:
All C++, Python, and other source files must contain NVIDIA copyright header with current modification year.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tensorrt_llm/_torch/models/modeling_mistral.py` at line 1, This file (modeling_mistral.py) is missing the required NVIDIA copyright header; add or update the standard NVIDIA copyright/license header at the very top of the file before any imports (i.e., place it above the existing import copy), ensure the header uses the current modification year, and match the same header format used in other project Python sources so the file contains the required NVIDIA copyright and license lines.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@tensorrt_llm/_torch/models/modeling_mistral.py`:
- Line 1: This file (modeling_mistral.py) is missing the required NVIDIA
copyright header; add or update the standard NVIDIA copyright/license header at
the very top of the file before any imports (i.e., place it above the existing
import copy), ensure the header uses the current modification year, and match
the same header format used in other project Python sources so the file contains
the required NVIDIA copyright and license lines.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 3f445d26-1606-4142-b4b2-77ef3f363d57
📒 Files selected for processing (1)
tensorrt_llm/_torch/models/modeling_mistral.py
Summary
text_processor = AutoProcessor.from_pretrained(...)withtext_processor = self._processor(a MistralCommonImageProcessor), whose__call__both requires a positionalimagesarg and always appliesapply_chat_template, corrupting raw text prompts.AutoProcessor.from_pretrained(...)assignment fortext_processorin themistral_large_3branch, matching the intent documented in the in-line comment.Test plan
Links
Summary by CodeRabbit