Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
52dd2b61
Unverified
Commit
52dd2b61
authored
Dec 22, 2022
by
Younes Belkada
Committed by
GitHub
Dec 22, 2022
Browse files
[`MobileNet-v2`] Fix ONNX typo (#20860)
* fix typo `onnx` * fix test
parent
4d10ffd5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
src/transformers/onnx/features.py
src/transformers/onnx/features.py
+2
-2
tests/onnx/test_onnx_v2.py
tests/onnx/test_onnx_v2.py
+6
-1
No files found.
src/transformers/onnx/features.py
View file @
52dd2b61
...
...
@@ -408,12 +408,12 @@ class FeaturesManager:
"question-answering"
,
onnx_config_cls
=
"models.mobilebert.MobileBertOnnxConfig"
,
),
"mobilenet
_
v1"
:
supported_features_mapping
(
"mobilenet
-
v1"
:
supported_features_mapping
(
"default"
,
"image-classification"
,
onnx_config_cls
=
"models.mobilenet_v1.MobileNetV1OnnxConfig"
,
),
"mobilenet
_
v2"
:
supported_features_mapping
(
"mobilenet
-
v2"
:
supported_features_mapping
(
"default"
,
"image-classification"
,
onnx_config_cls
=
"models.mobilenet_v2.MobileNetV2OnnxConfig"
,
...
...
tests/onnx/test_onnx_v2.py
View file @
52dd2b61
...
...
@@ -272,7 +272,12 @@ def _get_models_to_test(export_models_list):
feature
:
FeaturesManager
.
get_config
(
name
,
feature
)
for
_
in
features
for
feature
in
_
}
else
:
feature_config_mapping
=
FeaturesManager
.
get_supported_features_for_model_type
(
name
)
# pre-process the model names
model_type
=
name
.
replace
(
"_"
,
"-"
)
model_name
=
getattr
(
model
,
"name"
,
""
)
feature_config_mapping
=
FeaturesManager
.
get_supported_features_for_model_type
(
model_type
,
model_name
=
model_name
)
for
feature
,
onnx_config_class_constructor
in
feature_config_mapping
.
items
():
models_to_test
.
append
((
f
"
{
name
}
_
{
feature
}
"
,
name
,
model
,
feature
,
onnx_config_class_constructor
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment