Skip to content

Commit

Permalink
Update Whisper.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
chidiwilliams committed Apr 24, 2023
1 parent 3af07c6 commit fba8817
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
5 changes: 3 additions & 2 deletions buzz/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1021,8 +1021,9 @@ def on_new_transcription_action_triggered(self):
self.open_file_transcriber_widget(file_paths)

def open_file_transcriber_widget(self, file_paths: List[str]):
file_transcriber_window = FileTranscriberWidget(
file_paths, self.openai_access_token, self, flags=Qt.WindowType.Window)
file_transcriber_window = FileTranscriberWidget(file_paths=file_paths,
openai_access_token=self.openai_access_token, parent=self,
flags=Qt.WindowType.Window)
file_transcriber_window.triggered.connect(
self.on_file_transcriber_triggered)
file_transcriber_window.openai_access_token_changed.connect(self.on_openai_access_token_changed)
Expand Down
3 changes: 3 additions & 0 deletions buzz/settings/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ def set_value(self, key: Key, value: typing.Any) -> None:
def value(self, key: Key, default_value: typing.Any, value_type: typing.Optional[type] = None) -> typing.Any:
return self.settings.value(key.value, default_value,
value_type if value_type is not None else type(default_value))

def clear(self):
self.settings.clear()
7 changes: 7 additions & 0 deletions tests/gui_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
RecordingTranscriberWidget,
TemperatureValidator, TranscriptionTasksTableWidget, HuggingFaceSearchLineEdit,
TranscriptionOptionsGroupBox)
from buzz.settings.settings import Settings
from buzz.widgets.transcription_viewer_widget import TranscriptionViewerWidget
from buzz.model_loader import ModelType
from buzz.transcriber import (FileTranscriptionOptions, FileTranscriptionTask,
Expand Down Expand Up @@ -298,6 +299,12 @@ def _get_toolbar_action(window: MainWindow, text: str):
return [action for action in toolbar.actions() if action.text() == text][0]


@pytest.fixture(scope='module', autouse=True)
def clear_settings():
settings = Settings()
settings.clear()


class TestFileTranscriberWidget:
def test_should_set_window_title(self, qtbot: QtBot):
widget = FileTranscriberWidget(
Expand Down
5 changes: 3 additions & 2 deletions tests/transcriber_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ class TestWhisperCppFileTranscriber:
@pytest.mark.parametrize(
'word_level_timings,expected_segments',
[
(False, [Segment(0, 1840, 'Bienvenue dans Passe Relle.')]),
(True, [Segment(30, 280, 'Bien'), Segment(280, 630, 'venue')])
(False, [Segment(0, 6560,
'Bienvenue dans Passe-Relle. Un podcast pensé pour évêiller la curiosité des apprenances')]),
(True, [Segment(0, 30, ''), Segment(30, 330, 'Bien'), Segment(330, 740, 'venue')])
])
def test_transcribe(self, qtbot: QtBot, word_level_timings: bool, expected_segments: List[Segment]):
file_transcription_options = FileTranscriptionOptions(
Expand Down
2 changes: 1 addition & 1 deletion whisper.cpp
Submodule whisper.cpp updated 105 files

0 comments on commit fba8817

Please sign in to comment.