v2-zeroshot: verify eval env by import
Browse files- v2-zeroshot/src/run.sh +5 -1
v2-zeroshot/src/run.sh
CHANGED
|
@@ -19,7 +19,10 @@ retry() { for i in 1 2 3 4 5 6; do "$@" && return 0; echo "attempt $i failed: $1
|
|
| 19 |
note "booted"
|
| 20 |
# The guard must start after "booted" overwrites progress.json, or it would act on a stale FAILED note.
|
| 21 |
pgrep -f "bash $W/guard.sh" >/dev/null || { setsid nohup bash $W/guard.sh >/dev/null 2>&1 < /dev/null & }
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
| 23 |
EVENV=$!
|
| 24 |
if [ ! -f $M/data ]; then
|
| 25 |
( uv run --no-sync python $W/train_v2zs.py --smoke --out $W/out > $W/smoke.log 2>&1 && touch $M/smoke ) &
|
|
@@ -46,6 +49,7 @@ api.upload_folder(folder_path='$W/out/stage3', repo_id=r, commit_message='Zero-s
|
|
| 46 |
touch $M/upload; note "model uploaded"
|
| 47 |
fi
|
| 48 |
wait $EVENV
|
|
|
|
| 49 |
if [ ! -f $M/eval ]; then
|
| 50 |
note "eval started"
|
| 51 |
$W/evenv/bin/python $W/eval_v2zs.py $W/out/stage3 >> $W/eval.log 2>&1 || fail eval
|
|
|
|
| 19 |
note "booted"
|
| 20 |
# The guard must start after "booted" overwrites progress.json, or it would act on a stale FAILED note.
|
| 21 |
pgrep -f "bash $W/guard.sh" >/dev/null || { setsid nohup bash $W/guard.sh >/dev/null 2>&1 < /dev/null & }
|
| 22 |
+
# Check the packages, not the folder: an interrupted install leaves a venv without them.
|
| 23 |
+
evenv_ok() { $W/evenv/bin/python -c "import mteb, sentence_transformers, torch" 2>/dev/null; }
|
| 24 |
+
install_evenv() { rm -rf $W/evenv && uv venv -q -p 3.12 $W/evenv && uv pip install -q -p $W/evenv "torch==2.6.0" "mteb==2.26.17" "sentence-transformers==6.2.0" "transformers==5.20.2"; }
|
| 25 |
+
evenv_ok || ( retry install_evenv > $W/evenv.log 2>&1 ) &
|
| 26 |
EVENV=$!
|
| 27 |
if [ ! -f $M/data ]; then
|
| 28 |
( uv run --no-sync python $W/train_v2zs.py --smoke --out $W/out > $W/smoke.log 2>&1 && touch $M/smoke ) &
|
|
|
|
| 49 |
touch $M/upload; note "model uploaded"
|
| 50 |
fi
|
| 51 |
wait $EVENV
|
| 52 |
+
evenv_ok || fail evenv
|
| 53 |
if [ ! -f $M/eval ]; then
|
| 54 |
note "eval started"
|
| 55 |
$W/evenv/bin/python $W/eval_v2zs.py $W/out/stage3 >> $W/eval.log 2>&1 || fail eval
|