Sakil commited on
Commit
8f3baa4
Β·
1 Parent(s): 87298db

code committed

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from parrot import Parrot
2
+ import torch
3
+ import gradio as gr
4
+ parrot = Parrot(model_tag="prithivida/parrot_paraphraser_on_T5", use_gpu=False)
5
+ def get_parapharse(phrase):
6
+ "Function to generate pharaphrase"
7
+ phrases=[phrase]
8
+ for phrase in phrases:
9
+ print("Input_phrase: ", phrase)
10
+ para_phrases = parrot.augment(input_phrase=phrase)
11
+ total_list_phrae=[]
12
+ for para_phrase in para_phrases:
13
+ total_list_phrae.append(para_phrase[0])
14
+ return total_list_phrae
15
+
16
+ iface = gr.Interface(get_parapharse,inputs="text",outputs="text",title='Paraphrase Prodigy',theme = "dark-peach",examples=["what is your favourite movies?","What is your favourite color?"], description="The Ultimate Writing Companion:Say goodbye to writer's block and hello to seamless content creation! ")
17
+ iface.launch(inline=True)