File size: 409 Bytes
fa11817 f108ac6 fa11817 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import gradio as gr
from faster_whisper import WhisperModel
model = WhisperModel("small",compute_type='auto',num_workers=2, cpu_threads=8)
def test(audio):
segments, info = model.transcribe(audio)
text = ''
for segment in segments:
text = text + segment.text + '\n'
return text
demo = gr.Interface(
test,
gr.Audio(type='filepath'),
'text'
)
demo.launch(share=True)
|