enable blip2 and emu3 cases on XPU (#37662)
* enable blip2 and emu3 modeling cases on XPU Signed-off-by: YAO Matrix <matrix.yao@intel.com> * fix style Signed-off-by: YAO Matrix <matrix.yao@intel.com> * remove extra new line Signed-off-by: YAO Matrix <matrix.yao@intel.com> * update --------- Signed-off-by: YAO Matrix <matrix.yao@intel.com> Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
@@ -27,7 +27,6 @@ from transformers.testing_utils import (
|
||||
require_torch,
|
||||
require_torch_accelerator,
|
||||
require_torch_fp16,
|
||||
require_torch_gpu,
|
||||
require_torch_multi_accelerator,
|
||||
require_torch_sdpa,
|
||||
require_vision,
|
||||
@@ -1400,7 +1399,7 @@ class Blip2VisionModelWithProjectionTest(ModelTesterMixin, unittest.TestCase):
|
||||
self.assertListEqual(arg_names[: len(expected_arg_names)], expected_arg_names)
|
||||
|
||||
@slow
|
||||
@require_torch_gpu
|
||||
@require_torch_accelerator
|
||||
def test_model_from_pretrained(self):
|
||||
model_name = "Salesforce/blip2-itm-vit-g"
|
||||
model = Blip2VisionModelWithProjection.from_pretrained(model_name)
|
||||
@@ -1551,7 +1550,7 @@ class Blip2TextRetrievalModelTest(ModelTesterMixin, unittest.TestCase):
|
||||
self.assertDictEqual(config.qformer_config.to_dict(), qformer_config.to_dict())
|
||||
|
||||
@slow
|
||||
@require_torch_gpu
|
||||
@require_torch_accelerator
|
||||
def test_model_from_pretrained(self):
|
||||
model_name = "Salesforce/blip2-itm-vit-g"
|
||||
model = Blip2ForImageTextRetrieval.from_pretrained(model_name)
|
||||
|
||||
Reference in New Issue
Block a user