Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,13 +15,13 @@ def index():
|
|
| 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}
|
| 26 |
|
| 27 |
# Create an MCP server based on this app
|
|
|
|
| 15 |
|
| 16 |
@app.get("/paraphrase")
|
| 17 |
def paraphrase(text: str, model: str, operation_id="get_paraphrase", description="Paraphrase text"):
|
| 18 |
+
resultValue: str, exception: str = 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: str = Translate.gemma_direct(text, model)
|
| 25 |
return {"input": text, "result": resultValue, "model": model}
|
| 26 |
|
| 27 |
# Create an MCP server based on this app
|