Skip to content

Conversation

sidchaini
Copy link

When lc_classifier is extracting features, the current implementation uses the default tqdm module intended for scripts, even if running on an IPy Notebook. tqdm does offer a notebook variant, but, it also offers the ability to infer it automatically through tqdm.auto.

I modified the code to import from tqdm.auto instead of tqdm. This will automatically invoke the right type of progress bar to be used depending on the platform (script v/s notebook).

Summary of the changes

Changed from tqdm import tqdm to from tqdm.auto import tqdm

Observations

This probably adds a very small overhead to the import as tqdm automatically infers the type of platform, namely, it tries in the following order:

  • tqdm.autonotebook without import warnings
  • tqdm.asyncio
  • tqdm.std base class

But, this overhead should still be negligible, and will be helpful for people using it on IPy Notebooks (like me!)

Ref: https://github.com/tqdm/tqdm/blob/master/tqdm/auto.py

sidchaini and others added 6 commits May 2, 2025 19:54
Using tqdm.auto instead of tqdm will automatically invoke the right type of progress bar to be used depending on the platform (script v/s notebook).
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.

2 participants