no module named robomme
Browse files- gradio-web/main.py +7 -0
- gradio-web/process_session.py +3 -0
gradio-web/main.py
CHANGED
|
@@ -8,10 +8,16 @@ from pathlib import Path
|
|
| 8 |
|
| 9 |
APP_DIR = Path(__file__).resolve().parent
|
| 10 |
PROJECT_ROOT = APP_DIR.parent
|
|
|
|
| 11 |
VIDEOS_DIR = APP_DIR / "videos"
|
| 12 |
TEMP_DEMOS_DIR = PROJECT_ROOT / "temp_demos"
|
| 13 |
CWD_TEMP_DEMOS_DIR = Path.cwd() / "temp_demos"
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
def setup_logging() -> logging.Logger:
|
| 17 |
"""Configure structured logging for Spaces runtime."""
|
|
@@ -103,6 +109,7 @@ def main():
|
|
| 103 |
server_port,
|
| 104 |
os.environ.get("ROBOMME_TEMP_DEMOS_DIR"),
|
| 105 |
)
|
|
|
|
| 106 |
|
| 107 |
demo = create_ui_blocks()
|
| 108 |
demo.launch(
|
|
|
|
| 8 |
|
| 9 |
APP_DIR = Path(__file__).resolve().parent
|
| 10 |
PROJECT_ROOT = APP_DIR.parent
|
| 11 |
+
SRC_DIR = PROJECT_ROOT / "src"
|
| 12 |
VIDEOS_DIR = APP_DIR / "videos"
|
| 13 |
TEMP_DEMOS_DIR = PROJECT_ROOT / "temp_demos"
|
| 14 |
CWD_TEMP_DEMOS_DIR = Path.cwd() / "temp_demos"
|
| 15 |
|
| 16 |
+
if str(PROJECT_ROOT) not in sys.path:
|
| 17 |
+
sys.path.insert(0, str(PROJECT_ROOT))
|
| 18 |
+
if str(SRC_DIR) not in sys.path:
|
| 19 |
+
sys.path.insert(0, str(SRC_DIR))
|
| 20 |
+
|
| 21 |
|
| 22 |
def setup_logging() -> logging.Logger:
|
| 23 |
"""Configure structured logging for Spaces runtime."""
|
|
|
|
| 109 |
server_port,
|
| 110 |
os.environ.get("ROBOMME_TEMP_DEMOS_DIR"),
|
| 111 |
)
|
| 112 |
+
LOGGER.debug("Python path head entries: %s", sys.path[:5])
|
| 113 |
|
| 114 |
demo = create_ui_blocks()
|
| 115 |
demo.launch(
|
gradio-web/process_session.py
CHANGED
|
@@ -21,8 +21,11 @@ import os
|
|
| 21 |
# 添加父目录到路径(逻辑复制自 oracle_logic.py)
|
| 22 |
current_dir = os.path.dirname(os.path.abspath(__file__))
|
| 23 |
parent_dir = os.path.dirname(current_dir)
|
|
|
|
| 24 |
if parent_dir not in sys.path:
|
| 25 |
sys.path.insert(0, parent_dir)
|
|
|
|
|
|
|
| 26 |
|
| 27 |
from oracle_logic import OracleSession, DEFAULT_DATASET_ROOT
|
| 28 |
|
|
|
|
| 21 |
# 添加父目录到路径(逻辑复制自 oracle_logic.py)
|
| 22 |
current_dir = os.path.dirname(os.path.abspath(__file__))
|
| 23 |
parent_dir = os.path.dirname(current_dir)
|
| 24 |
+
src_dir = os.path.join(parent_dir, "src")
|
| 25 |
if parent_dir not in sys.path:
|
| 26 |
sys.path.insert(0, parent_dir)
|
| 27 |
+
if src_dir not in sys.path:
|
| 28 |
+
sys.path.insert(0, src_dir)
|
| 29 |
|
| 30 |
from oracle_logic import OracleSession, DEFAULT_DATASET_ROOT
|
| 31 |
|