mirror of
https://github.com/mii443/tokenizers.git
synced 2025-08-23 00:35:35 +00:00
Update Python bindings for Encoding
This commit is contained in:
15
bindings/python/src/encoding.rs
Normal file
15
bindings/python/src/encoding.rs
Normal file
@ -0,0 +1,15 @@
|
||||
extern crate tokenizers as tk;
|
||||
|
||||
use pyo3::prelude::*;
|
||||
|
||||
#[pyclass]
|
||||
#[repr(transparent)]
|
||||
pub struct Encoding {
|
||||
encoding: tk::tokenizer::Encoding,
|
||||
}
|
||||
|
||||
impl Encoding {
|
||||
pub fn new(encoding: tk::tokenizer::Encoding) -> Self {
|
||||
Encoding { encoding }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user