yum-archive/TaSTT-Whisper
High-performance GPGPU inference of OpenAI's Whisper automatic speech recognition (ASR) model
git clone https://git.yummers.dev/yum-archive/TaSTT-Whisper
8c4603c
master
1#pragma once 2#include "DecoderTensors.h" 3#include <atlstr.h> 4#include <atlcoll.h> 5#include "../../ComLightLib/streams.h" 6 7namespace CpuCompute 8{ 9__interface iLoaderProgressSink 10 { 11HRESULT gotBytes (int64_t cb ); 12 }; 13 14class HybridLoader 15 { 16DecoderTensors & destination ; 17CAtlMap < CStringA ,Tensor *> map ; 18size_t bufferBytes = 0 ; 19 20struct alignas (32 )PendingTensor 21 { 22Tensor * destPointer = nullptr ; 23int64_t streamOffset = 0 ; 24size_t bufferOffset = 0 ; 25size_t payloadBytes = 0 ; 26 }; 27std ::vector < PendingTensor > pending ; 28 29public : 30 31HybridLoader (DecoderTensors & m ,int countLayers ); 32 33HRESULT setupTensor (const CStringA & name ,int n_dims ,int ftype ,const std ::array < int ,4 >& ne ,ComLight ::iReadStream * stream ,int64_t & postponedBytes ); 34 35HRESULT completeLoad (ComLight ::iReadStream * stream ,iLoaderProgressSink & progressSink ); 36 }; 37}