File: codex_setup.sh

package info (click to toggle)
pytorch 2.9.1%2Bdfsg-1~exp2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 180,096 kB
  • sloc: python: 1,473,255; cpp: 942,030; ansic: 79,796; asm: 7,754; javascript: 2,502; java: 1,962; sh: 1,809; makefile: 628; xml: 8
file content (14 lines) | stat: -rwxr-xr-x 784 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
set -ex
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
uv pip install numpy
lintrunner init
NIGHTLY_PATCH=$(curl -s https://github.com/pytorch/pytorch/commit/nightly.patch | head -n20)
COMMIT=$(grep -oE '[0-9a-f]{40}' <<< "$NIGHTLY_PATCH" | head -1)
COMMIT_DATE=$(echo "$NIGHTLY_PATCH" | grep '^Date:' | sed -E 's/Date: .*, ([0-9]+) ([A-Za-z]+) ([0-9]+) .*/\3 \2 \1/' | awk 'BEGIN{split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec", months, " "); for(i=1;i<=12;i++) month[months[i]]=sprintf("%02d",i)} {print $1 month[$2] sprintf("%02d",$3)}')
VERSION_STRING="2.9.0.dev${COMMIT_DATE}+cpu"
git rev-parse HEAD > /tmp/orig_work.txt
git reset --hard $COMMIT
USE_NIGHTLY=$VERSION_STRING python setup.py develop
echo "source $PWD/.venv/bin/activate" >> ~/.bashrc