Spaces:
Sleeping
Sleeping
File size: 853 Bytes
c59e29b dc5e584 c59e29b 1c80ea0 c59e29b 1c80ea0 c59e29b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
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()
|