Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,26 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
!rm -rf llama.cpp
|
4 |
-
!git clone https://github.com/ggerganov/llama.cpp.git
|
5 |
-
%cd llama.cpp
|
6 |
-
!make LLAMA_CUBLAS=1
|
7 |
|
8 |
-
#
|
9 |
-
|
10 |
|
|
|
|
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import subprocess
|
2 |
+
import os
|
|
|
|
|
|
|
|
|
3 |
|
4 |
+
# Change directory to /content
|
5 |
+
os.chdir("/content")
|
6 |
|
7 |
+
# Remove the llama.cpp directory if it exists
|
8 |
+
subprocess.run(["rm", "-rf", "llama.cpp"])
|
9 |
|
10 |
+
# Clone the llama.cpp repository
|
11 |
+
subprocess.run(["git", "clone", "https://github.com/ggerganov/llama.cpp.git"])
|
12 |
+
|
13 |
+
# Change directory to llama.cpp
|
14 |
+
os.chdir("llama.cpp")
|
15 |
+
|
16 |
+
# Build the project with LLAMA_CUBLAS=1
|
17 |
+
subprocess.run(["make", "LLAMA_CUBLAS=1"])
|
18 |
+
|
19 |
+
# Download the zephyr-7b-beta model
|
20 |
+
subprocess.run(["wget", "https://huggingface.co/TheBloke/zephyr-7B-beta-GGUF/resolve/main/zephyr-7b-beta.Q6_K.gguf"])
|
21 |
+
|
22 |
+
# Change directory to /content/llama.cpp
|
23 |
+
os.chdir("/content/llama.cpp")
|
24 |
+
|
25 |
+
# Run the server
|
26 |
+
subprocess.run(["./server", "-m", "zephyr-7b-beta.Q6_K.gguf", "-ngl", "9999", "-c", "0", "--port", "12345"])
|