File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change 1
1
use crate :: byte_pair_encoding:: BytePairEncoding ;
2
2
3
+ #[ derive( Clone ) ]
3
4
struct State {
4
5
state : u32 ,
5
6
last_token : u32 ,
6
7
count : u32 ,
7
8
}
8
9
9
10
/// Encoder which keeps track of the encoding length while appending characters.
11
+ #[ derive( Clone ) ]
10
12
pub struct AppendableEncoder < ' a > {
11
13
bpe : & ' a BytePairEncoding ,
12
14
states : Vec < State > ,
Original file line number Diff line number Diff line change 1
1
use crate :: byte_pair_encoding:: BytePairEncoding ;
2
2
3
+ #[ derive( Clone ) ]
3
4
struct State {
4
5
state : u32 ,
5
6
prev_token : u32 ,
6
7
count : u32 ,
7
8
}
8
9
9
10
/// Encoder which keeps track of the encoding length while prepending characters.
11
+ #[ derive( Clone ) ]
10
12
pub struct PrependableEncoder < ' a > {
11
13
bpe : & ' a BytePairEncoding ,
12
14
states : Vec < State > ,
You can’t perform that action at this time.
0 commit comments