mirror of
https://github.com/mii443/tokenizers.git
synced 2025-08-22 16:25:30 +00:00
Modify Processor
trait to support chaining. (#1054)
0 modifications yet, everything will consume the vector. Every test should be green without any modifications.
This commit is contained in:
@ -22,16 +22,15 @@ impl tk::PostProcessor for Processor {
|
||||
.added_tokens(is_pair)
|
||||
}
|
||||
|
||||
fn process(
|
||||
fn process_encodings(
|
||||
&self,
|
||||
encoding: Encoding,
|
||||
pair_encoding: Option<Encoding>,
|
||||
encodings: Vec<Encoding>,
|
||||
add_special_tokens: bool,
|
||||
) -> tk::Result<Encoding> {
|
||||
) -> tk::Result<Vec<Encoding>> {
|
||||
self.processor
|
||||
.as_ref()
|
||||
.ok_or("Uninitialized PostProcessor")?
|
||||
.process(encoding, pair_encoding, add_special_tokens)
|
||||
.process_encodings(encodings, add_special_tokens)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user