From 2ab03774e06345e89deaac2efb9b27165943966f Mon Sep 17 00:00:00 2001 From: Kar l5 Date: Sat, 14 Jun 2025 23:36:35 +0530 Subject: [PATCH] copy downloaded model --- Dockerfile | 4 +++- app/main.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index fa7b88e..2d799d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,18 @@ FROM python:3.10-slim +# Install dependencies RUN apt-get update && apt-get install -y \ build-essential \ ffmpeg \ curl \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt +# Copy app and model COPY app ./app EXPOSE 4002 diff --git a/app/main.py b/app/main.py index a9ea22d..f179d57 100644 --- a/app/main.py +++ b/app/main.py @@ -5,8 +5,8 @@ from whispercpp import Whisper app = FastAPI() -# Load the model (auto-download and cache it) -whisper = Whisper.from_pretrained("base.en") # Options: tiny, base, small, etc. +# Load the local model without Hugging Face token +whisper = Whisper.from_pretrained("./app/model/ggml-base.en.bin") @app.post("/transcribe") async def transcribe_audio(audio: UploadFile = File(...)):