Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
c772a24
Switch to optimum-intel internal testing models
yatarkan Oct 27, 2025
25a633b
Merge branch 'master' into yt/update-tiny-models-source
yatarkan Oct 27, 2025
ab0e883
Change model for unicode pybind decoding tests
yatarkan Oct 27, 2025
24e6f44
Merge branch 'master' into yt/update-tiny-models-source
yatarkan Oct 27, 2025
3d865e3
Merge branch 'master' into yt/update-tiny-models-source
yatarkan Oct 28, 2025
bf36513
Merge branch 'master' into yt/update-tiny-models-source
yatarkan Oct 28, 2025
272a913
Merge branch 'master' into yt/update-tiny-models-source
yatarkan Oct 28, 2025
bb2db2c
Merge branch 'master' into yt/update-tiny-models-source
yatarkan Oct 29, 2025
b599265
Merge branch 'master' into yt/update-tiny-models-source
yatarkan Oct 31, 2025
dc07500
Merge branch 'master' into yt/update-tiny-models-source
yatarkan Nov 3, 2025
a30db8e
Merge branch 'master' into yt/update-tiny-models-source
yatarkan Nov 25, 2025
2655b3c
Fix unicode test after merge
yatarkan Nov 25, 2025
48ca733
Update rest tiny models to optimum internal testing
yatarkan Nov 26, 2025
90b02d6
Update unicode test model and test cases
yatarkan Nov 26, 2025
9e38db3
Merge branch 'master' into yt/update-tiny-models-source
yatarkan Nov 26, 2025
1490d80
Merge branch 'master' into yt/update-tiny-models-source
yatarkan Dec 3, 2025
98836bd
Merge branch 'master' into yt/update-tiny-models-source
yatarkan Dec 5, 2025
754921c
Merge branch 'master' into yt/update-tiny-models-source
yatarkan Dec 9, 2025
95f8f1e
Merge branch 'master' into yt/update-tiny-models-source
yatarkan Dec 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/python_tests/data/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def get_models_list() -> tuple[str, ...]:
model_ids: list[str] = [
"katuni4ka/tiny-random-phi3",
"optimum-intel-internal-testing/tiny-random-Phi3ForCausalLM",
]
if pytest.selected_model_ids:
model_ids = [model_id for model_id in model_ids if model_id in pytest.selected_model_ids.split(' ')]
Expand Down
4 changes: 2 additions & 2 deletions tests/python_tests/data/tokenizer_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ def get_tokenizer_configs():
"unk_token": "<unk>",
"chat_template": "{% for message in messages %}{% if message['role'] == 'system' %}{{'<|system|>'+ '\n' + message['content'] + '\n'}}{% elif message['role'] == 'user' %}{{'<|user|>' + '\n' + message['content'] + '\n'}}{% elif message['role'] == 'assistant' %}{{'<|assistant|>' + '\n' + message['content'] + '<|endoftext|>' + ('' if loop.last else '\n')}}{% endif %}{% endfor %}"
},
"katuni4ka/tiny-random-phi3": {
"optimum-intel-internal-testing/tiny-random-Phi3ForCausalLM": {
"bos_token": "<s>",
"eos_token": "<|endoftext|>",
"pad_token": "<|endoftext|>",
Expand Down Expand Up @@ -712,7 +712,7 @@ def get_tokenizer_configs():
"unk_token": "<unk>",
"chat_template": "{% for message in messages %}\n{% if message['role'] == 'user' %}\n{{ '### User:\n' + message['content'] }}\n{% elif message['role'] == 'system' %}\n{{ '### System:\n' + message['content'] }}\n{% elif message['role'] == 'assistant' %}\n{{ '### Assistant:\n' + message['content'] }}\n{% endif %}\n{% if loop.last and add_generation_prompt %}\n{{ '### Assistant:' }}\n{% endif %}\n{% endfor %}"
},
"katuni4ka/tiny-random-minicpm": {
"optimum-intel-internal-testing/tiny-random-minicpm": {
"bos_token": "<s>",
"eos_token": "</s>",
"pad_token": None,
Expand Down
6 changes: 3 additions & 3 deletions tests/python_tests/samples/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"convert_args": ['--trust-remote-code', '--weight-format', 'fp16']
},
"tiny-random-minicpmv-2_6": {
"name": "katuni4ka/tiny-random-minicpmv-2_6",
"name": "optimum-intel-internal-testing/tiny-random-minicpmv-2_6",
"convert_args": ['--trust-remote-code', "--task", "image-text-to-text"]
},
"InternVL2-1B": {
Expand All @@ -118,15 +118,15 @@
"convert_args": ["--task", "text-generation-with-past", "--weight-format", "int8"]
},
"tiny-random-latent-consistency": {
"name": "echarlaix/tiny-random-latent-consistency",
"name": "optimum-intel-internal-testing/tiny-random-latent-consistency",
"convert_args": ['--trust-remote-code', '--weight-format', 'fp16']
},
"tiny-random-latent-consistency-lora": {
"name": "katuni4ka/tiny-random-latent-consistency-lora",
"convert_args": []
},
"tiny-random-llava": {
"name": "katuni4ka/tiny-random-llava",
"name": "optimum-intel-internal-testing/tiny-random-llava",
"convert_args": ["--trust-remote-code", "--task", "image-text-to-text"]
},
"tiny-random-qwen2vl": {
Expand Down
32 changes: 19 additions & 13 deletions tests/python_tests/test_llm_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,14 @@ def test_batch_string_inputs(
)


@pytest.mark.parametrize("llm_model", ['katuni4ka/tiny-random-phi3'], indirect=True)
@pytest.mark.parametrize("llm_model", ["optimum-intel-internal-testing/tiny-random-Phi3ForCausalLM"], indirect=True)
def test_batch_size_switch(ov_pipe: ov_genai.LLMPipeline) -> None:
ov_pipe.generate(["a"], max_new_tokens=2)
ov_pipe.generate(["1", "2"], max_new_tokens=2)
ov_pipe.generate(["a"], max_new_tokens=2)


@pytest.mark.parametrize("llm_model", ['katuni4ka/tiny-random-phi3'], indirect=True)
@pytest.mark.parametrize("llm_model", ["optimum-intel-internal-testing/tiny-random-Phi3ForCausalLM"], indirect=True)
def test_empty_encoded_inputs_throw(ov_pipe: ov_genai.LLMPipeline) -> None:
with pytest.raises(RuntimeError):
ov_pipe.generate(ov.Tensor(np.array([[]], dtype=np.int64)), max_new_tokens=2)
Expand Down Expand Up @@ -698,29 +698,35 @@ def test_pipeline_validates_generation_config(ov_pipe: ov_genai.LLMPipeline) ->
# Work with Unicode in Python API
#

@pytest.mark.parametrize("llm_model", MODELS_LIST, indirect=True)
def test_unicode_pybind_decoding_one_string(ov_pipe: ov_genai.LLMPipeline) -> None:
res_str = ov_pipe.generate(',', max_new_tokens=4, apply_chat_template=False)
# Model, prompt and max_new_tokens that generate unfinished utf-8 string
UNICODE_PYBIND_DECODING_TEST_CASES: list[tuple[str, str, int]] = [
("optimum-intel-internal-testing/tiny-random-PhiForCausalLM", ",", 3)
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The model name uses PhiForCausalLM while other models in this PR use Phi3ForCausalLM. This inconsistency suggests either a typo or a different model. Verify this is the correct model name and consider using tiny-random-Phi3ForCausalLM if it should match the pattern used elsewhere.

Suggested change
("optimum-intel-internal-testing/tiny-random-PhiForCausalLM", ",", 3)
("optimum-intel-internal-testing/tiny-random-Phi3ForCausalLM", ",", 3)

Copilot uses AI. Check for mistakes.
]


@pytest.mark.parametrize("llm_model,prompt,max_new_tokens", UNICODE_PYBIND_DECODING_TEST_CASES, indirect=["llm_model"])
def test_unicode_pybind_decoding_one_string(ov_pipe: ov_genai.LLMPipeline, prompt: str, max_new_tokens: int) -> None:
res_str = ov_pipe.generate(prompt, max_new_tokens=max_new_tokens, apply_chat_template=False)
assert '�' == res_str[-1]


@pytest.mark.parametrize("llm_model", MODELS_LIST, indirect=True)
def test_unicode_pybind_decoding_batched(ov_pipe: ov_genai.LLMPipeline) -> None:
res_str = ov_pipe.generate([","], max_new_tokens=4, apply_chat_template=False)
@pytest.mark.parametrize("llm_model,prompt,max_new_tokens", UNICODE_PYBIND_DECODING_TEST_CASES, indirect=["llm_model"])
def test_unicode_pybind_decoding_batched(ov_pipe: ov_genai.LLMPipeline, prompt: str, max_new_tokens: int) -> None:
res_str = ov_pipe.generate([prompt], max_new_tokens=max_new_tokens, apply_chat_template=False)
assert '�' == res_str.texts[0][-1]


@pytest.mark.parametrize("llm_model", MODELS_LIST, indirect=True)
def test_unicode_pybind_decoding_one_string_streamer(ov_pipe: ov_genai.LLMPipeline) -> None:
@pytest.mark.parametrize("llm_model,prompt,max_new_tokens", UNICODE_PYBIND_DECODING_TEST_CASES, indirect=["llm_model"])
def test_unicode_pybind_decoding_one_string_streamer(ov_pipe: ov_genai.LLMPipeline, prompt: str, max_new_tokens: int) -> None:
res_str = []
ov_pipe.generate(",", max_new_tokens=4, apply_chat_template=False, streamer=lambda x: res_str.append(x))
ov_pipe.generate(prompt, max_new_tokens=max_new_tokens, apply_chat_template=False, streamer=lambda x: res_str.append(x))
assert '�' == ''.join(res_str)[-1]

#
# Perf metrics
#

@pytest.mark.parametrize("llm_model", ['katuni4ka/tiny-random-gemma2'], indirect=True)
@pytest.mark.parametrize("llm_model", ["optimum-intel-internal-testing/tiny-random-gemma2"], indirect=True)
@pytest.mark.parametrize("generation_config,prompt", PERF_METRICS_TEST_CASES)
@pytest.mark.parametrize("pipeline_type", [PipelineType.STATEFUL, PipelineType.PAGED_ATTENTION])
def test_perf_metrics(
Expand Down Expand Up @@ -812,7 +818,7 @@ def test_perf_metrics(
assert len(raw_metrics.m_durations) == num_generated_tokens - 1


@pytest.mark.parametrize("llm_model", ['katuni4ka/tiny-random-gemma2'], indirect=True)
@pytest.mark.parametrize("llm_model", ["optimum-intel-internal-testing/tiny-random-gemma2"], indirect=True)
@pytest.mark.parametrize("generation_config,prompt", PERF_METRICS_STRUCTURED_OUTPUT_TEST_CASES)
def test_perf_metrics_with_structured_output(
ov_pipe: ov_genai.LLMPipeline,
Expand Down
14 changes: 7 additions & 7 deletions tests/python_tests/test_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def hf_ov_genai_models(request, tmp_path_factory):

@pytest.mark.parametrize(
"hf_ov_genai_models",
["katuni4ka/tiny-random-phi3"], # this tokenizer is used as a stub only
["optimum-intel-internal-testing/tiny-random-Phi3ForCausalLM"], # this tokenizer is used as a stub only
indirect=True
)
@pytest.mark.parametrize("answer", [
Expand Down Expand Up @@ -64,7 +64,7 @@ def write(self, message):

@pytest.mark.parametrize(
"hf_ov_genai_models",
["katuni4ka/tiny-random-phi3"], # this tokenizer is used as a stub only
["optimum-intel-internal-testing/tiny-random-Phi3ForCausalLM"], # this tokenizer is used as a stub only
indirect=True
)
def test_incremental_phi4_reason_integer_token_ids(hf_ov_genai_models):
Expand Down Expand Up @@ -92,7 +92,7 @@ def write(self, message):

@pytest.mark.parametrize(
"hf_ov_genai_models",
["katuni4ka/tiny-random-phi3"], # this tokenizer is used as a stub only
["optimum-intel-internal-testing/tiny-random-Phi3ForCausalLM"], # this tokenizer is used as a stub only
indirect=True
)
def test_incremental_integer_token_ids(hf_ov_genai_models):
Expand Down Expand Up @@ -144,7 +144,7 @@ def write(self, message):

@pytest.mark.parametrize(
"hf_ov_genai_models",
["katuni4ka/tiny-random-phi3"],
["optimum-intel-internal-testing/tiny-random-Phi3ForCausalLM"],
indirect=True
)
@pytest.mark.parametrize("split_answer", [
Expand Down Expand Up @@ -202,7 +202,7 @@ def test_incremental_phi4_reason_parser_nostreamer(answer):
@pytest.mark.parametrize("do_reset", [False])
@pytest.mark.parametrize(
"hf_ov_genai_models",
["katuni4ka/tiny-random-phi3"], # this tokenizer is used as a stub only
["optimum-intel-internal-testing/tiny-random-Phi3ForCausalLM"], # this tokenizer is used as a stub only
indirect=True
)
@pytest.mark.parametrize("answer", [
Expand Down Expand Up @@ -266,7 +266,7 @@ def test_incremental_deepseek_parser():

@pytest.mark.parametrize(
"hf_ov_genai_models",
["katuni4ka/tiny-random-phi3"],
["optimum-intel-internal-testing/tiny-random-Phi3ForCausalLM"],
indirect=True
)
def test_custom_incremental_parser(hf_ov_genai_models):
Expand Down Expand Up @@ -308,7 +308,7 @@ def write(self, message):

@pytest.mark.parametrize(
"hf_ov_genai_models",
["katuni4ka/tiny-random-phi3"],
["optimum-intel-internal-testing/tiny-random-Phi3ForCausalLM"],
indirect=True
)
def test_final_parser_llama_32_json(hf_ov_genai_models):
Expand Down
12 changes: 6 additions & 6 deletions tests/python_tests/test_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def model_facebook_opt_125m() -> OVConvertedModelSchema:


@pytest.fixture(scope="module")
def model_katuni4ka_tiny_random_phi3() -> OVConvertedModelSchema:
model_id : str = "katuni4ka/tiny-random-phi3"
def model_tiny_random_phi3() -> OVConvertedModelSchema:
model_id : str = "optimum-intel-internal-testing/tiny-random-Phi3ForCausalLM"
return download_and_convert_model(model_id)


Expand Down Expand Up @@ -50,11 +50,11 @@ def model_tinyllama_1_1b_chat() -> OVConvertedModelSchema:
]
)
def test_basic_stop_criteria(
model_katuni4ka_tiny_random_phi3: OVConvertedModelSchema,
model_tiny_random_phi3: OVConvertedModelSchema,
generation_config: GenerationConfig,
prompt
):
generate_and_compare(model_katuni4ka_tiny_random_phi3, [prompt], generation_config)
generate_and_compare(model_tiny_random_phi3, [prompt], generation_config)


@pytest.mark.parametrize(
Expand Down Expand Up @@ -159,14 +159,14 @@ def test_stop_strings_tinyllama(
'I have an interview about product speccing with the company Weekend Health. Give me an example of a question they might ask with regards about a new feature'
])
def test_greedy(
model_katuni4ka_tiny_random_phi3: OVConvertedModelSchema,
model_tiny_random_phi3: OVConvertedModelSchema,
generation_config,
prompt
):
prompt = prompt.decode('unicode_escape') if isinstance(prompt, bytes) else prompt

generate_and_compare(
model_katuni4ka_tiny_random_phi3,
model_tiny_random_phi3,
prompt,
generation_config
)
Expand Down
2 changes: 1 addition & 1 deletion tests/python_tests/test_stateful_speculative_decoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_string_inputs(main_model, main_device, draft_model, draft_device, promp
def test_perf_metrics():
import time
start_time = time.perf_counter()
model_id = 'katuni4ka/tiny-random-gemma2'
model_id = "optimum-intel-internal-testing/tiny-random-gemma2"
model_path = download_and_convert_model(model_id).models_path

# Create OpenVINO GenAI pipeline:
Expand Down
2 changes: 1 addition & 1 deletion tests/python_tests/test_structured_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class RESTAPIResponse(BaseModel):

structured_id_models = [
"TinyLlama/TinyLlama-1.1B-Chat-v1.0",
"katuni4ka/tiny-random-phi3",
"optimum-intel-internal-testing/tiny-random-Phi3ForCausalLM",
]


Expand Down
2 changes: 1 addition & 1 deletion tests/python_tests/test_text_streamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def test_text_prompts(tmp_path, prompt, model_id):
# '\n\n# 利用re.sub()方法,�' with UTF8 invalid for "microsoft/phi-1_5"
[198, 198, 2, 10263, 230, 102, 18796, 101, 260, 13],

# '룅튜룅튜�' causes error on "openbmb/MiniCPM-o-2_6" / "katuni4ka/tiny-random-minicpmv-2_6"
# '룅튜룅튜�' causes error on "openbmb/MiniCPM-o-2_6" / "optimum-intel-internal-testing/tiny-random-minicpmv-2_6"
[167, 96, 227, 169, 232, 250, 167, 96, 227, 169, 232, 250, 167]
]
@pytest.mark.parametrize("model_id", tokenizer_model_ids)
Expand Down
12 changes: 6 additions & 6 deletions tests/python_tests/test_tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def test_set_chat_template(ov_hf_tokenizers):
@pytest.mark.parametrize(
"ov_hf_tokenizers",
[
"katuni4ka/tiny-random-phi3",
"optimum-intel-internal-testing/tiny-random-Phi3ForCausalLM",
"TinyLlama/TinyLlama-1.1B-Chat-v1.0",
# ("black-forest-labs/FLUX.1-dev", dict(subfolder="tokenizer")), # FLUX.1-dev has tokenizer in subfolder
],
Expand Down Expand Up @@ -433,10 +433,10 @@ def hf_ov_genai_models(request, tmp_path_factory):
@pytest.mark.parametrize(
"hf_ov_genai_models",
[
("katuni4ka/tiny-random-phi3", {"padding_side": None}),
("optimum-intel-internal-testing/tiny-random-Phi3ForCausalLM", {"padding_side": None}),
("TinyLlama/TinyLlama-1.1B-Chat-v1.0", {"padding_side": None}),
("katuni4ka/tiny-random-llava-next", {"padding_side": "right"}),
("katuni4ka/tiny-random-llava-next", {"padding_side": "left"}),
("optimum-intel-internal-testing/tiny-random-llava-next", {"padding_side": "right"}),
("optimum-intel-internal-testing/tiny-random-llava-next", {"padding_side": "left"}),
(
"BAAI/bge-small-en-v1.5",
{"padding_side": None},
Expand Down Expand Up @@ -506,8 +506,8 @@ def test_padding(
base_models_for_paired_input_test = [
("answerdotai/ModernBERT-base", {"padding_side": None}),
("TinyLlama/TinyLlama-1.1B-Chat-v1.0", {"padding_side": None}),
("katuni4ka/tiny-random-llava-next", {"padding_side": "right"}),
("katuni4ka/tiny-random-llava-next", {"padding_side": "left"}),
("optimum-intel-internal-testing/tiny-random-llava-next", {"padding_side": "right"}),
("optimum-intel-internal-testing/tiny-random-llava-next", {"padding_side": "left"}),
]

def make_model_params():
Expand Down
Loading
Loading