Prompt Format.

#1
by xzuyn - opened

The LoRA versions have some info on proper formatting. https://huggingface.co/JosephusCheung/Guanaco & https://huggingface.co/KBlueLeaf/guanaco-7B-leh

Prompt format:

### Instruction:
User: History User Input
Assistant: History Assistant Answer
### Input:
System: Knowledge
User: New User Input
### Response:
New Assistant Answer

Example prompt, and its output.

### Instruction:
User: Hello
Assistant: Hello! How can I help you?
User: Can you explain how Gradient Descent work?
Assistant: Sure, Gradient Descent is a type of optimization algorithm used to find the global minimum of a function. It works by taking small steps in the direction of steepest descent and adjusting the parameters accordingly until the desired result is achieved.
### Input:
User: How about Nesterov Accelerated Gradient? Can you campare them?
### Response:
Nesterov Accelerated Gradient is a type of optimization algorithm used to find the global minimum of a function. It works by taking small steps in the direction of steepest descent and adjusting the parameters accordingly until the desired result is achieved. Gradient Descent, on the other hand, works by taking small steps in the direction of steepest descent and adjusting the parameters accordingly until the desired result is achieved. Both Gradient Descent and Nesterov Accelerated Gradient are optimization algorithms used to find the global minimum of a function, but they have different approaches to achieving this goal. Gradient Descent takes small steps in the direction of steepest descent, while Nesterov Accelerated Gradient takes larger steps that more quickly move towards the global minimum. 

A bit weird since it doesn't output as the Assistant, and just generates the Assistant's message. Unless Tim changed the way it was formatted when he trained with QLoRA, it should act like this.

Another thing to note is when it doesn't have anything else to say, it will output line breaks surrounded by spaces (\n) or zero width spaces (\u200b); that best meets your needs. \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n

They are not the same guanaco as the qlora species, are they?

The qlora guanaco playground has this
https://huggingface.co/spaces/uwnlp/guanaco-playground-tgi/blob/main/app.py#L48-L49

header = "A chat between a curious human and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions."
prompt_template = "### Human: {query}\n### Assistant:{response}"

and

    if len(past_messages) < 1:
        prompt = header + prompt_template.format(query=user_message, response="")
    else:
        prompt = header
        for i in range(0, len(past_messages), 2):
            intermediate_prompt = prompt_template.format(query=past_messages[i]["content"], response=past_messages[i+1]["content"])
            print("intermediate: ", intermediate_prompt)
            prompt = prompt + '\n' + intermediate_prompt

        prompt = prompt + prompt_template.format(query=user_message, response="")

Yeah while it's confusing I'm pretty sure there's no connection between Joseph Cheung's Guanaco model and Tim Dettmers's Guanaco model, they just both decided to name their models based on Guanacos which is a species related to Lamas.

Weird that they'd just use another models name.

Sign up or log in to comment