minor fixes
Some checks failed
Builder / Build addons (localai-p2p-master, amd64) (push) Failing after 8s
Builder / Build addons (localai-p2p-worker, amd64) (push) Failing after 8s
Validate / validate (push) Failing after 2s
Builder / Create release (push) Has been skipped

This commit is contained in:
2025-05-30 12:49:00 +02:00
parent dc3d01d224
commit 1b21f7f32e
4 changed files with 16 additions and 6 deletions

View File

@@ -17,6 +17,9 @@ environment:
LOCALAI_P2P: "true"
LOCALAI_FEDERATED: "true"
LOCALAI_MODELS_PATH: "/share/localai/models"
LOCALAI_ADDRESS: "0.0.0.0:8080"
LOCALAI_CORS: "true"
LOCALAI_CORS_ALLOW_ORIGINS: "*"
map:
- type: share
read_only: false

View File

@@ -3,15 +3,16 @@ CONFIG_PATH=/data/options.json
GPU_LAYERS="$(bashio::config 'gpu_layers')"
TOKEN="$(bashio::config 'master_token' || echo '')"
MODELS_PATH="$(bashio::config 'models_path')"
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
mkdir -p "$MODELS_PATH"
# 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
find "$MODELS_PATH" -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"
exec /build/local-ai run --models-path="$MODELS_PATH" --gpu-layers="$GPU_LAYERS" --address="0.0.0.0:8080" --cors --cors-allow-origins="*"