make style (#11442)
This commit is contained in:
committed by
GitHub
parent
04ab2ca639
commit
32dbb2d954
@@ -122,7 +122,7 @@ class TrainerIntegrationDeepSpeed(TestCasePlus, TrainerIntegrationCommon):
|
||||
transformers.integrations._is_deepspeed_zero3_enabled = None
|
||||
|
||||
def get_config_dict(self, stage):
|
||||
""" As the tests modify the dict, always make a copy """
|
||||
"""As the tests modify the dict, always make a copy"""
|
||||
config = deepcopy(self.ds_config_dict[stage])
|
||||
if stage == ZERO3:
|
||||
# This setting slows things down, so don't enable it by default unless needed by a test.
|
||||
@@ -430,7 +430,7 @@ class TrainerIntegrationDeepSpeed(TestCasePlus, TrainerIntegrationCommon):
|
||||
@require_deepspeed
|
||||
@require_torch_gpu
|
||||
class TestDeepSpeedWithLauncher(TestCasePlus):
|
||||
""" This class is for testing via an external script - can do multiple gpus """
|
||||
"""This class is for testing via an external script - can do multiple gpus"""
|
||||
|
||||
# Tests to devise #
|
||||
#
|
||||
|
||||
@@ -1122,7 +1122,7 @@ class ModelTesterMixin:
|
||||
|
||||
# a candidate for testing_utils
|
||||
def get_current_gpu_memory_use():
|
||||
""" returns a list of cuda memory allocations per GPU in MBs"""
|
||||
"""returns a list of cuda memory allocations per GPU in MBs"""
|
||||
|
||||
per_device_memory = []
|
||||
for id in range(torch.cuda.device_count()):
|
||||
|
||||
@@ -42,7 +42,7 @@ if is_torch_available():
|
||||
|
||||
|
||||
class FunnelModelTester:
|
||||
"""You can also import this e.g, from .test_modeling_funnel import FunnelModelTester """
|
||||
"""You can also import this e.g, from .test_modeling_funnel import FunnelModelTester"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
@@ -36,7 +36,7 @@ if is_torch_available():
|
||||
|
||||
|
||||
class LayoutLMModelTester:
|
||||
"""You can also import this e.g from .test_modeling_layoutlm import LayoutLMModelTester """
|
||||
"""You can also import this e.g from .test_modeling_layoutlm import LayoutLMModelTester"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
@@ -40,7 +40,7 @@ if is_torch_available():
|
||||
|
||||
|
||||
class LxmertModelTester:
|
||||
"""You can also import this e.g from .test_modeling_bart import BartModelTester """
|
||||
"""You can also import this e.g from .test_modeling_bart import BartModelTester"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
@@ -63,7 +63,7 @@ if is_torch_available():
|
||||
|
||||
|
||||
class TapasModelTester:
|
||||
"""You can also import this e.g from .test_modeling_tapas import TapasModelTester """
|
||||
"""You can also import this e.g from .test_modeling_tapas import TapasModelTester"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
@@ -39,7 +39,7 @@ if is_tf_available():
|
||||
|
||||
|
||||
class TFFunnelModelTester:
|
||||
"""You can also import this e.g, from .test_modeling_funnel import FunnelModelTester """
|
||||
"""You can also import this e.g, from .test_modeling_funnel import FunnelModelTester"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
@@ -58,7 +58,7 @@ NON_ENGLISH_TAGS = ["chinese", "dutch", "french", "finnish", "german", "multilin
|
||||
|
||||
|
||||
def filter_non_english(_, pretrained_name: str):
|
||||
""" Filter all the model for non-english language """
|
||||
"""Filter all the model for non-english language"""
|
||||
return not any([lang in pretrained_name for lang in NON_ENGLISH_TAGS])
|
||||
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ class FSMTTokenizationTest(TokenizerTesterMixin, unittest.TestCase):
|
||||
self.assertEqual(tokenizer.tgt_vocab_size, 21)
|
||||
|
||||
def test_full_tokenizer(self):
|
||||
""" Adapted from Sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt """
|
||||
"""Adapted from Sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt"""
|
||||
tokenizer = FSMTTokenizer(self.langs, self.src_vocab_file, self.tgt_vocab_file, self.merges_file)
|
||||
|
||||
text = "lower"
|
||||
|
||||
@@ -70,5 +70,5 @@ class LayoutLMTokenizationTest(TokenizerTesterMixin, unittest.TestCase):
|
||||
self.assertListEqual(tokenizer.convert_tokens_to_ids(tokens), [7, 4, 5, 10, 8, 9])
|
||||
|
||||
def test_special_tokens_as_you_expect(self):
|
||||
"""If you are training a seq2seq model that expects a decoder_prefix token make sure it is prepended to decoder_input_ids """
|
||||
"""If you are training a seq2seq model that expects a decoder_prefix token make sure it is prepended to decoder_input_ids"""
|
||||
pass
|
||||
|
||||
@@ -72,7 +72,7 @@ class XLMTokenizationTest(TokenizerTesterMixin, unittest.TestCase):
|
||||
return input_text, output_text
|
||||
|
||||
def test_full_tokenizer(self):
|
||||
""" Adapted from Sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt """
|
||||
"""Adapted from Sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt"""
|
||||
tokenizer = XLMTokenizer(self.vocab_file, self.merges_file)
|
||||
|
||||
text = "lower"
|
||||
|
||||
Reference in New Issue
Block a user