diff --git a/bindings/python/src/token.rs b/bindings/python/src/token.rs index 86e926028..72481c368 100644 --- a/bindings/python/src/token.rs +++ b/bindings/python/src/token.rs @@ -1,7 +1,7 @@ use pyo3::prelude::*; use tk::Token; -#[pyclass(module = "tokenizers", name = "Token")] +#[pyclass(module = "tokenizers", name = "Token", frozen)] #[derive(Clone)] pub struct PyToken { token: Token, diff --git a/bindings/python/src/utils/regex.rs b/bindings/python/src/utils/regex.rs index 16f706820..fafba844f 100644 --- a/bindings/python/src/utils/regex.rs +++ b/bindings/python/src/utils/regex.rs @@ -3,7 +3,7 @@ use pyo3::prelude::*; use tk::utils::SysRegex; /// Instantiate a new Regex with the given pattern -#[pyclass(module = "tokenizers", name = "Regex")] +#[pyclass(module = "tokenizers", name = "Regex", frozen)] pub struct PyRegex { pub inner: SysRegex, pub pattern: String,