Spaces:
Running
Running
File size: 901 Bytes
ad427b2 4fe16fe 56b174a |
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 |
#!/bin/bash
# Initialize variables with default values
model=""
revision="main"
port=5000
api_key=""
# Function to display help message
usage() {
echo "Usage: $0 --name <model_name> --api-key <api_key> [--revision <revision>] [--port <port>]"
exit 1
}
# Parse command-line arguments
while [[ $# -gt 0 ]]; do
case $1 in
--name)
model="$2"
shift 2
;;
--api-key)
api_key="$2"
shift 2
;;
--revision)
revision="$2"
shift 2
;;
--port)
port="$2"
shift 2
;;
*)
usage
;;
esac
done
# Check if mandatory arguments are provided
if [[ -z "$model" || -z "$api_key" ]]; then
usage
fi
# Run the Python command with the provided arguments
python -m vllm.entrypoints.openai.api_server --model "$model" --revision "$revision" --port "$port" --api-key "$api_key" --served-model-name "$model@$revision"
|