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:
Sylvain Gugger
2023-02-06 18:10:56 -05:00
committed by GitHub
parent b7bb2b59f7
commit 6f79d26442
1211 changed files with 1532 additions and 2687 deletions

View File

@@ -24,6 +24,7 @@ from ...test_modeling_flax_common import FlaxModelTesterMixin, ids_tensor, rando
if is_flax_available():
import jax.numpy as jnp
from transformers.models.roformer.modeling_flax_roformer import (
FlaxRoFormerForMaskedLM,
FlaxRoFormerForMultipleChoice,
@@ -116,7 +117,6 @@ class FlaxRoFormerModelTester(unittest.TestCase):
@require_flax
class FlaxRoFormerModelTest(FlaxModelTesterMixin, unittest.TestCase):
test_head_masking = True
all_model_classes = (

View File

@@ -361,7 +361,6 @@ class RoFormerModelTester:
@require_torch
class RoFormerModelTest(ModelTesterMixin, unittest.TestCase):
all_model_classes = (
(
RoFormerModel,
@@ -491,7 +490,6 @@ class RoFormerSinusoidalPositionalEmbeddingTest(unittest.TestCase):
)
def test_positional_emb_weights_against_roformer(self):
desired_weights = torch.tensor(
[
[0.0000, 0.0000, 0.0000, 0.0000, 0.0000],

View File

@@ -240,7 +240,6 @@ class TFRoFormerModelTester:
@require_tf
class TFRoFormerModelTest(TFModelTesterMixin, unittest.TestCase):
all_model_classes = (
(
TFRoFormerModel,
@@ -344,7 +343,6 @@ class TFRoFormerSinusoidalPositionalEmbeddingTest(unittest.TestCase):
tf.debugging.assert_near(emb, desired_weights, atol=self.tolerance)
def test_positional_emb_weights_against_roformer(self):
desired_weights = tf.constant(
[
[0.0000, 0.0000, 0.0000, 0.0000, 0.0000],

View File

@@ -24,7 +24,6 @@ from ...test_tokenization_common import TokenizerTesterMixin
@require_rjieba
@require_tokenizers
class RoFormerTokenizationTest(TokenizerTesterMixin, unittest.TestCase):
tokenizer_class = RoFormerTokenizer
rust_tokenizer_class = RoFormerTokenizerFast
space_between_special_tokens = True