Spaces:
Runtime error
Runtime error
Update codriao_tb_module.py
Browse files- 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
|
10 |
-
|
|
|
11 |
|
12 |
try:
|
13 |
from tb_image_processor import TBImageProcessor
|
14 |
from tb_audio_processor import TBAudioProcessor
|
15 |
except ModuleNotFoundError:
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
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"""
|