| FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04 |
|
|
| ENV DEBIAN_FRONTEND=noninteractive |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| python3.10 python3.10-venv python3-pip python3.10-dev \ |
| git git-lfs ffmpeg gcc \ |
| libgl1 libglib2.0-0 libsm6 libxrender1 libxext6 libsndfile1 \ |
| && git lfs install \ |
| && ln -sf /usr/bin/python3.10 /usr/bin/python \ |
| && ln -sf /usr/bin/pip3 /usr/bin/pip \ |
| && rm -rf /var/lib/apt/lists/* \ |
| && pip install --no-cache-dir --upgrade pip |
|
|
| |
| RUN useradd -m -u 1000 user |
| USER user |
| ENV HOME=/home/user |
| ENV PATH="/home/user/.local/bin:$PATH" |
|
|
| WORKDIR /app |
|
|
| |
|
|
| |
| RUN pip install --no-cache-dir vllm==0.7.3 |
|
|
| |
| RUN git clone https://github.com/deepbrainai-research/float.git /app/float_repo |
|
|
| |
| COPY --chown=user ./requirements.txt requirements.txt |
| RUN pip install --no-cache-dir \ |
| "numpy<2" \ |
| pyyaml opencv-python pandas tqdm matplotlib flow-vis librosa \ |
| "transformers==4.46.3" "tokenizers>=0.20" "albumentations==1.4.15" "albucore==0.0.16" \ |
| "torchdiffeq==0.2.5" "timm==1.0.9" "face_alignment==1.4.1" "av==12.0.0" \ |
| snac accelerate scipy soundfile vosk \ |
| && pip install --no-cache-dir --upgrade -r requirements.txt |
|
|
| |
| RUN mkdir -p /tmp/videos /tmp/tts_output /tmp/lipsync_output |
|
|
| |
| RUN python -c "from huggingface_hub import snapshot_download; \ |
| snapshot_download('hubertsiuzdak/snac_24khz')" \ |
| || echo 'WARNING: SNAC pre-download failed' |
|
|
| |
| RUN mkdir -p /app/checkpoints && \ |
| python -c "from huggingface_hub import snapshot_download; \ |
| print('Downloading wav2vec2-base-960h...'); \ |
| snapshot_download('facebook/wav2vec2-base-960h', local_dir='/app/checkpoints/wav2vec2-base-960h'); \ |
| print('Downloading emotion model...'); \ |
| snapshot_download('r-f/wav2vec-english-speech-emotion-recognition', local_dir='/app/checkpoints/wav2vec-english-speech-emotion-recognition'); \ |
| print('Models ready')" |
|
|
| |
| RUN python -c "import urllib.request, zipfile, os; \ |
| url='https://alphacephei.com/vosk/models/vosk-model-small-en-us-0.15.zip'; \ |
| print('Downloading Vosk model...'); \ |
| urllib.request.urlretrieve(url, '/tmp/vosk.zip'); \ |
| zipfile.ZipFile('/tmp/vosk.zip').extractall('/app/'); \ |
| os.rename('/app/vosk-model-small-en-us-0.15', '/app/vosk-model'); \ |
| os.unlink('/tmp/vosk.zip'); \ |
| print('Vosk model ready')" |
|
|
| |
| |
| COPY --chown=user ./app.py ./llm.py ./groq_tts.py ./orpheus_tts.py ./float_lipsync.py ./idle_generator.py ./vosk_stt.py /app/ |
|
|
| |
| COPY --chown=user ./avatars/ /app/avatars/ |
|
|
| |
| COPY --chown=user ./app/checkpoints/ /app/checkpoints/ |
|
|
| |
| COPY --chown=user ./voice* /app/ |
|
|
| EXPOSE 7860 |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |