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/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 diff --git a/requirements/server.txt b/requirements/server.txt index 5e7084c..2a34780 100644 --- a/requirements/server.txt +++ b/requirements/server.txt @@ -1,6 +1,6 @@ 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 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