File size: 363 Bytes
860424e
 
2ee9679
860424e
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
from whisper import load_model
from smolagents.tools import tool
# TODO: Add a tool to ask a question about an audio
@tool
def ask_question_about_audio(question: str, path_to_audio: str) -> str:
    """
    Ask a question about an audio and return the answer.
    """
    model = load_model("base")
    res = model.transcribe(path_to_audio)
    return res["text"]