Commit 812bc2e7 authored by Shota Kawabuchi's avatar Shota Kawabuchi
Browse files

bugfix for rnn tutorial on Python3

parent 70097a35
......@@ -25,10 +25,14 @@ import sys
import tensorflow as tf
Py3 = sys.version_info[0] == 3
def _read_words(filename):
with tf.gfile.GFile(filename, "r") as f:
return f.read().decode("utf-8").replace("\n", "<eos>").split()
if Py3:
return f.read().replace("\n", "<eos>").split()
else:
return f.read().decode("utf-8").replace("\n", "<eos>").split()
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