Spaces:
Running
Running
Update src/paraphrase/Paraphrase.py
Browse files
src/paraphrase/Paraphrase.py
CHANGED
|
@@ -5,13 +5,11 @@ import src.exception.Exception.Exception as ExceptionCustom
|
|
| 5 |
|
| 6 |
METHOD = "PARAPHRASE"
|
| 7 |
|
| 8 |
-
|
| 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 != "":
|