Skip to content

Commit

Permalink
Merge pull request karpathy#125 from skwerlman/master
Browse files Browse the repository at this point in the history
Fixed generic error message when input.txt can't be found
  • Loading branch information
karpathy committed Oct 26, 2015
2 parents 54b4c66 + b3c7e3c commit 106a75c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/CharSplitLMMinibatchLoader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function CharSplitLMMinibatchLoader.text_to_tensor(in_textfile, out_vocabfile, o
local cache_len = 10000
local rawdata
local tot_len = 0
f = io.open(in_textfile, "r")
local f = assert(io.open(in_textfile, "r"))

-- create vocabulary if it doesn't exist yet
print('creating vocabulary mapping...')
Expand All @@ -157,7 +157,7 @@ function CharSplitLMMinibatchLoader.text_to_tensor(in_textfile, out_vocabfile, o
-- construct a tensor with all the data
print('putting data into tensor...')
local data = torch.ByteTensor(tot_len) -- store it into 1D first, then rearrange
f = io.open(in_textfile, "r")
f = assert(io.open(in_textfile, "r"))
local currlen = 0
rawdata = f:read(cache_len)
repeat
Expand Down

0 comments on commit 106a75c

Please sign in to comment.