From 712ac234d13de7225c97c3919f83e83638b3f2e5 Mon Sep 17 00:00:00 2001 From: Yifan Mai Date: Thu, 31 Oct 2024 13:58:22 -0700 Subject: [PATCH] Add stop sequence support to MistralClient (#3120) --- src/helm/clients/mistral_client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/helm/clients/mistral_client.py b/src/helm/clients/mistral_client.py index 7627c537ae..e540240600 100644 --- a/src/helm/clients/mistral_client.py +++ b/src/helm/clients/mistral_client.py @@ -26,6 +26,7 @@ class MistralAIRequest(TypedDict): temperature: float top_p: float random_seed: Optional[int] + stop: Optional[List[str]] class MistralAIClient(CachingClient): @@ -120,6 +121,7 @@ def make_request(self, request: Request) -> RequestResult: "temperature": request.temperature, "top_p": request.top_p, "random_seed": self._get_random_seed(request, completion_index), + "stop": request.stop_sequences or None, } def do_it() -> Dict[str, Any]: