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

Method run

src/models/chatterbox/s3_tokenizer_impl.cpp:487–510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

485 }
486 engine::core::write_tensor_f32(cos_, cos_values);
487 engine::core::write_tensor_f32(sin_, sin_values);
488 }
489
490 ~S3TokenizerBackendRunner() {
491 if (graph_ != nullptr) {
492 engine::core::release_backend_graph_resources(execution_context_.backend(), graph_);
493 graph_ = nullptr;
494 }
495 if (gallocr_ != nullptr) {
496 ggml_gallocr_free(gallocr_);
497 gallocr_ = nullptr;
498 }
499 if (ggml_ != nullptr) {
500 ggml_free(ggml_);
501 ggml_ = nullptr;
502 }
503 }
504
505 TokenizerOutputs run(const std::vector<float> & mel_bct) {
506 std::lock_guard<std::mutex> lock(run_mutex_);
507 engine::core::write_tensor_f32(input_, mel_bct);
508 if (engine::core::compute_backend_graph(execution_context_.backend(), graph_) != GGML_STATUS_SUCCESS) {
509 throw std::runtime_error("ggml_backend_graph_compute failed for S3 tokenizer");
510 }
511 auto down = engine::core::read_tensor_f32(quant_out_.tensor);
512
513 TokenizerOutputs outputs;

Callers 1

run_backendMethod · 0.45

Calls 6

compute_backend_graphFunction · 0.85
read_tensor_f32Function · 0.85
torch_round_to_intFunction · 0.85
assignMethod · 0.80
write_tensor_f32Function · 0.50
backendMethod · 0.45

Tested by

no test coverage detected