Skip to content

Rerank type hints#459

Merged
joein merged 2 commits into
mainfrom
rerank-type-hints
Feb 4, 2025
Merged

Rerank type hints#459
joein merged 2 commits into
mainfrom
rerank-type-hints

Conversation

@hh-space-invader

Copy link
Copy Markdown
Contributor

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  • Does your submission pass the existing tests?
  • Have you added tests for your feature?
  • Have you installed pre-commit with pip3 install pre-commit and set up hooks with pre-commit install?

New models submission:

  • Have you added an explanation of why it's important to include this model?
  • Have you added tests for the new model? Were canonical values for tests computed via the original model?
  • Have you added the code snippet for how canonical values were computed?
  • Have you successfully ran tests with your changes locally?


if isinstance(pairs, tuple):
pairs = [pairs]
pairs = list(pairs)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the intended behaviour is

("Query_1", "Document_1") -> [("Query_1", "Document_1")]

not

("Query_1", "Document_1") -> ["Query_1", "Document_1"]

though, I understand that ("Query_1", "Document_1") is a violation of the type hint Iterable[tuple[str, str]], but I would rather not break this behaviour

@joein joein force-pushed the rerank-type-hints branch from 5bf11ce to ef28f51 Compare February 4, 2025 16:40
@joein joein self-requested a review February 4, 2025 16:40
@joein joein merged commit 877d963 into main Feb 4, 2025
@joein joein deleted the rerank-type-hints branch February 4, 2025 16: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.

2 participants