From f5314a0ddef034be27d9faa6fd005fdc7d67f1d8 Mon Sep 17 00:00:00 2001 From: niansa Date: Tue, 5 Sep 2023 09:27:45 +0200 Subject: [PATCH] Added python bindings for grammar --- pybind.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pybind.cpp b/pybind.cpp index 0a0ea1c..a2c3bec 100644 --- a/pybind.cpp +++ b/pybind.cpp @@ -38,6 +38,9 @@ PYBIND11_MODULE(justlm_py, m) { .def("get_prompt", &Inference::get_prompt) .def("get_context_size", &Inference::get_context_size) .def("is_mirostat_available", &Inference::is_mirostat_available) + .def("is_grammar_available", &Inference::is_grammar_available) + .def("load_grammar", &Inference::load_grammar) + .def("unload_grammar", &Inference::unload_grammar) .def_readwrite("params", &Inference::params); py::class_(m, "Savestate") .def(py::init<>());