-
Notifications
You must be signed in to change notification settings - Fork 25
[Gemma3] Add VLM support (need help) #50
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
Open
simondanielsson
wants to merge
56
commits into
huggingface:main
Choose a base branch
from
simondanielsson:feature/add-gemma3-export
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 17 commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
9afac3c
Initial commit
danielssonsimonbcg 4bc0fab
Add OnnxConfig
simondanielsson ae1bfce
Add gemma3 to list of models requiring position ids
simondanielsson 1775f54
Add vocab size to text config
simondanielsson 35a647f
Add normaliezd text and vision config to Gemma3
simondanielsson 454d47b
Update normalized config to grab from manager
simondanielsson cd831b6
Remove unused logigng
simondanielsson 97c09b9
Update dummy input generator
simondanielsson 03d4de3
Add gemma3 tests
simondanielsson 8345410
Improve formatting of Gemma3OnnxConfig
simondanielsson 55b5280
Add gemma3 onnxruntime tests
simondanielsson 510c2b7
Add Gemma and Gemma3 to list of supported models in docs
simondanielsson 41f0c75
Add Gemma3 to test_decoder.py
simondanielsson 709fff4
Remove commented code
simondanielsson 329062c
Reset formatting in onnx.py
simondanielsson 401f5f7
Remove .DS_Store
simondanielsson 38407e9
Fix formatting
simondanielsson bd4f48c
Stub base VLM onnx config
simondanielsson 33e2ec6
First version of multimodal OnnxConfig
simondanielsson d9bd16c
Allow registering custom classes and tasks from optimum-onnx
simondanielsson 04709f9
Implement monolith export of Gemma3
simondanielsson 30fde4c
Add support for exporting multi submodels
simondanielsson 57499b8
Add support for exporting for feature-extraction
simondanielsson ad68aa1
Add support for with-past
simondanielsson b420d36
Move classes to appropriate modules
simondanielsson 90bf94c
Remove TODO comment
simondanielsson e973905
Remove another comment
simondanielsson 01611f4
Rename constant
simondanielsson 7eca9c6
Fix with make style
simondanielsson e1cedf4
Remove dev from transformer version
simondanielsson bf27714
Add copyright/license in top of input_generators.py
simondanielsson a8c0d4a
Remove injection of preprocessors
simondanielsson 54b7e2b
Generate random inputs
simondanielsson da4b9de
Update VLMDecoderOnnxConfig to be streamlined
simondanielsson 3b2cca6
Add large model test
simondanielsson 522264f
Remove ds.store
simondanielsson 8c0c97e
Propagate behaviors correctly
simondanielsson eea29dc
Remove modelpatcher and implement direclty in patch_model_for_export
simondanielsson 1359fb1
Remove unused import
simondanielsson c0148b3
Apply use_cache if use_past is enabled and running LM or monolith
simondanielsson d6ff393
Add failing tests
simondanielsson 6253636
Attach correct configs for submodels
simondanielsson e400e07
Add export of multimodal projector
simondanielsson 2f7aa20
Add LM patcher from optimum-intel
simondanielsson 710057d
Remove import of override
simondanielsson ddd4e74
Update tests
simondanielsson e9a8811
Run make style
simondanielsson 436b59e
Remove LM head and add text_encoder
simondanielsson 6398669
Remove LM head from tests
simondanielsson 37ea777
Add LANGUAGE_MODEL_WITH_HEAD behvaior
simondanielsson 67a4302
Update tests to use _with_head
simondanielsson 60b250f
Update exported submodels
simondanielsson c7bb9f9
Stub modeling_vlm module and proper onnxruntime tests
simondanielsson e76ab45
Remove unused injection of processors in OnnxConfigWithPast
simondanielsson 9b839bc
Remove dsstore
simondanielsson 99be0fb
Change superclass of ORTModelForVIualCausalLM ot ORTModel
simondanielsson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,6 +75,7 @@ | |
| "cohere", | ||
| "falcon", | ||
| "gemma", | ||
| "gemma3", | ||
| "gpt2", | ||
| "gpt_bigcode", | ||
| "gpt_neo", | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
for example, here the model will only support text inputs, as it inherits its inputs property form llama. it also only supports classic decoder model (LLM) tasks, like text-generation.
if your intention is to support text only generation with gemma3, then yes this would be acceptable, in that case there's no need for DummyVisionInputGenerator. Also for NORMALIZED_CONFIG_CLASS, you can define it directly instead of using the config manager.