Files
hass-addons/localai-p2p-worker/run.sh
alex 81b435f6bc
Some checks failed
Builder / Build addons (localai-p2p-master, amd64) (push) Failing after 15s
Builder / Build addons (localai-p2p-worker, amd64) (push) Failing after 14s
Validate / validate (push) Failing after 1s
Builder / Create release (push) Has been skipped
fix
2025-05-30 12:37:26 +02:00

18 lines
611 B
Bash

#!/usr/bin/with-contenv bashio
CONFIG_PATH=/data/options.json
GPU_LAYERS="$(bashio::config 'gpu_layers')"
TOKEN="$(bashio::config 'master_token' || echo '')"
if [ ! -z "$TOKEN" ]; then
export LOCALAI_P2P_TOKEN="$TOKEN"
fi
# Créer le répertoire des modèles s'il n'existe pas
mkdir -p /share/localai/models
# Nettoyer les fichiers de configuration corrompus (contenant du code shell)
find /share/localai/models -name "*.yaml" -exec grep -l "#!/usr/bin/with-contenv bashio" {} \; | xargs rm -f 2>/dev/null || true
exec /build/local-ai run --models-path=/share/localai/models --gpu-layers="$GPU_LAYERS"