Skip to content

Commit

Permalink
Install transformers 4.46.3 on Win
Browse files Browse the repository at this point in the history
  • Loading branch information
as-suvorov committed Jan 8, 2025
1 parent bff7f90 commit 6b2ee94
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,12 @@ jobs:
. "${{ env.OV_INSTALL_DIR }}/setupvars.ps1"
python -m pip install . --verbose --find-links ${env:OV_INSTALL_DIR}/wheels
python -m pip install ./tools/who_what_benchmark --find-links ${env:OV_INSTALL_DIR}/wheels
# will install transformers 4.46.3 version
# transformers 4.46.3 will enable return_timestamps tests
# this check enabled for windows only. Ticket: 160205.
python -m pip install git+https://github.com/huggingface/optimum-intel.git@753f84db6e0966580eb9eaa74a808213be730631
python -m pytest -v ./tests/python_tests/test_whisper_pipeline.py -k "not test_smoke"
genai_python_lib_vlm:
Expand Down
15 changes: 11 additions & 4 deletions tests/python_tests/test_whisper_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import numpy as np
import os
import pathlib
import importlib.metadata as metadata
from packaging.version import parse


@pytest.fixture(scope="class", autouse=True)
Expand Down Expand Up @@ -164,8 +166,7 @@ def get_samples_from_dataset(

ds = typing.cast(datasets.IterableDataset, ds)
ds = ds.cast_column("audio", datasets.Audio(sampling_rate=16000))
ds = ds.skip(8)
ds = ds.take(1)
ds = ds.take(length)

return [x["audio"]["array"] for x in ds]

Expand Down Expand Up @@ -193,8 +194,13 @@ def compare_results(hf_result, genai_result):
assert genai_result.texts[0] == hf_result["text"]

# transformers 4.47 updated return_timestamps implementation
# enable once genai implementation aligned with trasformets. Ticket 160205.
return
# remove once genai implementation aligned with transformers. Ticket 160205.
transformers_version_greater_4_47 = parse(
metadata.version("transformers")
) >= parse("4.47.0")

if transformers_version_greater_4_47:
return

if "chunks" not in hf_result and genai_result.chunks is None:
return
Expand Down Expand Up @@ -448,6 +454,7 @@ def test_longform_audio(model_descr, test_sample):
genai_result = run_genai(
genai_pipe,
test_sample,
config=ov_genai.WhisperGenerationConfig(return_timestamps=True),
streamer=lambda x: streamer_result.append(x),
)

Expand Down

0 comments on commit 6b2ee94

Please sign in to comment.