Skip to content

Commit

Permalink
Add ONNX export support for TextNet
Browse files Browse the repository at this point in the history
  • Loading branch information
xenova committed Dec 24, 2024
1 parent d21256c commit dd8874d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/exporters/onnx/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Supported architectures from [🤗 Transformers](https://huggingface.co/docs/tra
- SwinV2
- T5
- Table Transformer
- TextNet
- TROCR
- UniSpeech
- UniSpeech SAT
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 @@ -824,6 +824,10 @@ def outputs(self) -> Dict[str, Dict[int, str]]:
return common_outputs


class TextNetOnnxConfig(ViTOnnxConfig):
pass


class CvTOnnxConfig(ViTOnnxConfig):
DEFAULT_ONNX_OPSET = 13
ATOL_FOR_VALIDATION = 1e-2
Expand Down
5 changes: 5 additions & 0 deletions optimum/exporters/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,11 @@ class TasksManager:
"object-detection",
onnx="TableTransformerOnnxConfig",
),
"textnet": supported_tasks_mapping(
"feature-extraction",
"image-classification",
onnx="TextNetOnnxConfig",
),
"trocr": supported_tasks_mapping(
"feature-extraction",
"feature-extraction-with-past",
Expand Down

0 comments on commit dd8874d

Please sign in to comment.