Fix for older model loading
This commit is contained in:
parent
62921c4896
commit
908dc8ea60
10
aiserver.py
10
aiserver.py
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue