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

Function main

examples/quantize/main.cpp:60–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60int main(int argc, char** argv) {
61 if (argc != 4) {
62 fprintf(stderr, "usage: %s model-f32.bin model-quant.bin type\n", argv[0]);
63 ggml_print_ftypes(stderr);
64 return 1;
65 }
66
67 // needed to initialize f16 tables
68 {
69 struct ggml_init_params params = {0, NULL, false};
70 struct ggml_context* ctx = ggml_init(params);
71 ggml_free(ctx);
72 }
73
74 const char* fname_inp = argv[1];
75 const char* fname_out = argv[2];
76
77 const ggml_ftype ftype = ggml_parse_ftype(argv[3]);
78
79 const int64_t t_main_start_us = ggml_time_us();
80
81 int64_t t_quantize_us = 0;
82
83 // load the model
84 {
85 const int64_t t_start_us = ggml_time_us();
86 bark_model_quantize(fname_inp, fname_out, ggml_ftype(ftype));
87 t_quantize_us = ggml_time_us() - t_start_us;
88 }
89
90 // report timing
91 {
92 const int64_t t_main_end_us = ggml_time_us();
93
94 printf("\n");
95 printf("%s: quantize time = %8.2f ms\n", __func__, t_quantize_us / 1000.0f);
96 printf("%s: total time = %8.2f ms\n", __func__, (t_main_end_us - t_main_start_us) / 1000.0f);
97 }
98
99 return 0;
100}

Callers

nothing calls this directly

Calls 4

ggml_print_ftypesFunction · 0.85
ggml_parse_ftypeFunction · 0.85
ggml_ftypeEnum · 0.70
bark_model_quantizeFunction · 0.50

Tested by

no test coverage detected