From 5f0ada21bf8ac8a69231f28cc40b1aa59bfcaeb4 Mon Sep 17 00:00:00 2001 From: Dmitry Wolf Date: Thu, 16 Mar 2023 00:30:07 +0300 Subject: [PATCH] fix --- convert-pth-to-ggml.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/convert-pth-to-ggml.py b/convert-pth-to-ggml.py index db30a7e1f..bef3618cb 100644 --- a/convert-pth-to-ggml.py +++ b/convert-pth-to-ggml.py @@ -184,12 +184,15 @@ def process_part(p): def writer(): while True: item = q.get() + if item is None: + q.task_done() + break fout.write(item.getvalue()) q.task_done() threading.Thread(target=writer, daemon=True).start() - for k, v in (t := tqdm(model.items())): + for k, v in (t := tqdm(model.items(), bar_format="{r_bar} {percentage:3.0f}% |{bar:50} | {desc}")): t.set_description(f"Processing {k} with shape {tuple(v.shape)} and type {np.dtype(v.dtype)}") name = k shape = v.shape @@ -235,6 +238,7 @@ def process_part(p): memout.write(data.tobytes()) q.put(memout) + q.put(None) q.join() model = None