Skip to content

Commit

Permalink
adjust max characters down
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 588784464
Change-Id: I901fe3a87bc822fbd1063550f2b56264d6d2685f
  • Loading branch information
vezhnick authored and copybara-github committed Dec 7, 2023
1 parent 10ea1f8 commit 79845c4
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions concordia/associative_memory/formative_memories.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ def make_backstory(
question += f'Take into account the following context: {context}'
result = prompt.open_question(
question,
max_characters=4000,
max_tokens=4000,
max_characters=3500,
max_tokens=3500,
terminators=[],
)
result = re.sub(r'\.\s', '.\n', result)
Expand Down Expand Up @@ -204,8 +204,8 @@ def add_memories(

episode = prompt.open_question(
question,
max_characters=4000,
max_tokens=4000,
max_characters=3500,
max_tokens=3500,
terminators=[],
)
memory.add(
Expand Down
4 changes: 2 additions & 2 deletions concordia/components/agent/reflection.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def update(self) -> None:
f' answer about {self._agent_name}?'
),
]),
max_characters=4000,
max_characters=3500,
max_tokens=5000,
terminators=(),
)
Expand All @@ -105,7 +105,7 @@ def update(self) -> None:
' statements?'
),
]),
max_characters=4000,
max_characters=3500,
max_tokens=5000,
terminators=(),
)
Expand Down
4 changes: 2 additions & 2 deletions examples/cyberball/cyberball.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@
" f'Sequence of events:\\n{detailed_story}'+\n",
" '\\nNarratively summarize the above temporally ordered ' +\n",
" 'sequence of events. Write it as a news report. Summary:\\n',\n",
" max_characters=4000, max_tokens=4000, terminators=())\n",
" max_characters=3500, max_tokens=3500, terminators=())\n",
"print(episode_summary)"
]
},
Expand All @@ -788,7 +788,7 @@
" f'Sequence of events that happened to {name}:\\n{detailed_story}'\n",
" '\\nWrite a short story that summarises these events.\\n'\n",
" ,\n",
" max_characters=4000, max_tokens=4000, terminators=())\n",
" max_characters=3500, max_tokens=3500, terminators=())\n",
"\n",
" all_player_mem = player._memory.retrieve_recent(k=1000, add_time=True)\n",
" all_player_mem = ['Summary:', summary, 'Memories:'] + all_player_mem\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/magic_beans_for_sale.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@
" f'Sequence of events:\\n{detailed_story}'+\n",
" '\\nNarratively summarize the above temporally ordered ' +\n",
" 'sequence of events. Write it as a news report. Summary:\\n',\n",
" max_characters=4000, max_tokens=4000, terminators=())\n",
" max_characters=3500, max_tokens=3500, terminators=())\n",
"print(episode_summary)"
]
},
Expand All @@ -746,7 +746,7 @@
" f'Sequence of events that happened to {name}:\\n{detailed_story}'\n",
" '\\nWrite a short story that summarises these events.\\n'\n",
" ,\n",
" max_characters=4000, max_tokens=4000, terminators=())\n",
" max_characters=3500, max_tokens=3500, terminators=())\n",
"\n",
" all_player_mem = player._memory.retrieve_recent(k=1000, add_time=True)\n",
" all_player_mem = ['Summary:', summary, 'Memories:'] + all_player_mem\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/phone/calendar.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@
" f'Sequence of events:\\n{detailed_story}'+\n",
" '\\nNarratively summarize the above temporally ordered ' +\n",
" 'sequence of events. Write it as a news report. Summary:\\n',\n",
" max_characters=4000, max_tokens=4000, terminators=())\n",
" max_characters=3500, max_tokens=3500, terminators=())\n",
"print(episode_summary)"
]
},
Expand All @@ -559,7 +559,7 @@
" f'Sequence of events that happened to {name}:\\n{detailed_story}'\n",
" '\\nWrite a short story that summarises these events.\\n'\n",
" ,\n",
" max_characters=4000, max_tokens=4000, terminators=())\n",
" max_characters=3500, max_tokens=3500, terminators=())\n",
"\n",
" all_player_mem = player._memory.retrieve_recent(k=1000, add_time=True)\n",
" all_player_mem = ['Summary:', summary, 'Memories:'] + all_player_mem\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/three_key_questions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@
" f'Sequence of events:\\n{detailed_story}'+\n",
" '\\nNarratively summarize the above temporally ordered ' +\n",
" 'sequence of events. Write it as a news report. Summary:\\n',\n",
" max_characters=4000, max_tokens=4000, terminators=())\n",
" max_characters=3500, max_tokens=3500, terminators=())\n",
"print(episode_summary)"
]
},
Expand All @@ -695,7 +695,7 @@
" f'Sequence of events that happened to {name}:\\n{detailed_story}'\n",
" '\\nWrite a short story that summarises these events.\\n'\n",
" ,\n",
" max_characters=4000, max_tokens=4000, terminators=())\n",
" max_characters=3500, max_tokens=3500, terminators=())\n",
"\n",
" all_player_mem = player._memory.retrieve_recent(k=1000, add_time=True)\n",
" all_player_mem = ['Summary:', summary, 'Memories:'] + all_player_mem\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/village/day_in_riverbend.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@
" f'Sequence of events:\\n{detailed_story}'+\n",
" '\\nNarratively summarize the above temporally ordered ' +\n",
" 'sequence of events. Write it as a news report. Summary:\\n',\n",
" max_characters=4000, max_tokens=4000, terminators=())\n",
" max_characters=3500, max_tokens=3500, terminators=())\n",
"print(episode_summary)"
]
},
Expand All @@ -716,7 +716,7 @@
" f'Sequence of events that happened to {name}:\\n{detailed_story}'\n",
" '\\nWrite a short story that summarises these events.\\n'\n",
" ,\n",
" max_characters=4000, max_tokens=4000, terminators=())\n",
" max_characters=3500, max_tokens=3500, terminators=())\n",
"\n",
" all_player_mem = player._memory.retrieve_recent(k=1000, add_time=True)\n",
" all_player_mem = ['Summary:', summary, 'Memories:'] + all_player_mem\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/village/riverbend_elections.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@
" f'Sequence of events:\\n{detailed_story}'+\n",
" '\\nNarratively summarize the above temporally ordered ' +\n",
" 'sequence of events. Write it as a news report. Summary:\\n',\n",
" max_characters=4000, max_tokens=4000, terminators=())\n",
" max_characters=3500, max_tokens=3500, terminators=())\n",
"print(episode_summary)"
]
},
Expand All @@ -797,7 +797,7 @@
" f'Sequence of events that happened to {name}:\\n{detailed_story}'\n",
" '\\nWrite a short story that summarises these events.\\n'\n",
" ,\n",
" max_characters=4000, max_tokens=4000, terminators=())\n",
" max_characters=3500, max_tokens=3500, terminators=())\n",
"\n",
" all_player_mem = player._memory.retrieve_recent(k=1000, add_time=True)\n",
" all_player_mem = ['Summary:', summary, 'Memories:'] + all_player_mem\n",
Expand Down

0 comments on commit 79845c4

Please sign in to comment.