File size: 551 Bytes
3f2dca0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import gradio as gr

from tts import transcribe_audio
from llm import analyze_snippet

def pipeline(audio_path):
    """Pipeline to comunicate tts and kg modules"""
    transcription = transcribe_audio(audio_path)
    bullet_points = analyze_snippet(str(transcription))
    return f"Game Analysis:\n {bullet_points}"


iface = gr.Interface(
    fn=pipeline,
    inputs=gr.Audio(sources="microphone", type="filepath", format="wav"),
    outputs="text",
    title="Sports-Analyzer",
)

if __name__ == "__main__":
    iface.launch()