Using serde (serde_pyo3) to get __str__ and __repr__ easily.

This commit is contained in:
Nicolas Patry
2024-08-02 18:41:54 +02:00
parent 7415e28536
commit 86138337fc
8 changed files with 27 additions and 7 deletions

View File

@ -44,8 +44,8 @@ impl PyNormalizedStringMut<'_> {
/// Normalizer will return an instance of this class when instantiated.
#[pyclass(dict, module = "tokenizers.normalizers", name = "Normalizer", subclass)]
#[derive(Clone, Serialize, Deserialize)]
#[serde(transparent)]
pub struct PyNormalizer {
#[serde(flatten)]
pub(crate) normalizer: PyNormalizerTypeWrapper,
}