mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Get rid of yet another instance of this identical class
This commit is contained in:
2
model.py
2
model.py
@@ -327,7 +327,7 @@ def patch_transformers_download():
|
||||
desc=f"Downloading {file_name}"
|
||||
if file_name is not None
|
||||
else "Downloading",
|
||||
file=utils.UIProgressBarFile,
|
||||
file=utils.UIProgressBarFile(),
|
||||
)
|
||||
utils.koboldai_vars.status_message = "Download Model"
|
||||
utils.koboldai_vars.total_download_chunks = total
|
||||
|
@@ -127,22 +127,6 @@ def show_spinner(queue):
|
||||
time.sleep(0.1)
|
||||
i += 1
|
||||
|
||||
class Send_to_socketio(object):
|
||||
def write(self, bar):
|
||||
bar = bar.replace("\r", "").replace("\n", "").replace(chr(0), "")
|
||||
if bar != "" and [ord(num) for num in bar] != [27, 91, 65]: #No idea why we're getting the 27, 1, 65 character set, just killing to so we can move on
|
||||
#logger.info(bar)
|
||||
print('\r' + bar, end='')
|
||||
time.sleep(0.01)
|
||||
try:
|
||||
socketio.emit('from_server', {'cmd': 'model_load_status', 'data': bar.replace(" ", " ")}, broadcast=True, room="UI_1")
|
||||
except:
|
||||
pass
|
||||
|
||||
def flush(self):
|
||||
pass
|
||||
|
||||
|
||||
__F = TypeVar("__F", bound=Callable)
|
||||
__T = TypeVar("__T")
|
||||
|
||||
@@ -1031,7 +1015,7 @@ def read_neox_checkpoint(state, path, config, checkpoint_shards=2):
|
||||
if socketio is None:
|
||||
bar = tqdm(total=tqdm_length, desc="Loading from NeoX checkpoint")
|
||||
else:
|
||||
bar = tqdm(total=tqdm_length, desc="Loading from NeoX checkpoint", file=Send_to_socketio())
|
||||
bar = tqdm(total=tqdm_length, desc="Loading from NeoX checkpoint", file=utils.UIProgressBarFile())
|
||||
koboldai_vars.status_message = "Loading TPU"
|
||||
koboldai_vars.total_layers = tqdm_length
|
||||
koboldai_vars.loaded_layers = 0
|
||||
|
Reference in New Issue
Block a user