newline char(`\n`) in stop param leads to 500 error in gpt-3.5-turbo
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
Verified this locally, passed onto the team to investigate.
Any updates on this?
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.
stop=[r"\n"] does not result in 500 error but it does not stop model generating multiple-lines of text.
This was fixed a week or so ago, apologies for the issue. Please reopen if you see this again!