import{s as Wl,o as Rl,n as Bl}from"../chunks/scheduler.37c15a92.js";import{S as Ll,i as Fl,g as f,s as p,r as b,A as Xl,h as y,f as n,c,j as Zl,u as w,x as d,k as bs,y as Yl,a,v as T,t as m,b as L,d as M,w as J,m as Pl,n as ql,p as F}from"../chunks/index.7cb9c9b8.js";import{T as Hl}from"../chunks/Tip.d10b3fc9.js";import{Y as zl}from"../chunks/Youtube.8666c400.js";import{C as j}from"../chunks/CodeBlock.abae2786.js";import{C as Sl}from"../chunks/CourseFloatingBanner.df82c153.js";import{F as Kl}from"../chunks/FrameworkSwitchCourse.97630871.js";import{H as ft,E as Ol}from"../chunks/index.c99deea2.js";function en(h){let s,r;return s=new Sl({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/master/course/en/chapter2/section2_tf.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/en/chapter2/section2_tf.ipynb"}]}}),{c(){b(s.$$.fragment)},l(t){w(s.$$.fragment,t)},m(t,o){T(s,t,o),r=!0},i(t){r||(M(s.$$.fragment,t),r=!0)},o(t){m(s.$$.fragment,t),r=!1},d(t){J(s,t)}}}function tn(h){let s,r;return s=new Sl({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/master/course/en/chapter2/section2_pt.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/en/chapter2/section2_pt.ipynb"}]}}),{c(){b(s.$$.fragment)},l(t){w(s.$$.fragment,t)},m(t,o){T(s,t,o),r=!0},i(t){r||(M(s.$$.fragment,t),r=!0)},o(t){m(s.$$.fragment,t),r=!1},d(t){J(s,t)}}}function sn(h){let s;return{c(){s=Pl("This is the first section where the content is slightly different depending on whether you use PyTorch or TensorFlow. Toggle the switch on top of the title to select the platform you prefer!")},l(r){s=ql(r,"This is the first section where the content is slightly different depending on whether you use PyTorch or TensorFlow. Toggle the switch on top of the title to select the platform you prefer!")},m(r,t){a(r,s,t)},d(r){r&&n(s)}}}function ln(h){let s,r;return s=new zl({props:{id:"wVN12smEvqg"}}),{c(){b(s.$$.fragment)},l(t){w(s.$$.fragment,t)},m(t,o){T(s,t,o),r=!0},i(t){r||(M(s.$$.fragment,t),r=!0)},o(t){m(s.$$.fragment,t),r=!1},d(t){J(s,t)}}}function nn(h){let s,r;return s=new zl({props:{id:"1pedAIvTWXk"}}),{c(){b(s.$$.fragment)},l(t){w(s.$$.fragment,t)},m(t,o){T(s,t,o),r=!0},i(t){r||(M(s.$$.fragment,t),r=!0)},o(t){m(s.$$.fragment,t),r=!1},d(t){J(s,t)}}}function an(h){let s,r;return s=new j({props:{code:"cmF3X2lucHV0cyUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMkkndmUlMjBiZWVuJTIwd2FpdGluZyUyMGZvciUyMGElMjBIdWdnaW5nRmFjZSUyMGNvdXJzZSUyMG15JTIwd2hvbGUlMjBsaWZlLiUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMkklMjBoYXRlJTIwdGhpcyUyMHNvJTIwbXVjaCElMjIlMkMlMEElNUQlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIocmF3X2lucHV0cyUyQyUyMHBhZGRpbmclM0RUcnVlJTJDJTIwdHJ1bmNhdGlvbiUzRFRydWUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQXByaW50KGlucHV0cyk=",highlighted:`raw_inputs = [
    <span class="hljs-string">&quot;I&#x27;ve been waiting for a HuggingFace course my whole life.&quot;</span>,
    <span class="hljs-string">&quot;I hate this so much!&quot;</span>,
]
inputs = tokenizer(raw_inputs, padding=<span class="hljs-literal">True</span>, truncation=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-built_in">print</span>(inputs)`,wrap:!1}}),{c(){b(s.$$.fragment)},l(t){w(s.$$.fragment,t)},m(t,o){T(s,t,o),r=!0},i(t){r||(M(s.$$.fragment,t),r=!0)},o(t){m(s.$$.fragment,t),r=!1},d(t){J(s,t)}}}function rn(h){let s,r;return s=new j({props:{code:"cmF3X2lucHV0cyUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMkkndmUlMjBiZWVuJTIwd2FpdGluZyUyMGZvciUyMGElMjBIdWdnaW5nRmFjZSUyMGNvdXJzZSUyMG15JTIwd2hvbGUlMjBsaWZlLiUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMkklMjBoYXRlJTIwdGhpcyUyMHNvJTIwbXVjaCElMjIlMkMlMEElNUQlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIocmF3X2lucHV0cyUyQyUyMHBhZGRpbmclM0RUcnVlJTJDJTIwdHJ1bmNhdGlvbiUzRFRydWUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXByaW50KGlucHV0cyk=",highlighted:`raw_inputs = [
    <span class="hljs-string">&quot;I&#x27;ve been waiting for a HuggingFace course my whole life.&quot;</span>,
    <span class="hljs-string">&quot;I hate this so much!&quot;</span>,
]
inputs = tokenizer(raw_inputs, padding=<span class="hljs-literal">True</span>, truncation=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-built_in">print</span>(inputs)`,wrap:!1}}),{c(){b(s.$$.fragment)},l(t){w(s.$$.fragment,t)},m(t,o){T(s,t,o),r=!0},i(t){r||(M(s.$$.fragment,t),r=!0)},o(t){m(s.$$.fragment,t),r=!1},d(t){J(s,t)}}}function on(h){let s,r="Here’s what the results look like as TensorFlow tensors:",t,o,u;return o=new j({props:{code:"JTdCJTBBJTIwJTIwJTIwJTIwJ2lucHV0X2lkcyclM0ElMjAlM0N0Zi5UZW5zb3IlM0ElMjBzaGFwZSUzRCgyJTJDJTIwMTYpJTJDJTIwZHR5cGUlM0RpbnQzMiUyQyUyMG51bXB5JTNEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwYXJyYXkoJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCJTIwJTIwMTAxJTJDJTIwJTIwMTA0NSUyQyUyMCUyMDEwMDUlMkMlMjAlMjAyMzEwJTJDJTIwJTIwMjA0MiUyQyUyMCUyMDM0MDMlMkMlMjAlMjAyMDA1JTJDJTIwJTIwMTAzNyUyQyUyMDE3NjYyJTJDJTIwMTIxNzIlMkMlMjAlMjAyNjA3JTJDJTIwJTIwMjAyNiUyQyUyMCUyMDI4NzglMkMlMjAlMjAyMTY2JTJDJTIwJTIwMTAxMiUyQyUyMCUyMCUyMDEwMiU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1QiUyMCUyMDEwMSUyQyUyMCUyMDEwNDUlMkMlMjAlMjA1MjIzJTJDJTIwJTIwMjAyMyUyQyUyMCUyMDIwNjElMkMlMjAlMjAyMTcyJTJDJTIwJTIwJTIwOTk5JTJDJTIwJTIwJTIwMTAyJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlMkMlMjAlMjAlMjAlMjAlMjAwJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlMkMlMjAlMjAlMjAlMjAlMjAwJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlNUQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUQlMkMlMjBkdHlwZSUzRGludDMyKSUzRSUyQyUyMCUwQSUyMCUyMCUyMCUyMCdhdHRlbnRpb25fbWFzayclM0ElMjAlM0N0Zi5UZW5zb3IlM0ElMjBzaGFwZSUzRCgyJTJDJTIwMTYpJTJDJTIwZHR5cGUlM0RpbnQzMiUyQyUyMG51bXB5JTNEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwYXJyYXkoJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1QjElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMCUyQyUyMDAlMkMlMjAwJTJDJTIwMCUyQyUyMDAlMkMlMjAwJTJDJTIwMCUyQyUyMDAlNUQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUQlMkMlMjBkdHlwZSUzRGludDMyKSUzRSUwQSU3RA==",highlighted:`{
    <span class="hljs-string">&#x27;input_ids&#x27;</span>: &lt;tf.Tensor: shape=(<span class="hljs-number">2</span>, <span class="hljs-number">16</span>), dtype=int32, numpy=
        array([
            [  <span class="hljs-number">101</span>,  <span class="hljs-number">1045</span>,  <span class="hljs-number">1005</span>,  <span class="hljs-number">2310</span>,  <span class="hljs-number">2042</span>,  <span class="hljs-number">3403</span>,  <span class="hljs-number">2005</span>,  <span class="hljs-number">1037</span>, <span class="hljs-number">17662</span>, <span class="hljs-number">12172</span>,  <span class="hljs-number">2607</span>,  <span class="hljs-number">2026</span>,  <span class="hljs-number">2878</span>,  <span class="hljs-number">2166</span>,  <span class="hljs-number">1012</span>,   <span class="hljs-number">102</span>],
            [  <span class="hljs-number">101</span>,  <span class="hljs-number">1045</span>,  <span class="hljs-number">5223</span>,  <span class="hljs-number">2023</span>,  <span class="hljs-number">2061</span>,  <span class="hljs-number">2172</span>,   <span class="hljs-number">999</span>,   <span class="hljs-number">102</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>]
        ], dtype=int32)&gt;, 
    <span class="hljs-string">&#x27;attention_mask&#x27;</span>: &lt;tf.Tensor: shape=(<span class="hljs-number">2</span>, <span class="hljs-number">16</span>), dtype=int32, numpy=
        array([
            [<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>],
            [<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>]
        ], dtype=int32)&gt;
}`,wrap:!1}}),{c(){s=f("p"),s.textContent=r,t=p(),b(o.$$.fragment)},l(i){s=y(i,"P",{"data-svelte-h":!0}),d(s)!=="svelte-pi8yu"&&(s.textContent=r),t=c(i),w(o.$$.fragment,i)},m(i,U){a(i,s,U),a(i,t,U),T(o,i,U),u=!0},i(i){u||(M(o.$$.fragment,i),u=!0)},o(i){m(o.$$.fragment,i),u=!1},d(i){i&&(n(s),n(t)),J(o,i)}}}function pn(h){let s,r="Here’s what the results look like as PyTorch tensors:",t,o,u;return o=new j({props:{code:"JTdCJTBBJTIwJTIwJTIwJTIwJ2lucHV0X2lkcyclM0ElMjB0ZW5zb3IoJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCJTIwJTIwMTAxJTJDJTIwJTIwMTA0NSUyQyUyMCUyMDEwMDUlMkMlMjAlMjAyMzEwJTJDJTIwJTIwMjA0MiUyQyUyMCUyMDM0MDMlMkMlMjAlMjAyMDA1JTJDJTIwJTIwMTAzNyUyQyUyMDE3NjYyJTJDJTIwMTIxNzIlMkMlMjAyNjA3JTJDJTIwJTIwMjAyNiUyQyUyMCUyMDI4NzglMkMlMjAlMjAyMTY2JTJDJTIwJTIwMTAxMiUyQyUyMCUyMCUyMDEwMiU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1QiUyMCUyMDEwMSUyQyUyMCUyMDEwNDUlMkMlMjAlMjA1MjIzJTJDJTIwJTIwMjAyMyUyQyUyMCUyMDIwNjElMkMlMjAlMjAyMTcyJTJDJTIwJTIwJTIwOTk5JTJDJTIwJTIwJTIwMTAyJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlMkMlMjAlMjAlMjAlMjAlMjAwJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlMkMlMjAlMjAlMjAlMjAlMjAwJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlNUQlMEElMjAlMjAlMjAlMjAlNUQpJTJDJTIwJTBBJTIwJTIwJTIwJTIwJ2F0dGVudGlvbl9tYXNrJyUzQSUyMHRlbnNvciglNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUIxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAwJTJDJTIwMCUyQyUyMDAlMkMlMjAwJTJDJTIwMCUyQyUyMDAlMkMlMjAwJTJDJTIwMCU1RCUwQSUyMCUyMCUyMCUyMCU1RCklMEElN0Q=",highlighted:`{
    <span class="hljs-string">&#x27;input_ids&#x27;</span>: tensor([
        [  <span class="hljs-number">101</span>,  <span class="hljs-number">1045</span>,  <span class="hljs-number">1005</span>,  <span class="hljs-number">2310</span>,  <span class="hljs-number">2042</span>,  <span class="hljs-number">3403</span>,  <span class="hljs-number">2005</span>,  <span class="hljs-number">1037</span>, <span class="hljs-number">17662</span>, <span class="hljs-number">12172</span>, <span class="hljs-number">2607</span>,  <span class="hljs-number">2026</span>,  <span class="hljs-number">2878</span>,  <span class="hljs-number">2166</span>,  <span class="hljs-number">1012</span>,   <span class="hljs-number">102</span>],
        [  <span class="hljs-number">101</span>,  <span class="hljs-number">1045</span>,  <span class="hljs-number">5223</span>,  <span class="hljs-number">2023</span>,  <span class="hljs-number">2061</span>,  <span class="hljs-number">2172</span>,   <span class="hljs-number">999</span>,   <span class="hljs-number">102</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>]
    ]), 
    <span class="hljs-string">&#x27;attention_mask&#x27;</span>: tensor([
        [<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>],
        [<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>]
    ])
}`,wrap:!1}}),{c(){s=f("p"),s.textContent=r,t=p(),b(o.$$.fragment)},l(i){s=y(i,"P",{"data-svelte-h":!0}),d(s)!=="svelte-14j15ya"&&(s.textContent=r),t=c(i),w(o.$$.fragment,i)},m(i,U){a(i,s,U),a(i,t,U),T(o,i,U),u=!0},i(i){u||(M(o.$$.fragment,i),u=!0)},o(i){m(o.$$.fragment,i),u=!1},d(i){i&&(n(s),n(t)),J(o,i)}}}function cn(h){let s,r="We can download our pretrained model the same way we did with our tokenizer. 🤗 Transformers provides an <code>TFAutoModel</code> class which also has a <code>from_pretrained</code> method:",t,o,u;return o=new j({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsJTBBJTBBY2hlY2twb2ludCUyMCUzRCUyMCUyMmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkLWZpbmV0dW5lZC1zc3QtMi1lbmdsaXNoJTIyJTBBbW9kZWwlMjAlM0QlMjBURkF1dG9Nb2RlbC5mcm9tX3ByZXRyYWluZWQoY2hlY2twb2ludCk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModel

checkpoint = <span class="hljs-string">&quot;distilbert-base-uncased-finetuned-sst-2-english&quot;</span>
model = TFAutoModel.from_pretrained(checkpoint)`,wrap:!1}}),{c(){s=f("p"),s.innerHTML=r,t=p(),b(o.$$.fragment)},l(i){s=y(i,"P",{"data-svelte-h":!0}),d(s)!=="svelte-f8jo3w"&&(s.innerHTML=r),t=c(i),w(o.$$.fragment,i)},m(i,U){a(i,s,U),a(i,t,U),T(o,i,U),u=!0},i(i){u||(M(o.$$.fragment,i),u=!0)},o(i){m(o.$$.fragment,i),u=!1},d(i){i&&(n(s),n(t)),J(o,i)}}}function un(h){let s,r="We can download our pretrained model the same way we did with our tokenizer. 🤗 Transformers provides an <code>AutoModel</code> class which also has a <code>from_pretrained()</code> method:",t,o,u;return o=new j({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbCUwQSUwQWNoZWNrcG9pbnQlMjAlM0QlMjAlMjJkaXN0aWxiZXJ0LWJhc2UtdW5jYXNlZC1maW5ldHVuZWQtc3N0LTItZW5nbGlzaCUyMiUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsLmZyb21fcHJldHJhaW5lZChjaGVja3BvaW50KQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModel

checkpoint = <span class="hljs-string">&quot;distilbert-base-uncased-finetuned-sst-2-english&quot;</span>
model = AutoModel.from_pretrained(checkpoint)`,wrap:!1}}),{c(){s=f("p"),s.innerHTML=r,t=p(),b(o.$$.fragment)},l(i){s=y(i,"P",{"data-svelte-h":!0}),d(s)!=="svelte-1hvpt07"&&(s.innerHTML=r),t=c(i),w(o.$$.fragment,i)},m(i,U){a(i,s,U),a(i,t,U),T(o,i,U),u=!0},i(i){u||(M(o.$$.fragment,i),u=!0)},o(i){m(o.$$.fragment,i),u=!1},d(i){i&&(n(s),n(t)),J(o,i)}}}function mn(h){let s,r,t,o;return s=new j({props:{code:"b3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0cyklMEFwcmludChvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlLnNoYXBlKQ==",highlighted:`outputs = model(inputs)
<span class="hljs-built_in">print</span>(outputs.last_hidden_state.shape)`,wrap:!1}}),t=new j({props:{code:"KDIlMkMlMjAxNiUyQyUyMDc2OCk=",highlighted:'(<span class="hljs-number">2</span>, <span class="hljs-number">16</span>, <span class="hljs-number">768</span>)',wrap:!1}}),{c(){b(s.$$.fragment),r=p(),b(t.$$.fragment)},l(u){w(s.$$.fragment,u),r=c(u),w(t.$$.fragment,u)},m(u,i){T(s,u,i),a(u,r,i),T(t,u,i),o=!0},i(u){o||(M(s.$$.fragment,u),M(t.$$.fragment,u),o=!0)},o(u){m(s.$$.fragment,u),m(t.$$.fragment,u),o=!1},d(u){u&&n(r),J(s,u),J(t,u)}}}function Mn(h){let s,r,t,o;return s=new j({props:{code:"b3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQXByaW50KG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUuc2hhcGUp",highlighted:`outputs = model(**inputs)
<span class="hljs-built_in">print</span>(outputs.last_hidden_state.shape)`,wrap:!1}}),t=new j({props:{code:"dG9yY2guU2l6ZSglNUIyJTJDJTIwMTYlMkMlMjA3NjglNUQp",highlighted:'torch.Size([<span class="hljs-number">2</span>, <span class="hljs-number">16</span>, <span class="hljs-number">768</span>])',wrap:!1}}),{c(){b(s.$$.fragment),r=p(),b(t.$$.fragment)},l(u){w(s.$$.fragment,u),r=c(u),w(t.$$.fragment,u)},m(u,i){T(s,u,i),a(u,r,i),T(t,u,i),o=!0},i(u){o||(M(s.$$.fragment,u),M(t.$$.fragment,u),o=!0)},o(u){m(s.$$.fragment,u),m(t.$$.fragment,u),o=!1},d(u){u&&n(r),J(s,u),J(t,u)}}}function hn(h){let s,r="For our example, we will need a model with a sequence classification head (to be able to classify the sentences as positive or negative). So, we won’t actually use the <code>TFAutoModel</code> class, but <code>TFAutoModelForSequenceClassification</code>:",t,o,u;return o=new j({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbiUwQSUwQWNoZWNrcG9pbnQlMjAlM0QlMjAlMjJkaXN0aWxiZXJ0LWJhc2UtdW5jYXNlZC1maW5ldHVuZWQtc3N0LTItZW5nbGlzaCUyMiUwQW1vZGVsJTIwJTNEJTIwVEZBdXRvTW9kZWxGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZChjaGVja3BvaW50KSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbChpbnB1dHMp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForSequenceClassification

checkpoint = <span class="hljs-string">&quot;distilbert-base-uncased-finetuned-sst-2-english&quot;</span>
model = TFAutoModelForSequenceClassification.from_pretrained(checkpoint)
outputs = model(inputs)`,wrap:!1}}),{c(){s=f("p"),s.innerHTML=r,t=p(),b(o.$$.fragment)},l(i){s=y(i,"P",{"data-svelte-h":!0}),d(s)!=="svelte-6up9xi"&&(s.innerHTML=r),t=c(i),w(o.$$.fragment,i)},m(i,U){a(i,s,U),a(i,t,U),T(o,i,U),u=!0},i(i){u||(M(o.$$.fragment,i),u=!0)},o(i){m(o.$$.fragment,i),u=!1},d(i){i&&(n(s),n(t)),J(o,i)}}}function fn(h){let s,r="For our example, we will need a model with a sequence classification head (to be able to classify the sentences as positive or negative). So, we won’t actually use the <code>AutoModel</code> class, but <code>AutoModelForSequenceClassification</code>:",t,o,u;return o=new j({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEFjaGVja3BvaW50JTIwJTNEJTIwJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQtZmluZXR1bmVkLXNzdC0yLWVuZ2xpc2glMjIlMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForSequenceClassification

checkpoint = <span class="hljs-string">&quot;distilbert-base-uncased-finetuned-sst-2-english&quot;</span>
model = AutoModelForSequenceClassification.from_pretrained(checkpoint)
outputs = model(**inputs)`,wrap:!1}}),{c(){s=f("p"),s.innerHTML=r,t=p(),b(o.$$.fragment)},l(i){s=y(i,"P",{"data-svelte-h":!0}),d(s)!=="svelte-35osqu"&&(s.innerHTML=r),t=c(i),w(o.$$.fragment,i)},m(i,U){a(i,s,U),a(i,t,U),T(o,i,U),u=!0},i(i){u||(M(o.$$.fragment,i),u=!0)},o(i){m(o.$$.fragment,i),u=!1},d(i){i&&(n(s),n(t)),J(o,i)}}}function yn(h){let s,r;return s=new j({props:{code:"KDIlMkMlMjAyKQ==",highlighted:'(<span class="hljs-number">2</span>, <span class="hljs-number">2</span>)',wrap:!1}}),{c(){b(s.$$.fragment)},l(t){w(s.$$.fragment,t)},m(t,o){T(s,t,o),r=!0},i(t){r||(M(s.$$.fragment,t),r=!0)},o(t){m(s.$$.fragment,t),r=!1},d(t){J(s,t)}}}function dn(h){let s,r;return s=new j({props:{code:"dG9yY2guU2l6ZSglNUIyJTJDJTIwMiU1RCk=",highlighted:'torch.Size([<span class="hljs-number">2</span>, <span class="hljs-number">2</span>])',wrap:!1}}),{c(){b(s.$$.fragment)},l(t){w(s.$$.fragment,t)},m(t,o){T(s,t,o),r=!0},i(t){r||(M(s.$$.fragment,t),r=!0)},o(t){m(s.$$.fragment,t),r=!1},d(t){J(s,t)}}}function bn(h){let s,r;return s=new j({props:{code:"JTNDdGYuVGVuc29yJTNBJTIwc2hhcGUlM0QoMiUyQyUyMDIpJTJDJTIwZHR5cGUlM0RmbG9hdDMyJTJDJTIwbnVtcHklM0QlMEElMjAlMjAlMjAlMjBhcnJheSglNUIlNUItMS41NjA2OTkxJTJDJTIwJTIwMS42MTIyODQyJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCJTIwNC4xNjkyMzElMjAlMkMlMjAtMy4zNDY0NDcyJTVEJTVEJTJDJTIwZHR5cGUlM0RmbG9hdDMyKSUzRQ==",highlighted:`&lt;tf.Tensor: shape=(<span class="hljs-number">2</span>, <span class="hljs-number">2</span>), dtype=float32, numpy=
    array([[-<span class="hljs-number">1.5606991</span>,  <span class="hljs-number">1.6122842</span>],
           [ <span class="hljs-number">4.169231</span> , -<span class="hljs-number">3.3464472</span>]], dtype=float32)&gt;`,wrap:!1}}),{c(){b(s.$$.fragment)},l(t){w(s.$$.fragment,t)},m(t,o){T(s,t,o),r=!0},i(t){r||(M(s.$$.fragment,t),r=!0)},o(t){m(s.$$.fragment,t),r=!1},d(t){J(s,t)}}}function wn(h){let s,r;return s=new j({props:{code:"dGVuc29yKCU1QiU1Qi0xLjU2MDclMkMlMjAlMjAxLjYxMjMlNUQlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUIlMjA0LjE2OTIlMkMlMjAtMy4zNDY0JTVEJTVEJTJDJTIwZ3JhZF9mbiUzRCUzQ0FkZG1tQmFja3dhcmQlM0Up",highlighted:`tensor([[-<span class="hljs-number">1.5607</span>,  <span class="hljs-number">1.6123</span>],
        [ <span class="hljs-number">4.1692</span>, -<span class="hljs-number">3.3464</span>]], grad_fn=&lt;AddmmBackward&gt;)`,wrap:!1}}),{c(){b(s.$$.fragment)},l(t){w(s.$$.fragment,t)},m(t,o){T(s,t,o),r=!0},i(t){r||(M(s.$$.fragment,t),r=!0)},o(t){m(s.$$.fragment,t),r=!1},d(t){J(s,t)}}}function Tn(h){let s,r;return s=new j({props:{code:"aW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEFwcmVkaWN0aW9ucyUyMCUzRCUyMHRmLm1hdGguc29mdG1heChvdXRwdXRzLmxvZ2l0cyUyQyUyMGF4aXMlM0QtMSklMEFwcmludChwcmVkaWN0aW9ucyk=",highlighted:`<span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

predictions = tf.math.softmax(outputs.logits, axis=-<span class="hljs-number">1</span>)
<span class="hljs-built_in">print</span>(predictions)`,wrap:!1}}),{c(){b(s.$$.fragment)},l(t){w(s.$$.fragment,t)},m(t,o){T(s,t,o),r=!0},i(t){r||(M(s.$$.fragment,t),r=!0)},o(t){m(s.$$.fragment,t),r=!1},d(t){J(s,t)}}}function Jn(h){let s,r;return s=new j({props:{code:"aW1wb3J0JTIwdG9yY2glMEElMEFwcmVkaWN0aW9ucyUyMCUzRCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwuc29mdG1heChvdXRwdXRzLmxvZ2l0cyUyQyUyMGRpbSUzRC0xKSUwQXByaW50KHByZWRpY3Rpb25zKQ==",highlighted:`<span class="hljs-keyword">import</span> torch

predictions = torch.nn.functional.softmax(outputs.logits, dim=-<span class="hljs-number">1</span>)
<span class="hljs-built_in">print</span>(predictions)`,wrap:!1}}),{c(){b(s.$$.fragment)},l(t){w(s.$$.fragment,t)},m(t,o){T(s,t,o),r=!0},i(t){r||(M(s.$$.fragment,t),r=!0)},o(t){m(s.$$.fragment,t),r=!1},d(t){J(s,t)}}}function Un(h){let s,r;return s=new j({props:{code:"dGYuVGVuc29yKCUwQSU1QiU1QjQuMDE5NTE2NzFlLTAyJTIwOS41OTgwNDgzM2UtMDElNUQlMEElMjAlNUI5Ljk5NDU1ODdlLTAxJTIwNS40NDE4NDI0ZS0wNCU1RCU1RCUyQyUyMHNoYXBlJTNEKDIlMkMlMjAyKSUyQyUyMGR0eXBlJTNEZmxvYXQzMik=",highlighted:`tf.Tensor(
[[<span class="hljs-number">4.01951671e-02</span> <span class="hljs-number">9.59804833e-01</span>]
 [<span class="hljs-number">9.9945587e-01</span> <span class="hljs-number">5.4418424e-04</span>]], shape=(<span class="hljs-number">2</span>, <span class="hljs-number">2</span>), dtype=float32)`,wrap:!1}}),{c(){b(s.$$.fragment)},l(t){w(s.$$.fragment,t)},m(t,o){T(s,t,o),r=!0},i(t){r||(M(s.$$.fragment,t),r=!0)},o(t){m(s.$$.fragment,t),r=!1},d(t){J(s,t)}}}function jn(h){let s,r;return s=new j({props:{code:"dGVuc29yKCU1QiU1QjQuMDE5NWUtMDIlMkMlMjA5LjU5ODBlLTAxJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCOS45OTQ2ZS0wMSUyQyUyMDUuNDQxOGUtMDQlNUQlNUQlMkMlMjBncmFkX2ZuJTNEJTNDU29mdG1heEJhY2t3YXJkJTNFKQ==",highlighted:`tensor([[<span class="hljs-number">4.0195e-02</span>, <span class="hljs-number">9.5980e-01</span>],
        [<span class="hljs-number">9.9946e-01</span>, <span class="hljs-number">5.4418e-04</span>]], grad_fn=&lt;SoftmaxBackward&gt;)`,wrap:!1}}),{c(){b(s.$$.fragment)},l(t){w(s.$$.fragment,t)},m(t,o){T(s,t,o),r=!0},i(t){r||(M(s.$$.fragment,t),r=!0)},o(t){m(s.$$.fragment,t),r=!1},d(t){J(s,t)}}}function kn(h){let s,r="✏️ <strong>Try it out!</strong> Choose two (or more) texts of your own and run them through the <code>sentiment-analysis</code> pipeline. Then replicate the steps you saw here yourself and check that you obtain the same results!";return{c(){s=f("p"),s.innerHTML=r},l(t){s=y(t,"P",{"data-svelte-h":!0}),d(s)!=="svelte-x1krla"&&(s.innerHTML=r)},m(t,o){a(t,s,o)},p:Bl,d(t){t&&n(s)}}}function _n(h){let s,r,t,o,u,i,U,dt,k,_,nt,X,bt,$,g,at,K,vs='Let’s start with a complete example, taking a look at what happened behind the scenes when we executed the following code in <a href="/course/chapter1">Chapter 1</a>:',wt,O,Tt,ee,As="and obtained:",Jt,te,Ut,se,xs='As we saw in <a href="/course/chapter1">Chapter 1</a>, this pipeline groups together three steps: preprocessing, passing the inputs through the model, and postprocessing:',jt,Y,Ns='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter2/full_nlp_pipeline.svg" alt="The full NLP pipeline: tokenization of text, conversion to IDs, and inference through the Transformer model and the model head."/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter2/full_nlp_pipeline-dark.svg" alt="The full NLP pipeline: tokenization of text, conversion to IDs, and inference through the Transformer model and the model head."/>',kt,le,Qs="Let’s quickly go over each of these.",_t,ne,$t,ae,Ds="Like other neural networks, Transformer models can’t process raw text directly, so the first step of our pipeline is to convert the text inputs into numbers that the model can make sense of. To do this we use a <em>tokenizer</em>, which will be responsible for:",gt,re,Es="<li>Splitting the input into words, subwords, or symbols (like punctuation) that are called <em>tokens</em></li> <li>Mapping each token to an integer</li> <li>Adding additional inputs that may be useful to the model</li>",Ct,ie,Gs='All this preprocessing needs to be done in exactly the same way as when the model was pretrained, so we first need to download that information from the <a href="https://huggingface.co/models" rel="nofollow">Model Hub</a>. To do this, we use the <code>AutoTokenizer</code> class and its <code>from_pretrained()</code> method. Using the checkpoint name of our model, it will automatically fetch the data associated with the model’s tokenizer and cache it (so it’s only downloaded the first time you run the code below).',It,oe,Vs='Since the default checkpoint of the <code>sentiment-analysis</code> pipeline is <code>distilbert-base-uncased-finetuned-sst-2-english</code> (you can see its model card <a href="https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english" rel="nofollow">here</a>), we run the following:',vt,pe,At,ce,Zs="Once we have the tokenizer, we can directly pass our sentences to it and we’ll get back a dictionary that’s ready to feed to our model! The only thing left to do is to convert the list of input IDs to tensors.",xt,ue,Hs="You can use 🤗 Transformers without having to worry about which ML framework is used as a backend; it might be PyTorch or TensorFlow, or Flax for some models. However, Transformer models only accept <em>tensors</em> as input. If this is your first time hearing about tensors, you can think of them as NumPy arrays instead. A NumPy array can be a scalar (0D), a vector (1D), a matrix (2D), or have more dimensions. It’s effectively a tensor; other ML frameworks’ tensors behave similarly, and are usually as simple to instantiate as NumPy arrays.",Nt,me,zs="To specify the type of tensors we want to get back (PyTorch, TensorFlow, or plain NumPy), we use the <code>return_tensors</code> argument:",Qt,C,I,rt,Me,Ss="Don’t worry about padding and truncation just yet; we’ll explain those later. The main things to remember here are that you can pass one sentence or a list of sentences, as well as specifying the type of tensors you want to get back (if no type is passed, you will get a list of lists as a result).",Dt,v,A,it,he,Ws="The output itself is a dictionary containing two keys, <code>input_ids</code> and <code>attention_mask</code>. <code>input_ids</code> contains two rows of integers (one for each sentence) that are the unique identifiers of the tokens in each sentence. We’ll explain what the <code>attention_mask</code> is later in this chapter.",Et,fe,Gt,x,N,ot,ye,Rs="In this code snippet, we have downloaded the same checkpoint we used in our pipeline before (it should actually have been cached already) and instantiated a model with it.",Vt,de,Bs="This architecture contains only the base Transformer module: given some inputs, it outputs what we’ll call <em>hidden states</em>, also known as <em>features</em>. For each model input, we’ll retrieve a high-dimensional vector representing the <strong>contextual understanding of that input by the Transformer model</strong>.",Zt,be,Ls="If this doesn’t make sense, don’t worry about it. We’ll explain it all later.",Ht,we,Fs='While these hidden states can be useful on their own, they’re usually inputs to another part of the model, known as the <em>head</em>. In <a href="/course/chapter1">Chapter 1</a>, the different tasks could have been performed with the same architecture, but each of these tasks will have a different head associated with it.',zt,Te,St,Je,Xs="The vector output by the Transformer module is usually large. It generally has three dimensions:",Wt,Ue,Ys="<li><strong>Batch size</strong>: The number of sequences processed at a time (2 in our example).</li> <li><strong>Sequence length</strong>: The length of the numerical representation of the sequence (16 in our example).</li> <li><strong>Hidden size</strong>: The vector dimension of each model input.</li>",Rt,je,Ps="It is said to be “high dimensional” because of the last value. The hidden size can be very large (768 is common for smaller models, and in larger models this can reach 3072 or more).",Bt,ke,qs="We can see this if we feed the inputs we preprocessed to our model:",Lt,Q,D,pt,_e,Ks="Note that the outputs of 🤗 Transformers models behave like <code>namedtuple</code>s or dictionaries. You can access the elements by attributes (like we did) or by key (<code>outputs[&quot;last_hidden_state&quot;]</code>), or even by index if you know exactly where the thing you are looking for is (<code>outputs[0]</code>).",Ft,$e,Xt,ge,Os="The model heads take the high-dimensional vector of hidden states as input and project them onto a different dimension. They are usually composed of one or a few linear layers:",Yt,P,el='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter2/transformer_and_head.svg" alt="A Transformer network alongside its head."/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter2/transformer_and_head-dark.svg" alt="A Transformer network alongside its head."/>',Pt,Ce,tl="The output of the Transformer model is sent directly to the model head to be processed.",qt,Ie,sl="In this diagram, the model is represented by its embeddings layer and the subsequent layers. The embeddings layer converts each input ID in the tokenized input into a vector that represents the associated token. The subsequent layers manipulate those vectors using the attention mechanism to produce the final representation of the sentences.",Kt,ve,ll="There are many different architectures available in 🤗 Transformers, with each one designed around tackling a specific task. Here is a non-exhaustive list:",Ot,Ae,nl="<li><code>*Model</code> (retrieve the hidden states)</li> <li><code>*ForCausalLM</code></li> <li><code>*ForMaskedLM</code></li> <li><code>*ForMultipleChoice</code></li> <li><code>*ForQuestionAnswering</code></li> <li><code>*ForSequenceClassification</code></li> <li><code>*ForTokenClassification</code></li> <li>and others 🤗</li>",es,E,G,ct,xe,al="Now if we look at the shape of our outputs, the dimensionality will be much lower: the model head takes as input the high-dimensional vectors we saw before, and outputs vectors containing two values (one per label):",ts,Ne,ss,V,Z,ut,Qe,rl="Since we have just two sentences and two labels, the result we get from our model is of shape 2 x 2.",ls,De,ns,Ee,il="The values we get as output from our model don’t necessarily make sense by themselves. Let’s take a look:",as,Ge,rs,H,z,mt,Ve,ol='Our model predicted <code>[-1.5607, 1.6123]</code> for the first sentence and <code>[ 4.1692, -3.3464]</code> for the second one. Those are not probabilities but <em>logits</em>, the raw, unnormalized scores outputted by the last layer of the model. To be converted to probabilities, they need to go through a <a href="https://en.wikipedia.org/wiki/Softmax_function" rel="nofollow">SoftMax</a> layer (all 🤗 Transformers models output the logits, as the loss function for training will generally fuse the last activation function, such as SoftMax, with the actual loss function, such as cross entropy):',is,S,W,Mt,R,B,ht,Ze,pl="Now we can see that the model predicted <code>[0.0402, 0.9598]</code> for the first sentence and <code>[0.9995, 0.0005]</code> for the second one. These are recognizable probability scores.",os,He,cl="To get the labels corresponding to each position, we can inspect the <code>id2label</code> attribute of the model config (more on this in the next section):",ps,ze,cs,Se,us,We,ul="Now we can conclude that the model predicted the following:",ms,Re,ml="<li>First sentence: NEGATIVE: 0.0402, POSITIVE: 0.9598</li> <li>Second sentence: NEGATIVE: 0.9995, POSITIVE: 0.0005</li>",Ms,Be,Ml="We have successfully reproduced the three steps of the pipeline: preprocessing with tokenizers, passing the inputs through the model, and postprocessing! Now let’s take some time to dive deeper into each of those steps.",hs,q,fs,Le,ys,yt,ds;u=new Kl({props:{fw:h[0]}}),U=new ft({props:{title:"Behind the pipeline",local:"behind-the-pipeline",headingTag:"h1"}});const hl=[tn,en],Fe=[];function fl(e,l){return e[0]==="pt"?0:1}k=fl(h),_=Fe[k]=hl[k](h),X=new Hl({props:{$$slots:{default:[sn]},$$scope:{ctx:h}}});const yl=[nn,ln],Xe=[];function dl(e,l){return e[0]==="pt"?0:1}$=dl(h),g=Xe[$]=yl[$](h),O=new j({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBY2xhc3NpZmllciUyMCUzRCUyMHBpcGVsaW5lKCUyMnNlbnRpbWVudC1hbmFseXNpcyUyMiklMEFjbGFzc2lmaWVyKCUwQSUyMCUyMCUyMCUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMkkndmUlMjBiZWVuJTIwd2FpdGluZyUyMGZvciUyMGElMjBIdWdnaW5nRmFjZSUyMGNvdXJzZSUyMG15JTIwd2hvbGUlMjBsaWZlLiUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMkklMjBoYXRlJTIwdGhpcyUyMHNvJTIwbXVjaCElMjIlMkMlMEElMjAlMjAlMjAlMjAlNUQlMEEp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

classifier = pipeline(<span class="hljs-string">&quot;sentiment-analysis&quot;</span>)
classifier(
    [
        <span class="hljs-string">&quot;I&#x27;ve been waiting for a HuggingFace course my whole life.&quot;</span>,
        <span class="hljs-string">&quot;I hate this so much!&quot;</span>,
    ]
)`,wrap:!1}}),te=new j({props:{code:"JTVCJTdCJ2xhYmVsJyUzQSUyMCdQT1NJVElWRSclMkMlMjAnc2NvcmUnJTNBJTIwMC45NTk4MDQ3MTM3MjYwNDM3JTdEJTJDJTBBJTIwJTdCJ2xhYmVsJyUzQSUyMCdORUdBVElWRSclMkMlMjAnc2NvcmUnJTNBJTIwMC45OTk0NTU4MDk1OTMyMDA3JTdEJTVE",highlighted:`[{<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;POSITIVE&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9598047137260437</span>},
 {<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;NEGATIVE&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9994558095932007</span>}]`,wrap:!1}}),ne=new ft({props:{title:"Preprocessing with a tokenizer",local:"preprocessing-with-a-tokenizer",headingTag:"h2"}}),pe=new j({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEFjaGVja3BvaW50JTIwJTNEJTIwJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQtZmluZXR1bmVkLXNzdC0yLWVuZ2xpc2glMjIlMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZChjaGVja3BvaW50KQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

checkpoint = <span class="hljs-string">&quot;distilbert-base-uncased-finetuned-sst-2-english&quot;</span>
tokenizer = AutoTokenizer.from_pretrained(checkpoint)`,wrap:!1}});const bl=[rn,an],Ye=[];function wl(e,l){return e[0]==="pt"?0:1}C=wl(h),I=Ye[C]=bl[C](h);const Tl=[pn,on],Pe=[];function Jl(e,l){return e[0]==="pt"?0:1}v=Jl(h),A=Pe[v]=Tl[v](h),fe=new ft({props:{title:"Going through the model",local:"going-through-the-model",headingTag:"h2"}});const Ul=[un,cn],qe=[];function jl(e,l){return e[0]==="pt"?0:1}x=jl(h),N=qe[x]=Ul[x](h),Te=new ft({props:{title:"A high-dimensional vector?",local:"a-high-dimensional-vector",headingTag:"h3"}});const kl=[Mn,mn],Ke=[];function _l(e,l){return e[0]==="pt"?0:1}Q=_l(h),D=Ke[Q]=kl[Q](h),$e=new ft({props:{title:"Model heads: Making sense out of numbers",local:"model-heads-making-sense-out-of-numbers",headingTag:"h3"}});const $l=[fn,hn],Oe=[];function gl(e,l){return e[0]==="pt"?0:1}E=gl(h),G=Oe[E]=$l[E](h),Ne=new j({props:{code:"cHJpbnQob3V0cHV0cy5sb2dpdHMuc2hhcGUp",highlighted:'<span class="hljs-built_in">print</span>(outputs.logits.shape)',wrap:!1}});const Cl=[dn,yn],et=[];function Il(e,l){return e[0]==="pt"?0:1}V=Il(h),Z=et[V]=Cl[V](h),De=new ft({props:{title:"Postprocessing the output",local:"postprocessing-the-output",headingTag:"h2"}}),Ge=new j({props:{code:"cHJpbnQob3V0cHV0cy5sb2dpdHMp",highlighted:'<span class="hljs-built_in">print</span>(outputs.logits)',wrap:!1}});const vl=[wn,bn],tt=[];function Al(e,l){return e[0]==="pt"?0:1}H=Al(h),z=tt[H]=vl[H](h);const xl=[Jn,Tn],st=[];function Nl(e,l){return e[0]==="pt"?0:1}S=Nl(h),W=st[S]=xl[S](h);const Ql=[jn,Un],lt=[];function Dl(e,l){return e[0]==="pt"?0:1}return R=Dl(h),B=lt[R]=Ql[R](h),ze=new j({props:{code:"bW9kZWwuY29uZmlnLmlkMmxhYmVs",highlighted:"model.config.id2label",wrap:!1}}),Se=new j({props:{code:"JTdCMCUzQSUyMCdORUdBVElWRSclMkMlMjAxJTNBJTIwJ1BPU0lUSVZFJyU3RA==",highlighted:'{<span class="hljs-number">0</span>: <span class="hljs-string">&#x27;NEGATIVE&#x27;</span>, <span class="hljs-number">1</span>: <span class="hljs-string">&#x27;POSITIVE&#x27;</span>}',wrap:!1}}),q=new Hl({props:{$$slots:{default:[kn]},$$scope:{ctx:h}}}),Le=new Ol({props:{source:"https://github.com/huggingface/course/blob/main/chapters/en/chapter2/2.mdx"}}),{c(){s=f("meta"),r=p(),t=f("p"),o=p(),b(u.$$.fragment),i=p(),b(U.$$.fragment),dt=p(),_.c(),nt=p(),b(X.$$.fragment),bt=p(),g.c(),at=p(),K=f("p"),K.innerHTML=vs,wt=p(),b(O.$$.fragment),Tt=p(),ee=f("p"),ee.textContent=As,Jt=p(),b(te.$$.fragment),Ut=p(),se=f("p"),se.innerHTML=xs,jt=p(),Y=f("div"),Y.innerHTML=Ns,kt=p(),le=f("p"),le.textContent=Qs,_t=p(),b(ne.$$.fragment),$t=p(),ae=f("p"),ae.innerHTML=Ds,gt=p(),re=f("ul"),re.innerHTML=Es,Ct=p(),ie=f("p"),ie.innerHTML=Gs,It=p(),oe=f("p"),oe.innerHTML=Vs,vt=p(),b(pe.$$.fragment),At=p(),ce=f("p"),ce.textContent=Zs,xt=p(),ue=f("p"),ue.innerHTML=Hs,Nt=p(),me=f("p"),me.innerHTML=zs,Qt=p(),I.c(),rt=p(),Me=f("p"),Me.textContent=Ss,Dt=p(),A.c(),it=p(),he=f("p"),he.innerHTML=Ws,Et=p(),b(fe.$$.fragment),Gt=p(),N.c(),ot=p(),ye=f("p"),ye.textContent=Rs,Vt=p(),de=f("p"),de.innerHTML=Bs,Zt=p(),be=f("p"),be.textContent=Ls,Ht=p(),we=f("p"),we.innerHTML=Fs,zt=p(),b(Te.$$.fragment),St=p(),Je=f("p"),Je.textContent=Xs,Wt=p(),Ue=f("ul"),Ue.innerHTML=Ys,Rt=p(),je=f("p"),je.textContent=Ps,Bt=p(),ke=f("p"),ke.textContent=qs,Lt=p(),D.c(),pt=p(),_e=f("p"),_e.innerHTML=Ks,Ft=p(),b($e.$$.fragment),Xt=p(),ge=f("p"),ge.textContent=Os,Yt=p(),P=f("div"),P.innerHTML=el,Pt=p(),Ce=f("p"),Ce.textContent=tl,qt=p(),Ie=f("p"),Ie.textContent=sl,Kt=p(),ve=f("p"),ve.textContent=ll,Ot=p(),Ae=f("ul"),Ae.innerHTML=nl,es=p(),G.c(),ct=p(),xe=f("p"),xe.textContent=al,ts=p(),b(Ne.$$.fragment),ss=p(),Z.c(),ut=p(),Qe=f("p"),Qe.textContent=rl,ls=p(),b(De.$$.fragment),ns=p(),Ee=f("p"),Ee.textContent=il,as=p(),b(Ge.$$.fragment),rs=p(),z.c(),mt=p(),Ve=f("p"),Ve.innerHTML=ol,is=p(),W.c(),Mt=p(),B.c(),ht=p(),Ze=f("p"),Ze.innerHTML=pl,os=p(),He=f("p"),He.innerHTML=cl,ps=p(),b(ze.$$.fragment),cs=p(),b(Se.$$.fragment),us=p(),We=f("p"),We.textContent=ul,ms=p(),Re=f("ul"),Re.innerHTML=ml,Ms=p(),Be=f("p"),Be.textContent=Ml,hs=p(),b(q.$$.fragment),fs=p(),b(Le.$$.fragment),ys=p(),yt=f("p"),this.h()},l(e){const l=Xl("svelte-u9bgzb",document.head);s=y(l,"META",{name:!0,content:!0}),l.forEach(n),r=c(e),t=y(e,"P",{}),Zl(t).forEach(n),o=c(e),w(u.$$.fragment,e),i=c(e),w(U.$$.fragment,e),dt=c(e),_.l(e),nt=c(e),w(X.$$.fragment,e),bt=c(e),g.l(e),at=c(e),K=y(e,"P",{"data-svelte-h":!0}),d(K)!=="svelte-j1te7i"&&(K.innerHTML=vs),wt=c(e),w(O.$$.fragment,e),Tt=c(e),ee=y(e,"P",{"data-svelte-h":!0}),d(ee)!=="svelte-16jsacb"&&(ee.textContent=As),Jt=c(e),w(te.$$.fragment,e),Ut=c(e),se=y(e,"P",{"data-svelte-h":!0}),d(se)!=="svelte-19ql29h"&&(se.innerHTML=xs),jt=c(e),Y=y(e,"DIV",{class:!0,"data-svelte-h":!0}),d(Y)!=="svelte-fbe70j"&&(Y.innerHTML=Ns),kt=c(e),le=y(e,"P",{"data-svelte-h":!0}),d(le)!=="svelte-1mmhgnm"&&(le.textContent=Qs),_t=c(e),w(ne.$$.fragment,e),$t=c(e),ae=y(e,"P",{"data-svelte-h":!0}),d(ae)!=="svelte-koy9hz"&&(ae.innerHTML=Ds),gt=c(e),re=y(e,"UL",{"data-svelte-h":!0}),d(re)!=="svelte-17s3a16"&&(re.innerHTML=Es),Ct=c(e),ie=y(e,"P",{"data-svelte-h":!0}),d(ie)!=="svelte-on9h0q"&&(ie.innerHTML=Gs),It=c(e),oe=y(e,"P",{"data-svelte-h":!0}),d(oe)!=="svelte-t8b40m"&&(oe.innerHTML=Vs),vt=c(e),w(pe.$$.fragment,e),At=c(e),ce=y(e,"P",{"data-svelte-h":!0}),d(ce)!=="svelte-l75ftz"&&(ce.textContent=Zs),xt=c(e),ue=y(e,"P",{"data-svelte-h":!0}),d(ue)!=="svelte-zkqkgq"&&(ue.innerHTML=Hs),Nt=c(e),me=y(e,"P",{"data-svelte-h":!0}),d(me)!=="svelte-mey5yg"&&(me.innerHTML=zs),Qt=c(e),I.l(e),rt=c(e),Me=y(e,"P",{"data-svelte-h":!0}),d(Me)!=="svelte-5dheo"&&(Me.textContent=Ss),Dt=c(e),A.l(e),it=c(e),he=y(e,"P",{"data-svelte-h":!0}),d(he)!=="svelte-ko08zm"&&(he.innerHTML=Ws),Et=c(e),w(fe.$$.fragment,e),Gt=c(e),N.l(e),ot=c(e),ye=y(e,"P",{"data-svelte-h":!0}),d(ye)!=="svelte-q7vos4"&&(ye.textContent=Rs),Vt=c(e),de=y(e,"P",{"data-svelte-h":!0}),d(de)!=="svelte-vpzu85"&&(de.innerHTML=Bs),Zt=c(e),be=y(e,"P",{"data-svelte-h":!0}),d(be)!=="svelte-u3nixm"&&(be.textContent=Ls),Ht=c(e),we=y(e,"P",{"data-svelte-h":!0}),d(we)!=="svelte-10yaw60"&&(we.innerHTML=Fs),zt=c(e),w(Te.$$.fragment,e),St=c(e),Je=y(e,"P",{"data-svelte-h":!0}),d(Je)!=="svelte-16q0yx"&&(Je.textContent=Xs),Wt=c(e),Ue=y(e,"UL",{"data-svelte-h":!0}),d(Ue)!=="svelte-1usd93i"&&(Ue.innerHTML=Ys),Rt=c(e),je=y(e,"P",{"data-svelte-h":!0}),d(je)!=="svelte-1y68z51"&&(je.textContent=Ps),Bt=c(e),ke=y(e,"P",{"data-svelte-h":!0}),d(ke)!=="svelte-1yd31f1"&&(ke.textContent=qs),Lt=c(e),D.l(e),pt=c(e),_e=y(e,"P",{"data-svelte-h":!0}),d(_e)!=="svelte-1g5de7c"&&(_e.innerHTML=Ks),Ft=c(e),w($e.$$.fragment,e),Xt=c(e),ge=y(e,"P",{"data-svelte-h":!0}),d(ge)!=="svelte-fbx3ha"&&(ge.textContent=Os),Yt=c(e),P=y(e,"DIV",{class:!0,"data-svelte-h":!0}),d(P)!=="svelte-8mo6lt"&&(P.innerHTML=el),Pt=c(e),Ce=y(e,"P",{"data-svelte-h":!0}),d(Ce)!=="svelte-dc738t"&&(Ce.textContent=tl),qt=c(e),Ie=y(e,"P",{"data-svelte-h":!0}),d(Ie)!=="svelte-1ti48ib"&&(Ie.textContent=sl),Kt=c(e),ve=y(e,"P",{"data-svelte-h":!0}),d(ve)!=="svelte-1i8ccko"&&(ve.textContent=ll),Ot=c(e),Ae=y(e,"UL",{"data-svelte-h":!0}),d(Ae)!=="svelte-v0insc"&&(Ae.innerHTML=nl),es=c(e),G.l(e),ct=c(e),xe=y(e,"P",{"data-svelte-h":!0}),d(xe)!=="svelte-8ekttt"&&(xe.textContent=al),ts=c(e),w(Ne.$$.fragment,e),ss=c(e),Z.l(e),ut=c(e),Qe=y(e,"P",{"data-svelte-h":!0}),d(Qe)!=="svelte-1jnh99l"&&(Qe.textContent=rl),ls=c(e),w(De.$$.fragment,e),ns=c(e),Ee=y(e,"P",{"data-svelte-h":!0}),d(Ee)!=="svelte-1edjuis"&&(Ee.textContent=il),as=c(e),w(Ge.$$.fragment,e),rs=c(e),z.l(e),mt=c(e),Ve=y(e,"P",{"data-svelte-h":!0}),d(Ve)!=="svelte-19waoxv"&&(Ve.innerHTML=ol),is=c(e),W.l(e),Mt=c(e),B.l(e),ht=c(e),Ze=y(e,"P",{"data-svelte-h":!0}),d(Ze)!=="svelte-sfijl8"&&(Ze.innerHTML=pl),os=c(e),He=y(e,"P",{"data-svelte-h":!0}),d(He)!=="svelte-irfdpk"&&(He.innerHTML=cl),ps=c(e),w(ze.$$.fragment,e),cs=c(e),w(Se.$$.fragment,e),us=c(e),We=y(e,"P",{"data-svelte-h":!0}),d(We)!=="svelte-1tedvvg"&&(We.textContent=ul),ms=c(e),Re=y(e,"UL",{"data-svelte-h":!0}),d(Re)!=="svelte-4ikgqa"&&(Re.innerHTML=ml),Ms=c(e),Be=y(e,"P",{"data-svelte-h":!0}),d(Be)!=="svelte-18zmy58"&&(Be.textContent=Ml),hs=c(e),w(q.$$.fragment,e),fs=c(e),w(Le.$$.fragment,e),ys=c(e),yt=y(e,"P",{}),Zl(yt).forEach(n),this.h()},h(){bs(s,"name","hf:doc:metadata"),bs(s,"content",$n),bs(Y,"class","flex justify-center"),bs(P,"class","flex justify-center")},m(e,l){Yl(document.head,s),a(e,r,l),a(e,t,l),a(e,o,l),T(u,e,l),a(e,i,l),T(U,e,l),a(e,dt,l),Fe[k].m(e,l),a(e,nt,l),T(X,e,l),a(e,bt,l),Xe[$].m(e,l),a(e,at,l),a(e,K,l),a(e,wt,l),T(O,e,l),a(e,Tt,l),a(e,ee,l),a(e,Jt,l),T(te,e,l),a(e,Ut,l),a(e,se,l),a(e,jt,l),a(e,Y,l),a(e,kt,l),a(e,le,l),a(e,_t,l),T(ne,e,l),a(e,$t,l),a(e,ae,l),a(e,gt,l),a(e,re,l),a(e,Ct,l),a(e,ie,l),a(e,It,l),a(e,oe,l),a(e,vt,l),T(pe,e,l),a(e,At,l),a(e,ce,l),a(e,xt,l),a(e,ue,l),a(e,Nt,l),a(e,me,l),a(e,Qt,l),Ye[C].m(e,l),a(e,rt,l),a(e,Me,l),a(e,Dt,l),Pe[v].m(e,l),a(e,it,l),a(e,he,l),a(e,Et,l),T(fe,e,l),a(e,Gt,l),qe[x].m(e,l),a(e,ot,l),a(e,ye,l),a(e,Vt,l),a(e,de,l),a(e,Zt,l),a(e,be,l),a(e,Ht,l),a(e,we,l),a(e,zt,l),T(Te,e,l),a(e,St,l),a(e,Je,l),a(e,Wt,l),a(e,Ue,l),a(e,Rt,l),a(e,je,l),a(e,Bt,l),a(e,ke,l),a(e,Lt,l),Ke[Q].m(e,l),a(e,pt,l),a(e,_e,l),a(e,Ft,l),T($e,e,l),a(e,Xt,l),a(e,ge,l),a(e,Yt,l),a(e,P,l),a(e,Pt,l),a(e,Ce,l),a(e,qt,l),a(e,Ie,l),a(e,Kt,l),a(e,ve,l),a(e,Ot,l),a(e,Ae,l),a(e,es,l),Oe[E].m(e,l),a(e,ct,l),a(e,xe,l),a(e,ts,l),T(Ne,e,l),a(e,ss,l),et[V].m(e,l),a(e,ut,l),a(e,Qe,l),a(e,ls,l),T(De,e,l),a(e,ns,l),a(e,Ee,l),a(e,as,l),T(Ge,e,l),a(e,rs,l),tt[H].m(e,l),a(e,mt,l),a(e,Ve,l),a(e,is,l),st[S].m(e,l),a(e,Mt,l),lt[R].m(e,l),a(e,ht,l),a(e,Ze,l),a(e,os,l),a(e,He,l),a(e,ps,l),T(ze,e,l),a(e,cs,l),T(Se,e,l),a(e,us,l),a(e,We,l),a(e,ms,l),a(e,Re,l),a(e,Ms,l),a(e,Be,l),a(e,hs,l),T(q,e,l),a(e,fs,l),T(Le,e,l),a(e,ys,l),a(e,yt,l),ds=!0},p(e,[l]){const El={};l&1&&(El.fw=e[0]),u.$set(El);let ws=k;k=fl(e),k!==ws&&(F(),m(Fe[ws],1,1,()=>{Fe[ws]=null}),L(),_=Fe[k],_||(_=Fe[k]=hl[k](e),_.c()),M(_,1),_.m(nt.parentNode,nt));const Gl={};l&2&&(Gl.$$scope={dirty:l,ctx:e}),X.$set(Gl);let Ts=$;$=dl(e),$!==Ts&&(F(),m(Xe[Ts],1,1,()=>{Xe[Ts]=null}),L(),g=Xe[$],g||(g=Xe[$]=yl[$](e),g.c()),M(g,1),g.m(at.parentNode,at));let Js=C;C=wl(e),C!==Js&&(F(),m(Ye[Js],1,1,()=>{Ye[Js]=null}),L(),I=Ye[C],I||(I=Ye[C]=bl[C](e),I.c()),M(I,1),I.m(rt.parentNode,rt));let Us=v;v=Jl(e),v!==Us&&(F(),m(Pe[Us],1,1,()=>{Pe[Us]=null}),L(),A=Pe[v],A||(A=Pe[v]=Tl[v](e),A.c()),M(A,1),A.m(it.parentNode,it));let js=x;x=jl(e),x!==js&&(F(),m(qe[js],1,1,()=>{qe[js]=null}),L(),N=qe[x],N||(N=qe[x]=Ul[x](e),N.c()),M(N,1),N.m(ot.parentNode,ot));let ks=Q;Q=_l(e),Q!==ks&&(F(),m(Ke[ks],1,1,()=>{Ke[ks]=null}),L(),D=Ke[Q],D||(D=Ke[Q]=kl[Q](e),D.c()),M(D,1),D.m(pt.parentNode,pt));let _s=E;E=gl(e),E!==_s&&(F(),m(Oe[_s],1,1,()=>{Oe[_s]=null}),L(),G=Oe[E],G||(G=Oe[E]=$l[E](e),G.c()),M(G,1),G.m(ct.parentNode,ct));let $s=V;V=Il(e),V!==$s&&(F(),m(et[$s],1,1,()=>{et[$s]=null}),L(),Z=et[V],Z||(Z=et[V]=Cl[V](e),Z.c()),M(Z,1),Z.m(ut.parentNode,ut));let gs=H;H=Al(e),H!==gs&&(F(),m(tt[gs],1,1,()=>{tt[gs]=null}),L(),z=tt[H],z||(z=tt[H]=vl[H](e),z.c()),M(z,1),z.m(mt.parentNode,mt));let Cs=S;S=Nl(e),S!==Cs&&(F(),m(st[Cs],1,1,()=>{st[Cs]=null}),L(),W=st[S],W||(W=st[S]=xl[S](e),W.c()),M(W,1),W.m(Mt.parentNode,Mt));let Is=R;R=Dl(e),R!==Is&&(F(),m(lt[Is],1,1,()=>{lt[Is]=null}),L(),B=lt[R],B||(B=lt[R]=Ql[R](e),B.c()),M(B,1),B.m(ht.parentNode,ht));const Vl={};l&2&&(Vl.$$scope={dirty:l,ctx:e}),q.$set(Vl)},i(e){ds||(M(u.$$.fragment,e),M(U.$$.fragment,e),M(_),M(X.$$.fragment,e),M(g),M(O.$$.fragment,e),M(te.$$.fragment,e),M(ne.$$.fragment,e),M(pe.$$.fragment,e),M(I),M(A),M(fe.$$.fragment,e),M(N),M(Te.$$.fragment,e),M(D),M($e.$$.fragment,e),M(G),M(Ne.$$.fragment,e),M(Z),M(De.$$.fragment,e),M(Ge.$$.fragment,e),M(z),M(W),M(B),M(ze.$$.fragment,e),M(Se.$$.fragment,e),M(q.$$.fragment,e),M(Le.$$.fragment,e),ds=!0)},o(e){m(u.$$.fragment,e),m(U.$$.fragment,e),m(_),m(X.$$.fragment,e),m(g),m(O.$$.fragment,e),m(te.$$.fragment,e),m(ne.$$.fragment,e),m(pe.$$.fragment,e),m(I),m(A),m(fe.$$.fragment,e),m(N),m(Te.$$.fragment,e),m(D),m($e.$$.fragment,e),m(G),m(Ne.$$.fragment,e),m(Z),m(De.$$.fragment,e),m(Ge.$$.fragment,e),m(z),m(W),m(B),m(ze.$$.fragment,e),m(Se.$$.fragment,e),m(q.$$.fragment,e),m(Le.$$.fragment,e),ds=!1},d(e){e&&(n(r),n(t),n(o),n(i),n(dt),n(nt),n(bt),n(at),n(K),n(wt),n(Tt),n(ee),n(Jt),n(Ut),n(se),n(jt),n(Y),n(kt),n(le),n(_t),n($t),n(ae),n(gt),n(re),n(Ct),n(ie),n(It),n(oe),n(vt),n(At),n(ce),n(xt),n(ue),n(Nt),n(me),n(Qt),n(rt),n(Me),n(Dt),n(it),n(he),n(Et),n(Gt),n(ot),n(ye),n(Vt),n(de),n(Zt),n(be),n(Ht),n(we),n(zt),n(St),n(Je),n(Wt),n(Ue),n(Rt),n(je),n(Bt),n(ke),n(Lt),n(pt),n(_e),n(Ft),n(Xt),n(ge),n(Yt),n(P),n(Pt),n(Ce),n(qt),n(Ie),n(Kt),n(ve),n(Ot),n(Ae),n(es),n(ct),n(xe),n(ts),n(ss),n(ut),n(Qe),n(ls),n(ns),n(Ee),n(as),n(rs),n(mt),n(Ve),n(is),n(Mt),n(ht),n(Ze),n(os),n(He),n(ps),n(cs),n(us),n(We),n(ms),n(Re),n(Ms),n(Be),n(hs),n(fs),n(ys),n(yt)),n(s),J(u,e),J(U,e),Fe[k].d(e),J(X,e),Xe[$].d(e),J(O,e),J(te,e),J(ne,e),J(pe,e),Ye[C].d(e),Pe[v].d(e),J(fe,e),qe[x].d(e),J(Te,e),Ke[Q].d(e),J($e,e),Oe[E].d(e),J(Ne,e),et[V].d(e),J(De,e),J(Ge,e),tt[H].d(e),st[S].d(e),lt[R].d(e),J(ze,e),J(Se,e),J(q,e),J(Le,e)}}}const $n='{"title":"Behind the pipeline","local":"behind-the-pipeline","sections":[{"title":"Preprocessing with a tokenizer","local":"preprocessing-with-a-tokenizer","sections":[],"depth":2},{"title":"Going through the model","local":"going-through-the-model","sections":[{"title":"A high-dimensional vector?","local":"a-high-dimensional-vector","sections":[],"depth":3},{"title":"Model heads: Making sense out of numbers","local":"model-heads-making-sense-out-of-numbers","sections":[],"depth":3}],"depth":2},{"title":"Postprocessing the output","local":"postprocessing-the-output","sections":[],"depth":2}],"depth":1}';function gn(h,s,r){let t="pt";return Rl(()=>{const o=new URLSearchParams(window.location.search);r(0,t=o.get("fw")||"pt")}),[t]}class En extends Ll{constructor(s){super(),Fl(this,s,gn,_n,Wl,{})}}export{En as component};
