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
|
TRL_USE_RICH = os.environ.get("TRL_USE_RICH", False) |
, meaning that when set, no matter what value is is, the condition
if TRL_USE_RICH will always be true).
Proposal
Description
Apparently the usage of
richwhen usingtrl's CLI is currently enforced toTrue(set to"1"), meaning thatrichwill 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
richis not properly handled so no logs are propagated, as thetqdmbar is being updated.So on, how the
TRL_USE_RICHflag 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 pertrl/examples/scripts/dpo.py
Line 58 in 78f8228
if TRL_USE_RICHwill always be true).Proposal
utils.py)TRL_USE_RICHis not set when runningtrl's CLI, then set it toTrueby default; otherwise, simply evaluate what's provided using the function mentioned above