| 89 | }; |
| 90 | |
| 91 | std::vector<int64_t> parse_depths(const std::string & value, const char * label) { |
| 92 | if (value.empty()) { |
| 93 | throw std::runtime_error(std::string("VibeVoice tokenizer missing ") + label); |
| 94 | } |
| 95 | std::vector<int64_t> out; |
| 96 | std::stringstream stream(value); |
| 97 | std::string item; |
| 98 | while (std::getline(stream, item, '-')) { |
| 99 | if (item.empty()) { |
| 100 | throw std::runtime_error(std::string("VibeVoice tokenizer invalid ") + label); |
| 101 | } |
| 102 | size_t pos = 0; |
| 103 | const auto depth = std::stoll(item, &pos); |
| 104 | if (pos != item.size() || depth <= 0) { |
| 105 | throw std::runtime_error(std::string("VibeVoice tokenizer invalid ") + label); |
| 106 | } |
| 107 | out.push_back(depth); |
| 108 | } |
| 109 | if (out.empty()) { |
| 110 | throw std::runtime_error(std::string("VibeVoice tokenizer empty ") + label); |
| 111 | } |
| 112 | return out; |
| 113 | } |
| 114 | |
| 115 | std::vector<int64_t> decoder_depths(const VibeVoiceTokenizerConfig & config) { |
| 116 | if (!config.decoder_depths.empty()) { |
no test coverage detected