Spaces:
Running
Running
Update src/Translate.py
Browse files- src/Translate.py +3 -1
src/Translate.py
CHANGED
|
@@ -79,7 +79,9 @@ class Translators:
|
|
| 79 |
# forced_bos_token_id = tokenizer.lang_code_to_id["ro_RO"]
|
| 80 |
|
| 81 |
# create the pipeline (pass tokenizer and model explicitly)
|
| 82 |
-
|
|
|
|
|
|
|
| 83 |
# "translation" task was used, instead of "translation_XX_to_YY", defaulting to "translation_en_to_ro"
|
| 84 |
|
| 85 |
# call the pipeline; generation kwargs are forwarded to model.generate
|
|
|
|
| 79 |
# forced_bos_token_id = tokenizer.lang_code_to_id["ro_RO"]
|
| 80 |
|
| 81 |
# create the pipeline (pass tokenizer and model explicitly)
|
| 82 |
+
# export langs=ar_AR,cs_CZ,de_DE,en_XX,es_XX,et_EE,fi_FI,fr_XX,gu_IN,hi_IN,it_IT,ja_XX,kk_KZ,ko_KR,lt_LT,lv_LV,my_MM,ne_NP,nl_XX,ro_RO,ru_RU,si_LK,tr_TR,vi_VN,zh_CN
|
| 83 |
+
# pipe = pipeline("translation", model=model_name, src_lang="en_XX", tgt_lang="ro_RO")
|
| 84 |
+
pipe = pipeline("translation_en_to_de", model="facebook/mbart-large-cc25")
|
| 85 |
# "translation" task was used, instead of "translation_XX_to_YY", defaulting to "translation_en_to_ro"
|
| 86 |
|
| 87 |
# call the pipeline; generation kwargs are forwarded to model.generate
|