stanfordnlp / dspy

DSPy: The framework for programming—not prompting—foundation models
https://dspy-docs.vercel.app/
MIT License
17.85k stars 1.36k forks source link

use_legacy_loading exception when loading model json file which is saved by #1634

Open wangyiav opened 3 hours ago

wangyiav commented 3 hours ago

In train.py, saving model json file (dspy-ai 2.5.10): optimized_cot = teleprompter.compile(****) optimized_cot.save(new_model_file)

In llm.py, loading model json file (dspy-ai 2.5.10): cot= xxxxWithAssertions().activate_assertions() cot.load(new_model_file) Got exception here: e=Retrieve.load_state() got an unexpected keyword argument 'use_legacy_loading'

wangyiav commented 3 hours ago

More information, I verified no this issue on dspy-ai 2.5.5 In train.py, saving model json file (dspy-ai 2.5.10): optimized_cot = teleprompter.compile(****) optimized_cot.save(new_model_file)

In llm.py, loading model json file (dspy-ai 2.5.5): cot= xxxxWithAssertions().activate_assertions() cot.load(new_model_file)