repeated_keys
This commit is contained in:
@@ -118,51 +118,55 @@ let
|
||||
];
|
||||
|
||||
# Systemd service for automatic model updates
|
||||
systemd.services.update-qwen-model = {
|
||||
description = "Update Qwen3-Coder-Next model from HuggingFace";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.writeShellScript "update-qwen-model" ''
|
||||
set -euo pipefail
|
||||
systemd = {
|
||||
services = {
|
||||
update-qwen-model = {
|
||||
description = "Update Qwen3-Coder-Next model from HuggingFace";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.writeShellScript "update-qwen-model" ''
|
||||
set -euo pipefail
|
||||
|
||||
MODEL_DIR="${cfg.configDir}/llama-cpp/models"
|
||||
MODEL_NAME="${cfg.llama-cpp.model}.gguf"
|
||||
REPO_ID="unsloth/Qwen3-Coder-Next-GGUF"
|
||||
MODEL_DIR="${cfg.configDir}/llama-cpp/models"
|
||||
MODEL_NAME="${cfg.llama-cpp.model}.gguf"
|
||||
REPO_ID="unsloth/Qwen3-Coder-Next-GGUF"
|
||||
|
||||
# Create model directory if it doesn't exist
|
||||
mkdir -p "$MODEL_DIR"
|
||||
# Create model directory if it doesn't exist
|
||||
mkdir -p "$MODEL_DIR"
|
||||
|
||||
# Download the latest version of the model
|
||||
echo "Updating $MODEL_NAME from HuggingFace..."
|
||||
${pkgs.python3Packages.huggingface-hub}/bin/hf download \
|
||||
"$REPO_ID" \
|
||||
"$MODEL_NAME" \
|
||||
--local-dir "$MODEL_DIR"
|
||||
# Download the latest version of the model
|
||||
echo "Updating $MODEL_NAME from HuggingFace..."
|
||||
${pkgs.python3Packages.huggingface-hub}/bin/hf download \
|
||||
"$REPO_ID" \
|
||||
"$MODEL_NAME" \
|
||||
--local-dir "$MODEL_DIR"
|
||||
|
||||
echo "Model updated successfully"
|
||||
''}";
|
||||
User = "nix-apps";
|
||||
Group = "jallen-nas";
|
||||
EnvironmentFile = [ config.sops.templates."ntfy.env".path ];
|
||||
echo "Model updated successfully"
|
||||
''}";
|
||||
User = "nix-apps";
|
||||
Group = "jallen-nas";
|
||||
EnvironmentFile = [ config.sops.templates."ntfy.env".path ];
|
||||
};
|
||||
unitConfig.OnFailure = "update-qwen-model-notify-failure.service";
|
||||
# Run daily at 3 AM
|
||||
startAt = "*-*-* 03:00:00";
|
||||
};
|
||||
|
||||
update-qwen-model-notify-failure = {
|
||||
description = "Notify ntfy on update-qwen-model failure";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${ntfyModelFailScript}";
|
||||
EnvironmentFile = [ config.sops.templates."ntfy.env".path ];
|
||||
};
|
||||
};
|
||||
|
||||
# Ensure model is available before llama-cpp starts
|
||||
llama-cpp = {
|
||||
after = [ "update-qwen-model.service" ];
|
||||
wants = [ "update-qwen-model.service" ];
|
||||
};
|
||||
};
|
||||
unitConfig.OnFailure = "update-qwen-model-notify-failure.service";
|
||||
# Run daily at 3 AM
|
||||
startAt = "*-*-* 03:00:00";
|
||||
};
|
||||
|
||||
systemd.services.update-qwen-model-notify-failure = {
|
||||
description = "Notify ntfy on update-qwen-model failure";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${ntfyModelFailScript}";
|
||||
EnvironmentFile = [ config.sops.templates."ntfy.env".path ];
|
||||
};
|
||||
};
|
||||
|
||||
# Ensure model is available before llama-cpp starts
|
||||
systemd.services.llama-cpp = {
|
||||
after = [ "update-qwen-model.service" ];
|
||||
wants = [ "update-qwen-model.service" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user