humanizer3.0 / app (1).py
khaliqabdull's picture
Upload 3 files
983c2e5 verified
raw
history blame contribute delete
769 Bytes
import gradio as gr
from transformers import pipeline
# Load the model
generator = pipeline("text2text-generation", model="MBZUAI/LaMini-Flan-T5-783M")
# Define the function
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"]
# Interface to expose /run/predict
gr.Interface(
fn=humanize_text,
inputs=gr.Textbox(lines=6, label="Input Text"),
outputs=gr.Textbox(label="Humanized Text"),
title="🤖 AI Humanizer",
description="Enter AI-generated or robotic text and get a more natural, human-sounding version."
).launch()