Release GIL to support multithreading in websocket servers. (#451)

This commit is contained in:
Fangjun Kuang
2023-11-27 13:44:03 +08:00
committed by GitHub
parent 8dc08a9b97
commit 87a47d7db4
10 changed files with 87 additions and 47 deletions

View File

@@ -45,7 +45,7 @@ void PybindOfflineTts(py::module *m) {
py::class_<PyClass>(*m, "OfflineTts")
.def(py::init<const OfflineTtsConfig &>(), py::arg("config"))
.def("generate", &PyClass::Generate, py::arg("text"), py::arg("sid") = 0,
py::arg("speed") = 1.0);
py::arg("speed") = 1.0, py::call_guard<py::gil_scoped_release>());
}
} // namespace sherpa_onnx