law-bot / utils.py
anpigon's picture
chore: Add utils, config, embeddings, retrievers, prompt, and llm modules
56487d0
raw
history blame
198 Bytes
# utils.py
import torch
def get_device():
if torch.cuda.is_available():
return "cuda:0"
elif torch.backends.mps.is_available():
return "mps"
else:
return "cpu"