Spaces:
Runtime error
Runtime error
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() | |