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

Fix W2V stream data newline error. #82

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
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
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