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

Default "temperature" parameter is incompatible with openai "o1" models #994

Closed
pollackscience opened this issue Sep 13, 2024 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@pollackscience
Copy link

Description

Error thrown when trying to invoke the new openai o1 model series:
BadRequestError: Error code: 400 - {'error': {'message': "Unsupported value: 'temperature' does not support 0.7 with this model. Only the default (1) value is supported.", 'type': 'invalid_request_error', 'param': 'temperature', 'code': 'unsupported_value'}}

Reproduce

  1. %config AiMagics.default_language_model = "openai-chat:o1-preview"
  2. %%ai What is 5+8?
  3. Error thrown due to "temperature" parameter.

Expected behavior

Ideally this model can be run without any additional modification to configs or core package code.

Context

  • jupyter_ai==2.23.0
  • jupyter_ai_magics==2.22.0
@pollackscience pollackscience added the bug Something isn't working label Sep 13, 2024
@dlqqq
Copy link
Member

dlqqq commented Sep 13, 2024

@pollackscience Unfortunately, I'm not able to reproduce this as I lack a tier-5 usage account necessary to use the latest OpenAI o1 models.

I've searched through our codebase and don't see any mention of us setting a default value for the temperature parameter, so I'm not sure why temperature is being set to 0.7 in your environment. This could be an upstream API issue given that it is a very recent release.

For now, can you try using the --model-parameters argument to explicitly set the temperature to 1?

%%ai -m {"temperature": 1}
What is 5 + 8?

@pollackscience
Copy link
Author

@dlqqq the explicit setting of temp to 1 does work! Thank you for your quick response. One item to note:
input must be {"temperature":1} (no space between ":" and "1") or else it throws a json.loads error.

Not sure if you want to mark this issue as closed, but it's a simple and effective workaround. Thanks!

@dlqqq
Copy link
Member

dlqqq commented Nov 27, 2024

Glad it worked for you! Closing.

@dlqqq dlqqq closed this as completed Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants