Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import src.Paraphrase as Paraphrase
|
|
3 |
import src.Translate as Translate
|
4 |
from typing import Optional
|
5 |
from fastapi_mcp import FastApiMCP
|
6 |
-
from typing import Union
|
7 |
|
8 |
app = FastAPI()
|
9 |
# app = FastAPI(docs_url="/docs")
|
@@ -56,7 +56,7 @@ def translate(text: str, model: Optional[str] = MODELS['enro']):
|
|
56 |
|
57 |
@app.get("/bergamot", operation_id="get_bergamot", description="Translate text with Bergamot", tags=["bergamot"], summary="Translate text with Bergamot")
|
58 |
# def bergamot(input_text: str, sl: str = 'de', tl: str = 'en', model: Optional[str] = 'bergamot'):
|
59 |
-
def bergamot(input_text: Union[str,
|
60 |
try:
|
61 |
import bergamot
|
62 |
# if isinstance(input_text, str):
|
|
|
3 |
import src.Translate as Translate
|
4 |
from typing import Optional
|
5 |
from fastapi_mcp import FastApiMCP
|
6 |
+
from typing import Union, List
|
7 |
|
8 |
app = FastAPI()
|
9 |
# app = FastAPI(docs_url="/docs")
|
|
|
56 |
|
57 |
@app.get("/bergamot", operation_id="get_bergamot", description="Translate text with Bergamot", tags=["bergamot"], summary="Translate text with Bergamot")
|
58 |
# def bergamot(input_text: str, sl: str = 'de', tl: str = 'en', model: Optional[str] = 'bergamot'):
|
59 |
+
def bergamot(input_text: Union[str, List[str]] = Query(default=None, description="One or more input strings"), sl: str = 'de', tl: str = 'en', model: Optional[str] = 'bergamot'):
|
60 |
try:
|
61 |
import bergamot
|
62 |
# if isinstance(input_text, str):
|