import{s as zt,o as Rt,n as St}from"../chunks/scheduler.37c15a92.js";import{S as Wt,i as Bt,g as f,s as c,r as J,A as Lt,h as T,f as n,c as M,j as Gt,u as U,x as b,k as Ts,y as Ft,a,v as j,t as o,b as L,d as m,w,m as Xt,n as Yt,p as F}from"../chunks/index.2bf4358c.js";import{T as Zt}from"../chunks/Tip.363c041f.js";import{Y as Vt}from"../chunks/Youtube.1e50a667.js";import{C as h}from"../chunks/CodeBlock.4f5fc1ad.js";import{C as Ht}from"../chunks/CourseFloatingBanner.06521e8b.js";import{F as Pt}from"../chunks/FrameworkSwitchCourse.8d4d4ab6.js";import{H as yl}from"../chunks/Heading.8ada512a.js";function qt(y){let s,r;return s=new Ht({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/zh-CN/chapter2/section2_tf.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/zh-CN/chapter2/section2_tf.ipynb"}]}}),{c(){J(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function Kt(y){let s,r;return s=new Ht({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/zh-CN/chapter2/section2_pt.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/zh-CN/chapter2/section2_pt.ipynb"}]}}),{c(){J(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function Ot(y){let s;return{c(){s=Xt("这是第一部分，根据您使用PyTorch或者TensorFlow，内容略有不同。点击标题上方的平台，选择您喜欢的平台！")},l(r){s=Yt(r,"这是第一部分，根据您使用PyTorch或者TensorFlow，内容略有不同。点击标题上方的平台，选择您喜欢的平台！")},m(r,l){a(r,s,l)},d(r){r&&n(s)}}}function en(y){let s,r;return s=new Vt({props:{id:"wVN12smEvqg"}}),{c(){J(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function ln(y){let s,r;return s=new Vt({props:{id:"1pedAIvTWXk"}}),{c(){J(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function sn(y){let s,r;return s=new h({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(){J(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function tn(y){let s,r;return s=new h({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(){J(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function nn(y){let s,r="以下是TensorFlow张量的结果：",l,i,u;return i=new h({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,l=c(),J(i.$$.fragment)},l(p){s=T(p,"P",{"data-svelte-h":!0}),b(s)!=="svelte-72qyl2"&&(s.textContent=r),l=M(p),U(i.$$.fragment,p)},m(p,d){a(p,s,d),a(p,l,d),j(i,p,d),u=!0},i(p){u||(m(i.$$.fragment,p),u=!0)},o(p){o(i.$$.fragment,p),u=!1},d(p){p&&(n(s),n(l)),w(i,p)}}}function an(y){let s,r="以下是PyTorch张量的结果：",l,i,u;return i=new h({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,l=c(),J(i.$$.fragment)},l(p){s=T(p,"P",{"data-svelte-h":!0}),b(s)!=="svelte-16afy86"&&(s.textContent=r),l=M(p),U(i.$$.fragment,p)},m(p,d){a(p,s,d),a(p,l,d),j(i,p,d),u=!0},i(p){u||(m(i.$$.fragment,p),u=!0)},o(p){o(i.$$.fragment,p),u=!1},d(p){p&&(n(s),n(l)),w(i,p)}}}function rn(y){let s,r="我们可以像使用标记器一样下载预训练模型。🤗 Transformers提供了一个<code>TFAutoModel</code>类，该类还具有<code>from_pretrained()</code>方法：",l,i,u;return i=new h({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,l=c(),J(i.$$.fragment)},l(p){s=T(p,"P",{"data-svelte-h":!0}),b(s)!=="svelte-cxat2c"&&(s.innerHTML=r),l=M(p),U(i.$$.fragment,p)},m(p,d){a(p,s,d),a(p,l,d),j(i,p,d),u=!0},i(p){u||(m(i.$$.fragment,p),u=!0)},o(p){o(i.$$.fragment,p),u=!1},d(p){p&&(n(s),n(l)),w(i,p)}}}function pn(y){let s,r="我们可以像使用标记器一样下载预训练模型。🤗 Transformers提供了一个<code>AutoModel</code>类，该类还具有<code>from_pretrained()</code>方法：",l,i,u;return i=new h({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,l=c(),J(i.$$.fragment)},l(p){s=T(p,"P",{"data-svelte-h":!0}),b(s)!=="svelte-138s0q2"&&(s.innerHTML=r),l=M(p),U(i.$$.fragment,p)},m(p,d){a(p,s,d),a(p,l,d),j(i,p,d),u=!0},i(p){u||(m(i.$$.fragment,p),u=!0)},o(p){o(i.$$.fragment,p),u=!1},d(p){p&&(n(s),n(l)),w(i,p)}}}function cn(y){let s,r,l,i;return s=new h({props:{code:"b3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0cyklMEFwcmludChvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlLnNoYXBlKQ==",highlighted:`outputs = model(inputs)
<span class="hljs-built_in">print</span>(outputs.last_hidden_state.shape)`,wrap:!1}}),l=new h({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(){J(s.$$.fragment),r=c(),J(l.$$.fragment)},l(u){U(s.$$.fragment,u),r=M(u),U(l.$$.fragment,u)},m(u,p){j(s,u,p),a(u,r,p),j(l,u,p),i=!0},i(u){i||(m(s.$$.fragment,u),m(l.$$.fragment,u),i=!0)},o(u){o(s.$$.fragment,u),o(l.$$.fragment,u),i=!1},d(u){u&&n(r),w(s,u),w(l,u)}}}function Mn(y){let s,r,l,i;return s=new h({props:{code:"b3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQXByaW50KG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUuc2hhcGUp",highlighted:`outputs = model(**inputs)
<span class="hljs-built_in">print</span>(outputs.last_hidden_state.shape)`,wrap:!1}}),l=new h({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(){J(s.$$.fragment),r=c(),J(l.$$.fragment)},l(u){U(s.$$.fragment,u),r=M(u),U(l.$$.fragment,u)},m(u,p){j(s,u,p),a(u,r,p),j(l,u,p),i=!0},i(u){i||(m(s.$$.fragment,u),m(l.$$.fragment,u),i=!0)},o(u){o(s.$$.fragment,u),o(l.$$.fragment,u),i=!1},d(u){u&&n(r),w(s,u),w(l,u)}}}function un(y){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>:",l,i,u;return i=new h({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,l=c(),J(i.$$.fragment)},l(p){s=T(p,"P",{"data-svelte-h":!0}),b(s)!=="svelte-6up9xi"&&(s.innerHTML=r),l=M(p),U(i.$$.fragment,p)},m(p,d){a(p,s,d),a(p,l,d),j(i,p,d),u=!0},i(p){u||(m(i.$$.fragment,p),u=!0)},o(p){o(i.$$.fragment,p),u=!1},d(p){p&&(n(s),n(l)),w(i,p)}}}function on(y){let s,r="对于我们的示例，我们需要一个带有序列分类头的模型（能够将句子分类为肯定或否定）。因此，我们实际上不会使用<code>AutoModel</code>类，而是使用<code>AutoModelForSequenceClassification</code>：",l,i,u;return i=new h({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,l=c(),J(i.$$.fragment)},l(p){s=T(p,"P",{"data-svelte-h":!0}),b(s)!=="svelte-7rh9mo"&&(s.innerHTML=r),l=M(p),U(i.$$.fragment,p)},m(p,d){a(p,s,d),a(p,l,d),j(i,p,d),u=!0},i(p){u||(m(i.$$.fragment,p),u=!0)},o(p){o(i.$$.fragment,p),u=!1},d(p){p&&(n(s),n(l)),w(i,p)}}}function mn(y){let s,r;return s=new h({props:{code:"KDIlMkMlMjAyKQ==",highlighted:'(<span class="hljs-number">2</span>, <span class="hljs-number">2</span>)',wrap:!1}}),{c(){J(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function yn(y){let s,r;return s=new h({props:{code:"dG9yY2guU2l6ZSglNUIyJTJDJTIwMiU1RCk=",highlighted:'torch.Size([<span class="hljs-number">2</span>, <span class="hljs-number">2</span>])',wrap:!1}}),{c(){J(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function fn(y){let s,r;return s=new h({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(){J(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function Tn(y){let s,r;return s=new h({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(){J(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function bn(y){let s,r;return s=new h({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(){J(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function Jn(y){let s,r;return s=new h({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(){J(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function Un(y){let s,r;return s=new h({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(){J(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function jn(y){let s,r;return s=new h({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(){J(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function wn(y){let s,r="✏️ <strong>试试看！</strong> 选择两个（或更多）你自己的文本并在管道中运行它们。然后自己复制在这里看到的步骤，并检查是否获得相同的结果！";return{c(){s=f("p"),s.innerHTML=r},l(l){s=T(l,"P",{"data-svelte-h":!0}),b(s)!=="svelte-ro1h4d"&&(s.innerHTML=r)},m(l,i){a(l,s,i)},p:St,d(l){l&&n(s)}}}function dn(y){let s,r,l,i,u,p,d,Tl,_,C,tl,X,bl,$,k,nl,K,Is='让我们从一个完整的示例开始，看看在<a href="/course/chapter1">Chapter 1</a>中执行以下代码时在幕后发生了什么',Jl,O,Ul,ee,gs="获得:",jl,le,wl,se,As='正如我们在<a href="/course/chapter1">Chapter 1</a>中看到的，此管道将三个步骤组合在一起：预处理、通过模型传递输入和后处理：',dl,Y,vs='<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."/>',hl,te,xs="让我们快速浏览一下这些内容。",_l,ne,Cl,ae,Qs="与其他神经网络一样，Transformer模型无法直接处理原始文本， 因此我们管道的第一步是将文本输入转换为模型能够理解的数字。 为此，我们使用<em>tokenizer</em>(标记器)，负责：",$l,re,Ns="<li>将输入拆分为单词、子单词或符号（如标点符号），称为标记(<em>token</em>)</li> <li>将每个标记(token)映射到一个整数</li> <li>添加可能对模型有用的其他输入</li>",kl,pe,Ds='所有这些预处理都需要以与模型预训练时完全相同的方式完成，因此我们首先需要从<a href="https://huggingface.co/models" rel="nofollow">Model Hub</a>中下载这些信息。为此，我们使用<code>AutoTokenizer</code>类及其<code>from_pretrained()</code>方法。使用我们模型的检查点名称，它将自动获取与模型的标记器相关联的数据，并对其进行缓存（因此只有在您第一次运行下面的代码时才会下载）。',Il,ie,Es='因为<code>sentiment-analysis</code>（情绪分析）管道的默认检查点是<code>distilbert-base-uncased-finetuned-sst-2-english</code>（你可以看到它的模型卡<a href="https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english" rel="nofollow">here</a>)，我们运行以下程序：',gl,ce,Al,Me,Gs="一旦我们有了标记器，我们就可以直接将我们的句子传递给它，然后我们就会得到一本字典，它可以提供给我们的模型！剩下要做的唯一一件事就是将输入ID列表转换为张量。",vl,ue,Zs="您可以使用🤗 Transformers，而不必担心哪个ML框架被用作后端；它可能是PyTorch或TensorFlow，或Flax。但是，Transformers型号只接受<em>张量</em>作为输入。如果这是你第一次听说张量，你可以把它们想象成NumPy数组。NumPy数组可以是标量（0D）、向量（1D）、矩阵（2D）或具有更多维度。它实际上是张量；其他ML框架的张量行为类似，通常与NumPy数组一样易于实例化。",xl,oe,Vs="要指定要返回的张量类型（PyTorch、TensorFlow或plain NumPy），我们使用<code>return_tensors</code>参数：",Ql,I,g,al,me,Hs="现在不要担心填充和截断；我们稍后会解释这些。这里要记住的主要事情是，您可以传递一个句子或一组句子，还可以指定要返回的张量类型（如果没有传递类型，您将得到一组列表）。",Nl,A,v,rl,ye,zs="输出本身是一个包含两个键的字典，<code>input_ids</code>和<code>attention_mask</code>。<code>input_ids</code>包含两行整数（每个句子一行），它们是每个句子中标记的唯一标记（token）。我们将在本章后面解释什么是<code>attention_mask</code>。",Dl,fe,El,x,Q,pl,Te,Rs="在这个代码片段中，我们下载了之前在管道中使用的相同检查点（它实际上应该已经被缓存），并用它实例化了一个模型。",Gl,be,Ss="这个架构只包含基本转换器模块：给定一些输入，它输出我们将调用的内容<em>隐藏状态（hidden states）</em>，亦称<em>特征（features）</em>。对于每个模型输入，我们将检索一个高维向量，表示<strong>Transformer模型对该输入的上下文理解</strong>。",Zl,Je,Ws="如果这不合理，不要担心。我们以后再解释。",Vl,Ue,Bs='虽然这些隐藏状态本身可能很有用，但它们通常是模型另一部分（称为<em>头部(head)</em>）的输入。 在<a href="/course/chapter1">Chapter 1</a>中，可以使用相同的体系结构执行不同的任务，但这些任务中的每个任务都有一个与之关联的不同头。',Hl,je,zl,we,Ls="Transformers模块的矢量输出通常较大。它通常有三个维度：",Rl,de,Fs="<li><strong>Batch size</strong>: 一次处理的序列数（在我们的示例中为2）。</li> <li><strong>Sequence length</strong>: 序列的数值表示的长度（在我们的示例中为16）。</li> <li><strong>Hidden size</strong>: 每个模型输入的向量维度。</li>",Sl,he,Xs="由于最后一个值，它被称为“高维”。隐藏的大小可能非常大（768通常用于较小的型号，而在较大的型号中，这可能达到3072或更大）。",Wl,_e,Ys="如果我们将预处理的输入输入到模型中，我们可以看到这一点：",Bl,N,D,il,Ce,Ps="注意🤗 Transformers模型的输出与<code>namedtuple</code>或词典相似。您可以通过属性（就像我们所做的那样）或键（<code>输出[&quot;last_hidden_state&quot;]</code>）访问元素，甚至可以通过索引访问元素，前提是您确切知道要查找的内容在哪里（<code>outputs[0]</code>）。",Ll,$e,Fl,ke,qs="模型头将隐藏状态的高维向量作为输入，并将其投影到不同的维度。它们通常由一个或几个线性层组成：",Xl,P,Ks='<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."/>',Yl,Ie,Os="Transformers模型的输出直接发送到模型头进行处理。",Pl,ge,et="在此图中，模型由其嵌入层和后续层表示。嵌入层将标记化输入中的每个输入ID转换为表示关联标记(token)的向量。后续层使用注意机制操纵这些向量，以生成句子的最终表示。",ql,Ae,lt="🤗 Transformers中有许多不同的体系结构，每种体系结构都是围绕处理特定任务而设计的。以下是一个非详尽的列表：",Kl,ve,st="<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>以及其他 🤗</li>",Ol,E,G,cl,xe,tt="现在，如果我们观察输出的形状，维度将低得多：模型头将我们之前看到的高维向量作为输入，并输出包含两个值的向量（每个标签一个）：",es,Qe,ls,Z,V,Ml,Ne,nt="因为我们只有两个句子和两个标签，所以我们从模型中得到的结果是2 x 2的形状。",ss,De,ts,Ee,at="我们从模型中得到的输出值本身并不一定有意义。我们来看看,",ns,Ge,as,H,z,ul,Ze,rt='我们的模型预测第一句为<code>[-1.5607, 1.6123]</code>，第二句为<code>[ 4.1692, -3.3464]</code>。这些不是概率，而是<em>logits</em>，即模型最后一层输出的原始非标准化分数。要转换为概率，它们需要经过<a href="https://en.wikipedia.org/wiki/Softmax_function" rel="nofollow">SoftMax</a>层（所有🤗Transformers模型输出logits，因为用于训练的损耗函数通常会将最后的激活函数（如SoftMax）与实际损耗函数（如交叉熵）融合）：',rs,R,S,ol,W,B,ml,Ve,pt="现在我们可以看到，模型预测第一句为<code>[0.0402, 0.9598]</code>，第二句为<code>[0.9995, 0.0005]</code>。这些是可识别的概率分数。",ps,He,it="为了获得每个位置对应的标签，我们可以检查模型配置的<code>id2label</code>属性（下一节将对此进行详细介绍）：",is,ze,cs,Re,Ms,Se,ct="现在我们可以得出结论，该模型预测了以下几点：",us,We,Mt="<li>第一句：否定：0.0402，肯定：0.9598</li> <li>第二句：否定：0.9995，肯定：0.0005</li>",os,Be,ut="我们已经成功地复制了管道的三个步骤：使用标记化器进行预处理、通过模型传递输入以及后处理！现在，让我们花一些时间深入了解这些步骤中的每一步。",ms,q,ys,fl,fs;u=new Pt({props:{fw:y[0]}}),d=new yl({props:{title:"管道的内部",local:"管道的内部",headingTag:"h1"}});const ot=[Kt,qt],Le=[];function mt(e,t){return e[0]==="pt"?0:1}_=mt(y),C=Le[_]=ot[_](y),X=new Zt({props:{$$slots:{default:[Ot]},$$scope:{ctx:y}}});const yt=[ln,en],Fe=[];function ft(e,t){return e[0]==="pt"?0:1}$=ft(y),k=Fe[$]=yt[$](y),O=new h({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}}),le=new h({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 yl({props:{title:"使用分词器进行预处理",local:"使用分词器进行预处理",headingTag:"h2"}}),ce=new h({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 Tt=[tn,sn],Xe=[];function bt(e,t){return e[0]==="pt"?0:1}I=bt(y),g=Xe[I]=Tt[I](y);const Jt=[an,nn],Ye=[];function Ut(e,t){return e[0]==="pt"?0:1}A=Ut(y),v=Ye[A]=Jt[A](y),fe=new yl({props:{title:"浏览模型",local:"浏览模型",headingTag:"h2"}});const jt=[pn,rn],Pe=[];function wt(e,t){return e[0]==="pt"?0:1}x=wt(y),Q=Pe[x]=jt[x](y),je=new yl({props:{title:"高维向量？",local:"高维向量？",headingTag:"h3"}});const dt=[Mn,cn],qe=[];function ht(e,t){return e[0]==="pt"?0:1}N=ht(y),D=qe[N]=dt[N](y),$e=new yl({props:{title:"模型头：数字的意义",local:"模型头：数字的意义",headingTag:"h3"}});const _t=[on,un],Ke=[];function Ct(e,t){return e[0]==="pt"?0:1}E=Ct(y),G=Ke[E]=_t[E](y),Qe=new h({props:{code:"cHJpbnQob3V0cHV0cy5sb2dpdHMuc2hhcGUp",highlighted:'<span class="hljs-built_in">print</span>(outputs.logits.shape)',wrap:!1}});const $t=[yn,mn],Oe=[];function kt(e,t){return e[0]==="pt"?0:1}Z=kt(y),V=Oe[Z]=$t[Z](y),De=new yl({props:{title:"对输出进行后处理",local:"对输出进行后处理",headingTag:"h2"}}),Ge=new h({props:{code:"cHJpbnQob3V0cHV0cy5sb2dpdHMp",highlighted:'<span class="hljs-built_in">print</span>(outputs.logits)',wrap:!1}});const It=[Tn,fn],el=[];function gt(e,t){return e[0]==="pt"?0:1}H=gt(y),z=el[H]=It[H](y);const At=[Jn,bn],ll=[];function vt(e,t){return e[0]==="pt"?0:1}R=vt(y),S=ll[R]=At[R](y);const xt=[jn,Un],sl=[];function Qt(e,t){return e[0]==="pt"?0:1}return W=Qt(y),B=sl[W]=xt[W](y),ze=new h({props:{code:"bW9kZWwuY29uZmlnLmlkMmxhYmVs",highlighted:"model.config.id2label",wrap:!1}}),Re=new h({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 Zt({props:{$$slots:{default:[wn]},$$scope:{ctx:y}}}),{c(){s=f("meta"),r=c(),l=f("p"),i=c(),J(u.$$.fragment),p=c(),J(d.$$.fragment),Tl=c(),C.c(),tl=c(),J(X.$$.fragment),bl=c(),k.c(),nl=c(),K=f("p"),K.innerHTML=Is,Jl=c(),J(O.$$.fragment),Ul=c(),ee=f("p"),ee.textContent=gs,jl=c(),J(le.$$.fragment),wl=c(),se=f("p"),se.innerHTML=As,dl=c(),Y=f("div"),Y.innerHTML=vs,hl=c(),te=f("p"),te.textContent=xs,_l=c(),J(ne.$$.fragment),Cl=c(),ae=f("p"),ae.innerHTML=Qs,$l=c(),re=f("ul"),re.innerHTML=Ns,kl=c(),pe=f("p"),pe.innerHTML=Ds,Il=c(),ie=f("p"),ie.innerHTML=Es,gl=c(),J(ce.$$.fragment),Al=c(),Me=f("p"),Me.textContent=Gs,vl=c(),ue=f("p"),ue.innerHTML=Zs,xl=c(),oe=f("p"),oe.innerHTML=Vs,Ql=c(),g.c(),al=c(),me=f("p"),me.textContent=Hs,Nl=c(),v.c(),rl=c(),ye=f("p"),ye.innerHTML=zs,Dl=c(),J(fe.$$.fragment),El=c(),Q.c(),pl=c(),Te=f("p"),Te.textContent=Rs,Gl=c(),be=f("p"),be.innerHTML=Ss,Zl=c(),Je=f("p"),Je.textContent=Ws,Vl=c(),Ue=f("p"),Ue.innerHTML=Bs,Hl=c(),J(je.$$.fragment),zl=c(),we=f("p"),we.textContent=Ls,Rl=c(),de=f("ul"),de.innerHTML=Fs,Sl=c(),he=f("p"),he.textContent=Xs,Wl=c(),_e=f("p"),_e.textContent=Ys,Bl=c(),D.c(),il=c(),Ce=f("p"),Ce.innerHTML=Ps,Ll=c(),J($e.$$.fragment),Fl=c(),ke=f("p"),ke.textContent=qs,Xl=c(),P=f("div"),P.innerHTML=Ks,Yl=c(),Ie=f("p"),Ie.textContent=Os,Pl=c(),ge=f("p"),ge.textContent=et,ql=c(),Ae=f("p"),Ae.textContent=lt,Kl=c(),ve=f("ul"),ve.innerHTML=st,Ol=c(),G.c(),cl=c(),xe=f("p"),xe.textContent=tt,es=c(),J(Qe.$$.fragment),ls=c(),V.c(),Ml=c(),Ne=f("p"),Ne.textContent=nt,ss=c(),J(De.$$.fragment),ts=c(),Ee=f("p"),Ee.textContent=at,ns=c(),J(Ge.$$.fragment),as=c(),z.c(),ul=c(),Ze=f("p"),Ze.innerHTML=rt,rs=c(),S.c(),ol=c(),B.c(),ml=c(),Ve=f("p"),Ve.innerHTML=pt,ps=c(),He=f("p"),He.innerHTML=it,is=c(),J(ze.$$.fragment),cs=c(),J(Re.$$.fragment),Ms=c(),Se=f("p"),Se.textContent=ct,us=c(),We=f("ul"),We.innerHTML=Mt,os=c(),Be=f("p"),Be.textContent=ut,ms=c(),J(q.$$.fragment),ys=c(),fl=f("p"),this.h()},l(e){const t=Lt("svelte-u9bgzb",document.head);s=T(t,"META",{name:!0,content:!0}),t.forEach(n),r=M(e),l=T(e,"P",{}),Gt(l).forEach(n),i=M(e),U(u.$$.fragment,e),p=M(e),U(d.$$.fragment,e),Tl=M(e),C.l(e),tl=M(e),U(X.$$.fragment,e),bl=M(e),k.l(e),nl=M(e),K=T(e,"P",{"data-svelte-h":!0}),b(K)!=="svelte-1j8jsnx"&&(K.innerHTML=Is),Jl=M(e),U(O.$$.fragment,e),Ul=M(e),ee=T(e,"P",{"data-svelte-h":!0}),b(ee)!=="svelte-dmlqno"&&(ee.textContent=gs),jl=M(e),U(le.$$.fragment,e),wl=M(e),se=T(e,"P",{"data-svelte-h":!0}),b(se)!=="svelte-19jqjnv"&&(se.innerHTML=As),dl=M(e),Y=T(e,"DIV",{class:!0,"data-svelte-h":!0}),b(Y)!=="svelte-fbe70j"&&(Y.innerHTML=vs),hl=M(e),te=T(e,"P",{"data-svelte-h":!0}),b(te)!=="svelte-k97r7m"&&(te.textContent=xs),_l=M(e),U(ne.$$.fragment,e),Cl=M(e),ae=T(e,"P",{"data-svelte-h":!0}),b(ae)!=="svelte-phpz7j"&&(ae.innerHTML=Qs),$l=M(e),re=T(e,"UL",{"data-svelte-h":!0}),b(re)!=="svelte-11ifqd0"&&(re.innerHTML=Ns),kl=M(e),pe=T(e,"P",{"data-svelte-h":!0}),b(pe)!=="svelte-vocr7q"&&(pe.innerHTML=Ds),Il=M(e),ie=T(e,"P",{"data-svelte-h":!0}),b(ie)!=="svelte-vup6d7"&&(ie.innerHTML=Es),gl=M(e),U(ce.$$.fragment,e),Al=M(e),Me=T(e,"P",{"data-svelte-h":!0}),b(Me)!=="svelte-jchdnt"&&(Me.textContent=Gs),vl=M(e),ue=T(e,"P",{"data-svelte-h":!0}),b(ue)!=="svelte-xgvzyw"&&(ue.innerHTML=Zs),xl=M(e),oe=T(e,"P",{"data-svelte-h":!0}),b(oe)!=="svelte-m68pv9"&&(oe.innerHTML=Vs),Ql=M(e),g.l(e),al=M(e),me=T(e,"P",{"data-svelte-h":!0}),b(me)!=="svelte-y2720n"&&(me.textContent=Hs),Nl=M(e),v.l(e),rl=M(e),ye=T(e,"P",{"data-svelte-h":!0}),b(ye)!=="svelte-rgutu4"&&(ye.innerHTML=zs),Dl=M(e),U(fe.$$.fragment,e),El=M(e),Q.l(e),pl=M(e),Te=T(e,"P",{"data-svelte-h":!0}),b(Te)!=="svelte-f4nwm4"&&(Te.textContent=Rs),Gl=M(e),be=T(e,"P",{"data-svelte-h":!0}),b(be)!=="svelte-16kf3gy"&&(be.innerHTML=Ss),Zl=M(e),Je=T(e,"P",{"data-svelte-h":!0}),b(Je)!=="svelte-3d75gw"&&(Je.textContent=Ws),Vl=M(e),Ue=T(e,"P",{"data-svelte-h":!0}),b(Ue)!=="svelte-5cb7ye"&&(Ue.innerHTML=Bs),Hl=M(e),U(je.$$.fragment,e),zl=M(e),we=T(e,"P",{"data-svelte-h":!0}),b(we)!=="svelte-o0sk0z"&&(we.textContent=Ls),Rl=M(e),de=T(e,"UL",{"data-svelte-h":!0}),b(de)!=="svelte-1rhe0xj"&&(de.innerHTML=Fs),Sl=M(e),he=T(e,"P",{"data-svelte-h":!0}),b(he)!=="svelte-1hzqz1x"&&(he.textContent=Xs),Wl=M(e),_e=T(e,"P",{"data-svelte-h":!0}),b(_e)!=="svelte-kb9c1u"&&(_e.textContent=Ys),Bl=M(e),D.l(e),il=M(e),Ce=T(e,"P",{"data-svelte-h":!0}),b(Ce)!=="svelte-1aaz0ky"&&(Ce.innerHTML=Ps),Ll=M(e),U($e.$$.fragment,e),Fl=M(e),ke=T(e,"P",{"data-svelte-h":!0}),b(ke)!=="svelte-19p5g8z"&&(ke.textContent=qs),Xl=M(e),P=T(e,"DIV",{class:!0,"data-svelte-h":!0}),b(P)!=="svelte-8mo6lt"&&(P.innerHTML=Ks),Yl=M(e),Ie=T(e,"P",{"data-svelte-h":!0}),b(Ie)!=="svelte-18kk9ur"&&(Ie.textContent=Os),Pl=M(e),ge=T(e,"P",{"data-svelte-h":!0}),b(ge)!=="svelte-1gv9jev"&&(ge.textContent=et),ql=M(e),Ae=T(e,"P",{"data-svelte-h":!0}),b(Ae)!=="svelte-10fdlre"&&(Ae.textContent=lt),Kl=M(e),ve=T(e,"UL",{"data-svelte-h":!0}),b(ve)!=="svelte-dcpvgx"&&(ve.innerHTML=st),Ol=M(e),G.l(e),cl=M(e),xe=T(e,"P",{"data-svelte-h":!0}),b(xe)!=="svelte-1c9e85c"&&(xe.textContent=tt),es=M(e),U(Qe.$$.fragment,e),ls=M(e),V.l(e),Ml=M(e),Ne=T(e,"P",{"data-svelte-h":!0}),b(Ne)!=="svelte-h6sls6"&&(Ne.textContent=nt),ss=M(e),U(De.$$.fragment,e),ts=M(e),Ee=T(e,"P",{"data-svelte-h":!0}),b(Ee)!=="svelte-1eacukd"&&(Ee.textContent=at),ns=M(e),U(Ge.$$.fragment,e),as=M(e),z.l(e),ul=M(e),Ze=T(e,"P",{"data-svelte-h":!0}),b(Ze)!=="svelte-cncla7"&&(Ze.innerHTML=rt),rs=M(e),S.l(e),ol=M(e),B.l(e),ml=M(e),Ve=T(e,"P",{"data-svelte-h":!0}),b(Ve)!=="svelte-1b8h63"&&(Ve.innerHTML=pt),ps=M(e),He=T(e,"P",{"data-svelte-h":!0}),b(He)!=="svelte-19136f0"&&(He.innerHTML=it),is=M(e),U(ze.$$.fragment,e),cs=M(e),U(Re.$$.fragment,e),Ms=M(e),Se=T(e,"P",{"data-svelte-h":!0}),b(Se)!=="svelte-orx96u"&&(Se.textContent=ct),us=M(e),We=T(e,"UL",{"data-svelte-h":!0}),b(We)!=="svelte-hx5asi"&&(We.innerHTML=Mt),os=M(e),Be=T(e,"P",{"data-svelte-h":!0}),b(Be)!=="svelte-1nvv9c8"&&(Be.textContent=ut),ms=M(e),U(q.$$.fragment,e),ys=M(e),fl=T(e,"P",{}),Gt(fl).forEach(n),this.h()},h(){Ts(s,"name","hf:doc:metadata"),Ts(s,"content",hn),Ts(Y,"class","flex justify-center"),Ts(P,"class","flex justify-center")},m(e,t){Ft(document.head,s),a(e,r,t),a(e,l,t),a(e,i,t),j(u,e,t),a(e,p,t),j(d,e,t),a(e,Tl,t),Le[_].m(e,t),a(e,tl,t),j(X,e,t),a(e,bl,t),Fe[$].m(e,t),a(e,nl,t),a(e,K,t),a(e,Jl,t),j(O,e,t),a(e,Ul,t),a(e,ee,t),a(e,jl,t),j(le,e,t),a(e,wl,t),a(e,se,t),a(e,dl,t),a(e,Y,t),a(e,hl,t),a(e,te,t),a(e,_l,t),j(ne,e,t),a(e,Cl,t),a(e,ae,t),a(e,$l,t),a(e,re,t),a(e,kl,t),a(e,pe,t),a(e,Il,t),a(e,ie,t),a(e,gl,t),j(ce,e,t),a(e,Al,t),a(e,Me,t),a(e,vl,t),a(e,ue,t),a(e,xl,t),a(e,oe,t),a(e,Ql,t),Xe[I].m(e,t),a(e,al,t),a(e,me,t),a(e,Nl,t),Ye[A].m(e,t),a(e,rl,t),a(e,ye,t),a(e,Dl,t),j(fe,e,t),a(e,El,t),Pe[x].m(e,t),a(e,pl,t),a(e,Te,t),a(e,Gl,t),a(e,be,t),a(e,Zl,t),a(e,Je,t),a(e,Vl,t),a(e,Ue,t),a(e,Hl,t),j(je,e,t),a(e,zl,t),a(e,we,t),a(e,Rl,t),a(e,de,t),a(e,Sl,t),a(e,he,t),a(e,Wl,t),a(e,_e,t),a(e,Bl,t),qe[N].m(e,t),a(e,il,t),a(e,Ce,t),a(e,Ll,t),j($e,e,t),a(e,Fl,t),a(e,ke,t),a(e,Xl,t),a(e,P,t),a(e,Yl,t),a(e,Ie,t),a(e,Pl,t),a(e,ge,t),a(e,ql,t),a(e,Ae,t),a(e,Kl,t),a(e,ve,t),a(e,Ol,t),Ke[E].m(e,t),a(e,cl,t),a(e,xe,t),a(e,es,t),j(Qe,e,t),a(e,ls,t),Oe[Z].m(e,t),a(e,Ml,t),a(e,Ne,t),a(e,ss,t),j(De,e,t),a(e,ts,t),a(e,Ee,t),a(e,ns,t),j(Ge,e,t),a(e,as,t),el[H].m(e,t),a(e,ul,t),a(e,Ze,t),a(e,rs,t),ll[R].m(e,t),a(e,ol,t),sl[W].m(e,t),a(e,ml,t),a(e,Ve,t),a(e,ps,t),a(e,He,t),a(e,is,t),j(ze,e,t),a(e,cs,t),j(Re,e,t),a(e,Ms,t),a(e,Se,t),a(e,us,t),a(e,We,t),a(e,os,t),a(e,Be,t),a(e,ms,t),j(q,e,t),a(e,ys,t),a(e,fl,t),fs=!0},p(e,[t]){const Nt={};t&1&&(Nt.fw=e[0]),u.$set(Nt);let bs=_;_=mt(e),_!==bs&&(F(),o(Le[bs],1,1,()=>{Le[bs]=null}),L(),C=Le[_],C||(C=Le[_]=ot[_](e),C.c()),m(C,1),C.m(tl.parentNode,tl));const Dt={};t&2&&(Dt.$$scope={dirty:t,ctx:e}),X.$set(Dt);let Js=$;$=ft(e),$!==Js&&(F(),o(Fe[Js],1,1,()=>{Fe[Js]=null}),L(),k=Fe[$],k||(k=Fe[$]=yt[$](e),k.c()),m(k,1),k.m(nl.parentNode,nl));let Us=I;I=bt(e),I!==Us&&(F(),o(Xe[Us],1,1,()=>{Xe[Us]=null}),L(),g=Xe[I],g||(g=Xe[I]=Tt[I](e),g.c()),m(g,1),g.m(al.parentNode,al));let js=A;A=Ut(e),A!==js&&(F(),o(Ye[js],1,1,()=>{Ye[js]=null}),L(),v=Ye[A],v||(v=Ye[A]=Jt[A](e),v.c()),m(v,1),v.m(rl.parentNode,rl));let ws=x;x=wt(e),x!==ws&&(F(),o(Pe[ws],1,1,()=>{Pe[ws]=null}),L(),Q=Pe[x],Q||(Q=Pe[x]=jt[x](e),Q.c()),m(Q,1),Q.m(pl.parentNode,pl));let ds=N;N=ht(e),N!==ds&&(F(),o(qe[ds],1,1,()=>{qe[ds]=null}),L(),D=qe[N],D||(D=qe[N]=dt[N](e),D.c()),m(D,1),D.m(il.parentNode,il));let hs=E;E=Ct(e),E!==hs&&(F(),o(Ke[hs],1,1,()=>{Ke[hs]=null}),L(),G=Ke[E],G||(G=Ke[E]=_t[E](e),G.c()),m(G,1),G.m(cl.parentNode,cl));let _s=Z;Z=kt(e),Z!==_s&&(F(),o(Oe[_s],1,1,()=>{Oe[_s]=null}),L(),V=Oe[Z],V||(V=Oe[Z]=$t[Z](e),V.c()),m(V,1),V.m(Ml.parentNode,Ml));let Cs=H;H=gt(e),H!==Cs&&(F(),o(el[Cs],1,1,()=>{el[Cs]=null}),L(),z=el[H],z||(z=el[H]=It[H](e),z.c()),m(z,1),z.m(ul.parentNode,ul));let $s=R;R=vt(e),R!==$s&&(F(),o(ll[$s],1,1,()=>{ll[$s]=null}),L(),S=ll[R],S||(S=ll[R]=At[R](e),S.c()),m(S,1),S.m(ol.parentNode,ol));let ks=W;W=Qt(e),W!==ks&&(F(),o(sl[ks],1,1,()=>{sl[ks]=null}),L(),B=sl[W],B||(B=sl[W]=xt[W](e),B.c()),m(B,1),B.m(ml.parentNode,ml));const Et={};t&2&&(Et.$$scope={dirty:t,ctx:e}),q.$set(Et)},i(e){fs||(m(u.$$.fragment,e),m(d.$$.fragment,e),m(C),m(X.$$.fragment,e),m(k),m(O.$$.fragment,e),m(le.$$.fragment,e),m(ne.$$.fragment,e),m(ce.$$.fragment,e),m(g),m(v),m(fe.$$.fragment,e),m(Q),m(je.$$.fragment,e),m(D),m($e.$$.fragment,e),m(G),m(Qe.$$.fragment,e),m(V),m(De.$$.fragment,e),m(Ge.$$.fragment,e),m(z),m(S),m(B),m(ze.$$.fragment,e),m(Re.$$.fragment,e),m(q.$$.fragment,e),fs=!0)},o(e){o(u.$$.fragment,e),o(d.$$.fragment,e),o(C),o(X.$$.fragment,e),o(k),o(O.$$.fragment,e),o(le.$$.fragment,e),o(ne.$$.fragment,e),o(ce.$$.fragment,e),o(g),o(v),o(fe.$$.fragment,e),o(Q),o(je.$$.fragment,e),o(D),o($e.$$.fragment,e),o(G),o(Qe.$$.fragment,e),o(V),o(De.$$.fragment,e),o(Ge.$$.fragment,e),o(z),o(S),o(B),o(ze.$$.fragment,e),o(Re.$$.fragment,e),o(q.$$.fragment,e),fs=!1},d(e){e&&(n(r),n(l),n(i),n(p),n(Tl),n(tl),n(bl),n(nl),n(K),n(Jl),n(Ul),n(ee),n(jl),n(wl),n(se),n(dl),n(Y),n(hl),n(te),n(_l),n(Cl),n(ae),n($l),n(re),n(kl),n(pe),n(Il),n(ie),n(gl),n(Al),n(Me),n(vl),n(ue),n(xl),n(oe),n(Ql),n(al),n(me),n(Nl),n(rl),n(ye),n(Dl),n(El),n(pl),n(Te),n(Gl),n(be),n(Zl),n(Je),n(Vl),n(Ue),n(Hl),n(zl),n(we),n(Rl),n(de),n(Sl),n(he),n(Wl),n(_e),n(Bl),n(il),n(Ce),n(Ll),n(Fl),n(ke),n(Xl),n(P),n(Yl),n(Ie),n(Pl),n(ge),n(ql),n(Ae),n(Kl),n(ve),n(Ol),n(cl),n(xe),n(es),n(ls),n(Ml),n(Ne),n(ss),n(ts),n(Ee),n(ns),n(as),n(ul),n(Ze),n(rs),n(ol),n(ml),n(Ve),n(ps),n(He),n(is),n(cs),n(Ms),n(Se),n(us),n(We),n(os),n(Be),n(ms),n(ys),n(fl)),n(s),w(u,e),w(d,e),Le[_].d(e),w(X,e),Fe[$].d(e),w(O,e),w(le,e),w(ne,e),w(ce,e),Xe[I].d(e),Ye[A].d(e),w(fe,e),Pe[x].d(e),w(je,e),qe[N].d(e),w($e,e),Ke[E].d(e),w(Qe,e),Oe[Z].d(e),w(De,e),w(Ge,e),el[H].d(e),ll[R].d(e),sl[W].d(e),w(ze,e),w(Re,e),w(q,e)}}}const hn='{"title":"管道的内部","local":"管道的内部","sections":[{"title":"使用分词器进行预处理","local":"使用分词器进行预处理","sections":[],"depth":2},{"title":"浏览模型","local":"浏览模型","sections":[{"title":"高维向量？","local":"高维向量？","sections":[],"depth":3},{"title":"模型头：数字的意义","local":"模型头：数字的意义","sections":[],"depth":3}],"depth":2},{"title":"对输出进行后处理","local":"对输出进行后处理","sections":[],"depth":2}],"depth":1}';function _n(y,s,r){let l="pt";return Rt(()=>{const i=new URLSearchParams(window.location.search);r(0,l=i.get("fw")||"pt")}),[l]}class Qn extends Wt{constructor(s){super(),Bt(this,s,_n,dn,zt,{})}}export{Qn as component};
