Skip to content

Commit

Permalink
pyo3: update to 0.20
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Lui committed Nov 11, 2023
1 parent ee2af9e commit e50ee91
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions bindings/python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ serde = { version = "1.0", features = [ "rc", "derive" ]}
serde_json = "1.0"
libc = "0.2"
env_logger = "0.10.0"
pyo3 = { version = "0.19" }
numpy = "0.19.0"
pyo3 = { version = "0.20" }
numpy = "0.20.0"
ndarray = "0.15"
onig = { version = "6.4", default-features = false }
itertools = "0.11"
Expand All @@ -26,7 +26,7 @@ path = "../../tokenizers"

[dev-dependencies]
tempfile = "3.8"
pyo3 = { version = "0.19", features = ["auto-initialize"] }
pyo3 = { version = "0.20", features = ["auto-initialize"] }

[features]
defaut = ["pyo3/extension-module"]
6 changes: 3 additions & 3 deletions bindings/python/src/processors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,15 @@ impl FromPyObject<'_> for PySpecialToken {
Ok(Self(v.into()))
} else if let Ok(d) = ob.downcast::<PyDict>() {
let id = d
.get_item("id")
.get_item("id")?
.ok_or_else(|| exceptions::PyValueError::new_err("`id` must be specified"))?
.extract::<String>()?;
let ids = d
.get_item("ids")
.get_item("ids")?
.ok_or_else(|| exceptions::PyValueError::new_err("`ids` must be specified"))?
.extract::<Vec<u32>>()?;
let tokens = d
.get_item("tokens")
.get_item("tokens")?
.ok_or_else(|| exceptions::PyValueError::new_err("`tokens` must be specified"))?
.extract::<Vec<String>>()?;

Expand Down
1 change: 0 additions & 1 deletion bindings/python/src/tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use pyo3::exceptions;
use pyo3::intern;
use pyo3::prelude::*;
use pyo3::types::*;
use pyo3::AsPyPointer;
use tk::models::bpe::BPE;
use tk::tokenizer::{
Model, PaddingDirection, PaddingParams, PaddingStrategy, PostProcessor, TokenizerImpl,
Expand Down
1 change: 0 additions & 1 deletion bindings/python/src/utils/iterators.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use pyo3::prelude::*;
use pyo3::AsPyPointer;
use std::collections::VecDeque;

/// An simple iterator that can be instantiated with a specified length.
Expand Down

0 comments on commit e50ee91

Please sign in to comment.