codewithdark commited on
Commit
784f547
·
verified ·
1 Parent(s): 862fa65

Update utility/conf.py

Browse files
Files changed (1) hide show
  1. utility/conf.py +15 -14
utility/conf.py CHANGED
@@ -1,14 +1,15 @@
1
- import os
2
- import logging
3
- from pathlib import Path
4
-
5
- logger = logging.getLogger(__name__)
6
-
7
- # ImageMagick configuration
8
- IMAGEMAGICK_BINARY = r"C:\Program Files\ImageMagick-7.1.1-Q16-HDRI\magick.exe"
9
-
10
- # Validate ImageMagick path
11
- if not Path(IMAGEMAGICK_BINARY).exists():
12
- error_msg = f"ImageMagick not found at {IMAGEMAGICK_BINARY}. Please install ImageMagick and update the path."
13
- logger.error(error_msg)
14
- raise FileNotFoundError(error_msg)
 
 
1
+ import os
2
+ import logging
3
+ from pathlib import Path
4
+
5
+ logger = logging.getLogger(__name__)
6
+
7
+ # ImageMagick configuration for Hugging Face Spaces
8
+ os.environ['IMAGEMAGICK_BINARY'] = '/usr/bin/magick'
9
+ IMAGEMAGICK_BINARY = '/usr/bin/magick'
10
+
11
+ # Validate ImageMagick path
12
+ if not Path(IMAGEMAGICK_BINARY).exists():
13
+ error_msg = f"ImageMagick not found at {IMAGEMAGICK_BINARY}. Please check the installation."
14
+ logger.error(error_msg)
15
+ raise FileNotFoundError(error_msg)