28 lines
1.0 KiB
Bash
28 lines
1.0 KiB
Bash
#!/usr/bin/with-contenv bashio
|
|
|
|
# Les variables d'environnement sont automatiquement disponibles depuis les options
|
|
echo "Starting LocalAI P2P Master"
|
|
echo "GPU Layers: $(bashio::config 'gpu_layers')"
|
|
echo "Models Path: $(bashio::config 'models_path')"
|
|
|
|
# Créer le répertoire des modèles
|
|
MODELS_PATH="$(bashio::config 'models_path')"
|
|
mkdir -p "$MODELS_PATH"
|
|
|
|
# Nettoyer les fichiers corrompus
|
|
find "$MODELS_PATH" -name "*.yaml" -exec grep -l "#!/usr/bin/with-contenv bashio\|mapping values are not allowed in this context" {} \; 2>/dev/null | xargs rm -f 2>/dev/null || true
|
|
|
|
# Configurer les threads
|
|
export THREADS="$(bashio::config 'threads' || echo '8')"
|
|
export OMP_NUM_THREADS="$THREADS"
|
|
|
|
# Lancer LocalAI (master génère automatiquement un token)
|
|
echo "Starting LocalAI Master with models path: $MODELS_PATH"
|
|
echo "P2P Token will be generated automatically"
|
|
exec /usr/local/bin/local-ai run \
|
|
--models-path="$MODELS_PATH" \
|
|
--threads="$THREADS" \
|
|
--address="0.0.0.0:8080" \
|
|
--cors \
|
|
--cors-allow-origins="*"
|