Skip to content
Snippets Groups Projects
Commit 0555d4dc authored by Andres Marafioti's avatar Andres Marafioti
Browse files

pass the current language around

parent e2c9d968
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ import torch
from baseHandler import BaseHandler
from rich.console import Console
import logging
from shared_variables import current_language
logger = logging.getLogger(__name__)
console = Console()
......
......@@ -5,6 +5,7 @@ import librosa
import numpy as np
from rich.console import Console
import torch
from shared_variables import current_language
logger = logging.getLogger(__name__)
......@@ -53,7 +54,6 @@ class MeloTTSHandler(BaseHandler):
def process(self, llm_sentence):
console.print(f"[green]ASSISTANT: {llm_sentence}")
global current_language
if self.language != current_language:
self.model = TTS(language=WHISPER_LANGUAGE_TO_MELO_LANGUAGE[self.language], device=self.device)
self.speaker_id = self.model.hps.data.spk2id[WHISPER_LANGUAGE_TO_MELO_SPEAKER[self.language]]
......
......@@ -48,7 +48,6 @@ os.environ["TORCHINDUCTOR_CACHE_DIR"] = os.path.join(CURRENT_DIR, "tmp")
console = Console()
logging.getLogger("numba").setLevel(logging.WARNING) # quiet down numba logs
current_language = "en"
def prepare_args(args, prefix):
......
current_language = "en"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment