huytofu92 commited on
Commit
3c1a68d
·
1 Parent(s): f8efe10

Enhance audio agent

Browse files
Files changed (2) hide show
  1. audio_tools.py +1 -1
  2. mini_agents.py +1 -1
audio_tools.py CHANGED
@@ -16,7 +16,7 @@ class TranscribeAudioTool(Tool):
16
  output_type = "string"
17
 
18
  def setup(self):
19
- self.model = InferenceClient(model="openai/whisper-large-v3", token=os.getenv("HUGGINGFACE_API_KEY"))
20
 
21
  def forward(self, audio: str) -> str:
22
  audio_data = base64.b64decode(audio)
 
16
  output_type = "string"
17
 
18
  def setup(self):
19
+ self.model = InferenceClient(model="openai/whisper-large-v3", provider="hf-inference", token=os.getenv("HUGGINGFACE_API_KEY"))
20
 
21
  def forward(self, audio: str) -> str:
22
  audio_data = base64.b64decode(audio)
mini_agents.py CHANGED
@@ -41,7 +41,7 @@ audio_agent = CodeAgent(
41
  tools=[transcribe_audio_tool, audio_to_base64, noise_reduction, audio_segmentation, speaker_diarization],
42
  max_steps=6,
43
  # prompt_templates=PROMPT_TEMPLATE["audio_agent"],
44
- additional_authorized_imports=["pytube", "pytube3", "youtube_dl", "pydub", "pyAudioAnalysis", "base64", "io", "sklearn", "scipy", "numpy", "pandas", "json", "os", "logging", "yaml", "pyplot", "matplotlib", 'hmmlearn', 'pickle'],
45
  name="audio_agent",
46
  description="This agent is responsible for rocessing audio, transcribing audio and extracting text from it. It cannot process videos."
47
  )
 
41
  tools=[transcribe_audio_tool, audio_to_base64, noise_reduction, audio_segmentation, speaker_diarization],
42
  max_steps=6,
43
  # prompt_templates=PROMPT_TEMPLATE["audio_agent"],
44
+ additional_authorized_imports=["wave", "speech_recognition", "pytube", "pytube3", "youtube_dl", "pydub", "pyAudioAnalysis", "base64", "io", "sklearn", "scipy", "numpy", "pandas", "json", "os", "logging", "yaml", "pyplot", "matplotlib", 'hmmlearn', 'pickle'],
45
  name="audio_agent",
46
  description="This agent is responsible for rocessing audio, transcribing audio and extracting text from it. It cannot process videos."
47
  )