Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@
<section class="main">
<section class="overview" id="overview">
<h1>Overview</h1>
{% if ctx.job_id %}
<div>
<div class="field">Job ID</div>
<div class="text">{{ ctx.job_id }}</div>
</div>
{% endif %}
<div>
<div class="field">Generated</div>
<div class="text">{{ now.strftime("%m/%d/%Y") }}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ def jinja_context(self):
try:
ctx = super().jinja_context
ctx["tooltips"] = tooltips
# Get the job ID if it exist or create a new one.
ctx["job_id"] = os.environ.get("NEMO_JOB_ID") or "N/A"
# Job ID from the runtime environment (e.g. cluster); omit from HTML when unset.
raw_job_id = os.environ.get("NEMO_JOB_ID")
ctx["job_id"] = (raw_job_id or "").strip() or None

# Shorthands used in template
ctx["with_synthesizer"] = False
Expand Down
23 changes: 23 additions & 0 deletions tests/evaluation/reports/test_multimodal_report.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

import pandas as pd
import pytest

# Skip all tests in this module if sentence_transformers is not available
Expand All @@ -9,10 +10,32 @@
reason="sentence_transformers is required for these tests (install with: uv sync --extra cpu)",
)

from nemo_safe_synthesizer.evaluation.data_model.evaluation_dataset import EvaluationDataset
from nemo_safe_synthesizer.evaluation.data_model.evaluation_score import Grade
from nemo_safe_synthesizer.evaluation.reports.multimodal.multimodal_report import MultimodalReport


def _minimal_multimodal_report() -> MultimodalReport:
reference = pd.DataFrame({"x": [1, 2], "y": [3, 4]})
output = pd.DataFrame({"x": [1, 2], "y": [3, 4]})
dataset = EvaluationDataset(reference=reference, output=output)
return MultimodalReport(evaluation_dataset=dataset, components=[])


def test_jinja_context_job_id_none_when_nemo_job_id_unset(monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.delenv("NEMO_JOB_ID", raising=False)
report = _minimal_multimodal_report()
ctx = report.jinja_context
assert ctx["job_id"] is None


def test_jinja_context_job_id_set_when_nemo_job_id_present(monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.setenv("NEMO_JOB_ID", "cluster-job-abc123")
report = _minimal_multimodal_report()
ctx = report.jinja_context
assert ctx["job_id"] == "cluster-job-abc123"


@pytest.mark.skip(reason="Times out")
def test_multimodal_report(train_df_5k, synth_df_5k, test_df, skip_privacy_metrics_config):
report = MultimodalReport.from_dataframes(
Expand Down
Loading