32 个版本 (10 个重大更改)
新 0.11.2 | 2024年8月21日 |
---|---|
0.10.2 | 2024年7月25日 |
0.5.3 | 2024年3月25日 |
0.3.0 | 2023年11月28日 |
#259 在 数据结构
682 每月下载量
在 llama-core 中使用
365KB
7K SLoC
LLM的提示模板
chat-prompts
是 LlamaEdge API 服务器 项目的一部分。它提供了一组提示模板,用于为LLM生成提示(见 huggingface.co/second-state 中的模型)。
提示模板
以下列出了可用的提示模板
-
baichuan-2
-
提示字符串
以下内容为人类用户与与一位智能助手的对话。 用户:你好! 助手:
-
-
codellama-instruct
-
提示字符串
<s>[INST] <<SYS>> Write code to solve the following coding problem that obeys the constraints and passes the example test cases. Please wrap your code answer using ```: <</SYS>> {prompt} [/INST]
-
-
codellama-super-instruct
-
提示字符串
<s>Source: system\n\n {system_prompt} <step> Source: user\n\n {user_message_1} <step> Source: assistant\n\n {ai_message_1} <step> Source: user\n\n {user_message_2} <step> Source: assistant\nDestination: user\n\n
-
-
chatml
-
提示字符串
<|im_start|>system {system_message}<|im_end|> <|im_start|>user {prompt}<|im_end|> <|im_start|>assistant
-
-
chatml-tool
-
提示字符串
<|im_start|>system\n{system_message} Here are the available tools: <tools> [{tool_1}, {tool_2}] </tools> Use the following pydantic model json schema for each tool call you will make: {"properties": {"arguments": {"title": "Arguments", "type": "object"}, "name": {"title": "Name", "type": "string"}}, "required": ["arguments", "name"], "title": "FunctionCall", "type": "object"} For each function call return a json object with function name and arguments within <tool_call></tool_call> XML tags as follows:\n<tool_call>\n{"arguments": <args-dict>, "name": <function-name>}\n</tool_call><|im_end|> <|im_start|>user {user_message}<|im_end|> <|im_start|>assistant
-
示例
<|im_start|>system\nYou are a function calling AI model. You are provided with function signatures within <tools></tools> 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: <tools> [{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"format":{"type":"string","description":"The temperature unit to use. Infer this from the users location.","enum":["celsius","fahrenheit"]}},"required":["location","format"]}}},{"type":"function","function":{"name":"predict_weather","description":"Predict the weather in 24 hours","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"format":{"type":"string","description":"The temperature unit to use. Infer this from the users location.","enum":["celsius","fahrenheit"]}},"required":["location","format"]}}}] </tools> Use the following pydantic model json schema for each tool call you will make: {"properties": {"arguments": {"title": "Arguments", "type": "object"}, "name": {"title": "Name", "type": "string"}}, "required": ["arguments", "name"], "title": "FunctionCall", "type": "object"} For each function call return a json object with function name and arguments within <tool_call></tool_call> XML tags as follows:\n<tool_call>\n{"arguments": <args-dict>, "name": <function-name>}\n</tool_call><|im_end|> <|im_start|>user Hey! What is the weather like in Beijing?<|im_end|> <|im_start|>assistant
-
-
-
deepseek-chat
-
提示字符串
User: {user_message_1} Assistant: {assistant_message_1}<|end▁of▁sentence|>User: {user_message_2} Assistant:
-
-
deepseek-chat-2
-
提示字符串
<|begin_of_sentence|>{system_message} User: {user_message_1} Assistant: {assistant_message_1}<|end_of_sentence|>User: {user_message_2} Assistant:
-
-
deepseek-coder
-
提示字符串
{system} ### Instruction: {question_1} ### Response: {answer_1} <|EOT|> ### Instruction: {question_2} ### Response:
-
-
embedding
-
提示字符串 此提示模板仅用于嵌入模型。它作为一个占位符,因此没有具体的提示字符串。
-
-
gemma-instruct
-
提示字符串
<bos><start_of_turn>user {user_message}<end_of_turn> <start_of_turn>model {model_message}<end_of_turn>model
-
-
glm-4-chat
-
提示字符串
[gMASK]<|system|> {system_message}<|user|> {user_message_1}<|assistant|> {assistant_message_1}
-
-
human-assistant
-
提示字符串
Human: {input_1}\n\nAssistant:{output_1}Human: {input_2}\n\nAssistant:
-
-
intel-neural
-
提示字符串
### System: {system} ### User: {usr} ### Assistant:
-
-
llama-2-chat
-
提示字符串
<s>[INST] <<SYS>> {system_message} <</SYS>> {user_message_1} [/INST] {assistant_message} </s><s>[INST] {user_message_2} [/INST]
-
-
llama-3-chat
-
提示字符串
<|begin_of_text|><|start_header_id|>system<|end_header_id|> {{ system_prompt }}<|eot_id|><|start_header_id|>user<|end_header_id|> {{ user_message_1 }}<|eot_id|><|start_header_id|>assistant<|end_header_id|> {{ model_answer_1 }}<|eot_id|><|start_header_id|>user<|end_header_id|> {{ user_message_2 }}<|eot_id|><|start_header_id|>assistant<|end_header_id|>
-
-
mistral-instruct
-
提示字符串
<s>[INST] {user_message_1} [/INST]{assistant_message_1}</s>[INST] {user_message_2} [/INST]{assistant_message_2}</s>
-
-
mistrallite
-
提示字符串
<|prompter|>{user_message}</s><|assistant|>{assistant_message}</s>
-
-
mistral-tool
-
提示字符串
[INST] {user_message_1} [/INST][TOOL_CALLS] [{tool_call_1}]</s>[TOOL_RESULTS]{tool_result_1}[/TOOL_RESULTS]{assistant_message_1}</s>[AVAILABLE_TOOLS] [{tool_1},{tool_2}][/AVAILABLE_TOOLS][INST] {user_message_2} [/INST]
-
示例
[INST] Hey! What is the weather like in Beijing and Tokyo? [/INST][TOOL_CALLS] [{"name":"get_current_weather","arguments":{"location": "Beijing, CN", "format": "celsius"}}]</s>[TOOL_RESULTS]Fine, with a chance of showers.[/TOOL_RESULTS]Today in Auckland, the weather is expected to be partly cloudy with a high chance of showers. Be prepared for possible rain and carry an umbrella if you're venturing outside. Have a great day!</s>[AVAILABLE_TOOLS] [{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}},{"type":"function","function":{"name":"predict_weather","description":"Predict the weather in 24 hours","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}][/AVAILABLE_TOOLS][INST] What is the weather like in Beijing now?[/INST]
-
-
-
octopus
-
提示字符串
{system_prompt}\n\nQuery: {input_text} \n\nResponse:
-
-
openchat
-
提示字符串
GPT4 User: {prompt}<|end_of_turn|>GPT4 Assistant:
-
-
phi-2-instruct
-
提示字符串
Instruct: <prompt>\nOutput:
-
-
phi-3-chat
-
提示字符串
<|system|> {system_message}<|end|> <|user|> {user_message_1}<|end|> <|assistant|> {assistant_message_1}<|end|> <|user|> {user_message_2}<|end|> <|assistant|>
-
-
solar-instruct
-
提示字符串
<s> ### User: {user_message} \### Assistant: {assistant_message}</s>
-
-
stablelm-zephyr
-
提示字符串
<|user|> {prompt}<|endoftext|> <|assistant|>
-
-
vicuna-1.0-chat
-
提示字符串
{system} USER: {prompt} ASSISTANT:
-
-
vicuna-1.1-chat
-
提示字符串
USER: {prompt} ASSISTANT:
-
-
vicuna-llava
-
提示字符串
<system_prompt>\nUSER:<image_embeddings>\n<textual_prompt>\nASSISTANT:
-
-
wizard-coder
-
提示字符串
{system} ### Instruction: {instruction} ### Response:
-
-
zephyr
-
提示字符串
<|system|> {system_prompt}</s> <|user|> {prompt}</s> <|assistant|>
-
依赖项
~8MB
~170K SLoC