Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add color font capability to console outputs #77

Closed

Conversation

lessw2020
Copy link
Contributor

Current console output is a sea of white.
Added very simple color and style dataclass in utils, so we (or future users) can enable more informative (and fun) console outputs.

current:
Screenshot 2024-02-23 at 3 15 05 PM

after (not necessarily the 'final' color scheme, just showing the difference here):
Screenshot 2024-02-23 at 2 56 43 PM

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Feb 23, 2024
@lessw2020
Copy link
Contributor Author

lint issue is related to new CI rather than pr.

Copy link
Contributor

@yifuwang yifuwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good!

train.py Outdated
model_name = job_config.model.name
rank0_log(f"Building {model_name}")
model_name = job_config.model
rank0_log(f"{color.yellow} Building {model_name} {color.reset}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker, but maybe consider checking if we are being redirected when applying color to avoid '\033[33m' in logs w/ MAST/SLURM.

os.isatty(sys.stdout.fileno())

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, thanks for flagging this Yifu!

@lessw2020 lessw2020 closed this Feb 27, 2024
@lessw2020 lessw2020 force-pushed the add-color-to-console-outputs branch from 1198e76 to 5dec536 Compare February 27, 2024 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants