Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,11 +3,18 @@ from transformers import pipeline
|
|
| 3 |
|
| 4 |
st.title("Multilingual Translator Chatbot")
|
| 5 |
|
| 6 |
-
# Choose the translation
|
| 7 |
translation_models = {
|
| 8 |
"English to German": "Helsinki-NLP/opus-mt-en-de",
|
|
|
|
| 9 |
"English to French": "Helsinki-NLP/opus-mt-en-fr",
|
|
|
|
| 10 |
"English to Urdu": "Helsinki-NLP/opus-mt-en-ur",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
# Add more language pairs as needed
|
| 12 |
}
|
| 13 |
|
|
@@ -36,4 +43,3 @@ st.write(
|
|
| 36 |
st.write(
|
| 37 |
"Select a translation model from the dropdown, enter text, and click 'Translate' to see the translation."
|
| 38 |
)
|
| 39 |
-
|
|
|
|
| 3 |
|
| 4 |
st.title("Multilingual Translator Chatbot")
|
| 5 |
|
| 6 |
+
# Choose the translation models from Hugging Face
|
| 7 |
translation_models = {
|
| 8 |
"English to German": "Helsinki-NLP/opus-mt-en-de",
|
| 9 |
+
"German to English": "Helsinki-NLP/opus-mt-de-en",
|
| 10 |
"English to French": "Helsinki-NLP/opus-mt-en-fr",
|
| 11 |
+
"French to English": "Helsinki-NLP/opus-mt-fr-en",
|
| 12 |
"English to Urdu": "Helsinki-NLP/opus-mt-en-ur",
|
| 13 |
+
"Urdu to English": "Helsinki-NLP/opus-mt-ur-en",
|
| 14 |
+
"English to Spanish": "Helsinki-NLP/opus-mt-en-es",
|
| 15 |
+
"Spanish to English": "Helsinki-NLP/opus-mt-es-en",
|
| 16 |
+
"English to Chinese": "Helsinki-NLP/opus-mt-en-zh",
|
| 17 |
+
"Chinese to English": "Helsinki-NLP/opus-mt-zh-en",
|
| 18 |
# Add more language pairs as needed
|
| 19 |
}
|
| 20 |
|
|
|
|
| 43 |
st.write(
|
| 44 |
"Select a translation model from the dropdown, enter text, and click 'Translate' to see the translation."
|
| 45 |
)
|
|
|