Update app.py
Browse files
app.py
CHANGED
@@ -5,10 +5,10 @@ from transformers import T5ForConditionalGeneration,AutoTokenizer,pipeline
|
|
5 |
tokenizer = AutoTokenizer.from_pretrained('SeyedAli/Persian-Text-paraphraser-mT5-V1',model_max_length=100, add_special_tokens = True)
|
6 |
model = T5ForConditionalGeneration.from_pretrained('SeyedAli/Persian-Text-paraphraser-mT5-V1')
|
7 |
|
8 |
-
def
|
9 |
pipline = pipeline(task='text2text-generation', model=model, tokenizer=tokenizer)
|
10 |
output=pipline(text)
|
11 |
return output
|
12 |
|
13 |
-
iface = gr.Interface(fn=
|
14 |
iface.launch(share=False)
|
|
|
5 |
tokenizer = AutoTokenizer.from_pretrained('SeyedAli/Persian-Text-paraphraser-mT5-V1',model_max_length=100, add_special_tokens = True)
|
6 |
model = T5ForConditionalGeneration.from_pretrained('SeyedAli/Persian-Text-paraphraser-mT5-V1')
|
7 |
|
8 |
+
def Paraphrase(text):
|
9 |
pipline = pipeline(task='text2text-generation', model=model, tokenizer=tokenizer)
|
10 |
output=pipline(text)
|
11 |
return output
|
12 |
|
13 |
+
iface = gr.Interface(fn=Paraphrase, inputs="text", outputs="text")
|
14 |
iface.launch(share=False)
|