Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -150,7 +150,8 @@ with gr.Blocks(theme=gr.themes.Soft()) as app:
|
|
| 150 |
gr.Markdown("""
|
| 151 |
# Arabic Diacritization & Reading Assessment
|
| 152 |
1. Enter undiacritized Arabic text → Diacritize.
|
| 153 |
-
2.
|
|
|
|
| 154 |
""")
|
| 155 |
ref_state = gr.State("")
|
| 156 |
|
|
@@ -159,13 +160,9 @@ with gr.Blocks(theme=gr.themes.Soft()) as app:
|
|
| 159 |
text_in = gr.Textbox(label="Undiacritized Arabic Text", lines=3, text_align="right")
|
| 160 |
model_sel = gr.Dropdown(choices=["Encoder-Only","Encoder-Decoder"], value="Encoder-Only", label="Model")
|
| 161 |
diac_btn = gr.Button("Diacritize Text")
|
| 162 |
-
diac_out = gr.Textbox(label="Diacritized Text (Reference)", lines=3,
|
| 163 |
-
diac_out.change(
|
| 164 |
-
fn=lambda text: text, # Just pass the value through
|
| 165 |
-
inputs=diac_out,
|
| 166 |
-
outputs=reference_text_state
|
| 167 |
-
)
|
| 168 |
diac_btn.click(fn=diacritize_text, inputs=[model_sel, text_in], outputs=[diac_out, ref_state])
|
|
|
|
| 169 |
|
| 170 |
with gr.Column(scale=1):
|
| 171 |
audio_in = gr.Audio(label="Record/Upload Audio", type="filepath")
|
|
|
|
| 150 |
gr.Markdown("""
|
| 151 |
# Arabic Diacritization & Reading Assessment
|
| 152 |
1. Enter undiacritized Arabic text → Diacritize.
|
| 153 |
+
2. Optionally edit the diacritized result.
|
| 154 |
+
3. Record/upload audio → Transcribe & Compare.
|
| 155 |
""")
|
| 156 |
ref_state = gr.State("")
|
| 157 |
|
|
|
|
| 160 |
text_in = gr.Textbox(label="Undiacritized Arabic Text", lines=3, text_align="right")
|
| 161 |
model_sel = gr.Dropdown(choices=["Encoder-Only","Encoder-Decoder"], value="Encoder-Only", label="Model")
|
| 162 |
diac_btn = gr.Button("Diacritize Text")
|
| 163 |
+
diac_out = gr.Textbox(label="Diacritized Text (Reference)", lines=3, text_align="right", interactive=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
diac_btn.click(fn=diacritize_text, inputs=[model_sel, text_in], outputs=[diac_out, ref_state])
|
| 165 |
+
diac_out.change(fn=lambda text: text, inputs=diac_out, outputs=ref_state)
|
| 166 |
|
| 167 |
with gr.Column(scale=1):
|
| 168 |
audio_in = gr.Audio(label="Record/Upload Audio", type="filepath")
|