We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9feb662 + f766236 commit 2112a0eCopy full SHA for 2112a0e
2 files changed
crates/bpe/src/appendable_encoder.rs
@@ -1,12 +1,14 @@
1
use crate::byte_pair_encoding::BytePairEncoding;
2
3
+#[derive(Clone)]
4
struct State {
5
state: u32,
6
last_token: u32,
7
count: u32,
8
}
9
10
/// Encoder which keeps track of the encoding length while appending characters.
11
12
pub struct AppendableEncoder<'a> {
13
bpe: &'a BytePairEncoding,
14
states: Vec<State>,
crates/bpe/src/prependable_encoder.rs
prev_token: u32,
/// Encoder which keeps track of the encoding length while prepending characters.
pub struct PrependableEncoder<'a> {
0 commit comments