shaltielshmid / TorchSharp.PyBridge

A library enabling easy transfer and handling of PyTorch models between .NET and Python environments
MIT License
16 stars 4 forks source link

`strict` is not passed to `load_safetensor` in `load_checkpoint` extension #21

Closed LittleLittleCloud closed 1 month ago

LittleLittleCloud commented 1 month ago

In load_checkpoint API, the strict is not passed to the inner call towards load_safetensor, so if the checkpoint is safetensor, the loading process will always be in strict mode

https://github.com/shaltielshmid/TorchSharp.PyBridge/blob/74fb29feb3fca2c0700e49dc836a94b9cb6881b3/TorchSharp.PyBridge/PyBridgeModuleExtensions.cs#L311C115-L311C122

shaltielshmid commented 1 month ago

Great catch! Version 1.4.3 should be published on NuGet soon. Can you confirm that the new version works for you?