[tests] remove tests from libraries with deprecated support (flax, tensorflow_text, ...) (#39051)

* rm tf/flax tests

* more flax deletions

* revert fixture change

* reverted test that should not be deleted; rm tf/flax test

* revert

* fix a few add-model-like tests

* fix add-model-like checkpoint source

* a few more

* test_get_model_files_only_pt fix

* fix test_retrieve_info_for_model_with_xxx

* fix test_retrieve_model_classes

* relative paths are the devil

* add todo
This commit is contained in:
Joao Gante
2025-06-26 16:25:00 +01:00
committed by GitHub
parent cfff7ca9a2
commit 3e5cc12855
16 changed files with 156 additions and 691 deletions

View File

@@ -17,16 +17,13 @@ import unittest
import numpy as np
from parameterized import parameterized
from transformers.testing_utils import require_flax, require_torch, require_vision
from transformers.utils.import_utils import is_flax_available, is_torch_available, is_vision_available
from transformers.testing_utils import require_torch, require_vision
from transformers.utils.import_utils import is_torch_available, is_vision_available
if is_torch_available():
import torch
if is_flax_available():
import jax
if is_vision_available():
import PIL.Image
@@ -133,21 +130,6 @@ class ImageTransformsTester(unittest.TestCase):
self.assertIsInstance(pil_image, PIL.Image.Image)
self.assertEqual(pil_image.size, (5, 4))
@require_flax
def test_to_pil_image_from_jax(self):
key = jax.random.PRNGKey(0)
# channel first
image = jax.random.uniform(key, (3, 4, 5))
pil_image = to_pil_image(image)
self.assertIsInstance(pil_image, PIL.Image.Image)
self.assertEqual(pil_image.size, (5, 4))
# channel last
image = jax.random.uniform(key, (4, 5, 3))
pil_image = to_pil_image(image)
self.assertIsInstance(pil_image, PIL.Image.Image)
self.assertEqual(pil_image.size, (5, 4))
def test_to_channel_dimension_format(self):
# Test that function doesn't reorder if channel dim matches the input.
image = np.random.rand(3, 4, 5)