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

Implements #381 Expose all available checkpoints for a retriever via … #387

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hrojek
Copy link
Collaborator

@hrojek hrojek commented Nov 28, 2022

…service layer

Pull Request

What does this PR do?

Closes #381

Notes:

  • Replace (issue) above ↑↑↑ with the issue this PR closes to automatically link the two.
    This must be done when the PR is created.
  • Add multiple Closes #(issue) as needed.
  • If this PR is work towards but does not close an issue, simply tag the issue without mentioning Closes.

Description

Describe the changes proposed by this PR below to give the reviewer context below ↓↓↓

Implements a method in the Store class for inspecting the checkpoints store directory and exposing them as options in the checkpointparameter of the ColBERTRetriever.

Request Review

Be sure to request a review from one or more reviewers (unless the PR is to an unprotected branch).

Versioning

When opening a PR to make changes to PrimeQA (i.e. primeqa/) master, be sure to increment the version following
semantic versioning. The VERSION is stored here
and is incremented using bump2version {patch,minor,major} as described in the (development guide documentation)[development.html].

  • Have you updated the VERSION?
  • Or does this PR not change the primeqa package or was not into master?

After pulling in changes from master to an existing PR, ensure the VERSION is updated appropriately.
This may require bumping the version again if it has been previously bumped.

If you're not quite ready yet to post a PR for review, feel free to open a draft PR.

Releases

After Merging

If merging into master and VERSION was updated, after this PR is merged:

Checklist

Review the following and mark as completed:

  • Tag an issue or issues this PR addresses.
  • Added description of changes proposed.
  • Review requested as appropriate.
  • Version bumped as appropriate.
  • New classes, methods, and functions documented.
  • Documentation for modified code is updated.
  • Built documentation to confirm it renders as expected (see here).
  • Code cleaned up and commented out code removed.
  • Tests added to ensure all functionalities tested at >= 60% unit test coverage (see here).
  • Code cleaned up and commented out code removed.
  • Release created as needed after merging.

Copy link
Collaborator

@kpfadnis kpfadnis left a comment

Choose a reason for hiding this comment

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

Let's add a common utility function in retriever component and/or colBERTRetriever class that can populate/tweak parameters beyond default values. That function then can be called from Factory methods and/or directly from services.


# Custom behavior: Add checkpoints as options in checkpoint parameter:
try:
colbert_component = next(component for component in retrievers if component.retriever_id == 'ColBERTRetriever')
Copy link
Collaborator

Choose a reason for hiding this comment

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

@hrojek If I am not mistaken in future release @franzmpub might expose retriever based on DPR. That one will also have checkpoint parameter. So maybe Let's try to move this to a common function in retriever class or ColBERTRetriever class that gets called from to populate options for checkpoint.

{
"retriever_id": retriever_id,
"parameters": generate_parameters(retriever),
}
for retriever_id, retriever in RETRIEVERS_REGISTRY.items()
]
try:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same comment as above.

Copy link
Collaborator

@seirasto seirasto left a comment

Choose a reason for hiding this comment

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

I do not have a lot of experience with this code but it looks good to me. I agree with @kpfadnis to make it general for any retriever.

@jdpsen
Copy link
Collaborator

jdpsen commented Jan 10, 2023

@hrojek : could you please handle the PR reviews/comment on them

@hrojek hrojek requested a review from kpfadnis January 17, 2023 12:40
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.

None yet

4 participants