Skip to content

Commit

Permalink
Fix failing tests, remove integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
Niels Rogge authored and Niels Rogge committed Aug 10, 2022
1 parent 2af516f commit 28e6cc4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/transformers/utils/fx.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def _generate_supported_model_class_names(
"deberta",
"deberta-v2",
"distilbert",
"donut",
"donut-swin",
"electra",
"gpt2",
"gpt_neo",
Expand Down
4 changes: 2 additions & 2 deletions tests/models/donut/test_feature_extraction_donut.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def prepare_feat_extract_dict(self):
"do_pad": self.do_pad,
"do_normalize": self.do_normalize,
"image_mean": self.image_mean,
"image_std": self.image_std,
"image_std": self.image_std,
}


Expand Down Expand Up @@ -196,4 +196,4 @@ def test_call_pytorch(self):
self.feature_extract_tester.size[1],
self.feature_extract_tester.size[0],
),
)
)
19 changes: 2 additions & 17 deletions tests/models/donut/test_modeling_donut_swin.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import unittest

from transformers import DonutSwinConfig
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.testing_utils import require_torch, slow, torch_device
from transformers.utils import is_torch_available, is_torch_fx_available

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

if is_vision_available():
from transformers import AutoFeatureExtractor

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

Expand Down Expand Up @@ -465,15 +462,3 @@ def flatten_output(output):
torch.allclose(model_output[i], loaded_output[i]),
f"serialized model {i}th output doesn't match model {i}th output for {model_class}",
)


@require_vision
@require_torch
class DonutSwinModelIntegrationTest(unittest.TestCase):
@cached_property
def default_feature_extractor(self):
return AutoFeatureExtractor.from_pretrained("naver-clova-ix/donut-base") if is_vision_available() else None

@slow
def test_inference_image_classification_head(self):
raise NotImplementedError("To do")

0 comments on commit 28e6cc4

Please sign in to comment.