import{s as Ve,o as Re,n as Xe}from"../chunks/scheduler.37c15a92.js";import{S as He,i as Le,g as r,s as n,r as u,A as Ye,h as p,f as l,c as a,j as de,u as c,x as h,k as me,y as k,a as s,v as m,d as J,t as y,w as T,m as qt,n as At}from"../chunks/index.2bf4358c.js";import{T as bt}from"../chunks/Tip.363c041f.js";import{C as N}from"../chunks/CodeBlock.4f5fc1ad.js";import{C as De}from"../chunks/CourseFloatingBanner.15ba07e6.js";import{H as B,E as Pe}from"../chunks/EditOnGithub.8916dc7c.js";function Oe(C){let M;return{c(){M=qt(`Chat templates are crucial for:
- Maintaining consistent conversation structure
- Ensuring proper role identification
- Managing context across multiple turns
- Supporting advanced features like tool use`)},l(i){M=At(i,`Chat templates are crucial for:
- Maintaining consistent conversation structure
- Ensuring proper role identification
- Managing context across multiple turns
- Supporting advanced features like tool use`)},m(i,g){s(i,M,g)},d(i){i&&l(M)}}}function Ke(C){let M;return{c(){M=qt("When using an instruct model, always verify you're using the correct chat template format. Using the wrong template can result in poor model performance or unexpected behavior. The easiest way to ensure this is to check the model tokenizer configuration on the Hub. For example, the `SmolLM2-135M-Instruct` model uses [this configuration](https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct/blob/e2c3f7557efbdec707ae3a336371d169783f1da1/tokenizer_config.json#L146).")},l(i){M=At(i,"When using an instruct model, always verify you're using the correct chat template format. Using the wrong template can result in poor model performance or unexpected behavior. The easiest way to ensure this is to check the model tokenizer configuration on the Hub. For example, the `SmolLM2-135M-Instruct` model uses [this configuration](https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct/blob/e2c3f7557efbdec707ae3a336371d169783f1da1/tokenizer_config.json#L146).")},m(i,g){s(i,M,g)},d(i){i&&l(M)}}}function tl(C){let M;return{c(){M=qt(`When implementing advanced features:
- Test thoroughly with your specific model. Vision and tool use template are particularly diverse.
- Monitor token usage carefully between each feature and model.
- Document the expected format for each feature`)},l(i){M=At(i,`When implementing advanced features:
- Test thoroughly with your specific model. Vision and tool use template are particularly diverse.
- Monitor token usage carefully between each feature and model.
- Document the expected format for each feature`)},m(i,g){s(i,M,g)},d(i){i&&l(M)}}}function el(C){let M;return{c(){M=qt(`Common pitfalls to avoid:
- Mixing different template formats in the same application
- Exceeding token limits with long conversation histories
- Not properly escaping special characters in messages
- Forgetting to validate input message structure
- Ignoring model-specific template requirements`)},l(i){M=At(i,`Common pitfalls to avoid:
- Mixing different template formats in the same application
- Exceeding token limits with long conversation histories
- Not properly escaping special characters in messages
- Forgetting to validate input message structure
- Ignoring model-specific template requirements`)},m(i,g){s(i,M,g)},d(i){i&&l(M)}}}function ll(C){let M,i,g="<li>Load the dataset:</li>",v,j,S,U,F="<li>Create a processing function:</li>",$,b,q,x,W="<li>Apply the chat template using your chosen model’s tokenizer</li>",I,A,G="Remember to validate your output format matches your target model’s requirements!",E;return j=new N({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJIdWdnaW5nRmFjZVRCJTJGc21vbHRhbGslMjIp",highlighted:`<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

dataset = load_dataset(<span class="hljs-string">&quot;HuggingFaceTB/smoltalk&quot;</span>)`,wrap:!1}}),b=new N({props:{code:"ZGVmJTIwY29udmVydF90b19jaGF0bWwoZXhhbXBsZSklM0ElMEElMjAlMjAlMjAlMjByZXR1cm4lMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJtZXNzYWdlcyUyMiUzQSUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMGV4YW1wbGUlNUIlMjJpbnB1dCUyMiU1RCU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnJvbGUlMjIlM0ElMjAlMjJhc3Npc3RhbnQlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwZXhhbXBsZSU1QiUyMm91dHB1dCUyMiU1RCU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1RCUwQSUyMCUyMCUyMCUyMCU3RA==",highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">convert_to_chatml</span>(<span class="hljs-params">example</span>):
    <span class="hljs-keyword">return</span> {
        <span class="hljs-string">&quot;messages&quot;</span>: [
            {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: example[<span class="hljs-string">&quot;input&quot;</span>]},
            {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;assistant&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: example[<span class="hljs-string">&quot;output&quot;</span>]},
        ]
    }`,wrap:!1}}),{c(){M=qt("Follow these steps to convert the `HuggingFaceTB/smoltalk` dataset into chatml format:\n"),i=r("ol"),i.innerHTML=g,v=n(),u(j.$$.fragment),S=n(),U=r("ol"),U.innerHTML=F,$=n(),u(b.$$.fragment),q=n(),x=r("ol"),x.innerHTML=W,I=n(),A=r("p"),A.textContent=G,this.h()},l(o){M=At(o,"Follow these steps to convert the `HuggingFaceTB/smoltalk` dataset into chatml format:\n"),i=p(o,"OL",{"data-svelte-h":!0}),h(i)!=="svelte-1r7vb1q"&&(i.innerHTML=g),v=a(o),c(j.$$.fragment,o),S=a(o),U=p(o,"OL",{start:!0,"data-svelte-h":!0}),h(U)!=="svelte-1uqov0c"&&(U.innerHTML=F),$=a(o),c(b.$$.fragment,o),q=a(o),x=p(o,"OL",{start:!0,"data-svelte-h":!0}),h(x)!=="svelte-17g86i3"&&(x.innerHTML=W),I=a(o),A=p(o,"P",{"data-svelte-h":!0}),h(A)!=="svelte-tib7t6"&&(A.textContent=G),this.h()},h(){me(U,"start","2"),me(x,"start","3")},m(o,d){s(o,M,d),s(o,i,d),s(o,v,d),m(j,o,d),s(o,S,d),s(o,U,d),s(o,$,d),m(b,o,d),s(o,q,d),s(o,x,d),s(o,I,d),s(o,A,d),E=!0},p:Xe,i(o){E||(J(j.$$.fragment,o),J(b.$$.fragment,o),E=!0)},o(o){y(j.$$.fragment,o),y(b.$$.fragment,o),E=!1},d(o){o&&(l(M),l(i),l(v),l(S),l(U),l($),l(q),l(x),l(I),l(A)),T(j,o),T(b,o)}}}function sl(C){let M,i,g,v,j,S,U,F,$,b,q,x="Chat templates are essential for structuring interactions between language models and users. Whether you’re building a simple chatbot or a complex AI agent, understanding how to properly format your conversations is crucial for getting the best results from your model. In this guide, we’ll explore what chat templates are, why they matter, and how to use them effectively.",W,I,A,G,E,o,d,V,ge='A base model is trained on raw text data to predict the next token, while an instruct model is fine-tuned specifically to follow instructions and engage in conversations. For example, <a href="https://huggingface.co/HuggingFaceTB/SmolLM2-135M" rel="nofollow"><code>SmolLM2-135M</code></a> is a base model, while <a href="https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct" rel="nofollow"><code>SmolLM2-135M-Instruct</code></a> is its instruction-tuned variant.',xt,R,Ue="Instuction tuned models are trained to follow a specific conversational structure, making them more suitable for chatbot applications. Moreover, instruct models can handle complex interactions, including tool use, multimodal inputs, and function calling.",Gt,X,je='To make a base model behave like an instruct model, we need to format our prompts in a consistent way that the model can understand. This is where chat templates come in. ChatML is one such template format that structures conversations with clear role indicators (system, user, assistant). Here’s a guide on <a href="https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct/blob/e2c3f7557efbdec707ae3a336371d169783f1da1/tokenizer_config.json#L146" rel="nofollow">ChatML</a>.',Bt,Q,Nt,H,vt,L,we="Before diving into specific implementations, it’s important to understand how different models expect their conversations to be formatted. Let’s explore some common template formats using a simple example conversation:",St,Y,Ie="We’ll use the following conversation structure for all examples:",Et,D,Qt,P,fe="This is the ChatML template used in models like SmolLM2 and Qwen 2:",Zt,O,zt,K,Ce="This is using the <code>mistral</code> template format:",_t,tt,kt,et,$e="Key differences between these formats include:",Ft,lt,be="<li><p><strong>System Message Handling</strong>:</p> <ul><li>Llama 2 wraps system messages in <code>&lt;&lt;SYS&gt;&gt;</code> tags</li> <li>Llama 3 uses <code>&lt;|system|&gt;</code> tags with <code>&lt;/s&gt;</code> endings</li> <li>Mistral includes system message in the first instruction</li> <li>Qwen uses explicit <code>system</code> role with <code>&lt;|im_start|&gt;</code> tags</li> <li>ChatGPT uses <code>SYSTEM:</code> prefix</li></ul></li> <li><p><strong>Message Boundaries</strong>:</p> <ul><li>Llama 2 uses <code>[INST]</code> and <code>[/INST]</code> tags</li> <li>Llama 3 uses role-specific tags (<code>&lt;|system|&gt;</code>, <code>&lt;|user|&gt;</code>, <code>&lt;|assistant|&gt;</code>) with <code>&lt;/s&gt;</code> endings</li> <li>Mistral uses <code>[INST]</code> and <code>[/INST]</code> with <code>&lt;s&gt;</code> and <code>&lt;/s&gt;</code></li> <li>Qwen uses role-specific start/end tokens</li></ul></li> <li><p><strong>Special Tokens</strong>:</p> <ul><li>Llama 2 uses <code>&lt;s&gt;</code> and <code>&lt;/s&gt;</code> for conversation boundaries</li> <li>Llama 3 uses <code>&lt;/s&gt;</code> to end each message</li> <li>Mistral uses <code>&lt;s&gt;</code> and <code>&lt;/s&gt;</code> for turn boundaries</li> <li>Qwen uses role-specific start/end tokens</li></ul></li>",Wt,st,qe="Understanding these differences is key to working with various models. Let’s look at how the transformers library helps us handle these variations automatically:",Vt,nt,Rt,w,It,Ae="Click to see template examples",Je,ft,xe="Qwen 2 and SmolLM2 ChatML template:",ye,at,Te,Ct,Ge="Mistral template:",he,ot,Xt,it,Ht,Mt,Be="Chat templates can handle more complex scenarios beyond just conversational interactions, including:",Lt,rt,Ne="<li><strong>Tool Use</strong>: When models need to interact with external tools or APIs</li> <li><strong>Multimodal Inputs</strong>: For handling images, audio, or other media types</li> <li><strong>Function Calling</strong>: For structured function execution</li> <li><strong>Multi-turn Context</strong>: For maintaining conversation history</li>",Yt,Z,Dt,pt,ve="For multimodal conversations, chat templates can include image references or base64-encoded images:",Pt,ut,Ot,ct,Se="Here’s an example of a chat template with tool use:",Kt,mt,te,Jt,ee,yt,le,Tt,Ee="When working with chat templates, follow these key practices:",se,ht,Qe="<li><strong>Consistent Formatting</strong>: Always use the same template format throughout your application</li> <li><strong>Clear Role Definition</strong>: Clearly specify roles (system, user, assistant, tool) for each message</li> <li><strong>Context Management</strong>: Be mindful of token limits when maintaining conversation history</li> <li><strong>Error Handling</strong>: Include proper error handling for tool calls and multimodal inputs</li> <li><strong>Validation</strong>: Validate message structure before sending to the model</li>",ne,z,ae,dt,oe,gt,Ze="Let’s practice implementing chat templates with a real-world example.",ie,_,Me,Ut,re,jt,ze='<li><a href="https://huggingface.co/docs/transformers/main/en/chat_templating" rel="nofollow">Hugging Face Chat Templating Guide</a></li> <li><a href="https://huggingface.co/docs/transformers" rel="nofollow">Transformers Documentation</a></li> <li><a href="https://github.com/chujiezheng/chat_templates" rel="nofollow">Chat Templates Examples Repository</a></li>',pe,wt,ue,$t,ce;return j=new De({props:{chapter:2,classNames:"absolute z-10 right-0 top-0",notebooks:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/course/en/chapter11/section2.ipynb"}]}}),U=new B({props:{title:"Chat Templates",local:"chat-templates",headingTag:"h1"}}),$=new B({props:{title:"Introduction",local:"introduction",headingTag:"h2"}}),I=new bt({props:{$$slots:{default:[Oe]},$$scope:{ctx:C}}}),G=new B({props:{title:"Model Types and Templates",local:"model-types-and-templates",headingTag:"h2"}}),o=new B({props:{title:"Base Models vs Instruct Models",local:"base-models-vs-instruct-models",headingTag:"h3"}}),Q=new bt({props:{warning:!0,$$slots:{default:[Ke]},$$scope:{ctx:C}}}),H=new B({props:{title:"Common Template Formats",local:"common-template-formats",headingTag:"h3"}}),D=new N({props:{code:"bWVzc2FnZXMlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlN0IlMjJyb2xlJTIyJTNBJTIwJTIyc3lzdGVtJTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMCUyMllvdSUyMGFyZSUyMGElMjBoZWxwZnVsJTIwYXNzaXN0YW50LiUyMiU3RCUyQyUwQSUyMCUyMCUyMCUyMCU3QiUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMCUyMkhlbGxvISUyMiU3RCUyQyUwQSUyMCUyMCUyMCUyMCU3QiUyMnJvbGUlMjIlM0ElMjAlMjJhc3Npc3RhbnQlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIySGkhJTIwSG93JTIwY2FuJTIwSSUyMGhlbHAlMjB5b3UlMjB0b2RheSUzRiUyMiU3RCUyQyUwQSUyMCUyMCUyMCUyMCU3QiUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMCUyMldoYXQncyUyMHRoZSUyMHdlYXRoZXIlM0YlMjIlN0QlMkMlMEElNUQ=",highlighted:`messages = [
    {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;system&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;You are a helpful assistant.&quot;</span>},
    {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Hello!&quot;</span>},
    {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;assistant&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Hi! How can I help you today?&quot;</span>},
    {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;What&#x27;s the weather?&quot;</span>},
]`,wrap:!1}}),O=new N({props:{code:"JTNDJTdDaW1fc3RhcnQlN0MlM0VzeXN0ZW0lMEFZb3UlMjBhcmUlMjBhJTIwaGVscGZ1bCUyMGFzc2lzdGFudC4lM0MlN0NpbV9lbmQlN0MlM0UlMEElM0MlN0NpbV9zdGFydCU3QyUzRXVzZXIlMEFIZWxsbyElM0MlN0NpbV9lbmQlN0MlM0UlMEElM0MlN0NpbV9zdGFydCU3QyUzRWFzc2lzdGFudCUwQUhpISUyMEhvdyUyMGNhbiUyMEklMjBoZWxwJTIweW91JTIwdG9kYXklM0YlM0MlN0NpbV9lbmQlN0MlM0UlMEElM0MlN0NpbV9zdGFydCU3QyUzRXVzZXIlMEFXaGF0J3MlMjB0aGUlMjB3ZWF0aGVyJTNGJTNDJTdDaW1fc3RhcnQlN0MlM0Vhc3Npc3RhbnQ=",highlighted:`&lt;|im_start|&gt;system
You are a helpful assistant.&lt;|im_end|&gt;
&lt;|im_start|&gt;user
Hello!&lt;|im_end|&gt;
&lt;|im_start|&gt;assistant
Hi! How can I <span class="hljs-built_in">help</span> you today?&lt;|im_end|&gt;
&lt;|im_start|&gt;user
What<span class="hljs-string">&#x27;s the weather?&lt;|im_start|&gt;assistant</span>`,wrap:!1}}),tt=new N({props:{code:"JTNDcyUzRSU1QklOU1QlNUQlMjBZb3UlMjBhcmUlMjBhJTIwaGVscGZ1bCUyMGFzc2lzdGFudC4lMjAlNUIlMkZJTlNUJTVEJTBBSGkhJTIwSG93JTIwY2FuJTIwSSUyMGhlbHAlMjB5b3UlMjB0b2RheSUzRiUzQyUyRnMlM0UlMEElNUJJTlNUJTVEJTIwSGVsbG8hJTIwJTVCJTJGSU5TVCU1RA==",highlighted:`&lt;s&gt;[INST] You are a helpful assistant. [/INST]
Hi! How can I <span class="hljs-built_in">help</span> you today?&lt;/s&gt;
[INST] Hello! [/INST]`,wrap:!1}}),nt=new N({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEElMjMlMjBUaGVzZSUyMHdpbGwlMjB1c2UlMjBkaWZmZXJlbnQlMjB0ZW1wbGF0ZXMlMjBhdXRvbWF0aWNhbGx5JTBBbWlzdHJhbF90b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJtaXN0cmFsYWklMkZNaXN0cmFsLTdCLUluc3RydWN0LXYwLjElMjIpJTBBcXdlbl90b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJRd2VuJTJGUXdlbi03Qi1DaGF0JTIyKSUwQXNtb2xfdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIySHVnZ2luZ0ZhY2VUQiUyRlNtb2xMTTItMTM1TS1JbnN0cnVjdCUyMiklMEElMEFtZXNzYWdlcyUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCU3QiUyMnJvbGUlMjIlM0ElMjAlMjJzeXN0ZW0lMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIyWW91JTIwYXJlJTIwYSUyMGhlbHBmdWwlMjBhc3Npc3RhbnQuJTIyJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTdCJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIySGVsbG8hJTIyJTdEJTJDJTBBJTVEJTBBJTBBJTIzJTIwRWFjaCUyMHdpbGwlMjBmb3JtYXQlMjBhY2NvcmRpbmclMjB0byUyMGl0cyUyMG1vZGVsJ3MlMjB0ZW1wbGF0ZSUwQW1pc3RyYWxfY2hhdCUyMCUzRCUyMG1pc3RyYWxfdG9rZW5pemVyLmFwcGx5X2NoYXRfdGVtcGxhdGUobWVzc2FnZXMlMkMlMjB0b2tlbml6ZSUzREZhbHNlKSUwQXF3ZW5fY2hhdCUyMCUzRCUyMHF3ZW5fdG9rZW5pemVyLmFwcGx5X2NoYXRfdGVtcGxhdGUobWVzc2FnZXMlMkMlMjB0b2tlbml6ZSUzREZhbHNlKSUwQXNtb2xfY2hhdCUyMCUzRCUyMHNtb2xfdG9rZW5pemVyLmFwcGx5X2NoYXRfdGVtcGxhdGUobWVzc2FnZXMlMkMlMjB0b2tlbml6ZSUzREZhbHNlKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

<span class="hljs-comment"># These will use different templates automatically</span>
mistral_tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;mistralai/Mistral-7B-Instruct-v0.1&quot;</span>)
qwen_tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;Qwen/Qwen-7B-Chat&quot;</span>)
smol_tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;HuggingFaceTB/SmolLM2-135M-Instruct&quot;</span>)

messages = [
    {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;system&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;You are a helpful assistant.&quot;</span>},
    {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Hello!&quot;</span>},
]

<span class="hljs-comment"># Each will format according to its model&#x27;s template</span>
mistral_chat = mistral_tokenizer.apply_chat_template(messages, tokenize=<span class="hljs-literal">False</span>)
qwen_chat = qwen_tokenizer.apply_chat_template(messages, tokenize=<span class="hljs-literal">False</span>)
smol_chat = smol_tokenizer.apply_chat_template(messages, tokenize=<span class="hljs-literal">False</span>)`,wrap:!1}}),at=new N({props:{code:"JTNDJTdDaW1fc3RhcnQlN0MlM0VzeXN0ZW0lMEFZb3UlMjBhcmUlMjBhJTIwaGVscGZ1bCUyMGFzc2lzdGFudC4lM0MlN0NpbV9lbmQlN0MlM0UlMEElM0MlN0NpbV9zdGFydCU3QyUzRXVzZXIlMEFIZWxsbyElM0MlN0NpbV9lbmQlN0MlM0UlMEElM0MlN0NpbV9zdGFydCU3QyUzRWFzc2lzdGFudCUwQUhpISUyMEhvdyUyMGNhbiUyMEklMjBoZWxwJTIweW91JTIwdG9kYXklM0YlM0MlN0NpbV9lbmQlN0MlM0UlMEElM0MlN0NpbV9zdGFydCU3QyUzRXVzZXIlMEFXaGF0J3MlMjB0aGUlMjB3ZWF0aGVyJTNGJTNDJTdDaW1fc3RhcnQlN0MlM0Vhc3Npc3RhbnQ=",highlighted:`&lt;|im_start|&gt;system
You are a helpful assistant.&lt;|im_end|&gt;
&lt;|im_start|&gt;user
Hello!&lt;|im_end|&gt;
&lt;|im_start|&gt;assistant
Hi! How can I <span class="hljs-built_in">help</span> you today?&lt;|im_end|&gt;
&lt;|im_start|&gt;user
What<span class="hljs-string">&#x27;s the weather?&lt;|im_start|&gt;assistant</span>`,wrap:!1}}),ot=new N({props:{code:"JTNDcyUzRSU1QklOU1QlNUQlMjBZb3UlMjBhcmUlMjBhJTIwaGVscGZ1bCUyMGFzc2lzdGFudC4lMjAlNUIlMkZJTlNUJTVEJTBBSGkhJTIwSG93JTIwY2FuJTIwSSUyMGhlbHAlMjB5b3UlMjB0b2RheSUzRiUzQyUyRnMlM0UlMEElNUJJTlNUJTVEJTIwSGVsbG8hJTIwJTVCJTJGSU5TVCU1RA==",highlighted:`&lt;s&gt;[INST] You are a helpful assistant. [/INST]
Hi! How can I <span class="hljs-built_in">help</span> you today?&lt;/s&gt;
[INST] Hello! [/INST]`,wrap:!1}}),it=new B({props:{title:"Advanced Features",local:"advanced-features",headingTag:"h3"}}),Z=new bt({props:{$$slots:{default:[tl]},$$scope:{ctx:C}}}),ut=new N({props:{code:"bWVzc2FnZXMlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJyb2xlJTIyJTNBJTIwJTIyc3lzdGVtJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyY29udGVudCUyMiUzQSUyMCUyMllvdSUyMGFyZSUyMGElMjBoZWxwZnVsJTIwdmlzaW9uJTIwYXNzaXN0YW50JTIwdGhhdCUyMGNhbiUyMGFuYWx5emUlMjBpbWFnZXMuJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJjb250ZW50JTIyJTNBJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTIydHlwZSUyMiUzQSUyMCUyMnRleHQlMjIlMkMlMjAlMjJ0ZXh0JTIyJTNBJTIwJTIyV2hhdCdzJTIwaW4lMjB0aGlzJTIwaW1hZ2UlM0YlMjIlN0QlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMjJ0eXBlJTIyJTNBJTIwJTIyaW1hZ2UlMjIlMkMlMjAlMjJpbWFnZV91cmwlMjIlM0ElMjAlMjJodHRwcyUzQSUyRiUyRmV4YW1wbGUuY29tJTJGaW1hZ2UuanBnJTIyJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTdEJTJDJTBBJTVE",highlighted:`messages = [
    {
        <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;system&quot;</span>,
        <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;You are a helpful vision assistant that can analyze images.&quot;</span>,
    },
    {
        <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>,
        <span class="hljs-string">&quot;content&quot;</span>: [
            {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;What&#x27;s in this image?&quot;</span>},
            {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;image&quot;</span>, <span class="hljs-string">&quot;image_url&quot;</span>: <span class="hljs-string">&quot;https://example.com/image.jpg&quot;</span>},
        ],
    },
]`,wrap:!1}}),mt=new N({props:{code:"bWVzc2FnZXMlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJyb2xlJTIyJTNBJTIwJTIyc3lzdGVtJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyY29udGVudCUyMiUzQSUyMCUyMllvdSUyMGFyZSUyMGFuJTIwQUklMjBhc3Npc3RhbnQlMjB0aGF0JTIwY2FuJTIwdXNlJTIwdG9vbHMuJTIwQXZhaWxhYmxlJTIwdG9vbHMlM0ElMjBjYWxjdWxhdG9yJTJDJTIwd2VhdGhlcl9hcGklMjIlMkMlMEElMjAlMjAlMjAlMjAlN0QlMkMlMEElMjAlMjAlMjAlMjAlN0IlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJXaGF0J3MlMjAxMjMlMjAqJTIwNDU2JTIwYW5kJTIwaXMlMjBpdCUyMHJhaW5pbmclMjBpbiUyMFBhcmlzJTNGJTIyJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIycm9sZSUyMiUzQSUyMCUyMmFzc2lzdGFudCUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJMZXQlMjBtZSUyMGhlbHAlMjB5b3UlMjB3aXRoJTIwdGhhdC4lMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJ0b29sX2NhbGxzJTIyJTNBJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIydG9vbCUyMiUzQSUyMCUyMmNhbGN1bGF0b3IlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJwYXJhbWV0ZXJzJTIyJTNBJTIwJTdCJTIyb3BlcmF0aW9uJTIyJTNBJTIwJTIybXVsdGlwbHklMjIlMkMlMjAlMjJ4JTIyJTNBJTIwMTIzJTJDJTIwJTIyeSUyMiUzQSUyMDQ1NiU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnRvb2wlMjIlM0ElMjAlMjJ3ZWF0aGVyX2FwaSUyMiUyQyUyMCUyMnBhcmFtZXRlcnMlMjIlM0ElMjAlN0IlMjJjaXR5JTIyJTNBJTIwJTIyUGFyaXMlMjIlMkMlMjAlMjJjb3VudHJ5JTIyJTNBJTIwJTIyRnJhbmNlJTIyJTdEJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTdCJTIycm9sZSUyMiUzQSUyMCUyMnRvb2wlMjIlMkMlMjAlMjJ0b29sX25hbWUlMjIlM0ElMjAlMjJjYWxjdWxhdG9yJTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMCUyMjU2MDg4JTIyJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIycm9sZSUyMiUzQSUyMCUyMnRvb2wlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJ0b29sX25hbWUlMjIlM0ElMjAlMjJ3ZWF0aGVyX2FwaSUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjIlN0InY29uZGl0aW9uJyUzQSUyMCdyYWluJyUyQyUyMCd0ZW1wZXJhdHVyZSclM0ElMjAxNSU3RCUyMiUyQyUwQSUyMCUyMCUyMCUyMCU3RCUyQyUwQSU1RA==",highlighted:`messages = [
    {
        <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;system&quot;</span>,
        <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;You are an AI assistant that can use tools. Available tools: calculator, weather_api&quot;</span>,
    },
    {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;What&#x27;s 123 * 456 and is it raining in Paris?&quot;</span>},
    {
        <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;assistant&quot;</span>,
        <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Let me help you with that.&quot;</span>,
        <span class="hljs-string">&quot;tool_calls&quot;</span>: [
            {
                <span class="hljs-string">&quot;tool&quot;</span>: <span class="hljs-string">&quot;calculator&quot;</span>,
                <span class="hljs-string">&quot;parameters&quot;</span>: {<span class="hljs-string">&quot;operation&quot;</span>: <span class="hljs-string">&quot;multiply&quot;</span>, <span class="hljs-string">&quot;x&quot;</span>: <span class="hljs-number">123</span>, <span class="hljs-string">&quot;y&quot;</span>: <span class="hljs-number">456</span>},
            },
            {<span class="hljs-string">&quot;tool&quot;</span>: <span class="hljs-string">&quot;weather_api&quot;</span>, <span class="hljs-string">&quot;parameters&quot;</span>: {<span class="hljs-string">&quot;city&quot;</span>: <span class="hljs-string">&quot;Paris&quot;</span>, <span class="hljs-string">&quot;country&quot;</span>: <span class="hljs-string">&quot;France&quot;</span>}},
        ],
    },
    {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;tool&quot;</span>, <span class="hljs-string">&quot;tool_name&quot;</span>: <span class="hljs-string">&quot;calculator&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;56088&quot;</span>},
    {
        <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;tool&quot;</span>,
        <span class="hljs-string">&quot;tool_name&quot;</span>: <span class="hljs-string">&quot;weather_api&quot;</span>,
        <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;{&#x27;condition&#x27;: &#x27;rain&#x27;, &#x27;temperature&#x27;: 15}&quot;</span>,
    },
]`,wrap:!1}}),Jt=new B({props:{title:"Best Practices",local:"best-practices",headingTag:"h2"}}),yt=new B({props:{title:"General Guidelines",local:"general-guidelines",headingTag:"h3"}}),z=new bt({props:{warning:!0,$$slots:{default:[el]},$$scope:{ctx:C}}}),dt=new B({props:{title:"Hands-on Exercise",local:"hands-on-exercise",headingTag:"h2"}}),_=new bt({props:{$$slots:{default:[ll]},$$scope:{ctx:C}}}),Ut=new B({props:{title:"Additional Resources",local:"additional-resources",headingTag:"h2"}}),wt=new Pe({props:{source:"https://github.com/huggingface/course/blob/main/chapters/en/chapter11/2.mdx"}}),{c(){M=r("meta"),i=n(),g=r("p"),v=n(),u(j.$$.fragment),S=n(),u(U.$$.fragment),F=n(),u($.$$.fragment),b=n(),q=r("p"),q.textContent=x,W=n(),u(I.$$.fragment),A=n(),u(G.$$.fragment),E=n(),u(o.$$.fragment),d=n(),V=r("p"),V.innerHTML=ge,xt=n(),R=r("p"),R.textContent=Ue,Gt=n(),X=r("p"),X.innerHTML=je,Bt=n(),u(Q.$$.fragment),Nt=n(),u(H.$$.fragment),vt=n(),L=r("p"),L.textContent=we,St=n(),Y=r("p"),Y.textContent=Ie,Et=n(),u(D.$$.fragment),Qt=n(),P=r("p"),P.textContent=fe,Zt=n(),u(O.$$.fragment),zt=n(),K=r("p"),K.innerHTML=Ce,_t=n(),u(tt.$$.fragment),kt=n(),et=r("p"),et.textContent=$e,Ft=n(),lt=r("ol"),lt.innerHTML=be,Wt=n(),st=r("p"),st.textContent=qe,Vt=n(),u(nt.$$.fragment),Rt=n(),w=r("details"),It=r("summary"),It.textContent=Ae,Je=n(),ft=r("p"),ft.textContent=xe,ye=n(),u(at.$$.fragment),Te=n(),Ct=r("p"),Ct.textContent=Ge,he=n(),u(ot.$$.fragment),Xt=n(),u(it.$$.fragment),Ht=n(),Mt=r("p"),Mt.textContent=Be,Lt=n(),rt=r("ol"),rt.innerHTML=Ne,Yt=n(),u(Z.$$.fragment),Dt=n(),pt=r("p"),pt.textContent=ve,Pt=n(),u(ut.$$.fragment),Ot=n(),ct=r("p"),ct.textContent=Se,Kt=n(),u(mt.$$.fragment),te=n(),u(Jt.$$.fragment),ee=n(),u(yt.$$.fragment),le=n(),Tt=r("p"),Tt.textContent=Ee,se=n(),ht=r("ol"),ht.innerHTML=Qe,ne=n(),u(z.$$.fragment),ae=n(),u(dt.$$.fragment),oe=n(),gt=r("p"),gt.textContent=Ze,ie=n(),u(_.$$.fragment),Me=n(),u(Ut.$$.fragment),re=n(),jt=r("ul"),jt.innerHTML=ze,pe=n(),u(wt.$$.fragment),ue=n(),$t=r("p"),this.h()},l(t){const e=Ye("svelte-u9bgzb",document.head);M=p(e,"META",{name:!0,content:!0}),e.forEach(l),i=a(t),g=p(t,"P",{}),de(g).forEach(l),v=a(t),c(j.$$.fragment,t),S=a(t),c(U.$$.fragment,t),F=a(t),c($.$$.fragment,t),b=a(t),q=p(t,"P",{"data-svelte-h":!0}),h(q)!=="svelte-1k3k0tu"&&(q.textContent=x),W=a(t),c(I.$$.fragment,t),A=a(t),c(G.$$.fragment,t),E=a(t),c(o.$$.fragment,t),d=a(t),V=p(t,"P",{"data-svelte-h":!0}),h(V)!=="svelte-pqh38m"&&(V.innerHTML=ge),xt=a(t),R=p(t,"P",{"data-svelte-h":!0}),h(R)!=="svelte-bw0cej"&&(R.textContent=Ue),Gt=a(t),X=p(t,"P",{"data-svelte-h":!0}),h(X)!=="svelte-t1qpmx"&&(X.innerHTML=je),Bt=a(t),c(Q.$$.fragment,t),Nt=a(t),c(H.$$.fragment,t),vt=a(t),L=p(t,"P",{"data-svelte-h":!0}),h(L)!=="svelte-1rnoysy"&&(L.textContent=we),St=a(t),Y=p(t,"P",{"data-svelte-h":!0}),h(Y)!=="svelte-1domsij"&&(Y.textContent=Ie),Et=a(t),c(D.$$.fragment,t),Qt=a(t),P=p(t,"P",{"data-svelte-h":!0}),h(P)!=="svelte-8sxtx3"&&(P.textContent=fe),Zt=a(t),c(O.$$.fragment,t),zt=a(t),K=p(t,"P",{"data-svelte-h":!0}),h(K)!=="svelte-1yg6yh7"&&(K.innerHTML=Ce),_t=a(t),c(tt.$$.fragment,t),kt=a(t),et=p(t,"P",{"data-svelte-h":!0}),h(et)!=="svelte-qxk9qi"&&(et.textContent=$e),Ft=a(t),lt=p(t,"OL",{"data-svelte-h":!0}),h(lt)!=="svelte-udw0je"&&(lt.innerHTML=be),Wt=a(t),st=p(t,"P",{"data-svelte-h":!0}),h(st)!=="svelte-c21ogw"&&(st.textContent=qe),Vt=a(t),c(nt.$$.fragment,t),Rt=a(t),w=p(t,"DETAILS",{});var f=de(w);It=p(f,"SUMMARY",{"data-svelte-h":!0}),h(It)!=="svelte-so6cx1"&&(It.textContent=Ae),Je=a(f),ft=p(f,"P",{"data-svelte-h":!0}),h(ft)!=="svelte-2rzsq5"&&(ft.textContent=xe),ye=a(f),c(at.$$.fragment,f),Te=a(f),Ct=p(f,"P",{"data-svelte-h":!0}),h(Ct)!=="svelte-c25hqw"&&(Ct.textContent=Ge),he=a(f),c(ot.$$.fragment,f),f.forEach(l),Xt=a(t),c(it.$$.fragment,t),Ht=a(t),Mt=p(t,"P",{"data-svelte-h":!0}),h(Mt)!=="svelte-157lci4"&&(Mt.textContent=Be),Lt=a(t),rt=p(t,"OL",{"data-svelte-h":!0}),h(rt)!=="svelte-15wiqjs"&&(rt.innerHTML=Ne),Yt=a(t),c(Z.$$.fragment,t),Dt=a(t),pt=p(t,"P",{"data-svelte-h":!0}),h(pt)!=="svelte-4u84x6"&&(pt.textContent=ve),Pt=a(t),c(ut.$$.fragment,t),Ot=a(t),ct=p(t,"P",{"data-svelte-h":!0}),h(ct)!=="svelte-djgs24"&&(ct.textContent=Se),Kt=a(t),c(mt.$$.fragment,t),te=a(t),c(Jt.$$.fragment,t),ee=a(t),c(yt.$$.fragment,t),le=a(t),Tt=p(t,"P",{"data-svelte-h":!0}),h(Tt)!=="svelte-18063wt"&&(Tt.textContent=Ee),se=a(t),ht=p(t,"OL",{"data-svelte-h":!0}),h(ht)!=="svelte-tdiy2"&&(ht.innerHTML=Qe),ne=a(t),c(z.$$.fragment,t),ae=a(t),c(dt.$$.fragment,t),oe=a(t),gt=p(t,"P",{"data-svelte-h":!0}),h(gt)!=="svelte-1r51sxe"&&(gt.textContent=Ze),ie=a(t),c(_.$$.fragment,t),Me=a(t),c(Ut.$$.fragment,t),re=a(t),jt=p(t,"UL",{"data-svelte-h":!0}),h(jt)!=="svelte-kyf9sf"&&(jt.innerHTML=ze),pe=a(t),c(wt.$$.fragment,t),ue=a(t),$t=p(t,"P",{}),de($t).forEach(l),this.h()},h(){me(M,"name","hf:doc:metadata"),me(M,"content",nl)},m(t,e){k(document.head,M),s(t,i,e),s(t,g,e),s(t,v,e),m(j,t,e),s(t,S,e),m(U,t,e),s(t,F,e),m($,t,e),s(t,b,e),s(t,q,e),s(t,W,e),m(I,t,e),s(t,A,e),m(G,t,e),s(t,E,e),m(o,t,e),s(t,d,e),s(t,V,e),s(t,xt,e),s(t,R,e),s(t,Gt,e),s(t,X,e),s(t,Bt,e),m(Q,t,e),s(t,Nt,e),m(H,t,e),s(t,vt,e),s(t,L,e),s(t,St,e),s(t,Y,e),s(t,Et,e),m(D,t,e),s(t,Qt,e),s(t,P,e),s(t,Zt,e),m(O,t,e),s(t,zt,e),s(t,K,e),s(t,_t,e),m(tt,t,e),s(t,kt,e),s(t,et,e),s(t,Ft,e),s(t,lt,e),s(t,Wt,e),s(t,st,e),s(t,Vt,e),m(nt,t,e),s(t,Rt,e),s(t,w,e),k(w,It),k(w,Je),k(w,ft),k(w,ye),m(at,w,null),k(w,Te),k(w,Ct),k(w,he),m(ot,w,null),s(t,Xt,e),m(it,t,e),s(t,Ht,e),s(t,Mt,e),s(t,Lt,e),s(t,rt,e),s(t,Yt,e),m(Z,t,e),s(t,Dt,e),s(t,pt,e),s(t,Pt,e),m(ut,t,e),s(t,Ot,e),s(t,ct,e),s(t,Kt,e),m(mt,t,e),s(t,te,e),m(Jt,t,e),s(t,ee,e),m(yt,t,e),s(t,le,e),s(t,Tt,e),s(t,se,e),s(t,ht,e),s(t,ne,e),m(z,t,e),s(t,ae,e),m(dt,t,e),s(t,oe,e),s(t,gt,e),s(t,ie,e),m(_,t,e),s(t,Me,e),m(Ut,t,e),s(t,re,e),s(t,jt,e),s(t,pe,e),m(wt,t,e),s(t,ue,e),s(t,$t,e),ce=!0},p(t,[e]){const f={};e&2&&(f.$$scope={dirty:e,ctx:t}),I.$set(f);const _e={};e&2&&(_e.$$scope={dirty:e,ctx:t}),Q.$set(_e);const ke={};e&2&&(ke.$$scope={dirty:e,ctx:t}),Z.$set(ke);const Fe={};e&2&&(Fe.$$scope={dirty:e,ctx:t}),z.$set(Fe);const We={};e&2&&(We.$$scope={dirty:e,ctx:t}),_.$set(We)},i(t){ce||(J(j.$$.fragment,t),J(U.$$.fragment,t),J($.$$.fragment,t),J(I.$$.fragment,t),J(G.$$.fragment,t),J(o.$$.fragment,t),J(Q.$$.fragment,t),J(H.$$.fragment,t),J(D.$$.fragment,t),J(O.$$.fragment,t),J(tt.$$.fragment,t),J(nt.$$.fragment,t),J(at.$$.fragment,t),J(ot.$$.fragment,t),J(it.$$.fragment,t),J(Z.$$.fragment,t),J(ut.$$.fragment,t),J(mt.$$.fragment,t),J(Jt.$$.fragment,t),J(yt.$$.fragment,t),J(z.$$.fragment,t),J(dt.$$.fragment,t),J(_.$$.fragment,t),J(Ut.$$.fragment,t),J(wt.$$.fragment,t),ce=!0)},o(t){y(j.$$.fragment,t),y(U.$$.fragment,t),y($.$$.fragment,t),y(I.$$.fragment,t),y(G.$$.fragment,t),y(o.$$.fragment,t),y(Q.$$.fragment,t),y(H.$$.fragment,t),y(D.$$.fragment,t),y(O.$$.fragment,t),y(tt.$$.fragment,t),y(nt.$$.fragment,t),y(at.$$.fragment,t),y(ot.$$.fragment,t),y(it.$$.fragment,t),y(Z.$$.fragment,t),y(ut.$$.fragment,t),y(mt.$$.fragment,t),y(Jt.$$.fragment,t),y(yt.$$.fragment,t),y(z.$$.fragment,t),y(dt.$$.fragment,t),y(_.$$.fragment,t),y(Ut.$$.fragment,t),y(wt.$$.fragment,t),ce=!1},d(t){t&&(l(i),l(g),l(v),l(S),l(F),l(b),l(q),l(W),l(A),l(E),l(d),l(V),l(xt),l(R),l(Gt),l(X),l(Bt),l(Nt),l(vt),l(L),l(St),l(Y),l(Et),l(Qt),l(P),l(Zt),l(zt),l(K),l(_t),l(kt),l(et),l(Ft),l(lt),l(Wt),l(st),l(Vt),l(Rt),l(w),l(Xt),l(Ht),l(Mt),l(Lt),l(rt),l(Yt),l(Dt),l(pt),l(Pt),l(Ot),l(ct),l(Kt),l(te),l(ee),l(le),l(Tt),l(se),l(ht),l(ne),l(ae),l(oe),l(gt),l(ie),l(Me),l(re),l(jt),l(pe),l(ue),l($t)),l(M),T(j,t),T(U,t),T($,t),T(I,t),T(G,t),T(o,t),T(Q,t),T(H,t),T(D,t),T(O,t),T(tt,t),T(nt,t),T(at),T(ot),T(it,t),T(Z,t),T(ut,t),T(mt,t),T(Jt,t),T(yt,t),T(z,t),T(dt,t),T(_,t),T(Ut,t),T(wt,t)}}}const nl='{"title":"Chat Templates","local":"chat-templates","sections":[{"title":"Introduction","local":"introduction","sections":[],"depth":2},{"title":"Model Types and Templates","local":"model-types-and-templates","sections":[{"title":"Base Models vs Instruct Models","local":"base-models-vs-instruct-models","sections":[],"depth":3},{"title":"Common Template Formats","local":"common-template-formats","sections":[],"depth":3},{"title":"Advanced Features","local":"advanced-features","sections":[],"depth":3}],"depth":2},{"title":"Best Practices","local":"best-practices","sections":[{"title":"General Guidelines","local":"general-guidelines","sections":[],"depth":3}],"depth":2},{"title":"Hands-on Exercise","local":"hands-on-exercise","sections":[],"depth":2},{"title":"Additional Resources","local":"additional-resources","sections":[],"depth":2}],"depth":1}';function al(C){return Re(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class cl extends He{constructor(M){super(),Le(this,M,al,sl,Ve,{})}}export{cl as component};
