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

Method run_backend

src/models/chatterbox/s3_tokenizer_impl.cpp:564–587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

562 struct State;
563 std::unique_ptr<State> state_;
564};
565
566struct S3TokenizerInferenceSessionCache::State {
567 std::mutex mutex;
568 std::shared_ptr<S3TokenizerBackendRunner> runner;
569 const S3TokenizerV2Weights * weights = nullptr;
570 int64_t frames = 0;
571 engine::core::BackendConfig backend;
572};
573
574S3TokenizerInferenceSessionCache::S3TokenizerInferenceSessionCache()
575 : state_(std::make_unique<State>()) {}
576
577S3TokenizerInferenceSessionCache::~S3TokenizerInferenceSessionCache() = default;
578S3TokenizerInferenceSessionCache::S3TokenizerInferenceSessionCache(S3TokenizerInferenceSessionCache &&) noexcept = default;
579S3TokenizerInferenceSessionCache &
580S3TokenizerInferenceSessionCache::operator=(S3TokenizerInferenceSessionCache &&) noexcept = default;
581
582TokenizerOutputs S3TokenizerInferenceSessionCache::run_backend(
583 const S3TokenizerV2Weights & weights,
584 const std::vector<float> & mel_bct,
585 int64_t frames,
586 const engine::core::BackendConfig & backend) {
587 std::shared_ptr<S3TokenizerBackendRunner> runner;
588 {
589 std::lock_guard<std::mutex> lock(state_->mutex);
590 if (!state_->runner ||

Callers 1

Calls 2

same_backendFunction · 0.70
runMethod · 0.45

Tested by

no test coverage detected