mirror of
https://github.com/yusufipk/dikte.git
synced 2026-09-11 19:06:11 +00:00
Describe the binary the settings point at, not the one Dikte found
program_path takes the custom path as its second argument, and config.py passes it, but the settings window never did. Happened on this machine: Compiled my own whisper.cpp and llama.cpp with CUDA and pointed the settings at them. The box with no downloaded copy said "Not installed." The box with one said "Downloaded, version b4938." naming a processor build while the CUDA one did the transcribing. LocalModelBox is now handed a callable, so the setting is read when the label is drawn rather than frozen when the window is built. The label reflects that too. A path set by hand now says so, instead of claiming Dikte downloaded something it didn't.
This commit is contained in:
@@ -1461,6 +1461,29 @@ class LocalModels(DikteTest):
|
||||
self.assertNotIn("Ready", box.status.text())
|
||||
self.assertIn("program", box.status.text())
|
||||
|
||||
def test_a_program_set_in_the_settings_is_not_called_downloaded(self):
|
||||
mine = self.path("my-whisper-server")
|
||||
mine.write_text("#!/bin/sh\n")
|
||||
mine.chmod(0o755)
|
||||
self.patch_attr(ggml.shutil, "which", lambda name: None)
|
||||
box = self.window(self.config(local_binary=str(mine))).local_whisper
|
||||
self.assertIn(str(mine), box.program_label.text())
|
||||
self.assertFalse(box.install_button.isVisibleTo(box))
|
||||
|
||||
def test_a_model_over_a_program_set_by_hand_is_ready(self):
|
||||
# The program is there, it is just named by the settings rather than
|
||||
# downloaded, and the status line looked past it.
|
||||
mine = self.path("my-whisper-server")
|
||||
mine.write_text("#!/bin/sh\n")
|
||||
mine.chmod(0o755)
|
||||
self.patch_attr(ggml.shutil, "which", lambda name: None)
|
||||
path = ggml.whisper_model_path("ggml-small.bin")
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
path.write_bytes(b"not really a model")
|
||||
box = self.window(self.config(local_binary=str(mine))).local_whisper
|
||||
box.load("ggml-small.bin")
|
||||
self.assertIn("Ready", box.status.text())
|
||||
|
||||
def test_changing_the_publisher_changes_the_model(self):
|
||||
# The model chosen under the old publisher is not published by the new
|
||||
# one. Carried over, it was added back as "not downloaded" and selected
|
||||
|
||||
Reference in New Issue
Block a user