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

Support Splinter exporters (#555) #736

Merged
merged 4 commits into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ They specify which input generators should be used for the dummy inputs, but rem
- Segformer
- SEW
- Speech2Text
- Splinter
- SqueezeBert
- Stable Diffusion
- T5
Expand Down
4 changes: 4 additions & 0 deletions optimum/exporters/onnx/model_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ class XLMOnnxConfig(BertOnnxConfig):
pass


class SplinterOnnxConfig(BertOnnxConfig):
pass


class DistilBertOnnxConfig(BertOnnxConfig):
@property
def inputs(self) -> Mapping[str, Mapping[int, str]]:
Expand Down
5 changes: 5 additions & 0 deletions optimum/exporters/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,11 @@ class TasksManager:
"speech2seq-lm-with-past",
onnx="Speech2TextOnnxConfig",
),
"splinter": supported_tasks_mapping(
"default",
"question-answering",
onnx="SplinterOnnxConfig",
),
"squeezebert": supported_tasks_mapping(
"default",
"masked-lm",
Expand Down
1 change: 1 addition & 0 deletions optimum/utils/normalized_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ class NormalizedConfigManager:
"poolformer": NormalizedVisionConfig,
"resnet": NormalizedVisionConfig,
"roberta": NormalizedTextConfig,
"splinter": NormalizedTextConfig,
"t5": T5LikeNormalizedTextConfig,
"whisper": WhisperLikeNormalizedTextConfig,
"xlm-roberta": NormalizedTextConfig,
Expand Down
2 changes: 2 additions & 0 deletions tests/exporters/exporters_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"roberta": "hf-internal-testing/tiny-random-RobertaModel",
"roformer": "hf-internal-testing/tiny-random-RoFormerModel",
"segformer": "hf-internal-testing/tiny-random-SegformerModel",
"splinter": "hf-internal-testing/tiny-random-SplinterModel",
"squeezebert": "hf-internal-testing/tiny-random-SqueezeBertModel",
"swin": "hf-internal-testing/tiny-random-SwinModel",
"t5": "hf-internal-testing/tiny-random-t5",
Expand Down Expand Up @@ -175,6 +176,7 @@
"roberta": "roberta-base",
"roformer": "junnyu/roformer_chinese_base",
"segformer": "nvidia/segformer-b0-finetuned-ade-512-512",
"splinter": "hf-internal-testing/tiny-random-SplinterModel",
Allanbeddouk marked this conversation as resolved.
Show resolved Hide resolved
"squeezebert": "squeezebert/squeezebert-uncased",
"swin": "microsoft/swin-tiny-patch4-window7-224",
"t5": "t5-small",
Expand Down