Spaces:
Build error
Build error
File size: 393 Bytes
36bec1c ec72da9 2bacaf7 ec72da9 2bacaf7 ec72da9 2bacaf7 ec72da9 2bacaf7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import gradio as gr
import whisper
model = whisper.load_model("base")
def transcribe(audio):
audio = whisper.pad_or_trim(audio)
mel = whisper.log_mel_spectrogram(audio).to(model.device)
options = whisper.DecodingOptions()
result = whisper.decode(model, mel, options)
return result.text
iface = gr.Interface(fn=transcribe, inputs="audio", outputs="text")
iface.launch()
|