Skip to content

Commit

Permalink
support oe-eval revision
Browse files Browse the repository at this point in the history
vwxyzjn committed Aug 27, 2024
1 parent 27233d7 commit a16cf82
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 12 additions & 2 deletions scripts/eval/oe-eval.sh
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ set -ex

# Function to print usage
usage() {
echo "Usage: $0 --model-name MODEL_NAME --model-location MODEL_LOCATION [--hf-upload]"
echo "Usage: $0 --model-name MODEL_NAME --model-location MODEL_LOCATION [--revision REVISION] [--hf-upload]"
exit 1
}

@@ -41,6 +41,7 @@ while [[ "$#" -gt 0 ]]; do
case $1 in
--model-name) MODEL_NAME="$2"; shift ;;
--model-location) MODEL_LOCATION="$2"; shift ;;
--revision) REVISION="$2"; shift ;;
--hf-upload) HF_UPLOAD="true" ;;
*) echo "Unknown parameter passed: $1"; usage ;;
esac
@@ -58,6 +59,7 @@ MODEL_NAME_SAFE=${MODEL_NAME//\//_}

# Set defaults for optional arguments
HF_UPLOAD="${HF_UPLOAD:-false}"
REVISION="${REVISION:-main}"

# Set HF_UPLOAD_ARG if HF_UPLOAD is true
if [ "$HF_UPLOAD" == "true" ]; then
@@ -83,5 +85,13 @@ for TASK in "${TASKS[@]}"; do
else
BATCH_SIZE=$BATCH_SIZE_VLLM
fi
python oe-eval-internal/oe_eval/launch.py --model "$MODEL_NAME" --beaker-workspace "ai2/tulu-3-results" --beaker-budget ai2/oe-adapt --task "$TASK" $MODEL_TYPE --batch-size "$BATCH_SIZE" --model-args {\"model_path\":\"${MODEL_LOCATION}\"} ${HF_UPLOAD_ARG} --gpus "$GPU_COUNT"
python oe-eval-internal/oe_eval/launch.py \
--revision "$REVISION" \
--model "$MODEL_NAME" \
--beaker-workspace "ai2/tulu-3-results" \
--beaker-budget ai2/oe-adapt \
--task "$TASK" $MODEL_TYPE \
--batch-size "$BATCH_SIZE" \
--model-args {\"model_path\":\"${MODEL_LOCATION}\"} ${HF_UPLOAD_ARG} \
--gpus "$GPU_COUNT"
done
2 changes: 2 additions & 0 deletions scripts/submit_eval_jobs.py
Original file line number Diff line number Diff line change
@@ -579,6 +579,8 @@ def adjust_gpus(task_spec, experiment_group, model_name, gpu_multiplier):
oe_eval_cmd += f" --model-location {model_info[1]}"
else:
oe_eval_cmd += f" --model-location beaker://{model_info[1]}"
if args.hf_revision:
oe_eval_cmd += f" --revision {args.hf_revision}"
subprocess.Popen(oe_eval_cmd, shell=True)

# create an experiment that runs the safety eval tasks

0 comments on commit a16cf82

Please sign in to comment.