mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-05-02 22:44:32 +08:00
Fix streaming for granite tool call when <|tool_call|> is present (#11069)
Signed-off-by: Max de Bayser <mbayser@br.ibm.com>
This commit is contained in:
parent
ffa48c9146
commit
e39400a4b6
@ -88,7 +88,11 @@ class GraniteToolParser(ToolParser):
|
|||||||
) -> Union[DeltaMessage, None]:
|
) -> Union[DeltaMessage, None]:
|
||||||
|
|
||||||
start_idx = consume_space(0, current_text)
|
start_idx = consume_space(0, current_text)
|
||||||
if not current_text or current_text[start_idx] != '[':
|
if current_text[start_idx:].startswith(self.bot_token):
|
||||||
|
start_idx = consume_space(start_idx + len(self.bot_token),
|
||||||
|
current_text)
|
||||||
|
if not current_text or start_idx >= len(current_text)\
|
||||||
|
or current_text[start_idx] != '[':
|
||||||
return DeltaMessage(content=delta_text)
|
return DeltaMessage(content=delta_text)
|
||||||
|
|
||||||
# bit mask flags for partial JSON parsing. If the name hasn't been
|
# bit mask flags for partial JSON parsing. If the name hasn't been
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user