Conversation
Summary of ChangesHello @radicalyyyahaha, 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 significantly expands the FastVideo framework's capabilities by integrating full support for LingBot-World models. It introduces a new image-to-video pipeline tailored for these models, refines the model configuration to accommodate their specific architectures, and makes the weight loading process more adaptable to various checkpoint formats. Additionally, it includes a dedicated conversion script to simplify the preparation of LingBot-World checkpoints and implements a performance enhancement for multi-process operations. 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. Changelog
Activity
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 adds support for LingBot-World models. The changes include new parameter mappings, more flexible model configuration and weight loading, a new pipeline, and a conversion script. The changes are generally good, improving compatibility and performance. However, I found a potential issue in the __post_init__ method of WanVideoArchConfig where hidden_size is being incorrectly overwritten, which could lead to model configuration errors. I've provided a suggestion to fix this.
| def __post_init__(self): | ||
| if self.num_heads is not None: | ||
| self.num_attention_heads = self.num_heads | ||
| if self.in_dim is not None: | ||
| self.in_channels = self.in_dim | ||
| if self.out_dim is not None: | ||
| self.out_channels = self.out_dim | ||
| if self.dim is not None and self.num_attention_heads > 0: | ||
| self.attention_head_dim = self.dim // self.num_attention_heads | ||
| self.hidden_size = self.dim | ||
| super().__post_init__() | ||
| self.out_channels = self.out_channels or self.in_channels | ||
| self.hidden_size = self.num_attention_heads * self.attention_head_dim |
There was a problem hiding this comment.
In the __post_init__ method, self.hidden_size is set on line 175 based on self.dim, but it's then unconditionally overwritten on line 178. This can lead to an incorrect hidden_size if self.dim is not a multiple of self.num_attention_heads due to integer division. For example, if dim was 5001 and num_attention_heads was 40, attention_head_dim would be 125, and hidden_size would be incorrectly set to 40 * 125 = 5000 instead of the intended 5001. The logic should be restructured to correctly prioritize self.dim for hidden_size when it's available.
| def __post_init__(self): | |
| if self.num_heads is not None: | |
| self.num_attention_heads = self.num_heads | |
| if self.in_dim is not None: | |
| self.in_channels = self.in_dim | |
| if self.out_dim is not None: | |
| self.out_channels = self.out_dim | |
| if self.dim is not None and self.num_attention_heads > 0: | |
| self.attention_head_dim = self.dim // self.num_attention_heads | |
| self.hidden_size = self.dim | |
| super().__post_init__() | |
| self.out_channels = self.out_channels or self.in_channels | |
| self.hidden_size = self.num_attention_heads * self.attention_head_dim | |
| def __post_init__(self): | |
| if self.num_heads is not None: | |
| self.num_attention_heads = self.num_heads | |
| if self.in_dim is not None: | |
| self.in_channels = self.in_dim | |
| if self.out_dim is not None: | |
| self.out_channels = self.out_dim | |
| super().__post_init__() | |
| if self.dim is not None and self.num_attention_heads > 0: | |
| self.attention_head_dim = self.dim // self.num_attention_heads | |
| self.hidden_size = self.dim | |
| else: | |
| self.hidden_size = self.num_attention_heads * self.attention_head_dim | |
| self.out_channels = self.out_channels or self.in_channels |
No description provided.