Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import subprocess
|
2 |
+
import os
|
3 |
+
|
4 |
+
# Go one directory up
|
5 |
+
os.chdir("..")
|
6 |
+
|
7 |
+
# Prepare the command
|
8 |
+
command = [
|
9 |
+
"python",
|
10 |
+
"run_inference_server.py",
|
11 |
+
"-m", "./models/ggml-model-i2_s.gguf",
|
12 |
+
"--host", "0.0.0.0",
|
13 |
+
"--port", "7860"
|
14 |
+
]
|
15 |
+
|
16 |
+
# Run it as a subprocess
|
17 |
+
try:
|
18 |
+
subprocess.run(command, check=True)
|
19 |
+
except subprocess.CalledProcessError as e:
|
20 |
+
print(f"Error running inference server: {e}")
|