Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

Update evaluate.py (#8074)

koptagel5cd355b6fb46
diff --git a/dspy/evaluate/evaluate.py b/dspy/evaluate/evaluate.py
index a4ed0b2f8..5ddf66cb2 100644
--- a/dspy/evaluate/evaluate.py
+++ b/dspy/evaluate/evaluate.py
@@ -176,12 +176,12 @@ class Evaluate:
logger.info(f"Average Metric: {ncorrect} / {ntotal} ({round(100 * ncorrect / ntotal, 1)}%)")
- # Rename the 'correct' column to the name of the metric object
- metric_name = metric.__name__ if isinstance(metric, types.FunctionType) else metric.__class__.__name__
- # Construct a pandas DataFrame from the results
- result_df = self._construct_result_table(results, metric_name)
-
if display_table:
+ # Rename the 'correct' column to the name of the metric object
+ metric_name = metric.__name__ if isinstance(metric, types.FunctionType) else metric.__class__.__name__
+ # Construct a pandas DataFrame from the results
+ result_df = self._construct_result_table(results, metric_name)
+
self._display_result_table(result_df, display_table, metric_name)
if return_all_scores and return_outputs: