Skip to content

Commit

Permalink
Removed sha256 for whisper model downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleks committed Mar 30, 2024
1 parent 46a719f commit 6b06a71
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# The name of the project, used for API documentation.
PROJECT_NAME="Wordcab Transcribe"
# The version of the project, used for API documentation.
VERSION="0.5.1"
VERSION="0.5.3"
# The description of the project, used for API documentation.
DESCRIPTION="💬 ASR FastAPI server using faster-whisper and Auto-Tuning Spectral Clustering for diarization."
# This API prefix is used for all endpoints in the API outside of the status and cortex endpoints.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import hashlib
import os
import subprocess
from pathlib import Path
Expand Down Expand Up @@ -89,7 +88,7 @@ def build_whisper_trt_model(
None
"""
model_url = _MODELS[model_name]
expected_sha256 = model_url.split("/")[-2]
model_url.split("/")[-2]
model_ckpt_dir = Path(__file__).parent.parent / "assets"
model_ckpt_path = model_ckpt_dir / f"{model_name}.pt"
tokenizer_path = output_dir / "tokenizer.json"
Expand Down Expand Up @@ -132,13 +131,6 @@ def build_whisper_trt_model(
for data in response.iter_content(chunk_size=8192):
size = output.write(data)
pbar.update(size)
with open(model_ckpt_path, "rb") as f:
model_bytes = f.read()
if hashlib.sha256(model_bytes).hexdigest() != expected_sha256:
raise RuntimeError(
"Model has been downloaded but the SHA256 checksum does not not"
" match. Please retry loading the model."
)
logger.info(f"Model '{model_name}' has been downloaded successfully.")

logger.info(f"output_dir: {output_dir} | Exists: {os.path.exists(output_dir)}")
Expand Down

0 comments on commit 6b06a71

Please sign in to comment.