Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def read_instances_from_file(inst_file, max_sent_len, keep_case):

word_insts = []
trimmed_sent_count = 0
with open(inst_file) as f:
with open(inst_file, encoding='utf-8') as f:
for sent in f:
if not keep_case:
sent = sent.lower()
Expand Down
2 changes: 1 addition & 1 deletion translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def main():

translator = Translator(opt)

with open(opt.output, 'w') as f:
with open(opt.output, 'w', encoding='utf-8') as f:
for batch in tqdm(test_loader, mininterval=2, desc=' - (Test)', leave=False):
all_hyp, all_scores = translator.translate_batch(*batch)
for idx_seqs in all_hyp:
Expand Down