Skip to content

Commit 26ae725

Browse files
author
Francisco
committed
fix(sdk): remove unused DeploymentUpdateRequest import, fix update() payload to use dict comprehension with exclude-None
1 parent 90a98bb commit 26ae725

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

src/projectdavid/clients/deployments_client.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
DeploymentActivationResponse,
1111
DeploymentDeactivationResponse,
1212
DeploymentListResponse,
13-
DeploymentUpdateRequest,
1413
)
1514

1615
from projectdavid.clients.base_client import BaseAPIClient
@@ -277,16 +276,20 @@ def update(
277276
)
278277

279278
# Build payload — only include fields the caller explicitly passed
280-
payload = DeploymentUpdateRequest(
281-
gpu_memory_utilization=gpu_memory_utilization,
282-
max_model_len=max_model_len,
283-
max_num_seqs=max_num_seqs,
284-
quantization=quantization,
285-
dtype=dtype,
286-
enforce_eager=enforce_eager,
287-
limit_mm_per_prompt=limit_mm_per_prompt,
288-
tensor_parallel_size=tensor_parallel_size,
289-
).model_dump(exclude_unset=True)
279+
payload = {
280+
k: v
281+
for k, v in {
282+
"gpu_memory_utilization": gpu_memory_utilization,
283+
"max_model_len": max_model_len,
284+
"max_num_seqs": max_num_seqs,
285+
"quantization": quantization,
286+
"dtype": dtype,
287+
"enforce_eager": enforce_eager,
288+
"limit_mm_per_prompt": limit_mm_per_prompt,
289+
"tensor_parallel_size": tensor_parallel_size,
290+
}.items()
291+
if v is not None
292+
}
290293

291294
try:
292295
response = self.client.patch(

0 commit comments

Comments
 (0)