Update modules/processors/frame/face_swapper.py
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>pull/1189/head
parent
b7e011f5e7
commit
ae88412aae
|
@ -31,8 +31,12 @@ def pre_check() -> bool:
|
||||||
# Use models_dir instead of abs_dir to save to the correct location
|
# Use models_dir instead of abs_dir to save to the correct location
|
||||||
download_directory_path = models_dir
|
download_directory_path = models_dir
|
||||||
|
|
||||||
# Make sure the models directory exists
|
# Make sure the models directory exists, catch permission errors if they occur
|
||||||
|
try:
|
||||||
os.makedirs(download_directory_path, exist_ok=True)
|
os.makedirs(download_directory_path, exist_ok=True)
|
||||||
|
except PermissionError as e:
|
||||||
|
logging.error(f"Failed to create directory {download_directory_path} due to permission error: {e}")
|
||||||
|
return False
|
||||||
|
|
||||||
# Use the direct download URL from Hugging Face
|
# Use the direct download URL from Hugging Face
|
||||||
conditional_download(
|
conditional_download(
|
||||||
|
|
Loading…
Reference in New Issue