jonathanrstern
commited on
Commit
•
54ddccf
1
Parent(s):
a2c563f
delete convert.py
Browse files- convert.py +0 -17
convert.py
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
import torch
|
2 |
-
import safetensors
|
3 |
-
|
4 |
-
def load_safetensors(file_path: str):
|
5 |
-
return safetensors.load(file_path)
|
6 |
-
|
7 |
-
def save_as_pytorch_bin(tensor_or_state_dict, file_path: str):
|
8 |
-
torch.save(tensor_or_state_dict, file_path)
|
9 |
-
|
10 |
-
if __name__ == "__main__":
|
11 |
-
safetensors_file_path = "path/to/your/file.safetensors"
|
12 |
-
pytorch_bin_file_path = "path/to/save/pytorch_lora_weights.bin"
|
13 |
-
|
14 |
-
loaded_data = load_safetensors(safetensors_file_path)
|
15 |
-
save_as_pytorch_bin(loaded_data, pytorch_bin_file_path)
|
16 |
-
|
17 |
-
load_safetensors('./LogoRedmond-LogoLoraForSDXL/LogoRedmond_LogoRedAF.safetensors')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|