Skip to content

Commit 5cd355b

Browse files
authored
Update evaluate.py (#8074)
1 parent 08dc9b7 commit 5cd355b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

dspy/evaluate/evaluate.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,12 @@ def process_item(example):
176176

177177
logger.info(f"Average Metric: {ncorrect} / {ntotal} ({round(100 * ncorrect / ntotal, 1)}%)")
178178

179-
# Rename the 'correct' column to the name of the metric object
180-
metric_name = metric.__name__ if isinstance(metric, types.FunctionType) else metric.__class__.__name__
181-
# Construct a pandas DataFrame from the results
182-
result_df = self._construct_result_table(results, metric_name)
183-
184179
if display_table:
180+
# Rename the 'correct' column to the name of the metric object
181+
metric_name = metric.__name__ if isinstance(metric, types.FunctionType) else metric.__class__.__name__
182+
# Construct a pandas DataFrame from the results
183+
result_df = self._construct_result_table(results, metric_name)
184+
185185
self._display_result_table(result_df, display_table, metric_name)
186186

187187
if return_all_scores and return_outputs:

0 commit comments

Comments
 (0)