Raiff1982 commited on
Commit
967e35f
·
verified ·
1 Parent(s): bfb010a

Update codriao_tb_module.py

Browse files
Files changed (1) hide show
  1. codriao_tb_module.py +10 -5
codriao_tb_module.py CHANGED
@@ -6,16 +6,21 @@ if TYPE_CHECKING:
6
  import sys
7
  import os
8
 
9
- # Ensure Python can find the TB processors
10
- sys.path.append(os.path.dirname(os.path.abspath(__file__)))
 
11
 
12
  try:
13
  from tb_image_processor import TBImageProcessor
14
  from tb_audio_processor import TBAudioProcessor
15
  except ModuleNotFoundError:
16
- raise ImportError("Could not locate tb_image_processor.py or tb_audio_processor.py. Ensure they are in the root directory or 'modules/'.")
17
-
18
- logger = logging.getLogger(__name__)
 
 
 
 
19
 
20
  class CodriaoHealthModule:
21
  """Embedded compassionate TB detection within Codriao's architecture"""
 
6
  import sys
7
  import os
8
 
9
+ # Ensure Python can detect the correct module location
10
+ BASE_DIR = os.path.dirname(os.path.abspath(__file__))
11
+ sys.path.append(BASE_DIR) # Adds the directory to Python’s path
12
 
13
  try:
14
  from tb_image_processor import TBImageProcessor
15
  from tb_audio_processor import TBAudioProcessor
16
  except ModuleNotFoundError:
17
+ # Try importing from 'modules' if files are inside it
18
+ sys.path.append(os.path.join(BASE_DIR, "modules"))
19
+ try:
20
+ from modules.tb_image_processor import TBImageProcessor
21
+ from modules.tb_audio_processor import TBAudioProcessor
22
+ except ModuleNotFoundError:
23
+ raise ImportError("❌ Could not locate tb_image_processor.py or tb_audio_processor.py. Ensure they are in the root directory or inside 'modules/'.")
24
 
25
  class CodriaoHealthModule:
26
  """Embedded compassionate TB detection within Codriao's architecture"""