From 5eba30835d63e5fb16a65e0370de90fd78bb510a Mon Sep 17 00:00:00 2001 From: Anthony MOI Date: Mon, 9 Dec 2019 12:49:17 -0500 Subject: [PATCH] Python - Add WordPiece decoder --- bindings/python/src/decoders.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bindings/python/src/decoders.rs b/bindings/python/src/decoders.rs index 15b3df5c..1ca71ac7 100644 --- a/bindings/python/src/decoders.rs +++ b/bindings/python/src/decoders.rs @@ -36,6 +36,18 @@ impl ByteLevel { } } +#[pyclass] +pub struct WordPiece {} +#[pymethods] +impl WordPiece { + #[staticmethod] + fn new() -> PyResult { + Ok(Decoder { + decoder: Container::Owned(Box::new(tk::decoders::wordpiece::WordPiece)), + }) + } +} + struct PyDecoder { class: PyObject, }