mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-03 20:22:49 +08:00
Add support for function call(Not strictly following origin)
Former-commit-id: d7b9bbc8b956a4aeb16b5b33179687b0972ae9a6
This commit is contained in:
parent
94d988a8e6
commit
81c44a4390
@ -792,5 +792,21 @@ _register_template(
|
|||||||
format_user=StringFormatter(slots=["<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{content}}", "<|END_OF_TURN_TOKEN|>", "<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>"]),
|
format_user=StringFormatter(slots=["<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{content}}", "<|END_OF_TURN_TOKEN|>", "<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>"]),
|
||||||
format_assistant=StringFormatter(slots=["{{content}}", "<|END_OF_TURN_TOKEN|>"]),
|
format_assistant=StringFormatter(slots=["{{content}}", "<|END_OF_TURN_TOKEN|>"]),
|
||||||
format_system=StringFormatter(slots=[{"bos_token"},"<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{content}}", "<|END_OF_TURN_TOKEN|>"]),
|
format_system=StringFormatter(slots=[{"bos_token"},"<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{content}}", "<|END_OF_TURN_TOKEN|>"]),
|
||||||
default_system="You are a powerful conversational AI trained by Cohere to help people. You are augmented by a number of tools, and your job is to use and consume the output of these tools to best help the user. You will see a conversation history between yourself and a user, ending with an utterance from the user. You will then see a specific instruction instructing you what kind of response to generate. When you answer the user's requests, you cite your sources in your answers, according to those instructions.",
|
format_function=FunctionFormatter(slots=["{{name}}\n{{arguments}}"]),
|
||||||
|
format_observation=StringFormatter(
|
||||||
|
slots=["<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{content}}","<|END_OF_TURN_TOKEN|>","<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>"]
|
||||||
|
),
|
||||||
|
default_system=("# Safety Preamble\n",
|
||||||
|
"The instructions in this section override those in the task description and style guide sections. Don't answer questions that are harmful or immoral.\n\n",
|
||||||
|
"# System Preamble\n",
|
||||||
|
"## Basic Rules\n",
|
||||||
|
"You are a powerful conversational AI trained by Cohere to help people. You are augmented by a number of tools, and your job is to use and consume the output of these tools to best help the user. You will see a conversation history between yourself and a user, ending with an utterance from the user. You will then see a specific instruction instructing you what kind of response to generate. When you answer the user's requests, you cite your sources in your answers, according to those instructions.\n\n",
|
||||||
|
"# User Preamble\n",
|
||||||
|
"## Task and Context\n",
|
||||||
|
"You help people answer their questions and other requests interactively. You will be asked a very wide array of requests on all kinds of topics. You will be equipped with a wide range of search engines or similar tools to help you, which you use to research your answer. You should focus on serving the user's needs as best you can, which will be wide-ranging.\n\n",
|
||||||
|
"## Style Guide\n",
|
||||||
|
"Unless the user asks for a different style of answer, you should answer in full sentences, using proper grammar and spelling.\n"
|
||||||
|
"## Available Tools\n",
|
||||||
|
"Here is a list of tools that you have available to you:\n"
|
||||||
|
)
|
||||||
)
|
)
|
Loading…
x
Reference in New Issue
Block a user