Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -67,14 +67,14 @@ def read_root():
|
|
67 |
|
68 |
class TranslateRequest(BaseModel):
|
69 |
sentences: List[str]
|
70 |
-
src_lang
|
71 |
target_lang: str
|
72 |
|
73 |
|
74 |
@app.post("/translate/")
|
75 |
def translate(request: TranslateRequest):
|
76 |
try:
|
77 |
-
result = translate_text(request.sentences, request.target_lang)
|
78 |
return result
|
79 |
except Exception as e:
|
80 |
raise HTTPException(status_code=500, detail=str(e))
|
|
|
67 |
|
68 |
class TranslateRequest(BaseModel):
|
69 |
sentences: List[str]
|
70 |
+
src_lang: str
|
71 |
target_lang: str
|
72 |
|
73 |
|
74 |
@app.post("/translate/")
|
75 |
def translate(request: TranslateRequest):
|
76 |
try:
|
77 |
+
result = translate_text(request.sentences, request.src_lang, request.target_lang)
|
78 |
return result
|
79 |
except Exception as e:
|
80 |
raise HTTPException(status_code=500, detail=str(e))
|