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

Function parse_depths

src/models/vibevoice/tokenizer_audio.cpp:91–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89};
90
91std::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
115std::vector<int64_t> decoder_depths(const VibeVoiceTokenizerConfig & config) {
116 if (!config.decoder_depths.empty()) {

Callers 2

decoder_depthsFunction · 0.85
load_encoderFunction · 0.85

Calls 3

stringFunction · 0.50
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected