fix(ci): fixup checksum scanning pipeline (#3631)

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto 2024-09-23 10:56:10 +02:00 committed by GitHub
parent 4edd8c80b4
commit 3e8e71f8b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,9 +29,14 @@ def calculate_sha256(file_path):
def manual_safety_check_hf(repo_id): def manual_safety_check_hf(repo_id):
scanResponse = requests.get('https://huggingface.co/api/models/' + repo_id + "/scan") scanResponse = requests.get('https://huggingface.co/api/models/' + repo_id + "/scan")
scan = scanResponse.json() scan = scanResponse.json()
if scan['hasUnsafeFile']: # Check if 'hasUnsafeFile' exists in the response
return scan if 'hasUnsafeFile' in scan:
return None if scan['hasUnsafeFile']:
return scan
else:
return None
else:
return None
download_type, repo_id_or_url = parse_uri(uri) download_type, repo_id_or_url = parse_uri(uri)