Skip to content

Commit d36de5c

Browse files
committed
add message in tests
1 parent 7f2f404 commit d36de5c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/openvino/test_modeling.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,10 @@ def test_compare_to_transformers(self, model_arch):
927927

928928
additional_inputs = {"past_key_values": DynamicCache()}
929929
transformers_outputs = transformers_model.generate(**tokens, generation_config=gen_config, **additional_inputs)
930-
self.assertTrue(torch.allclose(ov_outputs, transformers_outputs))
930+
self.assertTrue(
931+
torch.allclose(ov_outputs, transformers_outputs),
932+
"OV output {ov_outputs}\nTransofrmers output {transformers_output}",
933+
)
931934

932935
del transformers_model
933936
del ov_model
@@ -1092,6 +1095,10 @@ def test_beam_search(self, model_arch):
10921095
"config": AutoConfig.from_pretrained(model_id, trust_remote_code=True),
10931096
"trust_remote_code": True,
10941097
}
1098+
1099+
# starting from transformers 4.45.0 gemma2 uses eager attention by default, while ov - sdpa
1100+
if model_arch == "gemma2" and is_transformers_version(">=", "4.45.0"):
1101+
model_kwargs["attn_implemenation"] = "sdpa"
10951102
# Qwen tokenizer does not support padding, chatglm, glm4 testing models produce nan that incompatible with beam search
10961103
if model_arch in ["qwen", "chatglm", "glm4"]:
10971104
return

0 commit comments

Comments
 (0)