-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_dearpygui_ui.sh
More file actions
executable file
·43 lines (36 loc) · 1.49 KB
/
run_dearpygui_ui.sh
File metadata and controls
executable file
·43 lines (36 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash
# Main script to run the Dear PyGui UI for OneTrainer
set -e
echo "=== OneTrainer Dear PyGui UI Launcher ==="
# Use python3 as backup if python command isn't available
if ! command -v python &> /dev/null && command -v python3 &> /dev/null; then
export OT_PYTHON_CMD="python3"
fi
source "${BASH_SOURCE[0]%/*}/lib.include.sh"
prepare_runtime_environment
# Check if DearPyGui is installed
if ! run_python_in_active_env -c "import dearpygui" &> /dev/null; then
echo "DearPyGui is not installed. Installing..."
run_pip_in_active_env install dearpygui==1.8.0
echo "Installed DearPyGui 1.8.0"
else
# Check version
DPG_VERSION=$(run_python_in_active_env -c "import dearpygui; print(getattr(dearpygui, '__version__', 'unknown'))")
echo "DearPyGui version: $DPG_VERSION"
if [[ "$DPG_VERSION" == "2.0.0" ]]; then
echo "DearPyGui 2.0.0 may have compatibility issues with OneTrainer."
echo "Would you like to install a more compatible version (1.8.0)? (y/n)"
read -r response
if [[ "$response" =~ ^[Yy] ]]; then
echo "Installing DearPyGui 1.8.0..."
run_pip_in_active_env install dearpygui==1.8.0
echo "Installed DearPyGui 1.8.0"
else
echo "Applying compatibility fixes for DearPyGui 2.0.0..."
run_python_in_active_env ./fix_dearpygui_versions.py
fi
fi
fi
# Run the UI
echo "Starting OneTrainer with Dear PyGui interface..."
run_python_in_active_env "./dpg_ui/app.py"