Lightning-AI / litgpt

20+ high-performance LLM implementations with recipes to pretrain, finetune and deploy at scale.
https://lightning.ai
Apache License 2.0
8.09k stars 817 forks source link

Enable multi-turn prompts for supported LLMs #1488

Open aniketmaurya opened 2 weeks ago

aniketmaurya commented 2 weeks ago

Enable multi-turn prompts for the supported LLMs like Llama3, Mistral similar to https://github.com/Lightning-AI/litgpt/pull/1487

We should be able to do the following with other supported models:

style = Llama3()
msgs = [
        {"role": "system", "content": "You are a helpful AI assistant for travel tips and recommendations"},
        {"role": "user", "content": "What is France's capital?"},
        {"role": "assistant", "content": "Bonjour! The capital of France is Paris!"},
        {"role": "user", "content": "What can I do there?"},
    ]
multiturn_output = style.apply(msgs)
rasbt commented 2 weeks ago

Agreed. We planned this previously #1269 and can come back to it some time.