copy downloaded model
parent
5bc2e260ff
commit
2ab03774e0
|
@ -1,5 +1,6 @@
|
||||||
FROM python:3.10-slim
|
FROM python:3.10-slim
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
build-essential \
|
build-essential \
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
|
@ -11,6 +12,7 @@ WORKDIR /app
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
# Copy app and model
|
||||||
COPY app ./app
|
COPY app ./app
|
||||||
|
|
||||||
EXPOSE 4002
|
EXPOSE 4002
|
||||||
|
|
|
@ -5,8 +5,8 @@ from whispercpp import Whisper
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
|
|
||||||
# Load the model (auto-download and cache it)
|
# Load the local model without Hugging Face token
|
||||||
whisper = Whisper.from_pretrained("base.en") # Options: tiny, base, small, etc.
|
whisper = Whisper.from_pretrained("./app/model/ggml-base.en.bin")
|
||||||
|
|
||||||
@app.post("/transcribe")
|
@app.post("/transcribe")
|
||||||
async def transcribe_audio(audio: UploadFile = File(...)):
|
async def transcribe_audio(audio: UploadFile = File(...)):
|
||||||
|
|
Loading…
Reference in New Issue