-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.command
More file actions
executable file
·20 lines (20 loc) · 1.24 KB
/
Copy pathrun.command
File metadata and controls
executable file
·20 lines (20 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
set -euo pipefail
source "$(cd -- "$(dirname -- "$0")" && pwd -P)/environment.sh"
if [[ ! -x "$QWEN_ROOT/.venv/bin/python" ]] || ! qwen_select_python; then
printf 'Окружение не найдено. Сначала запустите install.command в этой папке.\n' >&2
exit 1
fi
qwen_check_python
# Rebind venv metadata after moving the folder; no packages are installed here.
QWEN_PREVIOUS_ROOT=""
if [[ -f "$QWEN_ROOT/data/cache/venv-root.txt" ]]; then
IFS= read -r QWEN_PREVIOUS_ROOT < "$QWEN_ROOT/data/cache/venv-root.txt" || true
fi
if [[ "$QWEN_PREVIOUS_ROOT" != "$QWEN_ROOT" ]]; then
"$QWEN_PYTHON" -m venv --copies --without-pip "$QWEN_ROOT/.venv"
printf '%s\n' "$QWEN_ROOT" > "$QWEN_ROOT/data/cache/venv-root.txt"
fi
printf 'После сообщения о готовности интерфейс автоматически откроется в браузере.\nЕсли вкладка не появилась, откройте http://127.0.0.1:7860 вручную.\nЗавершение всего приложения: Control+C в этом окне.\n'
QWEN_RUN_LOG="$QWEN_ROOT/data/logs/console-$(date +%Y%m%d-%H%M%S)-$$.log"
"$QWEN_ROOT/.venv/bin/python" -u "$QWEN_ROOT/app.py" 2>&1 | tee "$QWEN_RUN_LOG"