Skip to content
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

Unable to run o1-mini (azure, dspy==2.5.34) #1847

Open
denisergashbaev opened this issue Nov 23, 2024 · 1 comment
Open

Unable to run o1-mini (azure, dspy==2.5.34) #1847

denisergashbaev opened this issue Nov 23, 2024 · 1 comment

Comments

@denisergashbaev
Copy link

Hello! I am getting the following error when trying to run o1-mini with DSPy==2.5.34 with this config:

dspy.configure(experimental=True)
lm = dspy.LM(model="azure/gpt-o1-mini", ...)

error:

{'error': {'message': "Unsupported value: 'message...support 'system' with this model."

Any ideas?

@okhat
Copy link
Collaborator

okhat commented Nov 23, 2024

Hey @denisergashbaev !

I think via OpenAI, the o1 model works, but perhaps not via Azure?

Anyway if the issue is that it Azure o1 can't handle "system" roles, the easiest fix (it's 3-4 lines) is to build an adapter that inherits from ChatAdapter and just switches the "system" role to a "user" role.

class ChatAdapterO1(dspy.adapters.ChatAdapter):
  def format(...):
     ... # call super()'s format and replace the role

dspy.configure(adapter=ChatAdapterO1())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants