MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / step

Method step

src/models/vibevoice/scheduler.cpp:240–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238}
239
240VibeVoiceSchedulerStepResult VibeVoiceDPMSolverScheduler::step(
241 const std::vector<float> & model_output,
242 int64_t timestep,
243 const std::vector<float> & sample) {
244 if (num_inference_steps_ <= 0) {
245 throw std::runtime_error("VibeVoice scheduler set_timesteps must be called before step");
246 }
247 if (step_index_ < 0) {
248 init_step_index(timestep);
249 }
250 const bool lower_order_final = (step_index_ == static_cast<int64_t>(timesteps_.size()) - 1);
251 const bool lower_order_second =
252 (step_index_ == static_cast<int64_t>(timesteps_.size()) - 2) &&
253 static_cast<int64_t>(timesteps_.size()) < 15;
254 auto converted = convert_model_output(model_output, sample);
255 for (size_t i = 0; i + 1 < model_outputs_.size(); ++i) {
256 model_outputs_[i] = model_outputs_[i + 1];
257 }
258 model_outputs_.back() = converted;
259
260 std::vector<float> prev_sample;
261 if (lower_order_nums_ < 1 || lower_order_final) {
262 prev_sample = first_order_update(model_outputs_.back(), sample);
263 } else if (kSolverOrder == 2 || lower_order_nums_ < 2 || lower_order_second) {
264 prev_sample = second_order_update(sample);
265 } else {
266 throw std::runtime_error("VibeVoice scheduler unexpected third-order path");
267 }
268
269 if (lower_order_nums_ < kSolverOrder) {
270 ++lower_order_nums_;
271 }
272 ++step_index_;
273 return {std::move(prev_sample)};
274}
275
276} // namespace engine::models::vibevoice

Callers 2

trainFunction · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected