Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed generic error message when input.txt can't be found #125

Merged
merged 1 commit into from
Oct 26, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix unclear errors
also fixed accidental global
  • Loading branch information
skwerlman committed Oct 26, 2015
commit b3c7e3c21538366669fd7fa8b15d48bf5843a271
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