Skip to content

Commit 05fad58

Browse files
update seq2seq test
1 parent 6c0c617 commit 05fad58

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/openvino/test_seq2seq.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ def test_compare_to_transformers(self, model_arch):
656656
transformers_inputs["past_key_values"] = DynamicCache()
657657

658658
with torch.no_grad():
659-
if model_arch in ["minicpmo"]:
659+
if model_arch in ["minicpmo", "minicpmv4", "minicpmv4_5"]:
660660
# `generate` method for minicpmo requires tokenizer
661661
tokenizer = AutoTokenizer.from_pretrained(
662662
model_id, trust_remote_code=model_arch in self.REMOTE_CODE_MODELS
@@ -837,6 +837,9 @@ def test_generate_utils(self, model_arch):
837837
input_audio = self._generate_random_audio_data()
838838
question = "Translate this audio to French"
839839
inputs = model.preprocess_inputs(**preprocessors, text=question, audio=[input_audio])
840+
# skip the temporal_ids which makes the number of loop inconstant:
841+
# https://huggingface.co/openbmb/MiniCPM-V-4_5/blob/main/resampler.py#L261
842+
inputs.pop("temporal_ids", None)
840843
outputs = model.generate(**inputs, max_new_tokens=10)
841844
# filter out original prompt becuase it may contains out of tokenizer tokens e.g. in nanollva text separator = -200
842845
outputs = outputs[:, inputs["input_ids"].shape[1] :]

0 commit comments

Comments
 (0)