支持自定义PIXELLE_VIDEO_ROOT
This commit is contained in:
@@ -18,6 +18,9 @@ cd /d "%PROJECT_ROOT%"
|
||||
:: Set PYTHONPATH to project root for module imports
|
||||
set "PYTHONPATH=%PROJECT_ROOT%"
|
||||
|
||||
:: Set PIXELLE_VIDEO_ROOT environment variable for reliable path resolution
|
||||
set "PIXELLE_VIDEO_ROOT=%PROJECT_ROOT%"
|
||||
|
||||
:: Start Web UI
|
||||
echo [Starting] Launching Pixelle-Video Web UI...
|
||||
echo Browser will open at: http://localhost:8501
|
||||
|
||||
@@ -18,6 +18,9 @@ cd /d "%PROJECT_ROOT%"
|
||||
:: Set PYTHONPATH to project root for module imports
|
||||
set "PYTHONPATH=%PROJECT_ROOT%"
|
||||
|
||||
:: Set PIXELLE_VIDEO_ROOT environment variable for reliable path resolution
|
||||
set "PIXELLE_VIDEO_ROOT=%PROJECT_ROOT%"
|
||||
|
||||
:: Start API Server
|
||||
echo [Starting] Launching Pixelle-Video API Server...
|
||||
echo API will be available at: http://localhost:8000
|
||||
|
||||
@@ -18,6 +18,9 @@ cd /d "%PROJECT_ROOT%"
|
||||
:: Set PYTHONPATH to project root for module imports
|
||||
set "PYTHONPATH=%PROJECT_ROOT%"
|
||||
|
||||
:: Set PIXELLE_VIDEO_ROOT environment variable for reliable path resolution
|
||||
set "PIXELLE_VIDEO_ROOT=%PROJECT_ROOT%"
|
||||
|
||||
:: Start Web UI (Standalone mode)
|
||||
echo [Starting] Launching Pixelle-Video Web UI (Standalone)...
|
||||
echo Browser will open at: http://localhost:8501
|
||||
|
||||
@@ -26,11 +26,21 @@ from typing import Optional, Tuple, Literal
|
||||
|
||||
def get_pixelle_video_root_path() -> str:
|
||||
"""
|
||||
Get Pixelle-Video root path - current working directory
|
||||
Get Pixelle-Video root path
|
||||
|
||||
Uses PIXELLE_VIDEO_ROOT environment variable to determine project root.
|
||||
This ensures reliable path resolution in both development and packaged environments.
|
||||
|
||||
Returns:
|
||||
Current working directory as string
|
||||
Project root path as string
|
||||
"""
|
||||
# Check environment variable (required for reliable operation)
|
||||
env_root = os.environ.get("PIXELLE_VIDEO_ROOT")
|
||||
if env_root and Path(env_root).exists():
|
||||
return str(Path(env_root).resolve())
|
||||
|
||||
# Fallback to current working directory if environment variable not set
|
||||
# (for development environments where env var might not be set)
|
||||
return str(Path.cwd())
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user