Skip to content

Commit 7e89908

Browse files
authored
Merge pull request #495 from classtranscribe/UpdateForWhisper
Update for whisper
2 parents 7df2b1d + e5f9bbe commit 7e89908

File tree

3 files changed

+68
-78
lines changed

3 files changed

+68
-78
lines changed

PythonRpcServer/requirements.txt

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
1-
# 2024-1-17 Removed Pygments,python-genutils and ipython
2-
# Also removed jedi. why autocomplete?? jedi==0.19.1
3-
#Why? prompt-toolkit==3.0.43
4-
5-
#Did not try updating (maybe nexttime)
6-
#protobuf==3.15.0 #4.25.2
7-
protobuf==4.25.2
8-
9-
#Floowing Updated to latest 2024-1-17:
10-
certifi==2024.7.4
1+
# 2025-4-30
2+
protobuf
3+
certifi==2025.4.26
114
backcall==0.2.0
125
chardet==5.2.0
13-
click==8.1.7
14-
decorator==5.1.1
6+
click==8.1.8
7+
decorator==5.2.1
158
ffmpy==0.3.1
16-
grpcio==1.60.0
17-
grpcio-tools==1.60.0
18-
idna==3.7
9+
grpcio
10+
grpcio-tools
11+
idna==3.10
1912
KalturaApiClient==19.3.0
2013
lxml==5.1.0
2114
parso==0.8.3
@@ -29,11 +22,45 @@ tqdm==4.66.3
2922
traitlets==4.3.3
3023
urllib3==2.2.2
3124
wcwidth==0.2.13
32-
33-
# Not versioned
3425
numpy
35-
# No longer maintained pytube # if not available, use the tar.gz package (see Dockerfile)
3626
yt-dlp
27+
28+
# 2024-1-17 Removed Pygments,python-genutils and ipython
29+
# Also removed jedi. why autocomplete?? jedi==0.19.1
30+
#Why? prompt-toolkit==3.0.43
31+
32+
#Did not try updating (maybe nexttime)
33+
#protobuf==3.15.0 #4.25.2
34+
# protobuf==4.25.2
35+
36+
# #Floowing Updated to latest 2024-1-17:
37+
# certifi==2024.7.4
38+
# backcall==0.2.0
39+
# chardet==5.2.0
40+
# click==8.1.7
41+
# decorator==5.1.1
42+
# ffmpy==0.3.1
43+
# grpcio==1.60.0
44+
# grpcio-tools==1.60.0
45+
# idna==3.7
46+
# KalturaApiClient==19.3.0
47+
# lxml==5.1.0
48+
# parso==0.8.3
49+
# pexpect==4.9.0
50+
# pickleshare==0.7.5
51+
# ptyprocess==0.7.0
52+
# requests==2.32.2
53+
# requests-toolbelt==1.0.0
54+
# six==1.16.0
55+
# tqdm==4.66.3
56+
# traitlets==4.3.3
57+
# urllib3==2.2.2
58+
# wcwidth==0.2.13
59+
60+
# # Not versioned
61+
# numpy
62+
# # No longer maintained pytube # if not available, use the tar.gz package (see Dockerfile)
63+
# yt-dlp
3764
#Always get latest
3865

3966
# protobuf version 3.18.3 causes NotImplementedError("To be implemented") in PythonRpcServer/mediaprovider.py

pythonrpcserver.Dockerfile

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# ------------------------------
22
# Stage 1: Build Whisper.cpp
33
# ------------------------------
4-
FROM --platform=linux/amd64 python:3.8.15-slim-buster AS whisperbuild
4+
FROM --platform=linux/amd64 python:3.13.3-bookworm AS whisperbuild
55
RUN apt-get update && \
6-
apt-get install -y curl gcc g++ make libglib2.0-0 libsm6 libxext6 libxrender-dev ffmpeg git && \
7-
apt-get install -y wget && \
6+
apt-get install -y curl gcc g++ make libglib2.0-0 libsm6 libxext6 libxrender-dev ffmpeg git wget && \
87
wget https://github.com/Kitware/CMake/releases/download/v3.27.7/cmake-3.27.7-linux-x86_64.sh -O /tmp/cmake-install.sh && \
98
chmod +x /tmp/cmake-install.sh && \
109
/tmp/cmake-install.sh --skip-license --prefix=/usr/local && \
@@ -19,27 +18,38 @@ RUN bash ./models/download-ggml-model.sh tiny.en
1918
RUN bash ./models/download-ggml-model.sh large-v3
2019

2120
# ------------------------------
22-
# Stage 2: Setup Python RPC Server
21+
# Stage 2: Build Python Dependencies
2322
# ------------------------------
24-
FROM --platform=linux/amd64 python:3.8.15-slim-buster AS rpcserver
23+
FROM --platform=linux/amd64 python:3.13.3-bookworm AS builder
24+
RUN apt-get update && apt-get install -y build-essential libxml2-dev libxslt1-dev zlib1g-dev libssl-dev libffi-dev python3-dev
25+
26+
COPY ./PythonRpcServer/requirements.txt .
27+
RUN pip install --no-cache-dir --upgrade pip && \
28+
pip wheel --wheel-dir=/wheels -r requirements.txt
29+
30+
# ------------------------------
31+
# Stage 3: Setup Python RPC Server
32+
# ------------------------------
33+
FROM --platform=linux/amd64 python:3.13.3-slim-bookworm AS rpcserver
2534
RUN apt-get update && \
26-
apt-get install -y curl gcc g++ make libglib2.0-0 libsm6 libxext6 libxrender-dev ffmpeg
35+
apt-get install -y curl gcc g++ make libglib2.0-0 libsm6 libxext6 libxrender-dev ffmpeg libxml2-dev libxslt1-dev zlib1g-dev libssl-dev libffi-dev python3-dev
2736

2837
ENV OMP_THREAD_LIMIT=1
2938
COPY --from=whisperbuild /whisper.cpp/build/bin/whisper-cli /usr/local/bin/whisper
3039
COPY --from=whisperbuild /whisper.cpp/models /PythonRpcServer/models
31-
WORKDIR /PythonRpcServer
3240

41+
# copy pre-built wheels from builder stage
42+
COPY --from=builder /wheels /wheels
43+
COPY ./PythonRpcServer/requirements.txt .
44+
RUN pip install --no-cache-dir --upgrade pip && \
45+
pip install --no-cache-dir --find-links=/wheels -r requirements.txt
46+
47+
WORKDIR /PythonRpcServer
3348
COPY ./PythonRpcServer/transcribe_hellohellohello.wav .
3449
RUN whisper -ojf -f transcribe_hellohellohello.wav
3550

36-
COPY ./PythonRpcServer/requirements.txt requirements.txt
37-
RUN pip install --no-cache-dir --upgrade pip && \
38-
pip install --no-cache-dir -r requirements.txt
39-
4051
COPY ct.proto ct.proto
4152
RUN python -m grpc_tools.protoc -I . --python_out=./ --grpc_python_out=./ ct.proto
4253

4354
COPY ./PythonRpcServer .
44-
45-
CMD [ "nice", "-n", "18", "ionice", "-c", "2", "-n", "6", "python3", "-u", "/PythonRpcServer/server.py" ]
55+
CMD ["nice", "-n", "18", "ionice", "-c", "2", "-n", "6", "python3", "-u", "/PythonRpcServer/server.py"]

pythonrpcserver_legacy.Dockerfile

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)