From eba071fa60fd1f45935b404ba6ebafe38ac57bf8 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Fri, 12 Jun 2026 15:57:58 +0000 Subject: [PATCH] docker/studio: make the quantizer build assertion content based llama-quantize exits nonzero on --help/--version while still printing usage, so a bare invocation fails the build even when the binary is healthy. Grep for the usage banner instead; a loader failure prints error while loading shared libraries and no usage text. --- docker/Dockerfile.studio | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile.studio b/docker/Dockerfile.studio index 6751a5ccc4..8fb488c9e1 100644 --- a/docker/Dockerfile.studio +++ b/docker/Dockerfile.studio @@ -109,8 +109,10 @@ RUN set -eux \ && "${UNSLOTH_STUDIO_HOME}/unsloth_studio/bin/python" -c "from importlib.metadata import version; v = version('torch'); assert v.endswith('+${TORCH_FAMILY}'), 'Studio venv torch ' + v + ' does not match ${TORCH_FAMILY}'; print('Studio venv torch', v)" \ # setup.sh may relink the root llama-quantize into build/bin; prove the # relinked quantizer still resolves its libraries, or GGUF export breaks - # at runtime with "No working quantizer found". - && "${UNSLOTH_STUDIO_HOME}/llama.cpp/llama-quantize" --version \ + # at runtime with "No working quantizer found". Content check, not rc: + # llama-quantize exits nonzero on --help, while a loader failure prints + # "error while loading shared libraries" and no usage text. + && { "${UNSLOTH_STUDIO_HOME}/llama.cpp/llama-quantize" --help 2>&1 || true; } | grep -q "usage" \ && rm -rf "${UNSLOTH_STUDIO_HOME}/src/.git" /root/.cache \ && if [ "${TARGETARCH:-amd64}" = "arm64" ]; then \ for NVRTC_DIR in "${UNSLOTH_STUDIO_HOME}"/unsloth_studio/lib/python*/site-packages/nvidia/cuda_nvrtc/lib; do \