Vadym Myroshnyk commited on
Commit ·
a1addcb
1
Parent(s): dff263a
save
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import os
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
from rapidfuzz import fuzz
|
| 4 |
|
|
@@ -36,6 +37,7 @@ with gr.Blocks(theme="soft") as demo:
|
|
| 36 |
</span>
|
| 37 |
""")
|
| 38 |
|
|
|
|
| 39 |
@gr.render(inputs=[week_dropdown, current_index, dialogue_state])
|
| 40 |
def render_transcription_inputs(week, index, inputs):
|
| 41 |
audio_path = audio_structure[week][0]
|
|
@@ -66,7 +68,8 @@ with gr.Blocks(theme="soft") as demo:
|
|
| 66 |
feedback_outputs.append(fb)
|
| 67 |
|
| 68 |
def on_add(*user_inputs):
|
| 69 |
-
updated_inputs = [(line_index, speaker, user_inputs[i]) for i, (line_index, speaker, _) in
|
|
|
|
| 70 |
return index, updated_inputs
|
| 71 |
|
| 72 |
def on_check(*user_inputs):
|
|
@@ -97,7 +100,7 @@ with gr.Blocks(theme="soft") as demo:
|
|
| 97 |
else:
|
| 98 |
average_html = "<i>⬇️ Average score will appear here after checking</i>"
|
| 99 |
|
| 100 |
-
return highlights + feedback + [
|
| 101 |
|
| 102 |
# Action binding
|
| 103 |
if index < len(lines):
|
|
@@ -106,6 +109,7 @@ with gr.Blocks(theme="soft") as demo:
|
|
| 106 |
action_btn.click(fn=on_check, inputs=textboxes,
|
| 107 |
outputs=diff_outputs + feedback_outputs + [average_score_box])
|
| 108 |
|
|
|
|
| 109 |
demo.load(lambda: None)
|
| 110 |
|
| 111 |
if __name__ == "__main__":
|
|
|
|
| 1 |
import os
|
| 2 |
+
|
| 3 |
import gradio as gr
|
| 4 |
from rapidfuzz import fuzz
|
| 5 |
|
|
|
|
| 37 |
</span>
|
| 38 |
""")
|
| 39 |
|
| 40 |
+
|
| 41 |
@gr.render(inputs=[week_dropdown, current_index, dialogue_state])
|
| 42 |
def render_transcription_inputs(week, index, inputs):
|
| 43 |
audio_path = audio_structure[week][0]
|
|
|
|
| 68 |
feedback_outputs.append(fb)
|
| 69 |
|
| 70 |
def on_add(*user_inputs):
|
| 71 |
+
updated_inputs = [(line_index, speaker, user_inputs[i]) for i, (line_index, speaker, _) in
|
| 72 |
+
enumerate(inputs)]
|
| 73 |
return index, updated_inputs
|
| 74 |
|
| 75 |
def on_check(*user_inputs):
|
|
|
|
| 100 |
else:
|
| 101 |
average_html = "<i>⬇️ Average score will appear here after checking</i>"
|
| 102 |
|
| 103 |
+
return highlights + feedback + [average_html]
|
| 104 |
|
| 105 |
# Action binding
|
| 106 |
if index < len(lines):
|
|
|
|
| 109 |
action_btn.click(fn=on_check, inputs=textboxes,
|
| 110 |
outputs=diff_outputs + feedback_outputs + [average_score_box])
|
| 111 |
|
| 112 |
+
|
| 113 |
demo.load(lambda: None)
|
| 114 |
|
| 115 |
if __name__ == "__main__":
|