Skip to content

Fix EVALS_SHOW_EVAL_PROGRESS env var parsing#1670

Open
LeSingh1 wants to merge 1 commit into
openai:mainfrom
LeSingh1:fix-show-progress-env-parsing
Open

Fix EVALS_SHOW_EVAL_PROGRESS env var parsing#1670
LeSingh1 wants to merge 1 commit into
openai:mainfrom
LeSingh1:fix-show-progress-env-parsing

Conversation

@LeSingh1
Copy link
Copy Markdown

bool(os.environ.get(...)) treats the string "0" as truthy, so setting EVALS_SHOW_EVAL_PROGRESS=0 (or =false) on the command line did not disable the tqdm progress bar as expected.

Replace the bool(...) call with an explicit string check, matching the pattern already used for EVALS_SEQUENTIAL and EVALS_GENTLE_INTERRUPT in the same file. When the env var is unset, the caller-supplied show_progress argument is preserved.

Before:

EVALS_SHOW_EVAL_PROGRESS=0 -> show_progress = True   (bug)
EVALS_SHOW_EVAL_PROGRESS=false -> show_progress = True (bug)

After:

EVALS_SHOW_EVAL_PROGRESS=0 -> show_progress = False
EVALS_SHOW_EVAL_PROGRESS=1 -> show_progress = True
unset -> uses the caller default

Added unit tests covering the unset, truthy, and falsy cases.

bool("0") evaluates to True in Python, so setting
EVALS_SHOW_EVAL_PROGRESS=0 or =false did not disable the progress bar
as users would expect. Replace bool(os.environ.get(...)) with an
explicit string check matching the convention used for EVALS_SEQUENTIAL
and EVALS_GENTLE_INTERRUPT in the same file. When the variable is unset,
the caller-supplied show_progress argument is preserved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant