Spaces:
Runtime error
Runtime error
flutter-painter
commited on
Commit
•
5a4a746
1
Parent(s):
41a6de0
Update translation.py
Browse files- translation.py +5 -5
translation.py
CHANGED
@@ -52,7 +52,7 @@ class TextPreprocessor:
|
|
52 |
return clean
|
53 |
|
54 |
|
55 |
-
def fix_tokenizer(tokenizer, new_lang="
|
56 |
"""Add a new language token to the tokenizer vocabulary
|
57 |
(this should be done each time after its initialization)
|
58 |
"""
|
@@ -112,8 +112,8 @@ class Translator:
|
|
112 |
def translate(
|
113 |
self,
|
114 |
text,
|
115 |
-
src_lang="
|
116 |
-
tgt_lang="
|
117 |
max_length="auto",
|
118 |
num_beams=4,
|
119 |
by_sentence=True,
|
@@ -149,8 +149,8 @@ class Translator:
|
|
149 |
def translate_single(
|
150 |
self,
|
151 |
text,
|
152 |
-
src_lang="
|
153 |
-
tgt_lang="
|
154 |
max_length="auto",
|
155 |
num_beams=4,
|
156 |
n_out=None,
|
|
|
52 |
return clean
|
53 |
|
54 |
|
55 |
+
def fix_tokenizer(tokenizer, new_lang="fuf_Latn"):
|
56 |
"""Add a new language token to the tokenizer vocabulary
|
57 |
(this should be done each time after its initialization)
|
58 |
"""
|
|
|
112 |
def translate(
|
113 |
self,
|
114 |
text,
|
115 |
+
src_lang="fra_Latn",
|
116 |
+
tgt_lang="fuf_Latn",
|
117 |
max_length="auto",
|
118 |
num_beams=4,
|
119 |
by_sentence=True,
|
|
|
149 |
def translate_single(
|
150 |
self,
|
151 |
text,
|
152 |
+
src_lang="fra_Latn",
|
153 |
+
tgt_lang="fuf_Latn",
|
154 |
max_length="auto",
|
155 |
num_beams=4,
|
156 |
n_out=None,
|