forked from open-webui/open-webui
Update Dockerfile
This commit is contained in:
parent
733d69425e
commit
a649dc80c0
1 changed files with 32 additions and 27 deletions
59
Dockerfile
59
Dockerfile
|
@ -50,6 +50,11 @@ ENV OPENAI_API_KEY="" \
|
||||||
SCARF_NO_ANALYTICS=true \
|
SCARF_NO_ANALYTICS=true \
|
||||||
DO_NOT_TRACK=true
|
DO_NOT_TRACK=true
|
||||||
|
|
||||||
|
# Use locally bundled version of the LiteLLM cost map json
|
||||||
|
# to avoid repetitive startup connections
|
||||||
|
ENV LITELLM_LOCAL_MODEL_COST_MAP="True"
|
||||||
|
|
||||||
|
|
||||||
#### Other models #########################################################
|
#### Other models #########################################################
|
||||||
## whisper TTS model settings ##
|
## whisper TTS model settings ##
|
||||||
ENV WHISPER_MODEL="base" \
|
ENV WHISPER_MODEL="base" \
|
||||||
|
@ -66,39 +71,39 @@ WORKDIR /app/backend
|
||||||
COPY ./backend/requirements.txt ./requirements.txt
|
COPY ./backend/requirements.txt ./requirements.txt
|
||||||
|
|
||||||
RUN if [ "$USE_CUDA" = "true" ]; then \
|
RUN if [ "$USE_CUDA" = "true" ]; then \
|
||||||
# If you use CUDA the whisper and embedding modell will be downloaded on first use
|
# If you use CUDA the whisper and embedding modell will be downloaded on first use
|
||||||
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/$USE_CUDA_DOCKER_VER --no-cache-dir && \
|
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/$USE_CUDA_DOCKER_VER --no-cache-dir && \
|
||||||
pip3 install -r requirements.txt --no-cache-dir && \
|
pip3 install -r requirements.txt --no-cache-dir && \
|
||||||
python -c "import os; from faster_whisper import WhisperModel; WhisperModel(os.environ['WHISPER_MODEL'], device='cpu', compute_type='int8', download_root=os.environ['WHISPER_MODEL_DIR'])" && \
|
python -c "import os; from faster_whisper import WhisperModel; WhisperModel(os.environ['WHISPER_MODEL'], device='cpu', compute_type='int8', download_root=os.environ['WHISPER_MODEL_DIR'])" && \
|
||||||
python -c "import os; from chromadb.utils import embedding_functions; sentence_transformer_ef = embedding_functions.SentenceTransformerEmbeddingFunction(model_name=os.environ['RAG_EMBEDDING_MODEL'], device='cpu')"; \
|
python -c "import os; from chromadb.utils import embedding_functions; sentence_transformer_ef = embedding_functions.SentenceTransformerEmbeddingFunction(model_name=os.environ['RAG_EMBEDDING_MODEL'], device='cpu')"; \
|
||||||
else \
|
else \
|
||||||
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu --no-cache-dir && \
|
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu --no-cache-dir && \
|
||||||
pip3 install -r requirements.txt --no-cache-dir && \
|
pip3 install -r requirements.txt --no-cache-dir && \
|
||||||
python -c "import os; from faster_whisper import WhisperModel; WhisperModel(os.environ['WHISPER_MODEL'], device='cpu', compute_type='int8', download_root=os.environ['WHISPER_MODEL_DIR'])" && \
|
python -c "import os; from faster_whisper import WhisperModel; WhisperModel(os.environ['WHISPER_MODEL'], device='cpu', compute_type='int8', download_root=os.environ['WHISPER_MODEL_DIR'])" && \
|
||||||
python -c "import os; from chromadb.utils import embedding_functions; sentence_transformer_ef = embedding_functions.SentenceTransformerEmbeddingFunction(model_name=os.environ['RAG_EMBEDDING_MODEL'], device='cpu')"; \
|
python -c "import os; from chromadb.utils import embedding_functions; sentence_transformer_ef = embedding_functions.SentenceTransformerEmbeddingFunction(model_name=os.environ['RAG_EMBEDDING_MODEL'], device='cpu')"; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
RUN if [ "$USE_OLLAMA" = "true" ]; then \
|
RUN if [ "$USE_OLLAMA" = "true" ]; then \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
# Install pandoc and netcat
|
# Install pandoc and netcat
|
||||||
apt-get install -y --no-install-recommends pandoc netcat-openbsd && \
|
apt-get install -y --no-install-recommends pandoc netcat-openbsd && \
|
||||||
# for RAG OCR
|
# for RAG OCR
|
||||||
apt-get install -y --no-install-recommends ffmpeg libsm6 libxext6 && \
|
apt-get install -y --no-install-recommends ffmpeg libsm6 libxext6 && \
|
||||||
# install helper tools
|
# install helper tools
|
||||||
apt-get install -y --no-install-recommends curl && \
|
apt-get install -y --no-install-recommends curl && \
|
||||||
# install ollama
|
# install ollama
|
||||||
curl -fsSL https://ollama.com/install.sh | sh && \
|
curl -fsSL https://ollama.com/install.sh | sh && \
|
||||||
# cleanup
|
# cleanup
|
||||||
rm -rf /var/lib/apt/lists/*; \
|
rm -rf /var/lib/apt/lists/*; \
|
||||||
else \
|
else \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
# Install pandoc and netcat
|
# Install pandoc and netcat
|
||||||
apt-get install -y --no-install-recommends pandoc netcat-openbsd && \
|
apt-get install -y --no-install-recommends pandoc netcat-openbsd && \
|
||||||
# for RAG OCR
|
# for RAG OCR
|
||||||
apt-get install -y --no-install-recommends ffmpeg libsm6 libxext6 && \
|
apt-get install -y --no-install-recommends ffmpeg libsm6 libxext6 && \
|
||||||
# cleanup
|
# cleanup
|
||||||
rm -rf /var/lib/apt/lists/*; \
|
rm -rf /var/lib/apt/lists/*; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue