Unverified Commit 19420fd9 authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Move test model folders (#17034)



* move test model folders (TODO: fix imports and others)

* fix (potentially partially) imports (in model test modules)

* fix (potentially partially) imports (in tokenization test modules)

* fix (potentially partially) imports (in feature extraction test modules)

* fix import utils.test_modeling_tf_core

* fix path ../fixtures/

* fix imports about generation.test_generation_flax_utils

* fix more imports

* fix fixture path

* fix get_test_dir

* update module_to_test_file

* fix get_tests_dir from wrong transformers.utils

* update config.yml (CircleCI)

* fix style

* remove missing imports

* update new model script

* update check_repo

* update SPECIAL_MODULE_TO_TEST_MAP

* fix style

* add __init__

* update self-scheduled

* fix add_new_model scripts

* check one way to get location back

* python setup.py build install

* fix import in test auto

* update self-scheduled.yml

* update slack notification script

* Add comments about artifact names

* fix for yolos
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent cd9274d0
...@@ -21,9 +21,9 @@ from transformers import BlenderbotSmallConfig, is_torch_available ...@@ -21,9 +21,9 @@ from transformers import BlenderbotSmallConfig, is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device from transformers.testing_utils import require_torch, slow, torch_device
from transformers.utils import cached_property from transformers.utils import cached_property
from ..generation.test_generation_utils import GenerationTesterMixin from ...generation.test_generation_utils import GenerationTesterMixin
from ..test_configuration_common import ConfigTester from ...test_configuration_common import ConfigTester
from ..test_modeling_common import ModelTesterMixin, ids_tensor from ...test_modeling_common import ModelTesterMixin, ids_tensor
if is_torch_available(): if is_torch_available():
......
...@@ -20,8 +20,8 @@ import timeout_decorator # noqa ...@@ -20,8 +20,8 @@ import timeout_decorator # noqa
from transformers import BlenderbotSmallConfig, is_flax_available from transformers import BlenderbotSmallConfig, is_flax_available
from transformers.testing_utils import require_flax, slow from transformers.testing_utils import require_flax, slow
from ..generation.test_generation_flax_utils import FlaxGenerationTesterMixin from ...generation.test_generation_flax_utils import FlaxGenerationTesterMixin
from ..test_modeling_flax_common import FlaxModelTesterMixin, ids_tensor from ...test_modeling_flax_common import FlaxModelTesterMixin, ids_tensor
if is_flax_available(): if is_flax_available():
......
...@@ -20,8 +20,8 @@ from transformers import BlenderbotSmallConfig, BlenderbotSmallTokenizer, is_tf_ ...@@ -20,8 +20,8 @@ from transformers import BlenderbotSmallConfig, BlenderbotSmallTokenizer, is_tf_
from transformers.testing_utils import require_tf, require_tokenizers, slow from transformers.testing_utils import require_tf, require_tokenizers, slow
from transformers.utils import cached_property from transformers.utils import cached_property
from ..test_configuration_common import ConfigTester from ...test_configuration_common import ConfigTester
from ..test_modeling_tf_common import TFModelTesterMixin, ids_tensor from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor
if is_tf_available(): if is_tf_available():
......
...@@ -23,7 +23,7 @@ from transformers.models.blenderbot_small.tokenization_blenderbot_small import ( ...@@ -23,7 +23,7 @@ from transformers.models.blenderbot_small.tokenization_blenderbot_small import (
BlenderbotSmallTokenizer, BlenderbotSmallTokenizer,
) )
from ..test_tokenization_common import TokenizerTesterMixin from ...test_tokenization_common import TokenizerTesterMixin
class BlenderbotSmallTokenizerTest(TokenizerTesterMixin, unittest.TestCase): class BlenderbotSmallTokenizerTest(TokenizerTesterMixin, unittest.TestCase):
......
...@@ -24,7 +24,7 @@ from typing import Tuple ...@@ -24,7 +24,7 @@ from typing import Tuple
from transformers import AddedToken, BatchEncoding, ByT5Tokenizer from transformers import AddedToken, BatchEncoding, ByT5Tokenizer
from transformers.utils import cached_property, is_tf_available, is_torch_available from transformers.utils import cached_property, is_tf_available, is_torch_available
from ..test_tokenization_common import TokenizerTesterMixin from ...test_tokenization_common import TokenizerTesterMixin
if is_torch_available(): if is_torch_available():
......
...@@ -13,19 +13,17 @@ ...@@ -13,19 +13,17 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import os
import unittest import unittest
from os.path import dirname
from transformers import CamembertTokenizer, CamembertTokenizerFast from transformers import CamembertTokenizer, CamembertTokenizerFast
from transformers.testing_utils import require_sentencepiece, require_tokenizers, slow from transformers.testing_utils import get_tests_dir, require_sentencepiece, require_tokenizers, slow
from transformers.utils import is_torch_available from transformers.utils import is_torch_available
from ..test_tokenization_common import TokenizerTesterMixin from ...test_tokenization_common import TokenizerTesterMixin
SAMPLE_VOCAB = os.path.join(dirname(dirname(os.path.abspath(__file__))), "fixtures/test_sentencepiece.model") SAMPLE_VOCAB = get_tests_dir("fixtures/test_sentencepiece.model")
SAMPLE_BPE_VOCAB = os.path.join(dirname(dirname(os.path.abspath(__file__))), "fixtures/test_sentencepiece_bpe.model") SAMPLE_BPE_VOCAB = get_tests_dir("fixtures/test_sentencepiece_bpe.model")
FRAMEWORK = "pt" if is_torch_available() else "tf" FRAMEWORK = "pt" if is_torch_available() else "tf"
......
...@@ -21,8 +21,8 @@ from typing import List, Tuple ...@@ -21,8 +21,8 @@ from typing import List, Tuple
from transformers import CanineConfig, is_torch_available from transformers import CanineConfig, is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device from transformers.testing_utils import require_torch, slow, torch_device
from ..test_configuration_common import ConfigTester from ...test_configuration_common import ConfigTester
from ..test_modeling_common import ModelTesterMixin, _config_zero_init, global_rng, ids_tensor, random_attention_mask from ...test_modeling_common import ModelTesterMixin, _config_zero_init, global_rng, ids_tensor, random_attention_mask
if is_torch_available(): if is_torch_available():
......
...@@ -24,7 +24,7 @@ from transformers.testing_utils import require_tokenizers, require_torch ...@@ -24,7 +24,7 @@ from transformers.testing_utils import require_tokenizers, require_torch
from transformers.tokenization_utils import AddedToken from transformers.tokenization_utils import AddedToken
from transformers.utils import cached_property from transformers.utils import cached_property
from ..test_tokenization_common import TokenizerTesterMixin from ...test_tokenization_common import TokenizerTesterMixin
class CanineTokenizationTest(TokenizerTesterMixin, unittest.TestCase): class CanineTokenizationTest(TokenizerTesterMixin, unittest.TestCase):
......
...@@ -21,7 +21,7 @@ import numpy as np ...@@ -21,7 +21,7 @@ import numpy as np
from transformers.testing_utils import require_torch, require_vision from transformers.testing_utils import require_torch, require_vision
from transformers.utils import is_torch_available, is_vision_available from transformers.utils import is_torch_available, is_vision_available
from ..test_feature_extraction_common import FeatureExtractionSavingTestMixin from ...test_feature_extraction_common import FeatureExtractionSavingTestMixin
if is_torch_available(): if is_torch_available():
......
...@@ -35,8 +35,8 @@ from transformers.testing_utils import ( ...@@ -35,8 +35,8 @@ from transformers.testing_utils import (
) )
from transformers.utils import is_torch_available, is_vision_available from transformers.utils import is_torch_available, is_vision_available
from ..test_configuration_common import ConfigTester from ...test_configuration_common import ConfigTester
from ..test_modeling_common import ( from ...test_modeling_common import (
ModelTesterMixin, ModelTesterMixin,
_config_zero_init, _config_zero_init,
floats_tensor, floats_tensor,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment