-
Notifications
You must be signed in to change notification settings - Fork 487
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
Add visualbert onnx suport #2091
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks for your contribution @tedasdf !
optimum/exporters/tasks.py
Outdated
@@ -1108,6 +1108,12 @@ class TasksManager: | |||
"text-to-audio", | |||
onnx="VitsOnnxConfig", | |||
), | |||
"visualbert": supported_tasks_mapping( |
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.
should be
"visualbert": supported_tasks_mapping( | |
"visual-bert": supported_tasks_mapping( |
https://huggingface.co/hf-internal-testing/tiny-random-VisualBertModel/blob/main/config.json#L26
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.
wouldnt that be visual_bert
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.
model_type is defined as follows
optimum/optimum/exporters/tasks.py
Line 1318 in 01110ad
model_type = model_type.lower().replace("_", "-") |
"visual-bert"
Hi @echarlaix, I wanted to thank you for reviewing the pull request. Frankly, I’m struggling a bit. I understand the files that need to be altered and the function to be implemented, but I’m having trouble finding the information related to the model, especially given that I’m not very familiar with such a large codebase. I would like to know if there are ways I can contribute more to this issue. I understand you’re busy, but if possible, could you guide me further? I found the structure of inputs and outputs from the forward function of the model here. However, I’m not sure if the model needs the normalized text configuration or where to locate the appropriate _task_mapping attribute. I chose these areas based on the tasks the model has been fine-tuned for, but I could use some guidance on where to look. |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Hi @tedasdf, thanks for your contribution! I see that you closed this PR yesterday but happy to help if you want to re-open it and continue working on the integration.
The inputs used to export the model needs to be a subset of the model's inputs (a check is done here https://github.com/huggingface/optimum/blob/v1.23.3/optimum/exporters/onnx/convert.py#L96 for this). So you need to first make sure that the inputs defined in your In your case I see that you have optimum/optimum/utils/input_generators.py Line 829 in d6de676
visual_embeds . You can add one using an DummyInputGenerator
|
What does this PR do?
Fixes #555 (issue)
Support VisualBERT model config.
Before submitting
Who can review?