Check / app.py
Vivek12345323's picture
Update app.py
3a98369 verified
raw
history blame
513 Bytes
import gradio as gr
from transformers import pipeline
# Swap in a grammar-correction model
pipe = pipeline("text2text-generation", model="vennify/t5-base-grammar-correction")
def respond(prompt):
result = pipe(prompt, max_new_tokens=100)[0]['generated_text']
return f"Revised Essay:\n{result}\n\nExplanation:\nThe model corrected grammar, punctuation, and style based on typical English writing conventions."
gr.Interface(fn=respond, inputs="text", outputs="text", title="Free AI Essay Bot").launch()