Spaces:
Sleeping
Sleeping
import gradio as gr | |
from transformers import pipeline | |
# Load the paraphrasing pipeline | |
paraphraser = pipeline("text2text-generation", model="Eemansleepdeprived/Humaneyes") | |
# Define a function that calls the model | |
def paraphrase_text(text): | |
result = paraphraser( | |
text, | |
max_length=128, | |
do_sample=True, | |
top_k=50, | |
top_p=0.95, | |
temperature=0.9, | |
repetition_penalty=1.2, | |
num_return_sequences=1 | |
) | |
return result[0]['generated_text'] | |
# Create a Gradio interface | |
iface = gr.Interface( | |
fn=paraphrase_text, | |
inputs=gr.Textbox(lines=6, placeholder="Paste your AI-generated text here..."), | |
outputs="text", | |
title="AI Text Humanizer", | |
description="Make AI-generated text sound more human-like using T5 paraphraser.", | |
theme="compact" | |
) | |
# Launch the app | |
iface.launch() | |