Skip to content

Commit

Permalink
fix(api): handle more SwinIR models
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jun 17, 2023
1 parent 12e489b commit 1506f51
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/onnx_web/convert/upscaling/swinir.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ def convert_upscaling_swinir(
torch_model = torch.load(source, map_location=conversion.map_location)
if "params_ema" in torch_model:
model.load_state_dict(torch_model["params_ema"], strict=False)
else:
elif "params" in torch_model:
model.load_state_dict(torch_model["params"], strict=False)
else:
model.load_state_dict(torch_model, strict=False)

model.to(conversion.training_device).train(False)
model.eval()
Expand Down

0 comments on commit 1506f51

Please sign in to comment.