Skip to content

Commit fa6913f

Browse files
authored
v2.6.3
1 parent 918b5cc commit fa6913f

File tree

5 files changed

+41
-59
lines changed

5 files changed

+41
-59
lines changed

src/config.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,14 @@ AVAILABLE_MODELS:
185185
max_sequence: 512
186186
size_mb: 670
187187
model: thenlper/gte-large
188-
COMPUTE_DEVICE: cuda
188+
COMPUTE_DEVICE: cpu
189189
Compute_Device:
190190
available:
191191
- cuda
192192
- cpu
193-
database_creation: cuda
193+
database_creation: cpu
194194
database_query: cpu
195-
EMBEDDING_MODEL_NAME: C:/PATH/Scripts/ChromaDB-Plugin-for-LM-Studio/v2_6_2 - working/Embedding_Models/BAAI--llm-embedder
195+
EMBEDDING_MODEL_NAME:
196196
database:
197197
chunk_overlap: 250
198198
chunk_size: 700
@@ -219,14 +219,14 @@ styles:
219219
input: 'background-color: #2e333b; color: light gray; font: 13pt "Segoe UI Historic";'
220220
text: 'background-color: #092327; color: light gray; font: 12pt "Segoe UI Historic";'
221221
transcribe_file:
222-
device: cuda
223-
file: C:/PATH/Scripts/ChromaDB-Plugin-for-LM-Studio/v2_6_1 - working/test.wma
222+
device: cpu
223+
file:
224224
language: Option 1
225225
model: small.en
226-
quant: float16
226+
quant: float32
227227
timestamps: true
228228
translate: false
229229
transcriber:
230-
device: cuda
231-
model: small.en
230+
device: cpu
231+
model: base.en
232232
quant: float32

src/gui_tabs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ def create_tabs():
3636

3737
buttons_dict = {
3838
'Tips': 'tips.html',
39-
'Whisper': 'whisper_quants.html',
40-
'Float': 'number_format.html',
4139
'Settings': 'settings.html',
40+
'Embedding Models': 'embedding_models.html',
4241
'Transcribe': 'transcribe.html'
4342
}
4443

src/gui_tabs_settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ def __init__(self):
2121
self.layout = QVBoxLayout()
2222

2323
classes = {
24-
"Server/LLM Settings": (ServerSettingsTab, 4),
25-
"Embedding Models Settings": (ModelsSettingsTab, 6),
24+
"Server/LLM Settings": (ServerSettingsTab, 3),
25+
# "Embedding Models Settings": (ModelsSettingsTab, 6),
2626
# "Chunk Settings": (ChunkSettingsTab, 2),
2727
"Transcriber Settings": (TranscriberSettingsTab, 1),
28-
"Database Settings": (DatabaseSettingsTab, 3),
28+
"Database Settings": (DatabaseSettingsTab, 5),
2929
}
3030

3131
self.groups = {}

src/gui_tabs_tools_transcribe.py

Lines changed: 29 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from PySide6.QtCore import QThread, Qt
55
import ctranslate2
66
import yaml
7-
# Import the TranscribeFile class from the transcribe_module.py script
87
from transcribe_module import TranscribeFile
98

109
class TranscriptionThread(QThread):
@@ -26,7 +25,7 @@ class TranscriberToolSettingsTab(QWidget):
2625

2726
def __init__(self):
2827
super().__init__()
29-
self.selected_audio_file = None # Keep track of the selected audio file
28+
self.selected_audio_file = None
3029
self.create_layout()
3130
self.load_config()
3231

@@ -71,60 +70,48 @@ def update_quantization(self, device_combo, quantization_combo):
7170
def create_layout(self):
7271
layout = QGridLayout()
7372

73+
def add_widget(widget_class, text, row, column, colspan=1, signal_slot=None, items=None):
74+
widget = widget_class()
75+
if widget_class in [QLabel, QPushButton]:
76+
widget.setText(text)
77+
if signal_slot:
78+
widget.clicked.connect(signal_slot)
79+
if widget_class is QComboBox and items:
80+
widget.addItems(items)
81+
layout.addWidget(widget, row, column, 1, colspan)
82+
return widget
83+
7484
# Model
75-
model_label = QLabel("Model")
76-
layout.addWidget(model_label, 0, 0)
77-
self.model_combo = QComboBox()
78-
self.model_combo.addItems(["tiny", "tiny.en", "base", "base.en", "small", "small.en", "medium", "medium.en", "large-v2"])
79-
layout.addWidget(self.model_combo, 0, 1)
85+
add_widget(QLabel, "Model", 0, 0)
86+
self.model_combo = add_widget(QComboBox, None, 0, 1, items=["tiny", "tiny.en", "base", "base.en", "small", "small.en", "medium", "medium.en", "large-v2"])
8087

