From d7b31da8003a7b5a376127a5b2c78616483833aa Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Thu, 27 Feb 2025 17:21:35 +0100 Subject: [PATCH 1/3] Use TinyLlama-1.1B-Chat-v1.0 instead of LaMini-GPT-124M --- tests/python_tests/samples/conftest.py | 4 ++-- tests/python_tests/samples/test_greedy_causal_lm.py | 2 +- tests/python_tests/samples/test_multinomial_causal_lm.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/python_tests/samples/conftest.py b/tests/python_tests/samples/conftest.py index ab2cae6a7e..96b4502fbb 100644 --- a/tests/python_tests/samples/conftest.py +++ b/tests/python_tests/samples/conftest.py @@ -17,8 +17,8 @@ # - "name": the model's name or path # - "convert_args": a list of arguments for the conversion command MODELS = { - "LaMini-GPT-124M": { - "name": "MBZUAI/LaMini-GPT-124M", + "TinyLlama-1.1B-Chat-v1.0": { + "name": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "convert_args": [] }, "SmolLM-135M": { diff --git a/tests/python_tests/samples/test_greedy_causal_lm.py b/tests/python_tests/samples/test_greedy_causal_lm.py index 7894ccafdd..69b49d6477 100644 --- a/tests/python_tests/samples/test_greedy_causal_lm.py +++ b/tests/python_tests/samples/test_greedy_causal_lm.py @@ -14,7 +14,7 @@ class TestGreedyCausalLM: @pytest.mark.parametrize( "convert_model, sample_args", [ - pytest.param("LaMini-GPT-124M", "test"), + pytest.param("TinyLlama-1.1B-Chat-v1.0", "test"), pytest.param("SmolLM-135M", "return 0"), pytest.param("Qwen2.5-0.5B-Instruct", "69"), ], diff --git a/tests/python_tests/samples/test_multinomial_causal_lm.py b/tests/python_tests/samples/test_multinomial_causal_lm.py index 238c32f816..3b2256d444 100644 --- a/tests/python_tests/samples/test_multinomial_causal_lm.py +++ b/tests/python_tests/samples/test_multinomial_causal_lm.py @@ -15,7 +15,7 @@ class TestMultinomialCausalLM: "convert_model, sample_args", [ pytest.param("SmolLM-135M", "return 0"), - pytest.param("LaMini-GPT-124M", "0"), + pytest.param("TinyLlama-1.1B-Chat-v1.0", "0"), ], indirect=["convert_model"], ) From 6bfb8a636d8df044b67c76be27c11d290632a4ab Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Mon, 3 Mar 2025 10:01:51 +0100 Subject: [PATCH 2/3] extend supported extceptions --- tests/python_tests/utils/network.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/python_tests/utils/network.py b/tests/python_tests/utils/network.py index 32bfd2b8d2..a0c025b7cf 100644 --- a/tests/python_tests/utils/network.py +++ b/tests/python_tests/utils/network.py @@ -1,11 +1,11 @@ # Copyright (C) 2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -import requests import time import logging from huggingface_hub.utils import HfHubHTTPError from subprocess import CalledProcessError # nosec B404 +from requests.exceptions import RequestException # Configure the logger logging.basicConfig(level=logging.INFO) @@ -25,6 +25,7 @@ def retry_request(func, retries=5): network_error_patterns = [ "ConnectionError", "Timeout", + "Time-out", "ServiceUnavailable", "InternalServerError" ] @@ -32,7 +33,7 @@ def retry_request(func, retries=5): for attempt in range(retries): try: return func() - except (CalledProcessError, requests.exceptions.ConnectionError, requests.exceptions.Timeout, HfHubHTTPError) as e: + except (CalledProcessError, RequestException, HfHubHTTPError) as e: if isinstance(e, CalledProcessError): if any(pattern in e.stderr for pattern in network_error_patterns): logger.warning(f"CalledProcessError occurred: {e.stderr}") From 788d59b4d8148fc366b041156d49fc91f7407f47 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Mon, 3 Mar 2025 12:22:37 +0100 Subject: [PATCH 3/3] skip test on mac --- tests/python_tests/samples/test_multinomial_causal_lm.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/python_tests/samples/test_multinomial_causal_lm.py b/tests/python_tests/samples/test_multinomial_causal_lm.py index 3b2256d444..362a90bede 100644 --- a/tests/python_tests/samples/test_multinomial_causal_lm.py +++ b/tests/python_tests/samples/test_multinomial_causal_lm.py @@ -15,7 +15,11 @@ class TestMultinomialCausalLM: "convert_model, sample_args", [ pytest.param("SmolLM-135M", "return 0"), - pytest.param("TinyLlama-1.1B-Chat-v1.0", "0"), + pytest.param( + "TinyLlama-1.1B-Chat-v1.0", + "0", + marks=pytest.mark.skipif(sys.platform == "darwin", reason="CVS-163463") + ), ], indirect=["convert_model"], )