Skip to content

Conversation

@Mardak
Copy link
Contributor

@Mardak Mardak commented Dec 1, 2023

Fix #30 r? @ggerganov

Previously omitting "stop" asserts:

curl http://localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{
  "messages": [{
    "role": "user",
    "content": "Write a limerick about python exceptions"
  }]
}'

llama.cpp/server/json.h:21313: assert(it != m_value.object->end()) failed

@Mardak
Copy link
Contributor Author

Mardak commented Dec 1, 2023

This avoids the assert, but some .choices[0].message.content include <|im_sep|> (which also happens without this fix but requesting with "stop": null)

@Mardak
Copy link
Contributor Author

Mardak commented Dec 2, 2023

Oh, I see the original commit 401dd08 cherry-picked ggml-org/llama.cpp#4198 so maybe I should fix this upstream?

@Doublespaced1
Copy link

Doublespaced1 commented Dec 2, 2023 via email

Copy link
Collaborator

@jart jart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the OpenAI API documentation. https://platform.openai.com/docs/api-reference/chat/create I believe your fix is correct. I've confirmed the issue is also present ggerganov/llama.cpp too. It'd make me very happy to see you send a PR to the upstream project too. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAI /completions route fails

3 participants