mirror of
https://github.com/yusufipk/dikte.git
synced 2026-09-11 10:56:10 +00:00
Let OpenRouter subtitles use a chosen model instead of whisper-1
A timestamped run on OpenRouter always asked openai/whisper-1 for the segments, whatever model was picked for plain transcription. Not every model there returns segment times, so the one to use is now its own setting, openrouter_subtitle_model, shown in the speech-to-text box only when OpenRouter is the provider. Empty keeps the old whisper-1 fallback. Target carries the choice as subtitle_model and timestamp_model() reads it; the other providers are unchanged.
This commit is contained in:
@@ -220,6 +220,19 @@ class TranscribeTarget(DikteTest):
|
||||
self.assertEqual(target.service, "OpenRouter")
|
||||
self.assertEqual(target.api_key, "sk-or-test")
|
||||
self.assertEqual(target.model, "openai/whisper-1")
|
||||
self.assertEqual(target.subtitle_model, "")
|
||||
|
||||
def test_openrouter_carries_its_subtitle_model(self):
|
||||
conf = self.config(transcribe_provider="openrouter",
|
||||
openrouter_api_key="sk-or-test",
|
||||
openrouter_subtitle_model=" openai/whisper-large-v3 ")
|
||||
self.assertEqual(conf.transcribe_target().subtitle_model,
|
||||
"openai/whisper-large-v3")
|
||||
|
||||
def test_only_openrouter_has_a_subtitle_model(self):
|
||||
conf = self.config(transcribe_provider="openai", openai_api_key="sk-test",
|
||||
openrouter_subtitle_model="openai/whisper-large-v3")
|
||||
self.assertEqual(conf.transcribe_target().subtitle_model, "")
|
||||
|
||||
def test_groq_when_it_is_picked(self):
|
||||
conf = self.config(transcribe_provider="groq", groq_api_key="gsk-test",
|
||||
|
||||
Reference in New Issue
Block a user