From 08f888a4cf2add6e31fa07975f3f32f26f449926 Mon Sep 17 00:00:00 2001 From: makaveli10 Date: Tue, 11 Jul 2023 14:39:50 +0800 Subject: [PATCH 1/4] update req --- requirements/server.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/requirements/server.txt b/requirements/server.txt index 5e7084c..dc4dba5 100644 --- a/requirements/server.txt +++ b/requirements/server.txt @@ -1,6 +1,7 @@ PyAudio faster-whisper==0.6.0 paho-mqtt ---extra-index-url https://download.pytorch.org/whl/cu113 -torch==1.12.1 +--extra-index-url https://download.pytorch.org/whl/cu111 +torch==1.10.1 +torchaudio==0.10.1 websockets \ No newline at end of file From c6f9c9420e12633a80121fe9a0950d880d6dc697 Mon Sep 17 00:00:00 2001 From: makaveli10 Date: Tue, 11 Jul 2023 14:40:12 +0800 Subject: [PATCH 2/4] add Dockerfile --- Dockerfile | 44 ++++++++++++++++++++++++++++++++++++++++++++ server.py | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..98f82c2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,44 @@ +FROM nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04 + +ARG DEBIAN_FRONTEND=noninteractive + +# Remove any third-party apt sources to avoid issues with expiring keys. +RUN rm -f /etc/apt/sources.list.d/*.list + +# Install some basic utilities. +RUN apt-get update && apt-get install -y \ + curl \ + ca-certificates \ + sudo \ + git \ + bzip2 \ + libx11-6 \ + && rm -rf /var/lib/apt/lists/* + +RUN apt update + +# install python +RUN apt install software-properties-common -y && \ + add-apt-repository ppa:deadsnakes/ppa && \ + apt update + +RUN apt install python3-dev -y && \ + apt install python-is-python3 + + +# install pip +RUN apt install python3-pip -y + +# Create a working directory. +RUN mkdir /app +WORKDIR /app + +COPY setup.sh /app +COPY requirements/ /app + +RUN bash setup.sh +RUN pip install -r server.txt + +COPY *py /app + +CMD ["python", "server.py"] diff --git a/server.py b/server.py index 82f3d06..f189214 100644 --- a/server.py +++ b/server.py @@ -277,5 +277,5 @@ class ServeClient: if __name__ == "__main__": - with serve(recv_audio, "127.0.0.1", 9090) as server: + with serve(recv_audio, "0.0.0.0", 9090) as server: server.serve_forever() \ No newline at end of file From 38bc68bf7b441eb6b643c29e014e53ada5bd7e70 Mon Sep 17 00:00:00 2001 From: makaveli10 Date: Tue, 11 Jul 2023 18:49:01 +0800 Subject: [PATCH 3/4] remove paho mqtt from req --- requirements/server.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements/server.txt b/requirements/server.txt index dc4dba5..2a34780 100644 --- a/requirements/server.txt +++ b/requirements/server.txt @@ -1,6 +1,5 @@ PyAudio faster-whisper==0.6.0 -paho-mqtt --extra-index-url https://download.pytorch.org/whl/cu111 torch==1.10.1 torchaudio==0.10.1 From 119cdf53a23af2f43b28e7275991a716c780943f Mon Sep 17 00:00:00 2001 From: makaveli10 Date: Tue, 11 Jul 2023 18:56:13 +0800 Subject: [PATCH 4/4] update readme --- README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3d5127f..9039b97 100644 --- a/README.md +++ b/README.md @@ -46,13 +46,28 @@ Unlike traditional speech recognition systems that rely on continuous audio stre ``` This would start the websocket server on port ```9090```. +### Chrome Extension +- Head over to ```Audio-Transcription``` module to unpack and load a chrome extension to capture any audio in the browser and send it to the websocket server to transcribe the audio in the current tab. -- Head over to ```Audio-Transcription``` module to unpack and load a chrome extension to capture any audio in the browser(only Chrome for now) and send it to the websocket server to transcribe the audio in the current tab. +### Firefox Extension +- Refer to [Audio-Transcription-Firefox](https://github.com/collabora/whisper-live/tree/main/Audio-Transcription-Firefox#readme) to use mozilla firefox extension. + + +## Whisper Live Server in Docker +- Build docker container +```bash + docker build . -t whisper-live +``` + +- Run docker container +```bash + docker run -it --gpus all -p 9090:9090 whisper-live:latest +``` ## Future Work - [ ] Update Documentation. -- [ ] Keep only a single server implementation i.e. websockets and get rid of the socket implementation in ```server.py```. Also, update ```client.py``` to websockets-client implemenation. +- [x] Keep only a single server implementation i.e. websockets and get rid of the socket implementation in ```server.py```. Also, update ```client.py``` to websockets-client implemenation. - [ ] Add translation to other languages on top of transcription. ## Citations