SillyTavern / SillyTavern-Extras

Extensions API for SillyTavern.
GNU Affero General Public License v3.0
549 stars 124 forks source link

Docker setup on mac m2 #175

Open cornoctopus opened 11 months ago

cornoctopus commented 11 months ago

Hello. Is it possible to use container with extras on m2 mac? I'm not sure because dockerfile has: FROM nvidia/cuda:11.7.1-cudnn8-runtime-ubuntu20.04

And also in guide for local install I see this: If you run on Apple Silicon (M1/M2), use the requirements-silicon.txt file instead.

Cohee1207 commented 11 months ago

I have limited knowledge about running Extras in Docker, especially on Mac, I was running it natively on M1 and it works great. You can just try running it in Docker yourself. If it doesn't work - look to adjust the dockerfile to remove the nvidia base image and replace it with vanilla ubuntu.

Dalethium commented 11 months ago

in your docker compose build section, to use silicon, do this:

  args:
    REQUIREMENTS: requirements-silicon.txt

Here's a snippit of my docker compose:

services:
  sillytavernextras:
    runtime: nvidia
    image: cohee1207/sillytavern-extras
    build:
      context: ./SillyTavern-Extras/
      dockerfile: ./SillyTavern-Extras/docker/Dockerfile
      args:
        REQUIREMENTS: requirements-complete.txt
        MODULES: caption,summarize,classify,chromadb
    volumes:
      - "/chromadb:/chromadb"
      - "/cache:/root/.cache"
      - /sillytavernextras/api_key.txt:/sillytavern-extras/api_key.txt
    restart: unless-stopped
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    command: python server.py --enable-modules=caption,summarize,classify,chromadb --listen --chroma-folder=/chromadb/ --chroma-persist --secure --classification-model=joeddav/distilbert-base-uncased-go-emotions-student --cuda --port=443