| 1083 | } |
| 1084 | if (graph_ == nullptr || !graph_->matches(feature_frames, false)) { |
| 1085 | graph_ = std::make_unique<Vevo2CocoTokenizerGraph>( |
| 1086 | execution_context_.backend(), |
| 1087 | execution_context_.backend_type(), |
| 1088 | graph_context_bytes_, |
| 1089 | config_, |
| 1090 | *weights_, |
| 1091 | feature_frames); |
| 1092 | } |
| 1093 | return *graph_; |
| 1094 | } |
| 1095 | |
| 1096 | Vevo2TokenSequence Vevo2ProsodyTokenizerRuntime::encode_chromagram_features( |
| 1097 | const std::vector<float> & chromagram_features, |
| 1098 | int64_t feature_frames) const { |
| 1099 | if (static_cast<int64_t>(chromagram_features.size()) != feature_frames * config_.chromagram_dim) { |
| 1100 | throw std::runtime_error("Vevo2 prosody chromagram feature size mismatch"); |
| 1101 | } |
| 1102 | return ensure_graph(feature_frames, false).run(chromagram_features, std::nullopt); |
| 1103 | } |
| 1104 | |
| 1105 | Vevo2TokenSequence Vevo2ProsodyTokenizerRuntime::encode( |
| 1106 | const runtime::AudioBuffer & prosody_audio, |
| 1107 | const std::optional<runtime::AudioBuffer> & style_ref_audio, |
| 1108 | const Vevo2GenerationOptions & generation) const { |
| 1109 | if (generation.predict_target_prosody) { |
| 1110 | throw std::runtime_error("Vevo2 predict_target_prosody is not implemented in the reference path"); |
| 1111 | } |
nothing calls this directly
no test coverage detected