mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-31 10:30:00 +00:00
final fixes
This commit is contained in:
parent
971566fd74
commit
d3ebc18559
3 changed files with 11 additions and 15 deletions
|
|
@ -203,14 +203,8 @@ class ChatFormat:
|
|||
tokens.extend(toks)
|
||||
images.extend(imgs)
|
||||
|
||||
# if message.role == "assistant" and len(message.tool_calls) > 0:
|
||||
# tokens.append(self.tokenizer.special_tokens["<|python_start|>"])
|
||||
|
||||
_process_content(message.content)
|
||||
|
||||
# if message.role == "assistant" and len(message.tool_calls) > 0:
|
||||
# tokens.append(self.tokenizer.special_tokens["<|python_end|>"])
|
||||
|
||||
if message.role == "user" and message.context is not None:
|
||||
# This is RAG context; why is it here in the chat format? I don't think
|
||||
# this is needed and can be moved upwards
|
||||
|
|
@ -222,6 +216,7 @@ class ChatFormat:
|
|||
content = ToolUtils.encode_tool_call(t, tool_prompt_format)
|
||||
_process_content(content)
|
||||
|
||||
# Tool calls and Tool Response messages should be eom
|
||||
eom = False
|
||||
if message.role == "assistant":
|
||||
eom = message.stop_reason == StopReason.end_of_message or message.tool_calls
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue