From 5e675b3ec3f78ab54476bd65195c8ce3d62613fd Mon Sep 17 00:00:00 2001 From: "Joel Z. Leibo" Date: Wed, 11 Sep 2024 03:57:44 -0700 Subject: [PATCH] Improve Gemma2 wrapper: avoid lists, especially "\n\n" delimited lists. PiperOrigin-RevId: 673327325 Change-Id: I71e083105a924a1a087d3bbcd503610aade46657 --- concordia/components/agent/question_of_recent_memories.py | 2 +- concordia/language_model/together_ai.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/concordia/components/agent/question_of_recent_memories.py b/concordia/components/agent/question_of_recent_memories.py index 7bf5171b..8537db70 100644 --- a/concordia/components/agent/question_of_recent_memories.py +++ b/concordia/components/agent/question_of_recent_memories.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Agent component for self perception.""" +"""Agent component for asking questions about the agent's recent memories.""" from collections.abc import Callable, Collection, Mapping import datetime diff --git a/concordia/language_model/together_ai.py b/concordia/language_model/together_ai.py index 703cc196..b5e94fa8 100644 --- a/concordia/language_model/together_ai.py +++ b/concordia/language_model/together_ai.py @@ -78,8 +78,12 @@ def sample_text( 'role': 'system', 'content': ( 'You always continue sentences provided ' - + 'by the user and you never repeat what ' - + 'the user already said.' + 'by the user and you never repeat what ' + 'the user has already said. All responses must end with a ' + 'period. Try not to use lists, but if you must, then ' + 'always delimit list items using either ' + r"semicolons or single newline characters ('\n'), never " + r"delimit list items with double carriage returns ('\n\n')." ), }, {