Skip to content

Commit

Permalink
add message in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eaidova committed Oct 28, 2024
1 parent 7f2f404 commit d36de5c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/openvino/test_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,10 @@ def test_compare_to_transformers(self, model_arch):

additional_inputs = {"past_key_values": DynamicCache()}
transformers_outputs = transformers_model.generate(**tokens, generation_config=gen_config, **additional_inputs)
self.assertTrue(torch.allclose(ov_outputs, transformers_outputs))
self.assertTrue(
torch.allclose(ov_outputs, transformers_outputs),
"OV output {ov_outputs}\nTransofrmers output {transformers_output}",
)

del transformers_model
del ov_model
Expand Down Expand Up @@ -1092,6 +1095,10 @@ def test_beam_search(self, model_arch):
"config": AutoConfig.from_pretrained(model_id, trust_remote_code=True),
"trust_remote_code": True,
}

# starting from transformers 4.45.0 gemma2 uses eager attention by default, while ov - sdpa
if model_arch == "gemma2" and is_transformers_version(">=", "4.45.0"):
model_kwargs["attn_implemenation"] = "sdpa"
# Qwen tokenizer does not support padding, chatglm, glm4 testing models produce nan that incompatible with beam search
if model_arch in ["qwen", "chatglm", "glm4"]:
return
Expand Down

0 comments on commit d36de5c

Please sign in to comment.