From bb43639b0994f1bcf66de0fa22221f12cff8b0cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Tue, 25 Nov 2025 19:57:37 +0100 Subject: [PATCH] fix: call find_model_files() with source_pattern instead of empty filter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous fix still called find_model_files() with empty filter, which doesn't work. Now we call find_model_files() for EACH file mapping individually, passing the source_pattern as the filter. This eliminates the "No files matched filter (filter: )" warnings and allows the script to properly find and link downloaded models. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- artifact_huggingface_download.sh | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/artifact_huggingface_download.sh b/artifact_huggingface_download.sh index 687916f..9941ffa 100755 --- a/artifact_huggingface_download.sh +++ b/artifact_huggingface_download.sh @@ -613,24 +613,15 @@ link_model() { return 0 fi - # Find all model files in cache (no filter needed, we have explicit paths) - local model_files - model_files=$(find_model_files "$repo_id" "") - - if [[ -z "$model_files" ]]; then - print_warning "No model files found in cache for ${repo_id}" - return 1 - fi - - # Process each file mapping + # Process each file mapping - find each file individually by its pattern while IFS='|' read -r source_pattern dest_path; do if [[ -z "$source_pattern" ]] || [[ -z "$dest_path" ]]; then continue fi - # Find the file matching the source pattern in model_files + # Find the specific file using its source pattern as filter local source_file - source_file=$(echo "$model_files" | grep -F "/$source_pattern" | head -n1) + source_file=$(find_model_files "$repo_id" "$source_pattern" 2>/dev/null | head -n1) if [[ -z "$source_file" ]] || [[ ! -f "$source_file" ]]; then print_warning "Source file not found: ${source_pattern}" @@ -1061,15 +1052,7 @@ verify_model_links() { # Check if explicit file mappings exist if [[ -n "$file_mappings" ]]; then - # Verify files exist in cache (no filter needed) - local model_files - model_files=$(find_model_files "$repo_id" "" 2>/dev/null) - - if [[ -z "$model_files" ]]; then - echo "NOT_DOWNLOADED|0|0|0" - return 1 - fi - + # Process each file mapping to verify links while IFS='|' read -r source_pattern dest_path; do if [[ -z "$source_pattern" ]] || [[ -z "$dest_path" ]]; then continue