From da8b6bbce1040ce8a4a58b959faec14e969294a0 Mon Sep 17 00:00:00 2001 From: loupzeur <20752997+loupzeur@users.noreply.github.com> Date: Wed, 20 Sep 2023 09:57:02 +0200 Subject: [PATCH] fix: xtts not taking into account device flag (#2951) * fix: xtts not taking into account device flag * Style changes --------- Co-authored-by: Julian Weber --- TTS/tts/models/xtts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TTS/tts/models/xtts.py b/TTS/tts/models/xtts.py index 0836870e29..a23a0f5f65 100644 --- a/TTS/tts/models/xtts.py +++ b/TTS/tts/models/xtts.py @@ -642,7 +642,7 @@ def load_checkpoint( self.init_models() if eval: self.gpt.init_gpt_for_inference(kv_cache=self.args.kv_cache) - self.load_state_dict(load_fsspec(model_path)["model"], strict=strict) + self.load_state_dict(load_fsspec(model_path, map_location=self.device)["model"], strict=strict) if eval: self.gpt.init_gpt_for_inference(kv_cache=self.args.kv_cache)