mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-02-17 12:10:49 +01:00
Fix for getting "model download status" when downloading config to figure out layer counts
This commit is contained in:
parent
907cf74b13
commit
12acb50ee0
@ -1312,6 +1312,7 @@ def patch_transformers_download():
|
||||
def write(self, bar):
|
||||
bar = bar.replace("\r", "")
|
||||
try:
|
||||
print(bar, end="\r")
|
||||
emit('from_server', {'cmd': 'model_load_status', 'data': bar.replace(" ", " ")}, broadcast=True)
|
||||
eventlet.sleep(seconds=0)
|
||||
except:
|
||||
@ -1336,6 +1337,7 @@ def patch_transformers_download():
|
||||
total = resume_size + int(content_length) if content_length is not None else None
|
||||
# `tqdm` behavior is determined by `utils.logging.is_progress_bar_enabled()`
|
||||
# and can be set using `utils.logging.enable/disable_progress_bar()`
|
||||
if url[-11:] != 'config.json':
|
||||
progress = tqdm.tqdm(
|
||||
unit="B",
|
||||
unit_scale=True,
|
||||
@ -1347,8 +1349,10 @@ def patch_transformers_download():
|
||||
)
|
||||
for chunk in r.iter_content(chunk_size=1024):
|
||||
if chunk: # filter out keep-alive new chunks
|
||||
if url[-11:] != 'config.json':
|
||||
progress.update(len(chunk))
|
||||
temp_file.write(chunk)
|
||||
if url[-11:] != 'config.json':
|
||||
progress.close()
|
||||
|
||||
transformers.utils.hub.http_get = http_get
|
||||
|
Loading…
x
Reference in New Issue
Block a user