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
d9cfb0f
law-bot
/
libs
/
utils.py
anpigon
Upload 20 files
de850e8
verified
6 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"