Skip to content

Replace progress_bar with custom utility function#461

Open
JustAman62 wants to merge 1 commit into
elixir-nx:mainfrom
JustAman62:minimal-progress-bar
Open

Replace progress_bar with custom utility function#461
JustAman62 wants to merge 1 commit into
elixir-nx:mainfrom
JustAman62:minimal-progress-bar

Conversation

@JustAman62

Copy link
Copy Markdown

Removes the progress_bar dependency and replaces its single usage with a small utility function which renders a somewhat similar progress bar when downloading models.

Example output snippet (terminal was sized to 50cols to make this easy to read):

iex(2)> Bumblebee.load_model({:hf, "google-bert/be
rt-base-uncased"})
|                                    |  1% 4/440MB
|                                    |  2% 8/440MB
|=                                  |  3% 13/440MB
|=                                  |  4% 17/440MB
|=                                  |  5% 22/440MB
|==                                 |  6% 26/440MB
|==                                 |  7% 30/440MB
|==                                 |  8% 35/440MB
|===                                |  9% 39/440MB
|===                                | 10% 44/440MB

I've tried to implement just enough for this download use case and not much more, except for making sure the method doesn't failover on weird inputs, and supports non-byte unit progress.

This is my first contribution to this lib so please do let me know if I've forgotten to do something, or am not matching the code style in any way :)

Relates to #458.

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