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