Compare commits

..
2 Commits
Author SHA1 Message Date
zefie 3674fe921b update helper script 2026-11-04 16:44:06 -05:00
zefie 371d8792ba some fixes to Dockerfile 2026-11-04 16:41:04 -05:00
2 changed files with 19 additions and 5 deletions

No files matched your search

+9 -2
View File
@@ -58,6 +58,13 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
WORKDIR /workspace WORKDIR /workspace
RUN python3 -m venv /workspace/py-venv RUN python3 -m venv /workspace/py-venv
ENV PATH="/workspace/py-venv/bin:${PATH}" ENV PATH="/workspace/py-venv/bin:${PATH}"
# llama.cpp requirements
COPY --from=builder --chmod=0644 /workspace/requirements.txt /workspace/requirements-llama.txt
COPY --from=builder /workspace/requirements /workspace/requirements
RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked pip3 install -r /workspace/requirements-llama.txt
# Upgrade torch after llama's downgrade
RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked pip3 install torch torchvision torchaudio --upgrade --index-url \ RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked pip3 install torch torchvision torchaudio --upgrade --index-url \
https://download.pytorch.org/whl/cu132/ https://download.pytorch.org/whl/cu132/
@@ -69,8 +76,8 @@ RUN git clone --depth=1 https://github.com/silveroxides/convert_to_quant && \
RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked pip3 install heretic-llm RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked pip3 install heretic-llm
# Install zefie's nvfp4 quant requirements # Install zefie's nvfp4 quant requirements
COPY --chmod=0644 requirements.txt /workspace/requirements.txt COPY --chmod=0644 requirements.txt /workspace/requirements-nvfp4.txt
RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked pip3 install -r /workspace/requirements.txt RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked pip3 install -r /workspace/requirements-nvfp4.txt
# ---------- Main image # ---------- Main image
+10 -3
View File
@@ -21,13 +21,14 @@ get_latest() {
if [ "${1}" == "build" ]; then if [ "${1}" == "build" ]; then
THETAG=$(date +%Y%m%d) THETAG=$(date +%Y%m%d)
cd "$(realpath "$(dirname "${0}")")" cd "$(realpath "$(dirname "${0}")")"
docker buildx build --tag zefie/nvfp4_quant:${THETAG} . docker buildx build --tag "zefie/nvfp4_quant:${THETAG}" .
elif [ "${1}" == "mklatest" ]; then elif [ "${1}" == "mklatest" ]; then
LATEST=$(get_latest) LATEST=$(get_latest)
if [ -z "${LATEST}" ]; then if [ -z "${LATEST}" ]; then
exit 1; exit 1;
fi fi
docker tag ${LATEST} zefie/nvfp4_quant:latest docker tag "${LATEST}" zefie/nvfp4_quant:latest
echo "Set zefie/nvfp4_quant:latest to ${LATEST}"
elif [ "${1}" == "run" ]; then elif [ "${1}" == "run" ]; then
shift shift
IMAGE=$(get_latest) IMAGE=$(get_latest)
@@ -35,10 +36,16 @@ elif [ "${1}" == "run" ]; then
exit 1; exit 1;
fi fi
export EMBEDDED=1 export EMBEDDED=1
source ${CURDIR}/nvfp4_quant source "${CURDIR}/nvfp4_quant"
CMD=("${COMMON[@]}" "${@}") CMD=("${COMMON[@]}" "${@}")
echo "Executing ${CMD[@]}" echo "Executing ${CMD[@]}"
"${CMD[@]}" "${CMD[@]}"
elif [ "${1}" == "push" ]; then
# push dated one first, then latest
"${0}" mklatest
IMAGE=$(get_latest)
docker push "${IMAGE}"
docker push "zefie/nvfp4_quant:latest"
else else
echo "Usage: ${0} [build|run|mklatest]" echo "Usage: ${0} [build|run|mklatest]"
exit 1; exit 1;