Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shorten run spec names for Unitxt runs #3205

Merged
merged 1 commit into from
Dec 10, 2024
Merged
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
9 changes: 8 additions & 1 deletion src/helm/benchmark/run_specs/unitxt_run_specs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

from helm.benchmark.adaptation.adapter_spec import ADAPT_GENERATION, AdapterSpec
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.metrics.common_metric_specs import get_basic_metric_specs
Expand All @@ -10,7 +12,12 @@ def get_unitxt_spec(**kwargs) -> RunSpec:
card = kwargs.get("card")
if not card:
raise Exception("Unitxt card must be specified")
name_suffix = ",".join([f"{key}={value}" for key, value in kwargs.items()])
if os.environ.get("HELM_UNITXT_SHORTEN_RUN_SPEC_NAMES", "").lower() == "true":
name_suffix = ",".join(
[f"{key}={value}" for key, value in kwargs.items() if key not in ["template_card_index", "loader_limit"]]
)
else:
name_suffix = ",".join([f"{key}={value}" for key, value in kwargs.items()])
name = f"unitxt:{name_suffix}"
scenario_spec = ScenarioSpec(class_name="helm.benchmark.scenarios.unitxt_scenario.UnitxtScenario", args=kwargs)
adapter_spec = AdapterSpec(
Expand Down
Loading