Make the default value of fsdp compatible with transformers less than 4.57#7235
Make the default value of fsdp compatible with transformers less than 4.57#7235hjh0119 merged 22 commits intomodelscope:mainfrom
Conversation
support hunyuanOCR
fix position_ids for multi images
update faq
fix typos
update faq
Summary of ChangesHello @slin000111, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a compatibility issue with older versions of the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request addresses a compatibility issue with certain versions of the transformers library by setting a default value for the fsdp argument. My review focuses on improving the type consistency of the proposed change. The fix is functionally correct, but it can be improved to align with the existing type hints for better code quality and maintainability.
|
|
||
| def _init_fsdp(self): | ||
| if not self.fsdp: | ||
| self.fsdp = [] |
There was a problem hiding this comment.
While setting self.fsdp = [] fixes the compatibility issue, it introduces a type inconsistency. The fsdp attribute is type-hinted as Optional[str] on line 204, but you are assigning a list to it. To maintain type consistency, it would be better to set it to an empty string "". This is also a safe "disabled" value across different transformers versions and respects the established type hint.
| self.fsdp = [] | |
| self.fsdp = "" |
PR type
PR information
Write the detail information belongs to this PR.
Make the default value of fsdp compatible with transformers less than 4.57
Experiment results
Paste your experiment result here(if needed).