Add os for additional attempt
Browse files
start.py
CHANGED
@@ -1,7 +1,16 @@
|
|
|
|
1 |
import subprocess
|
2 |
|
3 |
-
#
|
4 |
subprocess.run("pip uninstall -y llama-cpp-python", shell=True)
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
subprocess.run(install_command, shell=True)
|
|
|
1 |
+
import os
|
2 |
import subprocess
|
3 |
|
4 |
+
# Uninstall the existing llama-cpp-python package
|
5 |
subprocess.run("pip uninstall -y llama-cpp-python", shell=True)
|
6 |
|
7 |
+
# Get the path to the CUDA compiler
|
8 |
+
cuda_path = "/usr/local/cuda"
|
9 |
+
nvcc_path = os.path.join(cuda_path, "bin", "nvcc")
|
10 |
+
|
11 |
+
# Set the CMAKE_CUDA_COMPILER environment variable
|
12 |
+
os.environ["CMAKE_CUDA_COMPILER"] = nvcc_path
|
13 |
+
|
14 |
+
# Install llama-cpp-python with CUDA support
|
15 |
+
install_command = "pip install llama-cpp-python --install-option='--cmake-args=-DLLAMA_CUDA=on'"
|
16 |
subprocess.run(install_command, shell=True)
|