Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,8 +44,10 @@ def paraphrase(text: str, model: str):
|
|
| 44 |
|
| 45 |
@app.get("/translate", operation_id="get_translate", description="Translate text", tags=["translate"], summary="Translate text")
|
| 46 |
def translate(text: str, model: Optional[str] = MTMODELS['gemma']):
|
| 47 |
-
|
| 48 |
-
|
|
|
|
|
|
|
| 49 |
return {"input": text, "result": resultValue, "model": model}
|
| 50 |
|
| 51 |
# Create an MCP server based on this app
|
|
|
|
| 44 |
|
| 45 |
@app.get("/translate", operation_id="get_translate", description="Translate text", tags=["translate"], summary="Translate text")
|
| 46 |
def translate(text: str, model: Optional[str] = MTMODELS['gemma']):
|
| 47 |
+
if 'BlackKakapo' in model:
|
| 48 |
+
resultValue = Translate.paraphraseTranslateMethod(text, model)
|
| 49 |
+
else:
|
| 50 |
+
resultValue: str = Translate.gemma_direct(text, model)
|
| 51 |
return {"input": text, "result": resultValue, "model": model}
|
| 52 |
|
| 53 |
# Create an MCP server based on this app
|