mirror of
https://github.com/yusufipk/dikte.git
synced 2026-09-11 10:56:10 +00:00
Add Windows support
Windows joins the three systems as its own entry in each table: DirectShow through ffmpeg for capture, the Win32 clipboard and SendInput for the paste, RegisterHotKey for the global shortcut, and the whisper.cpp and llama.cpp Windows zips (the OpenBLAS whisper build, which transcribes about twice as fast on a plain CPU). Settings go to APPDATA, data to LOCALAPPDATA, and install.ps1 adds the Start Menu entry, the dikte command and an optional autostart. Meetings are not supported yet: Windows offers nothing to record the far side from. Porting surfaced three fixes that were not Windows specific: - A stopped or overlong download tried to delete its .part file while still holding it open, which Windows refuses. The unlinks now wait for the handle. - The CLI transcribed files without handing the local servers their settings first, so a local provider failed with "no model downloaded" wherever the GUI had not run in the same process. - The audio content types are pinned instead of asked of the registry, which answers differently machine to machine. One fix is Windows specific but sits in shared code: shutdown() does not end a blocked recv there, so stopping a request also closes the socket handle. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5
parent
77b26e76be
commit
3436e6b426
@@ -14,6 +14,7 @@ from unittest import mock
|
||||
|
||||
import cli
|
||||
import config as cfg
|
||||
import ggml
|
||||
import hotkey
|
||||
import ipc
|
||||
from tests.support import DikteTest, fake_urlopen
|
||||
@@ -564,5 +565,27 @@ class Replies(DikteTest):
|
||||
self.assertEqual(cli.run(["cancel"]), 0)
|
||||
|
||||
|
||||
class TranscribeRunsHere(DikteTest):
|
||||
"""`dikte transcribe` runs in this process, not in the instance."""
|
||||
|
||||
def test_the_local_servers_are_handed_the_settings_first(self):
|
||||
# The GUI does this at startup; a CLI run has no GUI to have done it,
|
||||
# and without it the whisper server holds an empty model name.
|
||||
wav = self.path("clip.wav")
|
||||
wav.write_bytes(b"RIFF not really audio")
|
||||
self.write_config({"local_model": "ggml-base.bin"})
|
||||
self.addCleanup(ggml.whisper.configure,
|
||||
model="", threads=0, gpu=True, binary="")
|
||||
|
||||
opts = cli.build_parser().parse_args(["transcribe", str(wav)])
|
||||
with mock.patch.object(cli.filetranscribe, "FileTranscriber"), \
|
||||
mock.patch.object(cli, "_headless",
|
||||
return_value={"error": "stopped"}), \
|
||||
captured():
|
||||
cli.cmd_transcribe(opts)
|
||||
|
||||
self.assertEqual(ggml.whisper.settings()["model"], "ggml-base.bin")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user