diff --git a/artifact_huggingface_download.sh b/artifact_huggingface_download.sh index 88907ba..3e92ad1 100755 --- a/artifact_huggingface_download.sh +++ b/artifact_huggingface_download.sh @@ -607,9 +607,17 @@ get_model_disk_usage() { local total_bytes=0 while IFS= read -r file_path; do - if [[ -f "$file_path" ]]; then + if [[ -f "$file_path" ]] || [[ -L "$file_path" ]]; then local file_size - file_size=$(stat -f%z "$file_path" 2>/dev/null || stat -c%s "$file_path" 2>/dev/null || echo "0") + # Use -L to follow symlinks (HuggingFace uses symlinks to blobs) + # Try Linux stat first, then macOS stat + if stat -L -c "%s" "$file_path" >/dev/null 2>&1; then + file_size=$(stat -L -c "%s" "$file_path" 2>/dev/null) + elif stat -L -f "%z" "$file_path" >/dev/null 2>&1; then + file_size=$(stat -L -f "%z" "$file_path" 2>/dev/null) + else + file_size=0 + fi total_bytes=$((total_bytes + file_size)) fi done <<< "$model_files"