codewithdark's picture
Update utility/conf.py
784f547 verified
raw
history blame contribute delete
468 Bytes
import os
import logging
from pathlib import Path
logger = logging.getLogger(__name__)
# ImageMagick configuration for Hugging Face Spaces
os.environ['IMAGEMAGICK_BINARY'] = '/usr/bin/magick'
IMAGEMAGICK_BINARY = '/usr/bin/magick'
# Validate ImageMagick path
if not Path(IMAGEMAGICK_BINARY).exists():
error_msg = f"ImageMagick not found at {IMAGEMAGICK_BINARY}. Please check the installation."
logger.error(error_msg)
raise FileNotFoundError(error_msg)