Skip to content

Commit

Permalink
fix stream data newline char error. fix typo (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
yupyub authored Jan 9, 2024
1 parent 6a8312f commit efd7d0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion buffalo/data/fileio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ vector<string> _sort_and_compressed_binarization(
records.insert(end(records), begin(v), end_it);
}

assert(records.size == total_lines);
assert(records.size() == total_lines);

omp_set_num_threads(num_workers);

Expand Down
4 changes: 3 additions & 1 deletion buffalo/data/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def get_max_column_length(fname):
with open(main_path) as fin:
for line in log.ProgressBar(level=log.DEBUG, iterable=fin):
data = line.strip().split()
if not data:
continue
if not iid_path:
itemids |= set(data)

Expand Down Expand Up @@ -246,7 +248,7 @@ def _create_working_data(self, db, stream_main_path, itemids,
for col in train_data:
w.write(f"{user} {col} 1\n")
for col in vali_data:
vali_lines.append(f"{user} {col} {val}")
vali_lines.append(f"{user} {col} 1")
else:
for col, val in Counter(train_data).items():
w.write(f"{user} {col} {val}\n")
Expand Down

0 comments on commit efd7d0c

Please sign in to comment.