Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
anpigon
/
law-bot
like
2
Runtime error
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
0a79aa1
law-bot
/
utils.py
anpigon
chore: Add utils, config, embeddings, retrievers, prompt, and llm modules
56487d0
8 months ago
raw
Copy download link
history
blame
Safe
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"