From 184b7861169ebb32f0d982ce7ba50eb6ec16febb Mon Sep 17 00:00:00 2001 From: Shine1i Date: Sun, 15 Feb 2026 16:27:44 +0100 Subject: [PATCH] fix setup: fish alias, venv no activate --- setup.sh | 59 +++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 48 insertions(+), 11 deletions(-) diff --git a/setup.sh b/setup.sh index e5a41d371f..63de38b512 100755 --- a/setup.sh +++ b/setup.sh @@ -81,13 +81,17 @@ echo "✅ Frontend built to studio/frontend/dist" # ── 6. Python venv + deps ── echo "" echo "Setting up Python environment..." -python3 -m venv .venv -source .venv/bin/activate -run_quiet "pip upgrade" pip install --upgrade pip +if [ ! -d "$SCRIPT_DIR/.venv" ]; then + python3 -m venv "$SCRIPT_DIR/.venv" +fi + +# Avoid shell-specific activation; call venv python directly. +VENV_PY="$SCRIPT_DIR/.venv/bin/python" +run_quiet "pip upgrade" "$VENV_PY" -m pip install --upgrade pip echo " Installing unsloth-zoo + unsloth..." -run_quiet "pip install unsloth" pip install unsloth-zoo unsloth +run_quiet "pip install unsloth" "$VENV_PY" -m pip install unsloth-zoo unsloth echo " Installing studio dependencies..." -run_quiet "pip install extras" pip install typer fastapi uvicorn pydantic matplotlib pandas nest_asyncio "datasets==4.3.0" pyjwt easydict addict +run_quiet "pip install extras" "$VENV_PY" -m pip install typer fastapi uvicorn pydantic matplotlib pandas nest_asyncio "datasets==4.3.0" pyjwt easydict addict echo "✅ Python dependencies installed" # ── 7. Add shell alias ── @@ -95,23 +99,56 @@ echo "✅ Python dependencies installed" # This alias hardcodes the venv python path so users don't need to activate. echo "" REPO_DIR="$SCRIPT_DIR" +ALIAS_CMD="${REPO_DIR}/.venv/bin/python ${REPO_DIR}/cli.py ui -f ${REPO_DIR}/studio/frontend/dist" -if ! grep -qF "unsloth-ui" ~/.bashrc 2>/dev/null; then - cat >> ~/.bashrc </dev/null; then + cat >> "$FISH_RC" </dev/null; then + cat >> "$ZSH_RC" </dev/null; then + cat >> "$BASH_RC" <