Remove unused file open

This commit is contained in:
somebody
2023-07-03 17:51:54 -05:00
parent 7f869a54d8
commit 32917fd651

View File

@@ -1171,12 +1171,7 @@ def load_model(path: str, model_type: str, badwordsids=koboldai_settings.badword
if callback.nested:
return
callback.nested = True
with zipfile.ZipFile(f, "r") as z:
try:
last_storage_key = None
zipfolder = os.path.basename(os.path.normpath(f)).split('.')[0]
f = None
current_offset = 0
if utils.current_shard == 0:
print("\n\n\nThis model has ", f"{hk.data_structures.tree_size(network.state['params']):,d}".replace(",", " "), " parameters.\n")
@@ -1288,8 +1283,6 @@ def load_model(path: str, model_type: str, badwordsids=koboldai_settings.badword
utils.bar = None
koboldai_vars.status_message = ""
callback.nested = False
if isinstance(f, zipfile.ZipExtFile):
f.close()
callback.nested = False
if os.path.isdir(koboldai_vars.model.replace('/', '_')):