Skip to content

Commit

Permalink
fix(api): unwrap state dict from VAE
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Feb 17, 2023
1 parent c74d22a commit 37b173d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/onnx_web/convert/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ def load_tensor(name: str, map_location=None):
"failed to load with Torch JIT, falling back to PyTorch", e
)
checkpoint = torch.load(name, map_location=map_location)

checkpoint = (
checkpoint["state_dict"] if "state_dict" in checkpoint else checkpoint
)
else:
logger.debug("loading ckpt")
checkpoint = torch.load(name, map_location=map_location)
Expand Down

0 comments on commit 37b173d

Please sign in to comment.