fix: use stat -L to follow symlinks when checking checkpoint file size

HuggingFace cache stores files as symlinks to blobs, so stat without -L
was returning the symlink size (76 bytes) instead of actual file size (6.5GB).
This caused the >500MB check to fail and skip linking checkpoint files.
This commit is contained in:
2025-11-22 16:48:40 +01:00
parent 11b3d48c9b
commit eacd771207

View File

@@ -474,7 +474,8 @@ link_model() {
fi
# Only link if the file is large enough to be a checkpoint (> 500MB)
local file_size=$(stat -c%s "$ckpt_file" 2>/dev/null || echo "0")
# Use -L to follow symlinks (HuggingFace cache uses symlinks to blobs)
local file_size=$(stat -L -c%s "$ckpt_file" 2>/dev/null || echo "0")
if [[ $file_size -gt 524288000 ]]; then
local ckpt_link="${checkpoint_dir}/${ckpt_name}"