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

Function validate_generation_request

src/models/pocket_tts/session.cpp:229–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227 }
228 throw std::runtime_error(std::string(option_name) + " currently supports only native, f32, and f16");
229}
230
231} // namespace
232
233namespace {
234
235void validate_generation_request(const GenerationRequest & request) {
236 if (request.text.empty()) {
237 throw std::runtime_error("PocketTTS text prompt is required");
238 }
239 if (request.max_steps < 0) {
240 throw std::runtime_error("PocketTTS max_steps must be non-negative");
241 }
242 if (request.max_tokens <= 0) {
243 throw std::runtime_error("PocketTTS max_tokens must be positive");
244 }
245 if (request.frames_after_eos < -1) {
246 throw std::runtime_error("PocketTTS frames_after_eos must be -1 or non-negative");
247 }
248 if (request.temperature <= 0.0F) {

Callers 1

generateMethod · 0.85

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected