Skip to content

Commit

Permalink
Removed ggml log set
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrohanea committed Dec 22, 2024
1 parent 47c3325 commit b1c51d3
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 31 deletions.
5 changes: 0 additions & 5 deletions Whisper.net/Internals/Native/INativeWhisper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ internal interface INativeWhisper : IDisposable
[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
public delegate IntPtr whisper_full_get_token_text_from_state(IntPtr context, IntPtr state, int segmentIndex, int tokenIndex);

[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
public delegate void ggml_log_set(IntPtr logCallback, IntPtr user_data);

[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
public delegate IntPtr whisper_print_system_info();

Expand All @@ -105,7 +102,5 @@ internal interface INativeWhisper : IDisposable
whisper_ctx_init_openvino_encoder_with_state Whisper_Ctx_Init_Openvino_Encoder_With_State { get; }
whisper_full_get_token_data_from_state Whisper_Full_Get_Token_Data_From_State { get; }
whisper_full_get_token_text_from_state Whisper_Full_Get_Token_Text_From_State { get; }
ggml_log_set Ggml_log_set { get; }

whisper_print_system_info WhisperPrintSystemInfo { get; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ internal class DllImportsNativeLibWhisper : INativeWhisper
[DllImport(NativeConstants.LibWhisperLibraryName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
public static extern IntPtr whisper_full_get_token_text_from_state(IntPtr context, IntPtr state, int segmentIndex, int tokenIndex);

[DllImport(NativeConstants.LibGgmlWhisperLibraryName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
public static extern void ggml_log_set(IntPtr logCallback, IntPtr user_data);

[DllImport(NativeConstants.LibWhisperLibraryName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
public static extern IntPtr whisper_print_system_info();

Expand Down Expand Up @@ -131,8 +128,6 @@ internal class DllImportsNativeLibWhisper : INativeWhisper

public INativeWhisper.whisper_full_get_token_text_from_state Whisper_Full_Get_Token_Text_From_State => whisper_full_get_token_text_from_state;

public INativeWhisper.ggml_log_set Ggml_log_set => ggml_log_set;

public INativeWhisper.whisper_print_system_info WhisperPrintSystemInfo => whisper_print_system_info;

public void Dispose()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ internal class DllImportsNativeWhisper : INativeWhisper
[DllImport(NativeConstants.WhisperLibraryName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
public static extern IntPtr whisper_full_get_token_text_from_state(IntPtr context, IntPtr state, int segmentIndex, int tokenIndex);

[DllImport(NativeConstants.GgmlWhisperLibraryName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
public static extern void ggml_log_set(IntPtr logCallback, IntPtr user_data);

[DllImport(NativeConstants.WhisperLibraryName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
public static extern IntPtr whisper_print_system_info();

Expand Down Expand Up @@ -131,8 +128,6 @@ internal class DllImportsNativeWhisper : INativeWhisper

public INativeWhisper.whisper_full_get_token_text_from_state Whisper_Full_Get_Token_Text_From_State => whisper_full_get_token_text_from_state;

public INativeWhisper.ggml_log_set Ggml_log_set => ggml_log_set;

public INativeWhisper.whisper_print_system_info WhisperPrintSystemInfo => whisper_print_system_info;

public void Dispose()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ internal partial class LibraryImportInternalWhisper : INativeWhisper
[LibraryImport(NativeConstants.InternalLibraryName, StringMarshalling = StringMarshalling.Utf8)]
public static partial IntPtr whisper_full_get_token_text_from_state(IntPtr context, IntPtr state, int segmentIndex, int tokenIndex);

[LibraryImport(NativeConstants.InternalLibraryName, StringMarshalling = StringMarshalling.Utf8)]
public static partial void ggml_log_set(IntPtr logCallback, IntPtr user_data);

[LibraryImport(NativeConstants.InternalLibraryName, StringMarshalling = StringMarshalling.Utf8)]
public static partial IntPtr whisper_print_system_info();

Expand Down Expand Up @@ -131,8 +128,6 @@ internal partial class LibraryImportInternalWhisper : INativeWhisper

public INativeWhisper.whisper_full_get_token_text_from_state Whisper_Full_Get_Token_Text_From_State => whisper_full_get_token_text_from_state;

public INativeWhisper.ggml_log_set Ggml_log_set => ggml_log_set;

public INativeWhisper.whisper_print_system_info WhisperPrintSystemInfo => whisper_print_system_info;

public void Dispose()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ internal partial class LibraryImportLibWhisper : INativeWhisper
[LibraryImport(NativeConstants.LibWhisperLibraryName, StringMarshalling = StringMarshalling.Utf8)]
public static partial IntPtr whisper_full_get_token_text_from_state(IntPtr context, IntPtr state, int segmentIndex, int tokenIndex);

[LibraryImport(NativeConstants.LibGgmlWhisperLibraryName, StringMarshalling = StringMarshalling.Utf8)]
public static partial void ggml_log_set(IntPtr logCallback, IntPtr user_data);

[LibraryImport(NativeConstants.LibWhisperLibraryName, StringMarshalling = StringMarshalling.Utf8)]
public static partial IntPtr whisper_print_system_info();

Expand Down Expand Up @@ -132,8 +129,6 @@ internal partial class LibraryImportLibWhisper : INativeWhisper

public INativeWhisper.whisper_full_get_token_text_from_state Whisper_Full_Get_Token_Text_From_State => whisper_full_get_token_text_from_state;

public INativeWhisper.ggml_log_set Ggml_log_set => ggml_log_set;

public INativeWhisper.whisper_print_system_info WhisperPrintSystemInfo => whisper_print_system_info;

public void Dispose()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ internal static class NativeConstants
private const string libPrefix = "lib";

public const string WhisperLibraryName = "whisper";
public const string GgmlWhisperLibraryName = "ggml-whisper";
public const string LibWhisperLibraryName = libPrefix + WhisperLibraryName;
public const string LibGgmlWhisperLibraryName = libPrefix + GgmlWhisperLibraryName;

public const string InternalLibraryName = "__Internal";
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public NativeLibraryWhisper(IntPtr whisperLibraryHandle, IntPtr ggmlLibraryHandl
Whisper_Ctx_Init_Openvino_Encoder_With_State = Marshal.GetDelegateForFunctionPointer<whisper_ctx_init_openvino_encoder_with_state>(NativeLibrary.GetExport(whisperLibraryHandle, nameof(whisper_ctx_init_openvino_encoder_with_state)));
Whisper_Full_Get_Token_Data_From_State = Marshal.GetDelegateForFunctionPointer<whisper_full_get_token_data_from_state>(NativeLibrary.GetExport(whisperLibraryHandle, nameof(whisper_full_get_token_data_from_state)));
Whisper_Full_Get_Token_Text_From_State = Marshal.GetDelegateForFunctionPointer<whisper_full_get_token_text_from_state>(NativeLibrary.GetExport(whisperLibraryHandle, nameof(whisper_full_get_token_text_from_state)));
Ggml_log_set = Marshal.GetDelegateForFunctionPointer<ggml_log_set>(NativeLibrary.GetExport(ggmlLibraryHandle, nameof(ggml_log_set)));
WhisperPrintSystemInfo = Marshal.GetDelegateForFunctionPointer<whisper_print_system_info>(NativeLibrary.GetExport(whisperLibraryHandle, nameof(whisper_print_system_info)));

this.whisperLibraryHandle = whisperLibraryHandle;
Expand Down Expand Up @@ -89,8 +88,6 @@ public NativeLibraryWhisper(IntPtr whisperLibraryHandle, IntPtr ggmlLibraryHandl

public whisper_full_get_token_text_from_state Whisper_Full_Get_Token_Text_From_State { get; }

public ggml_log_set Ggml_log_set { get; }

public whisper_print_system_info WhisperPrintSystemInfo { get; }

public void Dispose()
Expand Down
1 change: 0 additions & 1 deletion Whisper.net/Logger/LogProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ internal static void InitializeLogging(INativeWhisper nativeWhisper)
funcPointer = (IntPtr)onLogging;
}
#endif
nativeWhisper.Ggml_log_set(funcPointer, IntPtr.Zero);
nativeWhisper.Whisper_Log_Set(funcPointer, IntPtr.Zero);
}

Expand Down

0 comments on commit b1c51d3

Please sign in to comment.