mark test_initialization as flaky in 2 model tests (#27906)
fix Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
@@ -19,6 +19,7 @@ import unittest
|
||||
|
||||
from transformers import Dinov2Config
|
||||
from transformers.testing_utils import (
|
||||
is_flaky,
|
||||
require_torch,
|
||||
require_vision,
|
||||
slow,
|
||||
@@ -230,6 +231,10 @@ class Dinov2ModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCase):
|
||||
self.model_tester = Dinov2ModelTester(self)
|
||||
self.config_tester = ConfigTester(self, config_class=Dinov2Config, has_text_modality=False, hidden_size=37)
|
||||
|
||||
@is_flaky(max_attempts=3, description="`torch.nn.init.trunc_normal_` is flaky.")
|
||||
def test_initialization(self):
|
||||
super().test_initialization()
|
||||
|
||||
def test_config(self):
|
||||
self.config_tester.run_common_tests()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user