Support vits models from piper (#390)

This commit is contained in:
Fangjun Kuang
2023-10-26 14:10:24 +08:00
committed by GitHub
parent a8fed2a9ce
commit 44512858d6
5 changed files with 130 additions and 49 deletions

View File

@@ -24,12 +24,13 @@ class Lexicon {
public:
Lexicon(const std::string &lexicon, const std::string &tokens,
const std::string &punctuations, const std::string &language,
bool debug = false);
bool debug = false, bool is_piper = false);
#if __ANDROID_API__ >= 9
Lexicon(AAssetManager *mgr, const std::string &lexicon,
const std::string &tokens, const std::string &punctuations,
const std::string &language, bool debug = false);
const std::string &language, bool debug = false,
bool is_piper = false);
#endif
std::vector<int64_t> ConvertTextToTokenIds(const std::string &text) const;
@@ -59,7 +60,7 @@ class Lexicon {
std::unordered_map<std::string, int32_t> token2id_;
Language language_;
bool debug_;
//
bool is_piper_;
};
} // namespace sherpa_onnx