Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,18 @@
|
|
1 |
import gradio as gr
|
2 |
|
|
|
|
|
3 |
|
4 |
-
|
5 |
-
|
6 |
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
import whisper
|
4 |
+
from transformers import pipeline
|
5 |
|
6 |
+
model_name = "Aismantas/whisper-base-lithuanian"
|
7 |
+
asr_pipeline = pipeline("automatic-speech-recognition", model=model_name)
|
8 |
|
9 |
+
def transcribe(filepath):
|
10 |
+
# Assuming the file is named 'audio.wav'
|
11 |
+
audio_file = "example_1.wav"
|
12 |
+
|
13 |
+
# Run the transcription
|
14 |
+
return asr_pipeline(audio_file)
|
15 |
+
|
16 |
+
|
17 |
+
demo = gr.Interface(fn=transcribe, inputs=[gr.Audio(type='filepath')], outputs="text")
|
18 |
demo.launch()
|