Make the models dir if required

This commit is contained in:
cmdr2 2022-11-09 16:28:58 +05:30 committed by GitHub
parent 6c1dda47c0
commit 18292e447c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -240,6 +240,9 @@ def getModels():
def listModels(models_dirname, model_type, model_extensions): def listModels(models_dirname, model_type, model_extensions):
models_dir = os.path.join(MODELS_DIR, models_dirname) models_dir = os.path.join(MODELS_DIR, models_dirname)
if not os.path.exists(models_dir):
os.makedirs(models_dir)
for file in os.listdir(models_dir): for file in os.listdir(models_dir):
for model_extension in model_extensions: for model_extension in model_extensions:
if file.endswith(model_extension): if file.endswith(model_extension):