I'm Japanese.
I feel that the prompt template is weird.
指示 is the instruction.
So, 指示 is 以下は、タスクを説明する指示と、文脈のある入力の組み合わせです。要求を適切に満たす応答を書きなさい。
入力 is the user prompt. Of course, 入力 also means "input".
So, 入力 is {prompt}.

Thanks in advance.

Oh OK - well you're probably right!

But let me show you how I came to this prompt, because it was based on code provided by the model creators. Maybe I misunderstood it?

This code is provided in the original model README:

def build_prompt(user_query, inputs="", sep="\n\n### "):
    sys_msg = "以下は、タスクを説明する指示と、文脈のある入力の組み合わせです。要求を適切に満たす応答を書きなさい。"
    p = sys_msg
    roles = ["指示", "応答"]
    msgs = [": \n" + user_query, ": \n"]
    if inputs:
        roles.insert(1, "入力")
        msgs.insert(1, ": \n" + inputs)
    for role, msg in zip(roles, msgs):
        p += sep + role + msg
    return p

# Infer with prompt without any additional input
user_inputs = {
    "user_query": "与えられたことわざの意味を小学生でも分かるように教えてください。",
    "inputs": "情けは人のためならず"
}
prompt = build_prompt(**user_inputs)

So what I did was run this code:

def build_prompt(user_query, inputs="", sep="\n\n### "):
    sys_msg = "以下は、タスクを説明する指示と、文脈のある入力の組み合わせです。要求を適切に満たす応答を書きなさい。"
    p = sys_msg
    roles = ["指示", "応答"]
    msgs = [": \n" + user_query, ": \n"]
    if inputs:
        roles.insert(1, "入力")
        msgs.insert(1, ": \n" + inputs)
    for role, msg in zip(roles, msgs):
        p += sep + role + msg
    return p

# Infer with prompt without any additional input
user_inputs = {
    "user_query": "write a story about llamas",
    "inputs": "the llamas are nice"
}
print(build_prompt(**user_inputs))

And it gave me this output:

以下は、タスクを説明する指示と、文脈のある入力の組み合わせです。要求を適切に満たす応答を書きなさい。

### 指示:
write a story about llamas

### 入力:
the llamas are nice

### 応答:

And then I set my prompt_template according to my understanding that "write a story about llamas" was the prompt and "the llamas are nice" was the input.

Did I misunderstand? Please let me know.

Yes, you're right. I'm sorry to misunderstand the prompt template.

No problem!

TheBloke changed pull request status to closed

Sign up or log in to comment