Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
5e443b59
Unverified
Commit
5e443b59
authored
Oct 17, 2024
by
sasha0552
Committed by
GitHub
Oct 17, 2024
Browse files
[Bugfix] Allow prefill of assistant response when using `mistral_common` (#9446)
parent
9d30a056
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
vllm/transformers_utils/tokenizers/mistral.py
vllm/transformers_utils/tokenizers/mistral.py
+4
-0
No files found.
vllm/transformers_utils/tokenizers/mistral.py
View file @
5e443b59
...
@@ -166,6 +166,10 @@ class MistralTokenizer:
...
@@ -166,6 +166,10 @@ class MistralTokenizer:
tools
:
Optional
[
Dict
[
str
,
Any
]]
=
None
,
tools
:
Optional
[
Dict
[
str
,
Any
]]
=
None
,
**
kwargs
)
->
List
[
int
]:
**
kwargs
)
->
List
[
int
]:
last_message
=
messages
[
-
1
]
if
last_message
[
"role"
]
==
"assistant"
:
last_message
[
"prefix"
]
=
True
request
=
ChatCompletionRequest
(
messages
=
messages
,
request
=
ChatCompletionRequest
(
messages
=
messages
,
tools
=
tools
)
# type: ignore[type-var]
tools
=
tools
)
# type: ignore[type-var]
encoded
=
self
.
mistral
.
encode_chat_completion
(
request
)
encoded
=
self
.
mistral
.
encode_chat_completion
(
request
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment