MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / main

Function main

subprojects/llama.cpp/tools/tts/tts.cpp:538–1093  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

536}
537
538int main(int argc, char ** argv) {
539 common_params params;
540
541 params.out_file = "output.wav";
542 params.prompt = "";
543
544 params.n_predict = 4096;
545 params.n_batch = 8192;
546 params.n_ctx = 8192;
547
548 params.sampling.top_k = 4;
549 params.sampling.samplers = { COMMON_SAMPLER_TYPE_TOP_K, };
550
551 if (!common_params_parse(argc, argv, params, LLAMA_EXAMPLE_TTS, print_usage)) {
552 return 1;
553 }
554
555 const int n_parallel = params.n_parallel;
556 const int n_predict = params.n_predict;
557
558 common_init();
559
560 // init LLM
561
562 llama_backend_init();
563 llama_numa_init(params.numa);
564
565 llama_model * model_ttc = NULL; // text-to-codes
566 llama_model * model_cts = NULL; // codes-to-speech
567
568 llama_context * ctx_ttc = NULL;
569 llama_context * ctx_cts = NULL;
570
571 auto llama_init_ttc = common_init_from_params(params);
572
573 model_ttc = llama_init_ttc->model();
574 ctx_ttc = llama_init_ttc->context();
575
576 if (model_ttc == nullptr || ctx_ttc == nullptr) {
577 return ENOENT;
578 }
579
580 const llama_vocab * vocab = llama_model_get_vocab(model_ttc);
581
582 params.model = params.vocoder.model;
583 params.embedding = true;
584 params.n_ubatch = params.n_batch;
585
586 auto llama_init_cts = common_init_from_params(params);
587
588 model_cts = llama_init_cts->model();
589 ctx_cts = llama_init_cts->context();
590
591 if (model_cts == nullptr || ctx_cts == nullptr) {
592 return ENOENT;
593 }
594
595 std::vector<common_sampler *> smpl(n_parallel);

Callers

nothing calls this directly

Calls 15

common_params_parseFunction · 0.85
common_initFunction · 0.85
llama_backend_initFunction · 0.85
llama_numa_initFunction · 0.85
common_init_from_paramsFunction · 0.85
llama_model_get_vocabFunction · 0.85
common_sampler_initFunction · 0.85
common_sampler_get_seedFunction · 0.85
common_sampler_printFunction · 0.85
ggml_time_usFunction · 0.85
get_tts_versionFunction · 0.85
speaker_from_fileFunction · 0.85

Tested by

no test coverage detected