philipp-zettl commited on
Commit
538b126
·
verified ·
1 Parent(s): d41d3c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -3
app.py CHANGED
@@ -1,8 +1,18 @@
1
  import gradio as gr
2
 
 
 
3
 
4
- def greet(audio):
5
- return "Hello " + audio + "!!"
6
 
7
- demo = gr.Interface(fn=greet, inputs="audio", outputs="text")
 
 
 
 
 
 
 
 
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()