mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
refac: dockerfile
This commit is contained in:
parent
898826dc22
commit
be373e9fd4
1 changed files with 4 additions and 5 deletions
|
|
@ -123,7 +123,6 @@ RUN apt-get update && \
|
||||||
COPY --chown=$UID:$GID ./backend/requirements.txt ./requirements.txt
|
COPY --chown=$UID:$GID ./backend/requirements.txt ./requirements.txt
|
||||||
|
|
||||||
RUN pip3 install --no-cache-dir uv && \
|
RUN pip3 install --no-cache-dir uv && \
|
||||||
if [ "$USE_SLIM" != "true" ]; then \
|
|
||||||
if [ "$USE_CUDA" = "true" ]; then \
|
if [ "$USE_CUDA" = "true" ]; then \
|
||||||
# If you use CUDA the whisper and embedding model will be downloaded on first use
|
# If you use CUDA the whisper and embedding model 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 && \
|
||||||
|
|
@ -134,17 +133,17 @@ RUN pip3 install --no-cache-dir uv && \
|
||||||
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 && \
|
||||||
uv pip install --system -r requirements.txt --no-cache-dir && \
|
uv pip install --system -r requirements.txt --no-cache-dir && \
|
||||||
|
if [ "$USE_SLIM" != "true" ]; then \
|
||||||
python -c "import os; from sentence_transformers import SentenceTransformer; SentenceTransformer(os.environ['RAG_EMBEDDING_MODEL'], device='cpu')" && \
|
python -c "import os; from sentence_transformers import SentenceTransformer; SentenceTransformer(os.environ['RAG_EMBEDDING_MODEL'], device='cpu')" && \
|
||||||
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; import tiktoken; tiktoken.get_encoding(os.environ['TIKTOKEN_ENCODING_NAME'])"; \
|
python -c "import os; import tiktoken; tiktoken.get_encoding(os.environ['TIKTOKEN_ENCODING_NAME'])"; \
|
||||||
fi; \
|
fi; \
|
||||||
else \
|
|
||||||
uv pip install --system -r requirements.txt --no-cache-dir; \
|
|
||||||
fi; \
|
fi; \
|
||||||
mkdir -p /app/backend/data && chown -R $UID:$GID /app/backend/data/
|
mkdir -p /app/backend/data && chown -R $UID:$GID /app/backend/data/ && \
|
||||||
|
rm -rf /var/lib/apt/lists/*;
|
||||||
|
|
||||||
# Install Ollama if requested
|
# Install Ollama if requested
|
||||||
RUN if [ "$USE_OLLAMA" = "true" ] && [ "$USE_SLIM" != "true" ]; then \
|
RUN if [ "$USE_OLLAMA" = "true" ]; then \
|
||||||
date +%s > /tmp/ollama_build_hash && \
|
date +%s > /tmp/ollama_build_hash && \
|
||||||
echo "Cache broken at timestamp: `cat /tmp/ollama_build_hash`" && \
|
echo "Cache broken at timestamp: `cat /tmp/ollama_build_hash`" && \
|
||||||
curl -fsSL https://ollama.com/install.sh | sh && \
|
curl -fsSL https://ollama.com/install.sh | sh && \
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue