-
Notifications
You must be signed in to change notification settings - Fork 470
Add intern vl3 and internvl3_5 #963
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
Conversation
Add support for InternVL3 and InternVL3.5 models including: - InternVL3-8B (OpenGVLab/InternVL3-8B) - InternVL3.5-30B-A3B (OpenGVLab/InternVL3_5-30B-A3B) The implementation supports both single GPU and multi-GPU inference with automatic device mapping.
Add internvl3_5.py as thin wrapper around InternVL3 with different default pretrained model. Both share same logic since they have identical interfaces.
Code Review: InternVL3 and InternVL3.5 ImplementationSummaryThis PR adds support for InternVL3 and InternVL3.5 models. The implementation follows existing patterns from InternVL2 and includes support for both image and video modalities. Overall, the code is well-structured, but there are several issues that need to be addressed before merging. Critical Issues1. Missing Type HintsLocation: Multiple functions throughout internvl3.py The codebase requires type hints for all functions per CLAUDE.md guidelines. The following functions are missing type annotations:
Fix: Add proper type hints to all function signatures. 2. Line Length ViolationsLocation: internvl3.py:64 and other locations The codebase enforces an 88-character line limit. Line 64 with the target_ratios set comprehension exceeds this. Fix: Break long lines appropriately using parentheses and multi-line formatting. 3. Missing _config PropertyLocation: internvl3.py:216-217 The config property returns self._model.config, but InternVL2 returns self._config. The _config attribute should be set during initialization. Fix: Add self._config = self._model.config in init 4. Unused ParameterLocation: internvl3.py:141, 143 The num_layers parameter is defined but never used in InternVL3. Fix: Remove the num_layers parameter from the init signature. 5. Missing DocstringsLocation: All public functions and the class Per CLAUDE.md: Public APIs must have docstrings. The InternVL3 class and all public functions lack docstrings. Fix: Add comprehensive docstrings to the class and all public functions. Positive Aspects
Required Actions Before Merge
Overall AssessmentThe implementation is solid and follows established patterns. The main issues are code style compliance that will cause CI failures. Once addressed and tests are added, this will be ready to merge. Recommendation: Request changes - address critical issues and add tests before merging. |
Pull Request Review: Add InternVL3 and InternVL3.5 SupportThank you for contributing these new model implementations! Overall, the code is well-structured and follows good practices. Below is a detailed review with suggestions for improvement. Code Quality and Best Practices ✅Strengths:
Areas for Improvement:1. Inconsistent Variable Naming in
|


Before you open a pull-request, please check if a similar issue already exists or has been closed before.
When you open a pull-request, please be sure to include the following
If you meet the lint warnings, you can use following scripts to reformat code.
Ask for review
Once you feel comfortable for your PR, feel free to @ one of the contributors to review
Thank you for your contributions!