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

Function max_generation_steps

src/models/vibevoice/generator.cpp:158–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158int64_t max_generation_steps(const VibeVoicePreparedPrompt & prompt, const VibeVoiceGenerationOptions & options, const VibeVoiceDecoderConfig & config) {
159 if (prompt.steps <= 0 || config.max_position_embeddings <= prompt.steps) {
160 throw std::runtime_error("VibeVoice generation prompt exceeds decoder position capacity");
161 }
162 int64_t by_length = config.max_position_embeddings - prompt.steps;
163 if (options.max_tokens > 0) {
164 by_length = std::min(by_length, options.max_tokens);
165 }
166 const int64_t by_ratio = static_cast<int64_t>(options.max_length_times * static_cast<float>(prompt.steps));
167 const int64_t steps = std::min(by_length, by_ratio);
168 if (steps <= 0) {
169 throw std::runtime_error("VibeVoice generation max steps must be positive");
170 }
171 return steps;
172}
173
174std::vector<float> load_noise_file(const std::string & path, const char * label) {
175 if (path.empty()) {

Callers 2

generate_vibevoiceFunction · 0.85
generate_vibevoice_batchFunction · 0.85

Calls 1

minFunction · 0.85

Tested by

no test coverage detected