Text-Paraphrase / app.py
asifkhan23's picture
Created app.py
985fa15
raw
history blame
377 Bytes
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()