The from_pretrained and from_local methods with the @classmethod decorator in zonos/model.py take a device: str = DEFAULT_DEVICE argument with str as its type hint. However, DEFAULT_DEVICE and get_device defined in zonos/utils.py shows that they're actually of torch.device type:
def get_device() -> torch.device:
if torch.cuda.is_available():
return torch.device(torch.cuda.current_device())
# MPS breaks for whatever reason. Uncomment when it's working.
# if torch.mps.is_available():
# return torch.device("mps")
return torch.device("cpu")
DEFAULT_DEVICE = get_device()
Is the type hint of the methods' argument wrong?
The
from_pretrainedandfrom_localmethods with the @classmethod decorator inzonos/model.pytake adevice: str = DEFAULT_DEVICEargument with str as its type hint. However,DEFAULT_DEVICEandget_devicedefined inzonos/utils.pyshows that they're actually oftorch.devicetype:Is the type hint of the methods' argument wrong?