Skip to content

Commit

Permalink
Merge pull request #719 from remiconnesson/hf-vllm-use-kwargs
Browse files Browse the repository at this point in the history
fix(dsp): in `HFClientVLLM`, actually use `kwargs` in the payload instead of discarding them
  • Loading branch information
arnavsinghvi11 authored Apr 1, 2024
2 parents 3e3a693 + e74c361 commit 4ec6805
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions dsp/modules/hf_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,18 @@ def __init__(self, model, port, url="http://localhost", **kwargs):
raise ValueError(f"The url provided to `HFClientVLLM` is neither a string nor a list of strings. It is of type {type(url)}.")

self.headers = {"Content-Type": "application/json"}
self.kwargs = kwargs


def _generate(self, prompt, **kwargs):
kwargs = {**self.kwargs, **kwargs}

payload = {
"model": kwargs["model"],
"model": self.model,
"prompt": prompt,
"max_tokens": kwargs["max_tokens"],
"temperature": kwargs["temperature"],
**kwargs,
}


# Round robin the urls.
url = self.urls.pop(0)
Expand Down

0 comments on commit 4ec6805

Please sign in to comment.