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

KonstantinSource codes8c4603c

master
1.5 KiB40 linesraw
1#pragma warning disable CS0649  // Field is never assigned to
2
3// Missing XML comment for publicly visible type or member
4// TODO: remove this line and document them.
5#pragma warning disable CS1591
6
7using System.Runtime.InteropServices;
8
9namespace Whisper.Internals
10{
11	/// <summary>This callback is called on each new segment</summary>
12	[UnmanagedFunctionPointer( CallingConvention.Cdecl )]
13	delegate int pfnNewSegment( IntPtr ctx, int countNew, IntPtr userData );
14
15	/// <summary>The callback is called before every encoder run. If it returns S_FALSE, the processing is aborted.</summary>
16	[UnmanagedFunctionPointer( CallingConvention.Cdecl )]
17	delegate int pfnEncoderBegin( IntPtr ctx, IntPtr userData );
18
19	/// <summary>Transcribe parameters</summary>
20	public struct sFullParams
21	{
22		internal Parameters publicParams;
23		// The rest of these parameters are not exposed to the user-friendly public API of this DLL
24
25		internal IntPtr prompt_tokens;
26		internal int prompt_n_tokens;
27
28		/// <summary>This callback is called on each new segment</summary>
29		[MarshalAs( UnmanagedType.FunctionPtr )]
30		internal pfnNewSegment? newSegmentCallback;
31		/// <summary>Parameter for the above, not needed in C#</summary>
32		internal IntPtr newSegmentCallbackData;
33
34		/// <summary>The callback is called before every encoder run. If it returns false, the processing is aborted</summary>
35		[MarshalAs( UnmanagedType.FunctionPtr )]
36		internal pfnEncoderBegin? encoderBeginCallback;
37		/// <summary>Parameter for the above, not needed in C#</summary>
38		internal IntPtr encoderBeginCallbackData;
39	}
40}