Commit
·
5ff6775
1
Parent(s):
b636de7
Update main.py
Browse files
main.py
CHANGED
@@ -1,23 +1,4 @@
|
|
1 |
-
from llama_cpp.server.app import create_app, Settings
|
2 |
-
from fastapi.responses import HTMLResponse
|
3 |
-
import os
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
model="model/gguf-model.bin",
|
9 |
-
embedding=False
|
10 |
-
)
|
11 |
-
)
|
12 |
-
|
13 |
-
# Read the content of index.html once and store it in memory
|
14 |
-
with open("index.html", "r") as f:
|
15 |
-
content = f.read()
|
16 |
-
|
17 |
-
|
18 |
-
@app.get("/", response_class=HTMLResponse)
|
19 |
-
async def read_items():
|
20 |
-
return content
|
21 |
-
|
22 |
-
import uvicorn
|
23 |
-
uvicorn.run(app, host=os.environ["HOST"], port=int(os.environ["PORT"]))
|
|
|
|
|
|
|
|
|
1 |
|
2 |
+
import subprocess
|
3 |
+
command = ["python3", "-m", "llama_cpp.server", "--model", "model/gguf-model.bin", "--host", "0.0.0.0", "--port", "2600"]
|
4 |
+
subprocess.Popen(command)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|