| 1175 | } |
| 1176 | |
| 1177 | struct 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 | |
| 1196 | static struct ggml_cgraph* bark_build_gpt_graph( |
| 1197 | gpt_model* model, |
nothing calls this directly
no test coverage detected