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
This commit is contained in:
itaihochman
2023-04-18 08:56:00 +03:00
parent 67846bad21
commit e34ede79b9

View File

@@ -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):