Skip to content

Commit

Permalink
fix: avoid 1.80 requirement
Browse files Browse the repository at this point in the history
Signed-off-by: YdrMaster <ydrml@hotmail.com>
  • Loading branch information
YdrMaster committed Aug 6, 2024
1 parent 7d0477c commit 8a9c60d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/bpe/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,9 @@ impl Bpe {
"scores size mismatch with vocab size"
);
// tokens 中直接引用字符串位置,绑定评分
let ptr = NonNull::new(_vocab.as_ptr().cast_mut()).unwrap();
let tokens = zip(meta, rank)
.map(|((off, len), rank)| TokenMeta {
ptr: unsafe { ptr.add(off) },
ptr: unsafe { NonNull::new_unchecked(_vocab[off..].as_ptr().cast_mut()) },
len: len as _,
rank,
})
Expand Down

0 comments on commit 8a9c60d

Please sign in to comment.