Feat : updat requirement & tts
This commit is contained in:
@@ -4,14 +4,14 @@ import soundfile as sf
|
||||
import subprocess
|
||||
import re
|
||||
|
||||
# 🇺🇸 'a' => American English, 🇬🇧 'b' => British English
|
||||
# 🇯🇵 'j' => Japanese: pip install misaki[ja]
|
||||
# 🇨🇳 'z' => Mandarin Chinese: pip install misaki[zh]
|
||||
pipeline = KPipeline(lang_code='a') # <= make sure lang_code matches voice
|
||||
|
||||
class Speech():
|
||||
def __init__(self) -> None:
|
||||
self.pipeline = KPipeline(lang_code='a')
|
||||
def __init__(self, language = "english") -> None:
|
||||
self.lang_map = {
|
||||
"english": 'a', # 🇺🇸 'a' => American English
|
||||
"chinese": 'z', # 🇯🇵 'j' => Japanese: pip install misaki[ja]
|
||||
"japanese": 'j' # # 🇨🇳 'z' => Mandarin Chinese: pip install misaki[zh]
|
||||
}
|
||||
self.pipeline = KPipeline(lang_code=self.lang_map[language])
|
||||
|
||||
def speak(self, sentence):
|
||||
sentence = self.clean_sentence(sentence)
|
||||
|
||||
@@ -17,7 +17,7 @@ class BashInterpreter(Tools):
|
||||
super().__init__()
|
||||
self.tag = "bash"
|
||||
|
||||
def execute(self, commands: str, safety = False, timeout = 10):
|
||||
def execute(self, commands: str, safety = False, timeout = 1000):
|
||||
"""
|
||||
Execute bash commands.
|
||||
"""
|
||||
@@ -35,7 +35,7 @@ class BashInterpreter(Tools):
|
||||
return output.strip()
|
||||
except subprocess.CalledProcessError as e:
|
||||
return f"Command execution failed:\n{e.output}"
|
||||
except subprocess.TimeoutExpired:
|
||||
except subprocess.TimeoutExpired as e:
|
||||
return f"Command timed out. Output:\n{e.output}"
|
||||
|
||||
def interpreter_feedback(self, output):
|
||||
|
||||
Reference in New Issue
Block a user