Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c490c4d

Browse files
authoredJan 21, 2025
Merge pull request #4 from m5stack/dev
Dev
2 parents 9d1dfce + a830d44 commit c490c4d

File tree

690 files changed

+182685
-877
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

690 files changed

+182685
-877
lines changed
 

‎projects/llm_framework/include/sherpa/sherpa-onnx/csrc/keyword-spotter.h

+5
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ struct KeywordSpotterConfig {
6969

7070
std::string keywords_file;
7171

72+
/// if keywords_buf is non-empty,
73+
/// the keywords will be loaded from the buffer instead of from the
74+
/// "keywrods_file"
75+
std::string keywords_buf;
76+
7277
KeywordSpotterConfig() = default;
7378

7479
KeywordSpotterConfig(const FeatureExtractorConfig &feat_config,

‎projects/llm_framework/include/sherpa/sherpa-onnx/csrc/lexicon.h

+5-10
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,13 @@
66
#define SHERPA_ONNX_CSRC_LEXICON_H_
77

88
#include <cstdint>
9+
#include <istream>
910
#include <memory>
1011
#include <string>
1112
#include <unordered_map>
1213
#include <unordered_set>
1314
#include <vector>
1415

15-
#if __ANDROID_API__ >= 9
16-
#include "android/asset_manager.h"
17-
#include "android/asset_manager_jni.h"
18-
#endif
19-
2016
#include "sherpa-onnx/csrc/offline-tts-frontend.h"
2117

2218
namespace sherpa_onnx {
@@ -30,11 +26,10 @@ class Lexicon : public OfflineTtsFrontend {
3026
const std::string &punctuations, const std::string &language,
3127
bool debug = false);
3228

33-
#if __ANDROID_API__ >= 9
34-
Lexicon(AAssetManager *mgr, const std::string &lexicon,
35-
const std::string &tokens, const std::string &punctuations,
36-
const std::string &language, bool debug = false);
37-
#endif
29+
template <typename Manager>
30+
Lexicon(Manager *mgr, const std::string &lexicon, const std::string &tokens,
31+
const std::string &punctuations, const std::string &language,
32+
bool debug = false);
3833

3934
std::vector<TokenIDs> ConvertTextToTokenIds(
4035
const std::string &text, const std::string &voice = "") const override;
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.