Ask: Better printing.
This commit is contained in:
parent
93c1ae56d8
commit
0781453676
|
@ -6,8 +6,9 @@
|
||||||
function ask() {
|
function ask() {
|
||||||
curl http://localhost:11434/api/generate -d "{
|
curl http://localhost:11434/api/generate -d "{
|
||||||
\"model\":\"''${OLLAMA_MODEL}\",
|
\"model\":\"''${OLLAMA_MODEL}\",
|
||||||
|
\"raw\":true,
|
||||||
\"prompt\":\"''${*}\"
|
\"prompt\":\"''${*}\"
|
||||||
}" 2> /dev/null | parallel -j1 -- "echo {} | jq -r .response | tr -d '\n'"
|
}" 2> /dev/null | parallel -j1 -- "printf '%s\n' {} | jq -r .response | sed -e 's/^$/\+\+\+/' | tr -d '\n' | sed -e 's/\+\+\+/\n/'"
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,10 +24,8 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
environment = {
|
|
||||||
# Specify default model.
|
# Specify default model.
|
||||||
variables.OLLAMA_MODEL = cfg.primaryModel;
|
environment.variables.OLLAMA_MODEL = cfg.primaryModel;
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services = {
|
systemd.services = {
|
||||||
# Enable Ollama server.
|
# Enable Ollama server.
|
||||||
|
|
Loading…
Reference in a new issue