Skip to content

Commit

Permalink
feat: use pre-converted whisper model
Browse files Browse the repository at this point in the history
  • Loading branch information
winstxnhdw committed Sep 17, 2023
1 parent d8def81 commit 375b279
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions capgen/transcriber/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Transcriber:
transcribe(file: str | BinaryIO, caption_format: Literal['srt']) -> str:
converts transcription segments into a SRT file
"""
model = WhisperModel('large-v2', device="cpu", compute_type='auto')
model = WhisperModel('large-v2', device="cpu", compute_type='auto', num_workers=4)

@classmethod
def toggle_device(cls):
Expand All @@ -26,7 +26,7 @@ def toggle_device(cls):
toggles the device between CPU and GPU
"""
cls.model = WhisperModel(
'large-v2',
'guillaumekln/faster-whisper-large-v2',
device="cpu" if cls.model.model.device == "cuda" else "cuda",
compute_type='auto'
)
Expand Down

0 comments on commit 375b279

Please sign in to comment.