This commit is contained in:
thiswillbeyourgithub 2024-09-13 17:18:44 +02:00
parent a7ea07036e
commit 82b35492af
2 changed files with 2 additions and 0 deletions

View File

@ -41,6 +41,7 @@ def serve(
)
try:
import torch
assert torch.cuda.is_available(), "CUDA not available"
typer.echo("CUDA seems to be working")
except Exception as e:

View File

@ -38,6 +38,7 @@ USE_CUDA = os.environ.get("USE_CUDA_DOCKER", "false")
if USE_CUDA.lower() == "true":
try:
import torch
assert torch.cuda.is_available(), "CUDA not available"
DEVICE_TYPE = "cuda"
except Exception as e: