-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Volc Engine MaaS has wrong entry in LLM type to class dict (causing SpaCy to not work with LangChain anymore) #14127
Comments
🤖 Hello @DirkKoelewijn, I am Dosu, an AI assistant designed to help users like you with bugs, answer questions, and assist in becoming a contributor to LangChain. I'm here to provide support while we wait for a human maintainer to assist you further. Great to meet you! Thank you for the detailed report, DirkKoelewijn. You're correct in your analysis. The Here's the corrected code: def get_type_to_cls_dict() -> Dict[str, Callable[[], Type[BaseLLM]]]:
return {
...
"VolcEngineMaasLLM": _import_volcengine_maas,
...
} And the corrected part in the elif name == "type_to_cls_dict":
# for backwards compatibility
type_to_cls_dict: Dict[str, Type[BaseLLM]] = {
k: v for k, v in get_type_to_cls_dict().items()
}
return type_to_cls_dict This change should resolve the issue with SpaCy not working with LangChain. The dictionary will now return the import function Unfortunately, as a bot, I'm unable to make changes to the codebase. I recommend reaching out to @h3l and @baskaryan, who you've identified as potentially being able to help. They should be able to implement this fix. I hope this helps, and thank you for your contribution to improving LangChain! SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
For anyone else having this problem: The workaround for now is to fix the langchain version to |
@DirkKoelewijn Thank you for identifying this bug. I have submitted a Pull Request and am now awaiting for it to be merged. |
- **Description:** fix Volc Engine MaaS import error - **Issue:** [the issue # it fixes (if applicable),](#14127) - **Dependencies:** None - **Tag maintainer:** @baskaryan - **Twitter handle:** Co-authored-by: lvzhong <lvzhong@bytedance.com>
Thank you very much! |
…ain-ai#14194) - **Description:** fix Volc Engine MaaS import error - **Issue:** [the issue # it fixes (if applicable),](langchain-ai#14127) - **Dependencies:** None - **Tag maintainer:** @baskaryan - **Twitter handle:** Co-authored-by: lvzhong <lvzhong@bytedance.com>
…ain-ai#14194) - **Description:** fix Volc Engine MaaS import error - **Issue:** [the issue # it fixes (if applicable),](langchain-ai#14127) - **Dependencies:** None - **Tag maintainer:** @baskaryan - **Twitter handle:** Co-authored-by: lvzhong <lvzhong@bytedance.com>
System Info
Who can help?
@h3l As the creator of the pull request where VolcEngine was introduced
@baskaryan As tag handler of that pull request
Information
Related Components
Reproduction
Anything that triggers spaCy's registry to make an inventory, for example:
With the last part of the Traceback being:
What I think causes this
I am quite certain that this is caused by
langchain.llms.__init__.py:869 (for commit b161f30)
:The Volc Engine Maas LLM is the only in this dict to actually call the import function, while all other entries only the function itself, and do not call it.
Expected behavior
Class to type dict only returns import functions, not actual classes:
Unfortunately I don't have time to put in a PR myself, but I hope this helps finding the solution!
The text was updated successfully, but these errors were encountered: