implement modular backend setup scripts, new frontend components, and expanded server services
This commit is contained in:
1 parent
bd89699994
commit
ffec37fd0a
27 files changed
+309
-149
No files matched your search
@@ -0,0 +1,130 @@
|
||||
# scripts/reset/reset.ps1
|
||||
# Resets portable app dependencies/builds while preserving user models and outputs.
|
||||
|
||||
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
$rootDir = Split-Path -Parent (Split-Path -Parent $scriptDir)
|
||||
$appDir = Join-Path $rootDir "app"
|
||||
|
||||
Write-Host ""
|
||||
Write-Host " ============================================================" -ForegroundColor Yellow
|
||||
Write-Host " Resetting Local AI Studio..." -ForegroundColor Yellow
|
||||
Write-Host " ============================================================" -ForegroundColor Yellow
|
||||
Write-Host ""
|
||||
|
||||
# Delete tools/node
|
||||
$toolsDir = Join-Path $appDir "tools"
|
||||
if (Test-Path $toolsDir) {
|
||||
Write-Host " >> Removing portable tools/ node folder..." -ForegroundColor Cyan
|
||||
Remove-Item $toolsDir -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Delete backend
|
||||
$backendDir = Join-Path $appDir "backend"
|
||||
if (Test-Path $backendDir) {
|
||||
Write-Host " >> Removing image backend binaries..." -ForegroundColor Cyan
|
||||
Remove-Item $backendDir -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Delete llama.cpp backend
|
||||
$llmBackendDir = Join-Path $appDir "llm-backend"
|
||||
if (Test-Path $llmBackendDir) {
|
||||
Write-Host " >> Removing llama.cpp text backend binaries..." -ForegroundColor Cyan
|
||||
Remove-Item $llmBackendDir -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Delete whisper.cpp backend
|
||||
$speechBackendDir = Join-Path $appDir "speech-backend"
|
||||
if (Test-Path $speechBackendDir) {
|
||||
Write-Host " >> Removing whisper.cpp speech backend binaries..." -ForegroundColor Cyan
|
||||
Remove-Item $speechBackendDir -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Delete Kokoro TTS runtime dependencies
|
||||
$ttsRuntimeDir = Join-Path $appDir "tts-runtime"
|
||||
if (Test-Path $ttsRuntimeDir) {
|
||||
Write-Host " >> Removing Kokoro TTS runtime dependencies..." -ForegroundColor Cyan
|
||||
Remove-Item $ttsRuntimeDir -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Delete dist
|
||||
$distDir = Join-Path $appDir "dist"
|
||||
if (Test-Path $distDir) {
|
||||
Write-Host " >> Removing dist/ build folder..." -ForegroundColor Cyan
|
||||
Remove-Item $distDir -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Preserve image models
|
||||
$modelsDir = Join-Path $appDir "models"
|
||||
if (Test-Path $modelsDir) {
|
||||
Write-Host " >> Preserving image models in app/models." -ForegroundColor Cyan
|
||||
}
|
||||
|
||||
# Preserve text models
|
||||
$llmModelsDir = Join-Path $appDir "llm-models"
|
||||
if (Test-Path $llmModelsDir) {
|
||||
Write-Host " >> Preserving text models in app/llm-models." -ForegroundColor Cyan
|
||||
}
|
||||
|
||||
# Preserve speech models
|
||||
$speechModelsDir = Join-Path $appDir "speech-models"
|
||||
if (Test-Path $speechModelsDir) {
|
||||
Write-Host " >> Preserving speech models in app/speech-models." -ForegroundColor Cyan
|
||||
}
|
||||
|
||||
# Preserve TTS models
|
||||
$ttsModelsDir = Join-Path $appDir "tts-models"
|
||||
if (Test-Path $ttsModelsDir) {
|
||||
Write-Host " >> Preserving TTS models in app/tts-models." -ForegroundColor Cyan
|
||||
}
|
||||
|
||||
# Preserve transcriptions
|
||||
$transcriptionsDir = Join-Path $appDir "transcriptions"
|
||||
if (Test-Path $transcriptionsDir) {
|
||||
Write-Host " >> Preserving speech transcripts in app/transcriptions." -ForegroundColor Cyan
|
||||
}
|
||||
|
||||
# Preserve TTS outputs/cache
|
||||
$ttsOutputsDir = Join-Path $appDir "tts-outputs"
|
||||
if (Test-Path $ttsOutputsDir) {
|
||||
Write-Host " >> Preserving TTS outputs in app/tts-outputs." -ForegroundColor Cyan
|
||||
}
|
||||
$ttsCacheDir = Join-Path $appDir "tts-cache"
|
||||
if (Test-Path $ttsCacheDir) {
|
||||
Write-Host " >> Preserving TTS model cache in app/tts-cache." -ForegroundColor Cyan
|
||||
}
|
||||
|
||||
# Preserve OpenVINO models
|
||||
$openVinoModelsDir = Join-Path $appDir "openvino-models"
|
||||
if (Test-Path $openVinoModelsDir) {
|
||||
Write-Host " >> Preserving OpenVINO models in app/openvino-models." -ForegroundColor Cyan
|
||||
}
|
||||
|
||||
# Delete all frontend dependency folders, including platform-specific copies
|
||||
$frontendDir = Join-Path $appDir "frontend"
|
||||
Get-ChildItem $frontendDir -Force -ErrorAction SilentlyContinue |
|
||||
Where-Object { $_.Name -eq "node_modules" -or $_.Name -like "node_modules_*" } |
|
||||
ForEach-Object {
|
||||
Write-Host " >> Removing frontend $($_.Name)..." -ForegroundColor Cyan
|
||||
Remove-Item -LiteralPath $_.FullName -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
$activeOsFile = Join-Path $frontendDir ".active_modules_os"
|
||||
if (Test-Path $activeOsFile) {
|
||||
Write-Host " >> Removing frontend platform marker..." -ForegroundColor Cyan
|
||||
Remove-Item $activeOsFile -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
|
||||
# Delete package-lock.json in frontend
|
||||
$lockFile = Join-Path $appDir "frontend\package-lock.json"
|
||||
if (Test-Path $lockFile) {
|
||||
Write-Host " >> Removing frontend package-lock.json..." -ForegroundColor Cyan
|
||||
Remove-Item $lockFile -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host " ============================================================" -ForegroundColor Green
|
||||
Write-Host " Reset complete. Image models, text models, speech models, TTS models, transcripts, TTS outputs, OpenVINO models, and generated outputs were preserved." -ForegroundColor Green
|
||||
Write-Host " ============================================================" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
Read-Host " Press Enter to close..."
|
||||
@@ -0,0 +1,117 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Local AI Studio - Linux/macOS Reset Script
|
||||
# Resets portable app dependencies/builds while preserving user models and outputs.
|
||||
#
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
ROOT_DIR="$(dirname "$(dirname "$SCRIPT_DIR")")"
|
||||
APP_DIR="$ROOT_DIR/app"
|
||||
|
||||
echo ""
|
||||
echo " ============================================================"
|
||||
echo " Resetting Local AI Studio..."
|
||||
echo " ============================================================"
|
||||
echo ""
|
||||
|
||||
# Delete tools/node
|
||||
if [[ -d "$APP_DIR/tools" ]]; then
|
||||
echo " >> Removing portable tools/ node folder..."
|
||||
rm -rf "$APP_DIR/tools"
|
||||
fi
|
||||
|
||||
# Delete backend
|
||||
if [[ -d "$APP_DIR/backend" ]]; then
|
||||
echo " >> Removing image backend binaries..."
|
||||
rm -rf "$APP_DIR/backend"
|
||||
fi
|
||||
|
||||
# Delete llama.cpp backend
|
||||
if [[ -d "$APP_DIR/llm-backend" ]]; then
|
||||
echo " >> Removing llama.cpp text backend binaries..."
|
||||
rm -rf "$APP_DIR/llm-backend"
|
||||
fi
|
||||
|
||||
# Delete whisper.cpp backend
|
||||
if [[ -d "$APP_DIR/speech-backend" ]]; then
|
||||
echo " >> Removing whisper.cpp speech backend binaries..."
|
||||
rm -rf "$APP_DIR/speech-backend"
|
||||
fi
|
||||
|
||||
# Delete Kokoro TTS runtime dependencies
|
||||
if [[ -d "$APP_DIR/tts-runtime" ]]; then
|
||||
echo " >> Removing Kokoro TTS runtime dependencies..."
|
||||
rm -rf "$APP_DIR/tts-runtime"
|
||||
fi
|
||||
|
||||
# Delete dist
|
||||
if [[ -d "$APP_DIR/dist" ]]; then
|
||||
echo " >> Removing dist/ build folder..."
|
||||
rm -rf "$APP_DIR/dist"
|
||||
fi
|
||||
|
||||
# Preserve image models
|
||||
if [[ -d "$APP_DIR/models" ]]; then
|
||||
echo " >> Preserving image models in app/models."
|
||||
fi
|
||||
|
||||
# Preserve text models
|
||||
if [[ -d "$APP_DIR/llm-models" ]]; then
|
||||
echo " >> Preserving text models in app/llm-models."
|
||||
fi
|
||||
|
||||
# Preserve speech models
|
||||
if [[ -d "$APP_DIR/speech-models" ]]; then
|
||||
echo " >> Preserving speech models in app/speech-models."
|
||||
fi
|
||||
|
||||
# Preserve TTS models
|
||||
if [[ -d "$APP_DIR/tts-models" ]]; then
|
||||
echo " >> Preserving TTS models in app/tts-models."
|
||||
fi
|
||||
|
||||
# Preserve transcriptions
|
||||
if [[ -d "$APP_DIR/transcriptions" ]]; then
|
||||
echo " >> Preserving speech transcripts in app/transcriptions."
|
||||
fi
|
||||
|
||||
# Preserve TTS outputs/cache
|
||||
if [[ -d "$APP_DIR/tts-outputs" ]]; then
|
||||
echo " >> Preserving TTS outputs in app/tts-outputs."
|
||||
fi
|
||||
if [[ -d "$APP_DIR/tts-cache" ]]; then
|
||||
echo " >> Preserving TTS model cache in app/tts-cache."
|
||||
fi
|
||||
|
||||
# Preserve OpenVINO models
|
||||
if [[ -d "$APP_DIR/openvino-models" ]]; then
|
||||
echo " >> Preserving OpenVINO models in app/openvino-models."
|
||||
fi
|
||||
|
||||
# Delete all frontend dependency folders, including platform-specific copies
|
||||
for modules_dir in "$APP_DIR/frontend/node_modules" "$APP_DIR/frontend"/node_modules_*; do
|
||||
if [[ -L "$modules_dir" || -d "$modules_dir" ]]; then
|
||||
echo " >> Removing frontend $(basename "$modules_dir")..."
|
||||
rm -rf "$modules_dir"
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -f "$APP_DIR/frontend/.active_modules_os" ]]; then
|
||||
echo " >> Removing frontend platform marker..."
|
||||
rm -f "$APP_DIR/frontend/.active_modules_os"
|
||||
fi
|
||||
|
||||
# Delete package-lock.json in frontend
|
||||
if [[ -f "$APP_DIR/frontend/package-lock.json" ]]; then
|
||||
echo " >> Removing frontend package-lock.json..."
|
||||
rm -f "$APP_DIR/frontend/package-lock.json"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo " ============================================================"
|
||||
echo " Reset complete. Image models, text models, speech models, TTS models, transcripts, TTS outputs, OpenVINO models, and generated outputs were preserved."
|
||||
echo " ============================================================"
|
||||
echo ""
|
||||
read -rp " Press Enter to close..."
|
||||
Reference in new issue
Block a user