fix: mypy "str" not callable for PromptModelInvocationLayer#6529
Merged
Conversation
anakin87
pushed a commit
that referenced
this pull request
Dec 15, 2023
* cast to PromptModelInvocationLayer * fix pylint pointless-exception-statement * use two variables to avoid re-assignment * black * use mocked tokenizer in unit test
anakin87
pushed a commit
that referenced
this pull request
Dec 21, 2023
…eciprocal rank fusion (#5704) * Change type of PromptModel invocation_layer_class init param (#6497) * fix: mypy `"str" not callable` for `PromptModelInvocationLayer` (#6529) * cast to PromptModelInvocationLayer * fix pylint pointless-exception-statement * use two variables to avoid re-assignment * black * use mocked tokenizer in unit test * Add normalization and weighting for `JoinDocuments` reciprocal rank fusion * Add weights and score normalization for reciprocal rank fusion in JoinDocuments node. * Fix black-jupyter * Fix JoinDocuments test for rrf + score normalization --------- Co-authored-by: Silvano Cerza <3314350+silvanocerza@users.noreply.github.com> Co-authored-by: Julian Risch <julian.risch@deepset.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues
I am seeing a pylint error on Haystack v1.x after the recent prompt model PR. It's haystack/nodes/prompt/prompt_model.py:101: error: "str" not callable [operator] now that invocation_layer_class can be a string: https://github.com/deepset-ai/haystack/pull/6497/files#diff-8a69dcdf57e9a29aff18add4eaa63876f41273bfb905a5b2b9be988a78fe6f76R77
Proposed Changes:
raiseto fixpointless-exception-statementerrorurlopen_mockcheckHow did you test it?
Ran mypy locally
Notes for the reviewer
Other option could be # type: ignore
The test added in the previous PR is not a unit test but marked as one and is failing for that reason: https://github.com/deepset-ai/haystack/pull/6497/files#diff-d1a8309a2d6fb001c0a8b7a97dcdb27b0e99626e3d35dd9ef8e33cedc04fe54eR43
It tries to load a tokenizer from the model hub.
Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:.