Release Python GIL in C++ class constructor (#493)
This commit is contained in:
@@ -53,7 +53,8 @@ void PybindOnlineRecognizer(py::module *m) {
|
||||
|
||||
using PyClass = OnlineRecognizer;
|
||||
py::class_<PyClass>(*m, "OnlineRecognizer")
|
||||
.def(py::init<const OnlineRecognizerConfig &>(), py::arg("config"))
|
||||
.def(py::init<const OnlineRecognizerConfig &>(), py::arg("config"),
|
||||
py::call_guard<py::gil_scoped_release>())
|
||||
.def(
|
||||
"create_stream",
|
||||
[](const PyClass &self) { return self.CreateStream(); },
|
||||
|
||||
Reference in New Issue
Block a user