Skip to content

Commit

Permalink
🐛 Fix offset for standalone content results
Browse files Browse the repository at this point in the history
Signed-off-by: gkumbhat <[email protected]>
  • Loading branch information
gkumbhat committed Aug 23, 2024
1 parent 52bc871 commit 6e0b9f9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/orchestrator/unary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,10 +594,14 @@ pub async fn detect_content(
let results = chunks
.into_iter()
.zip(response)
.flat_map(|(_chunk, response)| {
.flat_map(|(chunk, response)| {
response
.into_iter()
.filter_map(|resp| (resp.score >= threshold).then_some(resp))
.filter_map(|mut resp| {
resp.start += chunk.offset;
resp.end += chunk.offset;
(resp.score >= threshold).then_some(resp)
})
.collect::<Vec<_>>()
})
.collect::<Vec<_>>();
Expand Down

0 comments on commit 6e0b9f9

Please sign in to comment.