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:
@@ -22,8 +22,8 @@ import tempfile
|
||||
import unittest
|
||||
|
||||
import numpy as np
|
||||
|
||||
import requests
|
||||
|
||||
from transformers import GroupViTConfig, GroupViTTextConfig, GroupViTVisionConfig
|
||||
from transformers.testing_utils import is_pt_tf_cross_test, require_torch, require_vision, slow, torch_device
|
||||
from transformers.utils import is_torch_available, is_vision_available
|
||||
@@ -432,7 +432,6 @@ class GroupViTTextModelTester:
|
||||
|
||||
@require_torch
|
||||
class GroupViTTextModelTest(ModelTesterMixin, unittest.TestCase):
|
||||
|
||||
all_model_classes = (GroupViTTextModel,) if is_torch_available() else ()
|
||||
test_pruning = False
|
||||
test_head_masking = False
|
||||
@@ -475,7 +474,6 @@ class GroupViTTextModelTest(ModelTesterMixin, unittest.TestCase):
|
||||
|
||||
class GroupViTModelTester:
|
||||
def __init__(self, parent, text_kwargs=None, vision_kwargs=None, is_training=True):
|
||||
|
||||
if text_kwargs is None:
|
||||
text_kwargs = {}
|
||||
if vision_kwargs is None:
|
||||
|
||||
@@ -23,8 +23,8 @@ import unittest
|
||||
from importlib import import_module
|
||||
|
||||
import numpy as np
|
||||
|
||||
import requests
|
||||
|
||||
from transformers import GroupViTConfig, GroupViTTextConfig, GroupViTVisionConfig
|
||||
from transformers.testing_utils import (
|
||||
is_pt_tf_cross_test,
|
||||
@@ -96,7 +96,6 @@ class TFGroupViTVisionModelTester:
|
||||
self.seq_length = num_patches
|
||||
|
||||
def prepare_config_and_inputs(self):
|
||||
|
||||
rng = random.Random(0)
|
||||
pixel_values = floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size], rng=rng)
|
||||
config = self.get_config()
|
||||
@@ -452,7 +451,6 @@ class TFGroupViTTextModelTester:
|
||||
|
||||
@require_tf
|
||||
class TFGroupViTTextModelTest(TFModelTesterMixin, unittest.TestCase):
|
||||
|
||||
all_model_classes = (TFGroupViTTextModel,) if is_tf_available() else ()
|
||||
test_pruning = False
|
||||
test_head_masking = False
|
||||
|
||||
Reference in New Issue
Block a user