Add MBART to models exportable with ONNX (#13049)

* Add MBART to models exportable with ONNX

* unittest mock

* Add tests

* Misc fixes
This commit is contained in:
Lysandre Debut
2021-08-09 14:56:04 +02:00
committed by GitHub
parent 13a9c9a354
commit 6f5ab9daf1
5 changed files with 47 additions and 6 deletions

View File

@@ -25,6 +25,7 @@ from distutils.util import strtobool
from io import StringIO
from pathlib import Path
from typing import Iterator, Union
from unittest import mock
from transformers import logging as transformers_logging
@@ -1007,7 +1008,7 @@ def mockenv(**kwargs):
use_tf = os.getenv("USE_TF", False)
"""
return unittest.mock.patch.dict(os.environ, kwargs)
return mock.patch.dict(os.environ, kwargs)
# from https://stackoverflow.com/a/34333710/9201239