limcheekin's picture
feat: converted readme.md to index.html
7652cb7
raw
history blame
612 Bytes
from llama_cpp.server.app import create_app, Settings
from fastapi.responses import HTMLResponse
import os
print("os.cpu_count()", os.cpu_count())
app = create_app(
Settings(
n_threads=os.cpu_count(),
model="model/ggmlv3-model.bin",
embedding=False
)
)
@app.get("/", response_class=HTMLResponse)
async def read_items():
with open("index.html", "r") as f:
content = f.read()
return content
if __name__ == "__main__":
import uvicorn
uvicorn.run(app,
host=os.environ["HOST"],
port=int(os.environ["PORT"])
)