Skip to content

Commit

Permalink
[fix] Fixed buffer_size setting when hkv loads and saves files
Browse files Browse the repository at this point in the history
  • Loading branch information
LinGeLin authored and rhdong committed Apr 30, 2024
1 parent eabccef commit 697341f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,9 @@ class TableWrapper {
throw std::runtime_error(error_msg);
}

size_t n_saved = table_->save(wfile.get(), buffer_size, stream);
size_t n_saved = table_->save(
wfile.get(),
buffer_size * (sizeof(K) + sizeof(V) * dim + sizeof(uint64_t)), stream);
if (has_scores) {
LOG(INFO) << "[op] Save " << n_saved << " pairs from keyfile: " << keyfile
<< ", and valuefile: " << valuefile << ", and scorefile"
Expand Down Expand Up @@ -616,7 +618,9 @@ class TableWrapper {
throw std::runtime_error(error_msg);
}

size_t n_loaded = table_->load(rfile.get(), buffer_size, stream);
size_t n_loaded = table_->load(
rfile.get(),
buffer_size * (sizeof(K) + sizeof(V) * dim + sizeof(uint64_t)), stream);
if (has_scores) {
LOG(INFO) << "[op] Load " << n_loaded
<< " pairs from keyfile: " << keyfile
Expand Down

0 comments on commit 697341f

Please sign in to comment.