Skip to content

Commit

Permalink
python: Only eval latest message in chat sessions (nomic-ai#1149)
Browse files Browse the repository at this point in the history
* python: Only eval latest message in chat sessions

* python: version bump
  • Loading branch information
apage43 authored Jul 7, 2023
1 parent ee73f1a commit ed470e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gpt4all-bindings/python/gpt4all/gpt4all.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def generate(

if self._is_chat_session_activated:
self.current_chat_session.append({"role": "user", "content": prompt})
generate_kwargs['prompt'] = self._format_chat_prompt_template(messages=self.current_chat_session)
generate_kwargs['prompt'] = self._format_chat_prompt_template(messages=self.current_chat_session[-1:])
generate_kwargs['reset_context'] = len(self.current_chat_session) == 1
else:
generate_kwargs['reset_context'] = True
Expand Down
2 changes: 1 addition & 1 deletion gpt4all-bindings/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def copy_prebuilt_C_lib(src_dir, dest_dir, dest_build_dir):

setup(
name=package_name,
version="1.0.2",
version="1.0.3",
description="Python bindings for GPT4All",
author="Richard Guo",
author_email="[email protected]",
Expand Down

0 comments on commit ed470e1

Please sign in to comment.