Add safetensors weight file for gliner_multi-v2.1

#8
by Fouad91 - opened

Hello,

This PR adds a model.safetensors version of the existing
pytorch_model.bin file.

Benefits:

safer format with no arbitrary code execution (required by many inference providers)
slightly faster loading
fully compatible with the current GLiNER architecture
Tested locally:

model reloaded using GLiNER.from_pretrained(...) with the safetensors file
verified that all parameter keys in the state_dict match the original .bin model
verified that all tensor shapes match between the .bin and .safetensors models
verified that tensor values match with a maximum absolute difference <= 1e-6
inference tested successfully with the same outputs as the original model
These checks ensure that the converted safetensors file is fully consistent and not corrupted.

Hello,

This PR adds a model.safetensors version of the existing
pytorch_model.bin file.

Benefits:

  • safer format with no arbitrary code execution (required by many inference providers)
  • slightly faster loading
  • fully compatible with the current GLiNER architecture

Tested locally:

  • model reloaded using GLiNER.from_pretrained(...) with the safetensors file
  • verified that all parameter keys in the state_dict match the original .bin model
  • verified that all tensor shapes match between the .bin and .safetensors models
  • verified that tensor values match with a maximum absolute difference <= 1e-6
  • inference tested successfully with the same outputs as the original model

These checks ensure that the converted safetensors file is fully consistent and not corrupted.

Fouad91 changed pull request status to open
Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment