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

Method initialize

src/models/vevo2/fm.cpp:948–967  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;

Callers 3

generate_melMethod · 0.45
initialize_handlersFunction · 0.45
ace_step_loaderFunction · 0.45

Calls 3

ggml_backend_tensor_setFunction · 0.85
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected