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

KonstantinFixed the old sample project012be51

master
822 B40 linesraw
1#include <stdint.h>
2#include <vector>
3#include <cstdarg>
4#include "Logger.h"
5
6namespace
7{
8	void logMessage( const char* lvl, const char8_t* pszFormat, std::va_list va )
9	{
10		fprintf( stderr, "%s: ", lvl );
11		vfprintf( stderr, (const char*)pszFormat, va );
12		fprintf( stderr, "\n" );
13	}
14}
15
16#define LOG_MESSAGE_IMPL( lvl )                \
17	std::va_list args;                         \
18	va_start( args, pszFormat );               \
19	logMessage( lvl, pszFormat, args );        \
20	va_end( args );
21
22void logError( const char8_t* pszFormat, ... )
23{
24	LOG_MESSAGE_IMPL( "Error" );
25}
26
27void logWarning( const char8_t* pszFormat, ... )
28{
29	LOG_MESSAGE_IMPL( "Warning" );
30}
31
32void logInfo( const char8_t* pszFormat, ... )
33{
34	LOG_MESSAGE_IMPL( "Info" );
35}
36
37void logDebug( const char8_t* pszFormat, ... )
38{
39	LOG_MESSAGE_IMPL( "Debug" );
40}