From 71f7391fd16d331d288eec04afc160c38ed4e609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Tue, 25 Nov 2025 20:08:28 +0100 Subject: [PATCH] fix: match filename only in grep pattern for HuggingFace cache structure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HuggingFace cache flattens repository directory structure into snapshots. When YAML specifies "vae/model.safetensors", the cache stores it as just "model.safetensors" without preserving the vae/ subdirectory. Changed grep pattern from "/$source_pattern$" to "/$filename_only$" to match the actual flattened cache structure instead of the logical repo path. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- artifact_huggingface_download.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artifact_huggingface_download.sh b/artifact_huggingface_download.sh index f888e11..7c2cf9e 100755 --- a/artifact_huggingface_download.sh +++ b/artifact_huggingface_download.sh @@ -623,9 +623,9 @@ link_model() { local filename_only filename_only=$(basename "$source_pattern") - # Find files matching the filename, then filter by full source pattern + # Find files matching the filename (HuggingFace cache flattens directory structure) local source_file - source_file=$(find_model_files "$repo_id" "$filename_only" 2>/dev/null | grep "/$source_pattern$" | head -n1) + source_file=$(find_model_files "$repo_id" "$filename_only" 2>/dev/null | grep "/$filename_only$" | head -n1) if [[ -z "$source_file" ]] || [[ ! -f "$source_file" ]]; then print_warning "Source file not found: ${source_pattern}"