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")
|
@@ -57,7 +57,7 @@ def translate(text: str, model: Optional[str] = MODELS['enro']):
|
|
57 |
# https://tiberiucristianleon-fastapimt.hf.space/bergamot?input_text=das%20ist%20keine%20gute%20Frau&input_text=das%20ist%20eine%20gute%20Nachricht&sl=de&tl=en&model=bergamot
|
58 |
@app.get("/bergamot", operation_id="get_bergamot", description="Translate text with Bergamot", tags=["bergamot"], summary="Translate text with Bergamot")
|
59 |
# def bergamot(input_text: str, sl: str = 'de', tl: str = 'en', model: Optional[str] = 'bergamot'):
|
60 |
-
def bergamot(input_text: Union[str,
|
61 |
try:
|
62 |
import bergamot
|
63 |
print(type(input_text))
|
|
|
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")
|
|
|
57 |
# https://tiberiucristianleon-fastapimt.hf.space/bergamot?input_text=das%20ist%20keine%20gute%20Frau&input_text=das%20ist%20eine%20gute%20Nachricht&sl=de&tl=en&model=bergamot
|
58 |
@app.get("/bergamot", operation_id="get_bergamot", description="Translate text with Bergamot", tags=["bergamot"], summary="Translate text with Bergamot")
|
59 |
# def bergamot(input_text: str, sl: str = 'de', tl: str = 'en', model: Optional[str] = 'bergamot'):
|
60 |
+
def bergamot(input_text: Union[List[str], str] = Query(default=None, description="Input string or list of strings"), sl: str = 'de', tl: str = 'en', model: Optional[str] = 'bergamot'):
|
61 |
try:
|
62 |
import bergamot
|
63 |
print(type(input_text))
|