Support FIPS enabled machines with MD5 hashing (#15299)

Signed-off-by: Matthew Vine <32849887+MattTheCuber@users.noreply.github.com>
This commit is contained in:
Matthew Vine
2025-03-26 20:19:46 -04:00
committed by GitHub
parent e74ff409e0
commit 7a6d45bc8a
4 changed files with 36 additions and 19 deletions

View File

@ -63,7 +63,8 @@ class LlamaConfig:
factors.append((k, v))
factors.sort()
import hashlib
return hashlib.md5(str(factors).encode()).hexdigest()
return hashlib.md5(str(factors).encode(),
usedforsecurity=False).hexdigest()
def __post_init__(self):
assert self.mlp_size >= self.hidden_size