diff --git a/Dockerfile b/Dockerfile index c37860a..cd649b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,35 @@ -FROM python:3.9-slim +FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04 -WORKDIR /app +# Set noninteractive mode to avoid tzdata and other interactive prompts +ENV DEBIAN_FRONTEND=noninteractive +# Install prerequisites for adding repositories +RUN apt-get update && apt-get install -y --no-install-recommends \ + software-properties-common \ + && rm -rf /var/lib/apt/lists/* + +# Add deadsnakes PPA for Python 3.9 +RUN add-apt-repository ppa:deadsnakes/ppa -y + +# Install Python 3.9, python3.9-distutils, pip, and other dependencies RUN apt-get update && \ - apt-get install -y ffmpeg jq curl unzip && \ + apt-get install -y python3.9 python3.9-distutils python3-pip ffmpeg jq curl unzip && \ rm -rf /var/lib/apt/lists/* -# Copy requirements file (if you have one) and install Python dependencies +# Set python3.9 as the default python3 and upgrade pip +RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 && \ + pip3 install --no-cache-dir --upgrade pip + +# Set the working directory +WORKDIR /app + +# Copy requirements file and install Python dependencies +# (Ensure your requirements.txt includes the correct CUDA-enabled PyTorch version, +# for example: torch==1.13.1+cu113 -f https://download.pytorch.org/whl/torch_stable.html) COPY requirements.txt . -RUN pip install --no-cache-dir -r requirements.txt +RUN pip3 install --no-cache-dir -r requirements.txt - -# Download TwitchDownloaderCLI (adjust version if necessary) +# Download and install TwitchDownloaderCLI (adjust version if necessary) RUN curl -L https://github.com/lay295/TwitchDownloader/releases/download/1.55.2/TwitchDownloaderCLI-1.55.2-Linux-x64.zip \ -o /tmp/TwitchDownloaderCLI.zip && \ unzip /tmp/TwitchDownloaderCLI.zip -d /tmp && \ @@ -19,10 +37,10 @@ RUN curl -L https://github.com/lay295/TwitchDownloader/releases/download/1.55.2/ chmod +x /usr/local/bin/TwitchDownloaderCLI && \ rm /tmp/TwitchDownloaderCLI.zip -# Copy application code, the entrypoint script, and channels.json +# Copy application code and other necessary files COPY main.py . COPY channels.json . COPY cookies.txt . -# Default command -CMD ["python", "-u", "main.py"] \ No newline at end of file +# Default command to run your application +CMD ["python3", "-u", "main.py"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 70069a2..7d40724 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,14 +1,477 @@ services: - scanner_cyr: + scanner_amfikcz: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia environment: - - CHANNEL_NAME=cyr - - CHANNEL_LANGUAGE=en - - TIMEDELTA_DAYS=8 + - CHANNEL_NAME=amfikcz + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 - TIMEDELTA_DAYS_EXACT=false - CLIP_CREATE_FROM_CHAT=false - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es - image: t0is/madmonq-transcriptor-image:latest + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_andrej_kalinin: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=andrej_kalinin + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_artix: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=artix + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_astatoro: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=astatoro + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_avatar0fwar: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=avatar0fwar + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_batmanova: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=batmanova + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_bladeito: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=bladeito + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_claina: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=claina + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_cyr: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=cyr + - CHANNEL_LANGUAGE=en + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_domovnikofc: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=domovnikofc + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_elbowcz146: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=elbowcz146 + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_fluffcz: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=fluffcz + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_flyguncz: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=flyguncz + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_freezecz: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=freezecz + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_heddi2k: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=heddi2k + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_herdyn: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=herdyn + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_himtheoldboy: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=himtheoldboy + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_holasovic: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=holasovic + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_hornakcz: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=hornakcz + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_jorantheviking: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=jorantheviking + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda volumes: - /shared/transcriptor/clips:/app/clips - /shared/transcriptor/vods:/app/vods @@ -17,15 +480,166 @@ services: - /shared/transcriptor/models:/app/models - /shared/transcriptor/transcripts:/app/transcripts scanner_khalamity: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia environment: - CHANNEL_NAME=khalamity - CHANNEL_LANGUAGE=en - - TIMEDELTA_DAYS=8 + - TIMEDELTA_DAYS=10 - TIMEDELTA_DAYS_EXACT=false - CLIP_CREATE_FROM_CHAT=false - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es - image: t0is/madmonq-transcriptor-image:latest + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_kokiii_: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=kokiii_ + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_liveoliverr: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=liveoliverr + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_love_stanislove: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=love_stanislove + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_marty_vole: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=marty_vole + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_mullersie: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=mullersie + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_patrikturi: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=patrikturi + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda volumes: - /shared/transcriptor/clips:/app/clips - /shared/transcriptor/vods:/app/vods @@ -34,15 +648,190 @@ services: - /shared/transcriptor/models:/app/models - /shared/transcriptor/transcripts:/app/transcripts scanner_rachtaz: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia environment: - CHANNEL_NAME=rachtaz - CHANNEL_LANGUAGE=en - - TIMEDELTA_DAYS=8 + - TIMEDELTA_DAYS=10 - TIMEDELTA_DAYS_EXACT=false - CLIP_CREATE_FROM_CHAT=false - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es - image: t0is/madmonq-transcriptor-image:latest + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_resttpowered: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=resttpowered + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_spajkk: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=spajkk + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_styko: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=styko + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_tensterakdary: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=tensterakdary + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_tom__mm: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=tom__mm + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_vvudy: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=vvudy + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda + volumes: + - /shared/transcriptor/clips:/app/clips + - /shared/transcriptor/vods:/app/vods + - /shared/transcriptor/audio:/app/audio + - /shared/transcriptor/chat:/app/chat + - /shared/transcriptor/models:/app/models + - /shared/transcriptor/transcripts:/app/transcripts + scanner_xnapycz: + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + count: all + driver: nvidia + environment: + - CHANNEL_NAME=xnapycz + - CHANNEL_LANGUAGE=cs + - TIMEDELTA_DAYS=10 + - TIMEDELTA_DAYS_EXACT=false + - CLIP_CREATE_FROM_CHAT=false + - TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov + - TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es + image: t0is/madmonq-transcriptor-image:cuda volumes: - /shared/transcriptor/clips:/app/clips - /shared/transcriptor/vods:/app/vods diff --git a/generate-docker-compose.py b/generate-docker-compose.py index f4a8a0b..2ea2d47 100644 --- a/generate-docker-compose.py +++ b/generate-docker-compose.py @@ -1,6 +1,15 @@ import json import yaml +# Custom list class to force inline (flow style) YAML formatting +class InlineList(list): + pass + +def inline_list_representer(dumper, data): + return dumper.represent_sequence('tag:yaml.org,2002:seq', data, flow_style=True) + +yaml.add_representer(InlineList, inline_list_representer) + # Load the channels from channels.json with open("channels.json", "r") as f: channels = json.load(f) @@ -13,24 +22,37 @@ compose = { for channel in channels: service_name = f"scanner_{channel['name']}" compose["services"][service_name] = { - "image": "t0is/madmonq-transcriptor-image:latest", + "image": "t0is/madmonq-transcriptor-image:cuda", "environment": [ f"CHANNEL_NAME={channel['name']}", f"CHANNEL_LANGUAGE={channel['language']}", - "TIMEDELTA_DAYS=8", + "TIMEDELTA_DAYS=10", "TIMEDELTA_DAYS_EXACT=false", "CLIP_CREATE_FROM_CHAT=false", "TWITCH_CLIENT_ID=a0fuj6tm5ct79clvim9816orphqkov", "TWITCH_CLIENT_SECRET=h7whj3yspxgj1909sgcafx6iz1p1es" ], "volumes": [ - "/shared/transcriptor/clips:/app/clips", # Shared clips folder on the host + "/shared/transcriptor/clips:/app/clips", "/shared/transcriptor/vods:/app/vods", "/shared/transcriptor/audio:/app/audio", "/shared/transcriptor/chat:/app/chat", "/shared/transcriptor/models:/app/models", "/shared/transcriptor/transcripts:/app/transcripts" - ] + ], + "deploy": { + "resources": { + "reservations": { + "devices": [ + { + "driver": "nvidia", + "count": "all", + "capabilities": InlineList(["gpu"]) + } + ] + } + } + } } # Write the docker-compose file diff --git a/main.py b/main.py index ea0c1a4..979852d 100644 --- a/main.py +++ b/main.py @@ -161,7 +161,7 @@ def transcribe_audio_fast(audio_file, model_name, language, vod_id): return segments_data # Initialize the model and transcribe (passing language if provided) - model_fast = WhisperModel("large-v3-turbo", device="auto", compute_type="int8", download_root="/app/models") + model_fast = WhisperModel("large-v3-turbo", device="cuda", download_root="/app/models") segments, info = model_fast.transcribe(audio_file, language=language) print("faster_whisper -- Detected language '%s' with probability %f" % (info.language, info.language_probability))