Skip to content

Commit

Permalink
Update WhisperFactory.cs (#41)
Browse files Browse the repository at this point in the history
Since I needed a custom dll path, I noticed this isn't passed so far and the default path was always used. Positioning the if query after the variable declarations solved the problem for me. I think the if (!libraryLoaded.value.isSuccess) query before WhisperFactory.librayPath = libraryPath; was a bug.
  • Loading branch information
GFNiko authored May 16, 2023
1 parent df04c7a commit d31d84b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Whisper.net/WhisperFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ public sealed class WhisperFactory : IDisposable

private WhisperFactory(IWhisperProcessorModelLoader loader, bool delayInit, string? libraryPath = default, bool bypassLoading = false)
{
WhisperFactory.libraryPath = libraryPath;
WhisperFactory.bypassLoading = bypassLoading;

if (!libraryLoaded.Value.IsSuccess)
{
throw new Exception($"Failed to load native whisper library. Error: {libraryLoaded.Value.ErrorMessage}");
}

WhisperFactory.libraryPath = libraryPath;
WhisperFactory.bypassLoading = bypassLoading;

this.loader = loader;
if (!delayInit)
{
Expand Down

0 comments on commit d31d84b

Please sign in to comment.