mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-05-05 17:30:26 +02:00
17 lines
344 B
Python
17 lines
344 B
Python
import torch
|
|
from fastapi import APIRouter
|
|
from fastapi import Response
|
|
|
|
router = APIRouter(prefix="/api")
|
|
|
|
|
|
@router.get("/health")
|
|
def healthcheck() -> Response:
|
|
return Response(status_code=200)
|
|
|
|
|
|
@router.get("/gpu-status")
|
|
def gpu_status() -> dict[str, bool]:
|
|
has_gpu = torch.cuda.is_available()
|
|
return {"gpu_available": has_gpu}
|