Don't break if we can't write a file

This commit is contained in:
d8ahazard 2024-07-23 17:56:35 -05:00 committed by GitHub
parent 716f30fecb
commit 45f350239e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -282,9 +282,11 @@ def make_model_folders():
help_file_name = f"Place your {model_type} model files here.txt"
help_file_contents = f'Supported extensions: {" or ".join(MODEL_EXTENSIONS.get(model_type))}'
with open(os.path.join(model_dir_path, help_file_name), "w", encoding="utf-8") as f:
f.write(help_file_contents)
try:
with open(os.path.join(model_dir_path, help_file_name), "w", encoding="utf-8") as f:
f.write(help_file_contents)
except:
pass
def is_malicious_model(file_path):