Skip to content

Commit

Permalink
babi_rnn bugfix: Fixing missing Python 3 support
Browse files Browse the repository at this point in the history
+ reduce function disappeared (requires import from functools)
+ tarfiles and encodings - decoding bytes to ASCII at line level
  • Loading branch information
Smerity committed Aug 7, 2015
1 parent 63284a4 commit dbc0c27
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/babi_rnn.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import absolute_import
from __future__ import print_function
from functools import reduce
import re
import tarfile

Expand Down Expand Up @@ -67,7 +68,7 @@ def parse_stories(lines, only_supporting=False):
data = []
story = []
for line in lines:
line = line.strip()
line = line.decode('utf-8').strip()
nid, line = line.split(' ', 1)
nid = int(nid)
if nid == 1:
Expand Down

0 comments on commit dbc0c27

Please sign in to comment.