Skip to content

Commit

Permalink
[Bugfix] Allow prefill of assistant response when using `mistral_comm…
Browse files Browse the repository at this point in the history
  • Loading branch information
sasha0552 authored Oct 17, 2024
1 parent f3702b7 commit 4d647bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vllm/transformers_utils/tokenizers/mistral.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ def apply_chat_template(self,
tools: Optional[Dict[str, Any]] = None,
**kwargs) -> List[int]:

last_message = messages[-1]
if last_message["role"] == "assistant":
last_message["prefix"] = True

request = ChatCompletionRequest(messages=messages,
tools=tools) # type: ignore[type-var]
encoded = self.mistral.encode_chat_completion(request)
Expand Down

0 comments on commit 4d647bd

Please sign in to comment.