Buckets:
Logging
EvaluationTracker[[lighteval.logging.evaluation_tracker.EvaluationTracker]]
class lighteval.logging.evaluation_tracker.EvaluationTrackerlighteval.logging.evaluation_tracker.EvaluationTracker
- results_path_template (str, optional) -- Template for results directory structure. Example: "{output_dir}/results/{org}_{model}"
- save_details (bool, defaults to True) -- Whether to save detailed evaluation records
- push_to_hub (bool, defaults to False) -- Whether to push results to HF Hub
- push_to_tensorboard (bool, defaults to False) -- Whether to push metrics to TensorBoard
- hub_results_org (str, optional) -- HF Hub organization to push results to
- tensorboard_metric_prefix (str, defaults to "eval") -- Prefix for TensorBoard metrics
- public (bool, defaults to False) -- Whether to make Hub datasets public
- nanotron_run_info (GeneralArgs, optional) -- Nanotron model run information
- use_wandb (bool, defaults to False) -- Whether to log to Weights & Biases or Trackio if available0 Tracks and manages evaluation results, metrics, and logging for model evaluations.
The EvaluationTracker coordinates multiple specialized loggers to track different aspects of model evaluation:
- Details Logger (DetailsLogger): Records per-sample evaluation details and predictions
- Metrics Logger (MetricsLogger): Tracks aggregate evaluation metrics and scores
- Versions Logger (VersionsLogger): Records task and dataset versions
- General Config Logger (GeneralConfigLogger): Stores overall evaluation configuration
- Task Config Logger (TaskConfigLogger): Maintains per-task configuration details
The tracker can save results locally and optionally push them to:
- Hugging Face Hub as datasets
- TensorBoard for visualization
- Trackio or Weights & Biases for experiment tracking
Example:
tracker = EvaluationTracker(
output_dir="./eval_results",
push_to_hub=True,
hub_results_org="my-org",
save_details=True
)
# Log evaluation results
tracker.metrics_logger.add_metric("accuracy", 0.85)
tracker.details_logger.add_detail(task_name="qa", prediction="Paris")
# Save all results
tracker.save()
generate_final_dictlighteval.logging.evaluation_tracker.EvaluationTracker.generate_final_dict
This function should be used to gather and display said information at the end of an evaluation run.
push_to_hublighteval.logging.evaluation_tracker.EvaluationTracker.push_to_hub
recreate_metadata_cardlighteval.logging.evaluation_tracker.EvaluationTracker.recreate_metadata_cardorg/dataset)0
Fully updates the details repository metadata card for the currently evaluated model
savelighteval.logging.evaluation_tracker.EvaluationTracker.save
GeneralConfigLogger[[lighteval.logging.info_loggers.GeneralConfigLogger]]
class lighteval.logging.info_loggers.GeneralConfigLoggerlighteval.logging.info_loggers.GeneralConfigLogger
num_fewshot_seeds (int) -- Number of random seeds used for few-shot example sampling.
- If <= 1: Single evaluation with seed=0
- If > 1: Multiple evaluations with different few-shot samplings (HELM-style)
max_samples (int, optional) -- Maximum number of samples to evaluate per task. Only used for debugging - truncates each task's dataset.
job_id (int, optional) -- Slurm job ID if running on a cluster. Used to cross-reference with scheduler logs.
start_time (float) -- Unix timestamp when evaluation started. Automatically set during logger initialization.
end_time (float) -- Unix timestamp when evaluation completed. Set by calling log_end_time().
total_evaluation_time_secondes (str) -- Total runtime in seconds. Calculated as end_time - start_time.
model_config (ModelConfig) -- Complete model configuration settings. Contains model architecture, tokenizer, and generation parameters.
model_name (str) -- Name identifier for the evaluated model. Extracted from model_config.0 Tracks general configuration and runtime information for model evaluations.
This logger captures key configuration parameters, model details, and timing information to ensure reproducibility and provide insights into the evaluation process.
log_args_infolighteval.logging.info_loggers.GeneralConfigLogger.log_args_info
- max_samples (int | None) -- maximum number of samples, if None, use all the samples available.
- job_id (str) -- job ID, used to retrieve logs.0 Logs the information about the arguments passed to the method.
log_model_infolighteval.logging.info_loggers.GeneralConfigLogger.log_model_info
DetailsLogger[[lighteval.logging.info_loggers.DetailsLogger]]
class lighteval.logging.info_loggers.DetailsLoggerlighteval.logging.info_loggers.DetailsLoggerHash) -- Maps each task name to the list of all its samples' Hash.
- compiled_hashes (dict[str, CompiledHash) -- Maps each task name to its
CompiledHas, an aggregation of all the individual sample hashes. - details (dict[str, list
Detail]) -- Maps each task name to the list of its samples' details. Example: winogrande: [sample1_details, sample2_details, ...] - compiled_details (dict[str,
CompiledDetail]) -- : Maps each task name to the list of its samples' compiled details. - compiled_details_over_all_tasks (CompiledDetailOverAllTasks) -- Aggregated details over all the tasks.0 Logger for the experiment details.
Stores and logs experiment information both at the task and at the sample level.
aggregatelighteval.logging.info_loggers.DetailsLogger.aggregate
loglighteval.logging.info_loggers.DetailsLogger.log
- doc (Doc) -- Current sample that we want to store.
- model_response (ModelResponse) -- Model outputs for the current sample
- metrics (dict) -- Model scores for said sample on the current task's metrics.0 Stores the relevant information for one sample of one task to the total list of samples stored in the DetailsLogger.
MetricsLogger[[lighteval.logging.info_loggers.MetricsLogger]]
class lighteval.logging.info_loggers.MetricsLoggerlighteval.logging.info_loggers.MetricsLogger
- metric_aggregated (dict[str, dict[str, float]]) -- Maps each task to its dictionary of metrics to aggregated scores over all the example of the task. Example: {"winogrande|winogrande_xl": {"accuracy": 0.5}}0 Logs the actual scores for each metric of each task.
aggregatelighteval.logging.info_loggers.MetricsLogger.aggregate
- bootstrap_iters (int, optional) -- Number of runs used to run the statistical bootstrap. Defaults to 1000.0 Aggregate the metrics for each task and then for all tasks.
VersionsLogger[[lighteval.logging.info_loggers.VersionsLogger]]
class lighteval.logging.info_loggers.VersionsLoggerlighteval.logging.info_loggers.VersionsLogger
Tasks can have a version number/date, which indicates what is the precise metric definition and dataset version used for an evaluation.
TaskConfigLogger[[lighteval.logging.info_loggers.TaskConfigLogger]]
class lighteval.logging.info_loggers.TaskConfigLoggerlighteval.logging.info_loggers.TaskConfigLoggerLightevalTaskConfig0
Logs the different parameters of the current LightevalTask of interest.
Xet Storage Details
- Size:
- 15.7 kB
- Xet hash:
- 0f43cdaf24f913646e3163038f6e8862d6f69c6c3c3fb19d3c4b025fe6ac3f2e
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.