| 562 | struct State; |
| 563 | std::unique_ptr<State> state_; |
| 564 | }; |
| 565 | |
| 566 | struct 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 | |
| 574 | S3TokenizerInferenceSessionCache::S3TokenizerInferenceSessionCache() |
| 575 | : state_(std::make_unique<State>()) {} |
| 576 | |
| 577 | S3TokenizerInferenceSessionCache::~S3TokenizerInferenceSessionCache() = default; |
| 578 | S3TokenizerInferenceSessionCache::S3TokenizerInferenceSessionCache(S3TokenizerInferenceSessionCache &&) noexcept = default; |
| 579 | S3TokenizerInferenceSessionCache & |
| 580 | S3TokenizerInferenceSessionCache::operator=(S3TokenizerInferenceSessionCache &&) noexcept = default; |
| 581 | |
| 582 | TokenizerOutputs 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 || |
no test coverage detected