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

Model hyperparams with Temperature value 0 is not being respected #413

Closed
nmanchinn opened this issue Jun 26, 2023 · 3 comments
Closed

Model hyperparams with Temperature value 0 is not being respected #413

nmanchinn opened this issue Jun 26, 2023 · 3 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@nmanchinn
Copy link

Describe the bug
When clients set the model hyperparameters like Temperature to 0, they are being ignored and not sent to OpenAI. This causes LLM to use their default values ( for example, temperature 1 )

To Reproduce
While creating the request set the temperature value to 0

This will send the request to OpenAI as below

"{\"model\":\"gpt-3.5-turbo-0301\",\"messages\":[{\"role\":\"system\",\"content\":\"You are an AI Chatbot. Follow the user's instructions carefully. Respond using markdown. You have a knowledge cutoff of 2021.\"},{\"role\":\"user\",\"content\":\"What are the 3 topics I asked you to write about?\"}],\"max_tokens\":2048,\"stream\":true}"

Expected behavior
Temperature 0 should be sent to openai
"{"model":"gpt-3.5-turbo-0301","messages":[{"role":"system","content":"You are an AI Chatbot. Follow the user's instructions carefully. Respond using markdown. You have a knowledge cutoff of 2021."},{"role":"user","content":"What are the 3 topics I asked you to write about?"}],"max_tokens":2048,"temperature":0,"stream":true}"


**Screenshots/Logs**
This is the the request sent to OpenAI

"{"model":"gpt-3.5-turbo-0301","messages":[{"role":"system","content":"You are an AI Chatbot. Follow the user's instructions carefully. Respond using markdown. You have a knowledge cutoff of 2021."},{"role":"user","content":"What are the 3 topics I asked you to write about?"}],"max_tokens":2048,"stream":true}"


**Environment (please complete the following information):**
 - go-openai version:  v1.11.1
 - Go version:1.20
 - OpenAI API version: v1
 - OS: Ubuntu 20.04

@nmanchinn nmanchinn added the bug Something isn't working label Jun 26, 2023
@nmanchinn
Copy link
Author

This issue is with the omitempty field tag: https://github.com/sashabaranov/go-openai/blob/master/chat.go#L48

@vvatanabe vvatanabe added the duplicate This issue or pull request already exists label Jun 27, 2023
@vvatanabe
Copy link
Collaborator

@nmanchinn Thanks for feedback! This problem has already been reported. Please see #9.

@vvatanabe
Copy link
Collaborator

This is a duplicate issue with #9, so please discuss it in #9 from now on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants