]> khamidou — GitHub mirrors - safetensors.git/commitdiff
[docs] Convert weights (#345)
authorSteven Liu <59462357+stevhliu@users.noreply.github.com>
Wed, 6 Sep 2023 07:52:14 +0000 (00:52 -0700)
committerGitHub <noreply@github.com>
Wed, 6 Sep 2023 07:52:14 +0000 (09:52 +0200)
* Create convert-weights.md

* Update _toctree.yml

* convert space option only

docs/source/_toctree.yml
docs/source/convert-weights.md [new file with mode: 0644]

index c41db63b4d990e9f86fd0e836b0baab20dd25e30..ce40108cc5c9c692d3e8f6e7128dabd2aebaa7ea 100644 (file)
@@ -7,6 +7,8 @@
     title: Tensor Sharing in Pytorch
   - local: metadata_parsing
     title: Metadata Parsing
+  - local: convert-weights
+    title: Convert weights to safetensors
   title: Getting started
 - sections: 
   - local: api/torch
diff --git a/docs/source/convert-weights.md b/docs/source/convert-weights.md
new file mode 100644 (file)
index 0000000..65c42f0
--- /dev/null
@@ -0,0 +1,13 @@
+# Convert weights to safetensors
+
+PyTorch model weights are commonly saved and stored as `.bin` files with Python's [`pickle`](https://docs.python.org/3/library/pickle.html) utility. To save and store your model weights in the more secure `safetensor` format, we recommend converting your weights to `.safetensors`.
+
+The easiest way to convert your model weights is to use the [Convert Space](https://huggingface.co/spaces/diffusers/convert), given your model weights are already stored on the Hub. The Convert Space downloads the pickled weights, converts them, and opens a Pull Request to upload the newly converted `.safetensors` file to your repository.
+
+<Tip warning={true}>
+
+For larger models, the Space may be a bit slower because its resources are tied up in converting other models. You can also try running the [convert.py](https://github.com/huggingface/safetensors/blob/main/bindings/python/convert.py) script (this is what the Space is running) locally to convert your weights.
+
+Feel free to ping [@Narsil](https://huggingface.co/Narsil) for any issues with the Space.
+
+</Tip>