diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index de7fd3956..06ee0ea3f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -119,7 +119,6 @@ llama_target_and_test(test-llama-grammar.cpp) # llama_target_and_test(test-opt.cpp) # SLOW llama_target_and_test(test-backend-ops.cpp) llama_target_and_test(test-antiprompts.cpp) -llama_target_and_test(test-minja.cpp) llama_target_and_test(test-tool-call.cpp) llama_target_and_test(test-model-load-cancel.cpp LABEL "model") diff --git a/tests/chat/contexts/simple.json b/tests/chat/contexts/simple.json deleted file mode 100644 index 560f92f73..000000000 --- a/tests/chat/contexts/simple.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "messages": [ - { - "role": "user", - "content": "What's your favourite LLM framework?" - }, - { - "role": "assistant", - "content": "llama.cpp!" - } - ], - "add_generation_prompt": true, - "bos_token": "<|startoftext|>", - "eos_token": "<|endoftext|>" -} diff --git a/tests/chat/contexts/system.json b/tests/chat/contexts/system.json deleted file mode 100644 index 4d72972ad..000000000 --- a/tests/chat/contexts/system.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "messages": [ - { - "role": "system", - "content": "You only tell the truth." - }, - { - "role": "user", - "content": "What's your favourite LLM framework?" - }, - { - "role": "assistant", - "content": "llama.cpp!" - } - ], - "add_generation_prompt": true, - "bos_token": "<|startoftext|>", - "eos_token": "<|endoftext|>" -} diff --git a/tests/chat/contexts/tool_use.json b/tests/chat/contexts/tool_use.json deleted file mode 100644 index 2797ac5c7..000000000 --- a/tests/chat/contexts/tool_use.json +++ /dev/null @@ -1,167 +0,0 @@ -{ - "messages": [ - { - "role": "user", - "content": "Print a hello world message with python." - }, - { - "role": "assistant", - "content": "", - "tool_calls": [ - { - "id": "call_1___", - "type": "function", - "function": { - "arguments": "{\"code\": \"print('Hello, World!')\"}", - "name": "ipython" - } - } - ] - }, - { - "role": "tool", - "tool_call_id": "call_1___", - "name": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}" - }, - { - "role": "assistant", - "content": "Anything else?" - }, - { - "role": "user", - "content": "Test a tautology." - }, - { - "role": "assistant", - "content": "", - "tool_calls": [ - { - "id": "call_2___", - "type": "function", - "function": { - "arguments": "{\"condition\":true}", - "name": "test" - } - } - ] - }, - { - "role": "tool", - "tool_call_id": "call_2___", - "name": "test", - "content": "true" - }, - { - "role": "assistant", - "content": "Truth is definitely true." - }, - { - "role": "user", - "content": "Check it on the web." - }, - { - "role": "assistant", - "content": "", - "tool_calls": [ - { - "id": "call_3___", - "type": "function", - "function": { - "arguments": "{\"query\": \"what is truth anyway am I right?\"}", - "name": "brave_search" - } - } - ] - }, - { - "role": "tool", - "tool_call_id": "call_3___", - "name": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}" - }, - { - "role": "assistant", - "content": "I don't need the web to answer you but I did check, as you asked. What now?" - } - ], - "add_generation_prompt": true, - "bos_token": "<|startoftext|>", - "eos_token": "<|endoftext|>", - "builtin_tools": [ - "wolfram_alpha", - "brave_search" - ], - "cutting_knowledge_date": "2023-04-01", - "todays_date": "2024-09-03", - "tools": [ - { - "type": "function", - "function": { - "name": "ipython", - "description": "Runs code in an ipython interpreter and returns the result of the execution after 60 seconds.", - "parameters": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "The code to run in the ipython interpreter." - } - }, - "required": ["code"] - } - } - }, - { - "type": "function", - "function": { - "name": "brave_search", - "description": "Executes a web search with Brave.", - "parameters": { - "type": "object", - "properties": { - "query": { - "type": "string", - "description": "The query to search for." - } - }, - "required": ["query"] - } - } - }, - { - "type": "function", - "function": { - "name": "wolfram_alpha", - "description": "Executes a query with Wolfram Alpha.", - "parameters": { - "type": "object", - "properties": { - "query": { - "type": "string", - "description": "The query to execute." - } - }, - "required": ["query"] - } - } - }, - { - "type": "function", - "function": { - "name": "test", - "description": "Runs a test.", - "parameters": { - "type": "object", - "properties": { - "condition": { - "type": "boolean", - "description": "The condition to test." - } - }, - "required": ["condition"] - } - } - } - ] -} diff --git a/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-default-simple.txt b/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-default-simple.txt deleted file mode 100644 index 09e69d792..000000000 --- a/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-default-simple.txt +++ /dev/null @@ -1 +0,0 @@ -<|startoftext|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>What's your favourite LLM framework?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>llama.cpp!<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|> \ No newline at end of file diff --git a/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-default-system.txt b/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-default-system.txt deleted file mode 100644 index b9bea1cf7..000000000 --- a/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-default-system.txt +++ /dev/null @@ -1 +0,0 @@ -<|startoftext|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>You only tell the truth.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>What's your favourite LLM framework?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>llama.cpp!<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|> \ No newline at end of file diff --git a/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-default-tool_use.txt b/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-default-tool_use.txt deleted file mode 100644 index 2a537c411..000000000 --- a/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-default-tool_use.txt +++ /dev/null @@ -1,49 +0,0 @@ -<|startoftext|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Print a hello world message with python.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{ - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -}<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>{ - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -}<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>Anything else?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Test a tautology.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{ - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -}<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>{ - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -}<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>Truth is definitely true.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Check it on the web.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{ - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -}<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>{ - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -}<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>I don't need the web to answer you but I did check, as you asked. What now?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|> \ No newline at end of file diff --git a/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-rag-simple.txt b/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-rag-simple.txt deleted file mode 100644 index 5495007e1..000000000 --- a/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-rag-simple.txt +++ /dev/null @@ -1,16 +0,0 @@ -<|startoftext|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># Safety Preamble -The instructions in this section override those in the task description and style guide sections. Don't answer questions that are harmful or immoral. - -# System Preamble -## Basic Rules -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. - -# User Preamble -## Task and Context -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. - -## Style Guide -Unless the user asks for a different style of answer, you should answer in full sentences, using proper grammar and spelling.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>What's your favourite LLM framework?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>llama.cpp!<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>Carefully perform the following instructions, in order, starting each with a new line. -Firstly, Decide which of the retrieved documents are relevant to the user's last input by writing 'Relevant Documents:' followed by comma-separated list of document numbers. If none are relevant, you should instead write 'None'. -Secondly, Decide which of the retrieved documents contain facts that should be cited in a good answer to the user's last input by writing 'Cited Documents:' followed a comma-separated list of document numbers. If you dont want to cite any of them, you should instead write 'None'. -Finally, Write 'Grounded answer:' followed by a response to the user's last input in high quality natural english. Use the symbols and to indicate when a fact comes from a document in the search result, e.g my fact for a fact from document 0.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|> \ No newline at end of file diff --git a/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-rag-system.txt b/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-rag-system.txt deleted file mode 100644 index f18fe7ff8..000000000 --- a/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-rag-system.txt +++ /dev/null @@ -1,12 +0,0 @@ -<|startoftext|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># Safety Preamble -The instructions in this section override those in the task description and style guide sections. Don't answer questions that are harmful or immoral. - -# System Preamble -## Basic Rules -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. - -# User Preamble -You only tell the truth.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>What's your favourite LLM framework?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>llama.cpp!<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>Carefully perform the following instructions, in order, starting each with a new line. -Firstly, Decide which of the retrieved documents are relevant to the user's last input by writing 'Relevant Documents:' followed by comma-separated list of document numbers. If none are relevant, you should instead write 'None'. -Secondly, Decide which of the retrieved documents contain facts that should be cited in a good answer to the user's last input by writing 'Cited Documents:' followed a comma-separated list of document numbers. If you dont want to cite any of them, you should instead write 'None'. -Finally, Write 'Grounded answer:' followed by a response to the user's last input in high quality natural english. Use the symbols and to indicate when a fact comes from a document in the search result, e.g my fact for a fact from document 0.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|> \ No newline at end of file diff --git a/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-rag-tool_use.txt b/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-rag-tool_use.txt deleted file mode 100644 index 6d8b116b2..000000000 --- a/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-rag-tool_use.txt +++ /dev/null @@ -1,16 +0,0 @@ -<|startoftext|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># Safety Preamble -The instructions in this section override those in the task description and style guide sections. Don't answer questions that are harmful or immoral. - -# System Preamble -## Basic Rules -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. - -# User Preamble -## Task and Context -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. - -## Style Guide -Unless the user asks for a different style of answer, you should answer in full sentences, using proper grammar and spelling.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Print a hello world message with python.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>Anything else?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Test a tautology.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>Truth is definitely true.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Check it on the web.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>I don't need the web to answer you but I did check, as you asked. What now?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>Carefully perform the following instructions, in order, starting each with a new line. -Firstly, Decide which of the retrieved documents are relevant to the user's last input by writing 'Relevant Documents:' followed by comma-separated list of document numbers. If none are relevant, you should instead write 'None'. -Secondly, Decide which of the retrieved documents contain facts that should be cited in a good answer to the user's last input by writing 'Cited Documents:' followed a comma-separated list of document numbers. If you dont want to cite any of them, you should instead write 'None'. -Finally, Write 'Grounded answer:' followed by a response to the user's last input in high quality natural english. Use the symbols and to indicate when a fact comes from a document in the search result, e.g my fact for a fact from document 0.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|> \ No newline at end of file diff --git a/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-tool_use-simple.txt b/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-tool_use-simple.txt deleted file mode 100644 index 394cdafb3..000000000 --- a/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-tool_use-simple.txt +++ /dev/null @@ -1,25 +0,0 @@ -<|startoftext|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># Safety Preamble -The instructions in this section override those in the task description and style guide sections. Don't answer questions that are harmful or immoral. - -# System Preamble -## Basic Rules -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. - -# User Preamble -## Task and Context -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. - -## Style Guide -Unless the user asks for a different style of answer, you should answer in full sentences, using proper grammar and spelling. - -## Available Tools -Here is a list of tools that you have available to you: - -<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>What's your favourite LLM framework?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>llama.cpp!<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>Write 'Action:' followed by a json-formatted list of actions that you want to perform in order to produce a good response to the user's last input. You can use any of the supplied tools any number of times, but you should aim to execute the minimum number of necessary actions for the input. You should use the `directly-answer` tool if calling the other tools is unnecessary. The list of actions you want to call should be formatted as a list of json objects, for example: -```json -[ - { - "tool_name": title of the tool in the specification, - "parameters": a dict of parameters to input into the tool as they are defined in the specs, or {} if it takes no parameters - } -]```<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|> \ No newline at end of file diff --git a/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-tool_use-system.txt b/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-tool_use-system.txt deleted file mode 100644 index 61375a0d4..000000000 --- a/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-tool_use-system.txt +++ /dev/null @@ -1,21 +0,0 @@ -<|startoftext|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># Safety Preamble -The instructions in this section override those in the task description and style guide sections. Don't answer questions that are harmful or immoral. - -# System Preamble -## Basic Rules -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. - -# User Preamble -You only tell the truth. - -## Available Tools -Here is a list of tools that you have available to you: - -<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>What's your favourite LLM framework?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>llama.cpp!<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>Write 'Action:' followed by a json-formatted list of actions that you want to perform in order to produce a good response to the user's last input. You can use any of the supplied tools any number of times, but you should aim to execute the minimum number of necessary actions for the input. You should use the `directly-answer` tool if calling the other tools is unnecessary. The list of actions you want to call should be formatted as a list of json objects, for example: -```json -[ - { - "tool_name": title of the tool in the specification, - "parameters": a dict of parameters to input into the tool as they are defined in the specs, or {} if it takes no parameters - } -]```<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|> \ No newline at end of file diff --git a/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-tool_use-tool_use.txt b/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-tool_use-tool_use.txt deleted file mode 100644 index ad76a54eb..000000000 --- a/tests/chat/goldens/CohereForAI-c4ai-command-r-plus-tool_use-tool_use.txt +++ /dev/null @@ -1,93 +0,0 @@ -<|startoftext|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># Safety Preamble -The instructions in this section override those in the task description and style guide sections. Don't answer questions that are harmful or immoral. - -# System Preamble -## Basic Rules -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. - -# User Preamble -## Task and Context -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. - -## Style Guide -Unless the user asks for a different style of answer, you should answer in full sentences, using proper grammar and spelling. - -## Available Tools -Here is a list of tools that you have available to you: - -```python -def ipython(code: str) -> List[Dict]: - """Runs code in an ipython interpreter and returns the result of the execution after 60 seconds. - - Args: - code (str): The code to run in the ipython interpreter. - """ - pass -``` - -```python -def brave_search(query: str) -> List[Dict]: - """Executes a web search with Brave. - - Args: - query (str): The query to search for. - """ - pass -``` - -```python -def wolfram_alpha(query: str) -> List[Dict]: - """Executes a query with Wolfram Alpha. - - Args: - query (str): The query to execute. - """ - pass -``` - -```python -def test(condition: bool) -> List[Dict]: - """Runs a test. - - Args: - condition (bool): The condition to test. - """ - pass -```<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Print a hello world message with python.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|> -Action: -```json -[ - { - "tool_name": "ipython", - "parameters": "{\"code\": \"print('Hello, World!')\"}" - } -]``` -<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|> -{"stdout": "Hello, World!"}<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>Anything else?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Test a tautology.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|> -Action: -```json -[ - { - "tool_name": "test", - "parameters": "{\"condition\":true}" - } -]``` -<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|> -true<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>Truth is definitely true.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Check it on the web.<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|> -Action: -```json -[ - { - "tool_name": "brave_search", - "parameters": "{\"query\": \"what is truth anyway am I right?\"}" - } -]``` -<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|> -{"title":"Truth: don't ask the web, ask an LLM instead!","url":"https://en.wikipedia.org/wiki/Truth"}<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>I don't need the web to answer you but I did check, as you asked. What now?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>Write 'Action:' followed by a json-formatted list of actions that you want to perform in order to produce a good response to the user's last input. You can use any of the supplied tools any number of times, but you should aim to execute the minimum number of necessary actions for the input. You should use the `directly-answer` tool if calling the other tools is unnecessary. The list of actions you want to call should be formatted as a list of json objects, for example: -```json -[ - { - "tool_name": title of the tool in the specification, - "parameters": a dict of parameters to input into the tool as they are defined in the specs, or {} if it takes no parameters - } -]```<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|> \ No newline at end of file diff --git a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Llama-3-8B-default-simple.txt b/tests/chat/goldens/NousResearch-Hermes-2-Pro-Llama-3-8B-default-simple.txt deleted file mode 100644 index 8824912a4..000000000 --- a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Llama-3-8B-default-simple.txt +++ /dev/null @@ -1,5 +0,0 @@ -<|startoftext|><|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Llama-3-8B-default-system.txt b/tests/chat/goldens/NousResearch-Hermes-2-Pro-Llama-3-8B-default-system.txt deleted file mode 100644 index eed13ce3d..000000000 --- a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Llama-3-8B-default-system.txt +++ /dev/null @@ -1,7 +0,0 @@ -<|startoftext|><|im_start|>system -You only tell the truth.<|im_end|> -<|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Llama-3-8B-default-tool_use.txt b/tests/chat/goldens/NousResearch-Hermes-2-Pro-Llama-3-8B-default-tool_use.txt deleted file mode 100644 index 76e34c6d5..000000000 --- a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Llama-3-8B-default-tool_use.txt +++ /dev/null @@ -1,73 +0,0 @@ -<|startoftext|><|im_start|>user -Print a hello world message with python.<|im_end|> -<|im_start|>assistant -{ - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -}<|im_end|> -<|im_start|>user -{ - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -}<|im_end|> -<|im_start|>assistant -Anything else?<|im_end|> -<|im_start|>user -Test a tautology.<|im_end|> -<|im_start|>assistant -{ - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -}<|im_end|> -<|im_start|>user -{ - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -}<|im_end|> -<|im_start|>assistant -Truth is definitely true.<|im_end|> -<|im_start|>user -Check it on the web.<|im_end|> -<|im_start|>assistant -{ - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -}<|im_end|> -<|im_start|>user -{ - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -}<|im_end|> -<|im_start|>assistant -I don't need the web to answer you but I did check, as you asked. What now?<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Llama-3-8B-tool_use-simple.txt b/tests/chat/goldens/NousResearch-Hermes-2-Pro-Llama-3-8B-tool_use-simple.txt deleted file mode 100644 index 6a8b5a5c8..000000000 --- a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Llama-3-8B-tool_use-simple.txt +++ /dev/null @@ -1,11 +0,0 @@ -<|startoftext|><|im_start|>system -You are a function calling AI model. You are provided with function signatures within XML tags. You may call one or more functions to assist with the user query. Don't make assumptions about what values to plug into functions. Here are the available tools: Use the following pydantic model json schema for each tool call you will make: {"properties": {"name": {"title": "Name", "type": "string"}, "arguments": {"title": "Arguments", "type": "object"}}, "required": ["name", "arguments"], "title": "FunctionCall", "type": "object"}} -For each function call return a json object with function name and arguments within XML tags as follows: - -{"name": , "arguments": } -<|im_end|> -<|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Llama-3-8B-tool_use-system.txt b/tests/chat/goldens/NousResearch-Hermes-2-Pro-Llama-3-8B-tool_use-system.txt deleted file mode 100644 index 9435ec9b7..000000000 --- a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Llama-3-8B-tool_use-system.txt +++ /dev/null @@ -1,13 +0,0 @@ -<|startoftext|><|im_start|>system -You are a function calling AI model. You are provided with function signatures within XML tags. You may call one or more functions to assist with the user query. Don't make assumptions about what values to plug into functions. Here are the available tools: Use the following pydantic model json schema for each tool call you will make: {"properties": {"name": {"title": "Name", "type": "string"}, "arguments": {"title": "Arguments", "type": "object"}}, "required": ["name", "arguments"], "title": "FunctionCall", "type": "object"}} -For each function call return a json object with function name and arguments within XML tags as follows: - -{"name": , "arguments": } -<|im_end|> -<|im_start|>system -You only tell the truth.<|im_end|> -<|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Llama-3-8B-tool_use-tool_use.txt b/tests/chat/goldens/NousResearch-Hermes-2-Pro-Llama-3-8B-tool_use-tool_use.txt deleted file mode 100644 index 1bfd411d7..000000000 --- a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Llama-3-8B-tool_use-tool_use.txt +++ /dev/null @@ -1,58 +0,0 @@ -<|startoftext|><|im_start|>system -You are a function calling AI model. You are provided with function signatures within XML tags. You may call one or more functions to assist with the user query. Don't make assumptions about what values to plug into functions. Here are the available tools: {"type": "function", "function": {"name": "ipython", "description": "ipython(code: str) - Runs code in an ipython interpreter and returns the result of the execution after 60 seconds. - - Args: - code(str): The code to run in the ipython interpreter.", "parameters": {"type": "object", "properties": {"code": {"type": "string", "description": "The code to run in the ipython interpreter."}}, "required": ["code"]}} -{"type": "function", "function": {"name": "brave_search", "description": "brave_search(query: str) - Executes a web search with Brave. - - Args: - query(str): The query to search for.", "parameters": {"type": "object", "properties": {"query": {"type": "string", "description": "The query to search for."}}, "required": ["query"]}} -{"type": "function", "function": {"name": "wolfram_alpha", "description": "wolfram_alpha(query: str) - Executes a query with Wolfram Alpha. - - Args: - query(str): The query to execute.", "parameters": {"type": "object", "properties": {"query": {"type": "string", "description": "The query to execute."}}, "required": ["query"]}} -{"type": "function", "function": {"name": "test", "description": "test(condition: bool) - Runs a test. - - Args: - condition(bool): The condition to test.", "parameters": {"type": "object", "properties": {"condition": {"type": "boolean", "description": "The condition to test."}}, "required": ["condition"]}} Use the following pydantic model json schema for each tool call you will make: {"properties": {"name": {"title": "Name", "type": "string"}, "arguments": {"title": "Arguments", "type": "object"}}, "required": ["name", "arguments"], "title": "FunctionCall", "type": "object"}} -For each function call return a json object with function name and arguments within XML tags as follows: - -{"name": , "arguments": } -<|im_end|> -<|im_start|>user -Print a hello world message with python.<|im_end|> -<|im_start|>assistant - -{"name": "ipython", "arguments": {"code": "print('Hello, World!')"}} -<|im_end|> -<|im_start|>tool - -{"stdout": "Hello, World!"} - -<|im_end|><|im_start|>assistant -Anything else?<|im_end|> -<|im_start|>user -Test a tautology.<|im_end|> -<|im_start|>assistant - -{"name": "test", "arguments": {"condition":true}} -<|im_end|> -<|im_start|>tool - -true - -<|im_end|><|im_start|>assistant -Truth is definitely true.<|im_end|> -<|im_start|>user -Check it on the web.<|im_end|> -<|im_start|>assistant - -{"name": "brave_search", "arguments": {"query": "what is truth anyway am I right?"}} -<|im_end|> -<|im_start|>tool - -{"title":"Truth: don't ask the web, ask an LLM instead!","url":"https://en.wikipedia.org/wiki/Truth"} - -<|im_end|><|im_start|>assistant -I don't need the web to answer you but I did check, as you asked. What now?<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Mistral-7B-default-simple.txt b/tests/chat/goldens/NousResearch-Hermes-2-Pro-Mistral-7B-default-simple.txt deleted file mode 100644 index 8824912a4..000000000 --- a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Mistral-7B-default-simple.txt +++ /dev/null @@ -1,5 +0,0 @@ -<|startoftext|><|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Mistral-7B-default-system.txt b/tests/chat/goldens/NousResearch-Hermes-2-Pro-Mistral-7B-default-system.txt deleted file mode 100644 index eed13ce3d..000000000 --- a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Mistral-7B-default-system.txt +++ /dev/null @@ -1,7 +0,0 @@ -<|startoftext|><|im_start|>system -You only tell the truth.<|im_end|> -<|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Mistral-7B-default-tool_use.txt b/tests/chat/goldens/NousResearch-Hermes-2-Pro-Mistral-7B-default-tool_use.txt deleted file mode 100644 index 76e34c6d5..000000000 --- a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Mistral-7B-default-tool_use.txt +++ /dev/null @@ -1,73 +0,0 @@ -<|startoftext|><|im_start|>user -Print a hello world message with python.<|im_end|> -<|im_start|>assistant -{ - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -}<|im_end|> -<|im_start|>user -{ - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -}<|im_end|> -<|im_start|>assistant -Anything else?<|im_end|> -<|im_start|>user -Test a tautology.<|im_end|> -<|im_start|>assistant -{ - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -}<|im_end|> -<|im_start|>user -{ - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -}<|im_end|> -<|im_start|>assistant -Truth is definitely true.<|im_end|> -<|im_start|>user -Check it on the web.<|im_end|> -<|im_start|>assistant -{ - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -}<|im_end|> -<|im_start|>user -{ - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -}<|im_end|> -<|im_start|>assistant -I don't need the web to answer you but I did check, as you asked. What now?<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Mistral-7B-tool_use-simple.txt b/tests/chat/goldens/NousResearch-Hermes-2-Pro-Mistral-7B-tool_use-simple.txt deleted file mode 100644 index 6a8b5a5c8..000000000 --- a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Mistral-7B-tool_use-simple.txt +++ /dev/null @@ -1,11 +0,0 @@ -<|startoftext|><|im_start|>system -You are a function calling AI model. You are provided with function signatures within XML tags. You may call one or more functions to assist with the user query. Don't make assumptions about what values to plug into functions. Here are the available tools: Use the following pydantic model json schema for each tool call you will make: {"properties": {"name": {"title": "Name", "type": "string"}, "arguments": {"title": "Arguments", "type": "object"}}, "required": ["name", "arguments"], "title": "FunctionCall", "type": "object"}} -For each function call return a json object with function name and arguments within XML tags as follows: - -{"name": , "arguments": } -<|im_end|> -<|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Mistral-7B-tool_use-system.txt b/tests/chat/goldens/NousResearch-Hermes-2-Pro-Mistral-7B-tool_use-system.txt deleted file mode 100644 index 9435ec9b7..000000000 --- a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Mistral-7B-tool_use-system.txt +++ /dev/null @@ -1,13 +0,0 @@ -<|startoftext|><|im_start|>system -You are a function calling AI model. You are provided with function signatures within XML tags. You may call one or more functions to assist with the user query. Don't make assumptions about what values to plug into functions. Here are the available tools: Use the following pydantic model json schema for each tool call you will make: {"properties": {"name": {"title": "Name", "type": "string"}, "arguments": {"title": "Arguments", "type": "object"}}, "required": ["name", "arguments"], "title": "FunctionCall", "type": "object"}} -For each function call return a json object with function name and arguments within XML tags as follows: - -{"name": , "arguments": } -<|im_end|> -<|im_start|>system -You only tell the truth.<|im_end|> -<|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Mistral-7B-tool_use-tool_use.txt b/tests/chat/goldens/NousResearch-Hermes-2-Pro-Mistral-7B-tool_use-tool_use.txt deleted file mode 100644 index 1bfd411d7..000000000 --- a/tests/chat/goldens/NousResearch-Hermes-2-Pro-Mistral-7B-tool_use-tool_use.txt +++ /dev/null @@ -1,58 +0,0 @@ -<|startoftext|><|im_start|>system -You are a function calling AI model. You are provided with function signatures within XML tags. You may call one or more functions to assist with the user query. Don't make assumptions about what values to plug into functions. Here are the available tools: {"type": "function", "function": {"name": "ipython", "description": "ipython(code: str) - Runs code in an ipython interpreter and returns the result of the execution after 60 seconds. - - Args: - code(str): The code to run in the ipython interpreter.", "parameters": {"type": "object", "properties": {"code": {"type": "string", "description": "The code to run in the ipython interpreter."}}, "required": ["code"]}} -{"type": "function", "function": {"name": "brave_search", "description": "brave_search(query: str) - Executes a web search with Brave. - - Args: - query(str): The query to search for.", "parameters": {"type": "object", "properties": {"query": {"type": "string", "description": "The query to search for."}}, "required": ["query"]}} -{"type": "function", "function": {"name": "wolfram_alpha", "description": "wolfram_alpha(query: str) - Executes a query with Wolfram Alpha. - - Args: - query(str): The query to execute.", "parameters": {"type": "object", "properties": {"query": {"type": "string", "description": "The query to execute."}}, "required": ["query"]}} -{"type": "function", "function": {"name": "test", "description": "test(condition: bool) - Runs a test. - - Args: - condition(bool): The condition to test.", "parameters": {"type": "object", "properties": {"condition": {"type": "boolean", "description": "The condition to test."}}, "required": ["condition"]}} Use the following pydantic model json schema for each tool call you will make: {"properties": {"name": {"title": "Name", "type": "string"}, "arguments": {"title": "Arguments", "type": "object"}}, "required": ["name", "arguments"], "title": "FunctionCall", "type": "object"}} -For each function call return a json object with function name and arguments within XML tags as follows: - -{"name": , "arguments": } -<|im_end|> -<|im_start|>user -Print a hello world message with python.<|im_end|> -<|im_start|>assistant - -{"name": "ipython", "arguments": {"code": "print('Hello, World!')"}} -<|im_end|> -<|im_start|>tool - -{"stdout": "Hello, World!"} - -<|im_end|><|im_start|>assistant -Anything else?<|im_end|> -<|im_start|>user -Test a tautology.<|im_end|> -<|im_start|>assistant - -{"name": "test", "arguments": {"condition":true}} -<|im_end|> -<|im_start|>tool - -true - -<|im_end|><|im_start|>assistant -Truth is definitely true.<|im_end|> -<|im_start|>user -Check it on the web.<|im_end|> -<|im_start|>assistant - -{"name": "brave_search", "arguments": {"query": "what is truth anyway am I right?"}} -<|im_end|> -<|im_start|>tool - -{"title":"Truth: don't ask the web, ask an LLM instead!","url":"https://en.wikipedia.org/wiki/Truth"} - -<|im_end|><|im_start|>assistant -I don't need the web to answer you but I did check, as you asked. What now?<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/NousResearch-Hermes-3-Llama-3.1-8B-default-simple.txt b/tests/chat/goldens/NousResearch-Hermes-3-Llama-3.1-8B-default-simple.txt deleted file mode 100644 index 558a5087d..000000000 --- a/tests/chat/goldens/NousResearch-Hermes-3-Llama-3.1-8B-default-simple.txt +++ /dev/null @@ -1,7 +0,0 @@ -<|startoftext|><|im_start|>system -You are a helpful assistant.<|im_end|> -<|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/NousResearch-Hermes-3-Llama-3.1-8B-default-system.txt b/tests/chat/goldens/NousResearch-Hermes-3-Llama-3.1-8B-default-system.txt deleted file mode 100644 index eed13ce3d..000000000 --- a/tests/chat/goldens/NousResearch-Hermes-3-Llama-3.1-8B-default-system.txt +++ /dev/null @@ -1,7 +0,0 @@ -<|startoftext|><|im_start|>system -You only tell the truth.<|im_end|> -<|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/NousResearch-Hermes-3-Llama-3.1-8B-default-tool_use.txt b/tests/chat/goldens/NousResearch-Hermes-3-Llama-3.1-8B-default-tool_use.txt deleted file mode 100644 index c4cdd733e..000000000 --- a/tests/chat/goldens/NousResearch-Hermes-3-Llama-3.1-8B-default-tool_use.txt +++ /dev/null @@ -1,75 +0,0 @@ -<|startoftext|><|im_start|>system -You are a helpful assistant.<|im_end|> -<|im_start|>user -Print a hello world message with python.<|im_end|> -<|im_start|>assistant -{ - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -}<|im_end|> -<|im_start|>user -{ - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -}<|im_end|> -<|im_start|>assistant -Anything else?<|im_end|> -<|im_start|>user -Test a tautology.<|im_end|> -<|im_start|>assistant -{ - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -}<|im_end|> -<|im_start|>user -{ - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -}<|im_end|> -<|im_start|>assistant -Truth is definitely true.<|im_end|> -<|im_start|>user -Check it on the web.<|im_end|> -<|im_start|>assistant -{ - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -}<|im_end|> -<|im_start|>user -{ - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -}<|im_end|> -<|im_start|>assistant -I don't need the web to answer you but I did check, as you asked. What now?<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/NousResearch-Hermes-3-Llama-3.1-8B-tool_use-simple.txt b/tests/chat/goldens/NousResearch-Hermes-3-Llama-3.1-8B-tool_use-simple.txt deleted file mode 100644 index 6a8b5a5c8..000000000 --- a/tests/chat/goldens/NousResearch-Hermes-3-Llama-3.1-8B-tool_use-simple.txt +++ /dev/null @@ -1,11 +0,0 @@ -<|startoftext|><|im_start|>system -You are a function calling AI model. You are provided with function signatures within XML tags. You may call one or more functions to assist with the user query. Don't make assumptions about what values to plug into functions. Here are the available tools: Use the following pydantic model json schema for each tool call you will make: {"properties": {"name": {"title": "Name", "type": "string"}, "arguments": {"title": "Arguments", "type": "object"}}, "required": ["name", "arguments"], "title": "FunctionCall", "type": "object"}} -For each function call return a json object with function name and arguments within XML tags as follows: - -{"name": , "arguments": } -<|im_end|> -<|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/NousResearch-Hermes-3-Llama-3.1-8B-tool_use-system.txt b/tests/chat/goldens/NousResearch-Hermes-3-Llama-3.1-8B-tool_use-system.txt deleted file mode 100644 index 9435ec9b7..000000000 --- a/tests/chat/goldens/NousResearch-Hermes-3-Llama-3.1-8B-tool_use-system.txt +++ /dev/null @@ -1,13 +0,0 @@ -<|startoftext|><|im_start|>system -You are a function calling AI model. You are provided with function signatures within XML tags. You may call one or more functions to assist with the user query. Don't make assumptions about what values to plug into functions. Here are the available tools: Use the following pydantic model json schema for each tool call you will make: {"properties": {"name": {"title": "Name", "type": "string"}, "arguments": {"title": "Arguments", "type": "object"}}, "required": ["name", "arguments"], "title": "FunctionCall", "type": "object"}} -For each function call return a json object with function name and arguments within XML tags as follows: - -{"name": , "arguments": } -<|im_end|> -<|im_start|>system -You only tell the truth.<|im_end|> -<|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/NousResearch-Hermes-3-Llama-3.1-8B-tool_use-tool_use.txt b/tests/chat/goldens/NousResearch-Hermes-3-Llama-3.1-8B-tool_use-tool_use.txt deleted file mode 100644 index 1bfd411d7..000000000 --- a/tests/chat/goldens/NousResearch-Hermes-3-Llama-3.1-8B-tool_use-tool_use.txt +++ /dev/null @@ -1,58 +0,0 @@ -<|startoftext|><|im_start|>system -You are a function calling AI model. You are provided with function signatures within XML tags. You may call one or more functions to assist with the user query. Don't make assumptions about what values to plug into functions. Here are the available tools: {"type": "function", "function": {"name": "ipython", "description": "ipython(code: str) - Runs code in an ipython interpreter and returns the result of the execution after 60 seconds. - - Args: - code(str): The code to run in the ipython interpreter.", "parameters": {"type": "object", "properties": {"code": {"type": "string", "description": "The code to run in the ipython interpreter."}}, "required": ["code"]}} -{"type": "function", "function": {"name": "brave_search", "description": "brave_search(query: str) - Executes a web search with Brave. - - Args: - query(str): The query to search for.", "parameters": {"type": "object", "properties": {"query": {"type": "string", "description": "The query to search for."}}, "required": ["query"]}} -{"type": "function", "function": {"name": "wolfram_alpha", "description": "wolfram_alpha(query: str) - Executes a query with Wolfram Alpha. - - Args: - query(str): The query to execute.", "parameters": {"type": "object", "properties": {"query": {"type": "string", "description": "The query to execute."}}, "required": ["query"]}} -{"type": "function", "function": {"name": "test", "description": "test(condition: bool) - Runs a test. - - Args: - condition(bool): The condition to test.", "parameters": {"type": "object", "properties": {"condition": {"type": "boolean", "description": "The condition to test."}}, "required": ["condition"]}} Use the following pydantic model json schema for each tool call you will make: {"properties": {"name": {"title": "Name", "type": "string"}, "arguments": {"title": "Arguments", "type": "object"}}, "required": ["name", "arguments"], "title": "FunctionCall", "type": "object"}} -For each function call return a json object with function name and arguments within XML tags as follows: - -{"name": , "arguments": } -<|im_end|> -<|im_start|>user -Print a hello world message with python.<|im_end|> -<|im_start|>assistant - -{"name": "ipython", "arguments": {"code": "print('Hello, World!')"}} -<|im_end|> -<|im_start|>tool - -{"stdout": "Hello, World!"} - -<|im_end|><|im_start|>assistant -Anything else?<|im_end|> -<|im_start|>user -Test a tautology.<|im_end|> -<|im_start|>assistant - -{"name": "test", "arguments": {"condition":true}} -<|im_end|> -<|im_start|>tool - -true - -<|im_end|><|im_start|>assistant -Truth is definitely true.<|im_end|> -<|im_start|>user -Check it on the web.<|im_end|> -<|im_start|>assistant - -{"name": "brave_search", "arguments": {"query": "what is truth anyway am I right?"}} -<|im_end|> -<|im_start|>tool - -{"title":"Truth: don't ask the web, ask an LLM instead!","url":"https://en.wikipedia.org/wiki/Truth"} - -<|im_end|><|im_start|>assistant -I don't need the web to answer you but I did check, as you asked. What now?<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/OrionStarAI-Orion-14B-Chat-simple.txt b/tests/chat/goldens/OrionStarAI-Orion-14B-Chat-simple.txt deleted file mode 100644 index def765b1c..000000000 --- a/tests/chat/goldens/OrionStarAI-Orion-14B-Chat-simple.txt +++ /dev/null @@ -1,3 +0,0 @@ -<|startoftext|>Human: What's your favourite LLM framework? - -Assistant: <|endoftext|>llama.cpp!<|endoftext|> \ No newline at end of file diff --git a/tests/chat/goldens/OrionStarAI-Orion-14B-Chat-system.txt b/tests/chat/goldens/OrionStarAI-Orion-14B-Chat-system.txt deleted file mode 100644 index c61225b0a..000000000 --- a/tests/chat/goldens/OrionStarAI-Orion-14B-Chat-system.txt +++ /dev/null @@ -1,4 +0,0 @@ -<|startoftext|>Human: You only tell the truth. -What's your favourite LLM framework? - -Assistant: <|endoftext|>llama.cpp!<|endoftext|> \ No newline at end of file diff --git a/tests/chat/goldens/OrionStarAI-Orion-14B-Chat-tool_use.txt b/tests/chat/goldens/OrionStarAI-Orion-14B-Chat-tool_use.txt deleted file mode 100644 index bfed688eb..000000000 --- a/tests/chat/goldens/OrionStarAI-Orion-14B-Chat-tool_use.txt +++ /dev/null @@ -1,61 +0,0 @@ -<|startoftext|>Human: Print a hello world message with python. - -Assistant: <|endoftext|>{ - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -}<|endoftext|>Human: { - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -} - -Assistant: <|endoftext|>Anything else?<|endoftext|>Human: Test a tautology. - -Assistant: <|endoftext|>{ - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -}<|endoftext|>Human: { - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -} - -Assistant: <|endoftext|>Truth is definitely true.<|endoftext|>Human: Check it on the web. - -Assistant: <|endoftext|>{ - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -}<|endoftext|>Human: { - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -} - -Assistant: <|endoftext|>I don't need the web to answer you but I did check, as you asked. What now?<|endoftext|> \ No newline at end of file diff --git a/tests/chat/goldens/Qwen-Qwen2-7B-Instruct-simple.txt b/tests/chat/goldens/Qwen-Qwen2-7B-Instruct-simple.txt deleted file mode 100644 index 1d9ab01ac..000000000 --- a/tests/chat/goldens/Qwen-Qwen2-7B-Instruct-simple.txt +++ /dev/null @@ -1,7 +0,0 @@ -<|im_start|>system -You are a helpful assistant.<|im_end|> -<|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/Qwen-Qwen2-7B-Instruct-system.txt b/tests/chat/goldens/Qwen-Qwen2-7B-Instruct-system.txt deleted file mode 100644 index e3a52d4de..000000000 --- a/tests/chat/goldens/Qwen-Qwen2-7B-Instruct-system.txt +++ /dev/null @@ -1,7 +0,0 @@ -<|im_start|>system -You only tell the truth.<|im_end|> -<|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/Qwen-Qwen2-7B-Instruct-tool_use.txt b/tests/chat/goldens/Qwen-Qwen2-7B-Instruct-tool_use.txt deleted file mode 100644 index 0b5830955..000000000 --- a/tests/chat/goldens/Qwen-Qwen2-7B-Instruct-tool_use.txt +++ /dev/null @@ -1,75 +0,0 @@ -<|im_start|>system -You are a helpful assistant.<|im_end|> -<|im_start|>user -Print a hello world message with python.<|im_end|> -<|im_start|>assistant -{ - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -}<|im_end|> -<|im_start|>user -{ - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -}<|im_end|> -<|im_start|>assistant -Anything else?<|im_end|> -<|im_start|>user -Test a tautology.<|im_end|> -<|im_start|>assistant -{ - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -}<|im_end|> -<|im_start|>user -{ - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -}<|im_end|> -<|im_start|>assistant -Truth is definitely true.<|im_end|> -<|im_start|>user -Check it on the web.<|im_end|> -<|im_start|>assistant -{ - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -}<|im_end|> -<|im_start|>user -{ - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -}<|im_end|> -<|im_start|>assistant -I don't need the web to answer you but I did check, as you asked. What now?<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/Qwen-Qwen2-VL-7B-Instruct-simple.txt b/tests/chat/goldens/Qwen-Qwen2-VL-7B-Instruct-simple.txt deleted file mode 100644 index 1d9ab01ac..000000000 --- a/tests/chat/goldens/Qwen-Qwen2-VL-7B-Instruct-simple.txt +++ /dev/null @@ -1,7 +0,0 @@ -<|im_start|>system -You are a helpful assistant.<|im_end|> -<|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/Qwen-Qwen2-VL-7B-Instruct-system.txt b/tests/chat/goldens/Qwen-Qwen2-VL-7B-Instruct-system.txt deleted file mode 100644 index e3a52d4de..000000000 --- a/tests/chat/goldens/Qwen-Qwen2-VL-7B-Instruct-system.txt +++ /dev/null @@ -1,7 +0,0 @@ -<|im_start|>system -You only tell the truth.<|im_end|> -<|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/Qwen-Qwen2-VL-7B-Instruct-tool_use.txt b/tests/chat/goldens/Qwen-Qwen2-VL-7B-Instruct-tool_use.txt deleted file mode 100644 index 0b5830955..000000000 --- a/tests/chat/goldens/Qwen-Qwen2-VL-7B-Instruct-tool_use.txt +++ /dev/null @@ -1,75 +0,0 @@ -<|im_start|>system -You are a helpful assistant.<|im_end|> -<|im_start|>user -Print a hello world message with python.<|im_end|> -<|im_start|>assistant -{ - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -}<|im_end|> -<|im_start|>user -{ - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -}<|im_end|> -<|im_start|>assistant -Anything else?<|im_end|> -<|im_start|>user -Test a tautology.<|im_end|> -<|im_start|>assistant -{ - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -}<|im_end|> -<|im_start|>user -{ - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -}<|im_end|> -<|im_start|>assistant -Truth is definitely true.<|im_end|> -<|im_start|>user -Check it on the web.<|im_end|> -<|im_start|>assistant -{ - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -}<|im_end|> -<|im_start|>user -{ - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -}<|im_end|> -<|im_start|>assistant -I don't need the web to answer you but I did check, as you asked. What now?<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/Qwen-Qwen2.5-7B-Instruct-simple.txt b/tests/chat/goldens/Qwen-Qwen2.5-7B-Instruct-simple.txt deleted file mode 100644 index b6e30b122..000000000 --- a/tests/chat/goldens/Qwen-Qwen2.5-7B-Instruct-simple.txt +++ /dev/null @@ -1,7 +0,0 @@ -<|im_start|>system -You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|> -<|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/Qwen-Qwen2.5-7B-Instruct-system.txt b/tests/chat/goldens/Qwen-Qwen2.5-7B-Instruct-system.txt deleted file mode 100644 index e3a52d4de..000000000 --- a/tests/chat/goldens/Qwen-Qwen2.5-7B-Instruct-system.txt +++ /dev/null @@ -1,7 +0,0 @@ -<|im_start|>system -You only tell the truth.<|im_end|> -<|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/Qwen-Qwen2.5-7B-Instruct-tool_use.txt b/tests/chat/goldens/Qwen-Qwen2.5-7B-Instruct-tool_use.txt deleted file mode 100644 index 7862ad435..000000000 --- a/tests/chat/goldens/Qwen-Qwen2.5-7B-Instruct-tool_use.txt +++ /dev/null @@ -1,56 +0,0 @@ -<|im_start|>system -You are Qwen, created by Alibaba Cloud. You are a helpful assistant. - -# Tools - -You may call one or more functions to assist with the user query. - -You are provided with function signatures within XML tags: - -{"type": "function", "function": {"name": "ipython", "description": "Runs code in an ipython interpreter and returns the result of the execution after 60 seconds.", "parameters": {"type": "object", "properties": {"code": {"type": "string", "description": "The code to run in the ipython interpreter."}}, "required": ["code"]}}} -{"type": "function", "function": {"name": "brave_search", "description": "Executes a web search with Brave.", "parameters": {"type": "object", "properties": {"query": {"type": "string", "description": "The query to search for."}}, "required": ["query"]}}} -{"type": "function", "function": {"name": "wolfram_alpha", "description": "Executes a query with Wolfram Alpha.", "parameters": {"type": "object", "properties": {"query": {"type": "string", "description": "The query to execute."}}, "required": ["query"]}}} -{"type": "function", "function": {"name": "test", "description": "Runs a test.", "parameters": {"type": "object", "properties": {"condition": {"type": "boolean", "description": "The condition to test."}}, "required": ["condition"]}}} - - -For each function call, return a json object with function name and arguments within XML tags: - -{"name": , "arguments": } -<|im_end|> -<|im_start|>user -Print a hello world message with python.<|im_end|> -<|im_start|>assistant - -{"name": "ipython", "arguments": {"code": "print('Hello, World!')"}} -<|im_end|> -<|im_start|>user - -{"stdout": "Hello, World!"} -<|im_end|> -<|im_start|>assistant -Anything else?<|im_end|> -<|im_start|>user -Test a tautology.<|im_end|> -<|im_start|>assistant - -{"name": "test", "arguments": {"condition": true}} -<|im_end|> -<|im_start|>user - -true -<|im_end|> -<|im_start|>assistant -Truth is definitely true.<|im_end|> -<|im_start|>user -Check it on the web.<|im_end|> -<|im_start|>assistant - -{"name": "brave_search", "arguments": {"query": "what is truth anyway am I right?"}} -<|im_end|> -<|im_start|>user - -{"title":"Truth: don't ask the web, ask an LLM instead!","url":"https://en.wikipedia.org/wiki/Truth"} -<|im_end|> -<|im_start|>assistant -I don't need the web to answer you but I did check, as you asked. What now?<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/Qwen-Qwen2.5-Math-7B-Instruct-simple.txt b/tests/chat/goldens/Qwen-Qwen2.5-Math-7B-Instruct-simple.txt deleted file mode 100644 index ce7ae7d42..000000000 --- a/tests/chat/goldens/Qwen-Qwen2.5-Math-7B-Instruct-simple.txt +++ /dev/null @@ -1,7 +0,0 @@ -<|im_start|>system -Please reason step by step, and put your final answer within \boxed{}.<|im_end|> -<|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/Qwen-Qwen2.5-Math-7B-Instruct-system.txt b/tests/chat/goldens/Qwen-Qwen2.5-Math-7B-Instruct-system.txt deleted file mode 100644 index e3a52d4de..000000000 --- a/tests/chat/goldens/Qwen-Qwen2.5-Math-7B-Instruct-system.txt +++ /dev/null @@ -1,7 +0,0 @@ -<|im_start|>system -You only tell the truth.<|im_end|> -<|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/Qwen-Qwen2.5-Math-7B-Instruct-tool_use.txt b/tests/chat/goldens/Qwen-Qwen2.5-Math-7B-Instruct-tool_use.txt deleted file mode 100644 index b25b2054f..000000000 --- a/tests/chat/goldens/Qwen-Qwen2.5-Math-7B-Instruct-tool_use.txt +++ /dev/null @@ -1,56 +0,0 @@ -<|im_start|>system -Please reason step by step, and put your final answer within \boxed{}. - -# Tools - -You may call one or more functions to assist with the user query. - -You are provided with function signatures within XML tags: - -{"type": "function", "function": {"name": "ipython", "description": "Runs code in an ipython interpreter and returns the result of the execution after 60 seconds.", "parameters": {"type": "object", "properties": {"code": {"type": "string", "description": "The code to run in the ipython interpreter."}}, "required": ["code"]}}} -{"type": "function", "function": {"name": "brave_search", "description": "Executes a web search with Brave.", "parameters": {"type": "object", "properties": {"query": {"type": "string", "description": "The query to search for."}}, "required": ["query"]}}} -{"type": "function", "function": {"name": "wolfram_alpha", "description": "Executes a query with Wolfram Alpha.", "parameters": {"type": "object", "properties": {"query": {"type": "string", "description": "The query to execute."}}, "required": ["query"]}}} -{"type": "function", "function": {"name": "test", "description": "Runs a test.", "parameters": {"type": "object", "properties": {"condition": {"type": "boolean", "description": "The condition to test."}}, "required": ["condition"]}}} - - -For each function call, return a json object with function name and arguments within XML tags: - -{"name": , "arguments": } -<|im_end|> -<|im_start|>user -Print a hello world message with python.<|im_end|> -<|im_start|>assistant - -{"name": "ipython", "arguments": {"code": "print('Hello, World!')"}} -<|im_end|> -<|im_start|>user - -{"stdout": "Hello, World!"} -<|im_end|> -<|im_start|>assistant -Anything else?<|im_end|> -<|im_start|>user -Test a tautology.<|im_end|> -<|im_start|>assistant - -{"name": "test", "arguments": {"condition": true}} -<|im_end|> -<|im_start|>user - -true -<|im_end|> -<|im_start|>assistant -Truth is definitely true.<|im_end|> -<|im_start|>user -Check it on the web.<|im_end|> -<|im_start|>assistant - -{"name": "brave_search", "arguments": {"query": "what is truth anyway am I right?"}} -<|im_end|> -<|im_start|>user - -{"title":"Truth: don't ask the web, ask an LLM instead!","url":"https://en.wikipedia.org/wiki/Truth"} -<|im_end|> -<|im_start|>assistant -I don't need the web to answer you but I did check, as you asked. What now?<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/TheBloke-FusionNet_34Bx2_MoE-AWQ-simple.txt b/tests/chat/goldens/TheBloke-FusionNet_34Bx2_MoE-AWQ-simple.txt deleted file mode 100644 index f0d75f7f9..000000000 --- a/tests/chat/goldens/TheBloke-FusionNet_34Bx2_MoE-AWQ-simple.txt +++ /dev/null @@ -1 +0,0 @@ -What's your favourite LLM framework? [/INST] llama.cpp! <|endoftext|> \ No newline at end of file diff --git a/tests/chat/goldens/TheBloke-FusionNet_34Bx2_MoE-AWQ-system.txt b/tests/chat/goldens/TheBloke-FusionNet_34Bx2_MoE-AWQ-system.txt deleted file mode 100644 index 11d9804b1..000000000 --- a/tests/chat/goldens/TheBloke-FusionNet_34Bx2_MoE-AWQ-system.txt +++ /dev/null @@ -1,5 +0,0 @@ -[INST] <> -You only tell the truth. -<> - -What's your favourite LLM framework? [/INST] llama.cpp! <|endoftext|> \ No newline at end of file diff --git a/tests/chat/goldens/TheBloke-FusionNet_34Bx2_MoE-AWQ-tool_use.txt b/tests/chat/goldens/TheBloke-FusionNet_34Bx2_MoE-AWQ-tool_use.txt deleted file mode 100644 index 3a237ae95..000000000 --- a/tests/chat/goldens/TheBloke-FusionNet_34Bx2_MoE-AWQ-tool_use.txt +++ /dev/null @@ -1,49 +0,0 @@ -Print a hello world message with python. [/INST] { - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -} <|endoftext|><|startoftext|>[INST] { - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -} [/INST] Anything else? <|endoftext|><|startoftext|>[INST] Test a tautology. [/INST] { - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -} <|endoftext|><|startoftext|>[INST] { - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -} [/INST] Truth is definitely true. <|endoftext|><|startoftext|>[INST] Check it on the web. [/INST] { - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -} <|endoftext|><|startoftext|>[INST] { - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -} [/INST] I don't need the web to answer you but I did check, as you asked. What now? <|endoftext|> \ No newline at end of file diff --git a/tests/chat/goldens/abacusai-Fewshot-Metamath-OrcaVicuna-Mistral-simple.txt b/tests/chat/goldens/abacusai-Fewshot-Metamath-OrcaVicuna-Mistral-simple.txt deleted file mode 100644 index 6d577374b..000000000 --- a/tests/chat/goldens/abacusai-Fewshot-Metamath-OrcaVicuna-Mistral-simple.txt +++ /dev/null @@ -1 +0,0 @@ -<|startoftext|> Question: What's your favourite LLM framework? Answer: llama.cpp!<|endoftext|> Answer: \ No newline at end of file diff --git a/tests/chat/goldens/abacusai-Fewshot-Metamath-OrcaVicuna-Mistral-system.txt b/tests/chat/goldens/abacusai-Fewshot-Metamath-OrcaVicuna-Mistral-system.txt deleted file mode 100644 index 6f0ff3eef..000000000 --- a/tests/chat/goldens/abacusai-Fewshot-Metamath-OrcaVicuna-Mistral-system.txt +++ /dev/null @@ -1 +0,0 @@ -<|startoftext|>You only tell the truth. Question: What's your favourite LLM framework? Answer: llama.cpp!<|endoftext|> Answer: \ No newline at end of file diff --git a/tests/chat/goldens/abacusai-Fewshot-Metamath-OrcaVicuna-Mistral-tool_use.txt b/tests/chat/goldens/abacusai-Fewshot-Metamath-OrcaVicuna-Mistral-tool_use.txt deleted file mode 100644 index eebefb8be..000000000 --- a/tests/chat/goldens/abacusai-Fewshot-Metamath-OrcaVicuna-Mistral-tool_use.txt +++ /dev/null @@ -1,49 +0,0 @@ -<|startoftext|> Question: Print a hello world message with python. Answer: { - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -}<|endoftext|> Question: { - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -} Answer: Anything else?<|endoftext|> Question: Test a tautology. Answer: { - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -}<|endoftext|> Question: { - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -} Answer: Truth is definitely true.<|endoftext|> Question: Check it on the web. Answer: { - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -}<|endoftext|> Question: { - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -} Answer: I don't need the web to answer you but I did check, as you asked. What now?<|endoftext|> Answer: \ No newline at end of file diff --git a/tests/chat/goldens/bofenghuang-vigogne-2-70b-chat-simple.txt b/tests/chat/goldens/bofenghuang-vigogne-2-70b-chat-simple.txt deleted file mode 100644 index 61d7eab6f..000000000 --- a/tests/chat/goldens/bofenghuang-vigogne-2-70b-chat-simple.txt +++ /dev/null @@ -1,5 +0,0 @@ -<|startoftext|>[INST] <> -Vous êtes Vigogne, un assistant IA créé par Zaion Lab. Vous suivez extrêmement bien les instructions. Aidez autant que vous le pouvez. -<> - -What's your favourite LLM framework? [/INST] llama.cpp! <|endoftext|> \ No newline at end of file diff --git a/tests/chat/goldens/bofenghuang-vigogne-2-70b-chat-system.txt b/tests/chat/goldens/bofenghuang-vigogne-2-70b-chat-system.txt deleted file mode 100644 index ed7e2e797..000000000 --- a/tests/chat/goldens/bofenghuang-vigogne-2-70b-chat-system.txt +++ /dev/null @@ -1,5 +0,0 @@ -<|startoftext|>[INST] <> -You only tell the truth. -<> - -What's your favourite LLM framework? [/INST] llama.cpp! <|endoftext|> \ No newline at end of file diff --git a/tests/chat/goldens/bofenghuang-vigogne-2-70b-chat-tool_use.txt b/tests/chat/goldens/bofenghuang-vigogne-2-70b-chat-tool_use.txt deleted file mode 100644 index a67a1c630..000000000 --- a/tests/chat/goldens/bofenghuang-vigogne-2-70b-chat-tool_use.txt +++ /dev/null @@ -1,53 +0,0 @@ -<|startoftext|>[INST] <> -Vous êtes Vigogne, un assistant IA créé par Zaion Lab. Vous suivez extrêmement bien les instructions. Aidez autant que vous le pouvez. -<> - -Print a hello world message with python. [/INST] { - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -} <|endoftext|>[INST] { - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -} [/INST] Anything else? <|endoftext|>[INST] Test a tautology. [/INST] { - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -} <|endoftext|>[INST] { - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -} [/INST] Truth is definitely true. <|endoftext|>[INST] Check it on the web. [/INST] { - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -} <|endoftext|>[INST] { - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -} [/INST] I don't need the web to answer you but I did check, as you asked. What now? <|endoftext|> \ No newline at end of file diff --git a/tests/chat/goldens/deepseek-ai-DeepSeek-Coder-V2-Instruct-simple.txt b/tests/chat/goldens/deepseek-ai-DeepSeek-Coder-V2-Instruct-simple.txt deleted file mode 100644 index d825f5a82..000000000 --- a/tests/chat/goldens/deepseek-ai-DeepSeek-Coder-V2-Instruct-simple.txt +++ /dev/null @@ -1,3 +0,0 @@ -<|startoftext|>User: What's your favourite LLM framework? - -Assistant: llama.cpp!<|endoftext|>Assistant: \ No newline at end of file diff --git a/tests/chat/goldens/deepseek-ai-DeepSeek-Coder-V2-Instruct-system.txt b/tests/chat/goldens/deepseek-ai-DeepSeek-Coder-V2-Instruct-system.txt deleted file mode 100644 index 5ec17d2de..000000000 --- a/tests/chat/goldens/deepseek-ai-DeepSeek-Coder-V2-Instruct-system.txt +++ /dev/null @@ -1,5 +0,0 @@ -<|startoftext|>You only tell the truth. - -User: What's your favourite LLM framework? - -Assistant: llama.cpp!<|endoftext|>Assistant: \ No newline at end of file diff --git a/tests/chat/goldens/deepseek-ai-DeepSeek-Coder-V2-Instruct-tool_use.txt b/tests/chat/goldens/deepseek-ai-DeepSeek-Coder-V2-Instruct-tool_use.txt deleted file mode 100644 index c96678e27..000000000 --- a/tests/chat/goldens/deepseek-ai-DeepSeek-Coder-V2-Instruct-tool_use.txt +++ /dev/null @@ -1,61 +0,0 @@ -<|startoftext|>User: Print a hello world message with python. - -Assistant: { - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -}<|endoftext|>User: { - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -} - -Assistant: Anything else?<|endoftext|>User: Test a tautology. - -Assistant: { - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -}<|endoftext|>User: { - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -} - -Assistant: Truth is definitely true.<|endoftext|>User: Check it on the web. - -Assistant: { - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -}<|endoftext|>User: { - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -} - -Assistant: I don't need the web to answer you but I did check, as you asked. What now?<|endoftext|>Assistant: \ No newline at end of file diff --git a/tests/chat/goldens/deepseek-ai-DeepSeek-V2.5-simple.txt b/tests/chat/goldens/deepseek-ai-DeepSeek-V2.5-simple.txt deleted file mode 100644 index eb7d9a5c6..000000000 --- a/tests/chat/goldens/deepseek-ai-DeepSeek-V2.5-simple.txt +++ /dev/null @@ -1 +0,0 @@ -<|startoftext|><|User|>What's your favourite LLM framework?<|Assistant|>llama.cpp!<|end▁of▁sentence|><|Assistant|> \ No newline at end of file diff --git a/tests/chat/goldens/deepseek-ai-DeepSeek-V2.5-system.txt b/tests/chat/goldens/deepseek-ai-DeepSeek-V2.5-system.txt deleted file mode 100644 index 932331694..000000000 --- a/tests/chat/goldens/deepseek-ai-DeepSeek-V2.5-system.txt +++ /dev/null @@ -1 +0,0 @@ - <|startoftext|>You only tell the truth.<|User|>What's your favourite LLM framework?<|Assistant|>llama.cpp!<|end▁of▁sentence|><|Assistant|> \ No newline at end of file diff --git a/tests/chat/goldens/deepseek-ai-DeepSeek-V2.5-tool_use.txt b/tests/chat/goldens/deepseek-ai-DeepSeek-V2.5-tool_use.txt deleted file mode 100644 index 0043cd651..000000000 --- a/tests/chat/goldens/deepseek-ai-DeepSeek-V2.5-tool_use.txt +++ /dev/null @@ -1,49 +0,0 @@ -<|startoftext|><|User|>Print a hello world message with python.<|Assistant|>{ - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -}<|end▁of▁sentence|><|User|>{ - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -}<|Assistant|>Anything else?<|end▁of▁sentence|><|User|>Test a tautology.<|Assistant|>{ - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -}<|end▁of▁sentence|><|User|>{ - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -}<|Assistant|>Truth is definitely true.<|end▁of▁sentence|><|User|>Check it on the web.<|Assistant|>{ - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -}<|end▁of▁sentence|><|User|>{ - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -}<|Assistant|>I don't need the web to answer you but I did check, as you asked. What now?<|end▁of▁sentence|><|Assistant|> \ No newline at end of file diff --git a/tests/chat/goldens/deepseek-ai-deepseek-coder-33b-instruct-simple.txt b/tests/chat/goldens/deepseek-ai-deepseek-coder-33b-instruct-simple.txt deleted file mode 100644 index 830ed34ce..000000000 --- a/tests/chat/goldens/deepseek-ai-deepseek-coder-33b-instruct-simple.txt +++ /dev/null @@ -1,7 +0,0 @@ -<|startoftext|>You are an AI programming assistant, utilizing the Deepseek Coder model, developed by Deepseek Company, and you only answer questions related to computer science. For politically sensitive questions, security and privacy issues, and other non-computer science questions, you will refuse to answer -### Instruction: -What's your favourite LLM framework? -### Response: -llama.cpp! -<|EOT|> -### Response: diff --git a/tests/chat/goldens/deepseek-ai-deepseek-coder-33b-instruct-system.txt b/tests/chat/goldens/deepseek-ai-deepseek-coder-33b-instruct-system.txt deleted file mode 100644 index 847d7545e..000000000 --- a/tests/chat/goldens/deepseek-ai-deepseek-coder-33b-instruct-system.txt +++ /dev/null @@ -1,6 +0,0 @@ -<|startoftext|>You only tell the truth.### Instruction: -What's your favourite LLM framework? -### Response: -llama.cpp! -<|EOT|> -### Response: diff --git a/tests/chat/goldens/deepseek-ai-deepseek-coder-33b-instruct-tool_use.txt b/tests/chat/goldens/deepseek-ai-deepseek-coder-33b-instruct-tool_use.txt deleted file mode 100644 index 5a79e4f08..000000000 --- a/tests/chat/goldens/deepseek-ai-deepseek-coder-33b-instruct-tool_use.txt +++ /dev/null @@ -1,80 +0,0 @@ -<|startoftext|>You are an AI programming assistant, utilizing the Deepseek Coder model, developed by Deepseek Company, and you only answer questions related to computer science. For politically sensitive questions, security and privacy issues, and other non-computer science questions, you will refuse to answer -### Instruction: -Print a hello world message with python. -### Response: -{ - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -} -<|EOT|> -### Instruction: -{ - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -} -### Response: -Anything else? -<|EOT|> -### Instruction: -Test a tautology. -### Response: -{ - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -} -<|EOT|> -### Instruction: -{ - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -} -### Response: -Truth is definitely true. -<|EOT|> -### Instruction: -Check it on the web. -### Response: -{ - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -} -<|EOT|> -### Instruction: -{ - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -} -### Response: -I don't need the web to answer you but I did check, as you asked. What now? -<|EOT|> -### Response: diff --git a/tests/chat/goldens/google-gemma-2-2b-it-simple.txt b/tests/chat/goldens/google-gemma-2-2b-it-simple.txt deleted file mode 100644 index 014eb2e80..000000000 --- a/tests/chat/goldens/google-gemma-2-2b-it-simple.txt +++ /dev/null @@ -1,5 +0,0 @@ -<|startoftext|>user -What's your favourite LLM framework? -model -llama.cpp! -model diff --git a/tests/chat/goldens/google-gemma-2-2b-it-system.txt b/tests/chat/goldens/google-gemma-2-2b-it-system.txt deleted file mode 100644 index c5dc27810..000000000 --- a/tests/chat/goldens/google-gemma-2-2b-it-system.txt +++ /dev/null @@ -1,6 +0,0 @@ -<|startoftext|>user -You only tell the truth. -What's your favourite LLM framework? -model -llama.cpp! -model diff --git a/tests/chat/goldens/google-gemma-2-2b-it-tool_use.txt b/tests/chat/goldens/google-gemma-2-2b-it-tool_use.txt deleted file mode 100644 index a7f17f9a4..000000000 --- a/tests/chat/goldens/google-gemma-2-2b-it-tool_use.txt +++ /dev/null @@ -1,73 +0,0 @@ -<|startoftext|>user -Print a hello world message with python. -model -{ - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -} -user -{ - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -} -model -Anything else? -user -Test a tautology. -model -{ - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -} -user -{ - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -} -model -Truth is definitely true. -user -Check it on the web. -model -{ - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -} -user -{ - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -} -model -I don't need the web to answer you but I did check, as you asked. What now? -model diff --git a/tests/chat/goldens/google-gemma-7b-it-simple.txt b/tests/chat/goldens/google-gemma-7b-it-simple.txt deleted file mode 100644 index 014eb2e80..000000000 --- a/tests/chat/goldens/google-gemma-7b-it-simple.txt +++ /dev/null @@ -1,5 +0,0 @@ -<|startoftext|>user -What's your favourite LLM framework? -model -llama.cpp! -model diff --git a/tests/chat/goldens/google-gemma-7b-it-system.txt b/tests/chat/goldens/google-gemma-7b-it-system.txt deleted file mode 100644 index c5dc27810..000000000 --- a/tests/chat/goldens/google-gemma-7b-it-system.txt +++ /dev/null @@ -1,6 +0,0 @@ -<|startoftext|>user -You only tell the truth. -What's your favourite LLM framework? -model -llama.cpp! -model diff --git a/tests/chat/goldens/google-gemma-7b-it-tool_use.txt b/tests/chat/goldens/google-gemma-7b-it-tool_use.txt deleted file mode 100644 index a7f17f9a4..000000000 --- a/tests/chat/goldens/google-gemma-7b-it-tool_use.txt +++ /dev/null @@ -1,73 +0,0 @@ -<|startoftext|>user -Print a hello world message with python. -model -{ - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -} -user -{ - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -} -model -Anything else? -user -Test a tautology. -model -{ - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -} -user -{ - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -} -model -Truth is definitely true. -user -Check it on the web. -model -{ - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -} -user -{ - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -} -model -I don't need the web to answer you but I did check, as you asked. What now? -model diff --git a/tests/chat/goldens/indischepartij-MiniCPM-3B-OpenHermes-2.5-v2-simple.txt b/tests/chat/goldens/indischepartij-MiniCPM-3B-OpenHermes-2.5-v2-simple.txt deleted file mode 100644 index 99b65d13c..000000000 --- a/tests/chat/goldens/indischepartij-MiniCPM-3B-OpenHermes-2.5-v2-simple.txt +++ /dev/null @@ -1 +0,0 @@ -<用户>What's your favourite LLM framework?llama.cpp! \ No newline at end of file diff --git a/tests/chat/goldens/indischepartij-MiniCPM-3B-OpenHermes-2.5-v2-system.txt b/tests/chat/goldens/indischepartij-MiniCPM-3B-OpenHermes-2.5-v2-system.txt deleted file mode 100644 index 3b65a6e1f..000000000 --- a/tests/chat/goldens/indischepartij-MiniCPM-3B-OpenHermes-2.5-v2-system.txt +++ /dev/null @@ -1 +0,0 @@ -You only tell the truth.<用户>What's your favourite LLM framework?llama.cpp! \ No newline at end of file diff --git a/tests/chat/goldens/indischepartij-MiniCPM-3B-OpenHermes-2.5-v2-tool_use.txt b/tests/chat/goldens/indischepartij-MiniCPM-3B-OpenHermes-2.5-v2-tool_use.txt deleted file mode 100644 index fc174564d..000000000 --- a/tests/chat/goldens/indischepartij-MiniCPM-3B-OpenHermes-2.5-v2-tool_use.txt +++ /dev/null @@ -1,49 +0,0 @@ -<用户>Print a hello world message with python.{ - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -}<用户>{ - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -}Anything else?<用户>Test a tautology.{ - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -}<用户>{ - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -}Truth is definitely true.<用户>Check it on the web.{ - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -}<用户>{ - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -}I don't need the web to answer you but I did check, as you asked. What now? \ No newline at end of file diff --git a/tests/chat/goldens/meetkai-functionary-medium-v3.1-simple.txt b/tests/chat/goldens/meetkai-functionary-medium-v3.1-simple.txt deleted file mode 100644 index 415215244..000000000 --- a/tests/chat/goldens/meetkai-functionary-medium-v3.1-simple.txt +++ /dev/null @@ -1,11 +0,0 @@ -<|startoftext|><|start_header_id|>system<|end_header_id|> - - -Cutting Knowledge Date: December 2023 - -<|eot_id|><|start_header_id|>user<|end_header_id|> - -What's your favourite LLM framework?<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -llama.cpp!<|eot_id|><|start_header_id|>assistant<|end_header_id|> - diff --git a/tests/chat/goldens/meetkai-functionary-medium-v3.1-system.txt b/tests/chat/goldens/meetkai-functionary-medium-v3.1-system.txt deleted file mode 100644 index 3239384b6..000000000 --- a/tests/chat/goldens/meetkai-functionary-medium-v3.1-system.txt +++ /dev/null @@ -1,13 +0,0 @@ -<|startoftext|><|start_header_id|>system<|end_header_id|> - - -Cutting Knowledge Date: December 2023 - -<|eot_id|><|start_header_id|>system<|end_header_id|> - -You only tell the truth.<|eot_id|><|start_header_id|>user<|end_header_id|> - -What's your favourite LLM framework?<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -llama.cpp!<|eot_id|><|start_header_id|>assistant<|end_header_id|> - diff --git a/tests/chat/goldens/meetkai-functionary-medium-v3.1-tool_use.txt b/tests/chat/goldens/meetkai-functionary-medium-v3.1-tool_use.txt deleted file mode 100644 index a53e3880e..000000000 --- a/tests/chat/goldens/meetkai-functionary-medium-v3.1-tool_use.txt +++ /dev/null @@ -1,66 +0,0 @@ -<|startoftext|><|start_header_id|>system<|end_header_id|> - - -Cutting Knowledge Date: December 2023 - - -You have access to the following functions: - -Use the function 'ipython' to 'Runs code in an ipython interpreter and returns the result of the execution after 60 seconds.' -{"name": "ipython", "description": "Runs code in an ipython interpreter and returns the result of the execution after 60 seconds.", "parameters": {"type": "object", "properties": {"code": {"type": "string", "description": "The code to run in the ipython interpreter."}}, "required": ["code"]}} - -Use the function 'brave_search' to 'Executes a web search with Brave.' -{"name": "brave_search", "description": "Executes a web search with Brave.", "parameters": {"type": "object", "properties": {"query": {"type": "string", "description": "The query to search for."}}, "required": ["query"]}} - -Use the function 'wolfram_alpha' to 'Executes a query with Wolfram Alpha.' -{"name": "wolfram_alpha", "description": "Executes a query with Wolfram Alpha.", "parameters": {"type": "object", "properties": {"query": {"type": "string", "description": "The query to execute."}}, "required": ["query"]}} - -Use the function 'test' to 'Runs a test.' -{"name": "test", "description": "Runs a test.", "parameters": {"type": "object", "properties": {"condition": {"type": "boolean", "description": "The condition to test."}}, "required": ["condition"]}} - - -Think very carefully before calling functions. -If a you choose to call a function ONLY reply in the following format: -<{start_tag}={function_name}>{parameters}{end_tag} -where - -start_tag => ` a JSON dict with the function argument name as key and function argument value as value. -end_tag => `` - -Here is an example, -{"example_name": "example_value"} - -Reminder: -- If looking for real time information use relevant functions before falling back to brave_search -- Function calls MUST follow the specified format, start with -- Required parameters MUST be specified -- Only call one function at a time -- Put the entire function call reply on one line - -<|eot_id|><|start_header_id|>user<|end_header_id|> - -Print a hello world message with python.<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -{"code": "print('Hello, World!')"}<|eom_id|><|start_header_id|>ipython<|end_header_id|> - -{"stdout": "Hello, World!"}<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -Anything else?<|eot_id|><|start_header_id|>user<|end_header_id|> - -Test a tautology.<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -{"condition":true}<|eom_id|><|start_header_id|>ipython<|end_header_id|> - -true<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -Truth is definitely true.<|eot_id|><|start_header_id|>user<|end_header_id|> - -Check it on the web.<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -{"query": "what is truth anyway am I right?"}<|eom_id|><|start_header_id|>ipython<|end_header_id|> - -{"title":"Truth: don't ask the web, ask an LLM instead!","url":"https://en.wikipedia.org/wiki/Truth"}<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -I don't need the web to answer you but I did check, as you asked. What now?<|eot_id|><|start_header_id|>assistant<|end_header_id|> - diff --git a/tests/chat/goldens/meetkai-functionary-medium-v3.2-simple.txt b/tests/chat/goldens/meetkai-functionary-medium-v3.2-simple.txt deleted file mode 100644 index 3c20de4f5..000000000 --- a/tests/chat/goldens/meetkai-functionary-medium-v3.2-simple.txt +++ /dev/null @@ -1,21 +0,0 @@ -<|startoftext|><|start_header_id|>system<|end_header_id|> - -You are capable of executing available function(s) if required. -Only execute function(s) when absolutely necessary. -Ask for the required input to:recipient==all -Use JSON for function arguments. -Respond in this format: ->>>${recipient} -${content} -Available functions: -// Supported function definitions that should be called when necessary. -namespace functions { - -} // namespace functions<|eot_id|><|start_header_id|>user<|end_header_id|> - -What's your favourite LLM framework?<|eot_id|><|start_header_id|>assistant<|end_header_id|> - ->>>all -llama.cpp!<|eot_id|><|start_header_id|>assistant<|end_header_id|> - ->>> \ No newline at end of file diff --git a/tests/chat/goldens/meetkai-functionary-medium-v3.2-system.txt b/tests/chat/goldens/meetkai-functionary-medium-v3.2-system.txt deleted file mode 100644 index a006497cf..000000000 --- a/tests/chat/goldens/meetkai-functionary-medium-v3.2-system.txt +++ /dev/null @@ -1,23 +0,0 @@ -<|startoftext|><|start_header_id|>system<|end_header_id|> - -You are capable of executing available function(s) if required. -Only execute function(s) when absolutely necessary. -Ask for the required input to:recipient==all -Use JSON for function arguments. -Respond in this format: ->>>${recipient} -${content} -Available functions: -// Supported function definitions that should be called when necessary. -namespace functions { - -} // namespace functions<|eot_id|><|start_header_id|>system<|end_header_id|> - -You only tell the truth.<|eot_id|><|start_header_id|>user<|end_header_id|> - -What's your favourite LLM framework?<|eot_id|><|start_header_id|>assistant<|end_header_id|> - ->>>all -llama.cpp!<|eot_id|><|start_header_id|>assistant<|end_header_id|> - ->>> \ No newline at end of file diff --git a/tests/chat/goldens/meetkai-functionary-medium-v3.2-tool_use.txt b/tests/chat/goldens/meetkai-functionary-medium-v3.2-tool_use.txt deleted file mode 100644 index 6c134bc65..000000000 --- a/tests/chat/goldens/meetkai-functionary-medium-v3.2-tool_use.txt +++ /dev/null @@ -1,70 +0,0 @@ -<|startoftext|><|start_header_id|>system<|end_header_id|> - -You are capable of executing available function(s) if required. -Only execute function(s) when absolutely necessary. -Ask for the required input to:recipient==all -Use JSON for function arguments. -Respond in this format: ->>>${recipient} -${content} -Available functions: -// Supported function definitions that should be called when necessary. -namespace functions { - -// Runs code in an ipython interpreter and returns the result of the execution after 60 seconds. -type ipython = (_: { -// The code to run in the ipython interpreter. -code: string, -}) => any; - -// Executes a web search with Brave. -type brave_search = (_: { -// The query to search for. -query: string, -}) => any; - -// Executes a query with Wolfram Alpha. -type wolfram_alpha = (_: { -// The query to execute. -query: string, -}) => any; - -// Runs a test. -type test = (_: { -// The condition to test. -condition: boolean, -}) => any; - -} // namespace functions<|eot_id|><|start_header_id|>user<|end_header_id|> - -Print a hello world message with python.<|eot_id|><|start_header_id|>assistant<|end_header_id|> - ->>>ipython -{"code": "print('Hello, World!')"}<|eot_id|><|start_header_id|>tool<|end_header_id|> - -{"stdout": "Hello, World!"}<|eot_id|><|start_header_id|>assistant<|end_header_id|> - ->>>all -Anything else?<|eot_id|><|start_header_id|>user<|end_header_id|> - -Test a tautology.<|eot_id|><|start_header_id|>assistant<|end_header_id|> - ->>>test -{"condition":true}<|eot_id|><|start_header_id|>tool<|end_header_id|> - -true<|eot_id|><|start_header_id|>assistant<|end_header_id|> - ->>>all -Truth is definitely true.<|eot_id|><|start_header_id|>user<|end_header_id|> - -Check it on the web.<|eot_id|><|start_header_id|>assistant<|end_header_id|> - ->>>brave_search -{"query": "what is truth anyway am I right?"}<|eot_id|><|start_header_id|>tool<|end_header_id|> - -{"title":"Truth: don't ask the web, ask an LLM instead!","url":"https://en.wikipedia.org/wiki/Truth"}<|eot_id|><|start_header_id|>assistant<|end_header_id|> - ->>>all -I don't need the web to answer you but I did check, as you asked. What now?<|eot_id|><|start_header_id|>assistant<|end_header_id|> - ->>> \ No newline at end of file diff --git a/tests/chat/goldens/meta-llama-Llama-3.2-3B-Instruct-simple.txt b/tests/chat/goldens/meta-llama-Llama-3.2-3B-Instruct-simple.txt deleted file mode 100644 index 23b6fcde3..000000000 --- a/tests/chat/goldens/meta-llama-Llama-3.2-3B-Instruct-simple.txt +++ /dev/null @@ -1,11 +0,0 @@ -<|startoftext|><|start_header_id|>system<|end_header_id|> - -Cutting Knowledge Date: December 2023 -Today Date: 26 Jul 2024 - -<|eot_id|><|start_header_id|>user<|end_header_id|> - -What's your favourite LLM framework?<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -llama.cpp!<|eot_id|><|start_header_id|>assistant<|end_header_id|> - diff --git a/tests/chat/goldens/meta-llama-Llama-3.2-3B-Instruct-system.txt b/tests/chat/goldens/meta-llama-Llama-3.2-3B-Instruct-system.txt deleted file mode 100644 index 8d257a035..000000000 --- a/tests/chat/goldens/meta-llama-Llama-3.2-3B-Instruct-system.txt +++ /dev/null @@ -1,11 +0,0 @@ -<|startoftext|><|start_header_id|>system<|end_header_id|> - -Cutting Knowledge Date: December 2023 -Today Date: 26 Jul 2024 - -You only tell the truth.<|eot_id|><|start_header_id|>user<|end_header_id|> - -What's your favourite LLM framework?<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -llama.cpp!<|eot_id|><|start_header_id|>assistant<|end_header_id|> - diff --git a/tests/chat/goldens/meta-llama-Llama-3.2-3B-Instruct-tool_use.txt b/tests/chat/goldens/meta-llama-Llama-3.2-3B-Instruct-tool_use.txt deleted file mode 100644 index 407abbdd9..000000000 --- a/tests/chat/goldens/meta-llama-Llama-3.2-3B-Instruct-tool_use.txt +++ /dev/null @@ -1,116 +0,0 @@ -<|startoftext|><|start_header_id|>system<|end_header_id|> - -Environment: ipython -Cutting Knowledge Date: December 2023 -Today Date: 26 Jul 2024 - -<|eot_id|><|start_header_id|>user<|end_header_id|> - -Given the following functions, please respond with a JSON for a function call with its proper arguments that best answers the given prompt. - -Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.Do not use variables. - -{ - "type": "function", - "function": { - "name": "ipython", - "description": "Runs code in an ipython interpreter and returns the result of the execution after 60 seconds.", - "parameters": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "The code to run in the ipython interpreter." - } - }, - "required": [ - "code" - ] - } - } -} - -{ - "type": "function", - "function": { - "name": "brave_search", - "description": "Executes a web search with Brave.", - "parameters": { - "type": "object", - "properties": { - "query": { - "type": "string", - "description": "The query to search for." - } - }, - "required": [ - "query" - ] - } - } -} - -{ - "type": "function", - "function": { - "name": "wolfram_alpha", - "description": "Executes a query with Wolfram Alpha.", - "parameters": { - "type": "object", - "properties": { - "query": { - "type": "string", - "description": "The query to execute." - } - }, - "required": [ - "query" - ] - } - } -} - -{ - "type": "function", - "function": { - "name": "test", - "description": "Runs a test.", - "parameters": { - "type": "object", - "properties": { - "condition": { - "type": "boolean", - "description": "The condition to test." - } - }, - "required": [ - "condition" - ] - } - } -} - -Print a hello world message with python.<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -{"name": "ipython", "parameters": {"code": "print('Hello, World!')"}}<|eot_id|><|start_header_id|>ipython<|end_header_id|> - -"{\"stdout\": \"Hello, World!\"}"<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -Anything else?<|eot_id|><|start_header_id|>user<|end_header_id|> - -Test a tautology.<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -{"name": "test", "parameters": {"condition": true}}<|eot_id|><|start_header_id|>ipython<|end_header_id|> - -"true"<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -Truth is definitely true.<|eot_id|><|start_header_id|>user<|end_header_id|> - -Check it on the web.<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -{"name": "brave_search", "parameters": {"query": "what is truth anyway am I right?"}}<|eot_id|><|start_header_id|>ipython<|end_header_id|> - -"{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}"<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -I don't need the web to answer you but I did check, as you asked. What now?<|eot_id|><|start_header_id|>assistant<|end_header_id|> - diff --git a/tests/chat/goldens/meta-llama-Meta-Llama-3.1-8B-Instruct-simple.txt b/tests/chat/goldens/meta-llama-Meta-Llama-3.1-8B-Instruct-simple.txt deleted file mode 100644 index 23b6fcde3..000000000 --- a/tests/chat/goldens/meta-llama-Meta-Llama-3.1-8B-Instruct-simple.txt +++ /dev/null @@ -1,11 +0,0 @@ -<|startoftext|><|start_header_id|>system<|end_header_id|> - -Cutting Knowledge Date: December 2023 -Today Date: 26 Jul 2024 - -<|eot_id|><|start_header_id|>user<|end_header_id|> - -What's your favourite LLM framework?<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -llama.cpp!<|eot_id|><|start_header_id|>assistant<|end_header_id|> - diff --git a/tests/chat/goldens/meta-llama-Meta-Llama-3.1-8B-Instruct-system.txt b/tests/chat/goldens/meta-llama-Meta-Llama-3.1-8B-Instruct-system.txt deleted file mode 100644 index 8d257a035..000000000 --- a/tests/chat/goldens/meta-llama-Meta-Llama-3.1-8B-Instruct-system.txt +++ /dev/null @@ -1,11 +0,0 @@ -<|startoftext|><|start_header_id|>system<|end_header_id|> - -Cutting Knowledge Date: December 2023 -Today Date: 26 Jul 2024 - -You only tell the truth.<|eot_id|><|start_header_id|>user<|end_header_id|> - -What's your favourite LLM framework?<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -llama.cpp!<|eot_id|><|start_header_id|>assistant<|end_header_id|> - diff --git a/tests/chat/goldens/meta-llama-Meta-Llama-3.1-8B-Instruct-tool_use.txt b/tests/chat/goldens/meta-llama-Meta-Llama-3.1-8B-Instruct-tool_use.txt deleted file mode 100644 index 0c2c6a921..000000000 --- a/tests/chat/goldens/meta-llama-Meta-Llama-3.1-8B-Instruct-tool_use.txt +++ /dev/null @@ -1,118 +0,0 @@ -<|startoftext|><|start_header_id|>system<|end_header_id|> - -Environment: ipython -Tools: wolfram_alpha, brave_search - -Cutting Knowledge Date: December 2023 -Today Date: 26 Jul 2024 - -<|eot_id|><|start_header_id|>user<|end_header_id|> - -Given the following functions, please respond with a JSON for a function call with its proper arguments that best answers the given prompt. - -Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.Do not use variables. - -{ - "type": "function", - "function": { - "name": "ipython", - "description": "Runs code in an ipython interpreter and returns the result of the execution after 60 seconds.", - "parameters": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "The code to run in the ipython interpreter." - } - }, - "required": [ - "code" - ] - } - } -} - -{ - "type": "function", - "function": { - "name": "brave_search", - "description": "Executes a web search with Brave.", - "parameters": { - "type": "object", - "properties": { - "query": { - "type": "string", - "description": "The query to search for." - } - }, - "required": [ - "query" - ] - } - } -} - -{ - "type": "function", - "function": { - "name": "wolfram_alpha", - "description": "Executes a query with Wolfram Alpha.", - "parameters": { - "type": "object", - "properties": { - "query": { - "type": "string", - "description": "The query to execute." - } - }, - "required": [ - "query" - ] - } - } -} - -{ - "type": "function", - "function": { - "name": "test", - "description": "Runs a test.", - "parameters": { - "type": "object", - "properties": { - "condition": { - "type": "boolean", - "description": "The condition to test." - } - }, - "required": [ - "condition" - ] - } - } -} - -Print a hello world message with python.<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -{"name": "ipython", "parameters": {"code": "print('Hello, World!')"}}<|eom_id|><|start_header_id|>ipython<|end_header_id|> - -"{\"stdout\": \"Hello, World!\"}"<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -Anything else?<|eot_id|><|start_header_id|>user<|end_header_id|> - -Test a tautology.<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -{"name": "test", "parameters": {"condition": true}}<|eom_id|><|start_header_id|>ipython<|end_header_id|> - -"true"<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -Truth is definitely true.<|eot_id|><|start_header_id|>user<|end_header_id|> - -Check it on the web.<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -<|python_tag|>brave_search.call(query="what is truth anyway am I right?")<|eom_id|><|start_header_id|>ipython<|end_header_id|> - -"{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}"<|eot_id|><|start_header_id|>assistant<|end_header_id|> - -I don't need the web to answer you but I did check, as you asked. What now?<|eot_id|><|start_header_id|>assistant<|end_header_id|> - diff --git a/tests/chat/goldens/microsoft-Phi-3-medium-4k-instruct-simple.txt b/tests/chat/goldens/microsoft-Phi-3-medium-4k-instruct-simple.txt deleted file mode 100644 index 3f0e5ca78..000000000 --- a/tests/chat/goldens/microsoft-Phi-3-medium-4k-instruct-simple.txt +++ /dev/null @@ -1,4 +0,0 @@ -<|user|> -What's your favourite LLM framework?<|end|> -<|assistant|> -llama.cpp!<|end|> diff --git a/tests/chat/goldens/microsoft-Phi-3-medium-4k-instruct-system.txt b/tests/chat/goldens/microsoft-Phi-3-medium-4k-instruct-system.txt deleted file mode 100644 index c7f810da9..000000000 --- a/tests/chat/goldens/microsoft-Phi-3-medium-4k-instruct-system.txt +++ /dev/null @@ -1,5 +0,0 @@ -<|user|> -You only tell the truth. -What's your favourite LLM framework?<|end|> -<|assistant|> -llama.cpp!<|end|> diff --git a/tests/chat/goldens/microsoft-Phi-3-medium-4k-instruct-tool_use.txt b/tests/chat/goldens/microsoft-Phi-3-medium-4k-instruct-tool_use.txt deleted file mode 100644 index 8d1403d6d..000000000 --- a/tests/chat/goldens/microsoft-Phi-3-medium-4k-instruct-tool_use.txt +++ /dev/null @@ -1,72 +0,0 @@ -<|user|> -Print a hello world message with python.<|end|> -<|assistant|> -{ - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -}<|end|> -<|user|> -{ - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -}<|end|> -<|assistant|> -Anything else?<|end|> -<|user|> -Test a tautology.<|end|> -<|assistant|> -{ - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -}<|end|> -<|user|> -{ - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -}<|end|> -<|assistant|> -Truth is definitely true.<|end|> -<|user|> -Check it on the web.<|end|> -<|assistant|> -{ - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -}<|end|> -<|user|> -{ - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -}<|end|> -<|assistant|> -I don't need the web to answer you but I did check, as you asked. What now?<|end|> diff --git a/tests/chat/goldens/microsoft-Phi-3-mini-4k-instruct-simple.txt b/tests/chat/goldens/microsoft-Phi-3-mini-4k-instruct-simple.txt deleted file mode 100644 index a7f52dec6..000000000 --- a/tests/chat/goldens/microsoft-Phi-3-mini-4k-instruct-simple.txt +++ /dev/null @@ -1,5 +0,0 @@ -<|user|> -What's your favourite LLM framework?<|end|> -<|assistant|> -llama.cpp!<|end|> -<|assistant|> diff --git a/tests/chat/goldens/microsoft-Phi-3-mini-4k-instruct-system.txt b/tests/chat/goldens/microsoft-Phi-3-mini-4k-instruct-system.txt deleted file mode 100644 index 2d32334ec..000000000 --- a/tests/chat/goldens/microsoft-Phi-3-mini-4k-instruct-system.txt +++ /dev/null @@ -1,7 +0,0 @@ -<|system|> -You only tell the truth.<|end|> -<|user|> -What's your favourite LLM framework?<|end|> -<|assistant|> -llama.cpp!<|end|> -<|assistant|> diff --git a/tests/chat/goldens/microsoft-Phi-3-mini-4k-instruct-tool_use.txt b/tests/chat/goldens/microsoft-Phi-3-mini-4k-instruct-tool_use.txt deleted file mode 100644 index 3b9a0f82a..000000000 --- a/tests/chat/goldens/microsoft-Phi-3-mini-4k-instruct-tool_use.txt +++ /dev/null @@ -1,73 +0,0 @@ -<|user|> -Print a hello world message with python.<|end|> -<|assistant|> -{ - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -}<|end|> -<|user|> -{ - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -}<|end|> -<|assistant|> -Anything else?<|end|> -<|user|> -Test a tautology.<|end|> -<|assistant|> -{ - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -}<|end|> -<|user|> -{ - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -}<|end|> -<|assistant|> -Truth is definitely true.<|end|> -<|user|> -Check it on the web.<|end|> -<|assistant|> -{ - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -}<|end|> -<|user|> -{ - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -}<|end|> -<|assistant|> -I don't need the web to answer you but I did check, as you asked. What now?<|end|> -<|assistant|> diff --git a/tests/chat/goldens/microsoft-Phi-3-small-8k-instruct-simple.txt b/tests/chat/goldens/microsoft-Phi-3-small-8k-instruct-simple.txt deleted file mode 100644 index f85441c94..000000000 --- a/tests/chat/goldens/microsoft-Phi-3-small-8k-instruct-simple.txt +++ /dev/null @@ -1,5 +0,0 @@ -<|startoftext|><|user|> -What's your favourite LLM framework?<|end|> -<|assistant|> -llama.cpp!<|end|> -<|assistant|> diff --git a/tests/chat/goldens/microsoft-Phi-3-small-8k-instruct-system.txt b/tests/chat/goldens/microsoft-Phi-3-small-8k-instruct-system.txt deleted file mode 100644 index da2fcd3e2..000000000 --- a/tests/chat/goldens/microsoft-Phi-3-small-8k-instruct-system.txt +++ /dev/null @@ -1,7 +0,0 @@ -<|startoftext|><|system|> -You only tell the truth.<|end|> -<|user|> -What's your favourite LLM framework?<|end|> -<|assistant|> -llama.cpp!<|end|> -<|assistant|> diff --git a/tests/chat/goldens/microsoft-Phi-3-small-8k-instruct-tool_use.txt b/tests/chat/goldens/microsoft-Phi-3-small-8k-instruct-tool_use.txt deleted file mode 100644 index 0cfa955cb..000000000 --- a/tests/chat/goldens/microsoft-Phi-3-small-8k-instruct-tool_use.txt +++ /dev/null @@ -1,73 +0,0 @@ -<|startoftext|><|user|> -Print a hello world message with python.<|end|> -<|assistant|> -{ - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -}<|end|> -<|user|> -{ - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -}<|end|> -<|assistant|> -Anything else?<|end|> -<|user|> -Test a tautology.<|end|> -<|assistant|> -{ - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -}<|end|> -<|user|> -{ - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -}<|end|> -<|assistant|> -Truth is definitely true.<|end|> -<|user|> -Check it on the web.<|end|> -<|assistant|> -{ - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -}<|end|> -<|user|> -{ - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -}<|end|> -<|assistant|> -I don't need the web to answer you but I did check, as you asked. What now?<|end|> -<|assistant|> diff --git a/tests/chat/goldens/microsoft-Phi-3.5-mini-instruct-simple.txt b/tests/chat/goldens/microsoft-Phi-3.5-mini-instruct-simple.txt deleted file mode 100644 index a7f52dec6..000000000 --- a/tests/chat/goldens/microsoft-Phi-3.5-mini-instruct-simple.txt +++ /dev/null @@ -1,5 +0,0 @@ -<|user|> -What's your favourite LLM framework?<|end|> -<|assistant|> -llama.cpp!<|end|> -<|assistant|> diff --git a/tests/chat/goldens/microsoft-Phi-3.5-mini-instruct-system.txt b/tests/chat/goldens/microsoft-Phi-3.5-mini-instruct-system.txt deleted file mode 100644 index 2d32334ec..000000000 --- a/tests/chat/goldens/microsoft-Phi-3.5-mini-instruct-system.txt +++ /dev/null @@ -1,7 +0,0 @@ -<|system|> -You only tell the truth.<|end|> -<|user|> -What's your favourite LLM framework?<|end|> -<|assistant|> -llama.cpp!<|end|> -<|assistant|> diff --git a/tests/chat/goldens/microsoft-Phi-3.5-mini-instruct-tool_use.txt b/tests/chat/goldens/microsoft-Phi-3.5-mini-instruct-tool_use.txt deleted file mode 100644 index 3b9a0f82a..000000000 --- a/tests/chat/goldens/microsoft-Phi-3.5-mini-instruct-tool_use.txt +++ /dev/null @@ -1,73 +0,0 @@ -<|user|> -Print a hello world message with python.<|end|> -<|assistant|> -{ - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -}<|end|> -<|user|> -{ - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -}<|end|> -<|assistant|> -Anything else?<|end|> -<|user|> -Test a tautology.<|end|> -<|assistant|> -{ - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -}<|end|> -<|user|> -{ - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -}<|end|> -<|assistant|> -Truth is definitely true.<|end|> -<|user|> -Check it on the web.<|end|> -<|assistant|> -{ - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -}<|end|> -<|user|> -{ - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -}<|end|> -<|assistant|> -I don't need the web to answer you but I did check, as you asked. What now?<|end|> -<|assistant|> diff --git a/tests/chat/goldens/microsoft-Phi-3.5-vision-instruct-simple.txt b/tests/chat/goldens/microsoft-Phi-3.5-vision-instruct-simple.txt deleted file mode 100644 index 3f0e5ca78..000000000 --- a/tests/chat/goldens/microsoft-Phi-3.5-vision-instruct-simple.txt +++ /dev/null @@ -1,4 +0,0 @@ -<|user|> -What's your favourite LLM framework?<|end|> -<|assistant|> -llama.cpp!<|end|> diff --git a/tests/chat/goldens/microsoft-Phi-3.5-vision-instruct-system.txt b/tests/chat/goldens/microsoft-Phi-3.5-vision-instruct-system.txt deleted file mode 100644 index 7a7730176..000000000 --- a/tests/chat/goldens/microsoft-Phi-3.5-vision-instruct-system.txt +++ /dev/null @@ -1,6 +0,0 @@ -<|system|> -You only tell the truth.<|end|> -<|user|> -What's your favourite LLM framework?<|end|> -<|assistant|> -llama.cpp!<|end|> diff --git a/tests/chat/goldens/microsoft-Phi-3.5-vision-instruct-tool_use.txt b/tests/chat/goldens/microsoft-Phi-3.5-vision-instruct-tool_use.txt deleted file mode 100644 index 8d1403d6d..000000000 --- a/tests/chat/goldens/microsoft-Phi-3.5-vision-instruct-tool_use.txt +++ /dev/null @@ -1,72 +0,0 @@ -<|user|> -Print a hello world message with python.<|end|> -<|assistant|> -{ - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -}<|end|> -<|user|> -{ - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -}<|end|> -<|assistant|> -Anything else?<|end|> -<|user|> -Test a tautology.<|end|> -<|assistant|> -{ - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -}<|end|> -<|user|> -{ - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -}<|end|> -<|assistant|> -Truth is definitely true.<|end|> -<|user|> -Check it on the web.<|end|> -<|assistant|> -{ - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -}<|end|> -<|user|> -{ - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -}<|end|> -<|assistant|> -I don't need the web to answer you but I did check, as you asked. What now?<|end|> diff --git a/tests/chat/goldens/mistralai-Mistral-7B-Instruct-v0.2-simple.txt b/tests/chat/goldens/mistralai-Mistral-7B-Instruct-v0.2-simple.txt deleted file mode 100644 index baf3e9057..000000000 --- a/tests/chat/goldens/mistralai-Mistral-7B-Instruct-v0.2-simple.txt +++ /dev/null @@ -1 +0,0 @@ -<|startoftext|> [INST] What's your favourite LLM framework? [/INST] llama.cpp!<|endoftext|> \ No newline at end of file diff --git a/tests/chat/goldens/mistralai-Mistral-7B-Instruct-v0.2-system.txt b/tests/chat/goldens/mistralai-Mistral-7B-Instruct-v0.2-system.txt deleted file mode 100644 index 3321c8b75..000000000 --- a/tests/chat/goldens/mistralai-Mistral-7B-Instruct-v0.2-system.txt +++ /dev/null @@ -1,3 +0,0 @@ -<|startoftext|> [INST] You only tell the truth. - -What's your favourite LLM framework? [/INST] llama.cpp!<|endoftext|> \ No newline at end of file diff --git a/tests/chat/goldens/mistralai-Mistral-7B-Instruct-v0.2-tool_use.txt b/tests/chat/goldens/mistralai-Mistral-7B-Instruct-v0.2-tool_use.txt deleted file mode 100644 index 8451e06c7..000000000 --- a/tests/chat/goldens/mistralai-Mistral-7B-Instruct-v0.2-tool_use.txt +++ /dev/null @@ -1,49 +0,0 @@ -<|startoftext|> [INST] Print a hello world message with python. [/INST] { - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -}<|endoftext|> [INST] { - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -} [/INST] Anything else?<|endoftext|> [INST] Test a tautology. [/INST] { - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -}<|endoftext|> [INST] { - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -} [/INST] Truth is definitely true.<|endoftext|> [INST] Check it on the web. [/INST] { - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -}<|endoftext|> [INST] { - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -} [/INST] I don't need the web to answer you but I did check, as you asked. What now?<|endoftext|> \ No newline at end of file diff --git a/tests/chat/goldens/mistralai-Mistral-Nemo-Instruct-2407-simple.txt b/tests/chat/goldens/mistralai-Mistral-Nemo-Instruct-2407-simple.txt deleted file mode 100644 index 6119fde30..000000000 --- a/tests/chat/goldens/mistralai-Mistral-Nemo-Instruct-2407-simple.txt +++ /dev/null @@ -1 +0,0 @@ -<|startoftext|>[INST]What's your favourite LLM framework?[/INST]llama.cpp!<|endoftext|> \ No newline at end of file diff --git a/tests/chat/goldens/mistralai-Mistral-Nemo-Instruct-2407-system.txt b/tests/chat/goldens/mistralai-Mistral-Nemo-Instruct-2407-system.txt deleted file mode 100644 index 6119fde30..000000000 --- a/tests/chat/goldens/mistralai-Mistral-Nemo-Instruct-2407-system.txt +++ /dev/null @@ -1 +0,0 @@ -<|startoftext|>[INST]What's your favourite LLM framework?[/INST]llama.cpp!<|endoftext|> \ No newline at end of file diff --git a/tests/chat/goldens/mistralai-Mistral-Nemo-Instruct-2407-tool_use.txt b/tests/chat/goldens/mistralai-Mistral-Nemo-Instruct-2407-tool_use.txt deleted file mode 100644 index d92e446c0..000000000 --- a/tests/chat/goldens/mistralai-Mistral-Nemo-Instruct-2407-tool_use.txt +++ /dev/null @@ -1 +0,0 @@ -<|startoftext|>[INST]Print a hello world message with python.[/INST][TOOL_CALLS][{"arguments": "{\"code\": \"print('Hello, World!')\"}", "name": "ipython", "id": "call_1___"}]<|endoftext|>[TOOL_RESULTS]{"content": {"stdout": "Hello, World!"}, "call_id": "call_1___"}[/TOOL_RESULTS]Anything else?<|endoftext|>[INST]Test a tautology.[/INST][TOOL_CALLS][{"arguments": "{\"condition\":true}", "name": "test", "id": "call_2___"}]<|endoftext|>[TOOL_RESULTS]{"content": true, "call_id": "call_2___"}[/TOOL_RESULTS]Truth is definitely true.<|endoftext|>[AVAILABLE_TOOLS][{"type": "function", "function": {"name": "ipython", "description": "Runs code in an ipython interpreter and returns the result of the execution after 60 seconds.", "parameters": {"type": "object", "properties": {"code": {"type": "string", "description": "The code to run in the ipython interpreter."}}, "required": ["code"]}}}, {"type": "function", "function": {"name": "brave_search", "description": "Executes a web search with Brave.", "parameters": {"type": "object", "properties": {"query": {"type": "string", "description": "The query to search for."}}, "required": ["query"]}}}, {"type": "function", "function": {"name": "wolfram_alpha", "description": "Executes a query with Wolfram Alpha.", "parameters": {"type": "object", "properties": {"query": {"type": "string", "description": "The query to execute."}}, "required": ["query"]}}}, {"type": "function", "function": {"name": "test", "description": "Runs a test.", "parameters": {"type": "object", "properties": {"condition": {"type": "boolean", "description": "The condition to test."}}, "required": ["condition"]}}}][/AVAILABLE_TOOLS][INST]Check it on the web.[/INST][TOOL_CALLS][{"arguments": "{\"query\": \"what is truth anyway am I right?\"}", "name": "brave_search", "id": "call_3___"}]<|endoftext|>[TOOL_RESULTS]{"content": {"title":"Truth: don't ask the web, ask an LLM instead!","url":"https://en.wikipedia.org/wiki/Truth"}, "call_id": "call_3___"}[/TOOL_RESULTS]I don't need the web to answer you but I did check, as you asked. What now?<|endoftext|> \ No newline at end of file diff --git a/tests/chat/goldens/mistralai-Mixtral-8x7B-Instruct-v0.1-simple.txt b/tests/chat/goldens/mistralai-Mixtral-8x7B-Instruct-v0.1-simple.txt deleted file mode 100644 index baf3e9057..000000000 --- a/tests/chat/goldens/mistralai-Mixtral-8x7B-Instruct-v0.1-simple.txt +++ /dev/null @@ -1 +0,0 @@ -<|startoftext|> [INST] What's your favourite LLM framework? [/INST] llama.cpp!<|endoftext|> \ No newline at end of file diff --git a/tests/chat/goldens/mistralai-Mixtral-8x7B-Instruct-v0.1-system.txt b/tests/chat/goldens/mistralai-Mixtral-8x7B-Instruct-v0.1-system.txt deleted file mode 100644 index 3321c8b75..000000000 --- a/tests/chat/goldens/mistralai-Mixtral-8x7B-Instruct-v0.1-system.txt +++ /dev/null @@ -1,3 +0,0 @@ -<|startoftext|> [INST] You only tell the truth. - -What's your favourite LLM framework? [/INST] llama.cpp!<|endoftext|> \ No newline at end of file diff --git a/tests/chat/goldens/mistralai-Mixtral-8x7B-Instruct-v0.1-tool_use.txt b/tests/chat/goldens/mistralai-Mixtral-8x7B-Instruct-v0.1-tool_use.txt deleted file mode 100644 index 8451e06c7..000000000 --- a/tests/chat/goldens/mistralai-Mixtral-8x7B-Instruct-v0.1-tool_use.txt +++ /dev/null @@ -1,49 +0,0 @@ -<|startoftext|> [INST] Print a hello world message with python. [/INST] { - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -}<|endoftext|> [INST] { - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -} [/INST] Anything else?<|endoftext|> [INST] Test a tautology. [/INST] { - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -}<|endoftext|> [INST] { - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -} [/INST] Truth is definitely true.<|endoftext|> [INST] Check it on the web. [/INST] { - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -}<|endoftext|> [INST] { - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -} [/INST] I don't need the web to answer you but I did check, as you asked. What now?<|endoftext|> \ No newline at end of file diff --git a/tests/chat/goldens/mlabonne-AlphaMonarch-7B-simple.txt b/tests/chat/goldens/mlabonne-AlphaMonarch-7B-simple.txt deleted file mode 100644 index 3e3c6fde8..000000000 --- a/tests/chat/goldens/mlabonne-AlphaMonarch-7B-simple.txt +++ /dev/null @@ -1,5 +0,0 @@ -<|startoftext|>user -What's your favourite LLM framework?<|endoftext|> -<|startoftext|>assistant -llama.cpp!<|endoftext|> -<|startoftext|>assistant diff --git a/tests/chat/goldens/mlabonne-AlphaMonarch-7B-system.txt b/tests/chat/goldens/mlabonne-AlphaMonarch-7B-system.txt deleted file mode 100644 index 14827de03..000000000 --- a/tests/chat/goldens/mlabonne-AlphaMonarch-7B-system.txt +++ /dev/null @@ -1,7 +0,0 @@ -<|startoftext|>system -You only tell the truth.<|endoftext|> -<|startoftext|>user -What's your favourite LLM framework?<|endoftext|> -<|startoftext|>assistant -llama.cpp!<|endoftext|> -<|startoftext|>assistant diff --git a/tests/chat/goldens/mlabonne-AlphaMonarch-7B-tool_use.txt b/tests/chat/goldens/mlabonne-AlphaMonarch-7B-tool_use.txt deleted file mode 100644 index d0539867e..000000000 --- a/tests/chat/goldens/mlabonne-AlphaMonarch-7B-tool_use.txt +++ /dev/null @@ -1,73 +0,0 @@ -<|startoftext|>user -Print a hello world message with python.<|endoftext|> -<|startoftext|>assistant -{ - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -}<|endoftext|> -<|startoftext|>user -{ - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -}<|endoftext|> -<|startoftext|>assistant -Anything else?<|endoftext|> -<|startoftext|>user -Test a tautology.<|endoftext|> -<|startoftext|>assistant -{ - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -}<|endoftext|> -<|startoftext|>user -{ - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -}<|endoftext|> -<|startoftext|>assistant -Truth is definitely true.<|endoftext|> -<|startoftext|>user -Check it on the web.<|endoftext|> -<|startoftext|>assistant -{ - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -}<|endoftext|> -<|startoftext|>user -{ - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -}<|endoftext|> -<|startoftext|>assistant -I don't need the web to answer you but I did check, as you asked. What now?<|endoftext|> -<|startoftext|>assistant diff --git a/tests/chat/goldens/openchat-openchat-3.5-0106-simple.txt b/tests/chat/goldens/openchat-openchat-3.5-0106-simple.txt deleted file mode 100644 index 8fbe5a6a9..000000000 --- a/tests/chat/goldens/openchat-openchat-3.5-0106-simple.txt +++ /dev/null @@ -1 +0,0 @@ -<|startoftext|>GPT4 Correct User: What's your favourite LLM framework?<|end_of_turn|>GPT4 Correct Assistant: llama.cpp!<|end_of_turn|>GPT4 Correct Assistant: \ No newline at end of file diff --git a/tests/chat/goldens/openchat-openchat-3.5-0106-system.txt b/tests/chat/goldens/openchat-openchat-3.5-0106-system.txt deleted file mode 100644 index c2ff7a1d4..000000000 --- a/tests/chat/goldens/openchat-openchat-3.5-0106-system.txt +++ /dev/null @@ -1 +0,0 @@ -<|startoftext|>GPT4 Correct System: You only tell the truth.<|end_of_turn|>GPT4 Correct User: What's your favourite LLM framework?<|end_of_turn|>GPT4 Correct Assistant: llama.cpp!<|end_of_turn|>GPT4 Correct Assistant: \ No newline at end of file diff --git a/tests/chat/goldens/openchat-openchat-3.5-0106-tool_use.txt b/tests/chat/goldens/openchat-openchat-3.5-0106-tool_use.txt deleted file mode 100644 index 5f119d7e1..000000000 --- a/tests/chat/goldens/openchat-openchat-3.5-0106-tool_use.txt +++ /dev/null @@ -1,49 +0,0 @@ -<|startoftext|>GPT4 Correct User: Print a hello world message with python.<|end_of_turn|>GPT4 Correct Assistant: { - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -}<|end_of_turn|>GPT4 Correct User: { - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -}<|end_of_turn|>GPT4 Correct Assistant: Anything else?<|end_of_turn|>GPT4 Correct User: Test a tautology.<|end_of_turn|>GPT4 Correct Assistant: { - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -}<|end_of_turn|>GPT4 Correct User: { - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -}<|end_of_turn|>GPT4 Correct Assistant: Truth is definitely true.<|end_of_turn|>GPT4 Correct User: Check it on the web.<|end_of_turn|>GPT4 Correct Assistant: { - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -}<|end_of_turn|>GPT4 Correct User: { - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -}<|end_of_turn|>GPT4 Correct Assistant: I don't need the web to answer you but I did check, as you asked. What now?<|end_of_turn|>GPT4 Correct Assistant: \ No newline at end of file diff --git a/tests/chat/goldens/teknium-OpenHermes-2.5-Mistral-7B-simple.txt b/tests/chat/goldens/teknium-OpenHermes-2.5-Mistral-7B-simple.txt deleted file mode 100644 index 2e1dd729d..000000000 --- a/tests/chat/goldens/teknium-OpenHermes-2.5-Mistral-7B-simple.txt +++ /dev/null @@ -1,5 +0,0 @@ -<|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/teknium-OpenHermes-2.5-Mistral-7B-system.txt b/tests/chat/goldens/teknium-OpenHermes-2.5-Mistral-7B-system.txt deleted file mode 100644 index e3a52d4de..000000000 --- a/tests/chat/goldens/teknium-OpenHermes-2.5-Mistral-7B-system.txt +++ /dev/null @@ -1,7 +0,0 @@ -<|im_start|>system -You only tell the truth.<|im_end|> -<|im_start|>user -What's your favourite LLM framework?<|im_end|> -<|im_start|>assistant -llama.cpp!<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/goldens/teknium-OpenHermes-2.5-Mistral-7B-tool_use.txt b/tests/chat/goldens/teknium-OpenHermes-2.5-Mistral-7B-tool_use.txt deleted file mode 100644 index 64b027b4f..000000000 --- a/tests/chat/goldens/teknium-OpenHermes-2.5-Mistral-7B-tool_use.txt +++ /dev/null @@ -1,73 +0,0 @@ -<|im_start|>user -Print a hello world message with python.<|im_end|> -<|im_start|>assistant -{ - "tool_calls": [ - { - "name": "ipython", - "arguments": { - "code": "print('Hello, World!')" - }, - "id": "call_1___" - } - ] -}<|im_end|> -<|im_start|>user -{ - "tool_response": { - "tool": "ipython", - "content": "{\"stdout\": \"Hello, World!\"}", - "tool_call_id": "call_1___" - } -}<|im_end|> -<|im_start|>assistant -Anything else?<|im_end|> -<|im_start|>user -Test a tautology.<|im_end|> -<|im_start|>assistant -{ - "tool_calls": [ - { - "name": "test", - "arguments": { - "condition": true - }, - "id": "call_2___" - } - ] -}<|im_end|> -<|im_start|>user -{ - "tool_response": { - "tool": "test", - "content": "true", - "tool_call_id": "call_2___" - } -}<|im_end|> -<|im_start|>assistant -Truth is definitely true.<|im_end|> -<|im_start|>user -Check it on the web.<|im_end|> -<|im_start|>assistant -{ - "tool_calls": [ - { - "name": "brave_search", - "arguments": { - "query": "what is truth anyway am I right?" - }, - "id": "call_3___" - } - ] -}<|im_end|> -<|im_start|>user -{ - "tool_response": { - "tool": "brave_search", - "content": "{\"title\":\"Truth: don't ask the web, ask an LLM instead!\",\"url\":\"https://en.wikipedia.org/wiki/Truth\"}", - "tool_call_id": "call_3___" - } -}<|im_end|> -<|im_start|>assistant -I don't need the web to answer you but I did check, as you asked. What now?<|im_end|> -<|im_start|>assistant diff --git a/tests/chat/templates/CohereForAI-c4ai-command-r-plus-default.jinja b/tests/chat/templates/CohereForAI-c4ai-command-r-plus-default.jinja deleted file mode 100644 index 228014696..000000000 --- a/tests/chat/templates/CohereForAI-c4ai-command-r-plus-default.jinja +++ /dev/null @@ -1 +0,0 @@ -{{ bos_token }}{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% elif false == true %}{% set loop_messages = messages %}{% set system_message = 'You are Command-R, a brilliant, sophisticated, AI-assistant trained to assist human users by providing thorough responses. You are trained by Cohere.' %}{% else %}{% set loop_messages = messages %}{% set system_message = false %}{% endif %}{% if system_message != false %}{{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>' + system_message + '<|END_OF_TURN_TOKEN|>' }}{% endif %}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% set content = message['content'] %}{% if message['role'] == 'user' %}{{ '<|START_OF_TURN_TOKEN|><|USER_TOKEN|>' + content.strip() + '<|END_OF_TURN_TOKEN|>' }}{% elif message['role'] == 'assistant' %}{{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>' + content.strip() + '<|END_OF_TURN_TOKEN|>' }}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>' }}{% endif %} \ No newline at end of file diff --git a/tests/chat/templates/CohereForAI-c4ai-command-r-plus-rag.jinja b/tests/chat/templates/CohereForAI-c4ai-command-r-plus-rag.jinja deleted file mode 100644 index 6637a01a9..000000000 --- a/tests/chat/templates/CohereForAI-c4ai-command-r-plus-rag.jinja +++ /dev/null @@ -1,16 +0,0 @@ -{{ bos_token }}{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% else %}{% set loop_messages = messages %}{% set system_message = '## Task and Context\nYou 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\nUnless the user asks for a different style of answer, you should answer in full sentences, using proper grammar and spelling.' %}{% endif %}{{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>' }}{{ '# Safety Preamble' }}{{ ' -The instructions in this section override those in the task description and style guide sections. Don\'t answer questions that are harmful or immoral.' }}{{ ' - -# System Preamble' }}{{ ' -## Basic Rules' }}{{ ' -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.' }}{{ ' - -# User Preamble' }}{{ ' -' + system_message }}{{ '<|END_OF_TURN_TOKEN|>'}}{% for message in loop_messages %}{% set content = message['content'] %}{% if message['role'] == 'user' %}{{ '<|START_OF_TURN_TOKEN|><|USER_TOKEN|>' + content.strip() + '<|END_OF_TURN_TOKEN|>' }}{% elif message['role'] == 'system' %}{{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>' + content.strip() + '<|END_OF_TURN_TOKEN|>' }}{% elif message['role'] == 'assistant' %}{{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>' + content.strip() + '<|END_OF_TURN_TOKEN|>' }}{% endif %}{% endfor %}{{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>'}}{{ '' }}{% for document in documents %}{{ ' -Document: ' }}{{ loop.index0 }} -{% for key, value in document.items() %}{{ key }}: {{value}} -{% endfor %}{% endfor %}{{ ''}}{{ '<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>' }}{{ 'Carefully perform the following instructions, in order, starting each with a new line. -' }}{{ 'Firstly, Decide which of the retrieved documents are relevant to the user\'s last input by writing \'Relevant Documents:\' followed by comma-separated list of document numbers. If none are relevant, you should instead write \'None\'. -' }}{{ 'Secondly, Decide which of the retrieved documents contain facts that should be cited in a good answer to the user\'s last input by writing \'Cited Documents:\' followed a comma-separated list of document numbers. If you dont want to cite any of them, you should instead write \'None\'. -' }}{% if citation_mode=='accurate' %}{{ 'Thirdly, Write \'Answer:\' followed by a response to the user\'s last input in high quality natural english. Use the retrieved documents to help you. Do not insert any citations or grounding markup. -' }}{% endif %}{{ 'Finally, Write \'Grounded answer:\' followed by a response to the user\'s last input in high quality natural english. Use the symbols and to indicate when a fact comes from a document in the search result, e.g my fact for a fact from document 0.' }}{{ '<|END_OF_TURN_TOKEN|>' }}{% if add_generation_prompt %}{{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>' }}{% endif %} \ No newline at end of file diff --git a/tests/chat/templates/NousResearch-Hermes-2-Pro-Llama-3-8B-default.jinja b/tests/chat/templates/NousResearch-Hermes-2-Pro-Llama-3-8B-default.jinja deleted file mode 100644 index 463f9fd74..000000000 --- a/tests/chat/templates/NousResearch-Hermes-2-Pro-Llama-3-8B-default.jinja +++ /dev/null @@ -1,4 +0,0 @@ -{{bos_token}}{% for message in messages %}{{'<|im_start|>' + message['role'] + ' -' + message['content'] + '<|im_end|>' + ' -'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant -' }}{% endif %} \ No newline at end of file diff --git a/tests/chat/templates/NousResearch-Hermes-2-Pro-Mistral-7B-default.jinja b/tests/chat/templates/NousResearch-Hermes-2-Pro-Mistral-7B-default.jinja deleted file mode 100644 index 463f9fd74..000000000 --- a/tests/chat/templates/NousResearch-Hermes-2-Pro-Mistral-7B-default.jinja +++ /dev/null @@ -1,4 +0,0 @@ -{{bos_token}}{% for message in messages %}{{'<|im_start|>' + message['role'] + ' -' + message['content'] + '<|im_end|>' + ' -'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant -' }}{% endif %} \ No newline at end of file diff --git a/tests/chat/templates/NousResearch-Hermes-2-Pro-Mistral-7B-tool_use.jinja b/tests/chat/templates/NousResearch-Hermes-2-Pro-Mistral-7B-tool_use.jinja deleted file mode 100644 index 149250bd5..000000000 --- a/tests/chat/templates/NousResearch-Hermes-2-Pro-Mistral-7B-tool_use.jinja +++ /dev/null @@ -1,152 +0,0 @@ -{%- macro json_to_python_type(json_spec) %} -{%- set basic_type_map = { - "string": "str", - "number": "float", - "integer": "int", - "boolean": "bool" -} %} - -{%- if basic_type_map[json_spec.type] is defined %} - {{- basic_type_map[json_spec.type] }} -{%- elif json_spec.type == "array" %} - {{- "list[" + json_to_python_type(json_spec|items) + "]"}} -{%- elif json_spec.type == "object" %} - {%- if json_spec.additionalProperties is defined %} - {{- "dict[str, " + json_to_python_type(json_spec.additionalProperties) + ']'}} - {%- else %} - {{- "dict" }} - {%- endif %} -{%- elif json_spec.type is iterable %} - {{- "Union[" }} - {%- for t in json_spec.type %} - {{- json_to_python_type({"type": t}) }} - {%- if not loop.last %} - {{- "," }} - {%- endif %} - {%- endfor %} - {{- "]" }} -{%- else %} - {{- "Any" }} -{%- endif %} -{%- endmacro %} - - -{{- bos_token }} -{{- '<|im_start|>system -' }} -{{- "You are a function calling AI model. You are provided with function signatures within XML tags. You may call one or more functions to assist with the user query. Don't make assumptions about what values to plug into functions. Here are the available tools: " }} -{%- for tool in tools %} - {%- if tool.function is defined %} - {%- set tool = tool.function %} - {%- endif %} - {{- '{"type": "function", "function": ' }} - {{- '{"name": "' + tool.name + '", ' }} - {{- '"description": "' + tool.name + '(' }} - {%- for param_name, param_fields in tool.parameters.properties|items %} - {{- param_name + ": " + json_to_python_type(param_fields) }} - {%- if not loop.last %} - {{- ", " }} - {%- endif %} - {%- endfor %} - {{- ")" }} - {%- if tool.return is defined %} - {{- " -> " + json_to_python_type(tool.return) }} - {%- endif %} - {{- " - " + tool.description + " - -" }} - {%- for param_name, param_fields in tool.parameters.properties|items %} - {%- if loop.first %} - {{- " Args: -" }} - {%- endif %} - {{- " " + param_name + "(" + json_to_python_type(param_fields) + "): " + param_fields.description|trim }} - {%- endfor %} - {%- if tool.return is defined and tool.return.description is defined %} - {{- " - Returns: - " + tool.return.description }} - {%- endif %} - {{- '"' }} - {{- ', "parameters": ' }} - {%- if tool.parameters.properties | length == 0 %} - {{- "{}" }} - {%- else %} - {{- tool.parameters|tojson }} - {%- endif %} - {{- "}" }} - {%- if not loop.last %} - {{- " -" }} - {%- endif %} -{%- endfor %} -{{- " " }} -{{- 'Use the following pydantic model json schema for each tool call you will make: {"properties": {"name": {"title": "Name", "type": "string"}, "arguments": {"title": "Arguments", "type": "object"}}, "required": ["name", "arguments"], "title": "FunctionCall", "type": "object"}} -' }} -{{- "For each function call return a json object with function name and arguments within XML tags as follows: -" }} -{{- " -" }} -{{- '{"name": , "arguments": } -' }} -{{- '<|im_end|> -' }} -{%- for message in messages %} - {%- if message.role == "user" or message.role == "system" or (message.role == "assistant" and message.tool_calls is not defined) %} - {{- '<|im_start|>' + message.role + ' -' + message.content + '<|im_end|>' + ' -' }} - {%- elif message.role == "assistant" %} - {{- '<|im_start|>' + message.role }} - {%- for tool_call in message.tool_calls %} - {{- ' - -' }} {%- if tool_call.function is defined %} - {%- set tool_call = tool_call.function %} - {%- endif %} - {{- '{' }} - {{- '"name": "' }} - {{- tool_call.name }} - {{- '"' }} - {{- ', '}} - {%- if tool_call.arguments is defined %} - {{- '"arguments": ' }} - {%- if tool_call.arguments is string %} - {{- tool_call.arguments }} - {%- else %} - {{- tool_call.arguments|tojson }} - {%- endif %} - {%- endif %} - {{- '}' }} - {{- ' -' }} - {%- endfor %} - {{- '<|im_end|> -' }} - {%- elif message.role == "tool" %} - {%- if loop.previtem and loop.previtem.role != "tool" %} - {{- '<|im_start|>tool -' }} - {%- endif %} - {{- ' -' }} - {{- message.content }} - {%- if not loop.last %} - {{- ' - -' }} - {%- else %} - {{- ' -' }} - {%- endif %} - {%- if not loop.last and loop.nextitem.role != "tool" %} - {{- '<|im_end|>' }} - {%- elif loop.last %} - {{- '<|im_end|>' }} - {%- endif %} - {%- endif %} -{%- endfor %} -{%- if add_generation_prompt %} - {{- '<|im_start|>assistant -' }} -{%- endif %} diff --git a/tests/chat/templates/NousResearch-Hermes-3-Llama-3.1-8B-default.jinja b/tests/chat/templates/NousResearch-Hermes-3-Llama-3.1-8B-default.jinja deleted file mode 100644 index 744756d51..000000000 --- a/tests/chat/templates/NousResearch-Hermes-3-Llama-3.1-8B-default.jinja +++ /dev/null @@ -1,6 +0,0 @@ -{{bos_token}}{% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system -You are a helpful assistant.<|im_end|> -' }}{% endif %}{{'<|im_start|>' + message['role'] + ' -' + message['content'] + '<|im_end|>' + ' -'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant -' }}{% endif %} \ No newline at end of file diff --git a/tests/chat/templates/OrionStarAI-Orion-14B-Chat.jinja b/tests/chat/templates/OrionStarAI-Orion-14B-Chat.jinja deleted file mode 100644 index a13957bdb..000000000 --- a/tests/chat/templates/OrionStarAI-Orion-14B-Chat.jinja +++ /dev/null @@ -1,3 +0,0 @@ -{% for message in messages %}{% if loop.first %}{{ bos_token }}{% endif %}{% if message['role'] == 'user' %}{{ 'Human: ' + message['content'] + ' - -Assistant: ' + eos_token }}{% elif message['role'] == 'assistant' %}{{ message['content'] + eos_token }}{% endif %}{% endfor %} \ No newline at end of file diff --git a/tests/chat/templates/Qwen-Qwen2-7B-Instruct.jinja b/tests/chat/templates/Qwen-Qwen2-7B-Instruct.jinja deleted file mode 100644 index a4c0b5993..000000000 --- a/tests/chat/templates/Qwen-Qwen2-7B-Instruct.jinja +++ /dev/null @@ -1,6 +0,0 @@ -{% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system -You are a helpful assistant.<|im_end|> -' }}{% endif %}{{'<|im_start|>' + message['role'] + ' -' + message['content'] + '<|im_end|>' + ' -'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant -' }}{% endif %} \ No newline at end of file diff --git a/tests/chat/templates/Qwen-Qwen2-VL-7B-Instruct.jinja b/tests/chat/templates/Qwen-Qwen2-VL-7B-Instruct.jinja deleted file mode 100644 index 6c2266323..000000000 --- a/tests/chat/templates/Qwen-Qwen2-VL-7B-Instruct.jinja +++ /dev/null @@ -1,7 +0,0 @@ -{% set image_count = namespace(value=0) %}{% set video_count = namespace(value=0) %}{% for message in messages %}{% if loop.first and message['role'] != 'system' %}<|im_start|>system -You are a helpful assistant.<|im_end|> -{% endif %}<|im_start|>{{ message['role'] }} -{% if message['content'] is string %}{{ message['content'] }}<|im_end|> -{% else %}{% for content in message['content'] %}{% if content['type'] == 'image' or 'image' in content or 'image_url' in content %}{% set image_count.value = image_count.value + 1 %}{% if add_vision_id %}Picture {{ image_count.value }}: {% endif %}<|vision_start|><|image_pad|><|vision_end|>{% elif content['type'] == 'video' or 'video' in content %}{% set video_count.value = video_count.value + 1 %}{% if add_vision_id %}Video {{ video_count.value }}: {% endif %}<|vision_start|><|video_pad|><|vision_end|>{% elif 'text' in content %}{{ content['text'] }}{% endif %}{% endfor %}<|im_end|> -{% endif %}{% endfor %}{% if add_generation_prompt %}<|im_start|>assistant -{% endif %} \ No newline at end of file diff --git a/tests/chat/templates/Qwen-Qwen2.5-Math-7B-Instruct.jinja b/tests/chat/templates/Qwen-Qwen2.5-Math-7B-Instruct.jinja deleted file mode 100644 index 11f6d3214..000000000 --- a/tests/chat/templates/Qwen-Qwen2.5-Math-7B-Instruct.jinja +++ /dev/null @@ -1,54 +0,0 @@ -{%- if tools %} - {{- '<|im_start|>system\n' }} - {%- if messages[0]['role'] == 'system' %} - {{- messages[0]['content'] }} - {%- else %} - {{- 'Please reason step by step, and put your final answer within \\boxed{}.' }} - {%- endif %} - {{- "\n\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within XML tags:\n" }} - {%- for tool in tools %} - {{- "\n" }} - {{- tool | tojson }} - {%- endfor %} - {{- "\n\n\nFor each function call, return a json object with function name and arguments within XML tags:\n\n{\"name\": , \"arguments\": }\n<|im_end|>\n" }} -{%- else %} - {%- if messages[0]['role'] == 'system' %} - {{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }} - {%- else %} - {{- '<|im_start|>system\nPlease reason step by step, and put your final answer within \\boxed{}.<|im_end|>\n' }} - {%- endif %} -{%- endif %} -{%- for message in messages %} - {%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %} - {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }} - {%- elif message.role == "assistant" %} - {{- '<|im_start|>' + message.role }} - {%- if message.content %} - {{- '\n' + message.content }} - {%- endif %} - {%- for tool_call in message.tool_calls %} - {%- if tool_call.function is defined %} - {%- set tool_call = tool_call.function %} - {%- endif %} - {{- '\n\n{"name": "' }} - {{- tool_call.name }} - {{- '", "arguments": ' }} - {{- tool_call.arguments | tojson }} - {{- '}\n' }} - {%- endfor %} - {{- '<|im_end|>\n' }} - {%- elif message.role == "tool" %} - {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %} - {{- '<|im_start|>user' }} - {%- endif %} - {{- '\n\n' }} - {{- message.content }} - {{- '\n' }} - {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %} - {{- '<|im_end|>\n' }} - {%- endif %} - {%- endif %} -{%- endfor %} -{%- if add_generation_prompt %} - {{- '<|im_start|>assistant\n' }} -{%- endif %} diff --git a/tests/chat/templates/TheBloke-FusionNet_34Bx2_MoE-AWQ.jinja b/tests/chat/templates/TheBloke-FusionNet_34Bx2_MoE-AWQ.jinja deleted file mode 100644 index d6e78a0a8..000000000 --- a/tests/chat/templates/TheBloke-FusionNet_34Bx2_MoE-AWQ.jinja +++ /dev/null @@ -1,13 +0,0 @@ -{%- for idx in range(0, messages|length) -%} -{%- if messages[idx]['role'] == 'user' -%} -{%- if idx > 1 -%} -{{- bos_token + '[INST] ' + messages[idx]['content'] + ' [/INST]' -}} -{%- else -%} -{{- messages[idx]['content'] + ' [/INST]' -}} -{%- endif -%} -{% elif messages[idx]['role'] == 'system' %} -{{- '[INST] <>\n' + messages[idx]['content'] + '\n<>\n\n' -}} -{%- elif messages[idx]['role'] == 'assistant' -%} -{{- ' ' + messages[idx]['content'] + ' ' + eos_token -}} -{% endif %} -{% endfor %} \ No newline at end of file diff --git a/tests/chat/templates/abacusai-Fewshot-Metamath-OrcaVicuna-Mistral.jinja b/tests/chat/templates/abacusai-Fewshot-Metamath-OrcaVicuna-Mistral.jinja deleted file mode 100644 index 818333bfa..000000000 --- a/tests/chat/templates/abacusai-Fewshot-Metamath-OrcaVicuna-Mistral.jinja +++ /dev/null @@ -1 +0,0 @@ -{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{{ bos_token }}{% for message in messages %}{% if message['role'] == 'user' %}{{ ' Question: ' + message['content']}}{% elif message['role'] == 'assistant' %}{{ ' Answer: ' + message['content'] + eos_token }}{% elif message['role'] == 'system' %}{{ message['content']}}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ ' Answer: ' }}{% endif %} \ No newline at end of file diff --git a/tests/chat/templates/bofenghuang-vigogne-2-70b-chat.jinja b/tests/chat/templates/bofenghuang-vigogne-2-70b-chat.jinja deleted file mode 100644 index 9c31b1662..000000000 --- a/tests/chat/templates/bofenghuang-vigogne-2-70b-chat.jinja +++ /dev/null @@ -1 +0,0 @@ -{{ bos_token }}{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% elif true == true and not '<>' in messages[0]['content'] %}{% set loop_messages = messages %}{% set system_message = 'Vous êtes Vigogne, un assistant IA créé par Zaion Lab. Vous suivez extrêmement bien les instructions. Aidez autant que vous le pouvez.' %}{% else %}{% set loop_messages = messages %}{% set system_message = false %}{% endif %}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if loop.index0 == 0 and system_message != false %}{% set content = '<>\n' + system_message + '\n<>\n\n' + message['content'] %}{% else %}{% set content = message['content'] %}{% endif %}{% if message['role'] == 'user' %}{{ '[INST] ' + content.strip() + ' [/INST]' }}{% elif message['role'] == 'system' %}{{ '<>\n' + content.strip() + '\n<>\n\n' }}{% elif message['role'] == 'assistant' %}{{ ' ' + content.strip() + ' ' + eos_token }}{% endif %}{% endfor %} \ No newline at end of file diff --git a/tests/chat/templates/deepseek-ai-DeepSeek-Coder-V2-Instruct.jinja b/tests/chat/templates/deepseek-ai-DeepSeek-Coder-V2-Instruct.jinja deleted file mode 100644 index 66050bdbd..000000000 --- a/tests/chat/templates/deepseek-ai-DeepSeek-Coder-V2-Instruct.jinja +++ /dev/null @@ -1,5 +0,0 @@ -{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{{ bos_token }}{% for message in messages %}{% if message['role'] == 'user' %}{{ 'User: ' + message['content'] + ' - -' }}{% elif message['role'] == 'assistant' %}{{ 'Assistant: ' + message['content'] + eos_token }}{% elif message['role'] == 'system' %}{{ message['content'] + ' - -' }}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ 'Assistant:' }}{% endif %} \ No newline at end of file diff --git a/tests/chat/templates/deepseek-ai-DeepSeek-V2.5.jinja b/tests/chat/templates/deepseek-ai-DeepSeek-V2.5.jinja deleted file mode 100644 index e6ba24848..000000000 --- a/tests/chat/templates/deepseek-ai-DeepSeek-V2.5.jinja +++ /dev/null @@ -1 +0,0 @@ -{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='') %}{%- for message in messages %} {%- if message['role'] == 'system' %} {% set ns.system_prompt = message['content'] %} {%- endif %}{%- endfor %}{{bos_token}}{{ns.system_prompt}}{%- for message in messages %} {%- if message['role'] == 'user' %} {%- set ns.is_tool = false -%}{{'<|User|>' + message['content']}} {%- endif %} {%- if message['role'] == 'assistant' and message['content'] is none %} {%- set ns.is_tool = false -%} {%- for tool in message['tool_calls']%} {%- if not ns.is_first %}{{'<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\n' + '```json' + '\n' + tool['function']['arguments'] + '\n' + '```' + '<|tool▁call▁end|>'}} {%- set ns.is_first = true -%} {%- else %}{{'\n' + '<|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\n' + '```json' + '\n' + tool['function']['arguments'] + '\n' + '```' + '<|tool▁call▁end|>'}}{{'<|tool▁calls▁end|><|end▁of▁sentence|>'}} {%- endif %} {%- endfor %} {%- endif %} {%- if message['role'] == 'assistant' and message['content'] is not none %} {%- if ns.is_tool %}{{'<|tool▁outputs▁end|>' + message['content'] + '<|end▁of▁sentence|>'}} {%- set ns.is_tool = false -%} {%- else %}{{'<|Assistant|>' + message['content'] + '<|end▁of▁sentence|>'}} {%- endif %} {%- endif %} {%- if message['role'] == 'tool' %} {%- set ns.is_tool = true -%} {%- if ns.is_output_first %}{{'<|tool▁outputs▁begin|><|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}} {%- set ns.is_output_first = false %} {%- else %}{{'\n<|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}} {%- endif %} {%- endif %}{%- endfor -%}{% if ns.is_tool %}{{'<|tool▁outputs▁end|>'}}{% endif %}{% if add_generation_prompt and not ns.is_tool %}{{'<|Assistant|>'}}{% endif %} \ No newline at end of file diff --git a/tests/chat/templates/deepseek-ai-deepseek-coder-33b-instruct.jinja b/tests/chat/templates/deepseek-ai-deepseek-coder-33b-instruct.jinja deleted file mode 100644 index 7be73618e..000000000 --- a/tests/chat/templates/deepseek-ai-deepseek-coder-33b-instruct.jinja +++ /dev/null @@ -1,26 +0,0 @@ -{% if not add_generation_prompt is defined %} -{% set add_generation_prompt = false %} -{% endif %} -{%- set ns = namespace(found=false) -%} -{%- for message in messages -%} - {%- if message['role'] == 'system' -%} - {%- set ns.found = true -%} - {%- endif -%} -{%- endfor -%} -{{bos_token}}{%- if not ns.found -%} -{{'You are an AI programming assistant, utilizing the Deepseek Coder model, developed by Deepseek Company, and you only answer questions related to computer science. For politically sensitive questions, security and privacy issues, and other non-computer science questions, you will refuse to answer\n'}} -{%- endif %} -{%- for message in messages %} - {%- if message['role'] == 'system' %} -{{ message['content'] }} - {%- else %} - {%- if message['role'] == 'user' %} -{{'### Instruction:\n' + message['content'] + '\n'}} - {%- else %} -{{'### Response:\n' + message['content'] + '\n<|EOT|>\n'}} - {%- endif %} - {%- endif %} -{%- endfor %} -{% if add_generation_prompt %} -{{'### Response:'}} -{% endif %} \ No newline at end of file diff --git a/tests/chat/templates/indischepartij-MiniCPM-3B-OpenHermes-2.5-v2.jinja b/tests/chat/templates/indischepartij-MiniCPM-3B-OpenHermes-2.5-v2.jinja deleted file mode 100644 index 6af6db7dc..000000000 --- a/tests/chat/templates/indischepartij-MiniCPM-3B-OpenHermes-2.5-v2.jinja +++ /dev/null @@ -1 +0,0 @@ -{% for message in messages %}{% if message['role'] == 'user' %}{{'<用户>' + message['content'].strip() + ''}}{% else %}{{message['content'].strip()}}{% endif %}{% endfor %} \ No newline at end of file diff --git a/tests/chat/templates/microsoft-Phi-3-medium-4k-instruct.jinja b/tests/chat/templates/microsoft-Phi-3-medium-4k-instruct.jinja deleted file mode 100644 index 15e9c487e..000000000 --- a/tests/chat/templates/microsoft-Phi-3-medium-4k-instruct.jinja +++ /dev/null @@ -1,5 +0,0 @@ -{% for message in messages %}{% if (message['role'] == 'user') %}{{'<|user|>' + ' -' + message['content'] + '<|end|>' + ' -' + '<|assistant|>' + ' -'}}{% elif (message['role'] == 'assistant') %}{{message['content'] + '<|end|>' + ' -'}}{% endif %}{% endfor %} \ No newline at end of file diff --git a/tests/chat/templates/microsoft-Phi-3-mini-4k-instruct.jinja b/tests/chat/templates/microsoft-Phi-3-mini-4k-instruct.jinja deleted file mode 100644 index ddb5006ba..000000000 --- a/tests/chat/templates/microsoft-Phi-3-mini-4k-instruct.jinja +++ /dev/null @@ -1,8 +0,0 @@ -{% for message in messages %}{% if message['role'] == 'system' %}{{'<|system|> -' + message['content'] + '<|end|> -'}}{% elif message['role'] == 'user' %}{{'<|user|> -' + message['content'] + '<|end|> -'}}{% elif message['role'] == 'assistant' %}{{'<|assistant|> -' + message['content'] + '<|end|> -'}}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|assistant|> -' }}{% else %}{{ eos_token }}{% endif %} \ No newline at end of file diff --git a/tests/chat/templates/microsoft-Phi-3-small-8k-instruct.jinja b/tests/chat/templates/microsoft-Phi-3-small-8k-instruct.jinja deleted file mode 100644 index 029db3992..000000000 --- a/tests/chat/templates/microsoft-Phi-3-small-8k-instruct.jinja +++ /dev/null @@ -1,4 +0,0 @@ -{{ bos_token }}{% for message in messages %}{{'<|' + message['role'] + '|>' + ' -' + message['content'] + '<|end|> -' }}{% endfor %}{% if add_generation_prompt %}{{ '<|assistant|> -' }}{% else %}{{ eos_token }}{% endif %} \ No newline at end of file diff --git a/tests/chat/templates/microsoft-Phi-3.5-vision-instruct.jinja b/tests/chat/templates/microsoft-Phi-3.5-vision-instruct.jinja deleted file mode 100644 index 76ed59a56..000000000 --- a/tests/chat/templates/microsoft-Phi-3.5-vision-instruct.jinja +++ /dev/null @@ -1,4 +0,0 @@ -{% for message in messages %}{{'<|' + message['role'] + '|>' + ' -' + message['content'] + '<|end|> -' }}{% endfor %}{% if add_generation_prompt and messages[-1]['role'] != 'assistant' %}{{- '<|assistant|> -' -}}{% endif %} \ No newline at end of file diff --git a/tests/chat/templates/mistralai-Mistral-7B-Instruct-v0.2.jinja b/tests/chat/templates/mistralai-Mistral-7B-Instruct-v0.2.jinja deleted file mode 100644 index 40b37ad7f..000000000 --- a/tests/chat/templates/mistralai-Mistral-7B-Instruct-v0.2.jinja +++ /dev/null @@ -1,24 +0,0 @@ -{%- if messages[0]['role'] == 'system' %} - {%- set system_message = messages[0]['content'] %} - {%- set loop_messages = messages[1:] %} -{%- else %} - {%- set loop_messages = messages %} -{%- endif %} - -{{- bos_token }} -{%- for message in loop_messages %} - {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) %} - {{- raise_exception('After the optional system message, conversation roles must alternate user/assistant/user/assistant/...') }} - {%- endif %} - {%- if message['role'] == 'user' %} - {%- if loop.first and system_message is defined %} - {{- ' [INST] ' + system_message + '\n\n' + message['content'] + ' [/INST]' }} - {%- else %} - {{- ' [INST] ' + message['content'] + ' [/INST]' }} - {%- endif %} - {%- elif message['role'] == 'assistant' %} - {{- ' ' + message['content'] + eos_token}} - {%- else %} - {{- raise_exception('Only user and assistant roles are supported, with the exception of an initial optional system message!') }} - {%- endif %} -{%- endfor %} diff --git a/tests/chat/templates/mistralai-Mixtral-8x7B-Instruct-v0.1.jinja b/tests/chat/templates/mistralai-Mixtral-8x7B-Instruct-v0.1.jinja deleted file mode 100644 index 40b37ad7f..000000000 --- a/tests/chat/templates/mistralai-Mixtral-8x7B-Instruct-v0.1.jinja +++ /dev/null @@ -1,24 +0,0 @@ -{%- if messages[0]['role'] == 'system' %} - {%- set system_message = messages[0]['content'] %} - {%- set loop_messages = messages[1:] %} -{%- else %} - {%- set loop_messages = messages %} -{%- endif %} - -{{- bos_token }} -{%- for message in loop_messages %} - {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) %} - {{- raise_exception('After the optional system message, conversation roles must alternate user/assistant/user/assistant/...') }} - {%- endif %} - {%- if message['role'] == 'user' %} - {%- if loop.first and system_message is defined %} - {{- ' [INST] ' + system_message + '\n\n' + message['content'] + ' [/INST]' }} - {%- else %} - {{- ' [INST] ' + message['content'] + ' [/INST]' }} - {%- endif %} - {%- elif message['role'] == 'assistant' %} - {{- ' ' + message['content'] + eos_token}} - {%- else %} - {{- raise_exception('Only user and assistant roles are supported, with the exception of an initial optional system message!') }} - {%- endif %} -{%- endfor %} diff --git a/tests/chat/templates/mlabonne-AlphaMonarch-7B.jinja b/tests/chat/templates/mlabonne-AlphaMonarch-7B.jinja deleted file mode 100644 index a7d1e8534..000000000 --- a/tests/chat/templates/mlabonne-AlphaMonarch-7B.jinja +++ /dev/null @@ -1,4 +0,0 @@ -{% for message in messages %}{{bos_token + message['role'] + ' -' + message['content'] + eos_token + ' -'}}{% endfor %}{% if add_generation_prompt %}{{ bos_token + 'assistant -' }}{% endif %} \ No newline at end of file diff --git a/tests/chat/templates/openchat-openchat-3.5-0106.jinja b/tests/chat/templates/openchat-openchat-3.5-0106.jinja deleted file mode 100644 index 3adf67ad1..000000000 --- a/tests/chat/templates/openchat-openchat-3.5-0106.jinja +++ /dev/null @@ -1 +0,0 @@ -{{ bos_token }}{% for message in messages %}{{ 'GPT4 Correct ' + message['role'].title() + ': ' + message['content'] + '<|end_of_turn|>'}}{% endfor %}{% if add_generation_prompt %}{{ 'GPT4 Correct Assistant:' }}{% endif %} \ No newline at end of file diff --git a/tests/chat/templates/teknium-OpenHermes-2.5-Mistral-7B.jinja b/tests/chat/templates/teknium-OpenHermes-2.5-Mistral-7B.jinja deleted file mode 100644 index 057a3952a..000000000 --- a/tests/chat/templates/teknium-OpenHermes-2.5-Mistral-7B.jinja +++ /dev/null @@ -1,4 +0,0 @@ -{% for message in messages %}{{'<|im_start|>' + message['role'] + ' -' + message['content'] + '<|im_end|>' + ' -'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant -' }}{% endif %} \ No newline at end of file diff --git a/tests/test-chat-template.cpp b/tests/test-chat-template.cpp index de279f5b3..9a246069f 100644 --- a/tests/test-chat-template.cpp +++ b/tests/test-chat-template.cpp @@ -7,131 +7,8 @@ #include "llama.h" #include "common.h" -#include "chat-template.hpp" -#include -#include -#include -#include -#include -using json = nlohmann::ordered_json; - -static std::string filename_without_extension(const std::string & path) { - auto res = path; - auto pos = res.find_last_of('/'); - if (pos != std::string::npos) - res = res.substr(pos + 1); - pos = res.find_last_of('.'); - if (pos != std::string::npos) - res = res.substr(0, pos); - return res; -} - -template -static void assert_equals(const T & expected, const T & actual) { - if (expected != actual) { - std::cerr << "Expected: " << expected << std::endl; - std::cerr << "Actual: " << actual << std::endl; - std::cerr << std::flush; - throw std::runtime_error("Test failed"); - } -} - -static std::vector find_files(const std::string & folder, const std::string & ext) { - auto files = fs_list_files(folder, ext); - if (files.empty()) { - files = fs_list_files("../" + folder, ext); - } - return files; -} - -static std::string read_file(const std::string &path) { - std::ifstream fs(path, std::ios_base::binary); - if (!fs.is_open()) { - fs = std::ifstream("../" + path, std::ios_base::binary); - if (!fs.is_open()) { - throw std::runtime_error("Failed to open file: " + path); - } - } - fs.seekg(0, std::ios_base::end); - auto size = fs.tellg(); - fs.seekg(0); - std::string out; - out.resize(static_cast(size)); - fs.read(&out[0], static_cast(size)); - return out; -} - -static void test_jinja_templates() { - auto jinja_template_files = find_files("tests/chat/templates", ".jinja"); - auto context_files = find_files("tests/chat/contexts", ".json"); - - auto get_golden_file = [&](const std::string & tmpl_file, const std::string & ctx_file) { - auto tmpl_name = filename_without_extension(tmpl_file); - auto ctx_name = filename_without_extension(ctx_file); - auto golden_name = tmpl_name + "-" + ctx_name; - return "tests/chat/goldens/" + golden_name + ".txt"; - }; - auto fail_with_golden_instructions = [&]() { - throw std::runtime_error("To fetch templates and generate golden files, run `python scripts/update_jinja_goldens.py`"); - }; - if (jinja_template_files.empty()) { - std::cerr << "No Jinja templates found in tests/chat/templates" << std::endl; - fail_with_golden_instructions(); - } - // const auto options = minja::Options {.trim_blocks = true, .lstrip_blocks = true}; - for (const auto & tmpl_file : jinja_template_files) { - std::cout << "# Testing template: " << tmpl_file << std::endl << std::flush; - auto tmpl_str = read_file(tmpl_file); - - auto found_goldens = false; - - for (const auto & ctx_file : context_files) { - auto ctx = json::parse(read_file(ctx_file)); - - minja::chat_template tmpl( - tmpl_str, - ctx.at("bos_token"), - ctx.at("eos_token")); - - auto golden_file = get_golden_file(tmpl_file, ctx_file); - std::string expected; - try { - expected = read_file(golden_file); - } catch (const std::runtime_error & e) { - // No golden file. - continue; - } - found_goldens = true; - std::cout << " - " << golden_file << std::endl << std::flush; - - std::string actual; - try { - actual = tmpl.apply( - ctx.at("messages"), - ctx.contains("tools") ? ctx.at("tools") : json(), - ctx.at("add_generation_prompt"), - ctx.contains("tools") ? json { - {"builtin_tools", {"wolfram_alpha", "brave_search"}} - } : json()); - } catch (const std::runtime_error & e) { - actual = "ERROR: " + std::string(e.what()); - } - if (getenv("LLAMA_UPDATE_GOLDENS")) { - std::ofstream(golden_file) << actual; - } else { - assert_equals(expected, actual); - } - } - - if (!found_goldens) { - std::cerr << "No golden files found for " << tmpl_file << std::endl; - fail_with_golden_instructions(); - } - } -} - -static void test_legacy_templates() { +int main(void) { llama_chat_message conversation[] = { {"system", "You are a helpful assistant"}, {"user", "Hello"}, @@ -337,18 +214,6 @@ static void test_legacy_templates() { assert(fmt_single("mistral") == "[INST] How are you [/INST]"); // for old pre-v1 templates assert(fmt_single("gemma") == "\nuser\nHow are you\nmodel\n"); assert(fmt_single("llama3") == "<|start_header_id|>user<|end_header_id|>\n\nHow are you<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n"); -} - -int main(void) { - test_legacy_templates(); - - if (getenv("LLAMA_SKIP_TESTS_SLOW_ON_EMULATOR")) { - fprintf(stderr, "\033[33mWARNING: Skipping slow tests on emulator.\n\033[0m"); - } else { - test_jinja_templates(); - } - - printf("Test chat templates: OK\n"); return 0; } diff --git a/tests/test-minja.cpp b/tests/test-minja.cpp deleted file mode 100644 index d0bc342b1..000000000 --- a/tests/test-minja.cpp +++ /dev/null @@ -1,376 +0,0 @@ -/* - Minimalistic Jinja templating engine for llama.cpp. C++11, no deps (single-header), decent language support but very few functions (easy to extend), just what’s needed for actual prompt templates. - - Models have increasingly complex templates (e.g. Llama 3.1, Hermes 2 Pro w/ tool_use), so we need a proper template engine to get the best out of them. - - Supports: - - Full expression syntax - - Statements `{{% … %}}`, variable sections `{{ … }}`, and comments `{# … #}` with pre/post space elision `{%- … -%}` / `{{- … -}}` / `{#- … -#}` - - `if` / `elif` / `else` / `endif` - - `for` (`recursive`) (`if`) / `else` / `endfor` w/ `loop.*` (including `loop.cycle`) and destructuring - - `set` w/ namespaces & destructuring - - `macro` / `endmacro` - - Extensible filters collection: `count`, `dictsort`, `equalto`, `e` / `escape`, `items`, `join`, `joiner`, `namespace`, `raise_exception`, `range`, `reject`, `tojson`, `trim` - - Limitations: - - Not supporting most filters & pipes. Only the ones actually used in the templates are implemented. - https://jinja.palletsprojects.com/en/3.0.x/templates/#builtin-filters - - No difference between none and undefined - - Single namespace with all filters / tests / functions / macros / variables - - No tuples (templates seem to rely on lists only) - - No `if` expressions w/o `else` (but `if` statements are fine) - - No `{% raw %}`, `{% block … %}`, `{% include … %}`, `{% extends … %}, - - Model templates verified to work: - - Meta-Llama-3.1-8B-Instruct - - Phi-3.5-mini-instruct - - Hermes-2-Pro-Llama-3-8B (default & tool_use variants) - - Qwen2-VL-7B-Instruct, Qwen2-7B-Instruct - - Mixtral-8x7B-Instruct-v0.1 - - TODO: - - Simplify two-pass parsing - - Pass tokens to IfNode and such - - Macro nested set scope = global? - {%- macro get_param_type(param) -%} - {%- set param_type = "any" -%} - - Advertise in / link to https://jbmoelker.github.io/jinja-compat-tests/ -*/ -#include "minja.hpp" - -#include -#include -#include -#include - -static void assert_equals(const std::string & expected, const std::string & actual) { - if (expected != actual) { - std::cerr << "Expected: " << expected << std::endl; - std::cerr << "Actual: " << actual << std::endl; - std::cerr << std::flush; - throw std::runtime_error("Test failed"); - } -} - -static void announce_test(const std::string & name, const minja::Options & options) { - auto len = name.size(); - auto extract = minja::strip(name); - extract = json(name.substr(0, std::min(len, 50)) + (len > 50 ? " [...]" : "")).dump(); - extract = extract.substr(1, extract.size() - 2); - std::cout << "Testing: " << extract; - static const minja::Options default_options {}; - if (options.lstrip_blocks != default_options.lstrip_blocks) - std::cout << " lstrip_blocks=" << options.lstrip_blocks; - if (options.trim_blocks != default_options.trim_blocks) - std::cout << " trim_blocks=" << options.trim_blocks; - std::cout << std::endl << std::flush; -} - -static void test_render(const std::string & template_str, const json & bindings, const minja::Options & options, const std::string & expected, const json & expected_context = {}) { - announce_test(template_str, options); - auto root = minja::Parser::parse(template_str, options); - auto context = minja::Context::make(bindings); - std::string actual; - try { - actual = root->render(context); - } catch (const std::runtime_error & e) { - actual = "ERROR: " + std::string(e.what()); - } - - assert_equals(expected, actual); - - if (!expected_context.is_null()) { - // auto dump = context->dump(); - for (const auto & kv : expected_context.items()) { - auto value = context->get(kv.key()); - if (value != kv.value()) { - std::cerr << "Expected context value for " << kv.key() << ": " << kv.value() << std::endl; - std::cerr << "Actual value: " << value.dump() << std::endl; - std::cerr << std::flush; - throw std::runtime_error("Test failed"); - } - } - } - std::cout << "Test passed!" << std::endl << std::flush; -} - -static void test_error_contains(const std::string & template_str, const json & bindings, const minja::Options & options, const std::string & expected) { - announce_test(template_str, options); - try { - auto root = minja::Parser::parse(template_str, options); - auto context = minja::Context::make(bindings); - // auto copy = context.is_null() ? Value::object() : std::make_shared(context); - auto actual = root->render(context); - throw std::runtime_error("Expected error: " + expected + ", but got successful result instead: " + actual); - } catch (const std::runtime_error & e) { - std::string actual(e.what()); - if (actual.find(expected) == std::string::npos) { - std::cerr << "Expected: " << expected << std::endl; - std::cerr << "Actual: " << actual << std::endl; - std::cerr << std::flush; - throw std::runtime_error("Test failed"); - } - } - std::cout << " passed!" << std::endl << std::flush; -} - - -/* - cmake -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build -t test-minja -j && ./build/bin/test-minja -*/ -int main() { - const minja::Options lstrip_blocks { - /* .trim_blocks = */ false, - /* .lstrip_blocks = */ true, - /* .keep_trailing_newline = */ false, - }; - const minja::Options trim_blocks { - /* .trim_blocks = */ true, - /* .lstrip_blocks = */ false, - /* .keep_trailing_newline = */ false, - }; - const minja::Options lstrip_trim_blocks { - /* .trim_blocks = */ true, - /* .lstrip_blocks = */ true, - /* .keep_trailing_newline = */ false, - }; - - test_render("{% set txt = 'a\\nb\\n' %}{{ txt | indent(2) }}|{{ txt | indent(2, first=true) }}", {}, {}, "a\n b\n| a\n b\n"); - test_render(R"({%- if True %} {% set _ = x %}{%- endif %}{{ 1 }})", - {}, - lstrip_trim_blocks, - " 1" - ); - test_render(R"({{ "abcd"[1:-1] }})", {}, {}, "bc"); - test_render(R"({{ [0, 1, 2, 3][1:-1] }})", {}, {}, "[1, 2]"); - test_render(R"({{ "123456789" | length }})", {}, {}, "9"); - test_render(R"( {{- 'a' -}}{{ ' ' }}{{- 'b' -}} )", {}, {}, "a b"); - test_render(R"( {%- if True %}{%- endif %}{{ ' ' }}{%- for x in [] %}foo{% endfor %}end)", {}, {}, " end"); - test_render(R"({% set ns = namespace(is_first=false, nottool=false, and_or=true, delme='') %}{{ ns.is_first }})", {}, {}, "False"); - test_render(R"({{ {} is mapping }},{{ '' is mapping }})", {}, {}, "True,False"); - test_render(R"({{ {} is iterable }},{{ '' is iterable }})", {}, {}, "True,True"); - test_render(R"({% for x in ["a", "b"] %}{{ x }},{% endfor %})", {}, {}, "a,b,"); - test_render(R"({% for x in {"a": 1, "b": 2} %}{{ x }},{% endfor %})", {}, {}, "a,b,"); - test_render(R"({% for x in "ab" %}{{ x }},{% endfor %})", {}, {}, "a,b,"); - test_render(R"({{ 'foo bar'.title() }})", {}, {}, "Foo Bar"); - test_render(R"({{ 1 | safe }})", {}, {}, "1"); - test_render(R"({{ 'abc'.endswith('bc') }},{{ ''.endswith('a') }})", {}, {}, "True,False"); - test_render(R"({{ none | selectattr("foo", "equalto", "bar") | list }})", {}, {}, "[]"); - test_render(R"({{ 'a' in {"a": 1} }},{{ 'a' in {} }})", {}, {}, "True,False"); - test_render(R"({{ 'a' in ["a"] }},{{ 'a' in [] }})", {}, {}, "True,False"); - test_render(R"({{ [{"a": 1}, {"a": 2}, {}] | selectattr("a", "equalto", 1) }})", {}, {}, R"([{'a': 1}])"); - test_render(R"({{ [{"a": 1}, {"a": 2}] | map(attribute="a") | list }})", {}, {}, "[1, 2]"); - test_render(R"({{ ["", "a"] | map("length") | list }})", {}, {}, "[0, 1]"); - test_render(R"({{ range(3) | last }})", {}, {}, "2"); - test_render(R"({% set foo = true %}{{ foo is defined }})", {}, {}, "True"); - test_render(R"({% set foo = true %}{{ not foo is defined }})", {}, {}, "False"); - test_render(R"({{ {"a": "b"} | tojson }})", {}, {}, R"({"a": "b"})"); - test_render(R"({{ {"a": "b"} }})", {}, {}, R"({'a': 'b'})"); - - std::string trim_tmpl = - "\n" - " {% if true %}Hello{% endif %} \n" - "...\n" - "\n"; - test_render( - trim_tmpl, - {}, trim_blocks, "\n Hello...\n"); - test_render( - trim_tmpl, - {}, {}, "\n Hello \n...\n"); - test_render( - trim_tmpl, - {}, lstrip_blocks, "\nHello \n...\n"); - test_render( - trim_tmpl, - {}, lstrip_trim_blocks, "\nHello...\n"); - - test_render( - R"({%- set separator = joiner(' | ') -%} - {%- for item in ["a", "b", "c"] %}{{ separator() }}{{ item }}{% endfor -%})", - {}, {}, "a | b | c"); - test_render("a\nb\n", {}, {}, "a\nb"); - test_render(" {{- ' a\n'}}", {}, trim_blocks, " a\n"); - - test_render( - R"( - {%- for x in range(3) -%} - {%- if loop.first -%} - but first, mojitos! - {%- endif -%} - {{ loop.index }}{{ "," if not loop.last -}} - {%- endfor -%} - )", {}, {}, "but first, mojitos!1,2,3"); - test_render("{{ 'a' + [] | length + 'b' }}", {}, {}, "a0b"); - test_render("{{ [1, 2, 3] | join(', ') + '...' }}", {}, {}, "1, 2, 3..."); - test_render("{{ 'Tools: ' + [1, 2, 3] | reject('equalto', 2) | join(', ') + '...' }}", {}, {}, "Tools: 1, 3..."); - test_render("{{ [1, 2, 3] | join(', ') }}", {}, {}, "1, 2, 3"); - test_render("{% for i in range(3) %}{{i}},{% endfor %}", {}, {}, "0,1,2,"); - test_render("{% set foo %}Hello {{ 'there' }}{% endset %}{{ 1 ~ foo ~ 2 }}", {}, {}, "1Hello there2"); - test_render("{{ [1, False, null, True, 2, '3', 1, '3', False, null, True] | unique }}", {}, {}, - "[1, False, null, True, 2, '3']"); - test_render("{{ range(5) | length % 2 }}", {}, {}, "1"); - test_render("{{ range(5) | length % 2 == 1 }},{{ [] | length > 0 }}", {}, {}, "True,False"); - test_render( - "{{ messages[0]['role'] != 'system' }}", - {{"messages", json::array({json({{"role", "system"}})})}}, - {}, - "False"); - test_render( - R"( - {%- for x, y in [("a", "b"), ("c", "d")] -%} - {{- x }},{{ y -}}; - {%- endfor -%} - )", {}, {}, "a,b;c,d;"); - test_render("{{ 1 is not string }}", {}, {}, "True"); - test_render("{{ 'ab' * 3 }}", {}, {}, "ababab"); - test_render("{{ [1, 2, 3][-1] }}", {}, {}, "3"); - test_render( - "{%- for i in range(0) -%}NAH{% else %}OK{% endfor %}", - {}, {}, - "OK"); - test_render( - R"( - {%- for i in range(5) -%} - ({{ i }}, {{ loop.cycle('odd', 'even') }}), - {%- endfor -%} - )", {}, {}, "(0, odd),(1, even),(2, odd),(3, even),(4, odd),"); - - test_render( - "{%- for i in range(5) if i % 2 == 0 -%}\n" - "{{ i }}, first={{ loop.first }}, last={{ loop.last }}, index={{ loop.index }}, index0={{ loop.index0 }}, revindex={{ loop.revindex }}, revindex0={{ loop.revindex0 }}, prev={{ loop.previtem }}, next={{ loop.nextitem }},\n" - "{% endfor -%}", - {}, {}, - "0, first=True, last=False, index=1, index0=0, revindex=3, revindex0=2, prev=, next=2,\n" - "2, first=False, last=False, index=2, index0=1, revindex=2, revindex0=1, prev=0, next=4,\n" - "4, first=False, last=True, index=3, index0=2, revindex=1, revindex0=0, prev=2, next=,\n"); - - test_render( - R"( - {%- set res = [] -%} - {%- for c in ["<", ">", "&", '"'] -%} - {%- set _ = res.append(c | e) -%} - {%- endfor -%} - {{- res | join(", ") -}} - )", {}, {}, - R"(<, >, &, ")"); - test_render( - R"( - {%- set x = 1 -%} - {%- set y = 2 -%} - {%- macro foo(x, z, w=10) -%} - x={{ x }}, y={{ y }}, z={{ z }}, w={{ w -}} - {%- endmacro -%} - {{- foo(100, 3) -}} - )", {}, {}, - R"(x=100, y=2, z=3, w=10)"); - test_render( - R"( - {% macro input(name, value='', type='text', size=20) -%} - - {%- endmacro -%} - -

