BramLeo commited on
Commit
0dc5b09
·
verified ·
1 Parent(s): 38484a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -9,6 +9,7 @@ from llama_index.core.node_parser import SentenceSplitter
9
  from llama_index.embeddings.huggingface import HuggingFaceEmbedding
10
  from llama_index.core import Settings
11
  from llama_cpp import Llama
 
12
 
13
  # Fungsi untuk memasang ulang llama-cpp-python dengan dukungan CUDA
14
  def install_llama_with_cuda():
@@ -20,12 +21,10 @@ def install_llama_with_cuda():
20
  # Install setiap paket dengan CMAKE_ARGS untuk dukungan CUDA
21
  for package in packages:
22
  subprocess.run(
23
- [
24
- package, "--force-reinstall", "--no-cache-dir"
25
- ],
26
- env={"CMAKE_ARGS": "-DGGML_CUDA=on"},
27
- check=True
28
- )
29
  # Periksa apakah CUDA Toolkit tersedia
30
  if not shutil.which("nvcc"):
31
  print("CUDA Toolkit tidak ditemukan. Pastikan sudah diinstal.")
 
9
  from llama_index.embeddings.huggingface import HuggingFaceEmbedding
10
  from llama_index.core import Settings
11
  from llama_cpp import Llama
12
+ from huggingface_hub import hf_hub_download
13
 
14
  # Fungsi untuk memasang ulang llama-cpp-python dengan dukungan CUDA
15
  def install_llama_with_cuda():
 
21
  # Install setiap paket dengan CMAKE_ARGS untuk dukungan CUDA
22
  for package in packages:
23
  subprocess.run(
24
+ ["pip", "install", "--force-reinstall", "--no-cache-dir", "llama-cpp-python"],
25
+ env={"CMAKE_ARGS": "-DGGML_CUDA=on"},
26
+ check=True
27
+ )
 
 
28
  # Periksa apakah CUDA Toolkit tersedia
29
  if not shutil.which("nvcc"):
30
  print("CUDA Toolkit tidak ditemukan. Pastikan sudah diinstal.")