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
2a337346
Unverified
Commit
2a337346
authored
Dec 21, 2021
by
Sylvain Gugger
Committed by
GitHub
Dec 21, 2021
Browse files
Make the onnx submodule init lazy (#14855)
* Use lazy init for onnx submodule * Remove debug statements
parent
b6ec9569
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
src/transformers/onnx/__init__.py
src/transformers/onnx/__init__.py
+21
-3
No files found.
src/transformers/onnx/__init__.py
View file @
2a337346
...
...
@@ -13,6 +13,24 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
.config
import
EXTERNAL_DATA_FORMAT_SIZE_LIMIT
,
OnnxConfig
,
OnnxConfigWithPast
,
PatchingSpec
from
.convert
import
export
,
validate_model_outputs
from
.utils
import
ParameterFormat
,
compute_serialized_parameters_size
from
typing
import
TYPE_CHECKING
from
..file_utils
import
_LazyModule
_import_structure
=
{
"config"
:
[
"EXTERNAL_DATA_FORMAT_SIZE_LIMIT"
,
"OnnxConfig"
,
"OnnxConfigWithPast"
,
"PatchingSpec"
],
"convert"
:
[
"export"
,
"validate_model_outputs"
],
"utils"
:
[
"ParameterFormat"
,
"compute_serialized_parameters_size"
],
}
if
TYPE_CHECKING
:
from
.config
import
EXTERNAL_DATA_FORMAT_SIZE_LIMIT
,
OnnxConfig
,
OnnxConfigWithPast
,
PatchingSpec
from
.convert
import
export
,
validate_model_outputs
from
.utils
import
ParameterFormat
,
compute_serialized_parameters_size
else
:
import
sys
sys
.
modules
[
__name__
]
=
_LazyModule
(
__name__
,
globals
()[
"__file__"
],
_import_structure
)
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