creamy-leather-49606
06/29/2021, 8:02 AMstraight-shampoo-11124
06/29/2021, 8:07 AMstraight-shampoo-11124
06/29/2021, 8:08 AMtqdm
might work better now. Have you tried it with the latest version?creamy-leather-49606
06/29/2021, 8:25 AMstraight-shampoo-11124
06/29/2021, 8:39 AMcreamy-leather-49606
06/29/2021, 8:40 AMstraight-shampoo-11124
06/29/2021, 8:44 AMstraight-shampoo-11124
06/29/2021, 8:44 AMcreamy-leather-49606
06/29/2021, 8:50 AMfrom metaflow import FlowSpec, step
import tqdm
from time import sleep
class TQDMFlow(FlowSpec):
@step
def start(self):
print('Training...')
for t in tqdm.tqdm(range(100)):
print(t)
sleep(0.004)
sleep(5)
self.next(self.end)
@step
def end(self):
pass
if __name__ == '__main__':
TQDMFlow()
creamy-leather-49606
06/29/2021, 8:50 AMstraight-shampoo-11124
06/30/2021, 5:07 AMtqdm
doesn't have direct access to the terminal although it may seem like it. The task may even run in the cloud and the output is streamed via S3.
Pretty much the only workaround is to have tqdm
outside the task like in this example:straight-shampoo-11124
06/30/2021, 5:07 AMstraight-shampoo-11124
06/30/2021, 5:08 AMstraight-shampoo-11124
06/30/2021, 5:09 AMstraight-shampoo-11124
06/30/2021, 5:12 AM<<BEGIN>>
and <<ITER>>
) that the progress bar captures. You could wrap this special lines in a nice Python abstraction so you don't have to emit them manually, similar to what tqdm
does internallystraight-shampoo-11124
06/30/2021, 5:15 AM<<BEGIN>>
and <<ITER>>
messages will get saved in logs but so would the progress bar, if it was inside the taskcreamy-leather-49606
06/30/2021, 10:14 AMimportant-jewelry-43189
07/02/2021, 1:20 PM