Spaces:
Running on Zero
Running on Zero
Commit ·
c3ab1c4
1
Parent(s): afe862c
debugging app.py
Browse files
app.py
CHANGED
|
@@ -154,7 +154,7 @@ def create_app():
|
|
| 154 |
filename="FLUX/it-blender.bin",
|
| 155 |
token=token
|
| 156 |
)
|
| 157 |
-
|
| 158 |
pretrained_blended_attn_weights = torch.load(model_path, map_location=pipe._execution_device)
|
| 159 |
|
| 160 |
key_changed_blended_attn_weights = {}
|
|
@@ -162,7 +162,7 @@ def create_app():
|
|
| 162 |
block_idx = int(key.split(".")[0]) - 21
|
| 163 |
k_or_v = key.split("_")[2]
|
| 164 |
changed_key = f'single_transformer_blocks.{block_idx}.attn.processor.blended_attention_{k_or_v}_proj.weight'
|
| 165 |
-
key_changed_blended_attn_weights[changed_key] = value.to(dtype)
|
| 166 |
|
| 167 |
missing_keys, unexpected_keys = pipe.transformer.load_state_dict(key_changed_blended_attn_weights, strict=False)
|
| 168 |
|
|
@@ -184,5 +184,4 @@ def create_app():
|
|
| 184 |
|
| 185 |
if __name__ == "__main__":
|
| 186 |
demo = create_app()
|
| 187 |
-
# demo.launch(debug=True, queue=False)
|
| 188 |
demo.launch(debug=True, ssr_mode=False)
|
|
|
|
| 154 |
filename="FLUX/it-blender.bin",
|
| 155 |
token=token
|
| 156 |
)
|
| 157 |
+
|
| 158 |
pretrained_blended_attn_weights = torch.load(model_path, map_location=pipe._execution_device)
|
| 159 |
|
| 160 |
key_changed_blended_attn_weights = {}
|
|
|
|
| 162 |
block_idx = int(key.split(".")[0]) - 21
|
| 163 |
k_or_v = key.split("_")[2]
|
| 164 |
changed_key = f'single_transformer_blocks.{block_idx}.attn.processor.blended_attention_{k_or_v}_proj.weight'
|
| 165 |
+
key_changed_blended_attn_weights[changed_key] = value.to(dtype=dtype, device="cuda")
|
| 166 |
|
| 167 |
missing_keys, unexpected_keys = pipe.transformer.load_state_dict(key_changed_blended_attn_weights, strict=False)
|
| 168 |
|
|
|
|
| 184 |
|
| 185 |
if __name__ == "__main__":
|
| 186 |
demo = create_app()
|
|
|
|
| 187 |
demo.launch(debug=True, ssr_mode=False)
|