Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -358,9 +358,18 @@ def do_translate(
|
|
| 358 |
return "", info, history, _history_to_table(history), gr.update(visible=bool(history)), gr.update(visible=bool(history))
|
| 359 |
|
| 360 |
|
| 361 |
-
def clear_all(history
|
| 362 |
history = []
|
| 363 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 364 |
|
| 365 |
|
| 366 |
def export_history_csv(history: List[Dict[str, str]]):
|
|
@@ -540,7 +549,7 @@ with gr.Blocks(title="Linguo Core β Translation Space") as demo:
|
|
| 540 |
headers=["time", "direction", "src", "dst"],
|
| 541 |
datatype=["str", "str", "str", "str"],
|
| 542 |
row_count=0,
|
| 543 |
-
|
| 544 |
wrap=True,
|
| 545 |
interactive=False,
|
| 546 |
value=[],
|
|
@@ -600,7 +609,7 @@ with gr.Blocks(title="Linguo Core β Translation Space") as demo:
|
|
| 600 |
btn_clear_history.click(
|
| 601 |
clear_all,
|
| 602 |
inputs=[history_state],
|
| 603 |
-
outputs=[src, info, history_state, history_table, dl_hist_csv, dl_hist_txt,
|
| 604 |
queue=False,
|
| 605 |
)
|
| 606 |
|
|
|
|
| 358 |
return "", info, history, _history_to_table(history), gr.update(visible=bool(history)), gr.update(visible=bool(history))
|
| 359 |
|
| 360 |
|
| 361 |
+
def clear_all(history):
|
| 362 |
history = []
|
| 363 |
+
return (
|
| 364 |
+
"", "π§Ή γ―γͺγ’γγΎγγγ",
|
| 365 |
+
history, [],
|
| 366 |
+
gr.update(visible=False), # dl_hist_csv
|
| 367 |
+
gr.update(visible=False), # dl_hist_txt
|
| 368 |
+
gr.update(visible=False, value=None), # dl_batch_csv
|
| 369 |
+
gr.update(visible=False, value=None), # dl_batch_txt
|
| 370 |
+
"", # batch_status
|
| 371 |
+
"", # batch_preview
|
| 372 |
+
)
|
| 373 |
|
| 374 |
|
| 375 |
def export_history_csv(history: List[Dict[str, str]]):
|
|
|
|
| 549 |
headers=["time", "direction", "src", "dst"],
|
| 550 |
datatype=["str", "str", "str", "str"],
|
| 551 |
row_count=0,
|
| 552 |
+
column_count=(4, "fixed"),
|
| 553 |
wrap=True,
|
| 554 |
interactive=False,
|
| 555 |
value=[],
|
|
|
|
| 609 |
btn_clear_history.click(
|
| 610 |
clear_all,
|
| 611 |
inputs=[history_state],
|
| 612 |
+
outputs=[src, info, history_state, history_table, dl_hist_csv, dl_hist_txt, dl_batch_csv, dl_batch_txt, batch_status, batch_preview],
|
| 613 |
queue=False,
|
| 614 |
)
|
| 615 |
|