From 298c26a63fe419dd9eae23dc5a53fa26f97c027d Mon Sep 17 00:00:00 2001 From: martin legrand Date: Sun, 23 Feb 2025 10:36:17 +0100 Subject: [PATCH] Feat : updat requirement & tts --- .gitignore | 3 +++ main.py | 2 +- requirements.txt | 15 ++++++--------- sources/text_to_speech.py | 14 +++++++------- sources/tools/BashInterpreter.py | 4 ++-- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 15201ac..c14ab2a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +*.wav + + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/main.py b/main.py index 0128dce..1c967a6 100755 --- a/main.py +++ b/main.py @@ -26,7 +26,7 @@ def main(): server_address="192.168.1.100:5000") agent = CoderAgent(model="deepseek-r1:14b", - name="Marcus the code agent", + name="jarvis", prompt_path="prompts/coder_agent.txt", provider=server_provider) diff --git a/requirements.txt b/requirements.txt index fee1c8d..b08395f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,11 @@ -requests==2.28.2 -colorama==0.4.6 -openai==0.27.4 +requests==2.31.0 +openai==1.61.1 colorama==0.4.6 python-dotenv==1.0.0 playsound==1.3.0 -ipython==8.8.0 -pyperclip==1.8.2 -transformers==4.33.3 -torch==2.2.0 -ollama==0.1.9 -scipy==1.13.0 +transformers==4.48.3 +torch==2.5.1 +ollama==0.4.7 +scipy==1.15.1 kokoro==0.7.12 flask==3.1.0 \ No newline at end of file diff --git a/sources/text_to_speech.py b/sources/text_to_speech.py index 598cf04..dfb52fe 100644 --- a/sources/text_to_speech.py +++ b/sources/text_to_speech.py @@ -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) diff --git a/sources/tools/BashInterpreter.py b/sources/tools/BashInterpreter.py index b07a18b..dbea164 100644 --- a/sources/tools/BashInterpreter.py +++ b/sources/tools/BashInterpreter.py @@ -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):