diff --git a/artifact_huggingface_download.sh b/artifact_huggingface_download.sh index 9941ffa..f888e11 100755 --- a/artifact_huggingface_download.sh +++ b/artifact_huggingface_download.sh @@ -619,9 +619,13 @@ link_model() { continue fi - # Find the specific file using its source pattern as filter + # Extract just the filename from the source pattern (remove directory path) + local filename_only + filename_only=$(basename "$source_pattern") + + # Find files matching the filename, then filter by full source pattern local source_file - source_file=$(find_model_files "$repo_id" "$source_pattern" 2>/dev/null | head -n1) + source_file=$(find_model_files "$repo_id" "$filename_only" 2>/dev/null | grep "/$source_pattern$" | head -n1) if [[ -z "$source_file" ]] || [[ ! -f "$source_file" ]]; then print_warning "Source file not found: ${source_pattern}"