Spaces:
Running
Running
Fix output if translator predicts new line
Browse files- translate.py +6 -1
translate.py
CHANGED
@@ -210,7 +210,12 @@ def main(
|
|
210 |
samples_seen += len(tgt_text)
|
211 |
|
212 |
print(
|
213 |
-
"\n".join(
|
|
|
|
|
|
|
|
|
|
|
214 |
file=output_file,
|
215 |
)
|
216 |
|
|
|
210 |
samples_seen += len(tgt_text)
|
211 |
|
212 |
print(
|
213 |
+
"\n".join(
|
214 |
+
[
|
215 |
+
sentence.replace("\n", r"\n").replace("\t", r"\t")
|
216 |
+
for sentence in tgt_text
|
217 |
+
]
|
218 |
+
),
|
219 |
file=output_file,
|
220 |
)
|
221 |
|