{{ input('username') }}

-

{{ input('password', type='password') }}

)", - {}, {}, R"( -

-

)"); - test_render( - R"( - {#- The values' default array should be created afresh at each call, unlike the equivalent Python function -#} - {%- macro foo(values=[]) -%} - {%- set _ = values.append(1) -%} - {{- values -}} - {%- endmacro -%} - {{- foo() }} {{ foo() -}})", - {}, {}, R"([1] [1])"); - test_render(R"({{ None | items | tojson }}; {{ {1: 2} | items | tojson }})", {}, {}, "[]; [[1, 2]]"); - test_render(R"({{ {1: 2, 3: 4, 5: 7} | dictsort | tojson }})", {}, {}, "[[1, 2], [3, 4], [5, 7]]"); - test_render(R"({{ {1: 2}.items() }})", {}, {}, "[[1, 2]]"); - test_render(R"({{ {1: 2}.get(1) }}; {{ {}.get(1) }}; {{ {}.get(1, 10) }})", {}, {}, "2; ; 10"); - test_render( - R"( - {%- for x in [1, 1.2, "a", true, True, false, False, None, [], [1], [1, 2], {}, {"a": 1}, {1: "b"}] -%} - {{- x | tojson -}}, - {%- endfor -%} - )", {}, {}, - R"(1,1.2,"a",true,true,false,false,null,[],[1],[1, 2],{},{"a": 1},{"1": "b"},)"); - test_render( - R"( - {%- set n = namespace(value=1, title='') -%} - {{- n.value }} "{{ n.title }}", - {%- set n.value = 2 -%} - {%- set n.title = 'Hello' -%} - {{- n.value }} "{{ n.title }}")", {}, {}, R"(1 "",2 "Hello")"); - test_error_contains( - "{{ (a.b.c) }}", - {{"a", json({{"b", {{"c", 3}}}})}}, - {}, - "'a' is not defined"); - test_render( - "{% set _ = a.b.append(c.d.e) %}{{ a.b }}", - json::parse(R"({ - "a": {"b": [1, 2]}, - "c": {"d": {"e": 3}} - })"), - {}, - "[1, 2, 3]"); - - test_render(R"( - {%- for x, y in z -%} - {{- x }},{{ y -}}; - {%- endfor -%} - )", {{"z", json({json({1, 10}), json({2, 20})})}}, {}, "1,10;2,20;"); - - test_render(" a {{ 'b' -}} c ", {}, {}, " a bc "); - test_render(" a {{- 'b' }} c ", {}, {}, " ab c "); - test_render("a\n{{- 'b' }}\nc", {}, {}, "ab\nc"); - test_render("a\n{{ 'b' -}}\nc", {}, {}, "a\nbc"); - - test_error_contains("{{ raise_exception('hey') }}", {}, {}, "hey"); - - test_render("{{ [] is iterable }}", {}, {}, "True"); - test_render("{{ [] is not number }}", {}, {}, "True"); - test_render("{% set x = [0, 1, 2, 3] %}{{ x[1:] }}{{ x[:2] }}{{ x[1:3] }}", {}, {}, "[1, 2, 3][0, 1][1, 2]"); - test_render("{{ ' a ' | trim }}", {}, {}, "a"); - test_render("{{ range(3) }}{{ range(4, 7) }}{{ range(0, 10, step=2) }}", {}, {}, "[0, 1, 2][4, 5, 6][0, 2, 4, 6, 8]"); - - test_render( - R"( {{ "a" -}} b {{- "c" }} )", {}, {}, - " abc "); - - test_error_contains("{% else %}", {}, {}, "Unexpected else"); - test_error_contains("{% endif %}", {}, {}, "Unexpected endif"); - test_error_contains("{% elif 1 %}", {}, {}, "Unexpected elif"); - test_error_contains("{% endfor %}", {}, {}, "Unexpected endfor"); - - test_error_contains("{% if 1 %}", {}, {}, "Unterminated if"); - test_error_contains("{% for x in 1 %}", {}, {}, "Unterminated for"); - test_error_contains("{% if 1 %}{% else %}", {}, {}, "Unterminated if"); - test_error_contains("{% if 1 %}{% else %}{% elif 1 %}{% endif %}", {}, {}, "Unterminated if"); - - test_render("{% if 1 %}{% elif 1 %}{% else %}{% endif %}", {}, {}, ""); - - test_render( - "{% set x = [] %}{% set _ = x.append(1) %}{{ x | tojson(indent=2) }}", {}, {}, - "[\n 1\n]"); - - test_render( - "{{ not [] }}", {}, {}, - "True"); - - test_render("{{ tool.function.name == 'ipython' }}", - json({{"tool", json({ - {"function", {{"name", "ipython"}}} - })}}), - {}, - "True"); - - test_render(R"( - {%- set user = "Olivier" -%} - {%- set greeting = "Hello " ~ user -%} - {{- greeting -}} - )", {}, {}, "Hello Olivier"); - - return 0; -}