Skip to content

Llama 3.1 producing invalid output from Chat #9

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

Closed
jmont-dev opened this issue Aug 10, 2024 · 3 comments
Closed

Llama 3.1 producing invalid output from Chat #9

jmont-dev opened this issue Aug 10, 2024 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jmont-dev
Copy link
Owner

Llama 3.1 appears to have issues with the Chat endpoint, often producing empty or incoherent responses. The model appears to work with the standard generate endpoint.

Other models such as mistral and phi do appear to work without issues. There may be options or a special request structure that has to be made for Llama 3.

@jmont-dev jmont-dev added the bug Something isn't working label Aug 10, 2024
@jmont-dev jmont-dev added this to the 1.0 Release milestone Aug 10, 2024
@jmont-dev jmont-dev self-assigned this Aug 10, 2024
@jmont-dev
Copy link
Owner Author

This is resulting from providing a format value to the chat request, eg "format": "json". The API says that this should be acceptable but it appears to produce incoherent responses from some models. This tag has been commented out for now and the issue will be fed upstream to the Ollama team so they can address it or comment further.

The change removing the format field from chat requests was merged into main with #11.

@JG-Adams
Copy link

Removing format made both 3.1 and 3 work for me on MinGW Window. What is format supposed to do?

@jmont-dev
Copy link
Owner Author

Format represents the type of message that is returned from the Ollama server. Ollama currently only provides responses as JSON in HTTP replies to clients. The API lists this field as part of the specification and says that "json" is the only valid option. It's probably designed to future-proof the API in case they wanted to provide support for other types in the future (eg, YAML, TOML, or XML).

It definitely causes issues with some model responses, so they may be inadvertently passing the field on to the model itself which causes it to produce incoherent output. Marking this as closed for now and I'll push this up to the Ollama team to investigate in the base project.

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

2 participants