-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
textbase tqdm bar does not display correctly #15701
Comments
@ydmykr Personal NotesPython code used from time import sleep
from tqdm import tqdm
# from tqdm.notebook import tqdm
for i in tqdm(range(2)):
for j in tqdm(range(5), leave=False):
sleep(1.1) This produced the following outputs, Tested the following code in vscode to compress the outputs using Looks like some race condition in displaying the outputs or the like. const lines = [
"\r 0%| | 0/2 [00:00<?, ?it/s]",
"\n",
"\r 0%| | 0/5 [00:00<?, ?it/s]",
"\u001b[A",
"\n",
"\r 20%|██ | 1/5 [00:00<00:00, 9.59it/s]",
"\u001b[A",
"\n",
"\r 40%|████ | 2/5 [00:00<00:00, 9.48it/s]",
"\u001b[A",
"\n",
"\r 60%|██████ | 3/5 [00:00<00:00, 9.57it/s]",
"\u001b[A",
"\n",
"\r 80%|████████ | 4/5 [00:00<00:00, 9.49it/s]",
"\u001b[A",
"\n",
"\r100%|██████████| 5/5 [00:00<00:00, 9.55it/s]",
"\u001b[A",
"\n",
"\r ",
"\u001b[A",
"\r 50%|█████ | 1/2 [00:00<00:00, 1.90it/s]",
"\n",
"\r 0%| | 0/5 [00:00<?, ?it/s]",
"\u001b[A",
"\n",
"\r 20%|██ | 1/5 [00:00<00:00, 9.72it/s]",
"\u001b[A",
"\n",
"\r 40%|████ | 2/5 [00:00<00:00, 9.55it/s]",
"\u001b[A",
"\n",
"\r 60%|██████ | 3/5 [00:00<00:00, 9.39it/s]",
"\u001b[A",
"\n",
"\r 80%|████████ | 4/5 [00:00<00:00, 8.84it/s]",
"\u001b[A",
"\n",
"\r100%|██████████| 5/5 [00:00<00:00, 9.14it/s]",
// "\u001b[A",
"\n",
"\r ",
"\u001b[A",
"\r100%|██████████| 2/2 [00:01<00:00, 1.86it/s]",
"\r100%|██████████| 2/2 [00:01<00:00, 1.86it/s]",
"\n",
];
let result = valueBytesFromString("");
let value = "";
lines.forEach((line) => {
result = compressOutputItemStreams([result.buffer, valueBytesFromString(line).buffer]).data;
value = result.buffer.toString();
console.log(value);
});
value = result.buffer.toString().toString(); |
WORK AROUNDimport from time import sleep
from tqdm.notebook import tqdm
for i in tqdm(range(100)):
for j in tqdm(range(10), leave=False):
sleep(0.1) |
Thank you for looking into this (minor) issue. Schermopname.2024-08-02.om.13.30.03.mov |
The workaround works for me in VS Code on Windows: Version info: vs code:
conda environment:
|
tqdm has been really unreliable on vscode notebooks lately, it stops working suddenly, like it will render on previous cell and will stop working at next cell 🤷 not sure if issue with ipywidgets,tqdm or vscode. |
Sorry you are running into this and thank you for sharing this information. |
Here's the codes:
When running in the terminal, it shows correctly. It returns two progress bars, one for the
i
and one for thej
in the loop.However, when running in the jupyter notebook or Interactive Window, only the outermost
i
loop is displayed, and the progress bar of thej
loop contained therein is not displayed.The text was updated successfully, but these errors were encountered: