File size: 1,282 Bytes
24c2665
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash

# Default values
MODEL_PATH="andrewzh/Absolute_Zero_Reasoner-Coder-7b"
CUDA_GPU_ID="0"
NUM_GPUS=1
BATCH_SIZE=128
N=1
TEMPERATURE=0.0
TOP_P=1.0
MAX_TOKENS=8096

# Parse command-line arguments
while [[ $# -gt 0 ]]; do
  case $1 in
    -m|--model)
      MODEL_PATH="$2"
      shift 2
      ;;
    -g|--gpu)
      CUDA_GPU_ID="$2"
      shift 2
      ;;
    -n|--n)
      N="$2"
      shift 2
      ;;
    -t|--temperature)
      TEMPERATURE="$2"
      shift 2
      ;;
    -p|--top_p)
      TOP_P="$2"
      shift 2
      ;;
    -b|--batch_size)
      BATCH_SIZE="$2"
      shift 2
      ;;
    -k|--max_tokens)
      MAX_TOKENS="$2"
      shift 2
      ;;
    *)
      # Unknown option
      shift
      ;;
  esac
done

cd evaluation/code_eval/coding/LiveCodeBench

# Run LiveCodeBench with the AZR template and a local model
CUDA_VISIBLE_DEVICES=$CUDA_GPU_ID python -m lcb_runner.runner.main \
  --model $MODEL_PATH \
  --trust_remote_code \
  --scenario codegeneration \
  --release_version release_v6 \
  --tensor_parallel_size $NUM_GPUS \
  --use_cache \
  --n $N \
  --temperature $TEMPERATURE \
  --max_tokens $MAX_TOKENS \
  --custom_output_save_name $MODEL_PATH \
  --top_p $TOP_P \
  --timeout 60 \
  --evaluate --continue_existing --continue_existing_with_eval