import gradio as gr | |
from transformers import pipeline | |
def humanize(text): | |
# Use a smaller, faster model for testing | |
paraphraser = pipeline("text2text-generation", model="t5-small") | |
paraphrased = paraphraser( | |
f"Make this text sound human: {text}", | |
max_length=1000 | |
)[0]['generated_text'] | |
return paraphrased.replace(" however", " but hey").replace(". ", ". Seriously, ") + " 😊" | |
gr.Interface(fn=humanize, inputs="text", outputs="text").launch() |