You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on whisper speech to text, I have two option for user for converting speech to text, microphone and audio file.
once audio or microphone is on when user speaks, output text box saying error same for when audio file uploaded and click on submit.
Have you searched existing issues? 🔎
I have searched and found no existing issues
Reproduction
importgradioasgr
'''
import whisper
You can choose your model from - see it on readme file and update the modelname
modelname = "base"
model = whisper.load_model(modelname)
import gradio as gr
import time
def transcribe(audio):
# load audio and pad/trim it to fit 30 seconds
audio = whisper.load_audio(audio)
audio = whisper.pad_or_trim(audio)
# make log-Mel spectrogram and move to the same device as the model
mel = whisper.log_mel_spectrogram(audio).to(model.device)
# detect the spoken language
_, probs = model.detect_language(mel)
print(f"Detected language: {max(probs, key=probs.get)}")
# decode the audio
options = whisper.DecodingOptions()
result = whisper.decode(model, mel, options)
return result.text
interface = gr.Interface(
fn=transcribe,
inputs=[gr.Audio(), gr.File()], # Microphone and file options, no source argument
outputs="text",
description="Speech to Text for Medical Summarization"
)
interface.launch()
'''
Screenshot
Logs
No response
System Info
Latest version 4.29.0
Severity
Blocking usage of gradio
The text was updated successfully, but these errors were encountered:
Describe the bug
I am working on whisper speech to text, I have two option for user for converting speech to text, microphone and audio file.
once audio or microphone is on when user speaks, output text box saying error same for when audio file uploaded and click on submit.
Have you searched existing issues? 🔎
Reproduction
'''
import whisper
You can choose your model from - see it on readme file and update the modelname
modelname = "base"
model = whisper.load_model(modelname)
import gradio as gr
import time
def transcribe(audio):
interface = gr.Interface(
fn=transcribe,
inputs=[gr.Audio(), gr.File()], # Microphone and file options, no source argument
outputs="text",
description="Speech to Text for Medical Summarization"
)
interface.launch()
'''
Screenshot
Logs
No response
System Info
Severity
Blocking usage of gradio
The text was updated successfully, but these errors were encountered: