Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable win lib tests #560

Closed
9 changes: 4 additions & 5 deletions .github/workflows/genai_python_lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.12
- run: mkdir ./ov/
# Install CentOS7 instead of Ubuntu to match PyPI distribution ABI.
- run: curl ${{ env.l_ov_centos_link }} | tar --directory ./ov/ --strip-components 1 -xz
Expand Down Expand Up @@ -59,7 +59,6 @@ jobs:
- run: python -m pytest ./tests/python_tests/test_generate_api.py -m precommit

windows_genai_python_lib:
if: false
runs-on: windows-latest
env:
CMAKE_BUILD_PARALLEL_LEVEL: null
Expand All @@ -72,15 +71,15 @@ jobs:
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: 3.8
- run: curl --output ov.zip ${{ env.l_ov_link }}
python-version: 3.12
- run: curl --output ov.zip ${{ env.w_ov_link }}
- run: unzip -d ov ov.zip
- run: dirs=(ov/*) && mv ov/*/* ov && rmdir "${dirs[@]}"
shell: bash
- run: call ./ov/setupvars.bat && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
- run: call ./ov/setupvars.bat && cmake --build ./build/ --config Release -j
- run: call ./ov/setupvars.bat && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly --upgrade-strategy eager
# cmd evaluates variables in a different way. Setting PYTHONPATH before setupvars.bat instead of doing that after solves that.
- run: set "PYTHONPATH=./build/" && call ./ov/setupvars.bat && python -m pytest ./tests/python_tests/test_generate_api.py -m precommit
- run: set "PYTHONPATH=.\build\" && call ./ov/setupvars.bat && python -m pytest ./tests/python_tests/test_generate_api.py -m precommit
- run: call ./ov/setupvars.bat && python -m pip install . --verbose
- run: python -m pytest ./tests/python_tests/test_generate_api.py -m precommit
20 changes: 10 additions & 10 deletions tests/python_tests/test_generate_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,12 @@ def test_decoding(model_descr, generation_config, prompt):
@pytest.mark.parametrize("model_descr", models_list())
@pytest.mark.xfail(
raises=TypeError,
reason="pybind was unable to find overloads with tensor inputs on Linux",
reason="pybind was unable to find overloads with tensor inputs on Linux and Widnows",
strict=False,
condition=sys.platform == "linux"
condition=sys.platform in [
"linux",
"win32"
]
)
@pytest.mark.precommit
def test_ov_tensors(model_descr, inputs):
Expand All @@ -232,7 +235,10 @@ def test_ov_tensors(model_descr, inputs):
raises=TypeError,
reason="pybind was unable to find ov::Tensor from openvino yet",
strict=False,
condition=sys.platform in ["linux", "win32"]
condition=sys.platform in [
# "linux",
# "win32"
]
)
def test_genai_tokenizer_encode(model_descr, prompt):
model_id, path, tokenizer, model, pipe = read_model(model_descr)
Expand Down Expand Up @@ -263,12 +269,6 @@ def test_genai_tokenizer_encode(model_descr, prompt):
@pytest.mark.parametrize("model_descr", models_list())
@pytest.mark.parametrize("encoded_prompt", encoded_prompts)
@pytest.mark.precommit
@pytest.mark.xfail(
raises=TypeError,
reason="pybind was unable to find ov::Tensor from openvino yet",
strict=False,
condition=sys.platform in ["linux", "win32"]
)
def test_genai_tokenizer_decode(model_descr, encoded_prompt):
model_id, path, tokenizer, model, pipe = read_model(model_descr)
tok = pipe.get_tokenizer()
Expand Down Expand Up @@ -742,7 +742,7 @@ def test_unicode_pybind_decoding_3():
@pytest.mark.parametrize("generation_config", configs)
@pytest.mark.parametrize("model_descr", chat_models_list())
@pytest.mark.precommit
@pytest.mark.skipif(sys.platform == "linux", reason="no space left on linux device for chat models")
@pytest.mark.skipif(sys.platform in ["linux", "win32"], reason="no space left on device for chat models")
def test_chat_1(model_descr, generation_config):
config = generation_config.copy() # to avoid side effects

Expand Down
Loading