Skip to content

Commit

Permalink
Merge pull request #31 from csukuangfj/release-GIL
Browse files Browse the repository at this point in the history
Release GIL for offline feature extractors.
  • Loading branch information
csukuangfj authored May 22, 2022
2 parents 13f2917 + 78454c2 commit 2f65906
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
7 changes: 2 additions & 5 deletions cmake/pybind11.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ function(download_pybind11)

include(FetchContent)

set(pybind11_URL "https://github.com/pybind/pybind11/archive/v2.6.0.tar.gz")
set(pybind11_HASH "SHA256=90b705137b69ee3b5fc655eaca66d0dc9862ea1759226f7ccd3098425ae69571")
set(pybind11_URL "https://github.com/pybind/pybind11/archive/v2.9.2.tar.gz")
set(pybind11_HASH "SHA256=6bd528c4dbe2276635dc787b6b1f2e5316cf6b49ee3e150264e455a0d68d19c1")

set(double_quotes "\"")
set(dollar "\$")
set(semicolon "\;")
FetchContent_Declare(pybind11
URL ${pybind11_URL}
URL_HASH ${pybind11_HASH}
Expand Down
2 changes: 1 addition & 1 deletion kaldifeat/python/csrc/feature-fbank.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static void PybindFbank(py::module &m) {
.def("dim", &PyClass::Dim)
.def_property_readonly("options", &PyClass::GetOptions)
.def("compute_features", &PyClass::ComputeFeatures, py::arg("wave"),
py::arg("vtln_warp"))
py::arg("vtln_warp"), py::call_guard<py::gil_scoped_release>())
.def(py::pickle(
[](const PyClass &self) -> py::dict {
return AsDict(self.GetOptions());
Expand Down
2 changes: 1 addition & 1 deletion kaldifeat/python/csrc/feature-mfcc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static void PybindMfcc(py::module &m) {
.def("dim", &PyClass::Dim)
.def_property_readonly("options", &PyClass::GetOptions)
.def("compute_features", &PyClass::ComputeFeatures, py::arg("wave"),
py::arg("vtln_warp"))
py::arg("vtln_warp"), py::call_guard<py::gil_scoped_release>())
.def(py::pickle(
[](const PyClass &self) -> py::dict {
return AsDict(self.GetOptions());
Expand Down
2 changes: 1 addition & 1 deletion kaldifeat/python/csrc/feature-plp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static void PybindPlp(py::module &m) {
.def("dim", &PyClass::Dim)
.def_property_readonly("options", &PyClass::GetOptions)
.def("compute_features", &PyClass::ComputeFeatures, py::arg("wave"),
py::arg("vtln_warp"))
py::arg("vtln_warp"), py::call_guard<py::gil_scoped_release>())
.def(py::pickle(
[](const PyClass &self) -> py::dict {
return AsDict(self.GetOptions());
Expand Down
2 changes: 1 addition & 1 deletion kaldifeat/python/csrc/feature-spectrogram.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static void PybindSpectrogram(py::module &m) {
.def("dim", &PyClass::Dim)
.def_property_readonly("options", &PyClass::GetOptions)
.def("compute_features", &PyClass::ComputeFeatures, py::arg("wave"),
py::arg("vtln_warp"))
py::arg("vtln_warp"), py::call_guard<py::gil_scoped_release>())
.def(py::pickle(
[](const PyClass &self) -> py::dict {
return AsDict(self.GetOptions());
Expand Down

0 comments on commit 2f65906

Please sign in to comment.