Skip to content

Commit

Permalink
fix: documentation for run_is_already_computed (#1084)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesWesch authored Oct 15, 2024
1 parent 75e516d commit 6cad539
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/documentation/parameter_optimization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,8 @@
"# Add a new model to the run configuration\n",
"model_list.append(\"model d\")\n",
"\n",
"# Loop over all combinations of parameters and run the `Task` for each combination.\n",
"# We set `recompute_if_metadata_changed` to `True` to only run the new model `model d` with the existing prompts.\n",
"# The previous runs are not recomputed and keep their old results, unless the metadata of the run has changed.\n",
"# Note, that currently the evaluations are recomputed for all runs.\n",
"# We use `run_is_already_computed` to only run the new model `model d` with the existing prompts.\n",
"# The previous runs/evaluations/aggregations are not recomputed and keep their old results, unless the metadata of the run has changed.\n",
"for i, (model, prompt) in enumerate(itertools.product(model_list, prompt_list)):\n",
" dummy_task = DummyTask(model=model, prompt=prompt)\n",
"\n",
Expand All @@ -348,12 +346,15 @@
" eval_overview.id, metadata=metadata, description=description, labels=labels\n",
" )\n",
"\n",
"# Let's print the number of run overviews. Because we have not recomputed the 12 (3 models times 4 examples) runs we now expect 16 runs in total.\n",
"# Without the `recompute_if_metadata_changed` flag we would get 28 runs!\n",
"print(len(list(run_repository.run_overviews())))\n",
"print(len(list(evaluation_repository.evaluation_overviews())))\n",
"# Let's print the number of run/evaluation/aggregation overviews.\n",
"# Because we have not recomputed the 12 (3 models times 4 examples) runs/evaluations/aggregations we now expect 16 for each in total.\n",
"# Without the `run_is_already_computed` check we would get 28 runs/evaluations/aggregations!\n",
"print(f\"Number of Runs: {len(list(run_repository.run_overviews()))}\")\n",
"print(\n",
" f\"Number of Evaluations: {len(list(evaluation_repository.evaluation_overviews()))}\"\n",
")\n",
"print(\n",
" len(list(aggregation_repository.aggregation_overviews(DummyAggregatedEvaluation)))\n",
" f\"Number of Aggregations: {len(list(aggregation_repository.aggregation_overviews(DummyAggregatedEvaluation)))}\"\n",
")"
]
}
Expand Down

0 comments on commit 6cad539

Please sign in to comment.