Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from transformers import pipeline | |
| # Load the text-to-text generation model | |
| generator = pipeline("text2text-generation", model="MBZUAI/LaMini-Flan-T5-783M") | |
| def humanize_text(input_text): | |
| if not input_text.strip(): | |
| return "Please enter some text to humanize." | |
| prompt = "Paraphrase this more naturally: " + input_text | |
| result = generator(prompt, max_length=256, do_sample=True) | |
| return result[0]["generated_text"] | |
| # Launch the Gradio app | |
| gr.Interface( | |
| fn=humanize_text, | |
| inputs=gr.Textbox(lines=6, label="Input Text", placeholder="Paste your AI text here..."), | |
| outputs=gr.Textbox(label="Humanized Text"), | |
| title="🤖 AI Humanizer", | |
| description="This tool makes robotic or AI-generated text sound more natural and human-like. Powered by Hugging Face." | |
| ).launch() | |