AItool commited on
Commit
4c34e0b
·
verified ·
1 Parent(s): 9a9bd49

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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("Round-trip"):
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 round-trip (Helsinki-NLP).")
74
- inp = gr.Textbox(lines=3, label="Input (English)", placeholder="Type a sentence")
75
- choice = gr.Dropdown(choices=MODEL_OPTIONS, value="FLAN-T5-base (Google en→en)", label="Method")
76
- btn = gr.Button("Polish")
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