jbilcke-hf commited on
Commit
566c982
·
verified ·
1 Parent(s): 4bc0633

Update start.sh (the verbose mode was overkill)

Browse files
Files changed (1) hide show
  1. start.sh +14 -37
start.sh CHANGED
@@ -5,38 +5,21 @@ echo "=== Starting AI Toolkit ==="
5
  echo "Working directory: $(pwd)"
6
  echo "User: $(whoami)"
7
 
8
- # Check if app has already been copied to /data
9
- if [ ! -d "/data/ai-toolkit/ui" ]; then
10
- echo "First run detected. Setting up persistent application..."
11
- echo "This may take a moment..."
12
 
13
- # Create base directory
14
- mkdir -p /data/ai-toolkit
 
 
 
15
 
16
- # Copy entire app to /data for full write access
17
- echo "Copying application files..."
18
- cp -r /app/ai-toolkit/* /data/ai-toolkit/
19
- echo "✓ Application copied to /data/ai-toolkit"
20
-
21
- # Remove the build-time Prisma client
22
- rm -rf /data/ai-toolkit/ui/node_modules/.prisma
23
- echo "✓ Removed build-time Prisma client"
24
- else
25
- echo "✓ Application already exists in /data/ai-toolkit"
26
-
27
- # Sync all files including frontend (but preserve node_modules and database)
28
- echo "Syncing application updates..."
29
- rsync -av --exclude='ui/node_modules' --exclude='database' \
30
- /app/ai-toolkit/ /data/ai-toolkit/
31
- echo "✓ Application synced"
32
-
33
- # Rebuild frontend if UI files were updated
34
- echo "Rebuilding frontend..."
35
- cd /data/ai-toolkit/ui
36
- npm run build
37
- cd -
38
- echo "✓ Frontend rebuilt"
39
- fi
40
 
41
  # Ensure persistent directories exist
42
  echo "Creating persistent directories..."
@@ -87,10 +70,4 @@ echo " HUGGINGFACE_HUB_CACHE=$HUGGINGFACE_HUB_CACHE"
87
  echo " TRANSFORMERS_CACHE=$TRANSFORMERS_CACHE"
88
  echo " DIFFUSERS_CACHE=$DIFFUSERS_CACHE"
89
 
90
- # Export variables again to ensure they're available to the Node process
91
- export HF_HOME="/data/huggingface"
92
- export HUGGINGFACE_HUB_CACHE="/data/huggingface/hub"
93
- export TRANSFORMERS_CACHE="/data/huggingface/transformers"
94
- export DIFFUSERS_CACHE="/data/huggingface/diffusers"
95
-
96
- npm run start
 
5
  echo "Working directory: $(pwd)"
6
  echo "User: $(whoami)"
7
 
8
+ # Create base directory
9
+ mkdir -p /data/ai-toolkit
 
 
10
 
11
+ # Sync all files including frontend (but preserve node_modules and database)
12
+ echo "Syncing application updates..."
13
+ rsync -a --exclude='database' --exclude='aitk_db.db' --exclude='datasets' \
14
+ /app/ai-toolkit/ /data/ai-toolkit/
15
+ echo "✓ Application synced"
16
 
17
+ # Rebuild frontend if UI files were updated
18
+ echo "Building frontend..."
19
+ cd /data/ai-toolkit/ui
20
+ npm run build
21
+ cd -
22
+ echo "✓ Frontend built"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  # Ensure persistent directories exist
25
  echo "Creating persistent directories..."
 
70
  echo " TRANSFORMERS_CACHE=$TRANSFORMERS_CACHE"
71
  echo " DIFFUSERS_CACHE=$DIFFUSERS_CACHE"
72
 
73
+ npm run start