Commit 504bc193 authored by Neal Wu's avatar Neal Wu Committed by GitHub
Browse files

Merge pull request #1922 from emsansone/issue-#1858

fix issue #1858
parents 2cae3c06 169550ae
...@@ -28,10 +28,7 @@ import tensorflow as tf ...@@ -28,10 +28,7 @@ import tensorflow as tf
def _read_words(filename): def _read_words(filename):
with tf.gfile.GFile(filename, "r") as f: with tf.gfile.GFile(filename, "r") as f:
if sys.version_info[0] >= 3: return f.read().decode("utf-8").replace("\n", "<eos>").split()
return f.read().replace("\n", "<eos>").split()
else:
return f.read().decode("utf-8").replace("\n", "<eos>").split()
def _build_vocab(filename): def _build_vocab(filename):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment