Prompt Template

#2
by tolasing - opened

I am trying to use the model in ollama ,however i cant get the model to call the functions.
is this the correct format for the prompt template ?
FROM quantized.bin
TEMPLATE """{{- if .First }}{{ .System }}{{- end }}

Instruction:

{{ .Prompt }}

Response:

"""
SYSTEM """You are a helpful AI assistant,you have a robot with you and can move it to different locations as per the user request ,use the following function to control the robot,if you are calling the b>
{
"name": "move_the_robot",
"description": "move the robot to different locations as per the user's request",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The locations in the home , " "e.g. Kitchen,TV room,Toilet"
},
"required": [
"location"
]
}
}]"""

PARAMETER stop "<|system|>"
PARAMETER stop "<|user|>"
PARAMETER stop "<|assistant|>"
PARAMETER stop ""

Owner

Hi there,
I am not sure how Ollama works but the model has been fine tuned with chatml. You can see examples of the prompts at: https://huggingface.co/datasets/gardner/tinyllama-function-calling-eval?row=0

This prompt:

<|im_start|>system You are a helpful assistant with access to the following functions. Use them if required - [ { "type": "function", "function": { "name": "check_stock_availability", "description": "Check the availability of a product in stock", "parameters": { "type": "object", "properties": { "product_id": { "type": "string", "description": "The ID of the product" } }, "required": [ "product_id" ] } } } ]<|im_end|>
<|im_start|>user Hi, I want to know if the product with ID 12345 is available in stock?<|im_end|>
<|im_start|>assistant

should produce this output:

 [ { "name": "check_stock_availability", "arguments": { "product_id": "12345" } } ]
tolasing changed discussion status to closed

Sign up or log in to comment