Hugging Face
Models
Datasets
Spaces
Community
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
dangtiendatdat
/
real
like
2
Running
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
cb7d3da
real
/
models
/
utils.py
vdkhoihgf
cc
13ba381
5 months ago
raw
Copy download link
history
blame
Safe
272 Bytes
import
logging
import
torch
def
get_device_type
() ->
str
:
if
torch.backends.mps.is_available():
return
"mps"
elif
torch.cuda.is_available():
return
"cuda"
else
:
logging.warning(
"No GPU found, using CPU instead"
)
return
"cpu"