[model] support granite4 (#8680)
This commit is contained in:
@@ -1071,6 +1071,23 @@ register_template(
|
||||
)
|
||||
|
||||
|
||||
register_template(
|
||||
name="granite4",
|
||||
format_user=StringFormatter(
|
||||
slots=[
|
||||
"<|start_of_role|>user<|end_of_role|>{{content}}<|end_of_text|>\n<|start_of_role|>assistant<|end_of_role|>"
|
||||
]
|
||||
),
|
||||
format_assistant=StringFormatter(slots=["{{content}}<|end_of_text|>\n"]),
|
||||
format_system=StringFormatter(slots=["<|start_of_role|>system<|end_of_role|>{{content}}<|end_of_text|>\n"]),
|
||||
format_function=FunctionFormatter(slots=["{{content}}<|end_of_text|>\n"], tool_format="default"),
|
||||
format_observation=StringFormatter(slots=["<|start_of_role|>tool<|end_of_role|>{{content}}<|end_of_text|>\n<|start_of_role|>assistant\n"]),
|
||||
format_tools=ToolFormatter(tool_format="default"),
|
||||
stop_words=["<|end_of_text|>"],
|
||||
default_system=("You are Granite, developed by IBM. You are a helpful AI assistant.")
|
||||
)
|
||||
|
||||
|
||||
register_template(
|
||||
name="index",
|
||||
format_user=StringFormatter(slots=["reserved_0{{content}}reserved_1"]),
|
||||
|
||||
Reference in New Issue
Block a user