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

Simplify ensemble retriever #14427

Merged

Conversation

ahmed-moubtahij
Copy link
Contributor

@ahmed-moubtahij ahmed-moubtahij commented Dec 8, 2023

  • Description: code simplification to improve readability and remove unnecessary memory allocations.
  • Tag maintainer: @baskaryan, @eyurtsev, @hwchase17.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Dec 8, 2023
Copy link

vercel bot commented Dec 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchain ❌ Failed (Inspect) Mar 29, 2024 11:43pm

@dosubot dosubot bot added Ɑ: models Related to LLMs or chat model modules 🤖:improvement Medium size change to existing code to handle new use-cases labels Dec 8, 2023
@ahmed-moubtahij ahmed-moubtahij marked this pull request as draft December 10, 2023 18:03
@ahmed-moubtahij ahmed-moubtahij marked this pull request as ready for review December 10, 2023 18:55
@ahmed-moubtahij ahmed-moubtahij marked this pull request as draft December 10, 2023 18:56
@ahmed-moubtahij ahmed-moubtahij marked this pull request as ready for review December 10, 2023 18:58
@@ -38,6 +38,14 @@ def wrapper(*args: Any, **kwargs: Any) -> Any:

return decorator

T = TypeVar('T')
H = TypeVar('H', bound=Hashable)
def unique_by_key(iterable: Iterable[T], key: Callable[[T], H]) -> Iterator[T]:
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe just worth being local to ensemble retriever until we use in multiple places?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hwchase17 Any more changes you'd like to see?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hwchase17 I apparently needed to run make lint at the langchain_core level as well (root didn't detect the lint fails on CI), it should be ok now.

@hwchase17 hwchase17 closed this Jan 30, 2024
@baskaryan baskaryan reopened this Jan 30, 2024
@ahmed-moubtahij
Copy link
Contributor Author

@hwchase17 @baskaryan Looks good to go?

@ahmed-moubtahij
Copy link
Contributor Author

make format and make lint pass locally but fail on CI (make lint #3.8):

Error: langchain/retrievers/ensemble.py:5:1: I001 Import block is un-sorted or un-formatted
Error: langchain/retrievers/ensemble.py:9:89: E501 Line too long (89 > 88)
make: *** [Makefile:62: lint_package] Error 1
Error: Process completed with exit code 2.

I don't know how to fix this.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Mar 29, 2024
Copy link

vercel bot commented Mar 29, 2024

Deployment failed with the following error:

The provided GitHub repository does not contain the requested branch or commit reference. Please ensure the repository is not empty.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Mar 29, 2024
@baskaryan baskaryan merged commit f5d4ce8 into langchain-ai:master Mar 29, 2024
40 of 41 checks passed
gkorland pushed a commit to FalkorDB/langchain that referenced this pull request Mar 30, 2024
- **Description:** code simplification to improve readability and remove
unnecessary memory allocations.
  - **Tag maintainer**: @baskaryan, @eyurtsev, @hwchase17.

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
hinthornw pushed a commit that referenced this pull request Apr 26, 2024
- **Description:** code simplification to improve readability and remove
unnecessary memory allocations.
  - **Tag maintainer**: @baskaryan, @eyurtsev, @hwchase17.

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:improvement Medium size change to existing code to handle new use-cases Ɑ: models Related to LLMs or chat model modules size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants