Skip to content

Commit 18c93d8

Browse files
committed
Add PyLlama::tokenize
1 parent 327be31 commit 18c93d8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/PyLlama.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "llama.h"
33
#include "utils.h"
44
#include <pybind11/pybind11.h>
5-
5+
#include <pybind11/stl.h>
66

77
namespace py = pybind11;
88

@@ -147,6 +147,7 @@ PYBIND11_MODULE(llamacpp, m) {
147147

148148
py::class_<PyLLAMA>(m, "PyLLAMA")
149149
.def(py::init<gpt_params>())
150+
.def("tokenize", &PyLLAMA::tokenize, "Tokenize text")
150151
.def("prepare_context", &PyLLAMA::prepare_context, "Prepare the LLaMA context")
151152
.def("add_bos", &PyLLAMA::add_bos, "Add a BOS token to the input")
152153
.def("update_input", &PyLLAMA::update_input, "Update input as text")

0 commit comments

Comments
 (0)