mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
Add Faster Whisper CUDA libs download - thx Perfview :)
See https://github.com/Purfview/whisper-standalone-win/issues/58#issuecomment-1678479859
This commit is contained in:
parent
35b2a21d17
commit
5d1597c6e0
@ -22,6 +22,7 @@
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=assa/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Cuda/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Downloader/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=ffprobe/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Immersive/@EntryIndexedValue">True</s:Boolean>
|
||||
|
@ -9,5 +9,6 @@
|
||||
public const string CTranslate2 = "CTranslate2";
|
||||
public const string StableTs = "stable-ts";
|
||||
public const string PurfviewFasterWhisper = "Purfview's Faster-Whisper";
|
||||
public const string PurfviewFasterWhisperCuda = "Purfview's Faster-Whisper CUDA";
|
||||
}
|
||||
}
|
||||
|
@ -66,6 +66,7 @@
|
||||
this.labelEngine = new System.Windows.Forms.Label();
|
||||
this.buttonAdvanced = new System.Windows.Forms.Button();
|
||||
this.labelAdvanced = new System.Windows.Forms.Label();
|
||||
this.downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.groupBoxModels.SuspendLayout();
|
||||
this.groupBoxInputFiles.SuspendLayout();
|
||||
this.contextMenuStripWhisperAdvanced.SuspendLayout();
|
||||
@ -398,34 +399,35 @@
|
||||
this.runOnlyPostProcessingToolStripMenuItem,
|
||||
this.toolStripSeparatorRunOnlyPostprocessing,
|
||||
this.setCPPConstmeModelsFolderToolStripMenuItem,
|
||||
this.removeTemporaryFilesToolStripMenuItem});
|
||||
this.removeTemporaryFilesToolStripMenuItem,
|
||||
this.downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem});
|
||||
this.contextMenuStripWhisperAdvanced.Name = "contextMenuStripWhisperAdvanced";
|
||||
this.contextMenuStripWhisperAdvanced.Size = new System.Drawing.Size(259, 76);
|
||||
this.contextMenuStripWhisperAdvanced.Size = new System.Drawing.Size(320, 120);
|
||||
this.contextMenuStripWhisperAdvanced.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStripWhisperAdvanced_Opening);
|
||||
//
|
||||
// runOnlyPostProcessingToolStripMenuItem
|
||||
//
|
||||
this.runOnlyPostProcessingToolStripMenuItem.Name = "runOnlyPostProcessingToolStripMenuItem";
|
||||
this.runOnlyPostProcessingToolStripMenuItem.Size = new System.Drawing.Size(258, 22);
|
||||
this.runOnlyPostProcessingToolStripMenuItem.Size = new System.Drawing.Size(319, 22);
|
||||
this.runOnlyPostProcessingToolStripMenuItem.Text = "Run only post processing";
|
||||
this.runOnlyPostProcessingToolStripMenuItem.Click += new System.EventHandler(this.runOnlyPostProcessingToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripSeparatorRunOnlyPostprocessing
|
||||
//
|
||||
this.toolStripSeparatorRunOnlyPostprocessing.Name = "toolStripSeparatorRunOnlyPostprocessing";
|
||||
this.toolStripSeparatorRunOnlyPostprocessing.Size = new System.Drawing.Size(255, 6);
|
||||
this.toolStripSeparatorRunOnlyPostprocessing.Size = new System.Drawing.Size(316, 6);
|
||||
//
|
||||
// setCPPConstmeModelsFolderToolStripMenuItem
|
||||
//
|
||||
this.setCPPConstmeModelsFolderToolStripMenuItem.Name = "setCPPConstmeModelsFolderToolStripMenuItem";
|
||||
this.setCPPConstmeModelsFolderToolStripMenuItem.Size = new System.Drawing.Size(258, 22);
|
||||
this.setCPPConstmeModelsFolderToolStripMenuItem.Size = new System.Drawing.Size(319, 22);
|
||||
this.setCPPConstmeModelsFolderToolStripMenuItem.Text = "Set CPP/Const-me models folder...";
|
||||
this.setCPPConstmeModelsFolderToolStripMenuItem.Click += new System.EventHandler(this.setCPPConstMeModelsFolderToolStripMenuItem_Click);
|
||||
//
|
||||
// removeTemporaryFilesToolStripMenuItem
|
||||
//
|
||||
this.removeTemporaryFilesToolStripMenuItem.Name = "removeTemporaryFilesToolStripMenuItem";
|
||||
this.removeTemporaryFilesToolStripMenuItem.Size = new System.Drawing.Size(258, 22);
|
||||
this.removeTemporaryFilesToolStripMenuItem.Size = new System.Drawing.Size(319, 22);
|
||||
this.removeTemporaryFilesToolStripMenuItem.Text = "Remove temporary files";
|
||||
this.removeTemporaryFilesToolStripMenuItem.Click += new System.EventHandler(this.removeTemporaryFilesToolStripMenuItem_Click);
|
||||
//
|
||||
@ -494,6 +496,13 @@
|
||||
this.labelAdvanced.TabIndex = 29;
|
||||
this.labelAdvanced.Text = "Advanced...";
|
||||
//
|
||||
// downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem
|
||||
//
|
||||
this.downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem.Name = "downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem";
|
||||
this.downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem.Size = new System.Drawing.Size(319, 22);
|
||||
this.downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem.Text = "Download CUDA for Perfview\'s Whisper-Faster";
|
||||
this.downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem.Click += new System.EventHandler(this.downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem_Click);
|
||||
//
|
||||
// WhisperAudioToText
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
@ -579,5 +588,6 @@
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparatorRunOnlyPostprocessing;
|
||||
private System.Windows.Forms.Button buttonAdvanced;
|
||||
private System.Windows.Forms.Label labelAdvanced;
|
||||
private System.Windows.Forms.ToolStripMenuItem downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem;
|
||||
}
|
||||
}
|
@ -16,6 +16,7 @@ using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Controls;
|
||||
using MessageBox = Nikse.SubtitleEdit.Forms.SeMsgBox.MessageBox;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
{
|
||||
@ -44,6 +45,7 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
private VideoInfo _videoInfo;
|
||||
private readonly WavePeakData _wavePeaks;
|
||||
public bool UnknownArgument { get; set; }
|
||||
public bool RunningOnCuda { get; set; }
|
||||
public bool IncompleteModel { get; set; }
|
||||
public string IncompleteModelName { get; set; }
|
||||
|
||||
@ -83,6 +85,7 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
removeTemporaryFilesToolStripMenuItem.Text = LanguageSettings.Current.AudioToText.RemoveTemporaryFiles;
|
||||
buttonAdvanced.Text = LanguageSettings.Current.General.Advanced;
|
||||
labelAdvanced.Text = Configuration.Settings.Tools.WhisperExtraSettings;
|
||||
downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem.Text = LanguageSettings.Current.AudioToText.DownloadFasterWhisperCuda;
|
||||
|
||||
columnHeaderFileName.Text = LanguageSettings.Current.JoinSubtitles.FileName;
|
||||
|
||||
@ -700,6 +703,11 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
UnknownArgument = true;
|
||||
}
|
||||
|
||||
if (outLine.Data.Contains("running on: CUDA", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
RunningOnCuda = true;
|
||||
}
|
||||
|
||||
_outputText.Add(outLine.Data.Trim() + Environment.NewLine);
|
||||
|
||||
foreach (var line in outLine.Data.SplitToLines())
|
||||
@ -1617,6 +1625,8 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
{
|
||||
setCPPConstmeModelsFolderToolStripMenuItem.Text = LanguageSettings.Current.AudioToText.SetCppConstMeFolder;
|
||||
}
|
||||
|
||||
downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem.Visible = Configuration.Settings.Tools.WhisperChoice == WhisperChoice.PurfviewFasterWhisper;
|
||||
}
|
||||
|
||||
private void runOnlyPostProcessingToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
@ -1666,5 +1676,48 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
labelAdvanced.Text = Configuration.Settings.Tools.WhisperExtraSettings;
|
||||
}
|
||||
}
|
||||
|
||||
private void downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
DownloadCudaForWhisperFaster(this);
|
||||
}
|
||||
|
||||
public static void DownloadCudaForWhisperFaster(IWin32Window owner)
|
||||
{
|
||||
if (MessageBox.Show(string.Format(LanguageSettings.Current.Settings.DownloadX, "Faster-Whisper CUDA (GPU)"), "Subtitle Edit", MessageBoxButtons.YesNoCancel) != DialogResult.Yes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var alreadyInstalled = IsFasterWhisperCudaInstalled();
|
||||
|
||||
if (alreadyInstalled)
|
||||
{
|
||||
if (MessageBox.Show("CUDA is probably already installed - reinstall?", "Subtitle Edit", MessageBoxButtons.YesNoCancel) != DialogResult.Yes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
using (var downloadForm = new WhisperDownload(WhisperChoice.PurfviewFasterWhisperCuda))
|
||||
{
|
||||
if (downloadForm.ShowDialog(owner) == DialogResult.OK)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsFasterWhisperCudaInstalled()
|
||||
{
|
||||
var folder = Path.Combine(Configuration.DataDirectory, "Whisper", "Purfview-Whisper-Faster");
|
||||
if (!Directory.Exists(folder))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var cudaFiles = Directory.GetFiles(folder, "cu*.dll");
|
||||
var alreadyInstalled = cudaFiles.Length > 2;
|
||||
return alreadyInstalled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -57,6 +57,7 @@
|
||||
this.comboBoxWhisperEngine = new Nikse.SubtitleEdit.Controls.NikseComboBox();
|
||||
this.labelAdvanced = new System.Windows.Forms.Label();
|
||||
this.buttonAdvanced = new System.Windows.Forms.Button();
|
||||
this.downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.groupBoxModels.SuspendLayout();
|
||||
this.groupBoxInputFiles.SuspendLayout();
|
||||
this.contextMenuStripWhisperAdvanced.SuspendLayout();
|
||||
@ -157,10 +158,23 @@
|
||||
//
|
||||
// comboBoxLanguages
|
||||
//
|
||||
this.comboBoxLanguages.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.comboBoxLanguages.BackColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
|
||||
this.comboBoxLanguages.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179)))));
|
||||
this.comboBoxLanguages.BorderColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(120)))), ((int)(((byte)(120)))));
|
||||
this.comboBoxLanguages.ButtonForeColor = System.Drawing.SystemColors.ControlText;
|
||||
this.comboBoxLanguages.ButtonForeColorDown = System.Drawing.Color.Orange;
|
||||
this.comboBoxLanguages.ButtonForeColorOver = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215)))));
|
||||
this.comboBoxLanguages.DropDownHeight = 400;
|
||||
this.comboBoxLanguages.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBoxLanguages.DropDownWidth = 194;
|
||||
this.comboBoxLanguages.FormattingEnabled = true;
|
||||
this.comboBoxLanguages.Location = new System.Drawing.Point(6, 53);
|
||||
this.comboBoxLanguages.MaxLength = 32767;
|
||||
this.comboBoxLanguages.Name = "comboBoxLanguages";
|
||||
this.comboBoxLanguages.SelectedIndex = -1;
|
||||
this.comboBoxLanguages.SelectedItem = null;
|
||||
this.comboBoxLanguages.SelectedText = "";
|
||||
this.comboBoxLanguages.Size = new System.Drawing.Size(194, 21);
|
||||
this.comboBoxLanguages.TabIndex = 7;
|
||||
this.comboBoxLanguages.SelectedIndexChanged += new System.EventHandler(this.comboBoxLanguages_SelectedIndexChanged);
|
||||
@ -198,10 +212,23 @@
|
||||
//
|
||||
// comboBoxModels
|
||||
//
|
||||
this.comboBoxModels.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.comboBoxModels.BackColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
|
||||
this.comboBoxModels.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179)))));
|
||||
this.comboBoxModels.BorderColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(120)))), ((int)(((byte)(120)))));
|
||||
this.comboBoxModels.ButtonForeColor = System.Drawing.SystemColors.ControlText;
|
||||
this.comboBoxModels.ButtonForeColorDown = System.Drawing.Color.Orange;
|
||||
this.comboBoxModels.ButtonForeColorOver = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215)))));
|
||||
this.comboBoxModels.DropDownHeight = 400;
|
||||
this.comboBoxModels.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBoxModels.DropDownWidth = 240;
|
||||
this.comboBoxModels.FormattingEnabled = true;
|
||||
this.comboBoxModels.Location = new System.Drawing.Point(257, 53);
|
||||
this.comboBoxModels.MaxLength = 32767;
|
||||
this.comboBoxModels.Name = "comboBoxModels";
|
||||
this.comboBoxModels.SelectedIndex = -1;
|
||||
this.comboBoxModels.SelectedItem = null;
|
||||
this.comboBoxModels.SelectedText = "";
|
||||
this.comboBoxModels.Size = new System.Drawing.Size(240, 21);
|
||||
this.comboBoxModels.TabIndex = 0;
|
||||
//
|
||||
@ -290,22 +317,23 @@
|
||||
//
|
||||
this.contextMenuStripWhisperAdvanced.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.setCPPConstmeModelsFolderToolStripMenuItem,
|
||||
this.removeTemporaryFilesToolStripMenuItem});
|
||||
this.removeTemporaryFilesToolStripMenuItem,
|
||||
this.downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem});
|
||||
this.contextMenuStripWhisperAdvanced.Name = "contextMenuStripWhisperAdvanced";
|
||||
this.contextMenuStripWhisperAdvanced.Size = new System.Drawing.Size(259, 48);
|
||||
this.contextMenuStripWhisperAdvanced.Size = new System.Drawing.Size(320, 92);
|
||||
this.contextMenuStripWhisperAdvanced.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStripWhisperAdvanced_Opening);
|
||||
//
|
||||
// setCPPConstmeModelsFolderToolStripMenuItem
|
||||
//
|
||||
this.setCPPConstmeModelsFolderToolStripMenuItem.Name = "setCPPConstmeModelsFolderToolStripMenuItem";
|
||||
this.setCPPConstmeModelsFolderToolStripMenuItem.Size = new System.Drawing.Size(258, 22);
|
||||
this.setCPPConstmeModelsFolderToolStripMenuItem.Size = new System.Drawing.Size(319, 22);
|
||||
this.setCPPConstmeModelsFolderToolStripMenuItem.Text = "Set CPP/Const-me models folder...";
|
||||
this.setCPPConstmeModelsFolderToolStripMenuItem.Click += new System.EventHandler(this.setCPPConstMeModelsFolderToolStripMenuItem_Click);
|
||||
//
|
||||
// removeTemporaryFilesToolStripMenuItem
|
||||
//
|
||||
this.removeTemporaryFilesToolStripMenuItem.Name = "removeTemporaryFilesToolStripMenuItem";
|
||||
this.removeTemporaryFilesToolStripMenuItem.Size = new System.Drawing.Size(258, 22);
|
||||
this.removeTemporaryFilesToolStripMenuItem.Size = new System.Drawing.Size(319, 22);
|
||||
this.removeTemporaryFilesToolStripMenuItem.Text = "Remove temporary files";
|
||||
this.removeTemporaryFilesToolStripMenuItem.Click += new System.EventHandler(this.removeTemporaryFilesToolStripMenuItem_Click);
|
||||
//
|
||||
@ -322,9 +350,23 @@
|
||||
// comboBoxWhisperEngine
|
||||
//
|
||||
this.comboBoxWhisperEngine.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.comboBoxWhisperEngine.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.comboBoxWhisperEngine.BackColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
|
||||
this.comboBoxWhisperEngine.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179)))));
|
||||
this.comboBoxWhisperEngine.BorderColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(120)))), ((int)(((byte)(120)))));
|
||||
this.comboBoxWhisperEngine.ButtonForeColor = System.Drawing.SystemColors.ControlText;
|
||||
this.comboBoxWhisperEngine.ButtonForeColorDown = System.Drawing.Color.Orange;
|
||||
this.comboBoxWhisperEngine.ButtonForeColorOver = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215)))));
|
||||
this.comboBoxWhisperEngine.DropDownHeight = 400;
|
||||
this.comboBoxWhisperEngine.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBoxWhisperEngine.DropDownWidth = 154;
|
||||
this.comboBoxWhisperEngine.FormattingEnabled = false;
|
||||
this.comboBoxWhisperEngine.Location = new System.Drawing.Point(543, 6);
|
||||
this.comboBoxWhisperEngine.MaxLength = 32767;
|
||||
this.comboBoxWhisperEngine.Name = "comboBoxWhisperEngine";
|
||||
this.comboBoxWhisperEngine.SelectedIndex = -1;
|
||||
this.comboBoxWhisperEngine.SelectedItem = null;
|
||||
this.comboBoxWhisperEngine.SelectedText = "";
|
||||
this.comboBoxWhisperEngine.Size = new System.Drawing.Size(154, 21);
|
||||
this.comboBoxWhisperEngine.TabIndex = 28;
|
||||
this.comboBoxWhisperEngine.SelectedIndexChanged += new System.EventHandler(this.comboBoxWhisperEngine_SelectedIndexChanged);
|
||||
@ -350,6 +392,13 @@
|
||||
this.buttonAdvanced.UseVisualStyleBackColor = true;
|
||||
this.buttonAdvanced.Click += new System.EventHandler(this.buttonAdvanced_Click);
|
||||
//
|
||||
// downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem
|
||||
//
|
||||
this.downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem.Name = "downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem";
|
||||
this.downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem.Size = new System.Drawing.Size(319, 22);
|
||||
this.downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem.Text = "Download CUDA for Perfview\'s Whisper-Faster";
|
||||
this.downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem.Click += new System.EventHandler(this.downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem_Click);
|
||||
//
|
||||
// WhisperAudioToTextSelectedLines
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
@ -422,5 +471,6 @@
|
||||
private System.Windows.Forms.ToolStripMenuItem setCPPConstmeModelsFolderToolStripMenuItem;
|
||||
private System.Windows.Forms.Label labelAdvanced;
|
||||
private System.Windows.Forms.Button buttonAdvanced;
|
||||
private System.Windows.Forms.ToolStripMenuItem downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem;
|
||||
}
|
||||
}
|
@ -28,6 +28,12 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
|
||||
public Subtitle TranscribedSubtitle { get; private set; }
|
||||
|
||||
public bool UnknownArgument { get; set; }
|
||||
public bool RunningOnCuda { get; set; }
|
||||
public bool IncompleteModel { get; set; }
|
||||
public string IncompleteModelName { get; set; }
|
||||
|
||||
|
||||
public WhisperAudioToTextSelectedLines(List<AudioClipsGet.AudioClip> audioClips, Form parentForm)
|
||||
{
|
||||
UiUtil.PreInitialize(this);
|
||||
@ -238,6 +244,25 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
return;
|
||||
}
|
||||
|
||||
if (outLine.Data.Contains("not all tensors loaded from model file"))
|
||||
{
|
||||
IncompleteModel = true;
|
||||
}
|
||||
|
||||
if (outLine.Data.Contains("error: unknown argument: ", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
UnknownArgument = true;
|
||||
}
|
||||
else if (outLine.Data.Contains("error: unrecognized argument: ", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
UnknownArgument = true;
|
||||
}
|
||||
|
||||
if (outLine.Data.Contains("running on: CUDA", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
RunningOnCuda = true;
|
||||
}
|
||||
|
||||
_outputText.Add(outLine.Data.Trim() + Environment.NewLine);
|
||||
|
||||
foreach (var line in outLine.Data.SplitToLines())
|
||||
@ -688,5 +713,10 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
labelAdvanced.Text = Configuration.Settings.Tools.WhisperExtraSettings;
|
||||
}
|
||||
}
|
||||
|
||||
private void downloadCUDAForPerfviewsWhisperFasterToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
WhisperAudioToText.DownloadCudaForWhisperFaster(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -72,6 +72,18 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
"5414c15bb1682efc2f737f3ab5f15c4350a70c30a6101b631297420bbc4cb077ef9b88cb6e5512f4adcdafbda85eb894ff92eae07bd70c66efa0b28a08361033", // Whisper-Faster r141.4
|
||||
};
|
||||
|
||||
private const string DownloadUrlPurfviewFasterWhisperCuda = "https://github.com/Purfview/whisper-standalone-win/releases/download/libs/cuBLAS.and.cuDNN.zip";
|
||||
|
||||
private static readonly string[] Sha512HashesPurfviewFasterWhisperCuda =
|
||||
{
|
||||
"8d3499298bf4ee227c2587ab7ad80a2a6cbac6b64592a2bb2a887821465d20e19ceec2a7d97a4473a9fb47b477cbbba8c69b8e615a42201a6f5509800056a73b",
|
||||
};
|
||||
|
||||
private static readonly string[] OldSha512HashesPurfviewFasterWhisperCuda =
|
||||
{
|
||||
"",
|
||||
};
|
||||
|
||||
|
||||
public WhisperDownload(string whisperChoice)
|
||||
{
|
||||
@ -96,6 +108,10 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
{
|
||||
downloadUrl = DownloadUrlPurfviewFasterWhisper;
|
||||
}
|
||||
else if (_whisperChoice == WhisperChoice.PurfviewFasterWhisperCuda)
|
||||
{
|
||||
downloadUrl = DownloadUrlPurfviewFasterWhisperCuda;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
@ -152,6 +168,10 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
{
|
||||
hashes = Sha512HashesPurfviewFasterWhisper;
|
||||
}
|
||||
else if (_whisperChoice == WhisperChoice.PurfviewFasterWhisperCuda)
|
||||
{
|
||||
hashes = Sha512HashesPurfviewFasterWhisperCuda;
|
||||
}
|
||||
else
|
||||
{
|
||||
hashes = Sha512Hashes;
|
||||
@ -220,6 +240,27 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (_whisperChoice == WhisperChoice.PurfviewFasterWhisperCuda)
|
||||
{
|
||||
folder = Path.Combine(folder, "Purfview-Whisper-Faster");
|
||||
if (!Directory.Exists(folder))
|
||||
{
|
||||
Directory.CreateDirectory(folder);
|
||||
}
|
||||
|
||||
using (var zip = ZipExtractor.Open(downloadStream))
|
||||
{
|
||||
var dir = zip.ReadCentralDir();
|
||||
foreach (var entry in dir)
|
||||
{
|
||||
if (entry.FileSize > 0)
|
||||
{
|
||||
var path = Path.Combine(folder, Path.GetFileName(entry.FilenameInZip));
|
||||
zip.ExtractFile(entry, path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var skipFileNames = new[] { "command.exe", "stream.exe", "talk.exe", "bench.exe" };
|
||||
@ -237,10 +278,6 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Cursor = Cursors.Default;
|
||||
labelPleaseWait.Text = string.Empty;
|
||||
DialogResult = DialogResult.OK;
|
||||
|
@ -35270,6 +35270,13 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
UiUtil.OpenFile(SeLogger.GetWhisperLogFilePath());
|
||||
}
|
||||
}
|
||||
else if (form.RunningOnCuda &&
|
||||
Configuration.Settings.Tools.WhisperChoice == WhisperChoice.PurfviewFasterWhisper &&
|
||||
!WhisperAudioToText.IsFasterWhisperCudaInstalled())
|
||||
{
|
||||
MessageBox.Show("Faster Whisper CUDA (GPU) seems to be missing.");
|
||||
WhisperAudioToText.DownloadCudaForWhisperFaster(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
var customArgument = Configuration.Settings.Tools.WhisperExtraSettings;
|
||||
|
@ -366,6 +366,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
RemoveTemporaryFiles = "Remove temporary files",
|
||||
SetCppConstMeFolder = "Set CPP/Const-me models folder...",
|
||||
OnlyRunPostProcessing = "Run only post-processing/adjust timings",
|
||||
DownloadFasterWhisperCuda = "Download CUDA for Perfview's Whisper-Faster",
|
||||
};
|
||||
|
||||
AssaAttachments = new LanguageStructure.AssaAttachments
|
||||
|
@ -216,6 +216,7 @@
|
||||
public string RemoveTemporaryFiles { get; set; }
|
||||
public string SetCppConstMeFolder { get; set; }
|
||||
public string OnlyRunPostProcessing { get; set; }
|
||||
public string DownloadFasterWhisperCuda { get; set; }
|
||||
}
|
||||
|
||||
public class AssaAttachments
|
||||
|
Loading…
Reference in New Issue
Block a user