Axon / entrypoint.sh
AIencoder's picture
Update entrypoint.sh
1c4e80f verified
raw
history blame
1.11 kB
#!/bin/bash
set -e
echo "Starting Ollama..."
ollama serve &
sleep 10
echo "Pulling standard models..."
ollama pull qwen2.5-coder:1.5b
ollama pull qwen2.5-coder:3b
ollama pull qwen2.5-coder:7b
echo "Downloading Qwen3-Coder-30B-A3B GGUF..."
mkdir -p /tmp/models
# Use huggingface-cli instead (more reliable)
pip3 install -q huggingface_hub --break-system-packages
python3 -c "
from huggingface_hub import hf_hub_download
path = hf_hub_download(
repo_id='Qwen/Qwen3-Coder-30B-A3B-Instruct-GGUF',
filename='qwen3-coder-30b-a3b-instruct-q4_k_m.gguf',
local_dir='/tmp/models'
)
print(f'Downloaded to: {path}')
"
echo "Creating Ollama model from GGUF..."
cat > /tmp/Modelfile << 'EOF'
FROM /tmp/models/qwen3-coder-30b-a3b-instruct-q4_k_m.gguf
TEMPLATE """{{- if .System }}<|im_start|>system
{{ .System }}<|im_end|>
{{ end }}<|im_start|>user
{{ .Prompt }}<|im_end|>
<|im_start|>assistant
"""
PARAMETER stop "<|im_end|>"
PARAMETER temperature 0.7
PARAMETER num_ctx 4096
EOF
ollama create qwen3-coder-30b-a3b -f /tmp/Modelfile
echo "Models ready!"
ollama list
echo "Starting app..."
python3 /app.py