|
19 | 19 | # Script to run lm-evaluation-harness against a running vLLM OpenAI-compatible server. |
20 | 20 | # |
21 | 21 | # Usage: |
22 | | -# bash run_lm_eval_vllm.sh <model_name> [port] [task] |
| 22 | +# bash run_lm_eval_vllm.sh <model_name> [port] [task] [host] |
23 | 23 | # |
24 | 24 | # Arguments: |
25 | 25 | # <model_name>: The name of the model being served (e.g., Qwen/Qwen3-30B-A3B). Used for the 'model' argument in lm_eval. |
26 | 26 | # [port]: The port the vLLM server is listening on (default: 8000). |
27 | 27 | # [task]: The lm_eval task(s) to run (default: mmlu). |
| 28 | +# [host]: The IP address or hostname of the vLLM server (default: localhost). |
28 | 29 | # |
29 | 30 | # Example: |
30 | 31 | # # Start vLLM server first (in another terminal): |
|
35 | 36 | # |
36 | 37 | # # Run for a different task, e.g., hellaswag: |
37 | 38 | # bash run_lm_eval_vllm.sh Qwen/Qwen3-30B-A3B 8000 hellaswag |
| 39 | +# |
| 40 | +# # Run against a remote server: |
| 41 | +# bash run_lm_eval_vllm.sh Qwen/Qwen3-30B-A3B 8000 mmlu 10.78.17.40 |
38 | 42 | # --- |
39 | 43 |
|
40 | 44 | set -e |
41 | 45 | set -x |
42 | 46 |
|
43 | 47 | # --- Argument Parsing --- |
44 | 48 | if [ -z "$1" ]; then |
45 | | - echo "Usage: $0 <model_name> [port] [task]" |
| 49 | + echo "Usage: $0 <model_name> [port] [task] [host]" |
46 | 50 | exit 1 |
47 | 51 | fi |
48 | 52 | MODEL_NAME=$1 |
49 | 53 | PORT=${2:-8000} # Default port is 8000 if not provided |
50 | 54 | TASK=${3:-mmlu} # Default task is mmlu if not provided |
| 55 | +HOST=${4:-localhost} # Default host is localhost if not provided |
51 | 56 |
|
52 | 57 | # --- Environment Setup --- |
53 | 58 | export OPENAI_API_KEY="local" # Not strictly required for local, but good practice |
54 | | -BASE_URL="http://localhost:${PORT}/v1" |
| 59 | +BASE_URL="http://${HOST}:${PORT}/v1" |
55 | 60 | COMPLETIONS_URL="${BASE_URL}/completions" |
56 | 61 |
|
57 | 62 | # --- Evaluation --- |
|
0 commit comments