generated from fastai/nbdev_template
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
Description
Apparently the usage of rich
when using trl
's CLI is currently enforced to True
(set to "1"
), meaning that rich
will always be used.
While this may be a nice enhancement to the CLI display to some, in some cases as logging to an external tracking tool as e.g. GCP's Log Explorer, makes the experience a bit hard since rich
is not properly handled so no logs are propagated, as the tqdm
bar is being updated.
So on, how the TRL_USE_RICH
flag is defined and handled could be improved, so that it can be both enabled and disabled (at the moment it can only be enabled as per
Line 58 in 78f8228
TRL_USE_RICH = os.environ.get("TRL_USE_RICH", False) |
if TRL_USE_RICH
will always be true).
Proposal
- Handle the boolean value for the environment value similarly to https://github.com/python/cpython/blob/48f9d3e3faec5faaa4f7c9849fecd27eae4da213/Lib/distutils/util.py#L308-L321 (already deprecated since Python 3.10, meaning we would need to copy that function into
utils.py
) - If
TRL_USE_RICH
is not set when runningtrl
's CLI, then set it toTrue
by default; otherwise, simply evaluate what's provided using the function mentioned above
Metadata
Metadata
Assignees
Labels
No labels