huggingface / tokenizers

💥 Fast State-of-the-Art Tokenizers optimized for Research and Production
https://huggingface.co/docs/tokenizers
Apache License 2.0
8.67k stars 743 forks source link

Progress bar doesn't show in log file. #1559

Open amssljc opened 1 week ago

amssljc commented 1 week ago

If not redirect it to my log file, it's all OK.

root@5b325f584bab:/data/project/# python -u ./src/tokenizing.py --vocab_size 20000
Processing:   2%|███▏                                                                                                                                                          | 458702/22828272 [00:31<25:29, 14628.06examples/s]
Training BPE:   0%|                                                                                                                                                                                       | 0/459 [00:00<?, ?it/s]
Training BPE: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 459/459 [00:38<00:00, 11.97it/s]
[00:00:41] Pre-processing sequences       ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ 22828272 / 22828272
[00:03:46] Tokenize words                 ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ 458702   /   458702
[00:00:16] Count pairs                    ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ 458702   /   458702
[00:11:52] Compute merges                 ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2        /    20000

But if i want to run script at backend, and print it to log file, some progress bar disappear!

nohup python -u ./src/tokenizing.py --vocab_size 20000 > ./log/log.tokenizing &

The output is as following:


Processing:   0%|          | 0/22828272 [00:00<?, ?examples/s]

Processing:   0%|          | 1/22828272 [00:00<4290:40:29,  1.48examples/s]

Processing:   0%|          | 3000/22828272 [00:00<1:13:41, 5162.61examples/s]

Processing:   0%|          | 7551/22828272 [00:00<28:58, 13124.60examples/s] 
Processing:   0%|          | 9999/22828272 [00:00<36:39, 10376.33examples/s]0:00<00:06,  1.36it/s]
Training BPE:  50%|█████     | 5/10 [00:00<00:00,  7.65it/s]
Training BPE:  90%|█████████ | 9/10 [00:00<00:00, 13.73it/s]
Training BPE: 100%|██████████| 10/10 [00:00<00:00, 10.34it/s]

The real thing i want to do is to estimate the run time of BPE algorithm on my dataset (~100G). If i cant see the progress bar, i don't know when to wait for.

ArthurZucker commented 1 week ago

Hey! Do you mean that the number are updated but not the bar ? 😓

amssljc commented 1 week ago

@ArthurZucker Sorry for causing misunderstanding, i mean these lines disapper:

[00:00:41] Pre-processing sequences       ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ 22828272 / 22828272
[00:03:46] Tokenize words                 ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ 458702   /   458702
[00:00:16] Count pairs                    ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ 458702   /   458702
[00:11:52] Compute merges                 ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2        /    20000

maybe i think the reason is that the computing part is coding by Rust?