CMLL commited on
Commit
4572637
1 Parent(s): b999ff7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -11
app.py CHANGED
@@ -1,14 +1,26 @@
1
- #@title # Setup
2
- %cd /content/
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
- # zephyr-7b-beta
9
- !wget https://huggingface.co/TheBloke/zephyr-7B-beta-GGUF/resolve/main/zephyr-7b-beta.Q6_K.gguf
10
 
 
 
11
 
12
- #@title # inference
13
- %cd /content/llama.cpp
14
- !./server -m zephyr-7b-beta.Q6_K.gguf -ngl 9999 -c 0 --port 12345
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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"])