Skip to content

Commit

Permalink
👕 Add one significant figure to %metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
o-laurent committed Jan 20, 2025
1 parent c3110a7 commit 04eb529
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion torch_uncertainty/utils/evaluation_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
def _add_row(table: Table, metric_name: str, value: Tensor) -> None:
if metric_name in PERCENTAGE_METRICS:
value = value * 100
table.add_row(metric_name, f"{value.item():.2f}%")
table.add_row(metric_name, f"{value.item():.3f}%")
else:
table.add_row(metric_name, f"{value.item():.5f}")

Expand Down
2 changes: 1 addition & 1 deletion torch_uncertainty/utils/to_hub_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
raise ValueError("File does not exist")

dtype = torch.float16 if args.fp16 else torch.float32
model = torch.load(args.path)["state_dict"]
model = torch.load(args.path, weights_only=True)["state_dict"]
model = {key.replace("model.", ""): val.to(device="cpu", dtype=dtype) for key, val in model.items()}

output_name = args.name
Expand Down

0 comments on commit 04eb529

Please sign in to comment.