Swedish_ASmR / app.py
adjoint-bass's picture
"changed app.py"
5b077dd
raw
history blame
1.14 kB
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()