File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 64
64
@test .test_id ("B615" )
65
65
def huggingface_unsafe_download (context ):
66
66
"""
67
- This plugin checks for unsafe artifact download from Hugging Face Hub
67
+ This plugin checks for unsafe artifact download from Hugging Face Hub
68
68
without immutable/reproducible revision pinning.
69
69
"""
70
70
# Check if any HuggingFace-related modules are imported
@@ -119,11 +119,11 @@ def huggingface_unsafe_download(context):
119
119
# Commit hashes: 40 chars (full SHA) or 7+ chars (short SHA)
120
120
if isinstance (revision_to_check , str ):
121
121
# Remove quotes if present
122
- revision_str = str (revision_to_check ).strip ('" \' ' )
122
+ revision_str = str (revision_to_check ).strip (" \" '" )
123
123
124
124
# Check if it looks like a commit hash (hexadecimal string)
125
125
# Must be at least 7 characters and all hexadecimal
126
- hex_chars = ' 0123456789abcdefABCDEF'
126
+ hex_chars = " 0123456789abcdefABCDEF"
127
127
is_hex = all (c in hex_chars for c in revision_str )
128
128
if len (revision_str ) >= 7 and is_hex :
129
129
# This looks like a commit hash, which is secure
You can’t perform that action at this time.
0 commit comments