Spaces:
Sleeping
Sleeping
import gradio as gr | |
from transformers import pipeline | |
def paraphrase(text): | |
paraphraser = pipeline("text2text-generation", model="tuner007/pegasus_paraphrase") | |
paraphrased_text = paraphraser(text, max_length=100, num_return_sequences=1)[0]['generated_text'] | |
return paraphrased_text | |
iface = gr.Interface(fn=paraphrase, inputs="text", outputs="text") | |
iface.launch() |