Unverified Commit 4879ac2b authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Avoid failure `TFBlipModelTest::test_pipeline_image_to_text` (#31827)



* fix

* fix

* fix

---------
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent ba743700
...@@ -215,6 +215,12 @@ class EfficientNetModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.Test ...@@ -215,6 +215,12 @@ class EfficientNetModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.Test
def test_pipeline_image_feature_extraction(self): def test_pipeline_image_feature_extraction(self):
super().test_pipeline_image_feature_extraction() super().test_pipeline_image_feature_extraction()
@is_pipeline_test
@require_vision
@slow
def test_pipeline_image_feature_extraction_fp16(self):
super().test_pipeline_image_feature_extraction_fp16()
@is_pipeline_test @is_pipeline_test
@require_vision @require_vision
@slow @slow
......
...@@ -181,6 +181,10 @@ class VitsModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCase): ...@@ -181,6 +181,10 @@ class VitsModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCase):
def test_pipeline_feature_extraction(self): def test_pipeline_feature_extraction(self):
super().test_pipeline_feature_extraction() super().test_pipeline_feature_extraction()
@is_flaky(description="torch 2.2.0 gives `Timeout >120.0s`")
def test_pipeline_feature_extraction_fp16(self):
super().test_pipeline_feature_extraction_fp16()
@unittest.skip(reason="Need to fix this after #26538") @unittest.skip(reason="Need to fix this after #26538")
def test_model_forward(self): def test_model_forward(self):
set_seed(12345) set_seed(12345)
......
...@@ -17,7 +17,7 @@ import unittest ...@@ -17,7 +17,7 @@ import unittest
import requests import requests
from transformers import MODEL_FOR_VISION_2_SEQ_MAPPING, TF_MODEL_FOR_VISION_2_SEQ_MAPPING, is_vision_available from transformers import MODEL_FOR_VISION_2_SEQ_MAPPING, TF_MODEL_FOR_VISION_2_SEQ_MAPPING, is_vision_available
from transformers.pipelines import pipeline from transformers.pipelines import ImageToTextPipeline, pipeline
from transformers.testing_utils import ( from transformers.testing_utils import (
is_pipeline_test, is_pipeline_test,
require_tf, require_tf,
...@@ -46,8 +46,8 @@ class ImageToTextPipelineTests(unittest.TestCase): ...@@ -46,8 +46,8 @@ class ImageToTextPipelineTests(unittest.TestCase):
tf_model_mapping = TF_MODEL_FOR_VISION_2_SEQ_MAPPING tf_model_mapping = TF_MODEL_FOR_VISION_2_SEQ_MAPPING
def get_test_pipeline(self, model, tokenizer, processor, torch_dtype="float32"): def get_test_pipeline(self, model, tokenizer, processor, torch_dtype="float32"):
pipe = pipeline( pipe = ImageToTextPipeline(
"image-to-text", model=model, tokenizer=tokenizer, image_processor=processor, torch_dtype=torch_dtype model=model, tokenizer=tokenizer, image_processor=processor, torch_dtype=torch_dtype
) )
examples = [ examples = [
Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"), Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment