-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Remove binary state from high-level API and use Jinja templates #3147
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cebtenzzre
force-pushed
the
remove-binarystate
branch
from
October 31, 2024 15:46
5cc501c
to
6400a7e
Compare
manyoso
force-pushed
the
remove-binarystate
branch
from
November 2, 2024 17:21
19e772f
to
5c3d83d
Compare
cebtenzzre
force-pushed
the
remove-binarystate
branch
from
November 5, 2024 17:16
2be19f2
to
d2b6ba3
Compare
- Python bindings use `jinja2` - server.cpp is not implemented - chatapi.cpp is not implemented 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>
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>
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
Signed-off-by: Adam Treat <treat.adam@gmail.com>
Signed-off-by: Adam Treat <treat.adam@gmail.com>
This reverts commit 15e8fba.
Signed-off-by: Adam Treat <treat.adam@gmail.com>
Signed-off-by: Adam Treat <treat.adam@gmail.com>
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
We still need this for models that don't include bos_token in their chat template. Llama 3.1 8B Instruct sets this to false. Signed-off-by: Jared Van Bortel <jared@nomic.ai>
Importantly, the non-chat completions endpoint (`/v1/completions`) no longer uses a system prompt or LocalDocs, as those are not applicable. Signed-off-by: Jared Van Bortel <jared@nomic.ai>
Before this PR, GPT4All inserted a system message into non-chat completions, and it attempted to use LocalDocs with them. It no longer does either of these things because they do not make sense here. This changes the output slightly, so the test needs to be updated. 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>
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
Alpaca is obsolete. We would be much better off defaulting to the chat template that is shipped with the model. The default system prompt exists in order to demonstrate how it should be templated with Alpaca, but this is no longer applicable because this is now part of the Jinja template. Signed-off-by: Jared Van Bortel <jared@nomic.ai>
As a bonus, system prompts can now be used with remote models. 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>
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>
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>
The new tool calling PR shows that we can achieve the desired UI with the same adjacent prompt/response pairs that we have now, by having child items instead of items in between. This assumption allows us to simplify the on-disk state by always computing the peer index lazily. Signed-off-by: Jared Van Bortel <jared@nomic.ai>
manyoso
requested changes
Nov 23, 2024
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This subrange is already const, so C++23 cbegin/cend isn't necessary. Signed-off-by: Jared Van Bortel <jared@nomic.ai>
The 'set tools = none' line is not recognized by Jinja2Cpp. Signed-off-by: Jared Van Bortel <jared@nomic.ai>
You won't see the new documentation page until this PR is merged. If you run the doc site locally with |
Signed-off-by: Adam Treat <treat.adam@gmail.com>
Signed-off-by: Adam Treat <treat.adam@gmail.com>
manyoso
approved these changes
Nov 25, 2024
Merged
cebtenzzre
added a commit
that referenced
this pull request
Dec 5, 2024
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
cebtenzzre
added a commit
that referenced
this pull request
Dec 6, 2024
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
manyoso
pushed a commit
that referenced
this pull request
Dec 6, 2024
This was referenced Dec 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR replaces GPT4All's templates that use QString.arg to format a user/assistant pair, with a HuggingFace-style Jinja template that formats the entire conversation.
This allows more fine-grained control of how the extra data (such as LocalDocs context) is passed to the model (for
{# version 1#}
templates).