Spaces:
Sleeping
Sleeping
File size: 1,085 Bytes
7603b27 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | #!/bin/bash
echo "π Starting AJ STUDIOZ..."
# Set Ollama home
export OLLAMA_HOME=/home/user/.ollama
mkdir -p $OLLAMA_HOME
# Start Ollama server in background
echo "π§ Starting Ollama server..."
ollama serve > /tmp/ollama.log 2>&1 &
# Wait for Ollama to be ready
echo "β³ Waiting for Ollama..."
for i in {1..30}; do
if curl -s http://localhost:11434/api/tags > /dev/null 2>&1; then
echo "β
Ollama is ready!"
break
fi
sleep 2
done
# Pull base model
echo "π₯ Downloading qwen2:0.5b (this may take a few minutes)..."
ollama pull qwen2:0.5b
# Create AJ model (Claude-like version)
echo "π¨ Creating AJ model with enhanced capabilities..."
ollama create aj-mini -f /app/Modelfile-AJ-Mini
# Verify model creation
if ollama list | grep -q "aj-mini"; then
echo "β
AJ model created successfully!"
else
echo "β οΈ Warning: AJ model may not have been created properly"
fi
echo "β
AJ-Mini ready!"
# List models
echo "π Available models:"
ollama list
# Start FastAPI server
echo "π Starting API server on port 7860..."
exec python /app/app.py
|