mirror of
https://github.com/yusufipk/dikte.git
synced 2026-09-11 10:56:10 +00:00
Name the card that ran, and say what to install
Two things the first pass got wrong. The card was named out of whichever listing came first, so a machine with both a CUDA build and a Vulkan loader could have its card named from the wrong one. Worse, whisper numbers every device it can see in one sequence while the handle carries the backend's own index: a processor-only build lent a Vulkan backend through GGML_BACKEND_PATH reports "device 1: Vulkan0", and reading that listing by the handle's digit names whatever sat in slot zero. The backend's own enumeration is asked first now, because it is the only one indexed the way the handle is, and whisper's listing is a fallback taken only when it names exactly one card. And "this build carries no graphics backend" left the reader with nowhere to go. It is the one case with a fix worth naming: whisper.cpp publishes no build that reaches a card on Linux, and program_path runs a copy from the system ahead of the downloaded one, so installing one is the whole remedy. Server.state() now says which copy is running, and the line says so only when it is Dikte's own download; a system build that cannot reach the card gets the shorter sentence, since installing it again would change nothing. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_019zqCqhmeaNT6m1GPp8ZWPp
This commit is contained in:
@@ -1205,6 +1205,20 @@ class LocalModels(DikteTest):
|
||||
self.assertIn("processor", whisper)
|
||||
self.assertIn("no graphics backend", whisper)
|
||||
|
||||
def test_the_downloaded_build_is_told_what_to_install(self):
|
||||
# whisper.cpp publishes nothing that reaches a card on this system, and
|
||||
# a copy on the PATH is used ahead of Dikte's own, so that is the fix.
|
||||
whisper, _ = self.shown(backend="CPU", device="CPU", available=["CPU"],
|
||||
downloaded=True)
|
||||
self.assertIn("Dikte downloaded", whisper)
|
||||
self.assertIn("whisper-server", whisper)
|
||||
|
||||
def test_a_system_build_is_not_told_to_install_itself(self):
|
||||
whisper, _ = self.shown(backend="CPU", device="CPU", available=["CPU"],
|
||||
downloaded=False)
|
||||
self.assertIn("no graphics backend", whisper)
|
||||
self.assertNotIn("Dikte downloaded", whisper)
|
||||
|
||||
def test_a_build_that_could_have_used_one_says_the_other_thing(self):
|
||||
whisper, _ = self.shown(backend="CPU", device="CPU",
|
||||
available=["CUDA", "CPU"])
|
||||
|
||||
Reference in New Issue
Block a user