Beinsezii commited on
Commit
bdae485
·
verified ·
1 Parent(s): e49579b

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. README.md +14 -0
  2. pytorch_lora_weights.safetensors +3 -0
  3. reproduce.py +30 -0
README.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - krea/Krea-2-Turbo
4
+ tags:
5
+ - lora
6
+ library_name: diffusers
7
+ ---
8
+
9
+ ```
10
+ - 0.01 weight = +1×
11
+ - 0.1 weight = +10×
12
+ - 1.0 weight = +100×
13
+ ```
14
+
pytorch_lora_weights.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9c3eeb6ef85bf1b569183c4b0337d97152e8b1fa2e32da5a30095380d5de6e13
3
+ size 268
reproduce.py ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # /// script
2
+ # requires-python = ">=3.14"
3
+ # dependencies = [
4
+ # "huggingface-hub>=1",
5
+ # "numpy>2",
6
+ # "safetensors>=0.8",
7
+ # "torch>2",
8
+ # ]
9
+ #
10
+ # [[tool.uv.index]]
11
+ # url = "https://download.pytorch.org/whl/cpu"
12
+ # ///
13
+
14
+ import huggingface_hub
15
+ import safetensors
16
+ import safetensors.torch
17
+ import torch
18
+
19
+ with safetensors.safe_open(
20
+ filename=huggingface_hub.hf_hub_download(
21
+ repo_id="krea/Krea-2-Turbo",
22
+ filename="transformer/diffusion_pytorch_model-00001-of-00003.safetensors",
23
+ ),
24
+ framework="pt",
25
+ ) as sft:
26
+ lora: dict[str, torch.Tensor] = {}
27
+ proj: torch.Tensor = sft.get_tensor("text_fusion.projector.weight")
28
+ lora["transformer.text_fusion.projector.lora_A.weight"] = proj
29
+ lora["transformer.text_fusion.projector.lora_B.weight"] = proj.new_tensor([[100.0]])
30
+ safetensors.torch.save_file(lora, "pytorch_lora_weights.safetensors")