mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-26 05:02:36 +01:00
Try to fix issue with running Whisper cpp/const-me after setting location for Whisper OpenAI Python - thx rsmith02ct :)
This commit is contained in:
parent
e947a5ebf2
commit
966276a75f
@ -73,17 +73,20 @@ namespace Nikse.SubtitleEdit.Core.AudioToText
|
||||
|
||||
try
|
||||
{
|
||||
var location = Configuration.Settings.Tools.WhisperLocation;
|
||||
if (!string.IsNullOrEmpty(location))
|
||||
if (Configuration.Settings.Tools.WhisperChoice == WhisperChoice.OpenAI)
|
||||
{
|
||||
if (location.EndsWith("whisper.exe", StringComparison.InvariantCultureIgnoreCase) && File.Exists(location))
|
||||
var location = Configuration.Settings.Tools.WhisperLocation;
|
||||
if (!string.IsNullOrEmpty(location))
|
||||
{
|
||||
return Path.GetDirectoryName(location);
|
||||
}
|
||||
if (location.EndsWith("whisper.exe", StringComparison.InvariantCultureIgnoreCase) && File.Exists(location))
|
||||
{
|
||||
return Path.GetDirectoryName(location);
|
||||
}
|
||||
|
||||
if (Directory.Exists(location) && File.Exists(Path.Combine(location, "whisper.exe")))
|
||||
{
|
||||
return location;
|
||||
if (Directory.Exists(location) && File.Exists(Path.Combine(location, "whisper.exe")))
|
||||
{
|
||||
return location;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,7 +98,7 @@ namespace Nikse.SubtitleEdit.Core.AudioToText
|
||||
|
||||
if (Configuration.Settings.Tools.WhisperChoice == WhisperChoice.WhisperX && !string.IsNullOrEmpty(Configuration.Settings.Tools.WhisperXLocation))
|
||||
{
|
||||
if (Configuration.Settings.Tools.WhisperXLocation.EndsWith("whisperx.exe", StringComparison.InvariantCultureIgnoreCase) && File.Exists(location))
|
||||
if (Configuration.Settings.Tools.WhisperXLocation.EndsWith("whisperx.exe", StringComparison.InvariantCultureIgnoreCase) && File.Exists(Configuration.Settings.Tools.WhisperXLocation))
|
||||
{
|
||||
return Path.GetDirectoryName(Configuration.Settings.Tools.WhisperXLocation);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user