8188
# Quantization
82-
quantization_label = QLabel("Quant")
83-
layout.addWidget(quantization_label, 0, 2)
84-
self.quantization_combo = QComboBox()
85-
layout.addWidget(self.quantization_combo, 0, 3)
89+
add_widget(QLabel, "Quant", 0, 2)
90+
self.quantization_combo = add_widget(QComboBox, None, 0, 3)
8691

8792
# Device
88-
device_label = QLabel("Device")
89-
layout.addWidget(device_label, 0, 4)
90-
self.device_combo = QComboBox()
91-
device_options = ["cpu"]
92-
if self.has_cuda_device():
93-
device_options.append("cuda")
94-
self.device_combo.addItems(device_options)
95-
layout.addWidget(self.device_combo, 0, 5)
93+
add_widget(QLabel, "Device", 0, 4)
94+
device_options = ["cpu"] + ["cuda"] if self.has_cuda_device() else []
95+
self.device_combo = add_widget(QComboBox, None, 0, 5, items=device_options)
9696

9797
# Timestamp and Translate Labels with Checkboxes
98-
timestamp_label = QLabel("Timestamps")
99-
layout.addWidget(timestamp_label, 1, 0)
100-
self.timestamp_checkbox = QCheckBox()
101-
layout.addWidget(self.timestamp_checkbox, 1, 1)
102-
translate_label = QLabel("Translate")
103-
layout.addWidget(translate_label, 1, 2)
104-
self.translate_checkbox = QCheckBox()
105-
layout.addWidget(self.translate_checkbox, 1, 3)
98+
add_widget(QLabel, "Timestamps", 1, 0)
99+
self.timestamp_checkbox = add_widget(QCheckBox, None, 1, 1)
100+
add_widget(QLabel, "Translate", 1, 2)
101+
self.translate_checkbox = add_widget(QCheckBox, None, 1, 3)
106102

107103
# Language Label and ComboBox
108-
language_label = QLabel("Language")
109-
layout.addWidget(language_label, 1, 4)
110-
self.language_combo = QComboBox()
111-
self.language_combo.addItems(["Option 1", "Option 2", "Option 3"])
112-
layout.addWidget(self.language_combo, 1, 5)
104+
add_widget(QLabel, "Language", 1, 4)
105+
self.language_combo = add_widget(QComboBox, None, 1, 5, items=["Option 1", "Option 2", "Option 3"])
113106

114107
# Select Audio File Button
115-
self.select_file_button = QPushButton("Select Audio File")
116-
self.select_file_button.clicked.connect(self.select_audio_file)
117-
layout.addWidget(self.select_file_button, 2, 0, 1, 3)
108+
self.select_file_button = add_widget(QPushButton, "Select Audio File", 2, 0, 3, signal_slot=self.select_audio_file)
118109

119-
# Transcribe/Translate Button (with functionality)
120-
self.transcribe_translate_button = QPushButton("Transcribe/Translate")
121-
self.transcribe_translate_button.clicked.connect(self.start_transcription)
122-
layout.addWidget(self.transcribe_translate_button, 2, 3, 1, 3)
110+
# Transcribe/Translate Button
111+
self.transcribe_translate_button = add_widget(QPushButton, "Transcribe/Translate", 2, 3, 3, signal_slot=self.start_transcription)
123112

124113
# Update Settings Button
125-
self.update_settings_button = QPushButton("Update Settings")
126-
self.update_settings_button.clicked.connect(self.save_settings)
127-
layout.addWidget(self.update_settings_button, 3, 0, 1, 6)
114+
self.update_settings_button = add_widget(QPushButton, "Update Settings", 3, 0, 6, signal_slot=self.save_settings)
128115

129116
self.device_combo.currentTextChanged.connect(lambda: self.update_quantization(self.device_combo, self.quantization_combo))
130117
self.update_quantization(self.device_combo, self.quantization_combo)
@@ -166,11 +153,8 @@ def update_config(self, file_to_transcribe=None, **kwargs):
166153

167154
def start_transcription(self):
168155
if self.selected_audio_file:
169-
# Create an instance of the TranscribeFile class
170156
transcriber = TranscribeFile()
171-
# Create a QThread object and move the transcriber to it
172157
self.transcription_thread = TranscriptionThread(transcriber)
173-
# Start the thread which will call the run method
174158
self.transcription_thread.start()
175159
else:
176160
print("Please select an audio file first.")

src/utilities.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import os
22

33
def validate_symbolic_links(source_directory):
4-
# Checks symbolic links in the docs for db folder to make sure they're valid, and removes the ones that aren't
54
symbolic_links = [entry for entry in os.listdir(source_directory) if os.path.islink(os.path.join(source_directory, entry))]
65

76
for symlink in symbolic_links:

0 commit comments

Comments
 (0)