Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,8 +10,8 @@ app = FastAPI()
|
|
| 10 |
logging.info("Loading translation model...")
|
| 11 |
|
| 12 |
translator = pipeline(
|
| 13 |
-
"
|
| 14 |
-
model="Helsinki-NLP/opus-mt-en-gd"
|
| 15 |
)
|
| 16 |
|
| 17 |
logging.info("Model loaded successfully")
|
|
@@ -35,4 +35,4 @@ def translate(req: TranslateRequest):
|
|
| 35 |
return {
|
| 36 |
"translatedText": result[0]["translation_text"],
|
| 37 |
"phonetics": ""
|
| 38 |
-
}
|
|
|
|
| 10 |
logging.info("Loading translation model...")
|
| 11 |
|
| 12 |
translator = pipeline(
|
| 13 |
+
"translation",
|
| 14 |
+
model="Helsinki-NLP/opus-mt-synthetic-en-gd"
|
| 15 |
)
|
| 16 |
|
| 17 |
logging.info("Model loaded successfully")
|
|
|
|
| 35 |
return {
|
| 36 |
"translatedText": result[0]["translation_text"],
|
| 37 |
"phonetics": ""
|
| 38 |
+
}
|