import{s as He,o as Le,n as Xe}from"../chunks/scheduler.cc52f4b9.js";import{S as Ye,i as De,e as r,s as n,c as u,h as Pe,a as p,d as l,b as a,f as ge,g as m,j as h,k as Gt,l as k,m as s,n as c,t as y,o as J,p as T,q as bt,r as qt}from"../chunks/index.5b747fde.js";import{T as At}from"../chunks/Tip.f0925d57.js";import{C as Oe,H as v,E as Ke}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.d38ac5a9.js";import{C as S}from"../chunks/CodeBlock.665bfc37.js";import{C as tl}from"../chunks/CourseFloatingBanner.b33fcd79.js";function el(b){let M;return{c(){M=bt(`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(o){M=qt(o,`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(o,U){s(o,M,U)},d(o){o&&l(M)}}}function ll(b){let M,o,U="this configuration",w;return{c(){M=bt("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 "),o=r("a"),o.textContent=U,w=bt("."),this.h()},l(d){M=qt(d,"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 "),o=p(d,"A",{href:!0,"data-svelte-h":!0}),h(o)!=="svelte-xnja4f"&&(o.textContent=U),w=qt(d,"."),this.h()},h(){Gt(o,"href","https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct/blob/e2c3f7557efbdec707ae3a336371d169783f1da1/tokenizer_config.json#L146")},m(d,I){s(d,M,I),s(d,o,I),s(d,w,I)},p:Xe,d(d){d&&(l(M),l(o),l(w))}}}function sl(b){let M;return{c(){M=bt(`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(o){M=qt(o,`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(o,U){s(o,M,U)},d(o){o&&l(M)}}}function nl(b){let M;return{c(){M=bt(`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(o){M=qt(o,`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(o,U){s(o,M,U)},d(o){o&&l(M)}}}function al(b){let M,o,U="<li>Load the dataset:</li>",w,d,I,j,F="<li>Create a processing function:</li>",q,x,A,C,N="<li>Apply the chat template using your chosen model’s tokenizer</li>",W,G,B="Remember to validate your output format matches your target model’s requirements!",E;return d=new S({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}}),x=new S({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=bt("Follow these steps to convert the `HuggingFaceTB/smoltalk` dataset into chatml format:\n"),o=r("ol"),o.innerHTML=U,w=n(),u(d.$$.fragment),I=n(),j=r("ol"),j.innerHTML=F,q=n(),u(x.$$.fragment),A=n(),C=r("ol"),C.innerHTML=N,W=n(),G=r("p"),G.textContent=B,this.h()},l(i){M=qt(i,"Follow these steps to convert the `HuggingFaceTB/smoltalk` dataset into chatml format:\n"),o=p(i,"OL",{"data-svelte-h":!0}),h(o)!=="svelte-1r7vb1q"&&(o.innerHTML=U),w=a(i),m(d.$$.fragment,i),I=a(i),j=p(i,"OL",{start:!0,"data-svelte-h":!0}),h(j)!=="svelte-1uqov0c"&&(j.innerHTML=F),q=a(i),m(x.$$.fragment,i),A=a(i),C=p(i,"OL",{start:!0,"data-svelte-h":!0}),h(C)!=="svelte-17g86i3"&&(C.innerHTML=N),W=a(i),G=p(i,"P",{"data-svelte-h":!0}),h(G)!=="svelte-tib7t6"&&(G.textContent=B),this.h()},h(){Gt(j,"start","2"),Gt(C,"start","3")},m(i,g){s(i,M,g),s(i,o,g),s(i,w,g),c(d,i,g),s(i,I,g),s(i,j,g),s(i,q,g),c(x,i,g),s(i,A,g),s(i,C,g),s(i,W,g),s(i,G,g),E=!0},p:Xe,i(i){E||(y(d.$$.fragment,i),y(x.$$.fragment,i),E=!0)},o(i){J(d.$$.fragment,i),J(x.$$.fragment,i),E=!1},d(i){i&&(l(M),l(o),l(w),l(I),l(j),l(q),l(A),l(C),l(W),l(G)),T(d,i),T(x,i)}}}function il(b){let M,o,U,w,d,I,j,F,q,x,A,C,N,W="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.",G,B,E,i,g,V,Bt,R,je='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.',Nt,X,we="Instruction 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.",vt,H,fe='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>.',St,Q,Et,L,Qt,Y,Ie="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:",zt,D,Ce="We’ll use the following conversation structure for all examples:",Zt,P,_t,O,$e="This is the ChatML template used in models like SmolLM2 and Qwen 2:",kt,K,Ft,tt,be="This is using the <code>mistral</code> template format:",Wt,et,Vt,lt,qe="Key differences between these formats include:",Rt,st,xe="<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>",Xt,nt,Ae="Understanding these differences is key to working with various models. Let’s look at how the transformers library helps us handle these variations automatically:",Ht,at,Lt,f,It,Ge="Click to see template examples",Te,Ct,Be="Qwen 2 and SmolLM2 ChatML template:",he,it,de,$t,Ne="Mistral template:",Ue,ot,Yt,Mt,Dt,rt,ve="Chat templates can handle more complex scenarios beyond just conversational interactions, including:",Pt,pt,Se="<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>",Ot,z,Kt,ut,Ee="For multimodal conversations, chat templates can include image references or base64-encoded images:",te,mt,ee,ct,Qe="Here’s an example of a chat template with tool use:",le,yt,se,Jt,ne,Tt,ae,ht,ze="When working with chat templates, follow these key practices:",ie,dt,Ze="<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>",oe,Z,Me,Ut,re,gt,_e="Let’s practice implementing chat templates with a real-world example.",pe,_,ue,jt,me,wt,ke='<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>',ce,ft,ye,xt,Je;return d=new tl({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"}]}}),j=new Oe({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),q=new v({props:{title:"Chat Templates",local:"chat-templates",headingTag:"h1"}}),A=new v({props:{title:"Introduction",local:"introduction",headingTag:"h2"}}),B=new At({props:{$$slots:{default:[el]},$$scope:{ctx:b}}}),i=new v({props:{title:"Model Types and Templates",local:"model-types-and-templates",headingTag:"h2"}}),V=new v({props:{title:"Base Models vs Instruct Models",local:"base-models-vs-instruct-models",headingTag:"h3"}}),Q=new At({props:{warning:!0,$$slots:{default:[ll]},$$scope:{ctx:b}}}),L=new v({props:{title:"Common Template Formats",local:"common-template-formats",headingTag:"h3"}}),P=new S({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}}),K=new S({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}}),et=new S({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}}),at=new S({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}}),it=new S({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 S({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}}),Mt=new v({props:{title:"Advanced Features",local:"advanced-features",headingTag:"h3"}}),z=new At({props:{$$slots:{default:[sl]},$$scope:{ctx:b}}}),mt=new S({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}}),yt=new S({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 v({props:{title:"Best Practices",local:"best-practices",headingTag:"h2"}}),Tt=new v({props:{title:"General Guidelines",local:"general-guidelines",headingTag:"h3"}}),Z=new At({props:{warning:!0,$$slots:{default:[nl]},$$scope:{ctx:b}}}),Ut=new v({props:{title:"Hands-on Exercise",local:"hands-on-exercise",headingTag:"h2"}}),_=new At({props:{$$slots:{default:[al]},$$scope:{ctx:b}}}),jt=new v({props:{title:"Additional Resources",local:"additional-resources",headingTag:"h2"}}),ft=new Ke({props:{source:"https://github.com/huggingface/course/blob/main/chapters/en/chapter11/2.mdx"}}),{c(){M=r("meta"),o=n(),U=r("p"),w=n(),u(d.$$.fragment),I=n(),u(j.$$.fragment),F=n(),u(q.$$.fragment),x=n(),u(A.$$.fragment),C=n(),N=r("p"),N.textContent=W,G=n(),u(B.$$.fragment),E=n(),u(i.$$.fragment),g=n(),u(V.$$.fragment),Bt=n(),R=r("p"),R.innerHTML=je,Nt=n(),X=r("p"),X.textContent=we,vt=n(),H=r("p"),H.innerHTML=fe,St=n(),u(Q.$$.fragment),Et=n(),u(L.$$.fragment),Qt=n(),Y=r("p"),Y.textContent=Ie,zt=n(),D=r("p"),D.textContent=Ce,Zt=n(),u(P.$$.fragment),_t=n(),O=r("p"),O.textContent=$e,kt=n(),u(K.$$.fragment),Ft=n(),tt=r("p"),tt.innerHTML=be,Wt=n(),u(et.$$.fragment),Vt=n(),lt=r("p"),lt.textContent=qe,Rt=n(),st=r("ol"),st.innerHTML=xe,Xt=n(),nt=r("p"),nt.textContent=Ae,Ht=n(),u(at.$$.fragment),Lt=n(),f=r("details"),It=r("summary"),It.textContent=Ge,Te=n(),Ct=r("p"),Ct.textContent=Be,he=n(),u(it.$$.fragment),de=n(),$t=r("p"),$t.textContent=Ne,Ue=n(),u(ot.$$.fragment),Yt=n(),u(Mt.$$.fragment),Dt=n(),rt=r("p"),rt.textContent=ve,Pt=n(),pt=r("ol"),pt.innerHTML=Se,Ot=n(),u(z.$$.fragment),Kt=n(),ut=r("p"),ut.textContent=Ee,te=n(),u(mt.$$.fragment),ee=n(),ct=r("p"),ct.textContent=Qe,le=n(),u(yt.$$.fragment),se=n(),u(Jt.$$.fragment),ne=n(),u(Tt.$$.fragment),ae=n(),ht=r("p"),ht.textContent=ze,ie=n(),dt=r("ol"),dt.innerHTML=Ze,oe=n(),u(Z.$$.fragment),Me=n(),u(Ut.$$.fragment),re=n(),gt=r("p"),gt.textContent=_e,pe=n(),u(_.$$.fragment),ue=n(),u(jt.$$.fragment),me=n(),wt=r("ul"),wt.innerHTML=ke,ce=n(),u(ft.$$.fragment),ye=n(),xt=r("p"),this.h()},l(t){const e=Pe("svelte-u9bgzb",document.head);M=p(e,"META",{name:!0,content:!0}),e.forEach(l),o=a(t),U=p(t,"P",{}),ge(U).forEach(l),w=a(t),m(d.$$.fragment,t),I=a(t),m(j.$$.fragment,t),F=a(t),m(q.$$.fragment,t),x=a(t),m(A.$$.fragment,t),C=a(t),N=p(t,"P",{"data-svelte-h":!0}),h(N)!=="svelte-1k3k0tu"&&(N.textContent=W),G=a(t),m(B.$$.fragment,t),E=a(t),m(i.$$.fragment,t),g=a(t),m(V.$$.fragment,t),Bt=a(t),R=p(t,"P",{"data-svelte-h":!0}),h(R)!=="svelte-pqh38m"&&(R.innerHTML=je),Nt=a(t),X=p(t,"P",{"data-svelte-h":!0}),h(X)!=="svelte-1kt0rz"&&(X.textContent=we),vt=a(t),H=p(t,"P",{"data-svelte-h":!0}),h(H)!=="svelte-t1qpmx"&&(H.innerHTML=fe),St=a(t),m(Q.$$.fragment,t),Et=a(t),m(L.$$.fragment,t),Qt=a(t),Y=p(t,"P",{"data-svelte-h":!0}),h(Y)!=="svelte-1rnoysy"&&(Y.textContent=Ie),zt=a(t),D=p(t,"P",{"data-svelte-h":!0}),h(D)!=="svelte-1domsij"&&(D.textContent=Ce),Zt=a(t),m(P.$$.fragment,t),_t=a(t),O=p(t,"P",{"data-svelte-h":!0}),h(O)!=="svelte-8sxtx3"&&(O.textContent=$e),kt=a(t),m(K.$$.fragment,t),Ft=a(t),tt=p(t,"P",{"data-svelte-h":!0}),h(tt)!=="svelte-1yg6yh7"&&(tt.innerHTML=be),Wt=a(t),m(et.$$.fragment,t),Vt=a(t),lt=p(t,"P",{"data-svelte-h":!0}),h(lt)!=="svelte-qxk9qi"&&(lt.textContent=qe),Rt=a(t),st=p(t,"OL",{"data-svelte-h":!0}),h(st)!=="svelte-udw0je"&&(st.innerHTML=xe),Xt=a(t),nt=p(t,"P",{"data-svelte-h":!0}),h(nt)!=="svelte-c21ogw"&&(nt.textContent=Ae),Ht=a(t),m(at.$$.fragment,t),Lt=a(t),f=p(t,"DETAILS",{});var $=ge(f);It=p($,"SUMMARY",{"data-svelte-h":!0}),h(It)!=="svelte-so6cx1"&&(It.textContent=Ge),Te=a($),Ct=p($,"P",{"data-svelte-h":!0}),h(Ct)!=="svelte-2rzsq5"&&(Ct.textContent=Be),he=a($),m(it.$$.fragment,$),de=a($),$t=p($,"P",{"data-svelte-h":!0}),h($t)!=="svelte-c25hqw"&&($t.textContent=Ne),Ue=a($),m(ot.$$.fragment,$),$.forEach(l),Yt=a(t),m(Mt.$$.fragment,t),Dt=a(t),rt=p(t,"P",{"data-svelte-h":!0}),h(rt)!=="svelte-157lci4"&&(rt.textContent=ve),Pt=a(t),pt=p(t,"OL",{"data-svelte-h":!0}),h(pt)!=="svelte-15wiqjs"&&(pt.innerHTML=Se),Ot=a(t),m(z.$$.fragment,t),Kt=a(t),ut=p(t,"P",{"data-svelte-h":!0}),h(ut)!=="svelte-4u84x6"&&(ut.textContent=Ee),te=a(t),m(mt.$$.fragment,t),ee=a(t),ct=p(t,"P",{"data-svelte-h":!0}),h(ct)!=="svelte-djgs24"&&(ct.textContent=Qe),le=a(t),m(yt.$$.fragment,t),se=a(t),m(Jt.$$.fragment,t),ne=a(t),m(Tt.$$.fragment,t),ae=a(t),ht=p(t,"P",{"data-svelte-h":!0}),h(ht)!=="svelte-18063wt"&&(ht.textContent=ze),ie=a(t),dt=p(t,"OL",{"data-svelte-h":!0}),h(dt)!=="svelte-tdiy2"&&(dt.innerHTML=Ze),oe=a(t),m(Z.$$.fragment,t),Me=a(t),m(Ut.$$.fragment,t),re=a(t),gt=p(t,"P",{"data-svelte-h":!0}),h(gt)!=="svelte-1r51sxe"&&(gt.textContent=_e),pe=a(t),m(_.$$.fragment,t),ue=a(t),m(jt.$$.fragment,t),me=a(t),wt=p(t,"UL",{"data-svelte-h":!0}),h(wt)!=="svelte-kyf9sf"&&(wt.innerHTML=ke),ce=a(t),m(ft.$$.fragment,t),ye=a(t),xt=p(t,"P",{}),ge(xt).forEach(l),this.h()},h(){Gt(M,"name","hf:doc:metadata"),Gt(M,"content",ol)},m(t,e){k(document.head,M),s(t,o,e),s(t,U,e),s(t,w,e),c(d,t,e),s(t,I,e),c(j,t,e),s(t,F,e),c(q,t,e),s(t,x,e),c(A,t,e),s(t,C,e),s(t,N,e),s(t,G,e),c(B,t,e),s(t,E,e),c(i,t,e),s(t,g,e),c(V,t,e),s(t,Bt,e),s(t,R,e),s(t,Nt,e),s(t,X,e),s(t,vt,e),s(t,H,e),s(t,St,e),c(Q,t,e),s(t,Et,e),c(L,t,e),s(t,Qt,e),s(t,Y,e),s(t,zt,e),s(t,D,e),s(t,Zt,e),c(P,t,e),s(t,_t,e),s(t,O,e),s(t,kt,e),c(K,t,e),s(t,Ft,e),s(t,tt,e),s(t,Wt,e),c(et,t,e),s(t,Vt,e),s(t,lt,e),s(t,Rt,e),s(t,st,e),s(t,Xt,e),s(t,nt,e),s(t,Ht,e),c(at,t,e),s(t,Lt,e),s(t,f,e),k(f,It),k(f,Te),k(f,Ct),k(f,he),c(it,f,null),k(f,de),k(f,$t),k(f,Ue),c(ot,f,null),s(t,Yt,e),c(Mt,t,e),s(t,Dt,e),s(t,rt,e),s(t,Pt,e),s(t,pt,e),s(t,Ot,e),c(z,t,e),s(t,Kt,e),s(t,ut,e),s(t,te,e),c(mt,t,e),s(t,ee,e),s(t,ct,e),s(t,le,e),c(yt,t,e),s(t,se,e),c(Jt,t,e),s(t,ne,e),c(Tt,t,e),s(t,ae,e),s(t,ht,e),s(t,ie,e),s(t,dt,e),s(t,oe,e),c(Z,t,e),s(t,Me,e),c(Ut,t,e),s(t,re,e),s(t,gt,e),s(t,pe,e),c(_,t,e),s(t,ue,e),c(jt,t,e),s(t,me,e),s(t,wt,e),s(t,ce,e),c(ft,t,e),s(t,ye,e),s(t,xt,e),Je=!0},p(t,[e]){const $={};e&2&&($.$$scope={dirty:e,ctx:t}),B.$set($);const Fe={};e&2&&(Fe.$$scope={dirty:e,ctx:t}),Q.$set(Fe);const We={};e&2&&(We.$$scope={dirty:e,ctx:t}),z.$set(We);const Ve={};e&2&&(Ve.$$scope={dirty:e,ctx:t}),Z.$set(Ve);const Re={};e&2&&(Re.$$scope={dirty:e,ctx:t}),_.$set(Re)},i(t){Je||(y(d.$$.fragment,t),y(j.$$.fragment,t),y(q.$$.fragment,t),y(A.$$.fragment,t),y(B.$$.fragment,t),y(i.$$.fragment,t),y(V.$$.fragment,t),y(Q.$$.fragment,t),y(L.$$.fragment,t),y(P.$$.fragment,t),y(K.$$.fragment,t),y(et.$$.fragment,t),y(at.$$.fragment,t),y(it.$$.fragment,t),y(ot.$$.fragment,t),y(Mt.$$.fragment,t),y(z.$$.fragment,t),y(mt.$$.fragment,t),y(yt.$$.fragment,t),y(Jt.$$.fragment,t),y(Tt.$$.fragment,t),y(Z.$$.fragment,t),y(Ut.$$.fragment,t),y(_.$$.fragment,t),y(jt.$$.fragment,t),y(ft.$$.fragment,t),Je=!0)},o(t){J(d.$$.fragment,t),J(j.$$.fragment,t),J(q.$$.fragment,t),J(A.$$.fragment,t),J(B.$$.fragment,t),J(i.$$.fragment,t),J(V.$$.fragment,t),J(Q.$$.fragment,t),J(L.$$.fragment,t),J(P.$$.fragment,t),J(K.$$.fragment,t),J(et.$$.fragment,t),J(at.$$.fragment,t),J(it.$$.fragment,t),J(ot.$$.fragment,t),J(Mt.$$.fragment,t),J(z.$$.fragment,t),J(mt.$$.fragment,t),J(yt.$$.fragment,t),J(Jt.$$.fragment,t),J(Tt.$$.fragment,t),J(Z.$$.fragment,t),J(Ut.$$.fragment,t),J(_.$$.fragment,t),J(jt.$$.fragment,t),J(ft.$$.fragment,t),Je=!1},d(t){t&&(l(o),l(U),l(w),l(I),l(F),l(x),l(C),l(N),l(G),l(E),l(g),l(Bt),l(R),l(Nt),l(X),l(vt),l(H),l(St),l(Et),l(Qt),l(Y),l(zt),l(D),l(Zt),l(_t),l(O),l(kt),l(Ft),l(tt),l(Wt),l(Vt),l(lt),l(Rt),l(st),l(Xt),l(nt),l(Ht),l(Lt),l(f),l(Yt),l(Dt),l(rt),l(Pt),l(pt),l(Ot),l(Kt),l(ut),l(te),l(ee),l(ct),l(le),l(se),l(ne),l(ae),l(ht),l(ie),l(dt),l(oe),l(Me),l(re),l(gt),l(pe),l(ue),l(me),l(wt),l(ce),l(ye),l(xt)),l(M),T(d,t),T(j,t),T(q,t),T(A,t),T(B,t),T(i,t),T(V,t),T(Q,t),T(L,t),T(P,t),T(K,t),T(et,t),T(at,t),T(it),T(ot),T(Mt,t),T(z,t),T(mt,t),T(yt,t),T(Jt,t),T(Tt,t),T(Z,t),T(Ut,t),T(_,t),T(jt,t),T(ft,t)}}}const ol='{"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 Ml(b){return Le(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Jl extends Ye{constructor(M){super(),De(this,M,Ml,il,He,{})}}export{Jl as component};
