GithubHelp home page GithubHelp logo

couragelfyang / chat_prompt_templates Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ki-seki/chat_prompt_templates

0.0 0.0 0.0 19 KB

Collection of Basic Prompt Templates for Various Chat LLMs (Chat LLM 的基础提示模板集合)

License: MIT License

chat_prompt_templates's Introduction

Chat Prompt Templates

Collection of Basic Prompt Templates for Various Chat LLMs | Chat LLM 的基础提示模板集合

Motivation: The basic prompt template will significantly affect the effectiveness of instruction following. Models of different architectures may use different prompt templates during training. However, at present, these templates can be challenging to locate; sometimes they are embedded in example codes, hidden within GitHub issues, or occasionally found in official blogs...

动机: 基础提示模板会显著影响指令跟随的效果。不同架构的模型在训练时可能使用不同的提示模板。然而,目前这些模板往往难以找到;有时它们嵌入在示例代码中,有时隐藏在 GitHub 问题中,有时偶尔在官方博客中发现...

Important

First check InternLM/xtuner's templates.py. If not found there, then return to this repository for your search.

请首先在 InternLM/xtuner 的 templates.py 中搜索你需要的模板。如果在那里找不到,请返回到此仓库搜索。

(Alphabetical order by architecture)

(按架构名称的字典序排列)

Baichuan Prompt Template

template = """<reserved_195>{query}<reserved_196>"""

ChatGLM3 Prompt Template

template = """<|system|>
You are ChatGLM3, a large language model trained by Zhipu.AI. Follow the user's instructions carefully. Respond using markdown.
<|user|>
{query}
<|assistant|>
"""

Gemma Prompt Template

template = """<bos><start_of_turn>user
{query}<end_of_turn>
<start_of_turn>model"""

InternLM2 Prompt Template

template = """<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
{query}<|im_end|>
<|im_start|>assistant
"""

LLaMA2 Prompt Template

template = """<s>[INST] <<SYS>>
You are a helpful, respectful and honest assistant.
<</SYS>> {query} [/INST] Sure, I'd be happy to help. Here is the answer:"""

Phi-2 Prompt Template

template = """Instruct: {query}\nOutput:"""
# or template = """Alice: {query}\nBob:"""

Qwen Prompt Template

template = """<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
{query}<|im_end|>
<|im_start|>assistant
"""
# Using vLLM interface
payload = json.dumps({
    "prompt": query,
    "n": 1,
    "stop": ["<|endoftext|>", "<|im_end|>"],
})

XXX Prompt Template

template = 
  • References:
  • Model Site:
  • Note:

chat_prompt_templates's People

Contributors

ki-seki avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.