AttributeError: module 'dspy.dsp' has no attribute 'lm'
Thank you for your excellent work and clean code!
When I run the command sh run.sh, an error raises as below, which seems to be some attribute errors of dspy.
I'd appreciate it a lot if you can give me some tips about how to solve this.
Thank you in advance for your assistance!
Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/root/OmniThink/examples/gpt4o.py", line 4, in <module> from src.tools.lm import OpenAIModel_dashscope File "/root/OmniThink/src/__init__.py", line 3, in <module> from .actions import * File "/root/OmniThink/src/actions/__init__.py", line 1, in <module> from .article_generation import * File "/root/OmniThink/src/actions/article_generation.py", line 14, in <module> class ArticleGenerationModule(): File "/root/OmniThink/src/actions/article_generation.py", line 21, in ArticleGenerationModule article_gen_lm=Union[dspy.dsp.lm, dspy.dsp.HFModel], ^^^^^^^^^^^ AttributeError: module 'dspy.dsp' has no attribute 'lm'
It looks like there might be an issue with the version of your dspy library. Could you please check if dspy_ai is version 2.4.9?
I also met this error. Here is my version
dspy 2.6.2 pypi_0 pypi
dspy-ai 2.4.9 pypi_0 pypi
I downgrade the dspy to 2.5.9. The error disappear, but
MindMap initialized
root : ERROR : Error occurs when searching query 电影哪吒2: 'results'
root : WARNING : *** In DSPy 2.5, all LM clients except `dspy.LM` are deprecated. ***
You are using the client QwenModel, which will be removed in DSPy 2.6.
Changing the client is straightforward and will let you use new features (Adapters) that improve the consistency of LM outputs, especially when using chat LMs.
Learn more about the changes and how to migrate at
https://github.com/stanfordnlp/dspy/blob/main/examples/migration.ipynb
It seems that there may be an issue with your Search API. Could you please check if your search engine is functioning properly?
ok
We sincerely apologize for the inconvenience caused. We have now fixed the versions of the libraries that could affect our final results. If you encounter any version compatibility issues, please feel free to contact me promptly.
hi, do you have any further questions?
Thank you for your patient assistance. I have solved the problem and have no further questions.