Update app.py
Browse files
app.py
CHANGED
@@ -2,18 +2,19 @@ from fastapi import FastAPI, Request
|
|
2 |
from fastapi.responses import HTMLResponse, StreamingResponse
|
3 |
from fastapi.staticfiles import StaticFiles
|
4 |
from modules.pmbl import PMBL
|
5 |
-
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
10 |
|
11 |
app = FastAPI(docs_url=None, redoc_url=None)
|
12 |
|
13 |
app.mount("/static", StaticFiles(directory="static"), name="static")
|
14 |
app.mount("/templates", StaticFiles(directory="templates"), name="templates")
|
15 |
|
16 |
-
pmbl = PMBL("./PMB-7b.Q6_K.gguf")
|
17 |
|
18 |
@app.head("/")
|
19 |
@app.get("/")
|
|
|
2 |
from fastapi.responses import HTMLResponse, StreamingResponse
|
3 |
from fastapi.staticfiles import StaticFiles
|
4 |
from modules.pmbl import PMBL
|
5 |
+
import torch
|
6 |
|
7 |
+
print(f"CUDA available: {torch.cuda.is_available()}")
|
8 |
+
print(f"CUDA device count: {torch.cuda.device_count()}")
|
9 |
+
if torch.cuda.is_available():
|
10 |
+
print(f"CUDA device name: {torch.cuda.get_device_name(0)}")
|
11 |
|
12 |
app = FastAPI(docs_url=None, redoc_url=None)
|
13 |
|
14 |
app.mount("/static", StaticFiles(directory="static"), name="static")
|
15 |
app.mount("/templates", StaticFiles(directory="templates"), name="templates")
|
16 |
|
17 |
+
pmbl = PMBL("./PMB-7b.Q6_K.gguf", gpu_layers=50)
|
18 |
|
19 |
@app.head("/")
|
20 |
@app.get("/")
|