File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6464@test .test_id ("B615" )
6565def huggingface_unsafe_download (context ):
6666 """
67- This plugin checks for unsafe artifact download from Hugging Face Hub
67+ This plugin checks for unsafe artifact download from Hugging Face Hub
6868 without immutable/reproducible revision pinning.
6969 """
7070 # Check if any HuggingFace-related modules are imported
@@ -119,11 +119,11 @@ def huggingface_unsafe_download(context):
119119 # Commit hashes: 40 chars (full SHA) or 7+ chars (short SHA)
120120 if isinstance (revision_to_check , str ):
121121 # Remove quotes if present
122- revision_str = str (revision_to_check ).strip ('" \' ' )
122+ revision_str = str (revision_to_check ).strip (" \" '" )
123123
124124 # Check if it looks like a commit hash (hexadecimal string)
125125 # Must be at least 7 characters and all hexadecimal
126- hex_chars = ' 0123456789abcdefABCDEF'
126+ hex_chars = " 0123456789abcdefABCDEF"
127127 is_hex = all (c in hex_chars for c in revision_str )
128128 if len (revision_str ) >= 7 and is_hex :
129129 # This looks like a commit hash, which is secure
You can’t perform that action at this time.
0 commit comments