Skip to content

Commit

Permalink
update chat format docstrings (#769)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebsmothers authored and joecummings committed Apr 16, 2024
1 parent 7003fb3 commit 9e2c9c0
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions torchtune/data/_chat_formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ class Llama2ChatFormat(ChatFormat):
repository <https://github.com/meta-llama/llama/blob/main/llama/generation.py>`_.
Example:
"[INST] <<SYS>>
You are a helpful, respectful and honest assistant.
<</SYS>>
.. code-block:: text
"[INST] <<SYS>>
You are a helpful, respectful and honest assistant.
<</SYS>>"
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]"
Expand Down Expand Up @@ -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..."
"""

Expand Down Expand Up @@ -162,7 +168,7 @@ def format(
class ChatMLFormat(ChatFormat):
"""
OpenAI's `Chat Markup Language
<https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/ai-services/openai/includes/chat-markup-language.md>`_
<https://github.com/MicrosoftDocs/azure-docs/blob/772c14eeabfa0c0c561d5c2d34ef19341f528b7b/articles/ai-services/openai/how-to/chat-markup-language.md>`_
used by their chat models.
It is the default chat format used by HuggingFace models.
Expand Down

0 comments on commit 9e2c9c0

Please sign in to comment.