From b9929649d0a1090a4099986b6dab1ad5b49f5bbe Mon Sep 17 00:00:00 2001 From: Bernhard Schlegel Date: Mon, 22 Jan 2024 09:55:59 +0100 Subject: [PATCH] check TORCH_DEVICE for being None --- marker/settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/marker/settings.py b/marker/settings.py index 9f2591e5..3dd22839 100644 --- a/marker/settings.py +++ b/marker/settings.py @@ -112,7 +112,7 @@ def TORCH_DEVICE_MODEL(self) -> str: @computed_field @property def CUDA(self) -> bool: - return "cuda" in self.TORCH_DEVICE + return self.TORCH_DEVICE is not None and "cuda" in self.TORCH_DEVICE @computed_field @property @@ -132,4 +132,4 @@ class Config: extra = "ignore" -settings = Settings() \ No newline at end of file +settings = Settings()