Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,12 +14,12 @@ def index():
|
|
| 14 |
return {'endpoints': ['/paraphrase', '/translate'], 'mtmodels': MTMODELS}
|
| 15 |
|
| 16 |
@app.get("/paraphrase")
|
| 17 |
-
def paraphrase(text: str, model: str, operation_id="get_paraphrase"):
|
| 18 |
resultValue, exception = Paraphrase.paraphraseParaphraseMethod(text, model)
|
| 19 |
return {"input": text, "translation": resultValue, "exception": exception}
|
| 20 |
|
| 21 |
@app.get("/translate")
|
| 22 |
-
def translate(text: str, model: Optional[str] = MTMODELS['gemma'], operation_id="get_translate"):
|
| 23 |
# resultValue, exception = Translate.paraphraseTranslateMethod(text, model)
|
| 24 |
resultValue = Translate.gemma_direct(text, model)
|
| 25 |
return {"input": text, "result": resultValue, "model": model}
|
|
|
|
| 14 |
return {'endpoints': ['/paraphrase', '/translate'], 'mtmodels': MTMODELS}
|
| 15 |
|
| 16 |
@app.get("/paraphrase")
|
| 17 |
+
def paraphrase(text: str, model: str, operation_id="get_paraphrase", description="Paraphrase text"):
|
| 18 |
resultValue, exception = Paraphrase.paraphraseParaphraseMethod(text, model)
|
| 19 |
return {"input": text, "translation": resultValue, "exception": exception}
|
| 20 |
|
| 21 |
@app.get("/translate")
|
| 22 |
+
def translate(text: str, model: Optional[str] = MTMODELS['gemma'], operation_id="get_translate", description="Translate text"):
|
| 23 |
# resultValue, exception = Translate.paraphraseTranslateMethod(text, model)
|
| 24 |
resultValue = Translate.gemma_direct(text, model)
|
| 25 |
return {"input": text, "result": resultValue, "model": model}
|