Commit
·
914e2c8
1
Parent(s):
f35cfb5
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import pipeline
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
pipe = pipeline(model="SharatChandra/whisper-fine-banking-dataset") # change to "your-username/the-name-you-picked"
|
| 5 |
+
|
| 6 |
+
def transcribe(audio):
|
| 7 |
+
text = pipe(audio, generate_kwargs = {"task":"translate", "language":"english"})["text"]
|
| 8 |
+
return text
|
| 9 |
+
|
| 10 |
+
iface = gr.Interface(
|
| 11 |
+
fn=transcribe,
|
| 12 |
+
inputs=gr.Audio(type="filepath"),
|
| 13 |
+
outputs="text",
|
| 14 |
+
title="Whisper Medium Bank Domain",
|
| 15 |
+
description="Realtime demo for Banking Domain speech recognition using a fine-tuned Whisper medium model.",
|
| 16 |
+
)
|
| 17 |
+
|
| 18 |
+
iface.launch()
|