Replies: 4 comments 3 replies
-
Hello ! I put in bold the tl;dr non technical speech. Unfortunately I am a technical person and cannot help myself but be specific at the same time (which does imply some jargonning, sorry).
It means you should never be scared to open these files. Contrary to Pytorch pickled files, which can contain arbitrary code and steal all your bitcoins.
Reading a malicious pickle file will infect your machine (depending on what actually goes in there tbh). So there is nothing preventing you from being infected if you ever read a malicious pickled file.
The threats currently avoided is Arbitrary Code Execution (ACE: people can do whatever they want with your machine). And DOS (Denial of Service: your computer stops responding or crashes) a much lesser kind of attack, usually it just tries to fill your memory or make your computer do unnecessary work to prevent it doing it's regular job, but it's not a means (on its own at least) for an attacker to gain control of your machine or steal your bitcoins.
Random That's the first goal I had in mind when creating this. Actually if you don't trust this repo's code, you can always load them yourself manually https://gist.github.com/Narsil/3edeec2669a5e94e4707aa0f901d2282 . This snippet is meant to be simple to adapt and pretty efficient with And if you don't trust Python, you can use any other language to use those files This repo does add some nice checks for you that are not in the snippet, which prevent loading huge json files (also a DOS), or intentionally malformed script that could cause DOS. It's hard to say never in security, but let's say nothing weird should happen when using those files. They contain tensors, so when you load you should get tensors of roughly the same size they are on disk. |
Beta Was this translation helpful? Give feedback.
-
Hi! First of all sorry for the double posting. Secondly, I want to thank you greatly for this detailed answer, the clarity that you use to write it and the speed of the delivery. All this for free, to a stranger. Kudos! What you're telling me it's honestly so liberating, as I was very concered with opening random ckpts on AUTOMATIC,'s webui, and to know that i can basically run any .safetensors without any fear that i will execute malicious code, basically i can just feel safe, is honestly so good to hear. I know this is not useful but i wanted to send some virtual thanks and make you feel appreciated for this, which i believe is very good work. I'm already using the safetensor! I manually modified AUTOMATIC's WEBUI with the files i found in pattonim's commit here . Then I take the ckpts, and use the colab you provided here to that user, all I do is slightly modify it to work with the ckpt i have in drive (or !wget from huggingface for example). On a side note, the NAI ckpt you uploaded in huggingface for that user might be illicit (i think it's stolen proprietary software), i suggest you look into it or remove it from hugginface to be safe. By the way, sometimes the free colab has not enough ram (12gb total) to convert .ckpts that are bigger than 4gb (I recently converted a 6bg one), but I found out a workaround that lets you use 25 gbs of ram instead of the usual 12gbs for free, let me know if you need it! They are a machine learning model, pure data, nothing more. This is what most people actually think that normal .ckpts do. With the fact that safetensors can even support merges, I have 0 doubts that this will be largely adopted as soon as it's implemetned in AUTOMATIC's and will be greatly appreciated by the community, once people realize what it is and how easy it is to use. |
Beta Was this translation helpful? Give feedback.
-
Hello, Thank you really for the answer here. its neat ! Thank you in advance and appreciation. |
Beta Was this translation helpful? Give feedback.
-
Warning notice: It's impossible to prove the absence of flaws. While it's impossible to prove there's no error, (It could be in the compiler, in the hardware, in the OS etc...) here are a list of steps taken here to assure no ACE: Use RUST, don't eval code. That's about it. torch pickle uses To assure no DOS is triggered: This one is first of all a much smaller guarantee, and not even guaranteed till the end of time. If usability can be vastly improved and is required for mass adoption, we could potentially lower that barrier for usability. I don't see that happening, but never say never.
Hope that helps. |
Beta Was this translation helpful? Give feedback.
-
Hi, coming from a non-IT field I would like to ask the owner of the code if they could spend a couple words talking about the security of this new format.
In simple words, what does it mean that this format is safe?
Does it mean I can convert any malicious .ckpt model that I find and once it is .safetensors it can't infect my machine anymore? Or is this format only protecting against some kinds of threats? if so, which ones? How concerned should I be running randomg converted .ckpts found over the internet once they are made .safetensors?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions