From 9e2c9c06ffd6eed67c4aff831fb72b61da693a18 Mon Sep 17 00:00:00 2001 From: ebsmothers Date: Mon, 15 Apr 2024 18:04:47 -0700 Subject: [PATCH] update chat format docstrings (#769) --- torchtune/data/_chat_formats.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/torchtune/data/_chat_formats.py b/torchtune/data/_chat_formats.py index 3d3388567b..40fe6436f6 100644 --- a/torchtune/data/_chat_formats.py +++ b/torchtune/data/_chat_formats.py @@ -47,11 +47,15 @@ class Llama2ChatFormat(ChatFormat): repository `_. Example: - "[INST] <> - You are a helpful, respectful and honest assistant. - <> + .. code-block:: text + + "[INST] <> + You are a helpful, respectful and honest assistant. + <>" + + I am going to Paris, what should I see? [/INST] Paris, the capital of France, is known for its stunning architecture..." + - I am going to Paris, what should I see? [/INST] Paris, the capital of France, is known for its stunning architecture..." """ B_INST, E_INST = "[INST]", "[/INST]" @@ -110,8 +114,10 @@ class MistralChatFormat(ChatFormat): prompts. Example: - "[INST] I am going to Paris, what should I see? [/INST] Paris, the capital - of France, is known for its stunning architecture..." + .. code-block:: text + + "[INST] I am going to Paris, what should I see? [/INST] Paris, the capital + of France, is known for its stunning architecture..." """ @@ -162,7 +168,7 @@ def format( class ChatMLFormat(ChatFormat): """ OpenAI's `Chat Markup Language - `_ + `_ used by their chat models. It is the default chat format used by HuggingFace models.