owlninjam commited on
Commit
c38026e
·
verified ·
1 Parent(s): cfae17d

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import subprocess
2
+ import os
3
+
4
+ model_path = "capybarahermes-2.5-mistral-7b.Q5_K_M.gguf"
5
+
6
+ # Download model if not exists
7
+ if not os.path.exists(model_path):
8
+ subprocess.run([
9
+ "wget",
10
+ "https://huggingface.co/TheBloke/CapybaraHermes-2.5-Mistral-7B-GGUF/resolve/main/" + model_path
11
+ ])
12
+
13
+ # Run llama.cpp server
14
+ subprocess.run([
15
+ "./main",
16
+ "-m", model_path,
17
+ "--host", "0.0.0.0",
18
+ "--port", "7860",
19
+ "-c", "2048",
20
+ "-t", "2"
21
+ ])