Spaces:
Sleeping
Sleeping
import gradio as gr | |
from transformers import pipeline | |
def correct_text(text): | |
model_id = "grammarly/coedit-large" | |
pipe = pipeline("text2text-generation", model=model_id) | |
corrected = pipe(text)[0]['generated_text'] | |
return corrected | |
interface = gr.Interface(fn=correct_text, inputs="text_area", outputs="text") | |
interface.launch() | |