mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-03 12:50:06 +06:00
update emu3 test (#38543)
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
This commit is contained in:
parent
55ec319de6
commit
814432423c
@ -537,7 +537,7 @@ class Emu3IntegrationTest(unittest.TestCase):
|
|||||||
)
|
)
|
||||||
self.assertTrue(out.shape[1] == 54)
|
self.assertTrue(out.shape[1] == 54)
|
||||||
|
|
||||||
image = model.decode_image_tokens(out[:, inputs.input_ids.shape[1] :], height=HEIGHT, width=WIDTH)
|
image = model.decode_image_tokens(image_tokens=out[:, inputs.input_ids.shape[1] :], height=HEIGHT, width=WIDTH)
|
||||||
images = processor.postprocess(list(image.float()), return_tensors="np")
|
images = processor.postprocess(list(image.float()), return_tensors="np")
|
||||||
self.assertTrue(images["pixel_values"].shape == (3, 40, 40))
|
self.assertTrue(images["pixel_values"].shape == (3, 40, 40))
|
||||||
self.assertTrue(isinstance(images["pixel_values"], np.ndarray))
|
self.assertTrue(isinstance(images["pixel_values"], np.ndarray))
|
||||||
@ -548,4 +548,4 @@ class Emu3IntegrationTest(unittest.TestCase):
|
|||||||
repo_type="dataset",
|
repo_type="dataset",
|
||||||
)
|
)
|
||||||
original_pixels = np.load(filepath)
|
original_pixels = np.load(filepath)
|
||||||
self.assertTrue(np.allclose(original_pixels, images["pixel_values"]))
|
self.assertTrue(np.allclose(original_pixels, images["pixel_values"], atol=1))
|
||||||
|
Loading…
Reference in New Issue
Block a user