Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,11 +3,12 @@ from transformers import pipeline
|
|
| 3 |
|
| 4 |
app = FastAPI(title="English–Persian Translator")
|
| 5 |
|
| 6 |
-
translator_en_fa = pipeline("translation_en_to_fa", model="
|
| 7 |
|
| 8 |
@app.get("/")
|
| 9 |
def home():
|
| 10 |
-
return {"message": "Welcome to English–
|
|
|
|
| 11 |
|
| 12 |
@app.get("/translate")
|
| 13 |
def translate(text: str = Query(...)):
|
|
|
|
| 3 |
|
| 4 |
app = FastAPI(title="English–Persian Translator")
|
| 5 |
|
| 6 |
+
translator_en_fa = pipeline("translation_en_to_fa", model="opus-mt-en-zh")
|
| 7 |
|
| 8 |
@app.get("/")
|
| 9 |
def home():
|
| 10 |
+
return {"message": "Welcome to English–Switzerland
|
| 11 |
+
Translator!"}
|
| 12 |
|
| 13 |
@app.get("/translate")
|
| 14 |
def translate(text: str = Query(...)):
|