Skip to content

Commit

Permalink
Support init FasterDecoder with StdVectorFst and StdConstFst. (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj authored Oct 2, 2023
1 parent a14454f commit 5d3ef5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
endif()

set(KALDI_DECODER_VERSION "0.2.1")
set(KALDI_DECODER_VERSION "0.2.2")

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
Expand Down
6 changes: 6 additions & 0 deletions kaldi-decoder/python/csrc/faster-decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ void PybindFasterDecoder(py::module *m) {
.def(py::init<const fst::Fst<fst::StdArc> &,
const FasterDecoderOptions &>(),
py::arg("fst"), py::arg("config"))
.def(py::init<const fst::VectorFst<fst::StdArc> &,
const FasterDecoderOptions &>(),
py::arg("fst"), py::arg("config"))
.def(py::init<const fst::ConstFst<fst::StdArc> &,
const FasterDecoderOptions &>(),
py::arg("fst"), py::arg("config"))
.def("set_options", &PyClass::SetOptions, py::arg("config"))
.def("decode", &PyClass::Decode, py::arg("decodable"))
.def("reached_final", &PyClass::ReachedFinal)
Expand Down

0 comments on commit 5d3ef5b

Please sign in to comment.