Skip to content

Commit

Permalink
Run formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaarsen committed Dec 7, 2023
1 parent e052e53 commit b699412
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/setfit/model_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,12 +462,14 @@ def try_to_pure_python(value: Any) -> Any:
try:
if hasattr(value, "dtype"):
return value.item()
except:
pass
except Exception:
pass
return value

pure_python_results = {key: try_to_pure_python(value) for key, value in results.items()}
results_without_split = {key.split("_", maxsplit=1)[1].title(): value for key, value in pure_python_results.items()}
results_without_split = {
key.split("_", maxsplit=1)[1].title(): value for key, value in pure_python_results.items()
}
self.eval_results_dict = pure_python_results
self.metric_lines = [{"Label": "**all**", **results_without_split}]

Expand Down

0 comments on commit b699412

Please sign in to comment.