Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3674fe921b | ||
|
|
371d8792ba |
No files matched your search
+9
-2
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in new issue
Block a user