GGUF-Interface / app.py
AFischer1985's picture
Rename run.py to app.py
06acc79
raw
history blame
708 Bytes
from llama_cpp.server.app import create_app, Settings
from fastapi.responses import HTMLResponse
import os
app = create_app(
Settings(
n_threads=2, # set to number of cpu cores
model="https://huggingface.co/TheBloke/OpenHermes-2-Mistral-7B-GGUF/resolve/main/openhermes-2-mistral-7b.Q4_0.gguf",
embedding=False
)
)
# Read the content of index.html once and store it in memory
with open("index.html", "r") as f:
content = f.read()
@app.get("/", response_class=HTMLResponse)
async def read_items():
return content
if __name__ == "__main__":
import uvicorn
uvicorn.run(app,
host="0.0.0.0",
port=int("2600")
)