render
render
¶
Jinja2 report rendering for evaluation results.
Loads HTML/Jinja templates from the assets/ directory and renders
an EvaluationReport into a self-contained HTML file.
Functions:
| Name | Description |
|---|---|
maybe_render_report |
Render the evaluation report if one is provided, otherwise return |
render_report |
Render an evaluation report to HTML using a Jinja2 template. |
maybe_render_report(evaluation_report, template_name='multi_modal_report.j2', output_path=None, workdir=None)
¶
Render the evaluation report if one is provided, otherwise return None.
Source code in src/nemo_safe_synthesizer/evaluation/render.py
render_report(evaluation_report, template_name='multi_modal_report.j2', output_path=None, workdir=None)
¶
Render an evaluation report to HTML using a Jinja2 template.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
evaluation_report
|
EvaluationReport
|
The completed evaluation report to render. |
required |
template_name
|
str
|
Jinja2 template filename relative to |
'multi_modal_report.j2'
|
output_path
|
str | Path | None
|
File path to write the rendered HTML. If |
None
|
workdir
|
Workdir | None
|
Working directory structure for output path resolution. |
None
|
Returns:
| Type | Description |
|---|---|
str | None
|
The rendered HTML string, or |