Use piper-phonemize to convert text to token IDs (#453)
This commit is contained in:
@@ -16,17 +16,20 @@ void PybindOfflineTtsVitsModelConfig(py::module *m) {
|
||||
py::class_<PyClass>(*m, "OfflineTtsVitsModelConfig")
|
||||
.def(py::init<>())
|
||||
.def(py::init<const std::string &, const std::string &,
|
||||
const std::string &, float, float, float>(),
|
||||
const std::string &, const std::string, float, float,
|
||||
float>(),
|
||||
py::arg("model"), py::arg("lexicon"), py::arg("tokens"),
|
||||
py::arg("noise_scale") = 0.667, py::arg("noise_scale_w") = 0.8,
|
||||
py::arg("length_scale") = 1.0)
|
||||
py::arg("data_dir") = "", py::arg("noise_scale") = 0.667,
|
||||
py::arg("noise_scale_w") = 0.8, py::arg("length_scale") = 1.0)
|
||||
.def_readwrite("model", &PyClass::model)
|
||||
.def_readwrite("lexicon", &PyClass::lexicon)
|
||||
.def_readwrite("tokens", &PyClass::tokens)
|
||||
.def_readwrite("data_dir", &PyClass::data_dir)
|
||||
.def_readwrite("noise_scale", &PyClass::noise_scale)
|
||||
.def_readwrite("noise_scale_w", &PyClass::noise_scale_w)
|
||||
.def_readwrite("length_scale", &PyClass::length_scale)
|
||||
.def("__str__", &PyClass::ToString);
|
||||
.def("__str__", &PyClass::ToString)
|
||||
.def("validate", &PyClass::Validate);
|
||||
}
|
||||
|
||||
} // namespace sherpa_onnx
|
||||
|
||||
@@ -30,10 +30,14 @@ static void PybindOfflineTtsConfig(py::module *m) {
|
||||
using PyClass = OfflineTtsConfig;
|
||||
py::class_<PyClass>(*m, "OfflineTtsConfig")
|
||||
.def(py::init<>())
|
||||
.def(py::init<const OfflineTtsModelConfig &, const std::string &>(),
|
||||
py::arg("model"), py::arg("rule_fsts") = "")
|
||||
.def(py::init<const OfflineTtsModelConfig &, const std::string &,
|
||||
int32_t>(),
|
||||
py::arg("model"), py::arg("rule_fsts") = "",
|
||||
py::arg("max_num_sentences") = 2)
|
||||
.def_readwrite("model", &PyClass::model)
|
||||
.def_readwrite("rule_fsts", &PyClass::rule_fsts)
|
||||
.def_readwrite("max_num_sentences", &PyClass::max_num_sentences)
|
||||
.def("validate", &PyClass::Validate)
|
||||
.def("__str__", &PyClass::ToString);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user