Skip to content

Commit

Permalink
build: add numpy to server dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
winstxnhdw committed Jun 18, 2024
1 parent 61e4a5d commit 949ce16
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions capgen/transcriber/transcriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,18 @@ def __init__(
number_of_workers: int = 1,
):
model_parameters: WhisperParameters = {
'model_size_or_path': 'Systran/faster-distil-whisper-large-v3',
'model_size_or_path': 'distil-large-v3',
'device': device,
'compute_type': 'auto',
'cpu_threads': number_of_threads,
'num_workers': number_of_workers,
}

self.model = WhisperModel(**model_parameters)
try:
self.model = WhisperModel(**model_parameters, flash_attention=True)

except ValueError:
self.model = WhisperModel(**model_parameters)

async def transcribe(self, file: str | BinaryIO, caption_format: str) -> str | None:
"""
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ readme = "README.md"
[tool.poetry.dependencies]
python = "^3.12"
faster-whisper = "^1.0.2"
numpy = "<2.0.0"
nvidia-cudnn-cu12 = { version = "8.9.7.29", optional = true }
nvidia-cublas-cu12 = { version = "^12.5.2.13", optional = true }

Expand All @@ -49,6 +48,7 @@ gunicorn = "^22.0.0"
uvicorn = "^0.30.0"
httptools = "^0.6.1"
uvloop = "^0.19.0"
numpy = "<2.0.0"

[tool.poetry.group.dev.dependencies]
pyright = "^1.1.367"
Expand Down

0 comments on commit 949ce16

Please sign in to comment.