update emu3 test (#38543)

Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
This commit is contained in:
jiqing-feng 2025-06-03 17:02:01 +08:00 committed by GitHub
parent 55ec319de6
commit 814432423c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -537,7 +537,7 @@ class Emu3IntegrationTest(unittest.TestCase):
)
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")
self.assertTrue(images["pixel_values"].shape == (3, 40, 40))
self.assertTrue(isinstance(images["pixel_values"], np.ndarray))
@ -548,4 +548,4 @@ class Emu3IntegrationTest(unittest.TestCase):
repo_type="dataset",
)
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))