Convert safetensors back to bin for LLM #397
-
Hi, how can I convert a .safetensors file back into a .bin file for a LLM (Mistral)? |
Beta Was this translation helpful? Give feedback.
Answered by
Narsil
Dec 4, 2023
Replies: 2 comments 1 reply
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
fakerybakery
-
from safetensors.torch import load_file
import torch
lora_model_path = 'adapter_model.safetensors'
bin_model_path = 'adapter_model.bin'
torch.save(load_file(lora_model_path), bin_model_path) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
torch.save(load_file(...))