Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -148,14 +148,7 @@ def create_detailed_feedback(transcription, grammar_score, corrected_text,
|
|
148 |
|
149 |
def process_audio(audio):
|
150 |
if audio is None:
|
151 |
-
return
|
152 |
-
"transcription": "No audio provided.",
|
153 |
-
"grammar_score": "",
|
154 |
-
"corrected": "",
|
155 |
-
"feedback": "",
|
156 |
-
"metrics_chart": None,
|
157 |
-
"detailed_analysis": ""
|
158 |
-
}
|
159 |
|
160 |
start_time = time.time()
|
161 |
|
@@ -272,14 +265,7 @@ def process_audio(audio):
|
|
272 |
{', '.join([f"{k}: {v}" for k, v in sorted(pos_counts.items(), key=lambda x: x[1], reverse=True)[:5]])}
|
273 |
"""
|
274 |
|
275 |
-
return
|
276 |
-
"transcription": transcription,
|
277 |
-
"grammar_score": grammar_score,
|
278 |
-
"corrected": corrected,
|
279 |
-
"feedback": feedback,
|
280 |
-
"metrics_chart": fig,
|
281 |
-
"detailed_analysis": detailed_analysis
|
282 |
-
}
|
283 |
|
284 |
# Create theme
|
285 |
theme = gr.themes.Soft(
|
@@ -358,14 +344,14 @@ with gr.Blocks(theme=theme, css="""
|
|
358 |
submit_btn.click(
|
359 |
fn=process_audio,
|
360 |
inputs=[audio_input],
|
361 |
-
outputs=
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
)
|
370 |
|
371 |
if __name__ == "__main__":
|
|
|
148 |
|
149 |
def process_audio(audio):
|
150 |
if audio is None:
|
151 |
+
return "No audio provided.", "", "", "", None, ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
|
153 |
start_time = time.time()
|
154 |
|
|
|
265 |
{', '.join([f"{k}: {v}" for k, v in sorted(pos_counts.items(), key=lambda x: x[1], reverse=True)[:5]])}
|
266 |
"""
|
267 |
|
268 |
+
return transcription, grammar_score, corrected, feedback, fig, detailed_analysis
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
269 |
|
270 |
# Create theme
|
271 |
theme = gr.themes.Soft(
|
|
|
344 |
submit_btn.click(
|
345 |
fn=process_audio,
|
346 |
inputs=[audio_input],
|
347 |
+
outputs=[
|
348 |
+
transcription_output,
|
349 |
+
grammar_score_output,
|
350 |
+
corrected_output,
|
351 |
+
feedback_output,
|
352 |
+
metrics_chart,
|
353 |
+
detailed_analysis
|
354 |
+
]
|
355 |
)
|
356 |
|
357 |
if __name__ == "__main__":
|