mirror of
https://github.com/yusufipk/dikte.git
synced 2026-09-11 19:06:11 +00:00
Call the OpenRouter subtitle model the audio file model
Timestamps are a file transcription option, so the model box is named after the file rather than the format it ends up in.
This commit is contained in:
+17
-17
@@ -865,14 +865,14 @@ class SettingsWindow(QDialog):
|
||||
self.refresh_transcribe_models)
|
||||
stt_form.addRow(t("Model"), self.transcribe_model_row)
|
||||
# OpenRouter only: which of its models a timestamped run asks for.
|
||||
self.subtitle_model = QComboBox()
|
||||
self.subtitle_model.setEditable(True)
|
||||
self.subtitle_model.lineEdit().setPlaceholderText(api.OPENROUTER_SUBTITLE_MODEL)
|
||||
self.subtitle_model.setToolTip(
|
||||
t("The model a timestamped run (subtitles) asks for. Not every model "
|
||||
self.file_model = QComboBox()
|
||||
self.file_model.setEditable(True)
|
||||
self.file_model.lineEdit().setPlaceholderText(api.OPENROUTER_FILE_MODEL)
|
||||
self.file_model.setToolTip(
|
||||
t("The model a timestamped audio file (subtitles) is sent to. Not every model "
|
||||
"on OpenRouter returns segment times; empty means openai/whisper-1."))
|
||||
self.subtitle_model_row = self._row(self.subtitle_model)
|
||||
stt_form.addRow(t("Subtitle model"), self.subtitle_model_row)
|
||||
self.file_model_row = self._row(self.file_model)
|
||||
stt_form.addRow(t("Audio file model"), self.file_model_row)
|
||||
# A spanning row: in the narrow field column a wrapped label gets a
|
||||
# height that fits one line, and the rest of the text is cut off.
|
||||
self.transcribe_status = QLabel("")
|
||||
@@ -1756,7 +1756,7 @@ class SettingsWindow(QDialog):
|
||||
self._shown_provider = ""
|
||||
self._select_data(self.transcribe_provider, conf["transcribe_provider"])
|
||||
self._provider_changed() # selecting index 0 fires no signal
|
||||
self.subtitle_model.setCurrentText(conf["openrouter_subtitle_model"])
|
||||
self.file_model.setCurrentText(conf["openrouter_file_model"])
|
||||
self.local_gpu.setChecked(conf["local_gpu"])
|
||||
self.local_preload.setChecked(conf["local_preload"])
|
||||
self.local_threads.setValue(int(conf["local_threads"]))
|
||||
@@ -1874,7 +1874,7 @@ class SettingsWindow(QDialog):
|
||||
for name, who in cfg.TRANSCRIBERS.items():
|
||||
conf[who.key] = self._key_fields[name].text().strip()
|
||||
conf[who.model] = self._models[name].strip() or cfg.DEFAULTS[who.model]
|
||||
conf["openrouter_subtitle_model"] = self.subtitle_model.currentText().strip()
|
||||
conf["openrouter_file_model"] = self.file_model.currentText().strip()
|
||||
conf["gemini_api_key"] = self.gemini_key.text().strip()
|
||||
conf["opencode_api_key"] = self.opencode_key.text().strip()
|
||||
conf["local_model"] = self.local_whisper.selected()
|
||||
@@ -2048,7 +2048,7 @@ class SettingsWindow(QDialog):
|
||||
self._shown_provider = provider
|
||||
local = provider == "local"
|
||||
self.stt_form.setRowVisible(self.transcribe_model_row, not local)
|
||||
self.stt_form.setRowVisible(self.subtitle_model_row, provider == "openrouter")
|
||||
self.stt_form.setRowVisible(self.file_model_row, provider == "openrouter")
|
||||
self.stt_form.setRowVisible(self.transcribe_status, not local)
|
||||
self.stt_form.setRowVisible(self.local_whisper, local)
|
||||
self.stt_form.setRowVisible(self.local_options, local)
|
||||
@@ -2058,14 +2058,14 @@ class SettingsWindow(QDialog):
|
||||
self.transcribe_model.addItems(TRANSCRIBE_MODELS[provider])
|
||||
self.transcribe_model.setCurrentText(self._models[provider])
|
||||
if provider == "openrouter":
|
||||
self._fill_subtitle_models(TRANSCRIBE_MODELS[provider])
|
||||
self._fill_file_models(TRANSCRIBE_MODELS[provider])
|
||||
self.transcribe_status.setText("")
|
||||
|
||||
def _fill_subtitle_models(self, models):
|
||||
current = self.subtitle_model.currentText()
|
||||
self.subtitle_model.clear()
|
||||
self.subtitle_model.addItems(models)
|
||||
self.subtitle_model.setCurrentText(current)
|
||||
def _fill_file_models(self, models):
|
||||
current = self.file_model.currentText()
|
||||
self.file_model.clear()
|
||||
self.file_model.addItems(models)
|
||||
self.file_model.setCurrentText(current)
|
||||
|
||||
def _load_transcribe_models(self):
|
||||
"""The model list of whichever provider is selected."""
|
||||
@@ -2096,7 +2096,7 @@ class SettingsWindow(QDialog):
|
||||
self.transcribe_model.addItems(models)
|
||||
self.transcribe_model.setCurrentText(current)
|
||||
if self._shown_provider == "openrouter":
|
||||
self._fill_subtitle_models(models)
|
||||
self._fill_file_models(models)
|
||||
self.transcribe_status.setText(t("{count} models loaded.", count=len(models)))
|
||||
|
||||
def _load_models(self):
|
||||
|
||||
Reference in New Issue
Block a user