From 1579578817ff00533878ed3bb5c46d2b01f52440 Mon Sep 17 00:00:00 2001 From: "niklas.finken" Date: Fri, 12 Apr 2024 16:37:29 +0200 Subject: [PATCH] fix type of "end" --- .../use_cases/qa/multiple_chunk_retriever_qa.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/intelligence_layer/use_cases/qa/multiple_chunk_retriever_qa.py b/src/intelligence_layer/use_cases/qa/multiple_chunk_retriever_qa.py index cf34cbb43..c18876c7a 100644 --- a/src/intelligence_layer/use_cases/qa/multiple_chunk_retriever_qa.py +++ b/src/intelligence_layer/use_cases/qa/multiple_chunk_retriever_qa.py @@ -101,7 +101,9 @@ def _get_highlights_per_chunk( if highlight.start < next_start and highlight.end > current_start: highlights_with_indices_fixed = ScoredTextHighlight( start=max(0, highlight.start - current_start), - end=min(highlight.end - current_start, next_start), + end=min(highlight.end - current_start, next_start) + if isinstance(next_start, int) + else highlight.end, score=highlight.score, ) current_overlaps.append(highlights_with_indices_fixed)