lmzjms commited on
Commit
06be3a6
·
1 Parent(s): e1b797b

Update audio_foundation_models.py

Browse files
Files changed (1) hide show
  1. audio_foundation_models.py +3 -2
audio_foundation_models.py CHANGED
@@ -556,7 +556,7 @@ class SoundDetection:
556
  self.model.to(device)
557
 
558
  @prompts(name="Detect The Sound Event From The Audio",
559
- description="useful for when you want to know what event in the audio and the sound event start or end time, "
560
  "receives audio_path as input. "
561
  "The input to this tool should be a string, "
562
  "representing the audio_path. " )
@@ -769,7 +769,8 @@ class TargetSoundDetection:
769
  "The input to this tool should be a comma seperated string of two, "
770
  "representing audio path and the text description. " )
771
 
772
- def inference(self, text, audio_path):
 
773
  target_emb = self.build_clip(text) # torch type
774
  idx = self.cal_similarity(target_emb, self.re_embeds)
775
  target_event = self.id_to_event[idx]
 
556
  self.model.to(device)
557
 
558
  @prompts(name="Detect The Sound Event From The Audio",
559
+ description="useful for when you want to know what event in the audio and the sound event start or end time, it will return an image "
560
  "receives audio_path as input. "
561
  "The input to this tool should be a string, "
562
  "representing the audio_path. " )
 
769
  "The input to this tool should be a comma seperated string of two, "
770
  "representing audio path and the text description. " )
771
 
772
+ def inference(self, inputs):
773
+ audio_path, text = inputs.split(",")[0], ','.join(inputs.split(',')[1:])
774
  target_emb = self.build_clip(text) # torch type
775
  idx = self.cal_similarity(target_emb, self.re_embeds)
776
  target_event = self.id_to_event[idx]