Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -68,21 +68,21 @@ def test(text: str, model: Optional[str] = 'bergamot'):
|
|
| 68 |
"In the last 3 months, over 80 arrestees were released.",
|
| 69 |
text,
|
| 70 |
]), options)
|
| 71 |
-
print(response)
|
| 72 |
for r in response:
|
| 73 |
print(r.target.text)
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
|
|
|
| 83 |
except Exception as error:
|
| 84 |
response = error
|
| 85 |
-
return {"input": text, "result":
|
| 86 |
|
| 87 |
# Create an MCP server based on this app
|
| 88 |
mcp = FastApiMCP(
|
|
|
|
| 68 |
"In the last 3 months, over 80 arrestees were released.",
|
| 69 |
text,
|
| 70 |
]), options)
|
|
|
|
| 71 |
for r in response:
|
| 72 |
print(r.target.text)
|
| 73 |
+
responselist = [r.target.text for r in response]
|
| 74 |
+
# from bergamot import Translator
|
| 75 |
+
# translator = Translator(
|
| 76 |
+
# models=["model.deen.intgemm.alphas.bin"],
|
| 77 |
+
# vocabs=["vocab.deen.spm", "vocab.deen.spm"],
|
| 78 |
+
# shortlist="lex.50.50.deen.s2t.bin",
|
| 79 |
+
# beam_size=1,
|
| 80 |
+
# normalize=1.0
|
| 81 |
+
# )
|
| 82 |
+
# response = translator.translate([text])
|
| 83 |
except Exception as error:
|
| 84 |
response = error
|
| 85 |
+
return {"input": text, "result": responselist, "model": str(model)}
|
| 86 |
|
| 87 |
# Create an MCP server based on this app
|
| 88 |
mcp = FastApiMCP(
|