Spaces:
Build error
Build error
from transformers import pipeline | |
import gradio as gr | |
import hopsworks | |
from pytube import Youtube | |
amp = hopsworks.login() | |
data = amp.get_model_registry() | |
pipe = pipeline(model = 'CsanadT/model_name') | |
def live_performance(audio): | |
text = pipe(audio)['text'] | |
return text | |
def url_performance(link): | |
selected_video = Youtube(str(link), only_audio = True) | |
with gr.Blocks() as demo: | |
with gr.Tab('Live audio'): | |
iface = gr.Interface( | |
fn=live_performance, | |
inputs=gr.Audio(source="microphone", type="filepath"), | |
outputs="text", | |
title="Whisper Small Hungarian", | |
description="Real-time demo for Hungarian speech recognition using a fine-tuned Whisper small model." | |
) | |
with gr.Tab('Transcription from URL'): | |
iface = gr.Interface( | |
fn=url_performance, | |
inputs=gr.Textbox(label='Paste the UL here'), | |
outputs="text", | |
title="Whisper Small Hungarian", | |
description="Real-time demo for Hungarian speech recognition using a fine-tuned Whisper small model." | |
) | |
demo.launch() |