Au revoir flaky test_fast_is_faster_than_slow (#36240)

* fix

* fix

* fix

---------

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
Yih-Dar
2025-02-17 18:30:07 +01:00
committed by GitHub
parent 429f1a682d
commit 626666c444
2 changed files with 22 additions and 4 deletions

View File

@@ -16,7 +16,14 @@ import unittest
import requests
from transformers.testing_utils import require_torch, require_torch_gpu, require_torchvision, require_vision, slow
from transformers.testing_utils import (
is_flaky,
require_torch,
require_torch_gpu,
require_torchvision,
require_vision,
slow,
)
from transformers.utils import is_torch_available, is_torchvision_available, is_vision_available
from ...test_image_processing_common import ImageProcessingTestMixin, prepare_image_inputs
@@ -427,3 +434,9 @@ class RtDetrImageProcessingTest(ImageProcessingTestMixin, unittest.TestCase):
)
# verify size
torch.testing.assert_close(encoding_cpu["labels"][0]["size"], encoding_gpu["labels"][0]["size"].to("cpu"))
@is_flaky(
description="Still flaky with a failing ratio of ~0.6% after #36240",
)
def test_fast_is_faster_than_slow(self):
super().test_fast_is_faster_than_slow()