File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change 11use fancy_regex:: Regex ;
22use rustc_hash:: FxHashMap as HashMap ;
33use rustc_hash:: FxHashSet as HashSet ;
4- use std:: sync:: Arc ;
54use thread_local:: ThreadLocal ;
65
76pub type Rank = u32 ;
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ use crate::corebpe::CoreBPE;
22use regex:: Regex ;
33use rustc_hash:: FxHashMap as HashMap ;
44use rustc_hash:: FxHashSet as HashSet ;
5- use std:: sync:: Arc ;
65use thiserror:: Error ;
76use odht:: HashTableOwned ;
87use crate :: rollhash:: { roll_hash, roll_hash_slice} ;
@@ -27,7 +26,7 @@ pub struct Encoding {
2726 /// The maximum token value in the encoding.
2827 max_token_value : Rank ,
2928 /// The core BPE logic implemented in Rust.
30- core_bpe : Arc < CoreBPE > ,
29+ core_bpe : CoreBPE ,
3130}
3231
3332// TODO: make a non-generic encoding error here
@@ -96,7 +95,7 @@ impl Encoding {
9695 . ok_or_else ( || EncodingError :: GenericEncodingError ( "No mergeable ranks found" . to_string ( ) ) ) ?;
9796
9897 let core_bpe = CoreBPE :: new (
99- mergeable_ranks. clone ( ) ,
98+ mergeable_ranks,
10099 special_tokens. clone ( ) ,
101100 pat_str,
102101 )
@@ -122,7 +121,7 @@ impl Encoding {
122121 prefixes_of_mergeable_ranks,
123122 special_tokens,
124123 max_token_value,
125- core_bpe : Arc :: new ( core_bpe) ,
124+ core_bpe : core_bpe,
126125 } )
127126 }
128127
You can’t perform that action at this time.
0 commit comments