stanfordnlp / dspy

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

module 'dspy' has no attribute 'HFClientVLLM' on main #383

Closed mgoin closed 7 months ago

mgoin commented 7 months ago

Using the latest pypi release (pip install dspy-ai==2.1.9), vLLM Client imports and works fine:

>>> import dspy
>>> lm = dspy.HFClientVLLM(model="NousResearch/Llama-2-7b-chat-hf", port=8000, url="http://localhost")
>>> lm("My name is ")
["👀 and I'm a 🐶. I'm a very good boy and I love to play fetch and go on long walks. I'm also very good at giving hugs and snuggles. I'm a bit of a foodie and I love treats, but I'm also happy to eat my kibble. I'm a bit of a cuddlebug and I love to be close to my humans. I'm a bit of a goofball and I love to play and have fun. I'm a very good boy and I'm looking for a forever home where I can be loved and adored. 🐾"]

However with the latest main this fails on import:

git clone https://github.com/stanfordnlp/dspy.git
pip install -e dspy/
>>> import dspy
>>> lm = dspy.HFClientVLLM(model="NousResearch/Llama-2-7b-chat-hf", port=8000, url="http://localhost")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'dspy' has no attribute 'HFClientVLLM'
yxs8495 commented 7 months ago

Same here except for all the models on main e.g.

AttributeError: module 'dspy' has no attribute 'OpenAI'

yxs8495 commented 7 months ago

Also I thought the install syntax was dspy-ai

okhat commented 7 months ago

Hmm I'm not able to reproduce this problem