AIencoder commited on
Commit
e0e1f07
·
verified ·
1 Parent(s): 92837ee

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +36 -36
entrypoint.sh CHANGED
@@ -1,43 +1,43 @@
1
  #!/bin/bash
 
2
 
3
- echo "🔥 Axon v6 - llama.cpp Edition"
4
- echo "📥 Downloading models..."
5
 
6
- mkdir -p /data/models
 
 
7
 
8
- python3 << 'EOF'
9
- from huggingface_hub import hf_hub_download
10
 
11
- models = [
12
- # Qwen3 30B MoE (Best!)
13
- ("unsloth/Qwen3-Coder-30B-A3B-Instruct-GGUF", "Qwen3-Coder-30B-A3B-Instruct-Q4_K_M.gguf"),
14
-
15
- # Qwen2.5 family
16
- ("Qwen/Qwen2.5-Coder-14B-Instruct-GGUF", "qwen2.5-coder-14b-instruct-q4_k_m.gguf"),
17
- ("Qwen/Qwen2.5-Coder-7B-Instruct-GGUF", "qwen2.5-coder-7b-instruct-q4_k_m.gguf"),
18
- ("Qwen/Qwen2.5-Coder-3B-Instruct-GGUF", "qwen2.5-coder-3b-instruct-q4_k_m.gguf"),
19
- ("Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF", "qwen2.5-coder-1.5b-instruct-q4_k_m.gguf"),
20
- ("Qwen/Qwen2.5-Coder-0.5B-Instruct-GGUF", "qwen2.5-coder-0.5b-instruct-q4_k_m.gguf"),
21
-
22
- # DeepSeek
23
- ("bartowski/DeepSeek-Coder-V2-Lite-Instruct-GGUF", "DeepSeek-Coder-V2-Lite-Instruct-Q4_K_M.gguf"),
24
- ("TheBloke/deepseek-coder-6.7B-instruct-GGUF", "deepseek-coder-6.7b-instruct.Q4_K_M.gguf"),
25
- ]
26
 
27
- for repo, filename in models:
28
- print(f"📥 Downloading {filename}...")
29
- try:
30
- hf_hub_download(
31
- repo_id=repo,
32
- filename=filename,
33
- local_dir="/data/models",
34
- )
35
- print(f"{filename} ready!")
36
- except Exception as e:
37
- print(f"⚠️ {filename}: {e}")
 
 
 
 
 
38
 
39
- print("✅ All models downloaded!")
40
- EOF
41
-
42
- echo "🚀 Starting Axon..."
43
- python3 /app.py
 
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 "$@"