-
Notifications
You must be signed in to change notification settings - Fork 903
[WIP] Add ZipVoice TTS model #2434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis change introduces support for a new "zipvoice" offline text-to-speech (TTS) model in the sherpa-onnx codebase. It adds configuration structures, validation, and stringification for the zipvoice model, and implements the model's inference pipeline, metadata, and integration into the existing TTS model selection logic. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant OfflineTtsZipvoiceImpl
participant ZipvoiceModel
participant Vocoder
User->>OfflineTtsZipvoiceImpl: Generate(text, prompt_text, prompt_samples, ...)
OfflineTtsZipvoiceImpl->>OfflineTtsZipvoiceImpl: Tokenize text and prompt_text
OfflineTtsZipvoiceImpl->>OfflineTtsZipvoiceImpl: Compute mel features from prompt_samples
OfflineTtsZipvoiceImpl->>ZipvoiceModel: Run(tokens, prompt_tokens, prompt_features, speed, num_step)
ZipvoiceModel-->>OfflineTtsZipvoiceImpl: Synthesized mel spectrogram
OfflineTtsZipvoiceImpl->>Vocoder: Synthesize waveform from mel spectrogram
Vocoder-->>OfflineTtsZipvoiceImpl: Audio samples
OfflineTtsZipvoiceImpl-->>User: GeneratedAudio (samples, sample_rate)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
🧹 Nitpick comments (2)
sherpa-onnx/csrc/offline-tts-zipvoice-impl.h (1)
88-95
: Implement frontend initialization methods.The frontend initialization methods are marked as TODO but the frontend is being used in the Generate method. These need to be implemented.
Would you like me to help implement the frontend initialization methods or create an issue to track this task?
sherpa-onnx/csrc/offline-tts-zipvoice-model.cc (1)
103-105
: Consider using a fixed seed for reproducibility.Using
std::random_device{}()
makes the model non-deterministic. For reproducible results, consider allowing a seed to be configured.Consider adding a seed parameter to the configuration or using a fixed seed:
-std::default_random_engine rng(std::random_device{}()); +// Use a fixed seed for reproducibility, or make it configurable +std::default_random_engine rng(config_.zipvoice.random_seed);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
sherpa-onnx/csrc/offline-tts-model-config.cc
(3 hunks)sherpa-onnx/csrc/offline-tts-model-config.h
(3 hunks)sherpa-onnx/csrc/offline-tts-zipvoice-impl.h
(1 hunks)sherpa-onnx/csrc/offline-tts-zipvoice-model-config.cc
(1 hunks)sherpa-onnx/csrc/offline-tts-zipvoice-model-config.h
(1 hunks)sherpa-onnx/csrc/offline-tts-zipvoice-model-meta-data.h
(1 hunks)sherpa-onnx/csrc/offline-tts-zipvoice-model.cc
(1 hunks)sherpa-onnx/csrc/offline-tts-zipvoice-model.h
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
sherpa-onnx/csrc/offline-tts-zipvoice-model-meta-data.h (2)
sherpa-onnx/csrc/offline-tts-zipvoice-model.h (1)
sherpa_onnx
(15-40)sherpa-onnx/csrc/offline-tts-zipvoice-impl.h (1)
sherpa_onnx
(24-268)
sherpa-onnx/csrc/offline-tts-zipvoice-model-config.cc (1)
sherpa-onnx/csrc/offline-tts-model-config.cc (6)
Register
(11-25)Register
(11-11)Validate
(27-46)Validate
(27-27)ToString
(48-61)ToString
(48-48)
sherpa-onnx/csrc/offline-tts-zipvoice-model-config.h (3)
sherpa-onnx/csrc/offline-tts-zipvoice-model-meta-data.h (1)
sherpa_onnx
(11-26)sherpa-onnx/csrc/offline-tts-zipvoice-model.h (1)
sherpa_onnx
(15-40)sherpa-onnx/csrc/offline-tts-model-config.h (1)
sherpa_onnx
(16-50)
🔇 Additional comments (21)
sherpa-onnx/csrc/offline-tts-model-config.cc (3)
15-15
: LGTM! Consistent integration pattern.The zipvoice configuration registration follows the same pattern as existing TTS models and is properly placed in the registration sequence.
41-43
: LGTM! Proper validation sequence.The zipvoice validation is correctly placed before the kokoro fallback and uses the appropriate key field (
flow_matching_model
) to determine model selection.
55-55
: LGTM! Consistent string representation.The zipvoice configuration is properly included in the string output following the established pattern.
sherpa-onnx/csrc/offline-tts-model-config.h (3)
13-13
: LGTM! Proper header inclusion.The zipvoice model config header is correctly included alongside other TTS model configuration headers.
22-22
: LGTM! Consistent struct organization.The zipvoice configuration member is properly added following the established pattern of other TTS model configurations.
33-33
: LGTM! Consistent constructor implementation.The zipvoice parameter and initialization are properly integrated into the constructor following the established pattern of other TTS model configurations.
Also applies to: 39-39
sherpa-onnx/csrc/offline-tts-zipvoice-model-meta-data.h (4)
5-10
: LGTM! Proper header structure.Header guards follow project conventions and necessary standard headers are correctly included.
13-15
: LGTM! Helpful documentation reference.The comment provides useful guidance for users to understand field meanings by referencing the original Python implementation.
16-24
: LGTM! Well-designed metadata structure.The struct fields represent standard audio processing parameters with mathematically consistent default values (e.g., hop_length = n_fft/4, window_length = n_fft, num_mels = feat_dim).
26-28
: LGTM! Proper file structure closure.Namespace and header guard are correctly closed following project conventions.
sherpa-onnx/csrc/offline-tts-zipvoice-model-config.h (5)
5-11
: LGTM! Proper header structure.Header guards follow project conventions and necessary headers are correctly included for the configuration struct.
15-17
: LGTM! Clear model path definitions.The three model path members (text_model, flow_matching_model, vocoder) represent a typical TTS pipeline with clear, descriptive naming.
19-24
: LGTM! Well-chosen synthesis parameters.The synthesis parameters have reasonable default values that represent neutral/standard settings for TTS synthesis (e.g., speed=1.0, guidance_scale=1.0, num_step=16 for diffusion).
26-26
: LGTM! Well-structured constructors.Both default and parameterized constructors are properly implemented. Parameter defaults match member defaults, and initialization order follows declaration order.
Also applies to: 28-45
47-50
: LGTM! Consistent method interface.The method declarations follow the established pattern used by other TTS model configuration classes, ensuring API consistency.
sherpa-onnx/csrc/offline-tts-zipvoice-model-config.cc (4)
5-10
: LGTM! Appropriate header inclusions.Headers are correctly included for file validation and logging functionality. The self-include follows project conventions.
14-33
: LGTM! Comprehensive parameter registration.All configuration parameters are properly registered with clear, informative help text. The "zipvoice-" prefix maintains consistency and avoids naming conflicts.
35-99
: LGTM! Comprehensive validation implementation.The validation covers all required aspects:
- File existence checks for all model files with clear error messages
- Appropriate numeric bounds validation (positive values where required, non-negative for t_shift)
- Descriptive error logging with parameter values
101-116
: LGTM! Complete string representation.The ToString method properly serializes all configuration parameters in a readable format consistent with other model configurations in the project.
sherpa-onnx/csrc/offline-tts-zipvoice-model.h (1)
1-42
: LGTM!The header file is well-structured with proper include guards, follows the pimpl idiom for ABI stability, and has appropriate method signatures.
sherpa-onnx/csrc/offline-tts-zipvoice-model.cc (1)
12-14
: Ignore the API-level 9 guard; it’s correct
AAssetManager and its JNI bindings were introduced in Android API 9 and the same#if __ANDROID_API__ >= 9
guard is applied consistently across every Android‐specific source file. No changes are needed.Likely an incorrect or invalid review comment.
#include <cmath> | ||
#include <memory> | ||
#include <string> | ||
#include <strstream> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace deprecated header with modern alternative.
The <strstream>
header is deprecated. Use <sstream>
instead.
-#include <strstream>
+#include <sstream>
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
#include <strstream> | |
-#include <strstream> | |
+#include <sstream> |
🤖 Prompt for AI Agents
In sherpa-onnx/csrc/offline-tts-zipvoice-impl.h at line 10, replace the
deprecated #include <strstream> directive with #include <sstream> to use the
modern, supported header for string stream operations.
explicit OfflineTtsZipvoiceImpl(const OfflineTtsConfig &config) | ||
: config_(config), | ||
model_(std::make_unique<OfflineTtsZipvoiceModel>(config.model)), | ||
vocoder_(Vocoder::Create(config.model)) { | ||
InitFrontend(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix missing closing brace in constructor.
The constructor is missing a closing brace.
explicit OfflineTtsZipvoiceImpl(const OfflineTtsConfig &config)
: config_(config),
model_(std::make_unique<OfflineTtsZipvoiceModel>(config.model)),
vocoder_(Vocoder::Create(config.model)) {
InitFrontend();
-
+ }
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
explicit OfflineTtsZipvoiceImpl(const OfflineTtsConfig &config) | |
: config_(config), | |
model_(std::make_unique<OfflineTtsZipvoiceModel>(config.model)), | |
vocoder_(Vocoder::Create(config.model)) { | |
InitFrontend(); | |
explicit OfflineTtsZipvoiceImpl(const OfflineTtsConfig &config) | |
: config_(config), | |
model_(std::make_unique<OfflineTtsZipvoiceModel>(config.model)), | |
vocoder_(Vocoder::Create(config.model)) { | |
InitFrontend(); | |
} |
🤖 Prompt for AI Agents
In sherpa-onnx/csrc/offline-tts-zipvoice-impl.h around lines 28 to 33, the
constructor OfflineTtsZipvoiceImpl is missing its closing brace. Add the missing
closing brace at the end of the constructor definition to properly close the
function body.
std::vector<TokenIDs> text_token_ids = | ||
frontend_->ConvertTextToTokenIds(text); | ||
|
||
std::vector<TokenIDs> prompt_token_ids = | ||
frontend_->ConvertTextToTokenIds(prompt_text); | ||
|
||
if (text_token_ids.empty() || | ||
(text_token_ids.size() == 1 && text_token_ids[0].tokens.empty())) { | ||
#if __OHOS__ | ||
SHERPA_ONNX_LOGE("Failed to convert '%{public}s' to token IDs", text.c_str()); | ||
#else | ||
SHERPA_ONNX_LOGE("Failed to convert '%s' to token IDs", text.c_str()); | ||
#endif | ||
return {}; | ||
} | ||
|
||
if (prompt_token_ids.empty() || | ||
(prompt_token_ids.size() == 1 && prompt_token_ids[0].tokens.empty())) { | ||
#if __OHOS__ | ||
SHERPA_ONNX_LOGE("Failed to convert prompt text '%{public}s' to token IDs", | ||
prompt_text.c_str()); | ||
#else | ||
SHERPA_ONNX_LOGE("Failed to convert prompt text '%s' to token IDs", | ||
prompt_text.c_str()); | ||
#endif | ||
return {}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add missing frontend_ member variable.
The code uses frontend_
member variable in multiple places but it's not declared. Based on the TODO comment at line 265, this member needs to be added.
Add the missing member declaration:
private:
OfflineTtsConfig config_;
std::unique_ptr<OfflineTtsZipvoiceModel> model_;
std::unique_ptr<Vocoder> vocoder_;
- // TODO: add frontend_ here
+ std::unique_ptr<OfflineTtsFrontend> frontend_;
Also applies to: 265-265
🤖 Prompt for AI Agents
In sherpa-onnx/csrc/offline-tts-zipvoice-impl.h around lines 51 to 77 and line
265, the member variable frontend_ is used but not declared. To fix this, add a
declaration for the frontend_ member variable in the class definition, ensuring
it matches the expected type for the frontend object used in
ConvertTextToTokenIds calls. This will resolve the missing member error and
align with the TODO comment at line 265.
prompt_features_tensor = Ort::Value::CreateTensor( | ||
memory_info, prompt_features_flat.data(), prompt_features_flat.size(), | ||
shape.data(), shape.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix undefined variable usage.
The variable prompt_features_tensor
is used without being declared.
std::array<int64_t, 3> shape = {1, num_frames, mel_dim};
-prompt_features_tensor = Ort::Value::CreateTensor(
+Ort::Value prompt_features_tensor = Ort::Value::CreateTensor(
memory_info, prompt_features_flat.data(), prompt_features_flat.size(),
shape.data(), shape.size());
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
prompt_features_tensor = Ort::Value::CreateTensor( | |
memory_info, prompt_features_flat.data(), prompt_features_flat.size(), | |
shape.data(), shape.size()); | |
std::array<int64_t, 3> shape = {1, num_frames, mel_dim}; | |
Ort::Value prompt_features_tensor = Ort::Value::CreateTensor( | |
memory_info, prompt_features_flat.data(), prompt_features_flat.size(), | |
shape.data(), shape.size()); |
🤖 Prompt for AI Agents
In sherpa-onnx/csrc/offline-tts-zipvoice-impl.h around lines 219 to 221, the
variable prompt_features_tensor is used without declaration. Declare
prompt_features_tensor with the appropriate type, likely Ort::Value, before
assigning it the result of Ort::Value::CreateTensor to fix the undefined
variable error.
std::vector<int64_t> tokens_shape = | ||
tokens_shape.GetTensorTypeAndShapeInfo().GetShape(); | ||
int64_t batch_size = tokens_shape[0]; | ||
if (batch_size != 1) { | ||
SHERPA_ONNX_LOGE("Support only batch_size == 1. Given: %d", | ||
static_cast<int32_t>(batch_size); | ||
exit(-1); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix variable naming and syntax errors.
There are two issues:
- Line 63:
tokens_shape
is incorrectly reused as the object to call method on - Line 67: Missing closing parenthesis
std::vector<int64_t> tokens_shape =
- tokens_shape.GetTensorTypeAndShapeInfo().GetShape();
+ tokens.GetTensorTypeAndShapeInfo().GetShape();
int64_t batch_size = tokens_shape[0];
if (batch_size != 1) {
SHERPA_ONNX_LOGE("Support only batch_size == 1. Given: %d",
- static_cast<int32_t>(batch_size);
+ static_cast<int32_t>(batch_size));
exit(-1);
}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
std::vector<int64_t> tokens_shape = | |
tokens_shape.GetTensorTypeAndShapeInfo().GetShape(); | |
int64_t batch_size = tokens_shape[0]; | |
if (batch_size != 1) { | |
SHERPA_ONNX_LOGE("Support only batch_size == 1. Given: %d", | |
static_cast<int32_t>(batch_size); | |
exit(-1); | |
} | |
std::vector<int64_t> tokens_shape = | |
tokens.GetTensorTypeAndShapeInfo().GetShape(); | |
int64_t batch_size = tokens_shape[0]; | |
if (batch_size != 1) { | |
SHERPA_ONNX_LOGE("Support only batch_size == 1. Given: %d", | |
static_cast<int32_t>(batch_size)); | |
exit(-1); | |
} |
🤖 Prompt for AI Agents
In sherpa-onnx/csrc/offline-tts-zipvoice-model.cc around lines 62 to 69, the
variable tokens_shape is reused incorrectly to call
GetTensorTypeAndShapeInfo().GetShape(), which causes a naming conflict. Rename
the initial variable holding the tensor info to avoid overwriting tokens_shape.
Also, fix the syntax error on line 67 by adding the missing closing parenthesis
in the SHERPA_ONNX_LOGE call. These changes will correct the variable misuse and
syntax error.
OfflineTtsMatchaModel::OfflineTtsMatchaModel( | ||
const OfflineTtsModelConfig &config) | ||
: impl_(std::make_unique<Impl>(config)) {} | ||
|
||
template <typename Manager> | ||
OfflineTtsMatchaModel::OfflineTtsMatchaModel( | ||
Manager *mgr, const OfflineTtsModelConfig &config) | ||
: impl_(std::make_unique<Impl>(mgr, config)) {} | ||
|
||
OfflineTtsMatchaModel::~OfflineTtsMatchaModel() = default; | ||
|
||
const OfflineTtsZipvoiceModelMetaData &OfflineTtsMatchaModel::GetMetaData() | ||
const { | ||
return impl_->GetMetaData(); | ||
} | ||
|
||
Ort::Value OfflineTtsMatchaModel::Run(Ort::Value tokens, | ||
Ort::Value prompt_tokens, | ||
Ort::Value prompt_features, | ||
float speed /*= 1.0*/, | ||
int num_step /*= 16*/) const { | ||
return impl_->Run(std::move(tokens), | ||
std::move(prompt_tokens), | ||
std::move(prompt_features), | ||
speed, num_step); | ||
} | ||
|
||
#if __ANDROID_API__ >= 9 | ||
template OfflineTtsMatchaModel::OfflineTtsMatchaModel( | ||
AAssetManager *mgr, const OfflineTtsModelConfig &config); | ||
#endif | ||
|
||
#if __OHOS__ | ||
template OfflineTtsMatchaModel::OfflineTtsMatchaModel( | ||
NativeResourceManager *mgr, const OfflineTtsModelConfig &config); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix class name mismatch.
The implementation uses OfflineTtsMatchaModel
but the header declares OfflineTtsZipvoiceModel
. This needs to be consistent.
-OfflineTtsMatchaModel::OfflineTtsMatchaModel(
+OfflineTtsZipvoiceModel::OfflineTtsZipvoiceModel(
const OfflineTtsModelConfig &config)
: impl_(std::make_unique<Impl>(config)) {}
template <typename Manager>
-OfflineTtsMatchaModel::OfflineTtsMatchaModel(
+OfflineTtsZipvoiceModel::OfflineTtsZipvoiceModel(
Manager *mgr, const OfflineTtsModelConfig &config)
: impl_(std::make_unique<Impl>(mgr, config)) {}
-OfflineTtsMatchaModel::~OfflineTtsMatchaModel() = default;
+OfflineTtsZipvoiceModel::~OfflineTtsZipvoiceModel() = default;
-const OfflineTtsZipvoiceModelMetaData &OfflineTtsMatchaModel::GetMetaData()
+const OfflineTtsZipvoiceModelMetaData &OfflineTtsZipvoiceModel::GetMetaData()
const {
return impl_->GetMetaData();
}
-Ort::Value OfflineTtsMatchaModel::Run(Ort::Value tokens,
+Ort::Value OfflineTtsZipvoiceModel::Run(Ort::Value tokens,
Ort::Value prompt_tokens,
Ort::Value prompt_features,
float speed /*= 1.0*/,
int num_step /*= 16*/) const {
#if __ANDROID_API__ >= 9
-template OfflineTtsMatchaModel::OfflineTtsMatchaModel(
+template OfflineTtsZipvoiceModel::OfflineTtsZipvoiceModel(
AAssetManager *mgr, const OfflineTtsModelConfig &config);
#endif
#if __OHOS__
-template OfflineTtsMatchaModel::OfflineTtsMatchaModel(
+template OfflineTtsZipvoiceModel::OfflineTtsZipvoiceModel(
NativeResourceManager *mgr, const OfflineTtsModelConfig &config);
#endif
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
OfflineTtsMatchaModel::OfflineTtsMatchaModel( | |
const OfflineTtsModelConfig &config) | |
: impl_(std::make_unique<Impl>(config)) {} | |
template <typename Manager> | |
OfflineTtsMatchaModel::OfflineTtsMatchaModel( | |
Manager *mgr, const OfflineTtsModelConfig &config) | |
: impl_(std::make_unique<Impl>(mgr, config)) {} | |
OfflineTtsMatchaModel::~OfflineTtsMatchaModel() = default; | |
const OfflineTtsZipvoiceModelMetaData &OfflineTtsMatchaModel::GetMetaData() | |
const { | |
return impl_->GetMetaData(); | |
} | |
Ort::Value OfflineTtsMatchaModel::Run(Ort::Value tokens, | |
Ort::Value prompt_tokens, | |
Ort::Value prompt_features, | |
float speed /*= 1.0*/, | |
int num_step /*= 16*/) const { | |
return impl_->Run(std::move(tokens), | |
std::move(prompt_tokens), | |
std::move(prompt_features), | |
speed, num_step); | |
} | |
#if __ANDROID_API__ >= 9 | |
template OfflineTtsMatchaModel::OfflineTtsMatchaModel( | |
AAssetManager *mgr, const OfflineTtsModelConfig &config); | |
#endif | |
#if __OHOS__ | |
template OfflineTtsMatchaModel::OfflineTtsMatchaModel( | |
NativeResourceManager *mgr, const OfflineTtsModelConfig &config); | |
#endif | |
OfflineTtsZipvoiceModel::OfflineTtsZipvoiceModel( | |
const OfflineTtsModelConfig &config) | |
: impl_(std::make_unique<Impl>(config)) {} | |
template <typename Manager> | |
OfflineTtsZipvoiceModel::OfflineTtsZipvoiceModel( | |
Manager *mgr, const OfflineTtsModelConfig &config) | |
: impl_(std::make_unique<Impl>(mgr, config)) {} | |
OfflineTtsZipvoiceModel::~OfflineTtsZipvoiceModel() = default; | |
const OfflineTtsZipvoiceModelMetaData &OfflineTtsZipvoiceModel::GetMetaData() | |
const { | |
return impl_->GetMetaData(); | |
} | |
Ort::Value OfflineTtsZipvoiceModel::Run(Ort::Value tokens, | |
Ort::Value prompt_tokens, | |
Ort::Value prompt_features, | |
float speed /*= 1.0*/, | |
int num_step /*= 16*/) const { | |
return impl_->Run(std::move(tokens), | |
std::move(prompt_tokens), | |
std::move(prompt_features), | |
speed, num_step); | |
} | |
#if __ANDROID_API__ >= 9 | |
template OfflineTtsZipvoiceModel::OfflineTtsZipvoiceModel( | |
AAssetManager *mgr, const OfflineTtsModelConfig &config); | |
#endif | |
#if __OHOS__ | |
template OfflineTtsZipvoiceModel::OfflineTtsZipvoiceModel( | |
NativeResourceManager *mgr, const OfflineTtsModelConfig &config); | |
#endif |
🤖 Prompt for AI Agents
In sherpa-onnx/csrc/offline-tts-zipvoice-model.cc between lines 272 and 307, the
class name used is OfflineTtsMatchaModel, but the header declares
OfflineTtsZipvoiceModel. Rename all occurrences of OfflineTtsMatchaModel in this
file to OfflineTtsZipvoiceModel to ensure consistency with the header
declaration.
Closing via #2487 |
Summary by CodeRabbit
New Features
Documentation