yusufs commited on
Commit
490e6a3
·
1 Parent(s): 69c6372

feat(runner.sh): using MODEL_ID only

Browse files
Files changed (1) hide show
  1. runner.sh +19 -16
runner.sh CHANGED
@@ -1,27 +1,30 @@
1
  #!/bin/bash
2
 
3
- # Check if MODEL_NAME is set and has a valid value
4
- if [[ -z "$MODEL_NAME" ]]; then
5
- echo "Error: MODEL_NAME is not set."
6
  exit 1
7
  fi
8
 
9
- if [[ "$MODEL_NAME" != "meta-llama/Llama-3.2-3B-Instruct" && "$MODEL_NAME" != "sail/Sailor-4B-Chat" ]]; then
10
- echo "Error: Invalid value for MODEL_NAME. Valid values are:"
11
- echo " - meta-llama/Llama-3.2-3B-Instruct"
12
- echo " - sail/Sailor-4B-Chat"
13
- exit 1
14
- fi
15
-
16
- # Check if MODEL_REV is set
17
- if [[ -z "$MODEL_REV" ]]; then
18
- echo "Error: MODEL_REV is not set."
19
- exit 1
20
- fi
 
 
 
21
 
22
  printf "Running %s using vLLM OpenAI compatible API Server at port %s\n" $MODEL_NAME "7860"
23
 
24
- # Run the Python script with the validated environment variables
25
  python -u /app/openai_compatible_api_server.py \
26
  --model "${MODEL_NAME}" \
27
  --revision "${MODEL_REV}" \
 
1
  #!/bin/bash
2
 
3
+ # Validate MODEL_ID
4
+ if [[ -z "$MODEL_ID" ]]; then
5
+ echo "Error: MODEL_ID is not set."
6
  exit 1
7
  fi
8
 
9
+ # Assign MODEL_NAME and MODEL_REV based on MODEL_ID
10
+ case "$MODEL_ID" in
11
+ 1)
12
+ MODEL_NAME="meta-llama/Llama-3.2-3B-Instruct"
13
+ MODEL_REV="0cb88a4f764b7a12671c53f0838cd831a0843b95"
14
+ ;;
15
+ 2)
16
+ MODEL_NAME="sail/Sailor-4B-Chat"
17
+ MODEL_REV="89a866a7041e6ec023dd462adeca8e28dd53c83e"
18
+ ;;
19
+ *)
20
+ echo "Error: Invalid MODEL_ID. Valid values are 1 or 2."
21
+ exit 1
22
+ ;;
23
+ esac
24
 
25
  printf "Running %s using vLLM OpenAI compatible API Server at port %s\n" $MODEL_NAME "7860"
26
 
27
+ # Run the Python script with the determined values
28
  python -u /app/openai_compatible_api_server.py \
29
  --model "${MODEL_NAME}" \
30
  --revision "${MODEL_REV}" \