Skip to content

Commit

Permalink
0.6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
CheshireCC committed Mar 6, 2024
1 parent ba6207b commit dc356cf
Show file tree
Hide file tree
Showing 5 changed files with 266 additions and 44 deletions.
8 changes: 4 additions & 4 deletions fasterWhisperGUIConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"Transcription_param": {
"aggregate_contents": true,
"language": 2,
"language": 1,
"task": false,
"beam_size": "5",
"best_of": "5",
Expand Down Expand Up @@ -67,11 +67,11 @@
"tabMovable": false,
"tabScrollable": false,
"tabShadowEnabled": false,
"tabMaxWidth": 205,
"tabMaxWidth": 366,
"closeDisplayMode": 0,
"whisperXMinSpeaker": 3,
"whisperXMinSpeaker": 2,
"whisperXMaxSpeaker": 3,
"outputFormat": 0,
"outputFormat": 4,
"outputEncoding": 1
}
}
12 changes: 8 additions & 4 deletions faster_whisper_GUI/mainWindows.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
from .fasterWhisperGuiIcon import FasterWhisperGUIIcon
from .UI_MainWindows import UIMainWin
from .tableModel_segments_path_info import TableModel
from .tableViewInterface import CustomTableView
from .whisper_x import WhisperXWorker
from .de_mucs import DemucsWorker
# from .style_sheet import StyleSheet
Expand Down Expand Up @@ -463,9 +464,11 @@ def transcribeProcess(self):
self.log.write(f"\n=========={dateTime_}==========\n")
self.log.write(f"==========Cancel==========\n")

messageBoxW = MessageBox(self.tr("取消")
, self.tr("是否取消操作?")
, self)
messageBoxW = MessageBox(
self.tr("取消")
, self.tr("是否取消操作?")
, self
)

if messageBoxW.exec():
self.page_process.button_process.setEnabled(False)
Expand Down Expand Up @@ -544,7 +547,8 @@ def createResultInTable(self, results):
for result in results:
segments, file, _ = result
file = file.replace("\\", "/")
table_view_widget = TableView()

table_view_widget = CustomTableView()
table_model = TableModel(segments)

self.tableModel_list[file] = table_model
Expand Down
23 changes: 17 additions & 6 deletions faster_whisper_GUI/tableModel_segments_path_info.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# coding:utf-8

from PySide6.QtCore import QAbstractTableModel, Qt
from PySide6.QtCore import QAbstractTableModel, QCoreApplication, Qt
# from PySide6.QtWidgets import QStyledItemDelegate, QLineEdit
from typing import List
from PySide6.QtWidgets import QApplication
from faster_whisper import Word
from qfluentwidgets.components.dialog_box.dialog import MessageBox

from .seg_ment import segment_Transcribe
from .util import HMSToSeconds, secondsToHMS
Expand All @@ -13,7 +15,10 @@ class TableModel(QAbstractTableModel):
def __init__(self, data:List[tuple]):
super(TableModel, self).__init__()
self._data = data


def __tr(self, text):
return QCoreApplication.translate(self.__class__.__name__, text)


def resetData(self, data):
self._data = data
Expand Down Expand Up @@ -56,10 +61,16 @@ def setData(self, index, value, role):
retxt = value.split(":")
if len(retxt) > 1:
if self._data[row].speaker != retxt[0]:
temp_data_speaker = self._data[row].speaker
for data in self._data:
if data.speaker is not None and data.speaker != "" and data.speaker == temp_data_speaker:
data.speaker = retxt[0]
temp_data_speaker = self._data[row].speaker
self._data[row].speaker = retxt[0]
# 批量修改所有相同说话人
msgb = MessageBox(self.__tr("提示"), self.__tr("是否修改所有相同说话人?"),QApplication.activeWindow())
# msgb.show()
if msgb.exec():
for data in self._data:
if data.speaker is not None and data.speaker != "" and data.speaker == temp_data_speaker:
data.speaker = retxt[0]

self._data[row].speaker = retxt[0]
self._data[row].text = ":".join(retxt[1:])
else:
Expand Down
Loading

0 comments on commit dc356cf

Please sign in to comment.