Skip to content

Commit f339af1

Browse files
stephentoubCopilot
andauthored
Update src/Microsoft.ML.Tokenizers/Utils/BytePairEncoder.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 394658e commit f339af1

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/Microsoft.ML.Tokenizers/Utils/BytePairEncoder.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,9 @@ void PotentialMerge(Span<State> stateSpan, PriorityQueue<MergeEntry> heapQueue,
270270
}
271271
}
272272

273-
int tokenId;
274-
if (state[currentIndex].CurRank != int.MaxValue)
275-
{
276-
tokenId = state[currentIndex].CurRank;
277-
}
278-
else
279-
{
280-
tokenId = ranks[mergingBytes.SliceStartEnd(startIndex, endIndex)];
281-
}
273+
int tokenId = state[currentIndex].CurRank != int.MaxValue
274+
? state[currentIndex].CurRank
275+
: ranks[mergingBytes.SliceStartEnd(startIndex, endIndex)];
282276

283277
resultList.Add((tokenId, mappedStartIndex, indexMappingSpan[finalEndIndex] - mappedStartIndex));
284278

0 commit comments

Comments
 (0)