Merge remote-tracking branch 'upstream/main' into add_client_queue
This commit is contained in:
@@ -0,0 +1,45 @@
|
|||||||
|
FROM ubuntu:focal
|
||||||
|
|
||||||
|
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 whisper_live /app/whisper_live
|
||||||
|
|
||||||
|
COPY run_server.py /app
|
||||||
|
CMD ["python", "run_server.py"]
|
||||||
@@ -36,10 +36,12 @@ WORKDIR /app
|
|||||||
COPY setup.sh /app
|
COPY setup.sh /app
|
||||||
COPY requirements/ /app
|
COPY requirements/ /app
|
||||||
|
|
||||||
|
RUN apt update --fix-missing
|
||||||
RUN bash setup.sh
|
RUN bash setup.sh
|
||||||
RUN pip install -r server.txt
|
RUN pip install -r server.txt
|
||||||
|
|
||||||
RUN pip install whisper-live
|
COPY whisper_live /app/whisper_live
|
||||||
|
|
||||||
COPY run_server.py /app
|
COPY run_server.py /app
|
||||||
|
|
||||||
CMD ["python", "run_server.py"]
|
CMD ["python", "run_server.py"]
|
||||||
@@ -9,7 +9,7 @@ README = (HERE / "README.md").read_text()
|
|||||||
|
|
||||||
# This call to setup() does all the work
|
# This call to setup() does all the work
|
||||||
setup(name="whisper-live",
|
setup(name="whisper-live",
|
||||||
version="0.0.4",
|
version="0.0.5",
|
||||||
description="A nearly-live implementation of OpenAI's Whisper.",
|
description="A nearly-live implementation of OpenAI's Whisper.",
|
||||||
long_description=README,
|
long_description=README,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
|||||||
@@ -149,10 +149,11 @@ class ServeClient:
|
|||||||
self.frames = b""
|
self.frames = b""
|
||||||
self.language = language if multilingual else "en"
|
self.language = language if multilingual else "en"
|
||||||
self.task = task
|
self.task = task
|
||||||
|
device = "cuda" if torch.cuda.is_available() else "cpu"
|
||||||
self.transcriber = WhisperModel(
|
self.transcriber = WhisperModel(
|
||||||
"small" if multilingual else "small.en",
|
"small" if multilingual else "small.en",
|
||||||
device=device if device else "cuda",
|
device=device,
|
||||||
compute_type="float16",
|
compute_type="int8" if device=="cpu" else "float16",
|
||||||
local_files_only=False,
|
local_files_only=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user