File size: 883 Bytes
f04355c
 
 
5b6cfb6
753091e
f04355c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
060e7ff
2f2135c
f04355c
 
 
 
 
 
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
#!/bin/bash

N_GPU_LAYERS="${N_GPU_LAYERS:-10}"
MODEL_PATH=${MODEL_PATH:-/data/models/mixtral-8x7b-v0.1.Q5_K_M.gguf}
MODEL_URL="${MODEL_URL:-https://huggingface.co/TheBloke/Mixtral-8x7B-v0.1-GGUF/resolve/main/mixtral-8x7b-v0.1.Q5_K_M.gguf}"
PORT="${PORT:-7860}"
CONTEXT="${CONTEXT:-32768}"

# Function to print download progress
print_progress() {
    local percentage=$1
    echo "Download progress: $percentage%"
}

calculate_progress() {
    local current=$1
    local total=$2
    echo "scale=2; $current / $total * 100" | bc
}

# Check if the file exists
if [ ! -e "$MODEL_PATH" ]; then
    echo "Downloading model."
    mkdir -p /data/models
    wget -x -q -O $MODEL_PATH "$MODEL_URL"
    echo "Model downloaded."
else
    echo "File already exists."
fi
cd /app
./server -m "$MODEL_PATH" -c $CONTEXT --port $PORT --host 0.0.0.0 --n-gpu-layers $N_GPU_LAYERS --path "/app/public"