refactor: opencode
This commit is contained in:
parent
09c5b30f15
commit
91d67b2e12
12 changed files with 1843 additions and 77 deletions
43
scripts/rebuild-venv.sh
Normal file
43
scripts/rebuild-venv.sh
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#!/usr/bin/env bash
|
||||
# Rebuild iai-mcp venv for non-AVX CPU (no AVX support on this machine)
|
||||
# Run from repo root: bash scripts/rebuild-venv.sh
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
||||
cd "${REPO_ROOT}"
|
||||
|
||||
VENV_PATH="${HOME}/.venv/iai-mcp"
|
||||
|
||||
echo "==> Removing old venv"
|
||||
rm -rf "${VENV_PATH}"
|
||||
|
||||
echo "==> Creating fresh venv"
|
||||
/usr/bin/python3.12 -m venv "${VENV_PATH}"
|
||||
|
||||
echo "==> Upgrading pip"
|
||||
"${VENV_PATH}"/bin/pip install --quiet --upgrade pip
|
||||
|
||||
echo "==> Installing torch CPU-only (no AVX needed)"
|
||||
"${VENV_PATH}"/bin/pip install --quiet \
|
||||
--extra-index-url https://download.pytorch.org/whl/cpu \
|
||||
torch torchvision torchaudio
|
||||
|
||||
echo "==> Installing iai-mcp dependencies"
|
||||
"${VENV_PATH}"/bin/pip install --quiet -e .
|
||||
|
||||
echo "==> Building TS wrapper"
|
||||
if [ -d mcp-wrapper ]; then
|
||||
pushd mcp-wrapper >/dev/null
|
||||
npm ci --silent --no-audit --no-fund
|
||||
npm run build --silent
|
||||
popd >/dev/null
|
||||
echo " ✓ mcp-wrapper/dist built"
|
||||
else
|
||||
echo " ! mcp-wrapper/ missing"
|
||||
fi
|
||||
|
||||
echo "==> Done"
|
||||
echo " venv: ${VENV_PATH}"
|
||||
echo " test: ${VENV_PATH}/bin/python -c 'import torch; print(torch.__version__)'"
|
||||
Loading…
Add table
Add a link
Reference in a new issue