-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Extended neva model to support llava_next #11390
Conversation
@@ -27,7 +27,7 @@ | |||
|
|||
if TYPE_CHECKING: | |||
from transformers import LlavaConfig as HFLlavaConfig | |||
from transformers import LlavaForConditionalGeneration | |||
from transformers import LlavaForConditionalGeneration, LlavaNextForConditionalGeneration |
Check notice
Code scanning / CodeQL
Unused import
beep boop 🤖: 🚨 The following files must be fixed before merge! Your code was analyzed with PyLint. The following annotations have been identified:
Thank you for improving NeMo's documentation! |
beep boop 🤖: 🙏 The following files have warnings. In case you are familiar with these, please try helping us to improve the code base. Your code was analyzed with PyLint. The following annotations have been identified:
Thank you for improving NeMo's documentation! |
@@ -31,7 +39,9 @@ | |||
"NevaConfig", | |||
"NevaModel", | |||
"LlavaConfig", | |||
"Llava15Config7B", | |||
"LlavaNextModel" "Llava15Config7B", |
Check failure
Code scanning / CodeQL
Explicit export is not defined
@@ -31,7 +39,9 @@ | |||
"NevaConfig", | |||
"NevaModel", | |||
"LlavaConfig", | |||
"Llava15Config7B", | |||
"LlavaNextModel" "Llava15Config7B", |
Check warning
Code scanning / CodeQL
Implicit string concatenation in a list
image_newline=self.image_newline, | ||
) | ||
combined_embeddings, attention_mask, position_ids, final_labels, final_input_ids, final_loss_mask = ( | ||
merge_input_ids_with_image_features( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this design here, reason -
this method is very similar function as self._preprocess_data
. In self._preprocess_data we do more things to support sp and cp. It will be good if we can re-use the same method. Can you tell me how these 2 methods are different?
@@ -455,6 +459,7 @@ def forward( | |||
self, | |||
input_ids: torch.Tensor, | |||
position_ids: torch.Tensor, | |||
image_sizes: List[torch.Tensor] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we are going to change the signiture, it would be better we are using 2 model class? it will might break something we will use nemo / mcore llava
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not break anything for vanilla neva as image_sizes tensor is optional and will be used only for llava_next. The reason for using the neva model class is most of the functionality is same.
8c69d24
to
8f779ba
Compare
What does this PR do ?
Extended neva model to support llava_next
Collection:
VLM
Changelog
-NeVA fwd function changes to handle image tiling
GitHub Actions CI
The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.
The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".
Before your PR is "Ready for review"
Pre checks:
PR Type:
If you haven't finished some of the above items you can still open "Draft" PR.
Who can review?
Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.
Additional Information