Skip to content
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 timm models export #1587

Merged
merged 13 commits into from
Dec 13, 2023
Merged

Conversation

mht-sharma
Copy link
Contributor

@mht-sharma mht-sharma commented Dec 12, 2023

What does this PR do?

Add export for large number of Timm models

  • Introduced DefaultTimmConfig to facilitate Timm model exports.
    • The Timm configuration entails the architecture, synonymous with model_type in transformers. However, the architecture comprises multiple variations for input_size, hidden_layers, etc.
    • This results in numerous architecture types for a single model, making it impractical to incorporate all in the TaskManager.
    • The addition of DefaultTimmConfig streamlines support for all Timm models. Specific cases can still be added similarly to other exports.
    • This design works best for this library, and changes do not affect other exports
  • This repository now accommodates over 1000 models available on the https://huggingface.co/timm page.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

@mht-sharma
Copy link
Contributor Author

mht-sharma commented Dec 12, 2023

Question: For TImm tests, should I add all the supported models based on architecture for testing, which would be a large number.
Best is manually selecting one for each model mentioned here: https://huggingface.co/docs/timm/models/. WDYT

optimum/exporters/onnx/convert.py Show resolved Hide resolved
optimum/exporters/tasks.py Show resolved Hide resolved
optimum/exporters/tasks.py Show resolved Hide resolved
tests/exporters/exporters_utils.py Outdated Show resolved Hide resolved
optimum/exporters/tasks.py Show resolved Hide resolved
@fxmarty fxmarty merged commit 7f4d7ee into huggingface:main Dec 13, 2023
53 of 58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants