Fix for older model loading

This commit is contained in:
ebolam 2022-09-27 15:59:56 -04:00
parent 62921c4896
commit 908dc8ea60
1 changed files with 1 additions and 9 deletions

View File

@ -730,15 +730,7 @@ def getModelSelection(modellist):
getModelSelection(mainmenu)
def check_if_dir_is_model(path):
if os.path.exists(path):
try:
from transformers import AutoConfig
model_config = AutoConfig.from_pretrained(path)
except:
return False
return True
else:
return False
return os.path.exists(os.path.join(path, 'config.json')):
#==================================================================#
# Return all keys in tokenizer dictionary containing char