Переглянути джерело

Merge pull request #1577 from justinh-rahb/pip2uv2

Switch `pip3` to `uv` in Dockerfile
Timothy Jaeryang Baek 1 рік тому
батько
коміт
44ad7c4132
1 змінених файлів з 4 додано та 3 видалено
  1. 4 3
      Dockerfile

+ 4 - 3
Dockerfile

@@ -93,15 +93,16 @@ RUN if [ "$USE_OLLAMA" = "true" ]; then \
 # install python dependencies
 COPY ./backend/requirements.txt ./requirements.txt
 
-RUN if [ "$USE_CUDA" = "true" ]; then \
+RUN pip3 install uv && \
+    if [ "$USE_CUDA" = "true" ]; then \
         # 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 -r requirements.txt --no-cache-dir && \
+        uv pip install --system -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 chromadb.utils import embedding_functions; sentence_transformer_ef = embedding_functions.SentenceTransformerEmbeddingFunction(model_name=os.environ['RAG_EMBEDDING_MODEL'], device='cpu')"; \
     else \
         pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu --no-cache-dir && \
-        pip3 install -r requirements.txt --no-cache-dir && \
+        uv pip install --system -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 chromadb.utils import embedding_functions; sentence_transformer_ef = embedding_functions.SentenceTransformerEmbeddingFunction(model_name=os.environ['RAG_EMBEDDING_MODEL'], device='cpu')"; \
     fi