Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasmcz committed Feb 5, 2017
1 parent 2806e7b commit e8a55a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion neuralmonkey/learning_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# pylint: disable=too-many-lines
# There are too many lines because of these pylint directives.

import codecs
from typing import Any, Callable, Dict, List, Tuple, Optional, Union, Iterable
import os
import numpy as np
Expand Down Expand Up @@ -342,7 +343,7 @@ def run_on_dataset(tf_manager: TensorFlowManager,
np.save(path, data)
log('Result saved as numpy array to "{}"'.format(path))
else:
with open(path, 'w') as f_out:
with codecs.open(path, 'w', 'utf-8') as f_out:
f_out.writelines(
[" ".join(sent) + "\n" for sent in data])
log("Result saved as plain text \"{}\"".format(path))
Expand Down

0 comments on commit e8a55a6

Please sign in to comment.