diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be4b2872..e5029863 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,7 +69,6 @@ jobs: matrix: include: - os: macos-latest - - os: ubuntu-latest - os: windows-latest steps: - uses: actions/checkout@v3 @@ -77,7 +76,7 @@ jobs: submodules: recursive - uses: actions/setup-python@v4 with: - python-version: '3.9.13' + python-version: '3.10.7' - name: Install Poetry Action uses: snok/install-poetry@v1.3.1 diff --git a/buzz/transcriber.py b/buzz/transcriber.py index b152c8e3..de06326c 100644 --- a/buzz/transcriber.py +++ b/buzz/transcriber.py @@ -194,7 +194,7 @@ class Signals(QObject): class WhisperCppFileTranscriber(QRunnable): signals: Signals duration_audio_ms = sys.maxsize # max int - segments: List[Segment] = [] + segments: List[Segment] def __init__( self, @@ -213,6 +213,7 @@ class WhisperCppFileTranscriber(QRunnable): self.word_level_timings = word_level_timings self.model_path = model_path self.signals = Signals() + self.segments = [] self.process = QProcess() self.process.readyReadStandardError.connect(self.read_std_err) diff --git a/testdata/whisper-french.mp3 b/testdata/whisper-french.mp3 index c37cd9d2..92ba03df 100644 Binary files a/testdata/whisper-french.mp3 and b/testdata/whisper-french.mp3 differ diff --git a/tests/gui_test.py b/tests/gui_test.py index f43984b9..34c65319 100644 --- a/tests/gui_test.py +++ b/tests/gui_test.py @@ -187,7 +187,7 @@ class TestFileTranscriberWidget: widget.run_button.click() output_file = open(output_file_path, 'r', encoding='utf-8') - assert 'Bienvenue dans Passe-Relle, un podcast' in output_file.read() + assert 'Bienvenue dans Passe' in output_file.read() class TestSettings: diff --git a/tests/transcriber_test.py b/tests/transcriber_test.py index d66bcc81..7ca0799f 100644 --- a/tests/transcriber_test.py +++ b/tests/transcriber_test.py @@ -41,8 +41,8 @@ class TestWhisperCppFileTranscriber: @pytest.mark.parametrize( 'task,output_text', [ - (Task.TRANSCRIBE, 'Bienvenue dans Passe-Relle, un podcast'), - (Task.TRANSLATE, 'Welcome to Passe-Relle, a podcast'), + (Task.TRANSCRIBE, 'Bienvenue dans Passe'), + (Task.TRANSLATE, 'Welcome to Passe-Relle'), ]) def test_transcribe(self, qtbot, tmp_path: pathlib.Path, task: Task, output_text: str): output_file_path = tmp_path / 'whisper_cpp.txt' @@ -84,11 +84,11 @@ class TestWhisperFileTranscriber: @pytest.mark.parametrize( 'word_level_timings,output_format,output_text', [ - (False, OutputFormat.TXT, 'Bienvenue dans Passe-Relle, un podcast'), - (False, OutputFormat.SRT, '1\n00:00:00.000 --> 00:00:06.560\n Bienvenue dans Passe-Relle, un podcast pensé pour évêyer la curiosité des apprenances'), - (False, OutputFormat.VTT, 'WEBVTT\n\n00:00:00.000 --> 00:00:06.560\n Bienvenue dans Passe-Relle, un podcast pensé pour évêyer la curiosité des apprenances'), + (False, OutputFormat.TXT, 'Bienvenue dans Passe-Relle'), + (False, OutputFormat.SRT, '1\n00:00:00.000 --> 00:00:06.560\n Bienvenue dans Passe-Relle'), + (False, OutputFormat.VTT, 'WEBVTT\n\n00:00:00.000 --> 00:00:06.560\n Bienvenue dans Passe'), (True, OutputFormat.SRT, - '1\n00:00:00.040 --> 00:00:00.359\n Bienvenue dans\n\n2\n00:00:00.359 --> 00:00:00.419\n Passe-'), + '1\n00:00:00.040 --> 00:00:00.299\n Bien\n\n2\n00:00:00.299 --> 00:00:00.329\nvenue dans\n\n3\n00:00:00.329 --> 00:00:00.429\n P\n\n4\n00:00:00.429 --> 00:00:00.589\nasse-'), ]) def test_transcribe(self, qtbot, tmp_path: pathlib.Path, word_level_timings: bool, output_format: OutputFormat, output_text: str): output_file_path = tmp_path / f'whisper.{output_format.value.lower()}' @@ -161,4 +161,4 @@ class TestWhisperCpp: result = whisper_cpp.transcribe( audio='testdata/whisper-french.mp3', params=params) - assert 'Bienvenue dans Passe-Relle, un podcast' in result['text'] + assert 'Bienvenue dans Passe' in result['text']