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

Uncomment modernbert config #2155

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 2 additions & 3 deletions optimum/exporters/onnx/model_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,8 @@ def inputs(self) -> Dict[str, Dict[int, str]]:
return {"input_ids": dynamic_axis, "attention_mask": dynamic_axis}


# TODO: uncomment when transformers>=4.48.0
# class ModernBertOnnxConfig(DistilBertOnnxConfig):
# pass
class ModernBertOnnxConfig(DistilBertOnnxConfig):
MIN_TRANSFORMERS_VERSION = version.parse("4.48.0")


class MPNetOnnxConfig(DistilBertOnnxConfig):
Expand Down
18 changes: 9 additions & 9 deletions optimum/exporters/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,15 +893,15 @@ class TasksManager:
"image-classification",
onnx="MobileNetV2OnnxConfig",
),
# "modernbert": supported_tasks_mapping(
# "feature-extraction",
# "fill-mask",
# "text-classification",
# "multiple-choice",
# "token-classification",
# "question-answering",
# onnx="ModernBertOnnxConfig",
# ),
"modernbert": supported_tasks_mapping(
"feature-extraction",
"fill-mask",
"text-classification",
"multiple-choice",
"token-classification",
"question-answering",
onnx="ModernBertOnnxConfig",
),
"mpnet": supported_tasks_mapping(
"feature-extraction",
"fill-mask",
Expand Down
4 changes: 2 additions & 2 deletions tests/exporters/exporters_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"mobilenet-v2": "hf-internal-testing/tiny-random-MobileNetV2Model",
"mobilenet-v1": "google/mobilenet_v1_0.75_192",
"mobilevit": "hf-internal-testing/tiny-random-mobilevit",
# "modernbert": "hf-internal-testing/tiny-random-ModernBertForMaskedLM",
"modernbert": "hf-internal-testing/tiny-random-ModernBertForMaskedLM",
"mpnet": "hf-internal-testing/tiny-random-MPNetModel",
"mpt": "hf-internal-testing/tiny-random-MptForCausalLM",
"mt5": "lewtun/tiny-random-mt5",
Expand Down Expand Up @@ -269,7 +269,7 @@
# "mobilenet_v1": "google/mobilenet_v1_0.75_192",
# "mobilenet_v2": "google/mobilenet_v2_0.35_96",
"mobilevit": "apple/mobilevit-small",
# "modernbert": "answerdotai/ModernBERT-base",
"modernbert": "answerdotai/ModernBERT-base",
"mpt": "mosaicml/mpt-7b",
"mt5": "lewtun/tiny-random-mt5", # Not using google/mt5-small because it takes too much time for testing.
"musicgen": "facebook/musicgen-small",
Expand Down
Loading