mirror of
https://github.com/karpathy/nanochat.git
synced 2025-12-06 04:12:13 +00:00
fix memory leak bug in rust tokenizer ty @mitsuhiko
This commit is contained in:
parent
d6d86cbf4c
commit
9467d83cf2
|
|
@ -292,8 +292,7 @@ impl Tokenizer {
|
||||||
|
|
||||||
// Prepare a true Python iterator object
|
// Prepare a true Python iterator object
|
||||||
let py_iter: pyo3::Py<pyo3::PyAny> = unsafe {
|
let py_iter: pyo3::Py<pyo3::PyAny> = unsafe {
|
||||||
pyo3::Bound::from_borrowed_ptr_or_err(py, pyo3::ffi::PyObject_GetIter(iterator.as_ptr()))?
|
pyo3::Py::from_owned_ptr_or_err(py, pyo3::ffi::PyObject_GetIter(iterator.as_ptr()))?
|
||||||
.into()
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Global chunk counts
|
// Global chunk counts
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user