mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
TPUMTJ: Fix loading bar
I don't know why it works but I know it works
This commit is contained in:
7
utils.py
7
utils.py
@@ -630,6 +630,8 @@ def get_missing_module_names(model: PreTrainedModel, names: List[str]) -> List[s
|
||||
|
||||
class UIProgressBarFile(object):
|
||||
"""Write TQDM progress to the UI."""
|
||||
def __init__(self, emit_func=emit) -> None:
|
||||
self.emit_func = emit_func
|
||||
|
||||
def write(self, bar):
|
||||
bar = bar.replace("\r", "").replace("\n", "").replace(chr(0), "")
|
||||
@@ -638,8 +640,9 @@ class UIProgressBarFile(object):
|
||||
print('\r' + bar, end='')
|
||||
time.sleep(0.01)
|
||||
try:
|
||||
emit('from_server', {'cmd': 'model_load_status', 'data': bar.replace(" ", " ")}, broadcast=True, room="UI_1")
|
||||
except:
|
||||
self.emit_func('from_server', {'cmd': 'model_load_status', 'data': bar.replace(" ", " ")}, broadcast=True, room="UI_1")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
pass
|
||||
|
||||
def flush(self):
|
||||
|
Reference in New Issue
Block a user