“Roleplay with me. You are asking me questions about a test on World War II. Give me one question at a time.”
On the playground, this works flawlessly. It asks the questions and I type back and answer it. Then it asks me another question… etc. Perfect.
When I put the same exact prompt via the API, using the same model and temperature, it does this:
“What were the three main Allied powers during World War II? The three main Allied powers were Great Britain, the United States, and the Soviet Union. What was the role of Great Britain in World War II? The role of Great Britain in World War II was…”
It asks the question and answers itself without even giving me the opportunity. What am I missing in my API coding that is causing this, that isn’t happening on Playground?
Yes, it’s continuing the conversation by itself (even in the playground sometimes now). I don’t have the exact code right now. I made a little script that sends the prompt.
This may be the problem! Thank you for mentionting it @paul.armstrong and @PaulBellow - I really appreciate you both mentioning that as I do NOT have a stop paramater implemented!
Do you mind explaining just a little about how the stop parameter could be implemented that would prevent the AI from going on to the answer?
In the Chat example, three Stop Sequences are used: A new line, the value “Human:”, and the value “AI:”. Our goal is to generate only a single line of text that corresponds to the current speaker. The chosen three stop sequences create the needed constraints to achieve that end:
The completion can’t go to a new line.
The completion can’t change the speaker.
The completion won’t allow the speaker to speak twice in a row
Thank you Paul! I guess sometimes when you’re pulling your hair out searching for an answer you don’t look at the most obvious source (openAI). I was watching YouTube videos galore. I appreciate your help.
No prob. Their docs are sometimes a little behind, but they’re getting a LOT better recently with keeping things updated. Things are moving at such a breakneck speed, I imagine it’s hard to keep up.
Well, the stop-sequence fixed the long lists it was spitting out. But unfortunately it hasn’t stopped it from changing speakers.
For example, my system message is “Interview me for a human resources job” and the first user prompt is “Interview me for a human resources job”.
The AI says “Let’s begin. Tell me what experience you have in human resources?”
I respond “I do not have any expereince in human resources.”
The AI then spits out “Yes, I have 10 years of experience as a human resources manager. During that time, I gained experience in all aspects of human resources…”
Anyone have any clue why its changing speakers like this mid conversation?
It’s really strange that you’re having this problem. ChatML as seen above was built to overcome issues such as these without relying on stop sequences.
Can you please just post the HTTP request you are making? Including the URL and parameters?