Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Whisper Factory Options #302

Merged
merged 3 commits into from
Dec 20, 2024
Merged

Conversation

sandrohanea
Copy link
Owner

As the options for creating a WhisperFactory were growing, took the initiative to migrate some of the options that are reusable to WhisperFactoryOptions and removing them from RuntimeOptions.

Now, RuntimeOptions remains only for Library loading (whisper.cpp Runtime) and any other options like GPU device, DTW options, etc. can be defined for each factory independent on the library itself.

@sandrohanea sandrohanea requested a review from Copilot December 20, 2024 15:13
@sandrohanea sandrohanea force-pushed the feature/addWhisperFactoryOptions branch from 96a8d4a to 401244a Compare December 20, 2024 15:14

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 9 changed files in this pull request and generated no comments.

Files not reviewed (4)
  • Whisper.net/Ggml/GgmlType.cs: Evaluated as low risk
  • Whisper.net/LibraryLoader/RuntimeOptions.cs: Evaluated as low risk
  • Whisper.net/WhisperFactory.cs: Evaluated as low risk
  • Whisper.net/Internals/Native/Data.cs: Evaluated as low risk
Comments suppressed due to low confidence (2)

Whisper.net/Internals/ModelLoader/ModelLoaderUtils.cs:30

  • The ArgumentOutOfRangeException should include a more descriptive error message.
throw new ArgumentOutOfRangeException(nameof(preset), preset, null);

Whisper.net/Internals/ModelLoader/WhisperProcessorModelFileLoader.cs:33

  • The variable 'aheadsHandle' is being redefined unnecessarily. It should use the existing 'aheadsHandle' field.
ModelLoaderUtils.GetWhisperAlignmentHeads(options.CustomAlignmentHeads, out var aheadsHandle);
@sandrohanea sandrohanea requested a review from Copilot December 20, 2024 15:18
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 9 changed files in this pull request and generated 1 comment.

Files not reviewed (4)
  • Whisper.net/Ggml/GgmlType.cs: Evaluated as low risk
  • Whisper.net/WhisperFactory.cs: Evaluated as low risk
  • Whisper.net/LibraryLoader/RuntimeOptions.cs: Evaluated as low risk
  • Whisper.net/Internals/Native/Data.cs: Evaluated as low risk
Comments suppressed due to low confidence (1)

Whisper.net/WhisperAlignmentHeads.cs:68

  • [nitpick] The parameter names textLayer and head should follow the naming convention and be renamed to TextLayer and Head respectively.
public readonly struct WhisperAlignmentHead(int textLayer, int head)

@sandrohanea sandrohanea requested a review from Copilot December 20, 2024 15:33

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 9 changed files in this pull request and generated no comments.

Files not reviewed (4)
  • Whisper.net/Ggml/GgmlType.cs: Evaluated as low risk
  • Whisper.net/LibraryLoader/RuntimeOptions.cs: Evaluated as low risk
  • Whisper.net/Internals/ModelLoader/WhisperProcessorModelBufferLoader.cs: Evaluated as low risk
  • Whisper.net/Internals/Native/Data.cs: Evaluated as low risk
Comments suppressed due to low confidence (1)

Whisper.net/WhisperAlignmentHeads.cs:70

  • [nitpick] The property name 'TextLayer' is ambiguous. It should be renamed to 'LayerIndex' for better clarity.
public int TextLayer { get; } = textLayer;
@sandrohanea sandrohanea merged commit dca380d into main Dec 20, 2024
21 checks passed
@sandrohanea sandrohanea deleted the feature/addWhisperFactoryOptions branch December 20, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant