fix(config): drop nonexistent config.use_cpu setting

This commit is contained in:
psychedelicious 2024-03-11 22:57:31 +11:00
parent a72cea014c
commit 7b1f9409bc

View File

@ -16,9 +16,7 @@ config = InvokeAIAppConfig.get_config()
def choose_torch_device() -> torch.device: def choose_torch_device() -> torch.device:
"""Convenience routine for guessing which GPU device to run model on""" """Convenience routine for guessing which GPU device to run model on"""
if config.use_cpu: # legacy setting - force CPU if config.device == "auto":
return CPU_DEVICE
elif config.device == "auto":
if torch.cuda.is_available(): if torch.cuda.is_available():
return torch.device("cuda") return torch.device("cuda")
if hasattr(torch.backends, "mps") and torch.backends.mps.is_available(): if hasattr(torch.backends, "mps") and torch.backends.mps.is_available():