Support multilingual whisper models (#274)
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
} \
|
||||
\
|
||||
dst = atoi(value.get()); \
|
||||
if (dst <= 0) { \
|
||||
if (dst < 0) { \
|
||||
SHERPA_ONNX_LOGE("Invalid value %d for %s", dst, src_key); \
|
||||
exit(-1); \
|
||||
} \
|
||||
@@ -77,6 +77,24 @@
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
// read a vector of strings
|
||||
#define SHERPA_ONNX_READ_META_DATA_VEC_STRING(dst, src_key) \
|
||||
do { \
|
||||
auto value = \
|
||||
meta_data.LookupCustomMetadataMapAllocated(src_key, allocator); \
|
||||
if (!value) { \
|
||||
SHERPA_ONNX_LOGE("%s does not exist in the metadata", src_key); \
|
||||
exit(-1); \
|
||||
} \
|
||||
SplitStringToVector(value.get(), ",", false, &dst); \
|
||||
\
|
||||
if (dst.empty()) { \
|
||||
SHERPA_ONNX_LOGE("Invalid value %s for %s. Empty vector!", value.get(), \
|
||||
src_key); \
|
||||
exit(-1); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
// Read a string
|
||||
#define SHERPA_ONNX_READ_META_DATA_STR(dst, src_key) \
|
||||
do { \
|
||||
|
||||
Reference in New Issue
Block a user