From a90bd1ce3f24bcd9d2c55774cd9220da1972a412 Mon Sep 17 00:00:00 2001 From: justintennenbaum Date: Tue, 7 Jan 2025 12:35:41 -0500 Subject: [PATCH 1/4] dataclasses replace method --- whisperx/asr.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/whisperx/asr.py b/whisperx/asr.py index 43575c2..d2c9f3e 100644 --- a/whisperx/asr.py +++ b/whisperx/asr.py @@ -1,6 +1,7 @@ import os import warnings from typing import List, NamedTuple, Optional, Union +from dataclasses import replace import ctranslate2 import faster_whisper @@ -240,7 +241,7 @@ class FasterWhisperPipeline(Pipeline): print(f"Suppressing numeral and symbol tokens") new_suppressed_tokens = numeral_symbol_tokens + self.options.suppress_tokens new_suppressed_tokens = list(set(new_suppressed_tokens)) - self.options = self.options._replace(suppress_tokens=new_suppressed_tokens) + self.options = replace(self.options, suppress_tokens=new_suppressed_tokens) segments: List[SingleSegment] = [] batch_size = batch_size or self._batch_size @@ -269,7 +270,7 @@ class FasterWhisperPipeline(Pipeline): # revert suppressed tokens if suppress_numerals is enabled if self.suppress_numerals: - self.options = self.options._replace(suppress_tokens=previous_suppress_tokens) + self.options = replace(self.options, suppress_tokens=previous_suppress_tokens) return {"segments": segments, "language": language} From d57f9dc54cac2b8c894d4d04dcc744fa9afc9fc9 Mon Sep 17 00:00:00 2001 From: Barabazs <31799121+Barabazs@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:06:59 +0100 Subject: [PATCH 2/4] Create tmp.yml --- .github/workflows/tmp.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/tmp.yml diff --git a/.github/workflows/tmp.yml b/.github/workflows/tmp.yml new file mode 100644 index 0000000..b632cbe --- /dev/null +++ b/.github/workflows/tmp.yml @@ -0,0 +1,31 @@ +name: Python Compatibility Test (PyPi) + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: # Allows manual triggering from GitHub UI + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install package + run: | + pip install whisperx + + - name: Test import + run: | + python -c "import whisperx; print('Successfully imported whisperx')" From 9395b0de189ccc1458f2bac57fb20a4ca07c6123 Mon Sep 17 00:00:00 2001 From: Barabazs <31799121+Barabazs@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:11:47 +0100 Subject: [PATCH 3/4] Update tmp.yml --- .github/workflows/tmp.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tmp.yml b/.github/workflows/tmp.yml index b632cbe..a83de44 100644 --- a/.github/workflows/tmp.yml +++ b/.github/workflows/tmp.yml @@ -26,6 +26,10 @@ jobs: run: | pip install whisperx + - name: Print packages + run: | + pip list + - name: Test import run: | python -c "import whisperx; print('Successfully imported whisperx')" From 734084cdf6f624bc33ed9f0cfcaa82840707ba6f Mon Sep 17 00:00:00 2001 From: Barabazs <31799121+Barabazs@users.noreply.github.com> Date: Wed, 8 Jan 2025 18:00:34 +0100 Subject: [PATCH 4/4] bump: update version to 3.3.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ef7ed34..13759a6 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ with open("README.md", "r", encoding="utf-8") as f: setup( name="whisperx", py_modules=["whisperx"], - version="3.3.0", + version="3.3.1", description="Time-Accurate Automatic Speech Recognition using Whisper.", long_description=long_description, long_description_content_type="text/markdown",