MCPcopy Create free account
hub / github.com/PABannier/bark.cpp / bark_load_model

Function bark_load_model

bark.cpp:1177–1194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1175}
1176
1177struct bark_context* bark_load_model(const char* model_path, struct bark_context_params params, uint32_t seed) {
1178 int64_t t_load_start_us = ggml_time_us();
1179
1180 struct bark_context* bctx = new bark_context();
1181
1182 bctx->text_model = bark_model();
1183 std::string model_path_str(model_path);
1184 if (!bark_load_model_from_file(model_path_str, bctx, params.verbosity)) {
1185 fprintf(stderr, "%s: failed to load model weights from '%s'\n", __func__, model_path);
1186 return nullptr;
1187 }
1188
1189 bctx->rng = std::mt19937(seed);
1190 bctx->params = params;
1191 bctx->stats.t_load_us = ggml_time_us() - t_load_start_us;
1192
1193 return bctx;
1194}
1195
1196static struct ggml_cgraph* bark_build_gpt_graph(
1197 gpt_model* model,

Callers

nothing calls this directly

Calls 2

bark_modelClass · 0.70

Tested by

no test coverage detected