Fix TF nightly tests (#20507)

* Fixed test_saved_model_extended

* Fix TFGPT2 tests

* make fixup

* Make sure keras-nlp utils are available for type hinting too

* Update src/transformers/testing_utils.py

Co-authored-by: Yih-Dar <2521628+ydshieh@users.noreply.github.com>

* make fixup

Co-authored-by: Yih-Dar <2521628+ydshieh@users.noreply.github.com>
This commit is contained in:
Matt
2022-11-30 14:47:54 +00:00
committed by GitHub
parent 761b3fad92
commit afad0c18d9
4 changed files with 22 additions and 6 deletions

View File

@@ -57,6 +57,7 @@ from .utils import (
is_ftfy_available,
is_ipex_available,
is_jumanpp_available,
is_keras_nlp_available,
is_librosa_available,
is_natten_available,
is_onnx_available,
@@ -392,6 +393,13 @@ def require_tensorflow_text(test_case):
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.
"""
return unittest.skipUnless(is_keras_nlp_available(), "test requires keras_nlp")(test_case)
def require_pandas(test_case):
"""
Decorator marking a test that requires pandas. These tests are skipped when pandas isn't installed.