Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -63,17 +63,17 @@ def polish(sentence: str, choice: str) -> str:
|
|
| 63 |
return ""
|
| 64 |
if choice.startswith("FLAN"):
|
| 65 |
return run_flan(sentence)
|
| 66 |
-
elif choice.startswith("
|
| 67 |
return run_roundtrip(sentence)
|
| 68 |
else:
|
| 69 |
return "Unknown option."
|
| 70 |
|
| 71 |
# --- Gradio UI ---
|
| 72 |
with gr.Blocks(title="English Grammar Polisher") as demo:
|
| 73 |
-
gr.Markdown("### English Grammar Polisher\nChoose FLAN-T5 (Google) or OPUS-MT
|
| 74 |
-
inp = gr.Textbox(lines=3, label="Input (English)", placeholder="Type
|
| 75 |
-
choice = gr.Dropdown(choices=MODEL_OPTIONS, value="FLAN-T5-base (Google
|
| 76 |
-
btn = gr.Button("
|
| 77 |
out = gr.Textbox(label="Output")
|
| 78 |
btn.click(polish, inputs=[inp, choice], outputs=out)
|
| 79 |
|
|
|
|
| 63 |
return ""
|
| 64 |
if choice.startswith("FLAN"):
|
| 65 |
return run_flan(sentence)
|
| 66 |
+
elif choice.startswith("Helsinki"):
|
| 67 |
return run_roundtrip(sentence)
|
| 68 |
else:
|
| 69 |
return "Unknown option."
|
| 70 |
|
| 71 |
# --- Gradio UI ---
|
| 72 |
with gr.Blocks(title="English Grammar Polisher") as demo:
|
| 73 |
+
gr.Markdown("### English Grammar Polisher\nChoose FLAN-T5 (Google) or OPUS-MT (Helsinki-NLP).")
|
| 74 |
+
inp = gr.Textbox(lines=3, label="Input (English)", placeholder="Type an English sentence to correct.")
|
| 75 |
+
choice = gr.Dropdown(choices=MODEL_OPTIONS, value="FLAN-T5-base (Google)", label="Method")
|
| 76 |
+
btn = gr.Button("Oxford grammar polish")
|
| 77 |
out = gr.Textbox(label="Output")
|
| 78 |
btn.click(polish, inputs=[inp, choice], outputs=out)
|
| 79 |
|