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

Fix local server regressions caused by Jinja PR #3256

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

cebtenzzre
Copy link
Member

@cebtenzzre cebtenzzre commented Dec 11, 2024

1. Don't ignore content of assistant messages in history

This was originally fixed in #2929 (the first time it worked), but was broken again in #3147. We should write an automated test for this so we don't break it again.

This is a simple test of the message history using the local server:

user: What is your name?
assistant: My name is Bob.
user: Could you repeat that?

After #2929, the model remembers its name, but on current main it forgets. This PR fixes that. See also: #2602

2. Don't report garbage token counts and incorrect stop reason

Additionally, this PR fixes an uninitialized struct that was causing the token counts to be unreasonably high garbage values and the stop reason to be incorrect. Now all of the local server tests pass (including the test that was previously marked as XFAIL).

3. Don't leave previous conversations in the LLM's context

If you send the my-name-is-Bob test above to the LLM in one request, and then in another request send only this:

user: What were we talking about?

The LLM should not mention the Bob test, since it's not part of this conversation. But there was some missing code in the Jinja PR to actually use the server's local list of messages instead of the entire chat view's contents (which reflects previous conversations).

Signed-off-by: Jared Van Bortel <jared@nomic.ai>
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
@cebtenzzre cebtenzzre marked this pull request as ready for review December 11, 2024 00:04
@cebtenzzre cebtenzzre requested a review from manyoso December 11, 2024 00:04
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
@cebtenzzre cebtenzzre changed the title Fix local server ignoring assistant messages in history Fix local server regressions caused by Jinja PR Dec 12, 2024
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
@cebtenzzre cebtenzzre requested a review from manyoso December 12, 2024 20:54
@cebtenzzre cebtenzzre linked an issue Dec 12, 2024 that may be closed by this pull request
cebtenzzre added a commit that referenced this pull request Dec 13, 2024
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.

Clarification on chat API behaviour
2 participants