| 946 | if (static_cast<int64_t>(timestep.size()) != config.hidden_size) { |
| 947 | throw std::runtime_error("Vevo2 FM step timestep shape mismatch"); |
| 948 | } |
| 949 | ggml_backend_tensor_set(timestep_input, timestep.data(), 0, timestep.size() * sizeof(float)); |
| 950 | const ggml_status status = engine::core::compute_backend_graph(backend, graph); |
| 951 | ggml_backend_synchronize(backend); |
| 952 | if (status != GGML_STATUS_SUCCESS) { |
| 953 | throw std::runtime_error("Vevo2 FM step graph compute failed"); |
| 954 | } |
| 955 | ggml_backend_tensor_copy(output, xt_input); |
| 956 | } |
| 957 | |
| 958 | std::vector<float> read_output(const Vevo2FMConfig & config) const { |
| 959 | std::vector<float> out(static_cast<size_t>(target_frames * config.mel_dim), 0.0F); |
| 960 | ggml_backend_tensor_get(output, out.data(), 0, out.size() * sizeof(float)); |
| 961 | return out; |
| 962 | } |
| 963 | |
| 964 | ggml_backend_t backend = nullptr; |
| 965 | std::shared_ptr<const Vevo2FMWeights> weights; |
| 966 | int64_t cond_frames = 0; |
| 967 | int64_t prompt_frames = 0; |
| 968 | int64_t target_frames = 0; |
| 969 | std::unique_ptr<ggml_context, GgmlContextDeleter> ctx; |
| 970 | ggml_tensor * prompt_input = nullptr; |
no test coverage detected