Skip to content

Commit

Permalink
fix quality
Browse files Browse the repository at this point in the history
  • Loading branch information
ydshieh committed Sep 7, 2022
1 parent df1147d commit 8f0b546
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 27 deletions.
8 changes: 1 addition & 7 deletions tests/models/donut/test_modeling_donut_swin.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@

import collections
import inspect
import os
import pickle
import tempfile
import unittest

from transformers import DonutSwinConfig
from transformers.testing_utils import require_torch, slow, torch_device
from transformers.utils import is_torch_available, is_torch_fx_available
from transformers.utils import is_torch_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, _config_zero_init, floats_tensor, ids_tensor
Expand All @@ -36,9 +33,6 @@
from transformers import DonutSwinModel
from transformers.models.donut.modeling_donut_swin import DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST

if is_torch_fx_available():
from transformers.utils.fx import symbolic_trace


class DonutSwinModelTester:
def __init__(
Expand Down
6 changes: 1 addition & 5 deletions tests/models/speech_to_text/test_modeling_speech_to_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import copy
import inspect
import os
import pickle
import tempfile
import unittest

Expand All @@ -31,7 +30,7 @@
slow,
torch_device,
)
from transformers.utils import cached_property, is_torch_fx_available
from transformers.utils import cached_property

from ...generation.test_generation_utils import GenerationTesterMixin
from ...test_configuration_common import ConfigTester
Expand All @@ -44,9 +43,6 @@
from transformers import Speech2TextForConditionalGeneration, Speech2TextModel, Speech2TextProcessor
from transformers.models.speech_to_text.modeling_speech_to_text import Speech2TextDecoder, Speech2TextEncoder

if is_torch_fx_available():
from transformers.utils.fx import symbolic_trace


def prepare_speech_to_text_inputs_dict(
config,
Expand Down
8 changes: 1 addition & 7 deletions tests/models/swin/test_modeling_swin.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@

import collections
import inspect
import os
import pickle
import tempfile
import unittest

from transformers import SwinConfig
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_torch_fx_available, is_vision_available
from transformers.utils import cached_property, is_torch_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, _config_zero_init, floats_tensor, ids_tensor
Expand All @@ -41,9 +38,6 @@

from transformers import AutoFeatureExtractor

if is_torch_fx_available():
from transformers.utils.fx import symbolic_trace


class SwinModelTester:
def __init__(
Expand Down
8 changes: 0 additions & 8 deletions tests/models/xglm/test_modeling_xglm.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,15 @@

import datetime
import math
import os
import pickle
import tempfile
import unittest

from transformers import XGLMConfig, is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device
from transformers.utils import is_torch_fx_available

from ...generation.test_generation_utils import GenerationTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import (
ModelTesterMixin,
_config_zero_init,
floats_tensor,
ids_tensor,
random_attention_mask,
Expand All @@ -40,9 +35,6 @@

from transformers import XGLM_PRETRAINED_MODEL_ARCHIVE_LIST, XGLMForCausalLM, XGLMModel, XGLMTokenizer

if is_torch_fx_available():
from transformers.utils.fx import symbolic_trace


class XGLMModelTester:
def __init__(
Expand Down

0 comments on commit 8f0b546

Please sign in to comment.