mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Colab Fix
This commit is contained in:
@@ -502,7 +502,7 @@ class model_settings(settings):
|
|||||||
self.tqdm_progress = 0
|
self.tqdm_progress = 0
|
||||||
else:
|
else:
|
||||||
self.tqdm.update(value-old_value)
|
self.tqdm.update(value-old_value)
|
||||||
self.tqdm_progress = round(float(self.downloaded_chunks)/float(self.total_download_chunks)*100, 1)
|
self.tqdm_progress = 0 if self.total_download_chunks==0 else round(float(self.downloaded_chunks)/float(self.total_download_chunks)*100, 1)
|
||||||
if self.tqdm.format_dict['rate'] is not None:
|
if self.tqdm.format_dict['rate'] is not None:
|
||||||
self.tqdm_rem_time = str(datetime.timedelta(seconds=int(float(self.total_download_chunks-self.downloaded_chunks)/self.tqdm.format_dict['rate'])))
|
self.tqdm_rem_time = str(datetime.timedelta(seconds=int(float(self.total_download_chunks-self.downloaded_chunks)/self.tqdm.format_dict['rate'])))
|
||||||
|
|
||||||
|
9
utils.py
9
utils.py
@@ -212,10 +212,6 @@ def _download_with_aria2(aria2_config: str, total_length: int, directory: str =
|
|||||||
p.terminate()
|
p.terminate()
|
||||||
done = True
|
done = True
|
||||||
break
|
break
|
||||||
if bar is None:
|
|
||||||
bar = tqdm(total=total_length, desc=f"[aria2] Downloading model", unit="B", unit_scale=True, unit_divisor=1000)
|
|
||||||
koboldai_vars.total_download_chunks = total_length
|
|
||||||
visited = set()
|
|
||||||
for x in r:
|
for x in r:
|
||||||
filename = x["files"][0]["path"]
|
filename = x["files"][0]["path"]
|
||||||
lengths[filename] = (int(x["completedLength"]), int(x["totalLength"]))
|
lengths[filename] = (int(x["completedLength"]), int(x["totalLength"]))
|
||||||
@@ -223,8 +219,11 @@ def _download_with_aria2(aria2_config: str, total_length: int, directory: str =
|
|||||||
for k, v in lengths.items():
|
for k, v in lengths.items():
|
||||||
if k not in visited:
|
if k not in visited:
|
||||||
lengths[k] = (v[1], v[1])
|
lengths[k] = (v[1], v[1])
|
||||||
koboldai_vars.downloaded_chunks = sum(v[0] for v in lengths.values())
|
if bar is None:
|
||||||
|
bar = tqdm(total=total_length, desc=f"[aria2] Downloading model", unit="B", unit_scale=True, unit_divisor=1000)
|
||||||
koboldai_vars.total_download_chunks = sum(v[1] for v in lengths.values())
|
koboldai_vars.total_download_chunks = sum(v[1] for v in lengths.values())
|
||||||
|
visited = set()
|
||||||
|
koboldai_vars.downloaded_chunks = sum(v[0] for v in lengths.values())
|
||||||
bar.n = koboldai_vars.downloaded_chunks
|
bar.n = koboldai_vars.downloaded_chunks
|
||||||
bar.update()
|
bar.update()
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
Reference in New Issue
Block a user