import{S as ar,i as ir,s as sr,e as i,k as c,w as A,t as H,l as rr,M as lr,c as s,d as t,m as $,x as z,a as p,h as N,b as l,G as o,g as u,y as b,o as _,p as or,q as w,B as T,v as pr,n as nr}from"../../chunks/vendor-hf-doc-builder.js";import{I as M}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as Et}from"../../chunks/CodeBlock-hf-doc-builder.js";import{C as fr}from"../../chunks/CourseFloatingBanner-hf-doc-builder.js";import{Q as C}from"../../chunks/Question-hf-doc-builder.js";import{F as hr}from"../../chunks/FrameworkSwitchCourse-hf-doc-builder.js";import"../../chunks/DocNotebookDropdown-hf-doc-builder.js";function ur(j){let f,h,k,m,S,y,q,E,d,g;return m=new M({}),d=new C({props:{choices:[{text:"\u6839\u636E\u60A8\u7684\u6570\u636E\u81EA\u52A8\u8FDB\u884C\u8BAD\u7EC3\u7684\u6A21\u578B",explain:"\u9519\u8BEF\u3002\u60A8\u53EF\u80FD\u628ATFAutoModel\u4E0E\u6211\u4EEC\u7684<a href='https://huggingface.co/autonlp'>AutoNLP</a> \u4EA7\u54C1\u76F8\u6DF7\u6DC6\u4E86\uFF1F"},{text:"\u4E00\u4E2A\u6839\u636ECheckpoint(\u68C0\u67E5\u70B9)\u8FD4\u56DE\u6A21\u578B\u4F53\u7CFB\u7ED3\u6784\u7684\u5BF9\u8C61",explain:"\u786E\u5207\u5730\u8BF4: <code>TFAutoModel</code>\u53EA\u9700\u8981\u77E5\u9053\u521D\u59CB\u5316\u7684Checkpoint(\u68C0\u67E5\u70B9)\u5C31\u53EF\u4EE5\u8FD4\u56DE\u6B63\u786E\u7684\u4F53\u7CFB\u7ED3\u6784\u3002",correct:!0},{text:"\u4E00\u79CD\u53EF\u4EE5\u81EA\u52A8\u68C0\u6D4B\u8F93\u5165\u8BED\u8A00\u6765\u52A0\u8F7D\u6B63\u786E\u6743\u91CD\u7684\u6A21\u578B",explain:"\u4E0D\u6B63\u786E; \u867D\u7136\u6709\u4E9BCheckpoint(\u68C0\u67E5\u70B9)\u548C\u6A21\u578B\u80FD\u591F\u5904\u7406\u591A\u79CD\u8BED\u8A00\uFF0C\u4F46\u662F\u6CA1\u6709\u5185\u7F6E\u7684\u5DE5\u5177\u53EF\u4EE5\u6839\u636E\u8BED\u8A00\u81EA\u52A8\u9009\u62E9Checkpoint(\u68C0\u67E5\u70B9)\u3002\u60A8\u5E94\u8BE5\u524D\u5F80 <a href='https://huggingface.co/models'>Model Hub</a> \u5BFB\u627E\u5B8C\u6210\u6240\u9700\u4EFB\u52A1\u7684\u6700\u4F73Checkpoint(\u68C0\u67E5\u70B9)\uFF01"}]}}),{c(){f=i("h3"),h=i("a"),k=i("span"),A(m.$$.fragment),S=c(),y=i("span"),q=H("5.\u4EC0\u4E48\u662F TFAutoModel\uFF1F"),E=c(),A(d.$$.fragment),this.h()},l(n){f=s(n,"H3",{class:!0});var v=p(f);h=s(v,"A",{id:!0,class:!0,href:!0});var r=p(h);k=s(r,"SPAN",{});var x=p(k);z(m.$$.fragment,x),x.forEach(t),r.forEach(t),S=$(v),y=s(v,"SPAN",{});var P=p(y);q=N(P,"5.\u4EC0\u4E48\u662F TFAutoModel\uFF1F"),P.forEach(t),v.forEach(t),E=$(n),z(d.$$.fragment,n),this.h()},h(){l(h,"id","5.\u4EC0\u4E48\u662F-tfautomodel\uFF1F"),l(h,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(h,"href","#5.\u4EC0\u4E48\u662F-tfautomodel\uFF1F"),l(f,"class","relative group")},m(n,v){u(n,f,v),o(f,h),o(h,k),b(m,k,null),o(f,S),o(f,y),o(y,q),u(n,E,v),b(d,n,v),g=!0},i(n){g||(w(m.$$.fragment,n),w(d.$$.fragment,n),g=!0)},o(n){_(m.$$.fragment,n),_(d.$$.fragment,n),g=!1},d(n){n&&t(f),T(m),n&&t(E),T(d,n)}}}function cr(j){let f,h,k,m,S,y,q,E,d,g;return m=new M({}),d=new C({props:{choices:[{text:"\u6839\u636E\u60A8\u7684\u6570\u636E\u81EA\u52A8\u8FDB\u884C\u8BAD\u7EC3\u7684\u6A21\u578B",explain:"\u9519\u8BEF\u3002\u60A8\u53EF\u80FD\u628AAutoModel\u4E0E\u6211\u4EEC\u7684<a href='https://huggingface.co/autonlp'>AutoNLP</a> \u4EA7\u54C1\u76F8\u6DF7\u6DC6\u4E86\uFF1F"},{text:"\u4E00\u4E2A\u6839\u636ECheckpoint(\u68C0\u67E5\u70B9)\u8FD4\u56DE\u6A21\u578B\u4F53\u7CFB\u7ED3\u6784\u7684\u5BF9\u8C61",explain:"\u786E\u5207\u5730\u8BF4: <code>AutoModel</code>\u53EA\u9700\u8981\u77E5\u9053\u521D\u59CB\u5316\u7684Checkpoint(\u68C0\u67E5\u70B9)\u5C31\u53EF\u4EE5\u8FD4\u56DE\u6B63\u786E\u7684\u4F53\u7CFB\u7ED3\u6784\u3002",correct:!0},{text:"\u4E00\u79CD\u53EF\u4EE5\u81EA\u52A8\u68C0\u6D4B\u8F93\u5165\u8BED\u8A00\u6765\u52A0\u8F7D\u6B63\u786E\u6743\u91CD\u7684\u6A21\u578B",explain:"\u4E0D\u6B63\u786E; \u867D\u7136\u6709\u4E9BCheckpoint(\u68C0\u67E5\u70B9)\u548C\u6A21\u578B\u80FD\u591F\u5904\u7406\u591A\u79CD\u8BED\u8A00\uFF0C\u4F46\u662F\u6CA1\u6709\u5185\u7F6E\u7684\u5DE5\u5177\u53EF\u4EE5\u6839\u636E\u8BED\u8A00\u81EA\u52A8\u9009\u62E9Checkpoint(\u68C0\u67E5\u70B9)\u3002\u60A8\u5E94\u8BE5\u524D\u5F80 <a href='https://huggingface.co/models'>Model Hub</a> \u5BFB\u627E\u5B8C\u6210\u6240\u9700\u4EFB\u52A1\u7684\u6700\u4F73Checkpoint(\u68C0\u67E5\u70B9)\uFF01"}]}}),{c(){f=i("h3"),h=i("a"),k=i("span"),A(m.$$.fragment),S=c(),y=i("span"),q=H("5.\u4EC0\u4E48\u662FAutoModel\uFF1F"),E=c(),A(d.$$.fragment),this.h()},l(n){f=s(n,"H3",{class:!0});var v=p(f);h=s(v,"A",{id:!0,class:!0,href:!0});var r=p(h);k=s(r,"SPAN",{});var x=p(k);z(m.$$.fragment,x),x.forEach(t),r.forEach(t),S=$(v),y=s(v,"SPAN",{});var P=p(y);q=N(P,"5.\u4EC0\u4E48\u662FAutoModel\uFF1F"),P.forEach(t),v.forEach(t),E=$(n),z(d.$$.fragment,n),this.h()},h(){l(h,"id","5.\u4EC0\u4E48\u662Fautomodel\uFF1F"),l(h,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(h,"href","#5.\u4EC0\u4E48\u662Fautomodel\uFF1F"),l(f,"class","relative group")},m(n,v){u(n,f,v),o(f,h),o(h,k),b(m,k,null),o(f,S),o(f,y),o(y,q),u(n,E,v),b(d,n,v),g=!0},i(n){g||(w(m.$$.fragment,n),w(d.$$.fragment,n),g=!0)},o(n){_(m.$$.fragment,n),_(d.$$.fragment,n),g=!1},d(n){n&&t(f),T(m),n&&t(E),T(d,n)}}}function $r(j){let f,h,k,m,S,y,q,E,d,g,n,v;return m=new M({}),d=new Et({props:{code:`from transformers import AutoTokenizer, TFAutoModel

tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")
model = TFAutoModel.from_pretrained("gpt2")

encoded = tokenizer("Hey!", return_tensors="pt")
result = model(**encoded)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFAutoModel

tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)
model = TFAutoModel.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)

encoded = tokenizer(<span class="hljs-string">&quot;Hey!&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
result = model(**encoded)`}}),n=new C({props:{choices:[{text:"\u4E0D\uFF0C\u770B\u8D77\u6765\u662F\u5BF9\u7684\u3002",explain:"\u4E0D\u5E78\u7684\u662F\uFF0C\u5C06\u4E00\u4E2A\u6A21\u578B\u4E0E\u4E00\u4E2A\u7528\u4E0D\u540CCheckpoint(\u68C0\u67E5\u70B9)\u8BAD\u7EC3\u7684Tokenizer(\u6807\u8BB0\u5668)\u8026\u5408\u5728\u5E76\u4E0D\u662F\u4E00\u4E2A\u597D\u4E3B\u610F\u3002\u6A21\u578B\u6CA1\u6709\u5728\u8FD9\u4E2A\u8FD9\u4E2ATokenizer(\u6807\u8BB0\u5668)\u4E0A\u8BAD\u7EC3\u6765\u7406\u89E3Tokenizer(\u6807\u8BB0\u5668)\u7684\u8F93\u51FA\uFF0C\u56E0\u6B64\u6A21\u578B\u8F93\u51FA(\u5982\u679C\u5B83\u53EF\u4EE5\u8FD0\u884C\u7684\u8BDD)\u4E0D\u4F1A\u6709\u4EFB\u4F55\u610F\u4E49\u3002"},{text:"Tokenizer(\u6807\u8BB0\u5668)\u548C\u6A21\u578B\u5E94\u8BE5\u6765\u81EA\u76F8\u540C\u7684Checkpoint(\u68C0\u67E5\u70B9)\u3002",explain:"\u5BF9\uFF01",correct:!0},{text:"\u7531\u4E8E\u6BCF\u4E2A\u8F93\u5165\u90FD\u662F\u4E00\u4E2ABatch\uFF0C\u56E0\u6B64\u53EF\u4EE5\u4F7F\u7528\u6807\u8BB0\u5668(Tokenizer)\u5BF9\u5176\u8FDB\u884C\u5E73\u79FB\u548C\u622A\u65AD\u6765\u6539\u5584\u8FD9\u6BB5\u4EE3\u7801\u3002",explain:"\u7684\u786E\uFF0C\u6BCF\u4E2A\u6A21\u578B\u90FD\u9700\u8981Batch\u7C7B\u578B\u7684\u8F93\u5165\u3002\u7136\u800C\uFF0C\u622A\u65AD\u6216\u586B\u5145\u8FD9\u4E2A\u5E8F\u5217\u5E76\u4E0D\u4E00\u5B9A\u6709\u610F\u4E49\uFF0C\u8FD9\u91CC\u53EA\u6709\u4E00\u53E5\u8BDD\uFF0C\u800C\u8FD9\u4E9B\u6280\u672F\u662F\u7528\u6765\u6279\u5904\u7406\u4E00\u4E2A\u53E5\u5B50\u5217\u8868\u7684\u3002"}]}}),{c(){f=i("h3"),h=i("a"),k=i("span"),A(m.$$.fragment),S=c(),y=i("span"),q=H("10.\u4E0B\u9762\u7684\u4EE3\u7801\u6709\u4EC0\u4E48\u9519\u8BEF\u5417\uFF1F"),E=c(),A(d.$$.fragment),g=c(),A(n.$$.fragment),this.h()},l(r){f=s(r,"H3",{class:!0});var x=p(f);h=s(x,"A",{id:!0,class:!0,href:!0});var P=p(h);k=s(P,"SPAN",{});var O=p(k);z(m.$$.fragment,O),O.forEach(t),P.forEach(t),S=$(x),y=s(x,"SPAN",{});var D=p(y);q=N(D,"10.\u4E0B\u9762\u7684\u4EE3\u7801\u6709\u4EC0\u4E48\u9519\u8BEF\u5417\uFF1F"),D.forEach(t),x.forEach(t),E=$(r),z(d.$$.fragment,r),g=$(r),z(n.$$.fragment,r),this.h()},h(){l(h,"id","10.\u4E0B\u9762\u7684\u4EE3\u7801\u6709\u4EC0\u4E48\u9519\u8BEF\u5417\uFF1F"),l(h,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(h,"href","#10.\u4E0B\u9762\u7684\u4EE3\u7801\u6709\u4EC0\u4E48\u9519\u8BEF\u5417\uFF1F"),l(f,"class","relative group")},m(r,x){u(r,f,x),o(f,h),o(h,k),b(m,k,null),o(f,S),o(f,y),o(y,q),u(r,E,x),b(d,r,x),u(r,g,x),b(n,r,x),v=!0},i(r){v||(w(m.$$.fragment,r),w(d.$$.fragment,r),w(n.$$.fragment,r),v=!0)},o(r){_(m.$$.fragment,r),_(d.$$.fragment,r),_(n.$$.fragment,r),v=!1},d(r){r&&t(f),T(m),r&&t(E),T(d,r),r&&t(g),T(n,r)}}}function mr(j){let f,h,k,m,S,y,q,E,d,g,n,v;return m=new M({}),d=new Et({props:{code:`from transformers import AutoTokenizer, AutoModel

tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")
model = AutoModel.from_pretrained("gpt2")

encoded = tokenizer("Hey!", return_tensors="pt")
result = model(**encoded)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModel

tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)
model = AutoModel.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)

encoded = tokenizer(<span class="hljs-string">&quot;Hey!&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
result = model(**encoded)`}}),n=new C({props:{choices:[{text:"\u4E0D\uFF0C\u770B\u8D77\u6765\u662F\u5BF9\u7684\u3002",explain:"\u4E0D\u5E78\u7684\u662F\uFF0C\u5C06\u4E00\u4E2A\u6A21\u578B\u4E0E\u4E00\u4E2A\u7528\u4E0D\u540CCheckpoint(\u68C0\u67E5\u70B9)\u8BAD\u7EC3\u7684Tokenizer(\u6807\u8BB0\u5668)\u8026\u5408\u5728\u5E76\u4E0D\u662F\u4E00\u4E2A\u597D\u4E3B\u610F\u3002\u6A21\u578B\u6CA1\u6709\u5728\u8FD9\u4E2A\u8FD9\u4E2ATokenizer(\u6807\u8BB0\u5668)\u4E0A\u8BAD\u7EC3\u6765\u7406\u89E3Tokenizer(\u6807\u8BB0\u5668)\u7684\u8F93\u51FA\uFF0C\u56E0\u6B64\u6A21\u578B\u8F93\u51FA(\u5982\u679C\u5B83\u53EF\u4EE5\u8FD0\u884C\u7684\u8BDD)\u4E0D\u4F1A\u6709\u4EFB\u4F55\u610F\u4E49\u3002"},{text:"Tokenizer(\u6807\u8BB0\u5668)\u548C\u6A21\u578B\u5E94\u8BE5\u6765\u81EA\u76F8\u540C\u7684Checkpoint(\u68C0\u67E5\u70B9)\u3002",explain:"\u5BF9\uFF01",correct:!0},{text:"\u7531\u4E8E\u6BCF\u4E2A\u8F93\u5165\u90FD\u662F\u4E00\u4E2ABatch\uFF0C\u56E0\u6B64\u53EF\u4EE5\u4F7F\u7528\u6807\u8BB0\u5668(Tokenizer)\u5BF9\u5176\u8FDB\u884C\u5E73\u79FB\u548C\u622A\u65AD\u6765\u6539\u5584\u8FD9\u6BB5\u4EE3\u7801\u3002",explain:"\u7684\u786E\uFF0C\u6BCF\u4E2A\u6A21\u578B\u90FD\u9700\u8981Batch\u7C7B\u578B\u7684\u8F93\u5165\u3002\u7136\u800C\uFF0C\u622A\u65AD\u6216\u586B\u5145\u8FD9\u4E2A\u5E8F\u5217\u5E76\u4E0D\u4E00\u5B9A\u6709\u610F\u4E49\uFF0C\u8FD9\u91CC\u53EA\u6709\u4E00\u53E5\u8BDD\uFF0C\u800C\u8FD9\u4E9B\u6280\u672F\u662F\u7528\u6765\u6279\u5904\u7406\u4E00\u4E2A\u53E5\u5B50\u5217\u8868\u7684\u3002"}]}}),{c(){f=i("h3"),h=i("a"),k=i("span"),A(m.$$.fragment),S=c(),y=i("span"),q=H("10.\u4E0B\u9762\u7684\u4EE3\u7801\u6709\u4EC0\u4E48\u9519\u8BEF\u5417\uFF1F"),E=c(),A(d.$$.fragment),g=c(),A(n.$$.fragment),this.h()},l(r){f=s(r,"H3",{class:!0});var x=p(f);h=s(x,"A",{id:!0,class:!0,href:!0});var P=p(h);k=s(P,"SPAN",{});var O=p(k);z(m.$$.fragment,O),O.forEach(t),P.forEach(t),S=$(x),y=s(x,"SPAN",{});var D=p(y);q=N(D,"10.\u4E0B\u9762\u7684\u4EE3\u7801\u6709\u4EC0\u4E48\u9519\u8BEF\u5417\uFF1F"),D.forEach(t),x.forEach(t),E=$(r),z(d.$$.fragment,r),g=$(r),z(n.$$.fragment,r),this.h()},h(){l(h,"id","10.\u4E0B\u9762\u7684\u4EE3\u7801\u6709\u4EC0\u4E48\u9519\u8BEF\u5417\uFF1F"),l(h,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(h,"href","#10.\u4E0B\u9762\u7684\u4EE3\u7801\u6709\u4EC0\u4E48\u9519\u8BEF\u5417\uFF1F"),l(f,"class","relative group")},m(r,x){u(r,f,x),o(f,h),o(h,k),b(m,k,null),o(f,S),o(f,y),o(y,q),u(r,E,x),b(d,r,x),u(r,g,x),b(n,r,x),v=!0},i(r){v||(w(m.$$.fragment,r),w(d.$$.fragment,r),w(n.$$.fragment,r),v=!0)},o(r){_(m.$$.fragment,r),_(d.$$.fragment,r),_(n.$$.fragment,r),v=!1},d(r){r&&t(f),T(m),r&&t(E),T(d,r),r&&t(g),T(n,r)}}}function dr(j){let f,h,k,m,S,y,q,E,d,g,n,v,r,x,P,O,D,ne,De,Q,V,Te,ae,ut,ye,ct,Oe,ie,Qe,U,X,Ee,se,$t,Se,mt,Ue,le,Ge,G,Y,qe,pe,dt,Pe,kt,Je,fe,Re,B,F,Ae,J,Z,He,he,vt,Ne,_t,We,ue,Ke,R,ee,Me,ce,wt,Ce,xt,Ve,$e,Xe,W,te,je,me,gt,Be,At,Ye,de,Ze,K,re,Fe,ke,zt,ve,bt,Ie,Tt,yt,et,_e,tt,we,rt,I,L,ze,ot;k=new hr({props:{fw:j[0]}}),E=new fr({props:{chapter:2,classNames:"absolute z-10 right-0 top-0"}}),r=new M({}),ne=new C({props:{choices:[{text:"\u9996\u5148\u662F\u6A21\u578B\u5B83\u5904\u7406\u6587\u672C\u5E76\u8FD4\u56DE\u539F\u59CB\u9884\u6D4B\u3002\u7136\u540E\uFF0C\u5206\u8BCD\u5668\u4F1A\u5BF9\u8FD9\u4E9B\u9884\u6D4B\u8FDB\u884C\u89E3\u91CA\uFF0C\u5E76\u5728\u9700\u8981\u65F6\u5C06\u5B83\u4EEC\u8F6C\u6362\u56DE\u6587\u672C",explain:"\u6A21\u578B\u4E0D\u80FD\u7406\u89E3\u6587\u672C\uFF01\u5FC5\u987B\u9996\u5148\u4F7F\u7528\u6807\u8BB0\u5668(Tokenizer)\u5C06\u6587\u672C\u8F6C\u6362\u4E3Aid\uFF0C\u4E4B\u540E\u624D\u53EF\u4EE5\u8F93\u5165\u7ED9\u6A21\u578B\u3002"},{text:"\u9996\u5148\u662F \u6807\u8BB0\u5668(Tokenizer)\uFF0C\u5B83\u5904\u7406\u6587\u672C\u5E76\u8FD4\u56DEid\u3002\u6A21\u578B\u6839\u636E\u8FD9\u4E9B id \u5E76\u8F93\u51FA\u9884\u6D4B\uFF0C\u53EF\u4EE5\u662F\u4E00\u4E9B\u6587\u672C\u3002",explain:"\u8BE5\u6A21\u578B\u7684\u9884\u6D4B\u7ED3\u679C\u662Fid\u800C\u4E0D\u662F\u6587\u672C\u3002\u4E3A\u4E86\u5C06\u9884\u6D4B\u8F6C\u6362\u56DE\u6587\u672C\uFF0C\u5FC5\u987B\u4F7F\u7528\u6807\u8BB0\u5668(Tokenizer)\uFF01"},{text:"\u6807\u8BB0\u5668(Tokenizer) \u5904\u7406\u6587\u672C\u5E76\u8FD4\u56DE id\u3002\u6A21\u578B\u5904\u7406\u8FD9\u4E9B id \u5E76\u8F93\u51FA\u4E00\u4E2A\u9884\u6D4B\u3002\u7136\u540E\u53EF\u4EE5\u518D\u6B21\u4F7F\u7528 \u6807\u8BB0\u5668(Tokenizer) \u5C06\u8FD9\u4E9B\u9884\u6D4B\u8F6C\u6362\u56DE\u67D0\u4E9B\u6587\u672C\u3002",explain:"\u6B63\u786E! \u6807\u8BB0\u5668(Tokenizer)\u53EF\u4EE5\u7528\u4E8Eid\u4E0E\u6587\u672C\u7684\u76F8\u4E92\u8F6C\u6362\u3002",correct:!0}]}}),ae=new M({}),ie=new C({props:{choices:[{text:"2\u4E2A\u7EF4\u5EA6\uFF0C\u5206\u522B\u662F: \u5E8F\u5217\u957F\u5EA6(Sequence Length)\u548C\u6279\u6B21\u5927\u5C0F(Batch Size)",explain:"\u9519! \u8BE5\u6A21\u578B\u7684\u5F20\u91CF\u8F93\u51FA\u8FD8\u5177\u6709\u7B2C\u4E09\u4E2A\u7EF4\u5EA6: \u9690\u85CF\u5C42\u5927\u5C0F(Hidden Size)\u3002"},{text:"2\u4E2A\u7EF4\u5EA6\uFF0C\u5206\u522B\u662F: \u5E8F\u5217\u957F\u5EA6(Sequence Length)\u548C\u9690\u85CF\u5C42\u5927\u5C0F(Hidden Size)",explain:"\u9519! \u6240\u6709Transformer\u6A21\u578B\u90FD\u6279\u91CF\u8FDB\u884C\u8BA1\u7B97\uFF0C\u5373\u4F7F\u662F\u5355\u4E2A\u5E8F\u5217; \u90A3\u4E48\u6279\u6B21\u5927\u5C0F(Batch Size)\u4E3A1\uFF01"},{text:"3\u4E2A\u7EF4\u5EA6\uFF0C\u5206\u522B\u662F: \u5E8F\u5217\u957F\u5EA6(Sequence Length)\u3001\u6279\u6B21\u5927\u5C0F(Batch Size)\u548C\u9690\u85CF\u5C42\u5927\u5C0F(Hidden Size)",explain:"\u6B63\u786E\uFF01",correct:!0}]}}),se=new M({}),le=new C({props:{choices:[{text:"WordPiece",explain:"\u662F\u7684\uFF0C\u8FD9\u662F\u4E00\u4E2ASubword \u6807\u8BB0\u5316(Tokenization)\u7684\u4F8B\u5B50\uFF01",correct:!0},{text:"\u57FA\u4E8E\u5355\u4E2A\u5B57\u7B26\u7684\u6807\u8BB0(Tokenization)",explain:"\u57FA\u4E8E\u5B57\u7B26\u7684\u6807\u8BB0(Tokenization)\u4E0D\u662F\u4E00\u79CDSubword \u6807\u8BB0\u5316(Tokenization)\u3002"},{text:"\u57FA\u4E8E\u7A7A\u683C\u548C\u6807\u70B9\u7B26\u53F7\u7684\u5206\u5272",explain:"\u8FD9\u662F\u4E00\u79CD\u57FA\u4E8E\u5355\u8BCD\u6807\u8BB0\u5316(Tokenization)\uFF01"},{text:"BPE(Byte Pair Encoding)",explain:"\u662F\u7684\uFF0C\u8FD9\u662F\u4E00\u4E2ASubword \u6807\u8BB0\u5316(Tokenization)\u7684\u4F8B\u5B50\uFF01",correct:!0},{text:"Unigram",explain:"\u662F\u7684\uFF0C\u8FD9\u662F\u4E00\u4E2ASubword \u6807\u8BB0\u5316(Tokenization)\u7684\u4F8B\u5B50\uFF01",correct:!0},{text:"\u4EE5\u4E0A\u90FD\u4E0D\u662F",explain:"\u4E0D\u5BF9\uFF01"}]}}),pe=new M({}),fe=new C({props:{choices:[{text:"\u539F\u59CBTransformer\u7F51\u7EDC\u7684\u4E00\u79CD\u7EC4\u4EF6\uFF0C\u5C06\u5F20\u91CF(Tensors)\u91CD\u5B9A\u5411\u5230\u5B83\u4EEC\u7684\u6B63\u786E\u5C42",explain:"\u4E0D\u5BF9! \u6CA1\u6709\u8FD9\u6837\u7684\u7EC4\u4EF6\u3002"},{text:"\u4E5F\u79F0\u4E3A\u81EA\u6CE8\u610F\u529B(self-attention)\u673A\u5236\uFF0C\u5B83\u6839\u636E\u5E8F\u5217\u4E2D\u7684\u5176\u4ED6\u6807\u8BB0(Token)\u6765\u8C03\u6574\u4E00\u4E2A\u6807\u8BB0(Token)",explain:"\u4E0D\u5BF9\uFF01 \u81EA\u6CE8\u610F\u529B\u5C42\u786E\u5B9E\u5305\u542B\u6CE8\u610F\u529B\u201CHead\u201D\u5C42\uFF0C\u4F46\u8FD9\u4E9B\u4E0D\u662F\u6A21\u578B\u7684head\u5C42\u3002"},{text:"\u4E00\u4E2A\u9644\u52A0\u7EC4\u4EF6\uFF0C\u901A\u5E38\u7531\u4E00\u4E2A\u6216\u51E0\u4E2A\u5C42\u7EC4\u6210\uFF0C\u7528\u4E8E\u5C06Transformer\u7684\u9884\u6D4B\u8F6C\u6362\u4E3A\u7279\u5B9A\u4E8E\u4EFB\u52A1\u7684\u8F93\u51FA",explain:"\u6CA1\u9519\u3002\u5B83\u7684\u5168\u540D\u662FAdaptation Heads\uFF0C\u4E5F\u88AB\u7B80\u5355\u5730\u79F0\u4E3A\u6A21\u578B\u7684\u5934\u90E8\uFF0C\u5728\u4E0D\u540C\u7684\u4EFB\u52A1\u4E0A\u6709\u4E0D\u540C\u7684\u5F62\u5F0F: \u8BED\u8A00\u6A21\u578BHeads\uFF0C\u95EE\u9898\u56DE\u7B54Heads\uFF0C\u5E8F\u5217\u5206\u7C7BHeads..\u3002",correct:!0}]}});const St=[cr,ur],xe=[];function qt(e,a){return e[0]==="pt"?0:1}B=qt(j),F=xe[B]=St[B](j),he=new M({}),ue=new C({props:{choices:[{text:"\u622A\u77ED",explain:"\u662F\u7684\uFF0C\u622A\u65AD\u662F\u4E00\u4E2A\u6B63\u786E\u7684\u65B9\u5F0F\uFF0C\u53EF\u4EE5\u5C06\u4ED6\u4EEC\u8F6C\u5316\u4E3A\u4E00\u4E2A\u56FA\u5B9A\u957F\u5EA6\u7684\u77E9\u5F62\u5E8F\u5217\u3002\u8FD9\u662F\u552F\u4E00\u7684\u4E00\u4E2A\u7B54\u6848\u5417\uFF1F",correct:!0},{text:"\u8FD4\u56DETensors",explain:"\u867D\u7136\u5176\u4ED6\u6280\u672F\u5141\u8BB8\u8FD4\u56DE\u77E9\u5F62\u5F20\u91CF\uFF0C\u4F46\u5728\u6279\u5904\u7406\u5E8F\u5217\u65F6\u4E0D\u53EF\u4EE5\u76F4\u63A5\u8FD4\u56DE\u957F\u5EA6\u4E0D\u4E00\u81F4\u7684Tensors\u3002(\u5E8F\u5217\u5FC5\u987B\u662F\u56FA\u5B9A\u957F\u5EA6)"},{text:"\u586B\u5145",explain:"\u662F\u7684\uFF0C\u586B\u5145\u662F\u4E00\u4E2A\u6B63\u786E\u7684\u65B9\u5F0F\uFF0C\u53EF\u4EE5\u5C06\u4ED6\u4EEC\u8F6C\u5316\u4E3A\u4E00\u4E2A\u56FA\u5B9A\u957F\u5EA6\u7684\u77E9\u5F62\u5E8F\u5217\u3002\u8FD9\u662F\u552F\u4E00\u7684\u4E00\u4E2A\u7B54\u6848\u5417\uFF1F",correct:!0},{text:"\u6CE8\u610F\u529B\u906E\u853D(Attention masking)",explain:"\u5F53\u7136\uFF01\u5F53\u5904\u7406\u4E0D\u540C\u957F\u5EA6\u7684\u5E8F\u5217\u65F6\uFF0C\u6CE8\u610F\u529B\u906E\u853D\u662F\u6700\u91CD\u8981\u7684\u3002\u7136\u800C\uFF0C\u8FD9\u5E76\u4E0D\u662F\u552F\u4E00\u9700\u8981\u8FDB\u884C\u7684\u5904\u7406\u3002",correct:!0}]}}),ce=new M({}),$e=new C({props:{choices:[{text:"\u5B83\u8F6F\u5316\u4E86logits\u8F93\u51FA\uFF0C\u4F7F\u7ED3\u679C\u66F4\u53EF\u9760\u3002",explain:"\u4E0D\uFF0C SoftMax\u6FC0\u6D3B\u51FD\u6570\u4E0D\u4F1A\u5F71\u54CD\u7ED3\u679C\u7684\u53EF\u9760\u6027\u3002"},{text:"\u5B83\u9650\u5B9A\u4E86\u4E0A\u4E0B\u754C\uFF0C\u4F7F\u6A21\u578B\u7684\u8F93\u51FA\u7ED3\u679C\u53EF\u4EE5\u88AB\u89E3\u91CA\u3002",explain:"\u6B63\u786E\uFF01\u7ED3\u679C\u503C\u88AB\u538B\u7F29\u5230\u4E860\u548C1\u4E4B\u95F4\u3002\u4E0D\u8FC7\uFF0C\u8FD9\u5E76\u4E0D\u662F\u6211\u4EEC\u4F7F\u7528SoftMax\u6FC0\u6D3B\u51FD\u6570\u7684\u552F\u4E00\u539F\u56E0\u3002",correct:!0},{text:"\u8F93\u51FA\u7684\u548C\u662F1\uFF0C\u4ECE\u800C\u4EA7\u751F\u4E00\u4E2A\u53EF\u80FD\u7684\u6982\u7387\u89E3\u91CA\u3002",explain:"\u6CA1\u9519\uFF0C\u4F46\u8FD9\u5E76\u4E0D\u662F\u6211\u4EEC\u4F7F\u7528SoftMax\u6FC0\u6D3B\u51FD\u6570\u7684\u552F\u4E00\u539F\u56E0\u3002",correct:!0}]}}),me=new M({}),de=new C({props:{choices:[{text:"<code>\u7F16\u7801</code> \uFF0C\u56E0\u4E3A\u5B83\u53EF\u4EE5\u5C06\u6587\u672C\u7F16\u7801\u4E3Aid\uFF0C\u5C06\u9884\u6D4B\u7684id\u89E3\u7801\u4E3A\u6587\u672C",explain:"\u9519! \u867D\u7136 <code>\u7F16\u7801</code> \u65B9\u6CD5\u786E\u5B9E\u5B58\u5728\u4E8E\u6807\u8BB0\u5668\u4E2D\uFF0C\u4F46\u662F\u5B83\u4E0D\u5B58\u5728\u4E8E\u6A21\u578B\u4E2D\u3002"},{text:"\u76F4\u63A5\u8C03\u7528\u6807\u8BB0\u5668(Tokenizer)\u5BF9\u8C61\u3002",explain:"\u5B8C\u5168\u6B63\u786E\uFF01\u6807\u8BB0\u5316\u5668(Tokenizer) \u7684 <code>__call__</code>\u65B9\u6CD5\u662F\u4E00\u4E2A\u975E\u5E38\u5F3A\u5927\u7684\u65B9\u6CD5\uFF0C\u53EF\u4EE5\u5904\u7406\u51E0\u4E4E\u4EFB\u4F55\u4E8B\u60C5\u3002\u5B83\u4E5F\u662F\u4ECE\u6A21\u578B\u4E2D\u83B7\u53D6\u9884\u6D4B\u7684\u65B9\u6CD5\u3002",correct:!0},{text:"<code>pad</code>(\u586B\u5145)",explain:"\u9519! <code>pad</code>(\u586B\u5145)\u975E\u5E38\u6709\u7528\uFF0C\u4F46\u5B83\u53EA\u662F\u6807\u8BB0\u5668(Tokenizer) API\u7684\u4E00\u90E8\u5206\u3002"},{text:"<code>tokenize</code>(\u6807\u8BB0)",explain:"\u53EF\u4EE5\u8BF4\uFF0C<code>tokenize</code>(\u6807\u8BB0)\u65B9\u6CD5\u662F\u6700\u6709\u7528\u7684\u65B9\u6CD5\u4E4B\u4E00\uFF0C\u4F46\u5B83\u4E0D\u662F\u6807\u8BB0\u5668(Tokenizer) API\u7684\u6838\u5FC3\u65B9\u6CD5\u3002"}]}}),ke=new M({}),_e=new Et({props:{code:`from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")
result = tokenizer.tokenize("Hello!")`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)
result = tokenizer.tokenize(<span class="hljs-string">&quot;Hello!&quot;</span>)`}}),we=new C({props:{choices:[{text:"\u5B57\u7B26\u4E32\u5217\u8868\uFF0C\u6BCF\u4E2A\u5B57\u7B26\u4E32\u90FD\u662F\u4E00\u4E2A\u6807\u8BB0(Token)",explain:"\u6B63\u786E! \u628A\u8FD9\u4E2A\u8F6C\u6362\u6210id\u540E\uFF0C\u5C31\u53EF\u4EE5\u4F20\u8F93\u7ED9\u6A21\u578B\u4E86\uFF01",correct:!0},{text:"\u4E00\u4E2AID\u7684\u5217\u8868",explain:"\u4E0D\u6B63\u786E; \u8FD9\u5C31\u662F <code>__call__</code> \u6216 <code>convert_tokens_to_ids</code>\u65B9\u6CD5\u7684\u4F5C\u7528\uFF01"},{text:"\u5305\u542B\u6240\u6709\u6807\u8BB0(Token)\u7684\u5B57\u7B26\u4E32",explain:"\u8FD9\u5C06\u662F\u6B21\u4F18\u7684\uFF0C\u56E0\u4E3ATokenizer\u4F1A\u5C06\u5B57\u7B26\u4E32\u62C6\u5206\u4E3A\u591A\u4E2A\u6807\u8BB0\u7684\u5217\u8868\u3002"}]}});const Pt=[mr,$r],ge=[];function Ht(e,a){return e[0]==="pt"?0:1}return I=Ht(j),L=ge[I]=Pt[I](j),{c(){f=i("meta"),h=c(),A(k.$$.fragment),m=c(),S=i("h1"),y=H("\u7AE0\u672B\u5C0F\u6D4B\u8BD5"),q=c(),A(E.$$.fragment),d=c(),g=i("h3"),n=i("a"),v=i("span"),A(r.$$.fragment),x=c(),P=i("span"),O=H("1. \u8BED\u8A00\u5EFA\u6A21 Pipeline \u7684\u987A\u5E8F\u662F\u4EC0\u4E48\uFF1F"),D=c(),A(ne.$$.fragment),De=c(),Q=i("h3"),V=i("a"),Te=i("span"),A(ae.$$.fragment),ut=c(),ye=i("span"),ct=H("2. Transformer\u6A21\u578B\u7684\u8F93\u51FA\u6709\u591A\u5C11\u4E2A\u7EF4\u5EA6\uFF0C\u6BCF\u4E2A\u7EF4\u5EA6\u5206\u522B\u662F\u4EC0\u4E48\uFF1F"),Oe=c(),A(ie.$$.fragment),Qe=c(),U=i("h3"),X=i("a"),Ee=i("span"),A(se.$$.fragment),$t=c(),Se=i("span"),mt=H("3.\u4E0B\u5217\u54EA\u4E00\u4E2A\u662FSubword\u6807\u8BB0(Tokenization)\u7684\u4F8B\u5B50\uFF08\u4ECE\u5206\u8BCD\u7684\u9897\u7C92\u5EA6\u6765\u5212\u5206\uFF09\uFF1F"),Ue=c(),A(le.$$.fragment),Ge=c(),G=i("h3"),Y=i("a"),qe=i("span"),A(pe.$$.fragment),dt=c(),Pe=i("span"),kt=H("4.\u4EC0\u4E48\u662F\u6A21\u578B\u7684Head\u5C42\uFF1F"),Je=c(),A(fe.$$.fragment),Re=c(),F.c(),Ae=c(),J=i("h3"),Z=i("a"),He=i("span"),A(he.$$.fragment),vt=c(),Ne=i("span"),_t=H("6.\u5F53\u5C06\u4E0D\u540C\u957F\u5EA6\u7684\u5E8F\u5217\u6279\u5904\u7406\u5728\u4E00\u8D77\u65F6\uFF0C\u9700\u8981\u8FDB\u884C\u54EA\u4E9B\u5904\u7406\uFF1F"),We=c(),A(ue.$$.fragment),Ke=c(),R=i("h3"),ee=i("a"),Me=i("span"),A(ce.$$.fragment),wt=c(),Ce=i("span"),xt=H("7.\u5C06 SoftMax\u6FC0\u6D3B\u51FD\u6570\u5E94\u7528\u4E8E\u5E8F\u5217\u5206\u7C7B(Sequence Classification)\u6A21\u578B\u7684 logits \u8F93\u51FA\u6709\u4EC0\u4E48\u610F\u4E49\uFF1F"),Ve=c(),A($e.$$.fragment),Xe=c(),W=i("h3"),te=i("a"),je=i("span"),A(me.$$.fragment),gt=c(),Be=i("span"),At=H("8.\u5927\u591A\u6570\u6807\u8BB0\u5668(Tokenizer)\u7684API\u4EE5\u4EC0\u4E48\u65B9\u6CD5\u4E3A\u6838\u5FC3\uFF1F"),Ye=c(),A(de.$$.fragment),Ze=c(),K=i("h3"),re=i("a"),Fe=i("span"),A(ke.$$.fragment),zt=c(),ve=i("span"),bt=H("9.\u8FD9\u4E2A\u4EE3\u7801\u793A\u4F8B\u4E2D\u7684"),Ie=i("code"),Tt=H("result"),yt=H("\u53D8\u91CF\u5305\u542B\u4EC0\u4E48\uFF1F"),et=c(),A(_e.$$.fragment),tt=c(),A(we.$$.fragment),rt=c(),L.c(),ze=rr(),this.h()},l(e){const a=lr('[data-svelte="svelte-1phssyn"]',document.head);f=s(a,"META",{name:!0,content:!0}),a.forEach(t),h=$(e),z(k.$$.fragment,e),m=$(e),S=s(e,"H1",{id:!0});var Le=p(S);y=N(Le,"\u7AE0\u672B\u5C0F\u6D4B\u8BD5"),Le.forEach(t),q=$(e),z(E.$$.fragment,e),d=$(e),g=s(e,"H3",{class:!0});var oe=p(g);n=s(oe,"A",{id:!0,class:!0,href:!0});var be=p(n);v=s(be,"SPAN",{});var Nt=p(v);z(r.$$.fragment,Nt),Nt.forEach(t),be.forEach(t),x=$(oe),P=s(oe,"SPAN",{});var Mt=p(P);O=N(Mt,"1. \u8BED\u8A00\u5EFA\u6A21 Pipeline \u7684\u987A\u5E8F\u662F\u4EC0\u4E48\uFF1F"),Mt.forEach(t),oe.forEach(t),D=$(e),z(ne.$$.fragment,e),De=$(e),Q=s(e,"H3",{class:!0});var nt=p(Q);V=s(nt,"A",{id:!0,class:!0,href:!0});var Ct=p(V);Te=s(Ct,"SPAN",{});var jt=p(Te);z(ae.$$.fragment,jt),jt.forEach(t),Ct.forEach(t),ut=$(nt),ye=s(nt,"SPAN",{});var Bt=p(ye);ct=N(Bt,"2. Transformer\u6A21\u578B\u7684\u8F93\u51FA\u6709\u591A\u5C11\u4E2A\u7EF4\u5EA6\uFF0C\u6BCF\u4E2A\u7EF4\u5EA6\u5206\u522B\u662F\u4EC0\u4E48\uFF1F"),Bt.forEach(t),nt.forEach(t),Oe=$(e),z(ie.$$.fragment,e),Qe=$(e),U=s(e,"H3",{class:!0});var at=p(U);X=s(at,"A",{id:!0,class:!0,href:!0});var Ft=p(X);Ee=s(Ft,"SPAN",{});var It=p(Ee);z(se.$$.fragment,It),It.forEach(t),Ft.forEach(t),$t=$(at),Se=s(at,"SPAN",{});var Lt=p(Se);mt=N(Lt,"3.\u4E0B\u5217\u54EA\u4E00\u4E2A\u662FSubword\u6807\u8BB0(Tokenization)\u7684\u4F8B\u5B50\uFF08\u4ECE\u5206\u8BCD\u7684\u9897\u7C92\u5EA6\u6765\u5212\u5206\uFF09\uFF1F"),Lt.forEach(t),at.forEach(t),Ue=$(e),z(le.$$.fragment,e),Ge=$(e),G=s(e,"H3",{class:!0});var it=p(G);Y=s(it,"A",{id:!0,class:!0,href:!0});var Dt=p(Y);qe=s(Dt,"SPAN",{});var Ot=p(qe);z(pe.$$.fragment,Ot),Ot.forEach(t),Dt.forEach(t),dt=$(it),Pe=s(it,"SPAN",{});var Qt=p(Pe);kt=N(Qt,"4.\u4EC0\u4E48\u662F\u6A21\u578B\u7684Head\u5C42\uFF1F"),Qt.forEach(t),it.forEach(t),Je=$(e),z(fe.$$.fragment,e),Re=$(e),F.l(e),Ae=$(e),J=s(e,"H3",{class:!0});var st=p(J);Z=s(st,"A",{id:!0,class:!0,href:!0});var Ut=p(Z);He=s(Ut,"SPAN",{});var Gt=p(He);z(he.$$.fragment,Gt),Gt.forEach(t),Ut.forEach(t),vt=$(st),Ne=s(st,"SPAN",{});var Jt=p(Ne);_t=N(Jt,"6.\u5F53\u5C06\u4E0D\u540C\u957F\u5EA6\u7684\u5E8F\u5217\u6279\u5904\u7406\u5728\u4E00\u8D77\u65F6\uFF0C\u9700\u8981\u8FDB\u884C\u54EA\u4E9B\u5904\u7406\uFF1F"),Jt.forEach(t),st.forEach(t),We=$(e),z(ue.$$.fragment,e),Ke=$(e),R=s(e,"H3",{class:!0});var lt=p(R);ee=s(lt,"A",{id:!0,class:!0,href:!0});var Rt=p(ee);Me=s(Rt,"SPAN",{});var Wt=p(Me);z(ce.$$.fragment,Wt),Wt.forEach(t),Rt.forEach(t),wt=$(lt),Ce=s(lt,"SPAN",{});var Kt=p(Ce);xt=N(Kt,"7.\u5C06 SoftMax\u6FC0\u6D3B\u51FD\u6570\u5E94\u7528\u4E8E\u5E8F\u5217\u5206\u7C7B(Sequence Classification)\u6A21\u578B\u7684 logits \u8F93\u51FA\u6709\u4EC0\u4E48\u610F\u4E49\uFF1F"),Kt.forEach(t),lt.forEach(t),Ve=$(e),z($e.$$.fragment,e),Xe=$(e),W=s(e,"H3",{class:!0});var pt=p(W);te=s(pt,"A",{id:!0,class:!0,href:!0});var Vt=p(te);je=s(Vt,"SPAN",{});var Xt=p(je);z(me.$$.fragment,Xt),Xt.forEach(t),Vt.forEach(t),gt=$(pt),Be=s(pt,"SPAN",{});var Yt=p(Be);At=N(Yt,"8.\u5927\u591A\u6570\u6807\u8BB0\u5668(Tokenizer)\u7684API\u4EE5\u4EC0\u4E48\u65B9\u6CD5\u4E3A\u6838\u5FC3\uFF1F"),Yt.forEach(t),pt.forEach(t),Ye=$(e),z(de.$$.fragment,e),Ze=$(e),K=s(e,"H3",{class:!0});var ft=p(K);re=s(ft,"A",{id:!0,class:!0,href:!0});var Zt=p(re);Fe=s(Zt,"SPAN",{});var er=p(Fe);z(ke.$$.fragment,er),er.forEach(t),Zt.forEach(t),zt=$(ft),ve=s(ft,"SPAN",{});var ht=p(ve);bt=N(ht,"9.\u8FD9\u4E2A\u4EE3\u7801\u793A\u4F8B\u4E2D\u7684"),Ie=s(ht,"CODE",{});var tr=p(Ie);Tt=N(tr,"result"),tr.forEach(t),yt=N(ht,"\u53D8\u91CF\u5305\u542B\u4EC0\u4E48\uFF1F"),ht.forEach(t),ft.forEach(t),et=$(e),z(_e.$$.fragment,e),tt=$(e),z(we.$$.fragment,e),rt=$(e),L.l(e),ze=rr(),this.h()},h(){l(f,"name","hf:doc:metadata"),l(f,"content",JSON.stringify(kr)),l(S,"id",""),l(n,"id","1.-\u8BED\u8A00\u5EFA\u6A21-pipeline-\u7684\u987A\u5E8F\u662F\u4EC0\u4E48\uFF1F"),l(n,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(n,"href","#1.-\u8BED\u8A00\u5EFA\u6A21-pipeline-\u7684\u987A\u5E8F\u662F\u4EC0\u4E48\uFF1F"),l(g,"class","relative group"),l(V,"id","2.-transformer\u6A21\u578B\u7684\u8F93\u51FA\u6709\u591A\u5C11\u4E2A\u7EF4\u5EA6\uFF0C\u6BCF\u4E2A\u7EF4\u5EA6\u5206\u522B\u662F\u4EC0\u4E48\uFF1F"),l(V,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(V,"href","#2.-transformer\u6A21\u578B\u7684\u8F93\u51FA\u6709\u591A\u5C11\u4E2A\u7EF4\u5EA6\uFF0C\u6BCF\u4E2A\u7EF4\u5EA6\u5206\u522B\u662F\u4EC0\u4E48\uFF1F"),l(Q,"class","relative group"),l(X,"id","3.\u4E0B\u5217\u54EA\u4E00\u4E2A\u662Fsubword\u6807\u8BB0(tokenization)\u7684\u4F8B\u5B50\uFF08\u4ECE\u5206\u8BCD\u7684\u9897\u7C92\u5EA6\u6765\u5212\u5206\uFF09\uFF1F"),l(X,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(X,"href","#3.\u4E0B\u5217\u54EA\u4E00\u4E2A\u662Fsubword\u6807\u8BB0(tokenization)\u7684\u4F8B\u5B50\uFF08\u4ECE\u5206\u8BCD\u7684\u9897\u7C92\u5EA6\u6765\u5212\u5206\uFF09\uFF1F"),l(U,"class","relative group"),l(Y,"id","4.\u4EC0\u4E48\u662F\u6A21\u578B\u7684head\u5C42\uFF1F"),l(Y,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Y,"href","#4.\u4EC0\u4E48\u662F\u6A21\u578B\u7684head\u5C42\uFF1F"),l(G,"class","relative group"),l(Z,"id","6.\u5F53\u5C06\u4E0D\u540C\u957F\u5EA6\u7684\u5E8F\u5217\u6279\u5904\u7406\u5728\u4E00\u8D77\u65F6\uFF0C\u9700\u8981\u8FDB\u884C\u54EA\u4E9B\u5904\u7406\uFF1F"),l(Z,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Z,"href","#6.\u5F53\u5C06\u4E0D\u540C\u957F\u5EA6\u7684\u5E8F\u5217\u6279\u5904\u7406\u5728\u4E00\u8D77\u65F6\uFF0C\u9700\u8981\u8FDB\u884C\u54EA\u4E9B\u5904\u7406\uFF1F"),l(J,"class","relative group"),l(ee,"id","7.\u5C06-softmax\u6FC0\u6D3B\u51FD\u6570\u5E94\u7528\u4E8E\u5E8F\u5217\u5206\u7C7B(sequence-classification)\u6A21\u578B\u7684-logits-\u8F93\u51FA\u6709\u4EC0\u4E48\u610F\u4E49\uFF1F"),l(ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ee,"href","#7.\u5C06-softmax\u6FC0\u6D3B\u51FD\u6570\u5E94\u7528\u4E8E\u5E8F\u5217\u5206\u7C7B(sequence-classification)\u6A21\u578B\u7684-logits-\u8F93\u51FA\u6709\u4EC0\u4E48\u610F\u4E49\uFF1F"),l(R,"class","relative group"),l(te,"id","8.\u5927\u591A\u6570\u6807\u8BB0\u5668(tokenizer)\u7684api\u4EE5\u4EC0\u4E48\u65B9\u6CD5\u4E3A\u6838\u5FC3\uFF1F"),l(te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(te,"href","#8.\u5927\u591A\u6570\u6807\u8BB0\u5668(tokenizer)\u7684api\u4EE5\u4EC0\u4E48\u65B9\u6CD5\u4E3A\u6838\u5FC3\uFF1F"),l(W,"class","relative group"),l(re,"id","9.\u8FD9\u4E2A\u4EE3\u7801\u793A\u4F8B\u4E2D\u7684<code>result</code>\u53D8\u91CF\u5305\u542B\u4EC0\u4E48\uFF1F"),l(re,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(re,"href","#9.\u8FD9\u4E2A\u4EE3\u7801\u793A\u4F8B\u4E2D\u7684<code>result</code>\u53D8\u91CF\u5305\u542B\u4EC0\u4E48\uFF1F"),l(K,"class","relative group")},m(e,a){o(document.head,f),u(e,h,a),b(k,e,a),u(e,m,a),u(e,S,a),o(S,y),u(e,q,a),b(E,e,a),u(e,d,a),u(e,g,a),o(g,n),o(n,v),b(r,v,null),o(g,x),o(g,P),o(P,O),u(e,D,a),b(ne,e,a),u(e,De,a),u(e,Q,a),o(Q,V),o(V,Te),b(ae,Te,null),o(Q,ut),o(Q,ye),o(ye,ct),u(e,Oe,a),b(ie,e,a),u(e,Qe,a),u(e,U,a),o(U,X),o(X,Ee),b(se,Ee,null),o(U,$t),o(U,Se),o(Se,mt),u(e,Ue,a),b(le,e,a),u(e,Ge,a),u(e,G,a),o(G,Y),o(Y,qe),b(pe,qe,null),o(G,dt),o(G,Pe),o(Pe,kt),u(e,Je,a),b(fe,e,a),u(e,Re,a),xe[B].m(e,a),u(e,Ae,a),u(e,J,a),o(J,Z),o(Z,He),b(he,He,null),o(J,vt),o(J,Ne),o(Ne,_t),u(e,We,a),b(ue,e,a),u(e,Ke,a),u(e,R,a),o(R,ee),o(ee,Me),b(ce,Me,null),o(R,wt),o(R,Ce),o(Ce,xt),u(e,Ve,a),b($e,e,a),u(e,Xe,a),u(e,W,a),o(W,te),o(te,je),b(me,je,null),o(W,gt),o(W,Be),o(Be,At),u(e,Ye,a),b(de,e,a),u(e,Ze,a),u(e,K,a),o(K,re),o(re,Fe),b(ke,Fe,null),o(K,zt),o(K,ve),o(ve,bt),o(ve,Ie),o(Ie,Tt),o(ve,yt),u(e,et,a),b(_e,e,a),u(e,tt,a),b(we,e,a),u(e,rt,a),ge[I].m(e,a),u(e,ze,a),ot=!0},p(e,[a]){const Le={};a&1&&(Le.fw=e[0]),k.$set(Le);let oe=B;B=qt(e),B!==oe&&(nr(),_(xe[oe],1,1,()=>{xe[oe]=null}),or(),F=xe[B],F||(F=xe[B]=St[B](e),F.c()),w(F,1),F.m(Ae.parentNode,Ae));let be=I;I=Ht(e),I!==be&&(nr(),_(ge[be],1,1,()=>{ge[be]=null}),or(),L=ge[I],L||(L=ge[I]=Pt[I](e),L.c()),w(L,1),L.m(ze.parentNode,ze))},i(e){ot||(w(k.$$.fragment,e),w(E.$$.fragment,e),w(r.$$.fragment,e),w(ne.$$.fragment,e),w(ae.$$.fragment,e),w(ie.$$.fragment,e),w(se.$$.fragment,e),w(le.$$.fragment,e),w(pe.$$.fragment,e),w(fe.$$.fragment,e),w(F),w(he.$$.fragment,e),w(ue.$$.fragment,e),w(ce.$$.fragment,e),w($e.$$.fragment,e),w(me.$$.fragment,e),w(de.$$.fragment,e),w(ke.$$.fragment,e),w(_e.$$.fragment,e),w(we.$$.fragment,e),w(L),ot=!0)},o(e){_(k.$$.fragment,e),_(E.$$.fragment,e),_(r.$$.fragment,e),_(ne.$$.fragment,e),_(ae.$$.fragment,e),_(ie.$$.fragment,e),_(se.$$.fragment,e),_(le.$$.fragment,e),_(pe.$$.fragment,e),_(fe.$$.fragment,e),_(F),_(he.$$.fragment,e),_(ue.$$.fragment,e),_(ce.$$.fragment,e),_($e.$$.fragment,e),_(me.$$.fragment,e),_(de.$$.fragment,e),_(ke.$$.fragment,e),_(_e.$$.fragment,e),_(we.$$.fragment,e),_(L),ot=!1},d(e){t(f),e&&t(h),T(k,e),e&&t(m),e&&t(S),e&&t(q),T(E,e),e&&t(d),e&&t(g),T(r),e&&t(D),T(ne,e),e&&t(De),e&&t(Q),T(ae),e&&t(Oe),T(ie,e),e&&t(Qe),e&&t(U),T(se),e&&t(Ue),T(le,e),e&&t(Ge),e&&t(G),T(pe),e&&t(Je),T(fe,e),e&&t(Re),xe[B].d(e),e&&t(Ae),e&&t(J),T(he),e&&t(We),T(ue,e),e&&t(Ke),e&&t(R),T(ce),e&&t(Ve),T($e,e),e&&t(Xe),e&&t(W),T(me),e&&t(Ye),T(de,e),e&&t(Ze),e&&t(K),T(ke),e&&t(et),T(_e,e),e&&t(tt),T(we,e),e&&t(rt),ge[I].d(e),e&&t(ze)}}}const kr={local:"",title:"\u7AE0\u672B\u5C0F\u6D4B\u8BD5"};function vr(j,f,h){let k="pt";return pr(()=>{const m=new URLSearchParams(window.location.search);h(0,k=m.get("fw")||"pt")}),[k]}class Tr extends ar{constructor(f){super();ir(this,f,vr,dr,sr,{})}}export{Tr as default,kr as metadata};
