mirror of
https://github.com/m-bain/whisperX.git
synced 2025-07-01 18:17:27 -04:00
Merge branch 'main' into silero-vad
This commit is contained in:
35
.github/workflows/tmp.yml
vendored
Normal file
35
.github/workflows/tmp.yml
vendored
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
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: Print packages
|
||||||
|
run: |
|
||||||
|
pip list
|
||||||
|
|
||||||
|
- name: Test import
|
||||||
|
run: |
|
||||||
|
python -c "import whisperx; print('Successfully imported whisperx')"
|
2
setup.py
2
setup.py
@ -9,7 +9,7 @@ with open("README.md", "r", encoding="utf-8") as f:
|
|||||||
setup(
|
setup(
|
||||||
name="whisperx",
|
name="whisperx",
|
||||||
py_modules=["whisperx"],
|
py_modules=["whisperx"],
|
||||||
version="3.3.0",
|
version="3.3.1",
|
||||||
description="Time-Accurate Automatic Speech Recognition using Whisper.",
|
description="Time-Accurate Automatic Speech Recognition using Whisper.",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
from typing import List, Optional, Union
|
import warnings
|
||||||
|
from typing import List, NamedTuple, Optional, Union
|
||||||
|
from dataclasses import replace
|
||||||
|
|
||||||
import ctranslate2
|
import ctranslate2
|
||||||
import faster_whisper
|
import faster_whisper
|
||||||
@ -247,7 +249,7 @@ class FasterWhisperPipeline(Pipeline):
|
|||||||
print(f"Suppressing numeral and symbol tokens")
|
print(f"Suppressing numeral and symbol tokens")
|
||||||
new_suppressed_tokens = numeral_symbol_tokens + self.options.suppress_tokens
|
new_suppressed_tokens = numeral_symbol_tokens + self.options.suppress_tokens
|
||||||
new_suppressed_tokens = list(set(new_suppressed_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] = []
|
segments: List[SingleSegment] = []
|
||||||
batch_size = batch_size or self._batch_size
|
batch_size = batch_size or self._batch_size
|
||||||
@ -276,7 +278,7 @@ class FasterWhisperPipeline(Pipeline):
|
|||||||
|
|
||||||
# revert suppressed tokens if suppress_numerals is enabled
|
# revert suppressed tokens if suppress_numerals is enabled
|
||||||
if self.suppress_numerals:
|
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}
|
return {"segments": segments, "language": language}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user