From e34ede79b94a8f3f679372f13e4e92178b1fa7b3 Mon Sep 17 00:00:00 2001 From: itaihochman Date: Tue, 18 Apr 2023 08:56:00 +0300 Subject: [PATCH] Add an option to set the chunk size using the configoration - BROWSE_CHUNK_MAX_LENGTH=4000 This way, we can avoid errors of exceeding chunk size when using gpt-3.5 --- autogpt/processing/text.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogpt/processing/text.py b/autogpt/processing/text.py index 52add814..130de473 100644 --- a/autogpt/processing/text.py +++ b/autogpt/processing/text.py @@ -62,7 +62,7 @@ def summarize_text( print(f"Text length: {text_length} characters") summaries = [] - chunks = list(split_text(text)) + chunks = list(split_text(text, CFG.browse_chunk_max_length)) scroll_ratio = 1 / len(chunks) for i, chunk in enumerate(chunks):