Spaces:
Running
Running
Commit
·
985fa15
1
Parent(s):
1412ed8
Created app.py
Browse files
app.py
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
def paraphrase(text):
|
5 |
+
paraphraser = pipeline("text2text-generation", model="tuner007/pegasus_paraphrase")
|
6 |
+
paraphrased_text = paraphraser(text, max_length=100, num_return_sequences=1)[0]['generated_text']
|
7 |
+
return paraphrased_text
|
8 |
+
|
9 |
+
iface = gr.Interface(fn=paraphrase, inputs="text", outputs="text")
|
10 |
+
iface.launch()
|