Ask: Better printing.
This commit is contained in:
parent
93c1ae56d8
commit
0781453676
|
@ -5,9 +5,10 @@
|
|||
# Usage: ask <QUERY>
|
||||
function ask() {
|
||||
curl http://localhost:11434/api/generate -d "{
|
||||
\"model\": \"''${OLLAMA_MODEL}\",
|
||||
\"model\":\"''${OLLAMA_MODEL}\",
|
||||
\"raw\":true,
|
||||
\"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
|
||||
}
|
||||
|
||||
|
|
|
@ -24,10 +24,8 @@ in
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment = {
|
||||
# Specify default model.
|
||||
variables.OLLAMA_MODEL = cfg.primaryModel;
|
||||
};
|
||||
# Specify default model.
|
||||
environment.variables.OLLAMA_MODEL = cfg.primaryModel;
|
||||
|
||||
systemd.services = {
|
||||
# Enable Ollama server.
|
||||
|
|
Loading…
Reference in a new issue