[InstructBlip] Fix instructblip slow test (#25171)

* fix instruct blip slow test

* Update tests/models/instructblip/test_modeling_instructblip.py
This commit is contained in:
Younes Belkada 2023-07-28 17:00:10 +02:00 committed by GitHub
parent add0895dd9
commit dd9d45b6ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -537,7 +537,7 @@ class InstructBlipModelIntegrationTest(unittest.TestCase):
logits = model(**inputs).logits
expected_slice = torch.tensor(
[[-3.5410, -12.2812, 8.2812], [-5.2500, -12.0938, 7.8398], [-4.1523, -13.8281, 9.0000]],
[[-3.5020, -12.3281, 8.4453], [-5.1406, -11.9609, 7.8711], [-4.0430, -13.4375, 9.1172]],
device=torch_device,
)
self.assertTrue(torch.allclose(logits[0, :3, :3].float(), expected_slice, atol=1e-3))