MCPcopy Create free account
hub / github.com/AnswerDotAI/ModernBERT / _print_table

Function _print_table

eval.py:456–477  ·  view source on GitHub ↗

Pretty prints a table given a results dictionary.

(results: Dict[str, Dict[str, Any]])

Source from the content-addressed store, hash-verified

454
455
456def _print_table(results: Dict[str, Dict[str, Any]]):
457 """Pretty prints a table given a results dictionary."""
458 header = "{job_name:50}| {eval_task:25}| {name:27}|"
459 hyphen_count = 50 + 25 + 27 + 11
460 row_format = header + " {value:.2f}"
461 print("\nCollected Job Results: \n")
462 print("-" * hyphen_count)
463 print(header.format(job_name="Job", eval_task="Dataset", name="Metric"))
464 print("-" * hyphen_count)
465 for job_name, result in results.items():
466 for eval_task, eval_results in result["result"]["metrics"].items():
467 for name, metric in eval_results.items():
468 print(
469 row_format.format(
470 job_name=format_job_name(job_name),
471 eval_task=eval_task,
472 name=name,
473 value=metric * 100,
474 )
475 )
476 print("-" * hyphen_count)
477 print("\n")
478
479
480def _print_averaged_glue_results(glue_results: List[Tuple[str, float]]) -> None:

Callers 1

trainFunction · 0.70

Calls 1

format_job_nameFunction · 0.70

Tested by

no test coverage detected