Feat : updat requirement & tts

This commit is contained in:
martin legrand 2025-02-23 10:36:17 +01:00
parent 561169b90a
commit 298c26a63f
5 changed files with 19 additions and 19 deletions

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
*.wav
# Byte-compiled / optimized / DLL files # Byte-compiled / optimized / DLL files
__pycache__/ __pycache__/
*.py[cod] *.py[cod]

View File

@ -26,7 +26,7 @@ def main():
server_address="192.168.1.100:5000") server_address="192.168.1.100:5000")
agent = CoderAgent(model="deepseek-r1:14b", agent = CoderAgent(model="deepseek-r1:14b",
name="Marcus the code agent", name="jarvis",
prompt_path="prompts/coder_agent.txt", prompt_path="prompts/coder_agent.txt",
provider=server_provider) provider=server_provider)

View File

@ -1,14 +1,11 @@
requests==2.28.2 requests==2.31.0
colorama==0.4.6 openai==1.61.1
openai==0.27.4
colorama==0.4.6 colorama==0.4.6
python-dotenv==1.0.0 python-dotenv==1.0.0
playsound==1.3.0 playsound==1.3.0
ipython==8.8.0 transformers==4.48.3
pyperclip==1.8.2 torch==2.5.1
transformers==4.33.3 ollama==0.4.7
torch==2.2.0 scipy==1.15.1
ollama==0.1.9
scipy==1.13.0
kokoro==0.7.12 kokoro==0.7.12
flask==3.1.0 flask==3.1.0

View File

@ -4,14 +4,14 @@ import soundfile as sf
import subprocess import subprocess
import re 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(): class Speech():
def __init__(self) -> None: def __init__(self, language = "english") -> None:
self.pipeline = KPipeline(lang_code='a') 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): def speak(self, sentence):
sentence = self.clean_sentence(sentence) sentence = self.clean_sentence(sentence)

View File

@ -17,7 +17,7 @@ class BashInterpreter(Tools):
super().__init__() super().__init__()
self.tag = "bash" self.tag = "bash"
def execute(self, commands: str, safety = False, timeout = 10): def execute(self, commands: str, safety = False, timeout = 1000):
""" """
Execute bash commands. Execute bash commands.
""" """
@ -35,7 +35,7 @@ class BashInterpreter(Tools):
return output.strip() return output.strip()
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
return f"Command execution failed:\n{e.output}" 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}" return f"Command timed out. Output:\n{e.output}"
def interpreter_feedback(self, output): def interpreter_feedback(self, output):