mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-28 19:38:46 +00:00
Merge branch 'main' into add-watsonx-inference-adapter
This commit is contained in:
commit
5366c423ae
10 changed files with 1355 additions and 26 deletions
|
|
@ -279,6 +279,10 @@ class PythonListCustomToolGenerator(PromptTemplateGeneratorBase): # noqa: N801
|
|||
{% endif -%}
|
||||
{%- endfor %}
|
||||
]
|
||||
|
||||
You can answer general questions or invoke tools when necessary.
|
||||
In addition to tool calls, you should also augment your responses by using the tool outputs.
|
||||
|
||||
"""
|
||||
)
|
||||
return PromptTemplate(
|
||||
|
|
|
|||
|
|
@ -216,9 +216,12 @@ 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
|
||||
eom = message.stop_reason == StopReason.end_of_message or message.tool_calls
|
||||
elif message.role == "tool":
|
||||
eom = True
|
||||
|
||||
tokens.append(self.tokenizer.special_tokens["<|eom|>" if eom else "<|eot|>"])
|
||||
return tokens, images
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue