CoCoCap-beta / app.py
Wataru's picture
added files
0eb9cd6
raw
history blame
592 Bytes
from transformers import pipeline
import gradio as gr
transcribe = pipeline(
task="automatic-speech-recognition",
model="ckpt_large_v2/checkpoint-1740",
tokenizer="ckpt_large_v2",
chunk_length_s=30,
device=-1,
)
transcribe.model.config.forced_decoder_ids = transcribe.tokenizer.get_decoder_prompt_ids(language="ja", task="transcribe")
def main(audio_path):
return transcribe(audio_path)["text"]
iface = gr.Interface(
fn=main,
inputs=gr.inputs.Audio(type='filepath'),
outputs="text",
title="Whisper-base finetuned on Coco-Nut Corpus",
).launch(share=True)