Update quality tooling for formatting (#21480)
* Result of black 23.1 * Update target to Python 3.7 * Switch flake8 to ruff * Configure isort * Configure isort * Apply isort with line limit * Put the right black version * adapt black in check copies * Fix copies
This commit is contained in:
@@ -129,7 +129,6 @@ class LxmertModelTester:
|
||||
self.num_hidden_layers = {"vision": r_layers, "cross_encoder": x_layers, "language": l_layers}
|
||||
|
||||
def prepare_config_and_inputs(self):
|
||||
|
||||
output_attentions = self.output_attentions
|
||||
input_ids = ids_tensor([self.batch_size, self.seq_length], vocab_size=self.vocab_size)
|
||||
visual_feats = torch.rand(self.batch_size, self.num_visual_features, self.visual_feat_dim, device=torch_device)
|
||||
@@ -412,7 +411,6 @@ class LxmertModelTester:
|
||||
ans,
|
||||
output_attentions,
|
||||
):
|
||||
|
||||
start_labels = config.num_qa_labels
|
||||
num_large_labels = config.num_qa_labels * 2
|
||||
num_small_labels = int(config.num_qa_labels * 2)
|
||||
@@ -532,7 +530,6 @@ class LxmertModelTester:
|
||||
|
||||
@require_torch
|
||||
class LxmertModelTest(ModelTesterMixin, unittest.TestCase):
|
||||
|
||||
all_model_classes = (LxmertModel, LxmertForPreTraining, LxmertForQuestionAnswering) if is_torch_available() else ()
|
||||
|
||||
fx_compatible = True
|
||||
@@ -741,7 +738,6 @@ class LxmertModelTest(ModelTesterMixin, unittest.TestCase):
|
||||
self.assertIsNotNone(attentions_vision.grad)
|
||||
|
||||
def prepare_tf_inputs_from_pt_inputs(self, pt_inputs_dict):
|
||||
|
||||
tf_inputs_dict = {}
|
||||
for key, value in pt_inputs_dict.items():
|
||||
# skip key that does not exist in tf
|
||||
|
||||
@@ -364,7 +364,6 @@ class TFLxmertModelTester(object):
|
||||
|
||||
@require_tf
|
||||
class TFLxmertModelTest(TFModelTesterMixin, unittest.TestCase):
|
||||
|
||||
all_model_classes = (TFLxmertModel, TFLxmertForPreTraining) if is_tf_available() else ()
|
||||
test_head_masking = False
|
||||
test_onnx = False
|
||||
@@ -493,7 +492,6 @@ class TFLxmertModelTest(TFModelTesterMixin, unittest.TestCase):
|
||||
|
||||
pt_inputs_dict = {}
|
||||
for key, value in tf_inputs_dict.items():
|
||||
|
||||
if isinstance(value, dict):
|
||||
pt_inputs_dict[key] = self.prepare_pt_inputs_from_tf_inputs(value)
|
||||
elif isinstance(value, (list, tuple)):
|
||||
|
||||
@@ -26,7 +26,6 @@ from ...test_tokenization_common import TokenizerTesterMixin
|
||||
|
||||
@require_tokenizers
|
||||
class LxmertTokenizationTest(TokenizerTesterMixin, unittest.TestCase):
|
||||
|
||||
tokenizer_class = LxmertTokenizer
|
||||
rust_tokenizer_class = LxmertTokenizerFast
|
||||
test_rust_tokenizer = True
|
||||
|
||||
Reference in New Issue
Block a user