Skip to content

Commit

Permalink
Whisper: Make quantization configurable and switch to int8 by default
Browse files Browse the repository at this point in the history
  • Loading branch information
rroohhh authored and phlmn committed Dec 27, 2023
1 parent ce5a614 commit 2ee6e82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions worker/transcribee_worker/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class Settings(BaseSettings):

CPU_THREADS: int = 4

COMPUTE_TYPE: str = "int8"

class Config:
env_file = ".env"

Expand Down
1 change: 1 addition & 0 deletions worker/transcribee_worker/whisper_transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def transcribe_clean(
strict_sentence_paragraphs,
)
model = WhisperModel(
compute_type=settings.COMPUTE_TYPE,
cpu_threads=settings.CPU_THREADS,
model_size_or_path=model_name,
download_root=str((settings.MODELS_DIR / "faster_whisper").absolute()),
Expand Down

0 comments on commit 2ee6e82

Please sign in to comment.