Skip to content

Commit c9532db

Browse files
committed
Making sure bool type is passed as bool in our tests
1 parent 501f74d commit c9532db

File tree

3 files changed

+26
-9
lines changed

3 files changed

+26
-9
lines changed

ci/L0_multi_gpu/multi_lora/test.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ export SERVER_ENABLE_LORA=true
5555
model_json=$(cat <<EOF
5656
{
5757
"model":"./weights/backbone/gemma-2b",
58-
"disable_log_requests": "true",
58+
"disable_log_requests": true,
5959
"gpu_memory_utilization": 0.7,
6060
"tensor_parallel_size": 2,
6161
"block_size": 16,
62-
"enforce_eager": "true",
63-
"enable_lora": "true",
62+
"enforce_eager": true,
63+
"enable_lora": true,
6464
"max_lora_rank": 32,
6565
"lora_extra_vocab_size": 256,
6666
"distributed_executor_backend":"ray"
@@ -115,12 +115,12 @@ export SERVER_ENABLE_LORA=false
115115
model_json=$(cat <<EOF
116116
{
117117
"model":"./weights/backbone/gemma-2b",
118-
"disable_log_requests": "true",
118+
"disable_log_requests": true,
119119
"gpu_memory_utilization": 0.8,
120120
"tensor_parallel_size": 2,
121121
"block_size": 16,
122-
"enforce_eager": "true",
123-
"enable_lora": "false",
122+
"enforce_eager": true,
123+
"enable_lora": false,
124124
"lora_extra_vocab_size": 256,
125125
"distributed_executor_backend":"ray"
126126
}

samples/model_repository/vllm_model/config.pbtxt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,10 @@ instance_group [
3535
kind: KIND_MODEL
3636
}
3737
]
38+
39+
parameters: {
40+
key: "REPORT_CUSTOM_METRICS"
41+
value: {
42+
string_value:"yes"
43+
}
44+
}

src/model.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,19 @@ def init_engine(self):
187187
def setup_lora(self):
188188
self.enable_lora = False
189189

190-
if (
191-
"enable_lora" in self.vllm_engine_config.keys()
192-
and self.vllm_engine_config["enable_lora"].lower() == "true"
190+
# Check if `enable_lora` field is in the `model.json`,
191+
# and if it is, read its contents, which can be string or bool.
192+
if "enable_lora" in self.vllm_engine_config.keys() and (
193+
(
194+
isinstance(self.vllm_engine_config["enable_lora"], str)
195+
and self.vllm_engine_config["enable_lora"].lower() == "true"
196+
)
197+
or (
198+
(
199+
isinstance(self.vllm_engine_config["enable_lora"], bool)
200+
and self.vllm_engine_config["enable_lora"]
201+
)
202+
)
193203
):
194204
# create Triton LoRA weights repository
195205
multi_lora_args_filepath = os.path.join(

0 commit comments

Comments
 (0)