John6666 commited on
Commit
1ba019b
1 Parent(s): f9c4591

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -14,6 +14,7 @@ from torchvision import transforms
14
  from dataclasses import dataclass
15
  import math
16
  from typing import Callable
 
17
 
18
  import torch
19
  import random
@@ -641,6 +642,7 @@ with EmptyInitWrapper():
641
  model = Flux().to(dtype=torch.bfloat16, device=device)
642
 
643
  sd = load_file(f"{model_path}/consolidated_s6700.safetensors")
 
644
  sd = {k.replace("model.", ""): v for k, v in sd.items()}
645
  result = model.load_state_dict(sd)
646
 
 
14
  from dataclasses import dataclass
15
  import math
16
  from typing import Callable
17
+ from pathlib import Path
18
 
19
  import torch
20
  import random
 
642
  model = Flux().to(dtype=torch.bfloat16, device=device)
643
 
644
  sd = load_file(f"{model_path}/consolidated_s6700.safetensors")
645
+ Path(f"{model_path}/consolidated_s6700.safetensors").unlink()
646
  sd = {k.replace("model.", ""): v for k, v in sd.items()}
647
  result = model.load_state_dict(sd)
648