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 support for Ernie model #1753

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions optimum/exporters/onnx/model_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ class SplinterOnnxConfig(BertOnnxConfig):
pass


class ErnieOnnxConfig(BertOnnxConfig):
pass


class DistilBertOnnxConfig(BertOnnxConfig):
@property
def inputs(self) -> Dict[str, Dict[int, str]]:
Expand Down
9 changes: 9 additions & 0 deletions optimum/exporters/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,15 @@ class TasksManager:
"text2text-generation-with-past",
onnx="EncoderDecoderOnnxConfig",
),
"ernie": supported_tasks_mapping(
"feature-extraction",
"fill-mask",
"text-classification",
"multiple-choice",
"token-classification",
"question-answering",
onnx="ErnieOnnxConfig",
),
"esm": supported_tasks_mapping(
"feature-extraction",
"fill-mask",
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 @@ -229,6 +229,7 @@ class NormalizedConfigManager:
"donut-swin": NormalizedVisionConfig,
"electra": NormalizedTextConfig,
"encoder-decoder": NormalizedEncoderDecoderConfig,
"ernie": NormalizedTextConfig,
"gemma": NormalizedTextConfigWithGQA,
"gpt2": GPT2LikeNormalizedTextConfig,
"gpt-bigcode": GPTBigCodeNormalizedTextConfig,
Expand Down
Loading