Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue 743 #753

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
### Fixes
- fix: `ExpectedSearchOutput` has only relevant fields and supports generic document-`ID` rather than just str
- fix: `SearchEvaluationLogic` explicitly compares documents by ids
- fix: In `RecusrsiveSummarize.do_run`, `num_generated_tokens` not uninitialized anymore. [See Issue 743.](https://github.com/Aleph-Alpha/intelligence-layer/issues/743).


## 0.9.0
Expand Down
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