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:
@@ -29,6 +29,7 @@ from ...test_modeling_flax_common import FlaxModelTesterMixin, floats_tensor, id
|
||||
if is_flax_available():
|
||||
import jax
|
||||
import jax.numpy as jnp
|
||||
|
||||
from transformers.modeling_flax_pytorch_utils import (
|
||||
convert_pytorch_state_dict_to_flax,
|
||||
load_flax_weights_in_pytorch_model,
|
||||
@@ -189,7 +190,6 @@ class FlaxGPT2ModelTester:
|
||||
|
||||
@require_flax
|
||||
class FlaxGPT2ModelTest(FlaxModelTesterMixin, FlaxGenerationTesterMixin, unittest.TestCase):
|
||||
|
||||
all_model_classes = (FlaxGPT2Model, FlaxGPT2LMHeadModel) if is_flax_available() else ()
|
||||
all_generative_model_classes = (FlaxGPT2LMHeadModel,) if is_flax_available() else ()
|
||||
|
||||
|
||||
@@ -430,7 +430,6 @@ class GPT2ModelTester:
|
||||
|
||||
@require_torch
|
||||
class GPT2ModelTest(ModelTesterMixin, GenerationTesterMixin, unittest.TestCase):
|
||||
|
||||
all_model_classes = (
|
||||
(GPT2Model, GPT2LMHeadModel, GPT2DoubleHeadsModel, GPT2ForSequenceClassification, GPT2ForTokenClassification)
|
||||
if is_torch_available()
|
||||
|
||||
@@ -355,7 +355,6 @@ class TFGPT2ModelTester:
|
||||
|
||||
@require_tf
|
||||
class TFGPT2ModelTest(TFModelTesterMixin, TFCoreModelTesterMixin, unittest.TestCase):
|
||||
|
||||
all_model_classes = (
|
||||
(TFGPT2Model, TFGPT2LMHeadModel, TFGPT2ForSequenceClassification, TFGPT2DoubleHeadsModel)
|
||||
if is_tf_available()
|
||||
@@ -439,7 +438,6 @@ class TFGPT2ModelTest(TFModelTesterMixin, TFCoreModelTesterMixin, unittest.TestC
|
||||
config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common()
|
||||
|
||||
for model_class in self.all_model_classes:
|
||||
|
||||
# Skip these 2 classes which uses `tf.gather` with `batch_dims=1`
|
||||
if model_class in [TFGPT2ForSequenceClassification, TFGPT2DoubleHeadsModel]:
|
||||
continue
|
||||
|
||||
@@ -27,7 +27,6 @@ from ...test_tokenization_common import TokenizerTesterMixin
|
||||
|
||||
@require_tokenizers
|
||||
class GPT2TokenizationTest(TokenizerTesterMixin, unittest.TestCase):
|
||||
|
||||
tokenizer_class = GPT2Tokenizer
|
||||
rust_tokenizer_class = GPT2TokenizerFast
|
||||
test_rust_tokenizer = True
|
||||
|
||||
@@ -28,7 +28,6 @@ if is_tf_available():
|
||||
|
||||
@tf.function(input_signature=(tf.TensorSpec((None,), tf.string, name="text"),))
|
||||
def serving(self, text):
|
||||
|
||||
tokenized = self.tokenizer(text)
|
||||
input_ids_dense = tokenized["input_ids"].to_tensor()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user