TiberiuCristianLeon commited on
Commit
f104456
·
verified ·
1 Parent(s): 62da6c0

Update src/paraphrase/Paraphrase.py

Browse files
Files changed (1) hide show
  1. src/paraphrase/Paraphrase.py +3 -5
src/paraphrase/Paraphrase.py CHANGED
@@ -5,13 +5,11 @@ import src.exception.Exception.Exception as ExceptionCustom
5
 
6
  METHOD = "PARAPHRASE"
7
 
8
- tokenizer = PegasusTokenizer.from_pretrained('tuner007/pegasus_paraphrase')
9
- model = PegasusForConditionalGeneration.from_pretrained('tuner007/pegasus_paraphrase')
10
-
11
-
12
- def paraphraseParaphraseMethod(requestValue : str, model: str):
13
  exception = ""
14
  result_value = ""
 
 
15
 
16
  exception = ExceptionCustom.checkForException(requestValue, METHOD)
17
  if exception != "":
 
5
 
6
  METHOD = "PARAPHRASE"
7
 
8
+ def paraphraseParaphraseMethod(requestValue : str, model: str = 'tuner007/pegasus_paraphrase'):
 
 
 
 
9
  exception = ""
10
  result_value = ""
11
+ tokenizer = PegasusTokenizer.from_pretrained(model)
12
+ model = PegasusForConditionalGeneration.from_pretrained(model)
13
 
14
  exception = ExceptionCustom.checkForException(requestValue, METHOD)
15
  if exception != "":