Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -69,23 +69,8 @@ def transcribe_and_feedback(audio, system_message, max_tokens, temperature, top_
|
|
69 |
demo = gr.Interface(
|
70 |
fn=transcribe_and_feedback, # The function that transcribes audio and provides feedback
|
71 |
inputs=[
|
72 |
-
gr.Audio(
|
73 |
gr.Textbox(value="Please read a simple sentence.", label="System message"), # Message used to generate text
|
74 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"), # Controls max token length for the generated text
|
75 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"), # Temperature control for text generation
|
76 |
-
gr.Slider(minimum=0.1, maximum=1.0, value=0.95
|
77 |
-
],
|
78 |
-
outputs=[
|
79 |
-
gr.Textbox(label="Transcription"), # Display transcription of the audio
|
80 |
-
gr.Textbox(label="Pronunciation Feedback"), # Feedback on pronunciation
|
81 |
-
gr.Textbox(label="Generated Text (What You Were Supposed to Read)") # Display the text generated by the API
|
82 |
-
],
|
83 |
-
title="Speech-to-Text with Pronunciation Feedback",
|
84 |
-
description="Record an audio sample and the system will transcribe it, "
|
85 |
-
"compare your transcription to the generated text, and give pronunciation feedback.",
|
86 |
-
live=True # Real-time interaction
|
87 |
-
)
|
88 |
-
|
89 |
-
|
90 |
-
if __name__ == "__main__":
|
91 |
-
demo.launch(enable_queue=True, show_error=True)
|
|
|
69 |
demo = gr.Interface(
|
70 |
fn=transcribe_and_feedback, # The function that transcribes audio and provides feedback
|
71 |
inputs=[
|
72 |
+
gr.Audio(type="filepath", label="Record Audio"), # Microphone input for recording
|
73 |
gr.Textbox(value="Please read a simple sentence.", label="System message"), # Message used to generate text
|
74 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"), # Controls max token length for the generated text
|
75 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"), # Temperature control for text generation
|
76 |
+
gr.Slider(minimum=0.1, maximum=1.0, value=0.95
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|