MCPcopy Create free account
hub / github.com/alibaba/MNN / vocoderWorkerLoop

Method vocoderWorkerLoop

transformers/llm/engine/src/omni.cpp:1832–1866  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1830}
1831
1832void Talker::vocoderWorkerLoop() {
1833 BackendConfig backendConfig;
1834 auto forwardType = backend_type_convert(mConfig->backend_type(true));
1835 int numThread = mConfig->thread_num(true);
1836 auto executor = Express::Executor::newExecutor(forwardType, backendConfig, numThread);
1837 Express::ExecutorScope scope(executor);
1838 mBigvgan_async.reset(Module::clone(mBigvgan.get()));
1839
1840 while (true) {
1841 WavChunk chunk;
1842 {
1843 std::unique_lock<std::mutex> lock(mMelQueueMutex);
1844 mMelQueueCond.wait(lock, [this] {
1845 return !mMelQueue.empty() || !mWavWorkerRunning;
1846 });
1847 if (!mWavWorkerRunning && mMelQueue.empty()) {
1848 break;
1849 }
1850 if (mMelQueue.empty()) {
1851 continue;
1852 }
1853 chunk = std::move(mMelQueue.front());
1854 mMelQueue.pop();
1855 }
1856
1857 processWavChunk(chunk);
1858
1859 if (chunk.is_last) {
1860 mWavLastDone.store(true);
1861 mWavQueueCond.notify_all();
1862 }
1863 }
1864
1865 mBigvgan_async.reset();
1866}
1867
1868VARP Talker::ditForwardAsync(const int codec_size, const int* codec_tokens, const float* initial_noise) {
1869 auto code = _Const(codec_tokens, {1, codec_size}, NCHW, halide_type_of<int>());

Callers

nothing calls this directly

Calls 11

backend_typeMethod · 0.80
thread_numMethod · 0.80
backend_type_convertFunction · 0.70
cloneFunction · 0.50
resetMethod · 0.45
getMethod · 0.45
waitMethod · 0.45
emptyMethod · 0.45
frontMethod · 0.45
popMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected