From 69622930c750fe9ccffbcc1a7170c3efc1606665 Mon Sep 17 00:00:00 2001 From: Hubert Kasperek <82332291+Hukasx0@users.noreply.github.com> Date: Sat, 27 Jan 2024 21:15:34 +0100 Subject: [PATCH] Ability to run the Coqui TTS extension on the CPU (#5365) --- extensions/coqui_tts/script.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/coqui_tts/script.py b/extensions/coqui_tts/script.py index 26d6b76a..dd3f48e7 100644 --- a/extensions/coqui_tts/script.py +++ b/extensions/coqui_tts/script.py @@ -3,6 +3,7 @@ import json import os import random import time +import torch from pathlib import Path import gradio as gr @@ -23,7 +24,7 @@ params = { "voice": "female_01.wav", "language": "English", "model_name": "tts_models/multilingual/multi-dataset/xtts_v2", - "device": "cuda" + "device": "cuda" if torch.cuda.is_available() else "cpu" } this_dir = str(Path(__file__).parent.resolve())