Files
light-heart-labs--dreamserver/ods/scripts/check-offline-models.sh
T
wehub-resource-sync 9e8f1bbeed
Dashboard / frontend (push) Failing after 0s
Dashboard / api (push) Failing after 0s
Lint PowerShell / powershell-lint (ubuntu-latest) (push) Failing after 1s
Python Lint / Lint Python with Ruff (push) Failing after 1s
ShellCheck / Lint shell scripts (push) Failing after 1s
Matrix Smoke / linux-smoke (push) Failing after 1s
Matrix Smoke / distro: cachyos (push) Failing after 15s
Matrix Smoke / distro: linux-mint-21.3 (push) Failing after 15s
Matrix Smoke / distro: debian-12 (push) Failing after 5m21s
Matrix Smoke / distro: fedora-41 (push) Failing after 4m56s
Matrix Smoke / distro: ubuntu-24.04 (push) Failing after 2m13s
Matrix Smoke / distro: rocky-9 (push) Failing after 10m39s
Matrix Smoke / distro: manjaro (push) Failing after 12m11s
Matrix Smoke / distro: opensuse-tw (push) Failing after 11m53s
Matrix Smoke / distro: archlinux (push) Failing after 20m3s
Matrix Smoke / distro: ubuntu-22.04 (push) Failing after 13m49s
Validate .env Schema / tier-1-env-validation (push) Successful in 52s
Validate .env Schema / tier-2-env-validation (push) Successful in 44s
Validate .env Schema / tier-3-env-validation (push) Successful in 52s
Validate .env Schema / tier-4-env-validation (push) Successful in 51s
Validate Extensions Catalog / Check catalog is up-to-date (push) Failing after 9m47s
Secret Scan / Scan for secrets (push) Failing after 21m4s
Validate Docker Compose / Validate Docker Compose files (push) Has been cancelled
Python Type Check / Type check with mypy (push) Has been cancelled
Validate .env Schema / tier-0-env-validation (push) Has been cancelled
Test Linux / integration-smoke (push) Has been cancelled
Lint PowerShell / powershell-lint (windows-latest) (push) Has been cancelled
Matrix Smoke / macos-smoke (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:31:33 +08:00

76 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
# ODS Offline Mode - Model Pre-download Check
# Verifies required models exist before starting services
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ODS_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
cd "$ODS_DIR"
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo "=========================================="
echo "ODS Offline Mode - Model Check"
echo "=========================================="
echo ""
MISSING=()
# Check LLM model (GGUF)
if ls data/models/*.gguf &>/dev/null; then
MODEL_FILE=$(ls -1 data/models/*.gguf | sed -n '1p')
echo -e "${GREEN}${NC} LLM model: $(basename "$MODEL_FILE")"
else
echo -e "${RED}${NC} LLM model (GGUF) - MISSING"
MISSING+=("gguf-model")
fi
# Check Whisper model
if [ -d "data/whisper/faster-whisper-base" ] || [ -d "data/whisper/models--Systran--faster-whisper-base" ]; then
echo -e "${GREEN}${NC} Whisper base (STT)"
else
echo -e "${RED}${NC} Whisper base - MISSING"
MISSING+=("whisper-base")
fi
# Check Kokoro voice
if [ -f "data/kokoro/voices/af_heart.pt" ]; then
echo -e "${GREEN}${NC} Kokoro voice af_heart (TTS)"
else
echo -e "${RED}${NC} Kokoro voice af_heart - MISSING"
MISSING+=("kokoro-af_heart")
fi
# Check embeddings model
if [ -d "data/embeddings/BAAI/bge-base-en-v1.5" ] || [ -d "data/embeddings/models--BAAI--bge-base-en-v1.5" ]; then
echo -e "${GREEN}${NC} BGE base embeddings (RAG)"
else
echo -e "${RED}${NC} BGE base embeddings - MISSING"
MISSING+=("bge-base-en-v1.5")
fi
echo ""
echo "=========================================="
if [ ${#MISSING[@]} -eq 0 ]; then
echo -e "${GREEN}All models present. Ready for offline mode!${NC}"
exit 0
else
echo -e "${RED}Missing models: ${#MISSING[@]}${NC}"
echo ""
echo "Download models with:"
echo " ./scripts/download-models.sh"
echo ""
echo "Or manually download:"
for model in "${MISSING[@]}"; do
echo " - $model"
done
exit 1
fi