RakanAlsheraiwi commited on
Commit
34da04b
1 Parent(s): 666427e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -21,8 +21,8 @@ def pronunciation_evaluator(user_audio, sentence):
21
  # Get a new sentence for the next round
22
  new_sentence = get_sentence()
23
 
24
- # Return the feedback and the new sentence
25
- return f"Recognized Text: {recognized_text}\n\nFeedback: {feedback}", new_sentence
26
 
27
  # Function to get a random sentence
28
  def get_sentence():
@@ -43,13 +43,13 @@ interface = gr.Interface(
43
  fn=pronunciation_evaluator,
44
  inputs=[
45
  gr.Audio(type="filepath", label="Record your pronunciation"),
46
- gr.Textbox(lines=2, label="Sentence to Pronounce", value=initial_sentence, interactive=False), # Display the sentence
47
  gr.State(value=initial_sentence) # Holds the current sentence
48
  ],
49
  outputs=[
50
- "text",
51
- gr.Textbox(label="New Sentence to Pronounce", interactive=False), # Display the new sentence
52
- gr.State() # The new sentence will be stored as the state for the next input
53
  ],
54
  title="Pronunciation Evaluator",
55
  description="Record yourself pronouncing the given sentence and receive feedback. A new sentence will be provided after each evaluation."
 
21
  # Get a new sentence for the next round
22
  new_sentence = get_sentence()
23
 
24
+ # Return the feedback and the new sentence for the next round
25
+ return feedback, new_sentence
26
 
27
  # Function to get a random sentence
28
  def get_sentence():
 
43
  fn=pronunciation_evaluator,
44
  inputs=[
45
  gr.Audio(type="filepath", label="Record your pronunciation"),
46
+ gr.Textbox(lines=2, label="Sentence to Pronounce", value=initial_sentence, interactive=False),
47
  gr.State(value=initial_sentence) # Holds the current sentence
48
  ],
49
  outputs=[
50
+ "text", # Feedback on pronunciation
51
+ gr.Textbox(label="Next Sentence to Pronounce", interactive=False), # Display the new sentence
52
+ gr.State() # State for the next input
53
  ],
54
  title="Pronunciation Evaluator",
55
  description="Record yourself pronouncing the given sentence and receive feedback. A new sentence will be provided after each evaluation."