This commit is contained in:
Aaron Po
2026-05-04 15:44:32 -04:00
parent b05000c6fb
commit 6eaa184eaa
9 changed files with 62 additions and 122 deletions

View File

@@ -10,44 +10,40 @@ PROMPT_DIR="/workspace/app/build/prompts"
echo "--- Starting Biergarten Pipeline Environment Check ---"
# 1. Ensure Volume Mounts exist
# 1. Ensure volume mount directories exist
mkdir -p "$OUTPUT_DIR"
mkdir -p "$(dirname "$LOG_PATH")"
# 2. Check for Model
# 2. Check for model file
if [ ! -f "$MODEL_PATH" ]; then
echo "ERROR: Model not found at $MODEL_PATH"
echo "Current /workspace/models contents:"
ls -lh /workspace/models
ls -lh /workspace/models 2>/dev/null || echo "(directory does not exist)"
exit 1
fi
# 3. Check for Backends (Diagnostic)
echo "Loading backends from: $GGML_BACKEND_PATH"
ls -l /usr/local/lib/libggml*
# 4. Build the command arguments
# 3. Build the command arguments
ARGS=(
"--model" "$MODEL_PATH"
"--model" "$MODEL_PATH"
"--prompt-dir" "$PROMPT_DIR"
"--output" "$OUTPUT_DIR"
"--log-path" "$LOG_PATH"
"--output" "$OUTPUT_DIR"
"--log-path" "$LOG_PATH"
)
# Optional Hyperparameters
[[ -n "$BIERGARTEN_TEMPERATURE" ]] && ARGS+=("--temperature" "$BIERGARTEN_TEMPERATURE")
[[ -n "$BIERGARTEN_TOP_P" ]] && ARGS+=("--top-p" "$BIERGARTEN_TOP_P")
[[ -n "$BIERGARTEN_TOP_K" ]] && ARGS+=("--top-k" "$BIERGARTEN_TOP_K")
[[ -n "$BIERGARTEN_N_CTX" ]] && ARGS+=("--n-ctx" "$BIERGARTEN_N_CTX")
[[ -n "$BIERGARTEN_SEED" ]] && ARGS+=("--seed" "$BIERGARTEN_SEED")
# Optional hyperparameters
[[ -n "$BIERGARTEN_TEMPERATURE" ]] && ARGS+=("--temperature" "$BIERGARTEN_TEMPERATURE")
[[ -n "$BIERGARTEN_TOP_P" ]] && ARGS+=("--top-p" "$BIERGARTEN_TOP_P")
[[ -n "$BIERGARTEN_TOP_K" ]] && ARGS+=("--top-k" "$BIERGARTEN_TOP_K")
[[ -n "$BIERGARTEN_N_CTX" ]] && ARGS+=("--n-ctx" "$BIERGARTEN_N_CTX")
[[ -n "$BIERGARTEN_SEED" ]] && ARGS+=("--seed" "$BIERGARTEN_SEED")
[[ -n "$BIERGARTEN_GL_LAYERS" ]] && ARGS+=("--n-gpu-layers" "$BIERGARTEN_GL_LAYERS")
# Append extra custom args
# Append any extra custom args
if [[ -n "$BIERGARTEN_EXTRA_ARGS" ]]; then
ARGS+=($BIERGARTEN_EXTRA_ARGS)
fi
echo "--- Executing: $EXECUTABLE ${ARGS[@]} ---"
echo "--- Executing: $EXECUTABLE ${ARGS[*]} ---"
# Execute the binary directly (replaces shell process)
# Execute the binary directly, replacing the shell process
exec "$EXECUTABLE" "${ARGS[@]}"