Skip to content

Commit 8cee361

Browse files
committed
fix vllmsampler client
1 parent bea8a11 commit 8cee361

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

client_tools/client_generator.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,14 @@ def set_template(self, template_cls: str, adapter_name: str = '', **kwargs) -> S
805805
)
806806
response.raise_for_status()
807807
return SetTemplateResponse(**response.json())
808+
809+
def apply_patch(self, patch_cls: str, **kwargs) -> None:
810+
"""Apply a patch to the model."""
811+
response = http_post(
812+
url=f'{self.server_url}/apply_patch',
813+
json_data={'patch_cls': patch_cls, 'adapter_name': self.adapter_name, **kwargs}
814+
)
815+
response.raise_for_status()
808816
'''
809817

810818
# Write the sampler client file

src/twinkle_client/sampler/vllm_sampler.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,11 @@ def set_template(self, template_cls: str, adapter_name: str = '', **kwargs) -> S
9494
)
9595
response.raise_for_status()
9696
return SetTemplateResponse(**response.json())
97+
98+
def apply_patch(self, patch_cls: str, **kwargs) -> None:
99+
"""Apply a patch to the model."""
100+
response = http_post(
101+
url=f'{self.server_url}/apply_patch',
102+
json_data={'patch_cls': patch_cls, 'adapter_name': self.adapter_name, **kwargs}
103+
)
104+
response.raise_for_status()

0 commit comments

Comments
 (0)