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

newline char(\n) in stop param leads to 500 error in gpt-3.5-turbo #290

Closed
wonkyuml opened this issue Mar 9, 2023 · 5 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@wonkyuml
Copy link

wonkyuml commented Mar 9, 2023

Describe the bug

unlike text-davinci-003 model, gpt-3.5-turbo model fails when using stop='\n'.
maybe it would be backend problem but it would be good to have front-end translates '\n' into some form that backend server can deal with.

To Reproduce

with openai(0.27.1) package
running this line of code would result in 500 error.

Code snippets

completion = openai.ChatCompletion.create(
  model="gpt-3.5-turbo",
  messages=[{"role": "user", "content":"hello"}], 
  stop=['\n']
)


### OS

Ubuntu 18.04

### Python version

Python3.7.15

### Library version

v0.27.1
@wonkyuml wonkyuml added the bug Something isn't working label Mar 9, 2023
@logankilpatrick
Copy link
Contributor

Verified this locally, passed onto the team to investigate.

@logankilpatrick logankilpatrick self-assigned this Mar 13, 2023
@mrsegev
Copy link

mrsegev commented Mar 17, 2023

Any updates on this?

@TotzkePaul
Copy link

Give this a try:
completion = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[{"role": "user", "content":"hello"}],
stop=[r"\n"]
)

https://community.openai.com/t/stop-n-in-gpt-3-5-turbo-leads-to-500-error/87815/12
This worked for me.

@wonkyuml
Copy link
Author

wonkyuml commented Mar 18, 2023

stop=[r"\n"] does not result in 500 error but it does not stop model generating multiple-lines of text.

@athyuttamre
Copy link
Collaborator

This was fixed a week or so ago, apologies for the issue. Please reopen if you see this again!

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

5 participants