Skip to content

Commit d92a44f

Browse files
authored
Fixes #100 and Fixes #101 (#102)
Does not show pbar during sampling if effective logging level is greater than INFO.
1 parent e907ce4 commit d92a44f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mellea/stdlib/sampling.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ def sample(
150150

151151
flog = FancyLogger.get_logger()
152152

153+
# The `logging_redirect_tqdm` approach did not work, so instead we will use the show_progress
154+
# flag to determine whether we should show the pbar.
155+
show_progress = show_progress and flog.getEffectiveLevel() <= FancyLogger.INFO
156+
153157
failed_results: list[ModelOutputThunk] = []
154158
failed_scores: list[list[tuple[Requirement, ValidationResult]]] = []
155159
failed_instructions: list[Instruction] = []

0 commit comments

Comments
 (0)