Skip to content

Commit

Permalink
fix: free offsets array
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardopinosio committed Aug 8, 2024
1 parent bf05314 commit a484e01
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tokenizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ func (t *Tokenizer) EncodeWithOptions(str string, addSpecialTokens bool, opts ..

if encOptions.ReturnOffsets && res.offsets != nil {
encoding.Offsets = offsetVecToSlice(res.offsets, len)
C.free(unsafe.Pointer(res.offsets))
}

return encoding
Expand Down

0 comments on commit a484e01

Please sign in to comment.