diff --git a/dsp/modules/hf_client.py b/dsp/modules/hf_client.py index 810c9d3a0..c4bf83e55 100644 --- a/dsp/modules/hf_client.py +++ b/dsp/modules/hf_client.py @@ -154,6 +154,10 @@ def _generate(self, prompt, **kwargs): messages = [{"role": "user", "content": prompt}] if system_prompt: messages.insert(0, {"role": "system", "content": system_prompt}) + + kwargs.pop("port", None) + kwargs.pop("url", None) + payload = { "model": self.kwargs["model"], "messages": messages, @@ -180,6 +184,9 @@ def _generate(self, prompt, **kwargs): print("Failed to parse JSON response:", response.text) raise Exception("Received invalid JSON response from server") else: + kwargs.pop("port", None) + kwargs.pop("url", None) + payload = { "model": self.kwargs["model"], "prompt": prompt,