On the Jupyter Notebook I can create named outputs that are able to be updated like this:
from IPython.display import HTML, display
import time
def progress(value, max=100):
return HTML("""
<progress
value='{value}'
max='{max}',
style='width: 100%'
>
{value}
</progress>
""".format(value=value, max=max))
out = display(progress(0, 100), display_id=True)
for ii in range(101):
time.sleep(0.02)
out.update(progress(ii, 100))
Whereas in colab it doesn't update the progress bar.
How do you do this in colab?
Good news! This now works in Colab. :)
(Previously, we didn't support update_display_data
messages.)
Pasting the code for anyone with sharing issues:
from IPython.display import HTML, display
import time
def progress(value, max=100):
return HTML("""
<progress
value='{value}'
max='{max}',
style='width: 100%'
>
{value}
</progress>
""".format(value=value, max=max))
out = display(progress(0, 100), display_id=True)
for ii in range(101):
time.sleep(0.02)
out.update(progress(ii, 100))