Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speech to text output text box issue #8307

Closed
1 task done
monishreddye opened this issue May 16, 2024 · 2 comments
Closed
1 task done

Speech to text output text box issue #8307

monishreddye opened this issue May 16, 2024 · 2 comments
Labels
bug Something isn't working pending clarification

Comments

@monishreddye
Copy link

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? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr

'''
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

gradio output textbox gradio output textbox

Logs

No response

System Info

Latest version 4.29.0

Severity

Blocking usage of gradio

@monishreddye monishreddye added the bug Something isn't working label May 16, 2024
@abidlabs
Copy link
Member

abidlabs commented May 16, 2024

Hi @monishreddye can you please clarify what the error is, and correct the formatting of your code so that we can repro?

@abidlabs
Copy link
Member

Closing for now, we can reopen with more details

@abidlabs abidlabs closed this as not planned Won't fix, can't repro, duplicate, stale May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending clarification
Projects
None yet
Development

No branches or pull requests

2 participants