Skip to content

Commit

Permalink
fix issue 743
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixFehseTNG committed Apr 18, 2024
1 parent 6b7fbe1 commit 9998068
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def do_run(
num_partial_summaries = 0
text_to_summarize = input.text
summary = ""
num_generated_tokens = 0
while True:
summarize_output = self.long_context_summarize_task.run(
LongContextSummarizeInput(
Expand Down
11 changes: 11 additions & 0 deletions tests/use_cases/summarize/test_recursive_summarize.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ def test_recursive_summarize_stops_when_num_partial_summaries_stays_same(
assert output.generated_tokens > 50


def test_recursive_summarize_stops_when_num_partial_summaries_stays_same_with_empty_text(
steerable_long_context_summarize: SteerableLongContextSummarize,
) -> None:
max_tokens = 2048
input = RecursiveSummarizeInput(text="", max_tokens=max_tokens)
task = RecursiveSummarize(steerable_long_context_summarize)
output = task.run(input, NoOpTracer())

assert output.generated_tokens == 0


def test_recursive_summarize_stops_after_one_chunk(
recursive_counting_client: RecursiveCountingClient,
) -> None:
Expand Down

0 comments on commit 9998068

Please sign in to comment.