Set usedforsecurity=False in hashlib methods (FIPS compliance) (#27483)

* Set usedforsecurity=False in hashlib methods (FIPS compliance)

* trigger ci

* tokenizers version

* deps

* bump hfh version

* let's try this
This commit is contained in:
Lucain
2023-11-16 15:29:53 +01:00
committed by GitHub
parent 5603fad247
commit fd65aa9818
9 changed files with 21 additions and 19 deletions

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import hashlib
import unittest
from huggingface_hub.utils import insecure_hashlib
from transformers import MODEL_FOR_DEPTH_ESTIMATION_MAPPING, is_torch_available, is_vision_available
from transformers.pipelines import DepthEstimationPipeline, pipeline
from transformers.testing_utils import (
@@ -44,7 +45,7 @@ else:
def hashimage(image: Image) -> str:
m = hashlib.md5(image.tobytes())
m = insecure_hashlib.md5(image.tobytes())
return m.hexdigest()