|
import gradio as gr |
|
import pandas as pd |
|
import io |
|
|
|
|
|
model = gr.load("models/luigisaetta/whisper-atcosim3") |
|
|
|
|
|
def process_output(audio): |
|
|
|
transcription = model(audio) |
|
|
|
|
|
|
|
|
|
|
|
|
|
df = pd.DataFrame(transcription) |
|
|
|
|
|
csv_buffer = io.StringIO() |
|
df.to_csv(csv_buffer, index=False) |
|
csv_buffer.seek(0) |
|
|
|
return csv_buffer.getvalue() |
|
|
|
|
|
iface = gr.Interface( |
|
fn=process_output, |
|
inputs=gr.Audio(type="file"), |
|
outputs=gr.File(type="csv"), |
|
title="Audio Transcription to CSV", |
|
description="Upload an audio file and get the transcription in a CSV format with timestamps." |
|
) |
|
|
|
|
|
iface.launch() |
|
|
|
|