stanfordnlp / dspy

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

No module named 'mlc_chat' #1206

Open wuyuzhe opened 6 days ago

wuyuzhe commented 6 days ago

when i used this to load local module,it print No module named 'mlc_chat' in dsp/modules/hf_client.py line 464

agent = dspy.ChatModuleClient(model=model, model_path=model_path)

how to resolve it

my versions: python: 3.10 dspy-ai: 2.4.10

arnavsinghvi11 commented 5 days ago

Hi @wuyuzhe , please reference the ChatModuleClient documentation to install the dependencies. We can eventually add this within the file wrapped with a try/except block too.

wuyuzhe commented 5 days ago

first,thank you for your answer. i didn't find the mlc-chat-nightly package from https://mlc.ai , now i installed mlc-ai-nightly-cu121 and mlc-llm-nightly-cu121 on my machine. but it also show that error. i find the shell at https://dspy-docs.vercel.app/api/local_language_model_clients/MLC

pip install --no-deps --pre --force-reinstall mlc-ai-nightly-cu118 mlc-chat-nightly-cu118 -f https://mlc.ai/wheels
pip install transformers
git lfs install

and the command in mlc

python -m pip install --pre -U -f https://mlc.ai/wheels mlc-llm-nightly-cu121 mlc-ai-nightly-cu121

so, what's wrong with my environment

wuyuzhe commented 5 days ago

mlc_chat was deprecated, it turned to mlc_llm

okhat commented 4 days ago

ah good catch, do you want to open a pr to correct this somehow @wuyuzhe or to note it in the right place?