mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Remove unused file open
This commit is contained in:
@@ -1171,12 +1171,7 @@ def load_model(path: str, model_type: str, badwordsids=koboldai_settings.badword
|
|||||||
if callback.nested:
|
if callback.nested:
|
||||||
return
|
return
|
||||||
callback.nested = True
|
callback.nested = True
|
||||||
with zipfile.ZipFile(f, "r") as z:
|
|
||||||
try:
|
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:
|
if utils.current_shard == 0:
|
||||||
print("\n\n\nThis model has ", f"{hk.data_structures.tree_size(network.state['params']):,d}".replace(",", " "), " parameters.\n")
|
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
|
utils.bar = None
|
||||||
koboldai_vars.status_message = ""
|
koboldai_vars.status_message = ""
|
||||||
callback.nested = False
|
callback.nested = False
|
||||||
if isinstance(f, zipfile.ZipExtFile):
|
|
||||||
f.close()
|
|
||||||
callback.nested = False
|
callback.nested = False
|
||||||
|
|
||||||
if os.path.isdir(koboldai_vars.model.replace('/', '_')):
|
if os.path.isdir(koboldai_vars.model.replace('/', '_')):
|
||||||
|
Reference in New Issue
Block a user