Fix LLAMA_CUBLAS deprecated error: Use GGML_CUDA flag with CPU fallback
Browse files- Dockerfile +8 -4
Dockerfile
CHANGED
|
@@ -25,9 +25,13 @@ COPY requirements.txt .
|
|
| 25 |
# Install PyTorch with CUDA support
|
| 26 |
RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
|
| 27 |
|
| 28 |
-
# Install llama-cpp-python with CUDA support
|
| 29 |
-
ENV CMAKE_ARGS="-
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
# Install other requirements
|
| 33 |
RUN pip install -r requirements.txt
|
|
@@ -44,4 +48,4 @@ ENV HF_HOME=/.cache
|
|
| 44 |
EXPOSE 7860
|
| 45 |
|
| 46 |
# Run the application
|
| 47 |
-
CMD ["python", "app.py"]
|
|
|
|
| 25 |
# Install PyTorch with CUDA support
|
| 26 |
RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
|
| 27 |
|
| 28 |
+
# Install llama-cpp-python with CUDA support (using new GGML_CUDA flag)
|
| 29 |
+
ENV CMAKE_ARGS="-DGGML_CUDA=on"
|
| 30 |
+
ENV FORCE_CMAKE=1
|
| 31 |
+
# Try CUDA build first, fallback to CPU if it fails
|
| 32 |
+
RUN pip install llama-cpp-python --force-reinstall --no-cache-dir || \
|
| 33 |
+
(echo "CUDA build failed, installing CPU version..." && \
|
| 34 |
+
CMAKE_ARGS="" pip install llama-cpp-python --force-reinstall --no-cache-dir)
|
| 35 |
|
| 36 |
# Install other requirements
|
| 37 |
RUN pip install -r requirements.txt
|
|
|
|
| 48 |
EXPOSE 7860
|
| 49 |
|
| 50 |
# Run the application
|
| 51 |
+
CMD ["python", "app.py"]
|