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

[WIP] #107

Open
wants to merge 4 commits into
base: index_on_ssd
Choose a base branch
from
Open

[WIP] #107

wants to merge 4 commits into from

Conversation

xm-gui
Copy link
Contributor

@xm-gui xm-gui commented May 12, 2022

No description provided.

for pid in range(pid_offset, pid_offset + metadata["num_passages"]):
pid_to_chunk_idx[pid] = chunk_idx
pid_doclen = chunk_doclens[pid - pid_offset]
pid_to_chunk_metadata[pid] = [chunk_idx, pid_doclen, pid_offset_in_chunk]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this a NamedTuple?

offset = 0
for chunk_idx in sorted(chunks.keys()):
for chunk_idx in sorted(pids_per_chunk.keys()):
Copy link
Collaborator

@santhnm2 santhnm2 May 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a problem in the code I wrote, but one concern I have is that it may be possible for the pids passed in to lookup_pids to not be in sorted order - if that is the case, then iterating over the chunks in sorted order would produce an output that's inconsistent with what the calling function expects

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the solution would be to iterate over the pids in the original order, then find the chunk each pid belongs to and extract the relevant data from that chunk
Or alternatively, we could sort the pids upstream somewhere (assuming this is not done already)

@okhat
Copy link
Collaborator

okhat commented Dec 30, 2023

@santhnm2 this is outdated right? Do we close it?

@okhat
Copy link
Collaborator

okhat commented Dec 30, 2023

Or is it WIP?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants