From a77e5e81fc6a57ec88dc4c8dcc99ea56c2d26d20 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 31 May 2024 14:20:29 +0200 Subject: [PATCH] fix windows issue with uname --- alphadia/libtransform.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/alphadia/libtransform.py b/alphadia/libtransform.py index b1721720..46125a60 100644 --- a/alphadia/libtransform.py +++ b/alphadia/libtransform.py @@ -301,7 +301,11 @@ def forward(self, input: SpecLibBase) -> SpecLibBase: # Check if CPU or GPU/MPS should be used device = "cpu" if self.use_gpu: - device = "mps" if os.uname().sysname == "Darwin" else "gpu" + try: + device = "mps" if os.uname().sysname == "Darwin" else "gpu" + except AttributeError: + # Windows does not support uname + device = "gpu" model_mgr = ModelManager(device=device) if self.checkpoint_folder_path is not None: