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
commit d772837ad0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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