Skip to content

Commit

Permalink
Update core/src/commonMain/kotlin/com/xebia/functional/xef/textsplitt…
Browse files Browse the repository at this point in the history
…ers/TokenTextSplitter.kt

Co-authored-by: Simon Vergauwen <[email protected]>
  • Loading branch information
diesalbla and nomisRev authored Jun 23, 2023
1 parent 5f83cb8 commit 5a71dd0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ private class TokenTextSplitterImpl(
val end = minOf(startIdx + chunkSize, inputIds.size)
return tokenizer.decode(inputIds.subList(startIdx, end))
}
val segments = IntProgression.fromClosedRange(0, inputIds.size - 1, chunkSize - chunkOverlap)
val segments = inputIds.indices step (chunkSize - chunkOverlap)
return segments.toList().map { decodeSegment(it) }
}

Expand Down

0 comments on commit 5a71dd0

Please sign in to comment.