Spaces:
Runtime error
Runtime error
File size: 377 Bytes
5ba1e8a |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import gradio as gr
from happytransformer import HappyTextToText, TTSettings
happy_tt = HappyTextToText("T5", "vennify/t5-base-grammar-correction")
args = TTSettings(num_beams=5, min_length=1)
def fix(bad):
result = happy_tt.generate_text("grammar: " + bad, args=args)
return result
iface = gr.Interface(fn=fix, inputs="text", outputs="text")
iface.launch()
|