Skip to content

Commit

Permalink
refactoring sample tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mryzhov committed Feb 21, 2025
1 parent 1505056 commit 0716394
Showing 1 changed file with 15 additions and 38 deletions.
53 changes: 15 additions & 38 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,18 @@ jobs:
working-directory: ${{ env.SRC_DIR }}

genai_samples_tests:
name: Samples Tests - ${{ matrix.build-type }}
name: Samples ${{ matrix.test.name }} (${{ matrix.build-type }})
strategy:
fail-fast: false
matrix:
build-type: [Release]
test:
- name: 'LLM'
marker: 'llm'
cmd: 'tests/python_tests/samples'
- name: 'Whisper'
marker: 'whisper'
cmd: 'tests/python_tests/samples'
needs: [ openvino_download, genai_build_cmake, genai_build_wheel, genai_build_samples ]
timeout-minutes: 45
defaults:
Expand All @@ -340,7 +347,6 @@ jobs:
INSTALL_DIR: ${{ github.workspace }}/ov
SRC_DIR: ${{ github.workspace }}/src
BUILD_DIR: ${{ github.workspace }}/build
MODELS_DIR: ${{ github.workspace }}/models

steps:
- name: Clone openvino.genai
Expand Down Expand Up @@ -370,45 +376,16 @@ jobs:
- name: Install GenAI wheels
uses: ./src/.github/actions/install_wheel
with:
packages: "openvino_tokenizers[transformers];openvino_genai"
packages: "openvino_tokenizers[transformers];openvino_genai[testing]"
requirements_files: "${{ env.SRC_DIR }}/samples/requirements.txt"
local_wheel_dir: ${{ env.INSTALL_DIR }}/wheels

- name: Download & convert Models and data
run: |
mkdir -p ${{ env.MODELS_DIR }}
optimum-cli export openvino --trust-remote-code --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 ${{ env.MODELS_DIR }}/TinyLlama-1.1B-Chat-v1.0
optimum-cli export openvino --trust-remote-code --model openai/whisper-tiny ${{ env.MODELS_DIR }}/whisper-tiny
wget https://storage.openvinotoolkit.org/models_contrib/speech/2021.2/librispeech_s5/how_are_you_doing_today.wav -O ${{ env.MODELS_DIR }}/how_are_you_doing_today.wav
- name: Test multinomial_causal_lm.py
if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only
timeout-minutes: 1
run: python ${{ env.INSTALL_DIR }}/samples/python/text_generation/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0
working-directory: ${{ env.MODELS_DIR }}

- name: Test whisper_speech_recognition.py
if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only
timeout-minutes: 1
run: python ${{ env.INSTALL_DIR }}/samples/python/whisper_speech_recognition/whisper_speech_recognition.py ./whisper-tiny/ how_are_you_doing_today.wav
working-directory: ${{ env.MODELS_DIR }}

- name: C++ Tests Prerequisites
run: python -m pip uninstall openvino openvino-tokenizers openvino-genai -y

- name: Test greedy_causal_lm
run: |
source ${{ env.INSTALL_DIR }}/setupvars.sh
chmod +x ${{ env.INSTALL_DIR }}/samples_bin/greedy_causal_lm
${{ env.INSTALL_DIR }}/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ ""
working-directory: ${{ env.MODELS_DIR }}

- name: Test whisper_speech_recognition
run: |
source ${{ env.INSTALL_DIR }}/setupvars.sh
chmod +x ${{ env.INSTALL_DIR }}/samples_bin/whisper_speech_recognition
${{ env.INSTALL_DIR }}/samples_bin/whisper_speech_recognition ./whisper-tiny/ how_are_you_doing_today.wav
working-directory: ${{ env.MODELS_DIR }}
- name: Test Samples (Python and C++)
run: python -m pytest -v ${{ env.SRC_DIR }}/${{ matrix.test.cmd }} -m "${{ matrix.test.marker }}"
env:
LD_LIBRARY_PATH: "${{ env.INSTALL_DIR }}/runtime/lib/intel64:${{ env.INSTALL_DIR }}/runtime/3rdparty/tbb/lib:$LD_LIBRARY_PATH" # Required for C++ samples
SAMPLES_PY_DIR: "${{ env.INSTALL_DIR }}/samples/python"
SAMPLES_CPP_DIR: "${{ env.INSTALL_DIR }}/samples_bin"

Overall_Status:
name: ci/gha_overall_status_macos
Expand Down

0 comments on commit 0716394

Please sign in to comment.