AIencoder commited on
Commit
20f5e6e
·
verified ·
1 Parent(s): 9ac41e6

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +5 -34
entrypoint.sh CHANGED
@@ -1,43 +1,14 @@
1
  #!/bin/bash
2
  set -e
3
 
4
- # 1. Define the directory
5
  MODEL_DIR="/data/models"
 
 
6
 
7
  # 2. Print status
8
  echo "--- ENTRYPOINT STARTED ---"
9
- echo "Checking model directory: $MODEL_DIR"
10
-
11
- # 3. Create directory if it doesn't exist
12
- mkdir -p $MODEL_DIR
13
-
14
- # 4. Check if directory is empty
15
- if [ -z "$(ls -A $MODEL_DIR)" ]; then
16
- echo "⚠️ Folder is empty! Starting download..."
17
-
18
- # Run the download script (using the Python snippet usually found here)
19
- # We use python to leverage the huggingface_hub library for faster/resumable downloads
20
- python3 -c "
21
- from huggingface_hub import snapshot_download
22
- import os
23
-
24
- print('⬇️ Downloading models to /data/models...')
25
- try:
26
- snapshot_download(
27
- repo_id='AIencoder/Axon-Models',
28
- local_dir='/data/models',
29
- local_dir_use_symlinks=False,
30
- repo_type='model'
31
- )
32
- print('✅ Download complete!')
33
- except Exception as e:
34
- print(f'❌ Download failed: {e}')
35
- "
36
- else
37
- echo "✅ Models found in $MODEL_DIR. Skipping download."
38
- ls -lh $MODEL_DIR
39
- fi
40
 
41
- # 5. Hand over control to the main app
42
- echo "--- STARTING APP ---"
43
  exec "$@"
 
1
  #!/bin/bash
2
  set -e
3
 
4
+ # 1. Define and create the directory (just in case)
5
  MODEL_DIR="/data/models"
6
+ mkdir -p $MODEL_DIR
7
+ chmod 777 $MODEL_DIR
8
 
9
  # 2. Print status
10
  echo "--- ENTRYPOINT STARTED ---"
11
+ echo "Storage fixed. Handing control to app.py..."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
+ # 3. Start the app
 
14
  exec "$@"