```python
Save a model state dictionary to the disk, handling sharding and shared tensors issues.

See also [`save_torch_model`] to directly save a PyTorch model.

For more information about tensor sharing, check out [this guide](https://huggingface.co/docs/safetensors/torch_shared_tensors).