fix: update imports and dependencies to address vulnerabilities#1241
Merged
Conversation
- Changed imports from `langchain.prompts` to `langchain_core.prompts` in `prompts.py`. - Updated import from `langchain.evaluation.qa` to `langchain_classic.evaluation.qa` in `helpers.py`. - Updated `poetry.lock` to reflect new versions of `langchain` and `langchain-core` to mitigate security issues. - Updated `pyproject.toml` to require `langchain` version `1.3.13`.
…r and ResponseEvaluator classes
…rn for model initialization
…s v5+ task consolidation
…elerate version constraint
blidiselalin
left a comment
There was a problem hiding this comment.
- langchain_classic is not declared as a dependency in pyproject.toml (or poetry.lock). helpers.py imports from langchain_classic.evaluation.qa import QAEvalChain
PretrainedModelForTranslation - uses a hardcoded T5-style prompt for every model (translate {source} to {target}: {text}). This is incorrect for non-T5 encoder-decoder models and likely degrades quality or produces garbage for mBART, MarianMT, etc. It is also a silent behavioural change from the previous pipeline-based implementation.
- no longer validates its inputs. The constructor previously asserted isinstance(model, Pipeline); it now accepts model: Any and can be constructed with incompatible objects.
Collaborator
Author
langchain_classic is from langchain package. |
Collaborator
|
Looks good to me. If this prompt format has been tested with the model, I think it's fine. |
Collaborator
Author
I'll make the prompt customizable so users can refine it, with T5 remaining as the default. |
… translation test to use 'German' as target language
…d enhance translation handling in PretrainedModelForTranslation
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.
langchain.promptstolangchain_core.promptsinprompts.py.langchain.evaluation.qatolangchain_classic.evaluation.qainhelpers.py.poetry.lockto reflect new versions oflangchainandlangchain-coreto mitigate security issues.pyproject.tomlto requirelangchainversion1.3.13.