Sergidev commited on
Commit
4394ff1
1 Parent(s): 99b094e

Add os for additional attempt

Browse files
Files changed (1) hide show
  1. start.py +11 -2
start.py CHANGED
@@ -1,7 +1,16 @@
 
1
  import subprocess
2
 
3
- # commented because the existing llama-cpp-python package was renoved fron requirements.txt
4
  subprocess.run("pip uninstall -y llama-cpp-python", shell=True)
5
 
6
- install_command = "CMAKE_ARGS='-DLLAMA_CUDA=on -DCMAKE_CUDA_COMPILER=./usr/local/cuda/bin/nvcc' pip install llama-cpp-python"
 
 
 
 
 
 
 
 
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)