Skip to content

Remove deprecated functions #40282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 0 additions & 56 deletions src/transformers/testing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,14 +523,6 @@ def require_jinja(test_case):
return unittest.skipUnless(is_jinja_available(), "test requires jinja")(test_case)


def require_tf2onnx(test_case):
logger.warning_once(
"TensorFlow test-related code, including `require_tf2onnx`, is deprecated and will be removed in "
"Transformers v4.55"
)
return unittest.skipUnless(is_tf2onnx_available(), "test requires tf2onnx")(test_case)


def require_onnx(test_case):
return unittest.skipUnless(is_onnx_available(), "test requires ONNX")(test_case)

Expand Down Expand Up @@ -725,49 +717,13 @@ def require_intel_extension_for_pytorch(test_case):
)(test_case)


def require_tensorflow_probability(test_case):
"""
Decorator marking a test that requires TensorFlow probability.

These tests are skipped when TensorFlow probability isn't installed.

"""
logger.warning_once(
"TensorFlow test-related code, including `require_tensorflow_probability`, is deprecated and will be "
"removed in Transformers v4.55"
)
return unittest.skipUnless(is_tensorflow_probability_available(), "test requires TensorFlow probability")(
test_case
)


def require_torchaudio(test_case):
"""
Decorator marking a test that requires torchaudio. These tests are skipped when torchaudio isn't installed.
"""
return unittest.skipUnless(is_torchaudio_available(), "test requires torchaudio")(test_case)


def require_tf(test_case):
"""
Decorator marking a test that requires TensorFlow. These tests are skipped when TensorFlow isn't installed.
"""
logger.warning_once(
"TensorFlow test-related code, including `require_tf`, is deprecated and will be removed in Transformers v4.55"
)
return unittest.skipUnless(is_tf_available(), "test requires TensorFlow")(test_case)


def require_flax(test_case):
"""
Decorator marking a test that requires JAX & Flax. These tests are skipped when one / both are not installed
"""
logger.warning_once(
"JAX test-related code, including `require_flax`, is deprecated and will be removed in Transformers v4.55"
)
return unittest.skipUnless(is_flax_available(), "test requires JAX & Flax")(test_case)


def require_sentencepiece(test_case):
"""
Decorator marking a test that requires SentencePiece. These tests are skipped when SentencePiece isn't installed.
Expand Down Expand Up @@ -803,18 +759,6 @@ def require_tokenizers(test_case):
return unittest.skipUnless(is_tokenizers_available(), "test requires tokenizers")(test_case)


def require_tensorflow_text(test_case):
"""
Decorator marking a test that requires tensorflow_text. These tests are skipped when tensroflow_text isn't
installed.
"""
logger.warning_once(
"TensorFlow test-related code, including `require_tensorflow_text`, is deprecated and will be "
"removed in Transformers v4.55"
)
return unittest.skipUnless(is_tensorflow_text_available(), "test requires tensorflow_text")(test_case)


def require_keras_nlp(test_case):
"""
Decorator marking a test that requires keras_nlp. These tests are skipped when keras_nlp isn't installed.
Expand Down