#Enforce safetensors format

1 messages · Page 1 of 1 (latest)

cyan oyster
#

PyTorch RVC models are not safe to use due to possible malicious code execution (https://huggingface.co/docs/hub/security-pickle). This can be partially mitigated by uploading a model to trusted sources (like huggingface, that checks pickled imports and may highlight possibility malicious code). But this approach is also error-prone, requires manual review and more sophisticated attacks can be applied that can be left undetected.

A possible approach could be:

  1. Forcing RVC developers to support safetensors format for inference and training (or at least provide tooling for conversion).
  2. Require model makers to provide/convert their models in safetensors format.

To smoothen transition, both pth and safetensors models may be supported and provided, but the use of pth models must be discouraged.

Don't expect anyone to drive this activity since this is not really about the server, but I'd like to at least bring awareness to this topic.

fresh riverBOT
#
Vote for this suggestion!
cyan oyster
wheat ember
#

the smooth transition should be easy with something like this

cyan oyster
wheat ember
#

what about performance?

#

better than .pth?

cyan oyster
#

Models are loaded faster (much faster on CPU, a bit faster on GPU), so on average it's not that big improvement

#

But inference performance itself is not affected

cyan oyster
#

But ofc that doesn't mean it's a safe approach, just convenient and is useful for sandbox environment. The resulting model will be defused, but the code will be executed because pth model is loaded with torch.load first.

sand spear
#

The egirlv2 model is a virus according to windows

#

First model that ever gave a beep beep

#

I don't trust that guy

cyan oyster