Merge pull request #217 from ebolam/united

Fix for older model loading
This commit is contained in:
henk717
2022-09-27 22:41:13 +02:00
committed by GitHub

View File

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