aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/ai/AiModule.qml
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/modules/ai/AiModule.qml')
-rw-r--r--desktop/modules/ai/AiModule.qml16
1 files changed, 2 insertions, 14 deletions
diff --git a/desktop/modules/ai/AiModule.qml b/desktop/modules/ai/AiModule.qml
index d58ebfe..4c50224 100644
--- a/desktop/modules/ai/AiModule.qml
+++ b/desktop/modules/ai/AiModule.qml
@@ -41,16 +41,12 @@ Module {
sd: "stable-diffusion.cpp",
assistant: "Desktop assistant",
chat: "Local chat",
- imggen: "imggen",
- fanfic: "Fanfictioner",
})
readonly property string assistantSh:
Quickshell.env("HOME") + "/Programming/GIT/desktop-assistant/assistant.sh"
- // Each project's own control. Fanfictioner has no start, a run needs a
- // story file, and its stop needs the pid, see stop(). llamachat has no
- // restart, and --quit answers before the app is gone, so a --daemon
+ // Each project's own control. llamachat has no restart, and --quit answers before the app is gone, so a --daemon
// straight after would find it still running and do nothing: wait for
// --ping to fail first, up to 5s.
readonly property var controls: ({
@@ -59,7 +55,6 @@ Module {
chat: { start: ["llamachat", "--daemon"], stop: ["llamachat", "--quit"],
restart: ["sh", "-c", "llamachat --quit; for _ in $(seq 50); do "
+ "llamachat --ping || break; sleep 0.1; done; exec llamachat --daemon"] },
- imggen: { start: ["imggen", "start"], stop: ["imggen", "stop"] },
})
function canStart(app) { return controls[app.name] !== undefined; }
@@ -75,14 +70,7 @@ Module {
}
function stop(app) {
- if (app.name !== "fanfic") {
- exec(controls[app.name].stop);
- return;
- }
- // The sd-cli children first, then the script, by pid only: a name
- // match would take unrelated sd-cli and python processes with it.
- if (!/^[0-9]+$/.test(app.detail)) return;
- exec(["sh", "-c", 'pkill -TERM -P "$1"; kill -TERM "$1"', "sh", app.detail]);
+ exec(controls[app.name].stop);
}
// The router frees the model's VRAM; the next request for it loads it