Skip to content

Commit

Permalink
fix pytorch#229 makes it work on Windows (pytorch#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
jxcodetw authored and soumith committed Apr 30, 2018
1 parent cddabb2 commit 4ce8b87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion intermediate_source/char_rnn_classification_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
from __future__ import unicode_literals, print_function, division
from io import open
import glob
import os

def findFiles(path): return glob.glob(path)

Expand Down Expand Up @@ -98,7 +99,7 @@ def readLines(filename):
return [unicodeToAscii(line) for line in lines]

for filename in findFiles('data/names/*.txt'):
category = filename.split('/')[-1].split('.')[0]
category = os.path.splitext(os.path.basename(filename))[0]
all_categories.append(category)
lines = readLines(filename)
category_lines[category] = lines
Expand Down
3 changes: 2 additions & 1 deletion intermediate_source/char_rnn_generation_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
from __future__ import unicode_literals, print_function, division
from io import open
import glob
import os
import unicodedata
import string

Expand All @@ -102,7 +103,7 @@ def readLines(filename):
category_lines = {}
all_categories = []
for filename in findFiles('data/names/*.txt'):
category = filename.split('/')[-1].split('.')[0]
category = os.path.splitext(os.path.basename(filename))[0]
all_categories.append(category)
lines = readLines(filename)
category_lines[category] = lines
Expand Down

0 comments on commit 4ce8b87

Please sign in to comment.