import{S as fe,i as pe,s as me,F as ye,e as g,c as _,a as f,d as n,b as u,g as $,H as Te,I as qe,J as Me,q as E,o as C,N as Dl,L as Z,O as B,P as V,G as s,k as A,t as d,m as y,h,f as gi,j as _i,w as P,x as O,y as D,Q as Pe,B as I,R as Au,T as yu,D as Tu,U as wu,v as hs,V as gs,n as ke,p as ze,W as ku,l as Ze,X as zu,K as Eu,Y as qu,Z as ds,M as Mu}from"../chunks/vendor-hf-doc-builder.js";import{I as qt}from"../chunks/IconCopyLink-hf-doc-builder.js";function Su(i){let e,a;const t=i[3].default,l=ye(t,i,i[2],null);return{c(){e=g("div"),l&&l.c(),this.h()},l(r){e=_(r,"DIV",{class:!0});var c=f(e);l&&l.l(c),c.forEach(n),this.h()},h(){u(e,"class","course-tip "+(i[0]==="orange"?"course-tip-orange":"")+" bg-gradient-to-br dark:bg-gradient-to-r before:border-"+i[0]+"-500 dark:before:border-"+i[0]+"-800 from-"+i[0]+"-50 dark:from-gray-900 to-white dark:to-gray-950 border border-"+i[0]+"-50 text-"+i[0]+"-700 dark:text-gray-400")},m(r,c){$(r,e,c),l&&l.m(e,null),a=!0},p(r,[c]){l&&l.p&&(!a||c&4)&&Te(l,t,r,r[2],a?Me(t,r[2],c,null):qe(r[2]),null)},i(r){a||(E(l,r),a=!0)},o(r){C(l,r),a=!1},d(r){r&&n(e),l&&l.d(r)}}}function Nu(i,e,a){let{$$slots:t={},$$scope:l}=e,{warning:r=!1}=e;const c=r?"orange":"green";return i.$$set=p=>{"warning"in p&&a(1,r=p.warning),"$$scope"in p&&a(2,l=p.$$scope)},[c,r,l,t]}class Pl extends fe{constructor(e){super();pe(this,e,Nu,Su,me,{warning:1})}}function Pu(i){let e,a;return{c(){e=g("iframe"),this.h()},l(t){e=_(t,"IFRAME",{class:!0,src:!0,title:!0,frameborder:!0,allow:!0}),f(e).forEach(n),this.h()},h(){u(e,"class","w-full xl:w-4/6 h-80"),Dl(e.src,a="https://www.youtube-nocookie.com/embed/"+i[0])||u(e,"src",a),u(e,"title","YouTube video player"),u(e,"frameborder","0"),u(e,"allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"),e.allowFullscreen=!0},m(t,l){$(t,e,l)},p(t,[l]){l&1&&!Dl(e.src,a="https://www.youtube-nocookie.com/embed/"+t[0])&&u(e,"src",a)},i:Z,o:Z,d(t){t&&n(e)}}}function Du(i,e,a){let{id:t}=e;return i.$$set=l=>{"id"in l&&a(0,t=l.id)},[t]}class Yc extends fe{constructor(e){super();pe(this,e,Du,Pu,me,{id:0})}}function Iu(i){const e=document.createElement("textarea");document.body.appendChild(e),e.value=i,e.select(),document.execCommand("copy"),document.body.removeChild(e)}function Ou(i){let e,a,t,l;return{c(){e=B("svg"),a=B("path"),t=B("path"),l=B("rect"),this.h()},l(r){e=V(r,"svg",{class:!0,xmlns:!0,"aria-hidden":!0,fill:!0,focusable:!0,role:!0,width:!0,height:!0,preserveAspectRatio:!0,viewBox:!0});var c=f(e);a=V(c,"path",{d:!0,transform:!0}),f(a).forEach(n),t=V(c,"path",{d:!0,transform:!0}),f(t).forEach(n),l=V(c,"rect",{fill:!0,width:!0,height:!0}),f(l).forEach(n),c.forEach(n),this.h()},h(){u(a,"d","M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z"),u(a,"transform","translate(0)"),u(t,"d","M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z"),u(t,"transform","translate(0)"),u(l,"fill","none"),u(l,"width","32"),u(l,"height","32"),u(e,"class",i[0]),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"aria-hidden","true"),u(e,"fill","currentColor"),u(e,"focusable","false"),u(e,"role","img"),u(e,"width","1em"),u(e,"height","1em"),u(e,"preserveAspectRatio","xMidYMid meet"),u(e,"viewBox","0 0 32 32")},m(r,c){$(r,e,c),s(e,a),s(e,t),s(e,l)},p(r,[c]){c&1&&u(e,"class",r[0])},i:Z,o:Z,d(r){r&&n(e)}}}function Fu(i,e,a){let{classNames:t=""}=e;return i.$$set=l=>{"classNames"in l&&a(0,t=l.classNames)},[t]}class Lu extends fe{constructor(e){super();pe(this,e,Fu,Ou,me,{classNames:0})}}function Hu(i){let e,a,t,l,r;return{c(){e=g("div"),a=g("div"),t=A(),l=d(i[1]),this.h()},l(c){e=_(c,"DIV",{class:!0});var p=f(e);a=_(p,"DIV",{class:!0,style:!0}),f(a).forEach(n),t=y(p),l=h(p,i[1]),p.forEach(n),this.h()},h(){u(a,"class","absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0"),gi(a,"border-left-color","transparent"),gi(a,"border-right-color","transparent"),u(e,"class",r="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow "+i[2]+" "+i[0])},m(c,p){$(c,e,p),s(e,a),s(e,t),s(e,l)},p(c,[p]){p&2&&_i(l,c[1]),p&5&&r!==(r="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow "+c[2]+" "+c[0])&&u(e,"class",r)},i:Z,o:Z,d(c){c&&n(e)}}}function Ru(i,e,a){let{classNames:t=""}=e,{label:l="Copied"}=e,{position:r="left-1/2 top-full transform -translate-x-1/2 translate-y-2"}=e;return i.$$set=c=>{"classNames"in c&&a(0,t=c.classNames),"label"in c&&a(1,l=c.label),"position"in c&&a(2,r=c.position)},[t,l,r]}class Bu extends fe{constructor(e){super();pe(this,e,Ru,Hu,me,{classNames:0,label:1,position:2})}}function Vu(i){let e,a,t,l,r,c,p,m,v;return a=new Lu({}),l=new Bu({props:{classNames:i[4]?"opacity-100":"opacity-0"}}),{c(){e=g("button"),P(a.$$.fragment),t=A(),P(l.$$.fragment),this.h()},l(w){e=_(w,"BUTTON",{class:!0,title:!0,type:!0});var z=f(e);O(a.$$.fragment,z),t=y(z),O(l.$$.fragment,z),z.forEach(n),this.h()},h(){u(e,"class",r="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none "+i[0]+" "+(i[2]==="text"?"mx-0.5":"")+" "+(i[2]==="button"?"btn":"")+" "+(i[2]==="button-clear"?"py-1 px-2 border rounded-lg shadow-sm":"")+" "+(!i[4]&&["button-clear","text"].includes(i[2])?"text-gray-600":"")+" "+(i[4]?"text-green-500":"")),u(e,"title",c=i[3]||i[1]||"Copy to clipboard"),u(e,"type","button")},m(w,z){$(w,e,z),D(a,e,null),s(e,t),D(l,e,null),p=!0,m||(v=Pe(e,"click",i[5]),m=!0)},p(w,[z]){const S={};z&16&&(S.classNames=w[4]?"opacity-100":"opacity-0"),l.$set(S),(!p||z&21&&r!==(r="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none "+w[0]+" "+(w[2]==="text"?"mx-0.5":"")+" "+(w[2]==="button"?"btn":"")+" "+(w[2]==="button-clear"?"py-1 px-2 border rounded-lg shadow-sm":"")+" "+(!w[4]&&["button-clear","text"].includes(w[2])?"text-gray-600":"")+" "+(w[4]?"text-green-500":"")))&&u(e,"class",r),(!p||z&10&&c!==(c=w[3]||w[1]||"Copy to clipboard"))&&u(e,"title",c)},i(w){p||(E(a.$$.fragment,w),E(l.$$.fragment,w),p=!0)},o(w){C(a.$$.fragment,w),C(l.$$.fragment,w),p=!1},d(w){w&&n(e),I(a),I(l),m=!1,v()}}}function Uu(i,e,a){let{classNames:t=""}=e,{label:l=""}=e,{style:r="text"}=e,{title:c=""}=e,{value:p}=e,m=!1,v;Au(()=>{v&&clearTimeout(v)});function w(){Iu(p),a(4,m=!0),v&&clearTimeout(v),v=setTimeout(()=>{a(4,m=!1)},1e3)}return i.$$set=z=>{"classNames"in z&&a(0,t=z.classNames),"label"in z&&a(1,l=z.label),"style"in z&&a(2,r=z.style),"title"in z&&a(3,c=z.title),"value"in z&&a(6,p=z.value)},[t,l,r,c,m,w,p]}class Ju extends fe{constructor(e){super();pe(this,e,Uu,Vu,me,{classNames:0,label:1,style:2,title:3,value:6})}}function Gu(i){let e,a,t,l,r,c,p,m;return t=new Ju({props:{classNames:"transition duration-200 ease-in-out "+(i[2]&&"opacity-0"),label:"code excerpt",value:i[0]}}),{c(){e=g("div"),a=g("div"),P(t.$$.fragment),l=A(),r=g("pre"),this.h()},l(v){e=_(v,"DIV",{class:!0});var w=f(e);a=_(w,"DIV",{class:!0});var z=f(a);O(t.$$.fragment,z),z.forEach(n),l=y(w),r=_(w,"PRE",{});var S=f(r);S.forEach(n),w.forEach(n),this.h()},h(){u(a,"class","absolute top-2.5 right-4"),u(e,"class","code-block relative")},m(v,w){$(v,e,w),s(e,a),D(t,a,null),s(e,l),s(e,r),r.innerHTML=i[1],c=!0,p||(m=[Pe(e,"mouseover",i[3]),Pe(e,"focus",i[3]),Pe(e,"mouseout",i[4]),Pe(e,"blur",i[4])],p=!0)},p(v,[w]){const z={};w&4&&(z.classNames="transition duration-200 ease-in-out "+(v[2]&&"opacity-0")),w&1&&(z.value=v[0]),t.$set(z),(!c||w&2)&&(r.innerHTML=v[1])},i(v){c||(E(t.$$.fragment,v),c=!0)},o(v){C(t.$$.fragment,v),c=!1},d(v){v&&n(e),I(t),p=!1,yu(m)}}}function Ku(i,e,a){let t=!0,{code:l=""}=e,{highlighted:r=""}=e;function c(){a(2,t=!1)}function p(){a(2,t=!0)}return i.$$set=m=>{"code"in m&&a(0,l=m.code),"highlighted"in m&&a(1,r=m.highlighted)},[l,r,t,c,p]}class Y extends fe{constructor(e){super();pe(this,e,Ku,Gu,me,{code:0,highlighted:1})}}var Qe=(i=>(i.OPEN="OPEN",i.CLOSED="CLOSED",i.HASHASHLINK="HASHASHLINK",i))(Qe||{});const hi={};function Qu(i){return hi[i]||(hi[i]=Tu("OPEN")),hi[i]}function Zu(i){let e,a,t,l,r,c;return{c(){e=B("svg"),a=B("defs"),t=B("clipPath"),l=B("rect"),r=B("g"),c=B("path"),this.h()},l(p){e=V(p,"svg",{class:!0,xmlns:!0,"xmlns:xlink":!0,"aria-hidden":!0,focusable:!0,role:!0,width:!0,height:!0,preserveAspectRatio:!0,viewBox:!0});var m=f(e);a=V(m,"defs",{});var v=f(a);t=V(v,"clipPath",{id:!0});var w=f(t);l=V(w,"rect",{x:!0,y:!0,width:!0,height:!0,fill:!0}),f(l).forEach(n),w.forEach(n),v.forEach(n),r=V(m,"g",{"clip-path":!0});var z=f(r);c=V(z,"path",{d:!0,fill:!0}),f(c).forEach(n),z.forEach(n),m.forEach(n),this.h()},h(){u(l,"x","3.05"),u(l,"y","0.5"),u(l,"width","25.73"),u(l,"height","31"),u(l,"fill","none"),u(t,"id","a"),u(c,"d","M24.94,9.51a12.81,12.81,0,0,1,0,18.16,12.68,12.68,0,0,1-18,0,12.81,12.81,0,0,1,0-18.16l9-9V5l-.84.83-6,6a9.58,9.58,0,1,0,13.55,0ZM20.44,9a1.68,1.68,0,1,1,1.67-1.67A1.68,1.68,0,0,1,20.44,9Z"),u(c,"fill","#ee4c2c"),u(r,"clip-path","url(#a)"),u(e,"class",i[0]),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),u(e,"aria-hidden","true"),u(e,"focusable","false"),u(e,"role","img"),u(e,"width","1em"),u(e,"height","1em"),u(e,"preserveAspectRatio","xMidYMid meet"),u(e,"viewBox","0 0 32 32")},m(p,m){$(p,e,m),s(e,a),s(a,t),s(t,l),s(e,r),s(r,c)},p(p,[m]){m&1&&u(e,"class",p[0])},i:Z,o:Z,d(p){p&&n(e)}}}function xu(i,e,a){let{classNames:t=""}=e;return i.$$set=l=>{"classNames"in l&&a(0,t=l.classNames)},[t]}class Wu extends fe{constructor(e){super();pe(this,e,xu,Zu,me,{classNames:0})}}function Yu(i){let e,a,t,l;return{c(){e=B("svg"),a=B("path"),t=B("path"),l=B("path"),this.h()},l(r){e=V(r,"svg",{class:!0,xmlns:!0,"xmlns:xlink":!0,"aria-hidden":!0,focusable:!0,role:!0,width:!0,height:!0,preserveAspectRatio:!0,viewBox:!0});var c=f(e);a=V(c,"path",{d:!0,fill:!0}),f(a).forEach(n),t=V(c,"path",{d:!0,fill:!0}),f(t).forEach(n),l=V(c,"path",{d:!0,fill:!0}),f(l).forEach(n),c.forEach(n),this.h()},h(){u(a,"d","M145.726 42.065v42.07l72.861 42.07v-42.07l-72.86-42.07zM0 84.135v42.07l36.43 21.03V105.17L0 84.135zm109.291 21.035l-36.43 21.034v126.2l36.43 21.035v-84.135l36.435 21.035v-42.07l-36.435-21.034V105.17z"),u(a,"fill","#E55B2D"),u(t,"d","M145.726 42.065L36.43 105.17v42.065l72.861-42.065v42.065l36.435-21.03v-84.14zM255.022 63.1l-36.435 21.035v42.07l36.435-21.035V63.1zm-72.865 84.135l-36.43 21.035v42.07l36.43-21.036v-42.07zm-36.43 63.104l-36.436-21.035v84.135l36.435-21.035V210.34z"),u(t,"fill","#ED8E24"),u(l,"d","M145.726 0L0 84.135l36.43 21.035l109.296-63.105l72.861 42.07L255.022 63.1L145.726 0zm0 126.204l-36.435 21.03l36.435 21.036l36.43-21.035l-36.43-21.03z"),u(l,"fill","#F8BF3C"),u(e,"class",i[0]),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),u(e,"aria-hidden","true"),u(e,"focusable","false"),u(e,"role","img"),u(e,"width","0.94em"),u(e,"height","1em"),u(e,"preserveAspectRatio","xMidYMid meet"),u(e,"viewBox","0 0 256 274")},m(r,c){$(r,e,c),s(e,a),s(e,t),s(e,l)},p(r,[c]){c&1&&u(e,"class",r[0])},i:Z,o:Z,d(r){r&&n(e)}}}function Xu(i,e,a){let{classNames:t=""}=e;return i.$$set=l=>{"classNames"in l&&a(0,t=l.classNames)},[t]}class ef extends fe{constructor(e){super();pe(this,e,Xu,Yu,me,{classNames:0})}}function tf(i){let e,a,t,l,r,c;const p=i[7].default,m=ye(p,i,i[6],null);return{c(){e=g("div"),a=g("ul"),m&&m.c(),this.h()},l(v){e=_(v,"DIV",{class:!0});var w=f(e);a=_(w,"UL",{class:!0});var z=f(a);m&&m.l(z),z.forEach(n),w.forEach(n),this.h()},h(){u(a,"class","min-w-full w-auto"),u(e,"class",t="absolute top-full mt-1 min-w-full w-auto bg-white rounded-xl overflow-hidden shadow-lg z-10 border border-gray-100 "+(i[2]==="right"?"right-0":"left-0")+" "+i[0])},m(v,w){$(v,e,w),s(e,a),m&&m.m(a,null),i[8](e),l=!0,r||(c=Pe(e,"click",function(){wu(i[1])&&i[1].apply(this,arguments)}),r=!0)},p(v,[w]){i=v,m&&m.p&&(!l||w&64)&&Te(m,p,i,i[6],l?Me(p,i[6],w,null):qe(i[6]),null),(!l||w&5&&t!==(t="absolute top-full mt-1 min-w-full w-auto bg-white rounded-xl overflow-hidden shadow-lg z-10 border border-gray-100 "+(i[2]==="right"?"right-0":"left-0")+" "+i[0]))&&u(e,"class",t)},i(v){l||(E(m,v),l=!0)},o(v){C(m,v),l=!1},d(v){v&&n(e),m&&m.d(v),i[8](null),r=!1,c()}}}function lf(i,e,a){let{$$slots:t={},$$scope:l}=e,{classNames:r=""}=e,{dropdownElement:c=void 0}=e,{forceAlignement:p=void 0}=e,{onClose:m}=e,v=p!=null?p:"left",w;hs(()=>{var q,N;if(document.addEventListener("click",z),!p){const j=document.documentElement.clientWidth,M=(w==null?void 0:w.getBoundingClientRect())||{},k=(q=M.left)!=null?q:0,T=(N=M.width)!=null?N:0;a(2,v=k+T>j?"right":"left")}return()=>{document.removeEventListener("click",z)}});function z(q){const N=q.target;N!==c&&!(c==null?void 0:c.contains(N))&&m()}function S(q){gs[q?"unshift":"push"](()=>{w=q,a(3,w)})}return i.$$set=q=>{"classNames"in q&&a(0,r=q.classNames),"dropdownElement"in q&&a(4,c=q.dropdownElement),"forceAlignement"in q&&a(5,p=q.forceAlignement),"onClose"in q&&a(1,m=q.onClose),"$$scope"in q&&a(6,l=q.$$scope)},[r,m,v,w,c,p,l,t,S]}class af extends fe{constructor(e){super();pe(this,e,lf,tf,me,{classNames:0,dropdownElement:4,forceAlignement:5,onClose:1})}}function of(i){let e,a;return{c(){e=B("svg"),a=B("path"),this.h()},l(t){e=V(t,"svg",{class:!0,xmlns:!0,"xmlns:xlink":!0,"aria-hidden":!0,focusable:!0,role:!0,width:!0,height:!0,preserveAspectRatio:!0,viewBox:!0,style:!0});var l=f(e);a=V(l,"path",{d:!0,fill:!0}),f(a).forEach(n),l.forEach(n),this.h()},h(){u(a,"d","M7 10l5 5l5-5z"),u(a,"fill","currentColor"),u(e,"class",i[0]),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),u(e,"aria-hidden","true"),u(e,"focusable","false"),u(e,"role","img"),u(e,"width","1em"),u(e,"height","1em"),u(e,"preserveAspectRatio","xMidYMid meet"),u(e,"viewBox","0 0 24 24"),gi(e,"transform","rotate(360deg)")},m(t,l){$(t,e,l),s(e,a)},p(t,[l]){l&1&&u(e,"class",t[0])},i:Z,o:Z,d(t){t&&n(e)}}}function sf(i,e,a){let{classNames:t=""}=e;return i.$$set=l=>{"classNames"in l&&a(0,t=l.classNames)},[t]}class nf extends fe{constructor(e){super();pe(this,e,sf,of,me,{classNames:0})}}const rf=i=>({}),Xc=i=>({}),cf=i=>({}),eu=i=>({});function uf(i){let e,a,t,l,r,c=i[2]&&tu(i),p=i[10]&&lu();return{c(){c&&c.c(),e=A(),a=d(i[4]),t=A(),p&&p.c(),l=Ze()},l(m){c&&c.l(m),e=y(m),a=h(m,i[4]),t=y(m),p&&p.l(m),l=Ze()},m(m,v){c&&c.m(m,v),$(m,e,v),$(m,a,v),$(m,t,v),p&&p.m(m,v),$(m,l,v),r=!0},p(m,v){m[2]?c?(c.p(m,v),v&4&&E(c,1)):(c=tu(m),c.c(),E(c,1),c.m(e.parentNode,e)):c&&(ke(),C(c,1,1,()=>{c=null}),ze()),(!r||v&16)&&_i(a,m[4]),m[10]?p?v&1024&&E(p,1):(p=lu(),p.c(),E(p,1),p.m(l.parentNode,l)):p&&(ke(),C(p,1,1,()=>{p=null}),ze())},i(m){r||(E(c),E(p),r=!0)},o(m){C(c),C(p),r=!1},d(m){c&&c.d(m),m&&n(e),m&&n(a),m&&n(t),p&&p.d(m),m&&n(l)}}}function ff(i){let e;const a=i[14].button,t=ye(a,i,i[18],eu);return{c(){t&&t.c()},l(l){t&&t.l(l)},m(l,r){t&&t.m(l,r),e=!0},p(l,r){t&&t.p&&(!e||r&262144)&&Te(t,a,l,l[18],e?Me(a,l[18],r,cf):qe(l[18]),eu)},i(l){e||(E(t,l),e=!0)},o(l){C(t,l),e=!1},d(l){t&&t.d(l)}}}function tu(i){let e,a,t;var l=i[2];function r(c){return{props:{classNames:"mr-1.5 "+c[3]}}}return l&&(e=new l(r(i))),{c(){e&&P(e.$$.fragment),a=Ze()},l(c){e&&O(e.$$.fragment,c),a=Ze()},m(c,p){e&&D(e,c,p),$(c,a,p),t=!0},p(c,p){const m={};if(p&8&&(m.classNames="mr-1.5 "+c[3]),l!==(l=c[2])){if(e){ke();const v=e;C(v.$$.fragment,1,0,()=>{I(v,1)}),ze()}l?(e=new l(r(c)),P(e.$$.fragment),E(e.$$.fragment,1),D(e,a.parentNode,a)):e=null}else l&&e.$set(m)},i(c){t||(e&&E(e.$$.fragment,c),t=!0)},o(c){e&&C(e.$$.fragment,c),t=!1},d(c){c&&n(a),e&&I(e,c)}}}function lu(i){let e,a;return e=new nf({props:{classNames:"-mr-1 text-gray-500"}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function au(i){let e,a;return e=new af({props:{classNames:i[6]+" "+(i[9]?"v2-dropdown-menu hidden":""),dropdownElement:i[11],forceAlignement:i[5],onClose:i[16],$$slots:{default:[pf]},$$scope:{ctx:i}}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p(t,l){const r={};l&576&&(r.classNames=t[6]+" "+(t[9]?"v2-dropdown-menu hidden":"")),l&2048&&(r.dropdownElement=t[11]),l&32&&(r.forceAlignement=t[5]),l&4096&&(r.onClose=t[16]),l&262144&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function pf(i){let e;const a=i[14].menu,t=ye(a,i,i[18],Xc);return{c(){t&&t.c()},l(l){t&&t.l(l)},m(l,r){t&&t.m(l,r),e=!0},p(l,r){t&&t.p&&(!e||r&262144)&&Te(t,a,l,l[18],e?Me(a,l[18],r,rf):qe(l[18]),Xc)},i(l){e||(E(t,l),e=!0)},o(l){C(t,l),e=!1},d(l){t&&t.d(l)}}}function mf(i){let e,a,t,l,r,c,p,m,v,w,z;const S=[ff,uf],q=[];function N(M,k){return M[13].button?0:1}t=N(i),l=q[t]=S[t](i);let j=(i[12]||i[9])&&au(i);return{c(){e=g("div"),a=g("button"),l.c(),c=A(),j&&j.c(),this.h()},l(M){e=_(M,"DIV",{class:!0,"selected-value":!0});var k=f(e);a=_(k,"BUTTON",{class:!0,type:!0});var T=f(a);l.l(T),T.forEach(n),c=y(k),j&&j.l(k),k.forEach(n),this.h()},h(){u(a,"class",r=""+i[1]+" "+(i[7]?"":"cursor-pointer w-full btn text-sm")+" "+(i[9]?"v2-dropdown-button":"")),u(a,"type","button"),u(e,"class",p="relative "+i[0]+" "+(i[9]?"v2-dropdown":"")),u(e,"selected-value",m=i[8]||void 0)},m(M,k){$(M,e,k),s(e,a),q[t].m(a,null),s(e,c),j&&j.m(e,null),i[17](e),v=!0,w||(z=Pe(a,"click",i[15]),w=!0)},p(M,[k]){let T=t;t=N(M),t===T?q[t].p(M,k):(ke(),C(q[T],1,1,()=>{q[T]=null}),ze(),l=q[t],l?l.p(M,k):(l=q[t]=S[t](M),l.c()),E(l,1),l.m(a,null)),(!v||k&642&&r!==(r=""+M[1]+" "+(M[7]?"":"cursor-pointer w-full btn text-sm")+" "+(M[9]?"v2-dropdown-button":"")))&&u(a,"class",r),M[12]||M[9]?j?(j.p(M,k),k&4608&&E(j,1)):(j=au(M),j.c(),E(j,1),j.m(e,null)):j&&(ke(),C(j,1,1,()=>{j=null}),ze()),(!v||k&513&&p!==(p="relative "+M[0]+" "+(M[9]?"v2-dropdown":"")))&&u(e,"class",p),(!v||k&256&&m!==(m=M[8]||void 0))&&u(e,"selected-value",m)},i(M){v||(E(l),E(j),v=!0)},o(M){C(l),C(j),v=!1},d(M){M&&n(e),q[t].d(),j&&j.d(),i[17](null),w=!1,z()}}}function df(i,e,a){let{$$slots:t={},$$scope:l}=e;const r=ku(t);let{classNames:c=""}=e,{btnClassNames:p=""}=e,{btnIcon:m=void 0}=e,{btnIconClassNames:v=""}=e,{btnLabel:w=""}=e,{forceMenuAlignement:z=void 0}=e,{menuClassNames:S=""}=e,{noBtnClass:q=void 0}=e,{selectedValue:N=void 0}=e,{useDeprecatedJS:j=!0}=e,{withBtnCaret:M=!1}=e,k,T=!1;const F=()=>a(12,T=!T),G=()=>a(12,T=!1);function U(R){gs[R?"unshift":"push"](()=>{k=R,a(11,k)})}return i.$$set=R=>{"classNames"in R&&a(0,c=R.classNames),"btnClassNames"in R&&a(1,p=R.btnClassNames),"btnIcon"in R&&a(2,m=R.btnIcon),"btnIconClassNames"in R&&a(3,v=R.btnIconClassNames),"btnLabel"in R&&a(4,w=R.btnLabel),"forceMenuAlignement"in R&&a(5,z=R.forceMenuAlignement),"menuClassNames"in R&&a(6,S=R.menuClassNames),"noBtnClass"in R&&a(7,q=R.noBtnClass),"selectedValue"in R&&a(8,N=R.selectedValue),"useDeprecatedJS"in R&&a(9,j=R.useDeprecatedJS),"withBtnCaret"in R&&a(10,M=R.withBtnCaret),"$$scope"in R&&a(18,l=R.$$scope)},[c,p,m,v,w,z,S,q,N,j,M,k,T,r,t,F,G,U,l]}class ju extends fe{constructor(e){super();pe(this,e,df,mf,me,{classNames:0,btnClassNames:1,btnIcon:2,btnIconClassNames:3,btnLabel:4,forceMenuAlignement:5,menuClassNames:6,noBtnClass:7,selectedValue:8,useDeprecatedJS:9,withBtnCaret:10})}}function hf(i){let e,a,t,l=i[5]&&ou(i);return{c(){l&&l.c(),e=A(),a=d(i[7])},l(r){l&&l.l(r),e=y(r),a=h(r,i[7])},m(r,c){l&&l.m(r,c),$(r,e,c),$(r,a,c),t=!0},p(r,c){r[5]?l?(l.p(r,c),c&32&&E(l,1)):(l=ou(r),l.c(),E(l,1),l.m(e.parentNode,e)):l&&(ke(),C(l,1,1,()=>{l=null}),ze()),(!t||c&128)&&_i(a,r[7])},i(r){t||(E(l),t=!0)},o(r){C(l),t=!1},d(r){l&&l.d(r),r&&n(e),r&&n(a)}}}function gf(i){let e;const a=i[15].default,t=ye(a,i,i[14],null);return{c(){t&&t.c()},l(l){t&&t.l(l)},m(l,r){t&&t.m(l,r),e=!0},p(l,r){t&&t.p&&(!e||r&16384)&&Te(t,a,l,l[14],e?Me(a,l[14],r,null):qe(l[14]),null)},i(l){e||(E(t,l),e=!0)},o(l){C(t,l),e=!1},d(l){t&&t.d(l)}}}function ou(i){let e,a,t;var l=i[5];function r(c){return{props:{classNames:"mr-1.5 "+c[6]}}}return l&&(e=new l(r(i))),{c(){e&&P(e.$$.fragment),a=Ze()},l(c){e&&O(e.$$.fragment,c),a=Ze()},m(c,p){e&&D(e,c,p),$(c,a,p),t=!0},p(c,p){const m={};if(p&64&&(m.classNames="mr-1.5 "+c[6]),l!==(l=c[5])){if(e){ke();const v=e;C(v.$$.fragment,1,0,()=>{I(v,1)}),ze()}l?(e=new l(r(c)),P(e.$$.fragment),E(e.$$.fragment,1),D(e,a.parentNode,a)):e=null}else l&&e.$set(m)},i(c){t||(e&&E(e.$$.fragment,c),t=!0)},o(c){e&&C(e.$$.fragment,c),t=!1},d(c){c&&n(a),e&&I(e,c)}}}function _f(i){let e,a,t,l,r,c,p,m,v,w;const z=[gf,hf],S=[];function q(N,j){return N[13].default?0:1}return t=q(i),l=S[t]=z[t](i),{c(){e=g("li"),a=g("a"),l.c(),this.h()},l(N){e=_(N,"LI",{});var j=f(e);a=_(j,"A",{class:!0,"data-label":!0,"data-url":!0,"data-value":!0,href:!0,rel:!0,target:!0});var M=f(a);l.l(M),M.forEach(n),j.forEach(n),this.h()},h(){u(a,"class",r="flex items-center hover:bg-gray-50 dark:hover:bg-gray-800 cursor-pointer px-3 py-1.5 whitespace-nowrap "+i[0]+" "+(i[9]?"hover:underline":"")+" "+(i[12]?"v2-dropdown-entry":"")),u(a,"data-label",i[1]),u(a,"data-url",i[2]),u(a,"data-value",i[3]),u(a,"href",i[4]),u(a,"rel",c=i[8]?"nofollow":void 0),u(a,"target",p=i[11]?"_blank":void 0)},m(N,j){$(N,e,j),s(e,a),S[t].m(a,null),m=!0,v||(w=Pe(a,"click",function(){wu(i[10])&&i[10].apply(this,arguments)}),v=!0)},p(N,[j]){i=N;let M=t;t=q(i),t===M?S[t].p(i,j):(ke(),C(S[M],1,1,()=>{S[M]=null}),ze(),l=S[t],l?l.p(i,j):(l=S[t]=z[t](i),l.c()),E(l,1),l.m(a,null)),(!m||j&4609&&r!==(r="flex items-center hover:bg-gray-50 dark:hover:bg-gray-800 cursor-pointer px-3 py-1.5 whitespace-nowrap "+i[0]+" "+(i[9]?"hover:underline":"")+" "+(i[12]?"v2-dropdown-entry":"")))&&u(a,"class",r),(!m||j&2)&&u(a,"data-label",i[1]),(!m||j&4)&&u(a,"data-url",i[2]),(!m||j&8)&&u(a,"data-value",i[3]),(!m||j&16)&&u(a,"href",i[4]),(!m||j&256&&c!==(c=i[8]?"nofollow":void 0))&&u(a,"rel",c),(!m||j&2048&&p!==(p=i[11]?"_blank":void 0))&&u(a,"target",p)},i(N){m||(E(l),m=!0)},o(N){C(l),m=!1},d(N){N&&n(e),S[t].d(),v=!1,w()}}}function vf(i,e,a){let{$$slots:t={},$$scope:l}=e;const r=ku(t);let{classNames:c=""}=e,{dataLabel:p=void 0}=e,{dataUrl:m=void 0}=e,{dataValue:v=void 0}=e,{href:w=void 0}=e,{icon:z=void 0}=e,{iconClassNames:S=""}=e,{label:q=""}=e,{noFollow:N=!1}=e,{underline:j=!1}=e,{onClick:M=()=>{}}=e,{targetBlank:k=!1}=e,{useDeprecatedJS:T=!0}=e;return i.$$set=F=>{"classNames"in F&&a(0,c=F.classNames),"dataLabel"in F&&a(1,p=F.dataLabel),"dataUrl"in F&&a(2,m=F.dataUrl),"dataValue"in F&&a(3,v=F.dataValue),"href"in F&&a(4,w=F.href),"icon"in F&&a(5,z=F.icon),"iconClassNames"in F&&a(6,S=F.iconClassNames),"label"in F&&a(7,q=F.label),"noFollow"in F&&a(8,N=F.noFollow),"underline"in F&&a(9,j=F.underline),"onClick"in F&&a(10,M=F.onClick),"targetBlank"in F&&a(11,k=F.targetBlank),"useDeprecatedJS"in F&&a(12,T=F.useDeprecatedJS),"$$scope"in F&&a(14,l=F.$$scope)},[c,p,m,v,w,z,S,q,N,j,M,k,T,r,l,t]}class Cu extends fe{constructor(e){super();pe(this,e,vf,_f,me,{classNames:0,dataLabel:1,dataUrl:2,dataValue:3,href:4,icon:5,iconClassNames:6,label:7,noFollow:8,underline:9,onClick:10,targetBlank:11,useDeprecatedJS:12})}}const{window:$f}=zu,bf=i=>({}),su=i=>({slot:"button"});function nu(i,e,a){const t=i.slice();return t[11]=e[a].label,t[12]=e[a].value,t}const wf=i=>({}),ru=i=>({slot:"menu"}),kf=i=>({}),iu=i=>({slot:"button"});function cu(i,e,a){const t=i.slice();return t[11]=e[a].label,t[12]=e[a].value,t}const zf=i=>({}),uu=i=>({slot:"menu"});function Ef(i){let e,a;return e=new ju({props:{btnLabel:"",classNames:"colab-dropdown",noBtnClass:!0,useDeprecatedJS:!1,$$slots:{menu:[Tf],button:[Af]},$$scope:{ctx:i}}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p(t,l){const r={};l&1024&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function jf(i){let e,a,t;return{c(){e=g("a"),a=g("img"),this.h()},l(l){e=_(l,"A",{href:!0,target:!0});var r=f(e);a=_(r,"IMG",{alt:!0,class:!0,src:!0}),r.forEach(n),this.h()},h(){u(a,"alt","Open In Colab"),u(a,"class","!m-0"),Dl(a.src,t="https://colab.research.google.com/assets/colab-badge.svg")||u(a,"src",t),u(e,"href",i[2][0].value),u(e,"target","_blank")},m(l,r){$(l,e,r),s(e,a)},p:Z,i:Z,o:Z,d(l){l&&n(e)}}}function Cf(i){let e,a;return{c(){e=g("img"),this.h()},l(t){e=_(t,"IMG",{alt:!0,class:!0,src:!0}),this.h()},h(){u(e,"alt","Open In Colab"),u(e,"class","!m-0"),Dl(e.src,a="https://colab.research.google.com/assets/colab-badge.svg")||u(e,"src",a)},m(t,l){$(t,e,l)},d(t){t&&n(e)}}}function Af(i){let e;const a=i[6].default,t=ye(a,i,i[10],iu),l=t||Cf();return{c(){l&&l.c()},l(r){l&&l.l(r)},m(r,c){l&&l.m(r,c),e=!0},p(r,c){t&&t.p&&(!e||c&1024)&&Te(t,a,r,r[10],e?Me(a,r[10],c,kf):qe(r[10]),iu)},i(r){e||(E(l,r),e=!0)},o(r){C(l,r),e=!1},d(r){l&&l.d(r)}}}function fu(i){let e,a;function t(){return i[7](i[12])}return e=new Cu({props:{classNames:"text-sm !no-underline",iconClassNames:"text-gray-500",label:i[11],onClick:t,useDeprecatedJS:!1}}),{c(){P(e.$$.fragment)},l(l){O(e.$$.fragment,l)},m(l,r){D(e,l,r),a=!0},p(l,r){i=l},i(l){a||(E(e.$$.fragment,l),a=!0)},o(l){C(e.$$.fragment,l),a=!1},d(l){I(e,l)}}}function yf(i){let e,a,t=i[2],l=[];for(let c=0;c<t.length;c+=1)l[c]=fu(cu(i,t,c));const r=c=>C(l[c],1,1,()=>{l[c]=null});return{c(){for(let c=0;c<l.length;c+=1)l[c].c();e=Ze()},l(c){for(let p=0;p<l.length;p+=1)l[p].l(c);e=Ze()},m(c,p){for(let m=0;m<l.length;m+=1)l[m].m(c,p);$(c,e,p),a=!0},p(c,p){if(p&4){t=c[2];let m;for(m=0;m<t.length;m+=1){const v=cu(c,t,m);l[m]?(l[m].p(v,p),E(l[m],1)):(l[m]=fu(v),l[m].c(),E(l[m],1),l[m].m(e.parentNode,e))}for(ke(),m=t.length;m<l.length;m+=1)r(m);ze()}},i(c){if(!a){for(let p=0;p<t.length;p+=1)E(l[p]);a=!0}},o(c){l=l.filter(Boolean);for(let p=0;p<l.length;p+=1)C(l[p]);a=!1},d(c){Eu(l,c),c&&n(e)}}}function Tf(i){let e;const a=i[6].default,t=ye(a,i,i[10],uu),l=t||yf(i);return{c(){l&&l.c()},l(r){l&&l.l(r)},m(r,c){l&&l.m(r,c),e=!0},p(r,c){t&&t.p&&(!e||c&1024)&&Te(t,a,r,r[10],e?Me(a,r[10],c,zf):qe(r[10]),uu)},i(r){e||(E(l,r),e=!0)},o(r){C(l,r),e=!1},d(r){l&&l.d(r)}}}function qf(i){let e,a;return e=new ju({props:{btnLabel:"",classNames:"colab-dropdown",noBtnClass:!0,useDeprecatedJS:!1,$$slots:{menu:[Df],button:[Nf]},$$scope:{ctx:i}}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p(t,l){const r={};l&1024&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function Mf(i){let e,a,t;return{c(){e=g("a"),a=g("img"),this.h()},l(l){e=_(l,"A",{href:!0,target:!0});var r=f(e);a=_(r,"IMG",{alt:!0,class:!0,src:!0}),r.forEach(n),this.h()},h(){u(a,"alt","Open In Studio Lab"),u(a,"class","!m-0"),Dl(a.src,t="https://studiolab.sagemaker.aws/studiolab.svg")||u(a,"src",t),u(e,"href",i[3][0].value),u(e,"target","_blank")},m(l,r){$(l,e,r),s(e,a)},p:Z,i:Z,o:Z,d(l){l&&n(e)}}}function Sf(i){let e,a;return{c(){e=g("img"),this.h()},l(t){e=_(t,"IMG",{alt:!0,class:!0,src:!0}),this.h()},h(){u(e,"alt","Open In Studio Lab"),u(e,"class","!m-0"),Dl(e.src,a="https://studiolab.sagemaker.aws/studiolab.svg")||u(e,"src",a)},m(t,l){$(t,e,l)},d(t){t&&n(e)}}}function Nf(i){let e;const a=i[6].default,t=ye(a,i,i[10],su),l=t||Sf();return{c(){l&&l.c()},l(r){l&&l.l(r)},m(r,c){l&&l.m(r,c),e=!0},p(r,c){t&&t.p&&(!e||c&1024)&&Te(t,a,r,r[10],e?Me(a,r[10],c,bf):qe(r[10]),su)},i(r){e||(E(l,r),e=!0)},o(r){C(l,r),e=!1},d(r){l&&l.d(r)}}}function pu(i){let e,a;function t(){return i[8](i[12])}return e=new Cu({props:{classNames:"text-sm !no-underline",iconClassNames:"text-gray-500",label:i[11],onClick:t,useDeprecatedJS:!1}}),{c(){P(e.$$.fragment)},l(l){O(e.$$.fragment,l)},m(l,r){D(e,l,r),a=!0},p(l,r){i=l},i(l){a||(E(e.$$.fragment,l),a=!0)},o(l){C(e.$$.fragment,l),a=!1},d(l){I(e,l)}}}function Pf(i){let e,a,t=i[3],l=[];for(let c=0;c<t.length;c+=1)l[c]=pu(nu(i,t,c));const r=c=>C(l[c],1,1,()=>{l[c]=null});return{c(){for(let c=0;c<l.length;c+=1)l[c].c();e=Ze()},l(c){for(let p=0;p<l.length;p+=1)l[p].l(c);e=Ze()},m(c,p){for(let m=0;m<l.length;m+=1)l[m].m(c,p);$(c,e,p),a=!0},p(c,p){if(p&8){t=c[3];let m;for(m=0;m<t.length;m+=1){const v=nu(c,t,m);l[m]?(l[m].p(v,p),E(l[m],1)):(l[m]=pu(v),l[m].c(),E(l[m],1),l[m].m(e.parentNode,e))}for(ke(),m=t.length;m<l.length;m+=1)r(m);ze()}},i(c){if(!a){for(let p=0;p<t.length;p+=1)E(l[p]);a=!0}},o(c){l=l.filter(Boolean);for(let p=0;p<l.length;p+=1)C(l[p]);a=!1},d(c){Eu(l,c),c&&n(e)}}}function Df(i){let e;const a=i[6].default,t=ye(a,i,i[10],ru),l=t||Pf(i);return{c(){l&&l.c()},l(r){l&&l.l(r)},m(r,c){l&&l.m(r,c),e=!0},p(r,c){t&&t.p&&(!e||c&1024)&&Te(t,a,r,r[10],e?Me(a,r[10],c,wf):qe(r[10]),ru)},i(r){e||(E(l,r),e=!0)},o(r){C(l,r),e=!1},d(r){l&&l.d(r)}}}function If(i){let e,a,t,l,r,c,p,m,v,w;const z=[jf,Ef],S=[];function q(k,T){return k[2].length===1?0:1}a=q(i),t=S[a]=z[a](i);const N=[Mf,qf],j=[];function M(k,T){return k[3].length===1?0:1}return r=M(i),c=j[r]=N[r](i),{c(){e=g("div"),t.c(),l=A(),c.c(),this.h()},l(k){e=_(k,"DIV",{class:!0});var T=f(e);t.l(T),l=y(T),c.l(T),T.forEach(n),this.h()},h(){u(e,"class",p="flex space-x-1 "+i[0])},m(k,T){$(k,e,T),S[a].m(e,null),s(e,l),j[r].m(e,null),i[9](e),m=!0,v||(w=Pe($f,"resize",i[4]),v=!0)},p(k,[T]){t.p(k,T),c.p(k,T),(!m||T&1&&p!==(p="flex space-x-1 "+k[0]))&&u(e,"class",p)},i(k){m||(E(t),E(c),m=!0)},o(k){C(t),C(c),m=!1},d(k){k&&n(e),S[a].d(),j[r].d(),i[9](null),v=!1,w()}}}function mu(i){window.open(i)}function Of(i,e,a){let{$$slots:t={},$$scope:l}=e,{options:r=[]}=e,{classNames:c=""}=e,p;const m=r.filter(N=>N.value.includes("colab.research.google.com")),v=r.filter(N=>N.value.includes("studiolab.sagemaker.aws"));function w(){const N=document.querySelector(".prose-doc h1"),j=document.querySelector(".prose-doc h1 > span");if(N&&j){const{width:M}=N.getBoundingClientRect(),{width:k}=j.getBoundingClientRect();let T=0;for(let G=0;G<p.children.length;G++)T+=p.children.item(G).clientWidth;const F=20;M-k<T+F?p.classList.remove("absolute"):p.classList.add("absolute")}}hs(()=>{w()});const z=N=>mu(N),S=N=>mu(N);function q(N){gs[N?"unshift":"push"](()=>{p=N,a(1,p)})}return i.$$set=N=>{"options"in N&&a(5,r=N.options),"classNames"in N&&a(0,c=N.classNames),"$$scope"in N&&a(10,l=N.$$scope)},[c,p,m,v,w,r,t,z,S,q,l]}class Ff extends fe{constructor(e){super();pe(this,e,Of,If,me,{options:5,classNames:0})}}function Lf(i){let e,a,t,l,r,c,p,m,v,w,z,S,q,N,j,M,k,T,F,G,U,R,W,K,x,ne,oe,se,de,ie,he,re,ee,ce,ge,H,J,le,L,Q,ue;return{c(){e=B("svg"),a=B("style"),t=d(`.J {
			stroke: #dce0df;
		}
		.K {
			stroke-linejoin: round;
		}
	`),l=B("g"),r=B("path"),c=B("path"),p=B("path"),m=B("path"),v=B("path"),w=B("path"),z=B("path"),S=B("path"),q=B("g"),N=B("path"),j=B("path"),M=B("path"),k=B("g"),T=B("path"),F=B("path"),G=B("path"),U=B("g"),R=B("path"),W=B("path"),K=B("g"),x=B("path"),ne=B("path"),oe=B("path"),se=B("path"),de=B("path"),ie=B("path"),he=B("path"),re=B("path"),ee=B("g"),ce=B("path"),ge=B("path"),H=B("path"),J=B("path"),le=B("g"),L=B("path"),Q=B("path"),ue=B("path"),this.h()},l($e){e=V($e,"svg",{class:!0,xmlns:!0,"xmlns:xlink":!0,"aria-hidden":!0,focusable:!0,role:!0,width:!0,height:!0,preserveAspectRatio:!0,viewBox:!0});var X=f(e);a=V(X,"style",{});var Se=f(a);t=h(Se,`.J {
			stroke: #dce0df;
		}
		.K {
			stroke-linejoin: round;
		}
	`),Se.forEach(n),l=V(X,"g",{fill:!0,class:!0});var ae=f(l);r=V(ae,"path",{d:!0}),f(r).forEach(n),c=V(ae,"path",{d:!0}),f(c).forEach(n),p=V(ae,"path",{d:!0}),f(p).forEach(n),m=V(ae,"path",{d:!0}),f(m).forEach(n),v=V(ae,"path",{d:!0}),f(v).forEach(n),w=V(ae,"path",{d:!0}),f(w).forEach(n),z=V(ae,"path",{d:!0}),f(z).forEach(n),S=V(ae,"path",{d:!0}),f(S).forEach(n),ae.forEach(n),q=V(X,"g",{fill:!0,class:!0});var Ne=f(q);N=V(Ne,"path",{d:!0}),f(N).forEach(n),j=V(Ne,"path",{d:!0}),f(j).forEach(n),M=V(Ne,"path",{d:!0}),f(M).forEach(n),Ne.forEach(n),k=V(X,"g",{fill:!0,class:!0});var Ee=f(k);T=V(Ee,"path",{d:!0}),f(T).forEach(n),F=V(Ee,"path",{d:!0}),f(F).forEach(n),Ee.forEach(n),G=V(X,"path",{d:!0,fill:!0,class:!0}),f(G).forEach(n),U=V(X,"g",{fill:!0,class:!0});var Ie=f(U);R=V(Ie,"path",{d:!0}),f(R).forEach(n),W=V(Ie,"path",{d:!0}),f(W).forEach(n),Ie.forEach(n),K=V(X,"g",{fill:!0,class:!0});var be=f(K);x=V(be,"path",{d:!0}),f(x).forEach(n),ne=V(be,"path",{d:!0}),f(ne).forEach(n),oe=V(be,"path",{d:!0}),f(oe).forEach(n),se=V(be,"path",{d:!0}),f(se).forEach(n),de=V(be,"path",{d:!0}),f(de).forEach(n),ie=V(be,"path",{d:!0}),f(ie).forEach(n),he=V(be,"path",{d:!0}),f(he).forEach(n),be.forEach(n),re=V(X,"path",{d:!0,fill:!0,class:!0}),f(re).forEach(n),ee=V(X,"g",{fill:!0,class:!0});var te=f(ee);ce=V(te,"path",{d:!0}),f(ce).forEach(n),ge=V(te,"path",{d:!0}),f(ge).forEach(n),H=V(te,"path",{d:!0}),f(H).forEach(n),J=V(te,"path",{d:!0}),f(J).forEach(n),te.forEach(n),le=V(X,"g",{fill:!0,class:!0});var Oe=f(le);L=V(Oe,"path",{d:!0}),f(L).forEach(n),Q=V(Oe,"path",{d:!0}),f(Q).forEach(n),ue=V(Oe,"path",{d:!0}),f(ue).forEach(n),Oe.forEach(n),X.forEach(n),this.h()},h(){u(r,"d","M50.5 130.4l-25 43.31h50l25-43.31h-50z"),u(c,"d","M.5 217.01l25-43.3h50l-25 43.3H.5z"),u(p,"d","M125.5 173.71h-50l-25 43.3h50l25-43.3z"),u(m,"d","M175.5 173.71h-50l-25 43.3h50l25-43.3z"),u(v,"d","M150.5 130.4l-25 43.31h50l25-43.31h-50z"),u(w,"d","M175.5 87.1l-25 43.3h50l25-43.3h-50z"),u(z,"d","M200.5 43.8l-25 43.3h50l25-43.3h-50z"),u(S,"d","M225.5.5l-25 43.3h50l25-43.3h-50z"),u(l,"fill","#5e97f6"),u(l,"class","J K"),u(N,"d","M.5 217.01l25 43.3h50l-25-43.3H.5z"),u(j,"d","M125.5 260.31h-50l-25-43.3h50l25 43.3z"),u(M,"d","M175.5 260.31h-50l-25-43.3h50l25 43.3z"),u(q,"fill","#2a56c6"),u(q,"class","J K"),u(T,"d","M200.5 217.01l-25-43.3-25 43.3 25 43.3 25-43.3zm50-86.61l-25-43.3-25 43.3h50z"),u(F,"d","M250.5 43.8l-25 43.3 25 43.3 25-43.3-25-43.3z"),u(k,"fill","#00796b"),u(k,"class","J K"),u(G,"d","M125.5 173.71l-25-43.31-25 43.31h50z"),u(G,"fill","#3367d6"),u(G,"class","J K"),u(R,"d","M250.5 130.4h-50l-25 43.31h50l25-43.31z"),u(W,"d","M300.5 130.4h-50l-25 43.31h50l25-43.31z"),u(U,"fill","#26a69a"),u(U,"class","J K"),u(x,"d","M350.5 43.8L325.5.5l-25 43.3 25 43.3 25-43.3z"),u(ne,"d","M375.5 87.1l-25-43.3-25 43.3 25 43.3 25-43.3z"),u(oe,"d","M400.5 130.4l-25-43.3-25 43.3 25 43.31 25-43.31z"),u(se,"d","M425.5 173.71l-25-43.31-25 43.31 25 43.3 25-43.3z"),u(de,"d","M450.5 217.01l-25-43.3-25 43.3 25 43.3 25-43.3zM425.5.5l-25 43.3 25 43.3 25-43.3-25-43.3z"),u(ie,"d","M375.5 87.1l25-43.3 25 43.3-25 43.3-25-43.3zm-25 43.3l-25 43.31 25 43.3 25-43.3-25-43.31z"),u(he,"d","M325.5 260.31l-25-43.3 25-43.3 25 43.3-25 43.3z"),u(K,"fill","#9c27b0"),u(K,"class","J K"),u(re,"d","M275.5 260.31l-25-43.3h50l25 43.3h-50z"),u(re,"fill","#6a1b9a"),u(re,"class","J K"),u(ce,"d","M225.5 173.71h-50l25 43.3h50l-25-43.3z"),u(ge,"d","M275.5 173.71h-50l25 43.3 25-43.3zm0-86.61l25 43.3h50l-25-43.3h-50z"),u(H,"d","M300.5 43.8h-50l25 43.3h50l-25-43.3zm125 216.51l-25-43.3h-50l25 43.3h50z"),u(J,"d","M375.5 173.71l-25 43.3h50l-25-43.3z"),u(ee,"fill","#00695c"),u(ee,"class","J K"),u(L,"d","M325.5.5h-50l-25 43.3h50l25-43.3zm0 173.21h-50l-25 43.3h50l25-43.3z"),u(Q,"d","M350.5 130.4h-50l-25 43.31h50l25-43.31zM425.5.5h-50l-25 43.3h50l25-43.3z"),u(ue,"d","M375.5 87.1l-25-43.3h50l-25 43.3z"),u(le,"fill","#ea80fc"),u(le,"class","J K"),u(e,"class",i[0]),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),u(e,"aria-hidden","true"),u(e,"focusable","false"),u(e,"role","img"),u(e,"width","1.73em"),u(e,"height","1em"),u(e,"preserveAspectRatio","xMidYMid meet"),u(e,"viewBox","0 0 451 260.81")},m($e,X){$($e,e,X),s(e,a),s(a,t),s(e,l),s(l,r),s(l,c),s(l,p),s(l,m),s(l,v),s(l,w),s(l,z),s(l,S),s(e,q),s(q,N),s(q,j),s(q,M),s(e,k),s(k,T),s(k,F),s(e,G),s(e,U),s(U,R),s(U,W),s(e,K),s(K,x),s(K,ne),s(K,oe),s(K,se),s(K,de),s(K,ie),s(K,he),s(e,re),s(e,ee),s(ee,ce),s(ee,ge),s(ee,H),s(ee,J),s(e,le),s(le,L),s(le,Q),s(le,ue)},p($e,[X]){X&1&&u(e,"class",$e[0])},i:Z,o:Z,d($e){$e&&n(e)}}}function Hf(i,e,a){let{classNames:t=""}=e;return i.$$set=l=>{"classNames"in l&&a(0,t=l.classNames)},[t]}class Rf extends fe{constructor(e){super();pe(this,e,Hf,Lf,me,{classNames:0})}}function Bf(i){let e,a;return{c(){e=B("svg"),a=B("path"),this.h()},l(t){e=V(t,"svg",{class:!0,width:!0,height:!0,viewBox:!0,fill:!0,xmlns:!0});var l=f(e);a=V(l,"path",{d:!0,fill:!0}),f(a).forEach(n),l.forEach(n),this.h()},h(){u(a,"d","M0 4.50001C0.390979 2.37042 2.25728 0.756592 4.5 0.756592C6.74272 0.756592 8.60861 2.37042 9 4.50001C8.60902 6.62959 6.74272 8.24342 4.5 8.24342C2.25728 8.24342 0.391395 6.62959 0 4.50001ZM4.5 6.57968C5.05156 6.57968 5.58054 6.36057 5.97055 5.97056C6.36057 5.58054 6.57967 5.05157 6.57967 4.50001C6.57967 3.94844 6.36057 3.41947 5.97055 3.02945C5.58054 2.63944 5.05156 2.42033 4.5 2.42033C3.94844 2.42033 3.41946 2.63944 3.02945 3.02945C2.63943 3.41947 2.42033 3.94844 2.42033 4.50001C2.42033 5.05157 2.63943 5.58054 3.02945 5.97056C3.41946 6.36057 3.94844 6.57968 4.5 6.57968ZM4.5 5.74781C4.16906 5.74781 3.85168 5.61635 3.61767 5.38234C3.38366 5.14833 3.2522 4.83094 3.2522 4.50001C3.2522 4.16907 3.38366 3.85168 3.61767 3.61767C3.85168 3.38367 4.16906 3.2522 4.5 3.2522C4.83094 3.2522 5.14832 3.38367 5.38233 3.61767C5.61634 3.85168 5.7478 4.16907 5.7478 4.50001C5.7478 4.83094 5.61634 5.14833 5.38233 5.38234C5.14832 5.61635 4.83094 5.74781 4.5 5.74781Z"),u(a,"fill","currentColor"),u(e,"class",i[0]),u(e,"width",i[1]),u(e,"height",i[1]),u(e,"viewBox","0 0 9 9"),u(e,"fill","currentColor"),u(e,"xmlns","http://www.w3.org/2000/svg")},m(t,l){$(t,e,l),s(e,a)},p(t,[l]){l&1&&u(e,"class",t[0]),l&2&&u(e,"width",t[1]),l&2&&u(e,"height",t[1])},i:Z,o:Z,d(t){t&&n(e)}}}function Vf(i,e,a){let{classNames:t=""}=e,{size:l="1em"}=e;return i.$$set=r=>{"classNames"in r&&a(0,t=r.classNames),"size"in r&&a(1,l=r.size)},[t,l]}class Uf extends fe{constructor(e){super();pe(this,e,Vf,Bf,me,{classNames:0,size:1})}}function Jf(i){let e,a;return{c(){e=B("svg"),a=B("path"),this.h()},l(t){e=V(t,"svg",{class:!0,width:!0,height:!0,viewBox:!0,fill:!0,xmlns:!0});var l=f(e);a=V(l,"path",{d:!0,fill:!0}),f(a).forEach(n),l.forEach(n),this.h()},h(){u(a,"d","M1.39125 1.9725L0.0883333 0.669997L0.677917 0.0804138L8.9275 8.33041L8.33792 8.91958L6.95875 7.54041C6.22592 8.00523 5.37572 8.25138 4.50792 8.25C2.26125 8.25 0.392083 6.63333 0 4.5C0.179179 3.52946 0.667345 2.64287 1.39167 1.9725H1.39125ZM5.65667 6.23833L5.04667 5.62833C4.81335 5.73996 4.55116 5.77647 4.29622 5.73282C4.04129 5.68918 3.80617 5.56752 3.62328 5.38463C3.44039 5.20175 3.31874 4.96663 3.27509 4.71169C3.23144 4.45676 3.26795 4.19456 3.37958 3.96125L2.76958 3.35125C2.50447 3.75187 2.38595 4.2318 2.4341 4.70978C2.48225 5.18777 2.6941 5.63442 3.0338 5.97411C3.37349 6.31381 3.82015 6.52567 4.29813 6.57382C4.77611 6.62197 5.25605 6.50345 5.65667 6.23833ZM2.83042 1.06666C3.35 0.862497 3.91625 0.749997 4.50792 0.749997C6.75458 0.749997 8.62375 2.36666 9.01583 4.5C8.88816 5.19404 8.60119 5.84899 8.1775 6.41333L6.56917 4.805C6.61694 4.48317 6.58868 4.15463 6.48664 3.84569C6.3846 3.53675 6.21162 3.256 5.98156 3.02594C5.7515 2.79588 5.47075 2.6229 5.16181 2.52086C4.85287 2.41882 4.52433 2.39056 4.2025 2.43833L2.83042 1.06708V1.06666Z"),u(a,"fill","currentColor"),u(e,"class",i[0]),u(e,"width",i[1]),u(e,"height",i[1]),u(e,"viewBox","0 0 10 9"),u(e,"fill","currentColor"),u(e,"xmlns","http://www.w3.org/2000/svg")},m(t,l){$(t,e,l),s(e,a)},p(t,[l]){l&1&&u(e,"class",t[0]),l&2&&u(e,"width",t[1]),l&2&&u(e,"height",t[1])},i:Z,o:Z,d(t){t&&n(e)}}}function Gf(i,e,a){let{classNames:t=""}=e,{size:l="1em"}=e;return i.$$set=r=>{"classNames"in r&&a(0,t=r.classNames),"size"in r&&a(1,l=r.size)},[t,l]}class Kf extends fe{constructor(e){super();pe(this,e,Gf,Jf,me,{classNames:0,size:1})}}const{window:Qf}=zu;function du(i){let e,a,t,l,r,c,p,m,v,w;return a=new Kf({props:{size:"0.9em"}}),{c(){e=g("div"),P(a.$$.fragment),t=A(),l=g("span"),r=d("Hide "),c=d(i[3]),p=d(" content"),this.h()},l(z){e=_(z,"DIV",{class:!0});var S=f(e);O(a.$$.fragment,S),t=y(S),l=_(S,"SPAN",{});var q=f(l);r=h(q,"Hide "),c=h(q,i[3]),p=h(q," content"),q.forEach(n),S.forEach(n),this.h()},h(){u(e,"class","cursor-pointer flex items-center justify-center space-x-1 text-sm px-2 bg-white dark:bg-gray-950 hover:underline leading-none")},m(z,S){$(z,e,S),D(a,e,null),s(e,t),s(e,l),s(l,r),s(l,c),s(l,p),m=!0,v||(w=Pe(e,"click",i[5]),v=!0)},p:Z,i(z){m||(E(a.$$.fragment,z),m=!0)},o(z){C(a.$$.fragment,z),m=!1},d(z){z&&n(e),I(a),v=!1,w()}}}function Zf(i){let e,a;const t=i[10].default,l=ye(t,i,i[9],null);return{c(){e=g("div"),l&&l.c(),this.h()},l(r){e=_(r,"DIV",{class:!0});var c=f(e);l&&l.l(c),c.forEach(n),this.h()},h(){u(e,"class","framework-content")},m(r,c){$(r,e,c),l&&l.m(e,null),a=!0},p(r,c){l&&l.p&&(!a||c&512)&&Te(l,t,r,r[9],a?Me(t,r[9],c,null):qe(r[9]),null)},i(r){a||(E(l,r),a=!0)},o(r){C(l,r),a=!1},d(r){r&&n(e),l&&l.d(r)}}}function xf(i){let e,a,t,l,r,c,p,m,v,w;return a=new Uf({props:{size:"0.9em"}}),{c(){e=g("div"),P(a.$$.fragment),t=A(),l=g("span"),r=d("Show "),c=d(i[3]),p=d(" content"),this.h()},l(z){e=_(z,"DIV",{class:!0});var S=f(e);O(a.$$.fragment,S),t=y(S),l=_(S,"SPAN",{});var q=f(l);r=h(q,"Show "),c=h(q,i[3]),p=h(q," content"),q.forEach(n),S.forEach(n),this.h()},h(){u(e,"class","cursor-pointer mt-[-12.5px] flex items-center justify-center space-x-1 py-4 text-sm hover:underline leading-none")},m(z,S){$(z,e,S),D(a,e,null),s(e,t),s(e,l),s(l,r),s(l,c),s(l,p),m=!0,v||(w=Pe(e,"click",i[5]),v=!0)},p:Z,i(z){m||(E(a.$$.fragment,z),m=!0)},o(z){C(a.$$.fragment,z),m=!1},d(z){z&&n(e),I(a),v=!1,w()}}}function Wf(i){let e,a,t,l,r,c,p,m,v,w,z,S,q,N;var j=i[2];function M(U){return{}}j&&(l=new j(M()));let k=!i[1]&&du(i);const T=[xf,Zf],F=[];function G(U,R){return U[1]?0:1}return w=G(i),z=F[w]=T[w](i),{c(){e=g("div"),a=g("div"),t=g("div"),l&&P(l.$$.fragment),r=A(),c=g("span"),p=d(i[3]),m=A(),k&&k.c(),v=A(),z.c(),this.h()},l(U){e=_(U,"DIV",{class:!0});var R=f(e);a=_(R,"DIV",{class:!0});var W=f(a);t=_(W,"DIV",{class:!0});var K=f(t);l&&O(l.$$.fragment,K),r=y(K),c=_(K,"SPAN",{});var x=f(c);p=h(x,i[3]),x.forEach(n),K.forEach(n),m=y(W),k&&k.l(W),W.forEach(n),v=y(R),z.l(R),R.forEach(n),this.h()},h(){u(t,"class","flex px-1 items-center space-x-1 bg-white dark:bg-gray-950"),u(a,"class","flex h-[22px] mt-[-12.5px] justify-between leading-none"),u(e,"class","border border-gray-200 rounded-xl px-4 relative")},m(U,R){$(U,e,R),s(e,a),s(a,t),l&&D(l,t,null),s(t,r),s(t,c),s(c,p),s(a,m),k&&k.m(a,null),s(e,v),F[w].m(e,null),i[11](e),S=!0,q||(N=Pe(Qf,"hashchange",i[6]),q=!0)},p(U,[R]){if(j!==(j=U[2])){if(l){ke();const K=l;C(K.$$.fragment,1,0,()=>{I(K,1)}),ze()}j?(l=new j(M()),P(l.$$.fragment),E(l.$$.fragment,1),D(l,t,r)):l=null}U[1]?k&&(ke(),C(k,1,1,()=>{k=null}),ze()):k?(k.p(U,R),R&2&&E(k,1)):(k=du(U),k.c(),E(k,1),k.m(a,null));let W=w;w=G(U),w===W?F[w].p(U,R):(ke(),C(F[W],1,1,()=>{F[W]=null}),ze(),z=F[w],z?z.p(U,R):(z=F[w]=T[w](U),z.c()),E(z,1),z.m(e,null))},i(U){S||(l&&E(l.$$.fragment,U),E(k),E(z),S=!0)},o(U){l&&C(l.$$.fragment,U),C(k),C(z),S=!1},d(U){U&&n(e),l&&I(l),k&&k.d(),F[w].d(),i[11](null),q=!1,N()}}}function Yf(i,e,a){let t,l,{$$slots:r={},$$scope:c}=e,{framework:p}=e,m,v=new Set;const w={pytorch:{Icon:Wu,label:"Pytorch"},tensorflow:{Icon:ef,label:"TensorFlow"},jax:{Icon:Rf,label:"JAX"}},{Icon:z,label:S}=w[p],q=`hf_doc_framework_${p}_is_hidden`,N=Qu(p);qu(i,N,T=>a(8,l=T));function j(){ds(N,l=l!==Qe.CLOSED?Qe.CLOSED:Qe.OPEN,l),localStorage.setItem(q,l)}function M(){const T=window.location.hash.slice(1);v.has(T)&&(ds(N,l=Qe.HASHASHLINK,l),localStorage.setItem(q,l))}hs(()=>{const T=window.location.hash.slice(1),F="header-link",G=m.querySelectorAll(`.${F}`);v=new Set([...G].map(R=>R.id));const U=localStorage.getItem(q);v.has(T)?ds(N,l=Qe.HASHASHLINK,l):U===Qe.CLOSED&&l!==Qe.HASHASHLINK&&ds(N,l=Qe.CLOSED,l)});function k(T){gs[T?"unshift":"push"](()=>{m=T,a(0,m)})}return i.$$set=T=>{"framework"in T&&a(7,p=T.framework),"$$scope"in T&&a(9,c=T.$$scope)},i.$$.update=()=>{i.$$.dirty&256&&a(1,t=l===Qe.CLOSED)},[m,t,z,S,N,j,M,p,l,c,r,k]}class vi extends fe{constructor(e){super();pe(this,e,Yf,Wf,me,{framework:7})}}const Xf=i=>({}),hu=i=>({}),ep=i=>({}),gu=i=>({}),tp=i=>({}),_u=i=>({});function vu(i){let e,a;return e=new vi({props:{framework:"pytorch",$$slots:{default:[lp]},$$scope:{ctx:i}}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p(t,l){const r={};l&16&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function lp(i){let e;const a=i[3].pytorch,t=ye(a,i,i[4],_u);return{c(){t&&t.c()},l(l){t&&t.l(l)},m(l,r){t&&t.m(l,r),e=!0},p(l,r){t&&t.p&&(!e||r&16)&&Te(t,a,l,l[4],e?Me(a,l[4],r,tp):qe(l[4]),_u)},i(l){e||(E(t,l),e=!0)},o(l){C(t,l),e=!1},d(l){t&&t.d(l)}}}function $u(i){let e,a;return e=new vi({props:{framework:"tensorflow",$$slots:{default:[ap]},$$scope:{ctx:i}}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p(t,l){const r={};l&16&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function ap(i){let e;const a=i[3].tensorflow,t=ye(a,i,i[4],gu);return{c(){t&&t.c()},l(l){t&&t.l(l)},m(l,r){t&&t.m(l,r),e=!0},p(l,r){t&&t.p&&(!e||r&16)&&Te(t,a,l,l[4],e?Me(a,l[4],r,ep):qe(l[4]),gu)},i(l){e||(E(t,l),e=!0)},o(l){C(t,l),e=!1},d(l){t&&t.d(l)}}}function bu(i){let e,a;return e=new vi({props:{framework:"jax",$$slots:{default:[op]},$$scope:{ctx:i}}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p(t,l){const r={};l&16&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function op(i){let e;const a=i[3].jax,t=ye(a,i,i[4],hu);return{c(){t&&t.c()},l(l){t&&t.l(l)},m(l,r){t&&t.m(l,r),e=!0},p(l,r){t&&t.p&&(!e||r&16)&&Te(t,a,l,l[4],e?Me(a,l[4],r,Xf):qe(l[4]),hu)},i(l){e||(E(t,l),e=!0)},o(l){C(t,l),e=!1},d(l){t&&t.d(l)}}}function sp(i){let e,a,t,l,r=i[0]&&vu(i),c=i[1]&&$u(i),p=i[2]&&bu(i);return{c(){e=g("div"),r&&r.c(),a=A(),c&&c.c(),t=A(),p&&p.c(),this.h()},l(m){e=_(m,"DIV",{class:!0});var v=f(e);r&&r.l(v),a=y(v),c&&c.l(v),t=y(v),p&&p.l(v),v.forEach(n),this.h()},h(){u(e,"class","space-y-10 py-6 2xl:py-8 2xl:-mx-4")},m(m,v){$(m,e,v),r&&r.m(e,null),s(e,a),c&&c.m(e,null),s(e,t),p&&p.m(e,null),l=!0},p(m,[v]){m[0]?r?(r.p(m,v),v&1&&E(r,1)):(r=vu(m),r.c(),E(r,1),r.m(e,a)):r&&(ke(),C(r,1,1,()=>{r=null}),ze()),m[1]?c?(c.p(m,v),v&2&&E(c,1)):(c=$u(m),c.c(),E(c,1),c.m(e,t)):c&&(ke(),C(c,1,1,()=>{c=null}),ze()),m[2]?p?(p.p(m,v),v&4&&E(p,1)):(p=bu(m),p.c(),E(p,1),p.m(e,null)):p&&(ke(),C(p,1,1,()=>{p=null}),ze())},i(m){l||(E(r),E(c),E(p),l=!0)},o(m){C(r),C(c),C(p),l=!1},d(m){m&&n(e),r&&r.d(),c&&c.d(),p&&p.d()}}}function np(i,e,a){let{$$slots:t={},$$scope:l}=e,{pytorch:r=!1}=e,{tensorflow:c=!1}=e,{jax:p=!1}=e;return i.$$set=m=>{"pytorch"in m&&a(0,r=m.pytorch),"tensorflow"in m&&a(1,c=m.tensorflow),"jax"in m&&a(2,p=m.jax),"$$scope"in m&&a(4,l=m.$$scope)},[r,c,p,t,l]}class Nl extends fe{constructor(e){super();pe(this,e,np,sp,me,{pytorch:0,tensorflow:1,jax:2})}}function rp(i){let e;const a=i[1].default,t=ye(a,i,i[0],null);return{c(){t&&t.c()},l(l){t&&t.l(l)},m(l,r){t&&t.m(l,r),e=!0},p(l,[r]){t&&t.p&&(!e||r&1)&&Te(t,a,l,l[0],e?Me(a,l[0],r,null):qe(l[0]),null)},i(l){e||(E(t,l),e=!0)},o(l){C(t,l),e=!1},d(l){t&&t.d(l)}}}function ip(i,e,a){let{$$slots:t={},$$scope:l}=e;return i.$$set=r=>{"$$scope"in r&&a(0,l=r.$$scope)},[l,t]}class De extends fe{constructor(e){super();pe(this,e,ip,rp,me,{})}}function cp(i){let e,a;return{c(){e=g("p"),a=d(`Tutti gli esempi di codice presenti in questa documentazione hanno un pulsante in alto a sinistra che permette di selezionare tra PyTorch e TensorFlow. Se
questo non \xE8 presente, ci si aspetta che il codice funzioni per entrambi i backend senza alcun cambiamento.`)},l(t){e=_(t,"P",{});var l=f(e);a=h(l,`Tutti gli esempi di codice presenti in questa documentazione hanno un pulsante in alto a sinistra che permette di selezionare tra PyTorch e TensorFlow. Se
questo non \xE8 presente, ci si aspetta che il codice funzioni per entrambi i backend senza alcun cambiamento.`),l.forEach(n)},m(t,l){$(t,e,l),s(e,a)},d(t){t&&n(e)}}}function up(i){let e,a,t,l,r,c,p,m;return{c(){e=g("p"),a=d("Per maggiori dettagli legati alla "),t=g("code"),l=d("pipeline()"),r=d(" e ai compiti ad essa associati, fai riferimento alla documentazione "),c=g("a"),p=d("qui"),m=d("."),this.h()},l(v){e=_(v,"P",{});var w=f(e);a=h(w,"Per maggiori dettagli legati alla "),t=_(w,"CODE",{});var z=f(t);l=h(z,"pipeline()"),z.forEach(n),r=h(w," e ai compiti ad essa associati, fai riferimento alla documentazione "),c=_(w,"A",{href:!0});var S=f(c);p=h(S,"qui"),S.forEach(n),m=h(w,"."),w.forEach(n),this.h()},h(){u(c,"href","./main_classes/pipelines")},m(v,w){$(v,e,w),s(e,a),s(e,t),s(t,l),s(e,r),s(e,c),s(c,p),s(e,m)},d(v){v&&n(e)}}}function fp(i){let e,a;return e=new Y({props:{code:"pip install torch",highlighted:"pip install torch"}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p:Z,i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function pp(i){let e,a;return e=new De({props:{$$slots:{default:[fp]},$$scope:{ctx:i}}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p(t,l){const r={};l&2&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function mp(i){let e,a;return e=new Y({props:{code:"pip install tensorflow",highlighted:"pip install tensorflow"}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p:Z,i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function dp(i){let e,a;return e=new De({props:{$$slots:{default:[mp]},$$scope:{ctx:i}}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p(t,l){const r={};l&2&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function hp(i){let e,a,t,l,r,c,p,m,v,w,z,S,q,N;return q=new Y({props:{code:`from transformers import AutoTokenizer, AutoModelForSequenceClassification

model = AutoModelForSequenceClassification.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForSequenceClassification.from_pretrained(model_name)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(model_name)`}}),{c(){e=g("p"),a=d("Usa "),t=g("code"),l=d("AutoModelForSequenceClassification"),r=d(" e "),c=g("code"),p=d("AutoTokenizer"),m=d(" per caricare il modello pre-allenato e il suo tokenizer associato (maggiori informazioni su una "),v=g("code"),w=d("AutoClass"),z=d(" in seguito):"),S=A(),P(q.$$.fragment)},l(j){e=_(j,"P",{});var M=f(e);a=h(M,"Usa "),t=_(M,"CODE",{});var k=f(t);l=h(k,"AutoModelForSequenceClassification"),k.forEach(n),r=h(M," e "),c=_(M,"CODE",{});var T=f(c);p=h(T,"AutoTokenizer"),T.forEach(n),m=h(M," per caricare il modello pre-allenato e il suo tokenizer associato (maggiori informazioni su una "),v=_(M,"CODE",{});var F=f(v);w=h(F,"AutoClass"),F.forEach(n),z=h(M," in seguito):"),M.forEach(n),S=y(j),O(q.$$.fragment,j)},m(j,M){$(j,e,M),s(e,a),s(e,t),s(t,l),s(e,r),s(e,c),s(c,p),s(e,m),s(e,v),s(v,w),s(e,z),$(j,S,M),D(q,j,M),N=!0},p:Z,i(j){N||(E(q.$$.fragment,j),N=!0)},o(j){C(q.$$.fragment,j),N=!1},d(j){j&&n(e),j&&n(S),I(q,j)}}}function gp(i){let e,a;return e=new De({props:{$$slots:{default:[hp]},$$scope:{ctx:i}}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p(t,l){const r={};l&2&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function _p(i){let e,a,t,l,r,c,p,m,v,w,z,S,q,N;return q=new Y({props:{code:`from transformers import AutoTokenizer, TFAutoModelForSequenceClassification

model = TFAutoModelForSequenceClassification.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFAutoModelForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFAutoModelForSequenceClassification.from_pretrained(model_name)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(model_name)`}}),{c(){e=g("p"),a=d("Usa "),t=g("code"),l=d("TFAutoModelForSequenceClassification"),r=d(" e "),c=g("code"),p=d("AutoTokenizer"),m=d(" per caricare il modello pre-allenato e il suo tokenizer associato (maggiori informazioni su una "),v=g("code"),w=d("TFAutoClass"),z=d(" in seguito):"),S=A(),P(q.$$.fragment)},l(j){e=_(j,"P",{});var M=f(e);a=h(M,"Usa "),t=_(M,"CODE",{});var k=f(t);l=h(k,"TFAutoModelForSequenceClassification"),k.forEach(n),r=h(M," e "),c=_(M,"CODE",{});var T=f(c);p=h(T,"AutoTokenizer"),T.forEach(n),m=h(M," per caricare il modello pre-allenato e il suo tokenizer associato (maggiori informazioni su una "),v=_(M,"CODE",{});var F=f(v);w=h(F,"TFAutoClass"),F.forEach(n),z=h(M," in seguito):"),M.forEach(n),S=y(j),O(q.$$.fragment,j)},m(j,M){$(j,e,M),s(e,a),s(e,t),s(t,l),s(e,r),s(e,c),s(c,p),s(e,m),s(e,v),s(v,w),s(e,z),$(j,S,M),D(q,j,M),N=!0},p:Z,i(j){N||(E(q.$$.fragment,j),N=!0)},o(j){C(q.$$.fragment,j),N=!1},d(j){j&&n(e),j&&n(S),I(q,j)}}}function vp(i){let e,a;return e=new De({props:{$$slots:{default:[_p]},$$scope:{ctx:i}}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p(t,l){const r={};l&2&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function $p(i){let e,a;return e=new Y({props:{code:`pt_batch = tokenizer(
    ["Siamo molto felici di mostrarti la libreria \u{1F917} Transformers.", "Speriamo te non la odierai."],
    padding=True,
    truncation=True,
    max_length=512,
    return_tensors="pt",
)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>pt_batch = tokenizer(
<span class="hljs-meta">... </span>    [<span class="hljs-string">&quot;Siamo molto felici di mostrarti la libreria \u{1F917} Transformers.&quot;</span>, <span class="hljs-string">&quot;Speriamo te non la odierai.&quot;</span>],
<span class="hljs-meta">... </span>    padding=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    truncation=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    max_length=<span class="hljs-number">512</span>,
<span class="hljs-meta">... </span>    return_tensors=<span class="hljs-string">&quot;pt&quot;</span>,
<span class="hljs-meta">... </span>)`}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p:Z,i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function bp(i){let e,a;return e=new De({props:{$$slots:{default:[$p]},$$scope:{ctx:i}}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p(t,l){const r={};l&2&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function wp(i){let e,a;return e=new Y({props:{code:`tf_batch = tokenizer(
    ["Siamo molto felici di mostrarti la libreria \u{1F917} Transformers.", "Speriamo te non la odierai."],
    padding=True,
    truncation=True,
    max_length=512,
    return_tensors="tf",
)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>tf_batch = tokenizer(
<span class="hljs-meta">... </span>    [<span class="hljs-string">&quot;Siamo molto felici di mostrarti la libreria \u{1F917} Transformers.&quot;</span>, <span class="hljs-string">&quot;Speriamo te non la odierai.&quot;</span>],
<span class="hljs-meta">... </span>    padding=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    truncation=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    max_length=<span class="hljs-number">512</span>,
<span class="hljs-meta">... </span>    return_tensors=<span class="hljs-string">&quot;tf&quot;</span>,
<span class="hljs-meta">... </span>)`}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p:Z,i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function kp(i){let e,a;return e=new De({props:{$$slots:{default:[wp]},$$scope:{ctx:i}}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p(t,l){const r={};l&2&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function zp(i){let e,a,t,l,r,c,p,m;return{c(){e=g("p"),a=d("Guarda il "),t=g("a"),l=d("task summary"),r=d(" per sapere quale classe di "),c=g("code"),p=d("AutoModel"),m=d(" utilizzare per quale compito."),this.h()},l(v){e=_(v,"P",{});var w=f(e);a=h(w,"Guarda il "),t=_(w,"A",{href:!0});var z=f(t);l=h(z,"task summary"),z.forEach(n),r=h(w," per sapere quale classe di "),c=_(w,"CODE",{});var S=f(c);p=h(S,"AutoModel"),S.forEach(n),m=h(w," utilizzare per quale compito."),w.forEach(n),this.h()},h(){u(t,"href","./task_summary")},m(v,w){$(v,e,w),s(e,a),s(e,t),s(t,l),s(e,r),s(e,c),s(c,p),s(e,m)},d(v){v&&n(e)}}}function Ep(i){let e,a,t,l,r,c,p,m,v,w,z,S,q,N,j,M,k,T,F,G,U,R,W,K,x,ne,oe,se,de,ie,he,re,ee,ce,ge,H,J,le;return M=new Y({props:{code:`from transformers import AutoModelForSequenceClassification

model_name = "nlptown/bert-base-multilingual-uncased-sentiment"
pt_model = AutoModelForSequenceClassification.from_pretrained(model_name)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>model_name = <span class="hljs-string">&quot;nlptown/bert-base-multilingual-uncased-sentiment&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pt_model = AutoModelForSequenceClassification.from_pretrained(model_name)`}}),T=new Pl({props:{$$slots:{default:[zp]},$$scope:{ctx:i}}}),ne=new Y({props:{code:"pt_outputs = pt_model(**pt_batch)",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>pt_outputs = pt_model(**pt_batch)'}}),J=new Y({props:{code:`from torch import nn

pt_predictions = nn.functional.softmax(pt_outputs.logits, dim=-1)
print(pt_predictions)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> torch <span class="hljs-keyword">import</span> nn

<span class="hljs-meta">&gt;&gt;&gt; </span>pt_predictions = nn.functional.softmax(pt_outputs.logits, dim=-<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(pt_predictions)
tensor([[<span class="hljs-number">0.0041</span>, <span class="hljs-number">0.0037</span>, <span class="hljs-number">0.0203</span>, <span class="hljs-number">0.2005</span>, <span class="hljs-number">0.7713</span>],
        [<span class="hljs-number">0.3766</span>, <span class="hljs-number">0.3292</span>, <span class="hljs-number">0.1832</span>, <span class="hljs-number">0.0558</span>, <span class="hljs-number">0.0552</span>]], grad_fn=&lt;SoftmaxBackward0&gt;)`}}),{c(){e=g("p"),a=d("\u{1F917} Transformers fornisce un metodo semplice e unificato per caricare istanze pre-allenate. Questo significa che puoi caricare un "),t=g("code"),l=d("AutoModel"),r=d(" come caricheresti un "),c=g("code"),p=d("AutoTokenizer"),m=d(". L\u2019unica differenza \xE8 selezionare l\u2019"),v=g("code"),w=d("AutoModel"),z=d(" corretto per il compito di interesse. Dato che stai facendo classificazione di testi, o sequenze, carica "),S=g("code"),q=d("AutoModelForSequenceClassification"),N=d(":"),j=A(),P(M.$$.fragment),k=A(),P(T.$$.fragment),F=A(),G=g("p"),U=d("Ora puoi passare il tuo lotto di input pre-processati direttamente al modello. Devi solo spacchettare il dizionario aggiungendo "),R=g("code"),W=d("**"),K=d(":"),x=A(),P(ne.$$.fragment),oe=A(),se=g("p"),de=d("Il modello produrr\xE0 le attivazioni finali nell\u2019attributo "),ie=g("code"),he=d("logits"),re=d(". Applica la funzione softmax a "),ee=g("code"),ce=d("logits"),ge=d(" per ottenere le probabilit\xE0:"),H=A(),P(J.$$.fragment)},l(L){e=_(L,"P",{});var Q=f(e);a=h(Q,"\u{1F917} Transformers fornisce un metodo semplice e unificato per caricare istanze pre-allenate. Questo significa che puoi caricare un "),t=_(Q,"CODE",{});var ue=f(t);l=h(ue,"AutoModel"),ue.forEach(n),r=h(Q," come caricheresti un "),c=_(Q,"CODE",{});var $e=f(c);p=h($e,"AutoTokenizer"),$e.forEach(n),m=h(Q,". L\u2019unica differenza \xE8 selezionare l\u2019"),v=_(Q,"CODE",{});var X=f(v);w=h(X,"AutoModel"),X.forEach(n),z=h(Q," corretto per il compito di interesse. Dato che stai facendo classificazione di testi, o sequenze, carica "),S=_(Q,"CODE",{});var Se=f(S);q=h(Se,"AutoModelForSequenceClassification"),Se.forEach(n),N=h(Q,":"),Q.forEach(n),j=y(L),O(M.$$.fragment,L),k=y(L),O(T.$$.fragment,L),F=y(L),G=_(L,"P",{});var ae=f(G);U=h(ae,"Ora puoi passare il tuo lotto di input pre-processati direttamente al modello. Devi solo spacchettare il dizionario aggiungendo "),R=_(ae,"CODE",{});var Ne=f(R);W=h(Ne,"**"),Ne.forEach(n),K=h(ae,":"),ae.forEach(n),x=y(L),O(ne.$$.fragment,L),oe=y(L),se=_(L,"P",{});var Ee=f(se);de=h(Ee,"Il modello produrr\xE0 le attivazioni finali nell\u2019attributo "),ie=_(Ee,"CODE",{});var Ie=f(ie);he=h(Ie,"logits"),Ie.forEach(n),re=h(Ee,". Applica la funzione softmax a "),ee=_(Ee,"CODE",{});var be=f(ee);ce=h(be,"logits"),be.forEach(n),ge=h(Ee," per ottenere le probabilit\xE0:"),Ee.forEach(n),H=y(L),O(J.$$.fragment,L)},m(L,Q){$(L,e,Q),s(e,a),s(e,t),s(t,l),s(e,r),s(e,c),s(c,p),s(e,m),s(e,v),s(v,w),s(e,z),s(e,S),s(S,q),s(e,N),$(L,j,Q),D(M,L,Q),$(L,k,Q),D(T,L,Q),$(L,F,Q),$(L,G,Q),s(G,U),s(G,R),s(R,W),s(G,K),$(L,x,Q),D(ne,L,Q),$(L,oe,Q),$(L,se,Q),s(se,de),s(se,ie),s(ie,he),s(se,re),s(se,ee),s(ee,ce),s(se,ge),$(L,H,Q),D(J,L,Q),le=!0},p(L,Q){const ue={};Q&2&&(ue.$$scope={dirty:Q,ctx:L}),T.$set(ue)},i(L){le||(E(M.$$.fragment,L),E(T.$$.fragment,L),E(ne.$$.fragment,L),E(J.$$.fragment,L),le=!0)},o(L){C(M.$$.fragment,L),C(T.$$.fragment,L),C(ne.$$.fragment,L),C(J.$$.fragment,L),le=!1},d(L){L&&n(e),L&&n(j),I(M,L),L&&n(k),I(T,L),L&&n(F),L&&n(G),L&&n(x),I(ne,L),L&&n(oe),L&&n(se),L&&n(H),I(J,L)}}}function jp(i){let e,a;return e=new De({props:{$$slots:{default:[Ep]},$$scope:{ctx:i}}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p(t,l){const r={};l&2&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function Cp(i){let e,a,t,l,r,c,p,m;return{c(){e=g("p"),a=d("Guarda il "),t=g("a"),l=d("task summary"),r=d(" per sapere quale classe di "),c=g("code"),p=d("AutoModel"),m=d(" utilizzare per quale compito."),this.h()},l(v){e=_(v,"P",{});var w=f(e);a=h(w,"Guarda il "),t=_(w,"A",{href:!0});var z=f(t);l=h(z,"task summary"),z.forEach(n),r=h(w," per sapere quale classe di "),c=_(w,"CODE",{});var S=f(c);p=h(S,"AutoModel"),S.forEach(n),m=h(w," utilizzare per quale compito."),w.forEach(n),this.h()},h(){u(t,"href","./task_summary")},m(v,w){$(v,e,w),s(e,a),s(e,t),s(t,l),s(e,r),s(e,c),s(c,p),s(e,m)},d(v){v&&n(e)}}}function Ap(i){let e,a,t,l,r,c,p,m,v,w,z,S,q,N,j,M,k,T,F,G,U,R,W,K,x,ne,oe,se,de,ie,he,re,ee,ce,ge;return M=new Y({props:{code:`from transformers import TFAutoModelForSequenceClassification

nome_del_modello = "nlptown/bert-base-multilingual-uncased-sentiment"
tf_model = TFAutoModelForSequenceClassification.from_pretrained(nome_del_modello)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>nome_del_modello = <span class="hljs-string">&quot;nlptown/bert-base-multilingual-uncased-sentiment&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model = TFAutoModelForSequenceClassification.from_pretrained(nome_del_modello)`}}),T=new Pl({props:{$$slots:{default:[Cp]},$$scope:{ctx:i}}}),W=new Y({props:{code:"tf_outputs = tf_model(tf_batch)",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>tf_outputs = tf_model(tf_batch)'}}),ce=new Y({props:{code:`import tensorflow as tf

tf_predictions = tf.nn.softmax(tf_outputs.logits, axis=-1)
tf_predictions`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tf_predictions = tf.nn.softmax(tf_outputs.logits, axis=-<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tf_predictions`}}),{c(){e=g("p"),a=d("\u{1F917} Transformers fornisce un metodo semplice e unificato per caricare istanze pre-allenate. Questo significa che puoi caricare un "),t=g("code"),l=d("TFAutoModel"),r=d(" come caricheresti un "),c=g("code"),p=d("AutoTokenizer"),m=d(". L\u2019unica differenza \xE8 selezionare il "),v=g("code"),w=d("TFAutoModel"),z=d(" corretto per il compito di interesse. Dato che stai facendo classificazione di testi, o sequenze, carica "),S=g("code"),q=d("TFAutoModelForSequenceClassification"),N=d(":"),j=A(),P(M.$$.fragment),k=A(),P(T.$$.fragment),F=A(),G=g("p"),U=d("Ora puoi passare il tuo lotto di input pre-processati direttamente al modello passando le chiavi del dizionario al tensore:"),R=A(),P(W.$$.fragment),K=A(),x=g("p"),ne=d("Il modello produrr\xE0 le attivazioni finali nell\u2019attributo "),oe=g("code"),se=d("logits"),de=d(". Applica la funzione softmax a "),ie=g("code"),he=d("logits"),re=d(" per ottenere le probabilit\xE0:"),ee=A(),P(ce.$$.fragment)},l(H){e=_(H,"P",{});var J=f(e);a=h(J,"\u{1F917} Transformers fornisce un metodo semplice e unificato per caricare istanze pre-allenate. Questo significa che puoi caricare un "),t=_(J,"CODE",{});var le=f(t);l=h(le,"TFAutoModel"),le.forEach(n),r=h(J," come caricheresti un "),c=_(J,"CODE",{});var L=f(c);p=h(L,"AutoTokenizer"),L.forEach(n),m=h(J,". L\u2019unica differenza \xE8 selezionare il "),v=_(J,"CODE",{});var Q=f(v);w=h(Q,"TFAutoModel"),Q.forEach(n),z=h(J," corretto per il compito di interesse. Dato che stai facendo classificazione di testi, o sequenze, carica "),S=_(J,"CODE",{});var ue=f(S);q=h(ue,"TFAutoModelForSequenceClassification"),ue.forEach(n),N=h(J,":"),J.forEach(n),j=y(H),O(M.$$.fragment,H),k=y(H),O(T.$$.fragment,H),F=y(H),G=_(H,"P",{});var $e=f(G);U=h($e,"Ora puoi passare il tuo lotto di input pre-processati direttamente al modello passando le chiavi del dizionario al tensore:"),$e.forEach(n),R=y(H),O(W.$$.fragment,H),K=y(H),x=_(H,"P",{});var X=f(x);ne=h(X,"Il modello produrr\xE0 le attivazioni finali nell\u2019attributo "),oe=_(X,"CODE",{});var Se=f(oe);se=h(Se,"logits"),Se.forEach(n),de=h(X,". Applica la funzione softmax a "),ie=_(X,"CODE",{});var ae=f(ie);he=h(ae,"logits"),ae.forEach(n),re=h(X," per ottenere le probabilit\xE0:"),X.forEach(n),ee=y(H),O(ce.$$.fragment,H)},m(H,J){$(H,e,J),s(e,a),s(e,t),s(t,l),s(e,r),s(e,c),s(c,p),s(e,m),s(e,v),s(v,w),s(e,z),s(e,S),s(S,q),s(e,N),$(H,j,J),D(M,H,J),$(H,k,J),D(T,H,J),$(H,F,J),$(H,G,J),s(G,U),$(H,R,J),D(W,H,J),$(H,K,J),$(H,x,J),s(x,ne),s(x,oe),s(oe,se),s(x,de),s(x,ie),s(ie,he),s(x,re),$(H,ee,J),D(ce,H,J),ge=!0},p(H,J){const le={};J&2&&(le.$$scope={dirty:J,ctx:H}),T.$set(le)},i(H){ge||(E(M.$$.fragment,H),E(T.$$.fragment,H),E(W.$$.fragment,H),E(ce.$$.fragment,H),ge=!0)},o(H){C(M.$$.fragment,H),C(T.$$.fragment,H),C(W.$$.fragment,H),C(ce.$$.fragment,H),ge=!1},d(H){H&&n(e),H&&n(j),I(M,H),H&&n(k),I(T,H),H&&n(F),H&&n(G),H&&n(R),I(W,H),H&&n(K),H&&n(x),H&&n(ee),I(ce,H)}}}function yp(i){let e,a;return e=new De({props:{$$slots:{default:[Ap]},$$scope:{ctx:i}}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p(t,l){const r={};l&2&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function Tp(i){let e,a,t,l,r;return{c(){e=g("p"),a=d("Tutti i modelli di \u{1F917} Transformers (PyTorch e TensorFlow) restituiscono i tensori "),t=g("em"),l=d("prima"),r=d(` della funzione finale
di attivazione (come la softmax) perch\xE9 la funzione di attivazione finale viene spesso unita a quella di perdita.`)},l(c){e=_(c,"P",{});var p=f(e);a=h(p,"Tutti i modelli di \u{1F917} Transformers (PyTorch e TensorFlow) restituiscono i tensori "),t=_(p,"EM",{});var m=f(t);l=h(m,"prima"),m.forEach(n),r=h(p,` della funzione finale
di attivazione (come la softmax) perch\xE9 la funzione di attivazione finale viene spesso unita a quella di perdita.`),p.forEach(n)},m(c,p){$(c,e,p),s(e,a),s(e,t),s(t,l),s(e,r)},d(c){c&&n(e)}}}function qp(i){let e,a,t,l,r;return{c(){e=g("p"),a=d(`Gli output del modello di \u{1F917} Transformers sono delle dataclasses speciali in modo che i loro attributi vengano auto-completati all\u2019interno di un IDE.
Gli output del modello si comportano anche come una tupla o un dizionario (ad esempio, puoi indicizzare con un intero, una slice o una stringa) nel qual caso gli attributi che sono `),t=g("code"),l=d("None"),r=d(" vengono ignorati.")},l(c){e=_(c,"P",{});var p=f(e);a=h(p,`Gli output del modello di \u{1F917} Transformers sono delle dataclasses speciali in modo che i loro attributi vengano auto-completati all\u2019interno di un IDE.
Gli output del modello si comportano anche come una tupla o un dizionario (ad esempio, puoi indicizzare con un intero, una slice o una stringa) nel qual caso gli attributi che sono `),t=_(p,"CODE",{});var m=f(t);l=h(m,"None"),m.forEach(n),r=h(p," vengono ignorati."),p.forEach(n)},m(c,p){$(c,e,p),s(e,a),s(e,t),s(t,l),s(e,r)},d(c){c&&n(e)}}}function Mp(i){let e,a,t,l,r,c,p,m,v,w,z,S,q,N,j,M;return p=new Y({props:{code:`pt_save_directory = "./pt_save_pretrained"
tokenizer.save_pretrained(pt_save_directory)
pt_model.save_pretrained(pt_save_directory)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>pt_save_directory = <span class="hljs-string">&quot;./pt_save_pretrained&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.save_pretrained(pt_save_directory)
<span class="hljs-meta">&gt;&gt;&gt; </span>pt_model.save_pretrained(pt_save_directory)`}}),j=new Y({props:{code:'pt_model = AutoModelForSequenceClassification.from_pretrained("./pt_save_pretrained")',highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>pt_model = AutoModelForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;./pt_save_pretrained&quot;</span>)'}}),{c(){e=g("p"),a=d("Una volta completato il fine-tuning del tuo modello, puoi salvarlo con il suo tokenizer utilizzando "),t=g("code"),l=d("PreTrainedModel.save_pretrained()"),r=d(":"),c=A(),P(p.$$.fragment),m=A(),v=g("p"),w=d("Quando desideri utilizzare il tuo modello nuovamente, puoi ri-caricarlo con "),z=g("code"),S=d("PreTrainedModel.from_pretrained()"),q=d(":"),N=A(),P(j.$$.fragment)},l(k){e=_(k,"P",{});var T=f(e);a=h(T,"Una volta completato il fine-tuning del tuo modello, puoi salvarlo con il suo tokenizer utilizzando "),t=_(T,"CODE",{});var F=f(t);l=h(F,"PreTrainedModel.save_pretrained()"),F.forEach(n),r=h(T,":"),T.forEach(n),c=y(k),O(p.$$.fragment,k),m=y(k),v=_(k,"P",{});var G=f(v);w=h(G,"Quando desideri utilizzare il tuo modello nuovamente, puoi ri-caricarlo con "),z=_(G,"CODE",{});var U=f(z);S=h(U,"PreTrainedModel.from_pretrained()"),U.forEach(n),q=h(G,":"),G.forEach(n),N=y(k),O(j.$$.fragment,k)},m(k,T){$(k,e,T),s(e,a),s(e,t),s(t,l),s(e,r),$(k,c,T),D(p,k,T),$(k,m,T),$(k,v,T),s(v,w),s(v,z),s(z,S),s(v,q),$(k,N,T),D(j,k,T),M=!0},p:Z,i(k){M||(E(p.$$.fragment,k),E(j.$$.fragment,k),M=!0)},o(k){C(p.$$.fragment,k),C(j.$$.fragment,k),M=!1},d(k){k&&n(e),k&&n(c),I(p,k),k&&n(m),k&&n(v),k&&n(N),I(j,k)}}}function Sp(i){let e,a;return e=new De({props:{$$slots:{default:[Mp]},$$scope:{ctx:i}}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p(t,l){const r={};l&2&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function Np(i){let e,a,t,l,r,c,p,m,v,w,z,S,q,N,j,M;return p=new Y({props:{code:`tf_save_directory = "./tf_save_pretrained"
tokenizer.save_pretrained(tf_save_directory)
tf_model.save_pretrained(tf_save_directory)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>tf_save_directory = <span class="hljs-string">&quot;./tf_save_pretrained&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.save_pretrained(tf_save_directory)
<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model.save_pretrained(tf_save_directory)`}}),j=new Y({props:{code:'tf_model = TFAutoModelForSequenceClassification.from_pretrained("./tf_save_pretrained")',highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model = TFAutoModelForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;./tf_save_pretrained&quot;</span>)'}}),{c(){e=g("p"),a=d("Una volta completato il fine-tuning del tuo modello, puoi salvarlo con il suo tokenizer utilizzando "),t=g("code"),l=d("TFPreTrainedModel.save_pretrained()"),r=d(":"),c=A(),P(p.$$.fragment),m=A(),v=g("p"),w=d("Quando desideri utilizzare il tuo modello nuovamente, puoi ri-caricarlo con "),z=g("code"),S=d("TFPreTrainedModel.from_pretrained()"),q=d(":"),N=A(),P(j.$$.fragment)},l(k){e=_(k,"P",{});var T=f(e);a=h(T,"Una volta completato il fine-tuning del tuo modello, puoi salvarlo con il suo tokenizer utilizzando "),t=_(T,"CODE",{});var F=f(t);l=h(F,"TFPreTrainedModel.save_pretrained()"),F.forEach(n),r=h(T,":"),T.forEach(n),c=y(k),O(p.$$.fragment,k),m=y(k),v=_(k,"P",{});var G=f(v);w=h(G,"Quando desideri utilizzare il tuo modello nuovamente, puoi ri-caricarlo con "),z=_(G,"CODE",{});var U=f(z);S=h(U,"TFPreTrainedModel.from_pretrained()"),U.forEach(n),q=h(G,":"),G.forEach(n),N=y(k),O(j.$$.fragment,k)},m(k,T){$(k,e,T),s(e,a),s(e,t),s(t,l),s(e,r),$(k,c,T),D(p,k,T),$(k,m,T),$(k,v,T),s(v,w),s(v,z),s(z,S),s(v,q),$(k,N,T),D(j,k,T),M=!0},p:Z,i(k){M||(E(p.$$.fragment,k),E(j.$$.fragment,k),M=!0)},o(k){C(p.$$.fragment,k),C(j.$$.fragment,k),M=!1},d(k){k&&n(e),k&&n(c),I(p,k),k&&n(m),k&&n(v),k&&n(N),I(j,k)}}}function Pp(i){let e,a;return e=new De({props:{$$slots:{default:[Np]},$$scope:{ctx:i}}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p(t,l){const r={};l&2&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function Dp(i){let e,a;return e=new Y({props:{code:`from transformers import AutoModel

tokenizer = AutoTokenizer.from_pretrained(tf_save_directory)
pt_model = AutoModelForSequenceClassification.from_pretrained(tf_save_directory, from_tf=True)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(tf_save_directory)
<span class="hljs-meta">&gt;&gt;&gt; </span>pt_model = AutoModelForSequenceClassification.from_pretrained(tf_save_directory, from_tf=<span class="hljs-literal">True</span>)`}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p:Z,i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function Ip(i){let e,a;return e=new De({props:{$$slots:{default:[Dp]},$$scope:{ctx:i}}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p(t,l){const r={};l&2&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function Op(i){let e,a;return e=new Y({props:{code:`from transformers import TFAutoModel

tokenizer = AutoTokenizer.from_pretrained(pt_save_directory)
tf_model = TFAutoModelForSequenceClassification.from_pretrained(pt_save_directory, from_pt=True)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(pt_save_directory)
<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model = TFAutoModelForSequenceClassification.from_pretrained(pt_save_directory, from_pt=<span class="hljs-literal">True</span>)`}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p:Z,i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function Fp(i){let e,a;return e=new De({props:{$$slots:{default:[Op]},$$scope:{ctx:i}}}),{c(){P(e.$$.fragment)},l(t){O(e.$$.fragment,t)},m(t,l){D(e,t,l),a=!0},p(t,l){const r={};l&2&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(t){a||(E(e.$$.fragment,t),a=!0)},o(t){C(e.$$.fragment,t),a=!1},d(t){I(e,t)}}}function Lp(i){let e,a,t,l,r,c,p,m,v,w,z,S,q,N,j,M,k,T,F,G,U,R,W,K,x,ne,oe,se,de,ie,he,re,ee,ce,ge,H,J,le,L,Q,ue,$e,X,Se,ae,Ne,Ee,Ie,be,te,Oe,_s,vs,Il,$s,bs,Ol,ws,ks,Fl,zs,Es,Ll,js,Cs,Hl,As,ys,Rl,Ts,qs,Bl,Ms,Va,Mt,Vl,Ss,Ns,Ua,Fe,Ul,Ps,Ds,Jl,Is,Os,Gl,Fs,Ja,St,Kl,Ls,Hs,Ga,at,Ql,Rs,Bs,Zl,Vs,Ka,ot,Qa,xe,st,xl,Nt,Us,Wl,Js,Za,nt,Gs,Yl,Ks,Qs,xa,cl,Zs,Wa,rt,Ya,it,xs,Xl,Ws,Ys,Xa,Pt,eo,Le,Xs,Dt,en,tn,ea,ln,an,to,It,lo,ct,on,ta,sn,nn,ao,Ot,oo,He,rn,la,cn,un,Ft,fn,pn,so,Lt,no,ut,mn,aa,dn,hn,ro,Ht,io,Re,gn,Rt,_n,vn,Bt,$n,bn,co,Vt,uo,ft,wn,oa,kn,zn,fo,Ut,po,ul,En,mo,Jt,ho,pt,jn,fl,Cn,An,go,We,mt,sa,Gt,yn,na,Tn,_o,je,qn,ra,Mn,Sn,Kt,Nn,Pn,ia,Dn,In,Qt,On,Fn,vo,Zt,$o,dt,bo,Be,Ln,ca,Hn,Rn,ua,Bn,Vn,wo,xt,ko,Ve,Un,pl,Jn,Gn,ml,Kn,Qn,zo,Ye,ht,fa,Wt,Zn,pa,xn,Eo,Yt,jo,_e,Wn,ma,Yn,Xn,da,er,tr,ha,lr,ar,dl,or,sr,ga,nr,rr,_a,ir,cr,Co,Ue,ur,va,fr,pr,$a,mr,dr,Ao,Xe,gt,ba,Xt,hr,wa,gr,yo,Je,_r,ka,vr,$r,hl,br,wr,To,_t,kr,za,zr,Er,qo,el,Mo,vt,jr,Ea,Cr,Ar,So,gl,yr,No,tl,Po,_l,Tr,Do,$t,vl,$l,qr,Mr,Sr,bl,wl,Nr,Pr,Io,bt,Dr,ja,Ir,Or,Oo,wt,Fo,kt,Fr,kl,Lr,Hr,Lo,et,zt,Ca,ll,Rr,Aa,Br,Ho,Et,Ro,jt,Bo,ve,Vr,al,ya,Ur,Jr,ol,Ta,Gr,Kr,qa,Qr,Zr,Ma,xr,Wr,sl,Yr,Xr,zl,ei,ti,Vo,Ct,Uo,tt,At,Sa,nl,li,Na,ai,Jo,yt,Go,Ge,oi,Pa,si,ni,Da,ri,ii,Ko,Tt,Qo;return c=new qt({}),z=new Ff({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/it/quicktour.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/it/pytorch/quicktour.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/it/tensorflow/quicktour.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/it/quicktour.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/it/pytorch/quicktour.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/it/tensorflow/quicktour.ipynb"}]}}),R=new Pl({props:{$$slots:{default:[cp]},$$scope:{ctx:i}}}),oe=new qt({}),J=new Yc({props:{id:"tiZFewofSLM"}}),ot=new Pl({props:{$$slots:{default:[up]},$$scope:{ctx:i}}}),Nt=new qt({}),rt=new Nl({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[dp],pytorch:[pp]},$$scope:{ctx:i}}}),Pt=new Y({props:{code:`from transformers import pipeline

classificatore = pipeline("sentiment-analysis", model="MilaNLProc/feel-it-italian-sentiment")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>classificatore = pipeline(<span class="hljs-string">&quot;sentiment-analysis&quot;</span>, model=<span class="hljs-string">&quot;MilaNLProc/feel-it-italian-sentiment&quot;</span>)`}}),It=new Y({props:{code:'classificatore("Siamo molto felici di mostrarti la libreria \u{1F917} Transformers.")',highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>classificatore(<span class="hljs-string">&quot;Siamo molto felici di mostrarti la libreria \u{1F917} Transformers.&quot;</span>)
[{<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.9997</span>}]`}}),Ot=new Y({props:{code:`risultati = classificatore(
    ["Siamo molto felici di mostrarti la libreria \u{1F917} Transformers.", "Speriamo te non la odierai."]
)
for risultato in risultati:
    print(f"etichetta: {risultato['label']}, con punteggio: {round(risultato['score'], 4)}")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>risultati = classificatore(
<span class="hljs-meta">... </span>    [<span class="hljs-string">&quot;Siamo molto felici di mostrarti la libreria \u{1F917} Transformers.&quot;</span>, <span class="hljs-string">&quot;Speriamo te non la odierai.&quot;</span>]
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> risultato <span class="hljs-keyword">in</span> risultati:
<span class="hljs-meta">... </span>    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;etichetta: <span class="hljs-subst">{risultato[<span class="hljs-string">&#x27;label&#x27;</span>]}</span>, con punteggio: <span class="hljs-subst">{<span class="hljs-built_in">round</span>(risultato[<span class="hljs-string">&#x27;score&#x27;</span>], <span class="hljs-number">4</span>)}</span>&quot;</span>)
etichetta: positive, con punteggio: <span class="hljs-number">0.9998</span>
etichetta: negative, con punteggio: <span class="hljs-number">0.9998</span>`}}),Lt=new Y({props:{code:"pip install datasets ",highlighted:"pip install datasets "}}),Ht=new Y({props:{code:`import torch
from transformers import pipeline

riconoscitore_vocale = pipeline(
    "automatic-speech-recognition", model="radiogroup-crits/wav2vec2-xls-r-1b-italian-doc4lm-5gram"
)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>riconoscitore_vocale = pipeline(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;automatic-speech-recognition&quot;</span>, model=<span class="hljs-string">&quot;radiogroup-crits/wav2vec2-xls-r-1b-italian-doc4lm-5gram&quot;</span>
<span class="hljs-meta">... </span>)`}}),Vt=new Y({props:{code:`from datasets import load_dataset, Audio

dataset = load_dataset("PolyAI/minds14", name="it-IT", split="train")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset, Audio

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;PolyAI/minds14&quot;</span>, name=<span class="hljs-string">&quot;it-IT&quot;</span>, split=<span class="hljs-string">&quot;train&quot;</span>)`}}),Ut=new Y({props:{code:'dataset = dataset.cast_column("audio", Audio(sampling_rate=riconoscitore_vocale.feature_extractor.sampling_rate))',highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.cast_column(<span class="hljs-string">&quot;audio&quot;</span>, Audio(sampling_rate=riconoscitore_vocale.feature_extractor.sampling_rate))'}}),Jt=new Y({props:{code:`risultato = riconoscitore_vocale(dataset[:4]["audio"])
print([d["text"] for d in risultato])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>risultato = riconoscitore_vocale(dataset[:<span class="hljs-number">4</span>][<span class="hljs-string">&quot;audio&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>([d[<span class="hljs-string">&quot;text&quot;</span>] <span class="hljs-keyword">for</span> d <span class="hljs-keyword">in</span> risultato])
[<span class="hljs-string">&#x27;dovrei caricare dei soldi sul mio conto corrente&#x27;</span>, <span class="hljs-string">&#x27;buongiorno e senza vorrei depositare denaro sul mio conto corrente come devo fare per cortesia&#x27;</span>, <span class="hljs-string">&#x27;s\xEC salve vorrei depositare del denaro sul mio conto&#x27;</span>, <span class="hljs-string">&#x27;e buon pomeriggio vorrei depositare dei soldi sul mio conto bancario volleo sapere come posso fare se e posso farlo online ed un altro conto o andandoo tramite bancomut&#x27;</span>]`}}),Gt=new qt({}),Zt=new Y({props:{code:'model_name = "nlptown/bert-base-multilingual-uncased-sentiment"',highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model_name = <span class="hljs-string">&quot;nlptown/bert-base-multilingual-uncased-sentiment&quot;</span>'}}),dt=new Nl({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[vp],pytorch:[gp]},$$scope:{ctx:i}}}),xt=new Y({props:{code:`classifier = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
classifier("Nous sommes tr\xE8s heureux de vous pr\xE9senter la biblioth\xE8que \u{1F917} Transformers.")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>classifier = pipeline(<span class="hljs-string">&quot;sentiment-analysis&quot;</span>, model=model, tokenizer=tokenizer)
<span class="hljs-meta">&gt;&gt;&gt; </span>classifier(<span class="hljs-string">&quot;Nous sommes tr\xE8s heureux de vous pr\xE9senter la biblioth\xE8que \u{1F917} Transformers.&quot;</span>)
[{<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;5 stars&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.7273</span>}]`}}),Wt=new qt({}),Yt=new Yc({props:{id:"AhChOFRegn4"}}),Xt=new qt({}),el=new Y({props:{code:`from transformers import AutoTokenizer

nome_del_modello = "nlptown/bert-base-multilingual-uncased-sentiment"
tokenizer = AutoTokenizer.from_pretrained(nome_del_modello)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>nome_del_modello = <span class="hljs-string">&quot;nlptown/bert-base-multilingual-uncased-sentiment&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(nome_del_modello)`}}),tl=new Y({props:{code:`encoding = tokenizer("Siamo molto felici di mostrarti la libreria \u{1F917} Transformers.")
print(encoding)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(<span class="hljs-string">&quot;Siamo molto felici di mostrarti la libreria \u{1F917} Transformers.&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(encoding)
{<span class="hljs-string">&#x27;input_ids&#x27;</span>: [<span class="hljs-number">101</span>, <span class="hljs-number">56821</span>, <span class="hljs-number">10132</span>, <span class="hljs-number">14407</span>, <span class="hljs-number">13019</span>, <span class="hljs-number">13007</span>, <span class="hljs-number">10120</span>, <span class="hljs-number">47201</span>, <span class="hljs-number">10330</span>, <span class="hljs-number">10106</span>, <span class="hljs-number">91686</span>, <span class="hljs-number">100</span>, <span class="hljs-number">58263</span>, <span class="hljs-number">119</span>, <span class="hljs-number">102</span>],
<span class="hljs-string">&#x27;token_type_ids&#x27;</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-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>: [<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>]}`}}),wt=new Nl({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[kp],pytorch:[bp]},$$scope:{ctx:i}}}),ll=new qt({}),Et=new Nl({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[yp],pytorch:[jp]},$$scope:{ctx:i}}}),jt=new Pl({props:{$$slots:{default:[Tp]},$$scope:{ctx:i}}}),Ct=new Pl({props:{$$slots:{default:[qp]},$$scope:{ctx:i}}}),nl=new qt({}),yt=new Nl({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Pp],pytorch:[Sp]},$$scope:{ctx:i}}}),Tt=new Nl({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Fp],pytorch:[Ip]},$$scope:{ctx:i}}}),{c(){e=g("meta"),a=A(),t=g("h1"),l=g("a"),r=g("span"),P(c.$$.fragment),p=A(),m=g("span"),v=d("Quick tour"),w=A(),P(z.$$.fragment),S=A(),q=g("p"),N=d("Entra in azione con \u{1F917} Transformers! Inizia utilizzando "),j=g("code"),M=d("pipeline()"),k=d(" per un\u2019inferenza veloce, carica un modello pre-allenato e un tokenizer con una "),T=g("a"),F=d("AutoClass"),G=d(" per risolvere i tuoi compiti legati a testo, immagini o audio."),U=A(),P(R.$$.fragment),W=A(),K=g("h2"),x=g("a"),ne=g("span"),P(oe.$$.fragment),se=A(),de=g("span"),ie=d("Pipeline"),he=A(),re=g("p"),ee=g("code"),ce=d("pipeline()"),ge=d(" \xE8 il modo pi\xF9 semplice per utilizzare un modello pre-allenato per un dato compito."),H=A(),P(J.$$.fragment),le=A(),L=g("p"),Q=d("La "),ue=g("code"),$e=d("pipeline()"),X=d(" supporta molti compiti comuni:"),Se=A(),ae=g("p"),Ne=g("strong"),Ee=d("Testo"),Ie=d(":"),be=A(),te=g("ul"),Oe=g("li"),_s=d("Analisi del Sentimento (Sentiment Analysis, in inglese): classifica la polarit\xE0 di un testo dato."),vs=A(),Il=g("li"),$s=d("Generazione del Testo (Text Generation, in inglese): genera del testo a partire da un dato input."),bs=A(),Ol=g("li"),ws=d("Riconoscimento di Entit\xE0 (Name Entity Recognition o NER, in inglese): etichetta ogni parola con l\u2019entit\xE0 che questa rappresenta (persona, data, luogo, ecc.)."),ks=A(),Fl=g("li"),zs=d("Rispondere a Domande (Question answering, in inglese): estrae la risposta da un contesto, dato del contesto e una domanda."),Es=A(),Ll=g("li"),js=d("Riempimento di Maschere (Fill-mask, in inglese): riempie gli spazi mancanti in un testo che ha parole mascherate."),Cs=A(),Hl=g("li"),As=d("Riassumere (Summarization, in inglese): genera una sintesi di una lunga sequenza di testo o di un documento."),ys=A(),Rl=g("li"),Ts=d("Traduzione (Translation, in inglese): traduce un testo in un\u2019altra lingua."),qs=A(),Bl=g("li"),Ms=d("Estrazione di Caratteristiche (Feature Extraction, in inglese): crea un tensore che rappresenta un testo."),Va=A(),Mt=g("p"),Vl=g("strong"),Ss=d("Immagini"),Ns=d(":"),Ua=A(),Fe=g("ul"),Ul=g("li"),Ps=d("Classificazione di Immagini (Image Classification, in inglese): classifica un\u2019immagine."),Ds=A(),Jl=g("li"),Is=d("Segmentazione di Immagini (Image Segmentation, in inglese): classifica ogni pixel di un\u2019immagine."),Os=A(),Gl=g("li"),Fs=d("Rilevazione di Oggetti (Object Detection, in inglese): rileva oggetti all\u2019interno di un\u2019immagine."),Ja=A(),St=g("p"),Kl=g("strong"),Ls=d("Audio"),Hs=d(":"),Ga=A(),at=g("ul"),Ql=g("li"),Rs=d("Classificazione di Audio (Audio Classification, in inglese): assegna un\u2019etichetta ad un segmento di audio dato."),Bs=A(),Zl=g("li"),Vs=d("Riconoscimento Vocale Automatico (Automatic Speech Recognition o ASR, in inglese): trascrive il contenuto di un audio dato in un testo."),Ka=A(),P(ot.$$.fragment),Qa=A(),xe=g("h3"),st=g("a"),xl=g("span"),P(Nt.$$.fragment),Us=A(),Wl=g("span"),Js=d("Utilizzo della Pipeline"),Za=A(),nt=g("p"),Gs=d("Nel seguente esempio, utilizzerai la "),Yl=g("code"),Ks=d("pipeline()"),Qs=d(" per l\u2019analisi del sentimento."),xa=A(),cl=g("p"),Zs=d("Installa le seguenti dipendenze se non lo hai gi\xE0 fatto:"),Wa=A(),P(rt.$$.fragment),Ya=A(),it=g("p"),xs=d("Importa "),Xl=g("code"),Ws=d("pipeline()"),Ys=d(" e specifica il compito che vuoi completare:"),Xa=A(),P(Pt.$$.fragment),eo=A(),Le=g("p"),Xs=d("La pipeline scarica e salva il "),Dt=g("a"),en=d("modello pre-allenato"),tn=d(" e il tokenizer per l\u2019analisi del sentimento. Se non avessimo scelto un modello, la pipeline ne avrebbe scelto uno di default. Ora puoi utilizzare il "),ea=g("code"),ln=d("classifier"),an=d(" sul tuo testo obiettivo:"),to=A(),P(It.$$.fragment),lo=A(),ct=g("p"),on=d("Per pi\xF9 di una frase, passa una lista di frasi alla "),ta=g("code"),sn=d("pipeline()"),nn=d(" la quale restituir\xE0 una lista di dizionari:"),ao=A(),P(Ot.$$.fragment),oo=A(),He=g("p"),rn=d("La "),la=g("code"),cn=d("pipeline()"),un=d(" pu\xF2 anche iterare su un dataset intero. Inizia installando la libreria "),Ft=g("a"),fn=d("\u{1F917} Datasets"),pn=d(":"),so=A(),P(Lt.$$.fragment),no=A(),ut=g("p"),mn=d("Crea una "),aa=g("code"),dn=d("pipeline()"),hn=d(" con il compito che vuoi risolvere e con il modello che vuoi utilizzare."),ro=A(),P(Ht.$$.fragment),io=A(),Re=g("p"),gn=d("Poi, carica un dataset (vedi \u{1F917} Datasets "),Rt=g("a"),_n=d("Quick Start"),vn=d(" per maggiori dettagli) sul quale vuoi iterare. Per esempio, carichiamo il dataset "),Bt=g("a"),$n=d("MInDS-14"),bn=d(":"),co=A(),P(Vt.$$.fragment),uo=A(),ft=g("p"),wn=d("Dobbiamo assicurarci che la frequenza di campionamento del set di dati corrisponda alla frequenza di campionamento con cui \xE8 stato addestrato "),oa=g("code"),kn=d("radiogroup-crits/wav2vec2-xls-r-1b-italian-doc4lm-5gram"),zn=d("."),fo=A(),P(Ut.$$.fragment),po=A(),ul=g("p"),En=d(`I file audio vengono caricati automaticamente e ri-campionati quando chiamiamo la colonna \u201Caudio\u201D.
Estraiamo i vettori delle forme d\u2019onda grezze delle prime 4 osservazioni e passiamoli come lista alla pipeline:`),mo=A(),P(Jt.$$.fragment),ho=A(),pt=g("p"),jn=d("Per un dataset pi\xF9 grande dove gli input sono di dimensione maggiore (come nel parlato/audio o nella visione), dovrai passare un generatore al posto di una lista che carica tutti gli input in memoria. Guarda la "),fl=g("a"),Cn=d("documentazione della pipeline"),An=d(" per maggiori informazioni."),go=A(),We=g("h3"),mt=g("a"),sa=g("span"),P(Gt.$$.fragment),yn=A(),na=g("span"),Tn=d("Utilizzare un altro modello e tokenizer nella pipeline"),_o=A(),je=g("p"),qn=d("La "),ra=g("code"),Mn=d("pipeline()"),Sn=d(" pu\xF2 ospitare qualsiasi modello del "),Kt=g("a"),Nn=d("Model Hub"),Pn=d(", rendendo semplice l\u2019adattamento della "),ia=g("code"),Dn=d("pipeline()"),In=d(" per altri casi d\u2019uso. Per esempio, se si vuole un modello capace di trattare testo in francese, usa i tag presenti nel Model Hub in modo da filtrare per ottenere un modello appropriato. Il miglior risultato filtrato restituisce un modello multi-lingua "),Qt=g("a"),On=d("BERT model"),Fn=d(" fine-tuned per l\u2019analisi del sentimento. Ottimo, utilizziamo questo modello!"),vo=A(),P(Zt.$$.fragment),$o=A(),P(dt.$$.fragment),bo=A(),Be=g("p"),Ln=d("Poi puoi specificare il modello e il tokenizer nella "),ca=g("code"),Hn=d("pipeline()"),Rn=d(", e applicare il "),ua=g("code"),Bn=d("classifier"),Vn=d(" sul tuo testo obiettivo:"),wo=A(),P(xt.$$.fragment),ko=A(),Ve=g("p"),Un=d("Se non riesci a trovare un modello per il tuo caso d\u2019uso, dovrai fare fine-tuning di un modello pre-allenato sui tuoi dati. Dai un\u2019occhiata al nostro tutorial "),pl=g("a"),Jn=d("fine-tuning tutorial"),Gn=d(" per imparare come. Infine, dopo che hai completato il fine-tuning del tuo modello pre-allenato, considera per favore di condividerlo (vedi il tutorial "),ml=g("a"),Kn=d("qui"),Qn=d(") con la comunit\xE0 sul Model Hub per democratizzare l\u2019NLP! \u{1F917}"),zo=A(),Ye=g("h2"),ht=g("a"),fa=g("span"),P(Wt.$$.fragment),Zn=A(),pa=g("span"),xn=d("AutoClass"),Eo=A(),P(Yt.$$.fragment),jo=A(),_e=g("p"),Wn=d("Al suo interno, le classi "),ma=g("code"),Yn=d("AutoModelForSequenceClassification"),Xn=d(" e "),da=g("code"),er=d("AutoTokenizer"),tr=d(" lavorano assieme per dare potere alla "),ha=g("code"),lr=d("pipeline()"),ar=d(". Una "),dl=g("a"),or=d("AutoClass"),sr=d(" \xE8 una scorciatoia che automaticamente recupera l\u2019architettura di un modello pre-allenato a partire dal suo nome o path. Hai solo bisogno di selezionare la "),ga=g("code"),nr=d("AutoClass"),rr=d(" appropriata per il tuo compito e il suo tokenizer associato con "),_a=g("code"),ir=d("AutoTokenizer"),cr=d("."),Co=A(),Ue=g("p"),ur=d("Ritorniamo al nostro esempio e vediamo come puoi utilizzare la "),va=g("code"),fr=d("AutoClass"),pr=d(" per replicare i risultati della "),$a=g("code"),mr=d("pipeline()"),dr=d("."),Ao=A(),Xe=g("h3"),gt=g("a"),ba=g("span"),P(Xt.$$.fragment),hr=A(),wa=g("span"),gr=d("AutoTokenizer"),yo=A(),Je=g("p"),_r=d("Un tokenizer \xE8 responsabile dell\u2019elaborazione del testo in modo da trasformarlo in un formato comprensibile dal modello. Per prima cosa, il tokenizer divider\xE0 il testo in parole chiamate "),ka=g("em"),vr=d("token"),$r=d(". Ci sono diverse regole che governano il processo di tokenizzazione, tra cui come dividere una parola e a quale livello (impara di pi\xF9 sulla tokenizzazione "),hl=g("a"),br=d("qui"),wr=d("). La cosa pi\xF9 importante da ricordare comunque \xE8 che hai bisogno di inizializzare il tokenizer con lo stesso nome del modello in modo da assicurarti che stai utilizzando le stesse regole di tokenizzazione con cui il modello \xE8 stato pre-allenato."),To=A(),_t=g("p"),kr=d("Carica un tokenizer con "),za=g("code"),zr=d("AutoTokenizer"),Er=d(":"),qo=A(),P(el.$$.fragment),Mo=A(),vt=g("p"),jr=d("Dopodich\xE9, il tokenizer converte i token in numeri in modo da costruire un tensore come input del modello. Questo \xE8 conosciuto come il "),Ea=g("em"),Cr=d("vocabolario"),Ar=d(" del modello."),So=A(),gl=g("p"),yr=d("Passa il tuo testo al tokenizer:"),No=A(),P(tl.$$.fragment),Po=A(),_l=g("p"),Tr=d("Il tokenizer restituir\xE0 un dizionario contenente:"),Do=A(),$t=g("ul"),vl=g("li"),$l=g("a"),qr=d("input_ids"),Mr=d(": rappresentazioni numeriche dei tuoi token."),Sr=A(),bl=g("li"),wl=g("a"),Nr=d("attention_mask"),Pr=d(": indica quali token devono essere presi in considerazione."),Io=A(),bt=g("p"),Dr=d("Come con la "),ja=g("code"),Ir=d("pipeline()"),Or=d(", il tokenizer accetter\xE0 una lista di input. In pi\xF9, il tokenizer pu\xF2 anche completare (pad, in inglese) e troncare il testo in modo da restituire un lotto (batch, in inglese) di lunghezza uniforme:"),Oo=A(),P(wt.$$.fragment),Fo=A(),kt=g("p"),Fr=d("Leggi il tutorial sul "),kl=g("a"),Lr=d("preproccesing"),Hr=d(" per maggiori dettagli sulla tokenizzazione."),Lo=A(),et=g("h3"),zt=g("a"),Ca=g("span"),P(ll.$$.fragment),Rr=A(),Aa=g("span"),Br=d("AutoModel"),Ho=A(),P(Et.$$.fragment),Ro=A(),P(jt.$$.fragment),Bo=A(),ve=g("p"),Vr=d("I modelli sono "),al=g("a"),ya=g("code"),Ur=d("torch.nn.Module"),Jr=d(" o "),ol=g("a"),Ta=g("code"),Gr=d("tf.keras.Model"),Kr=d(" standard cos\xEC puoi utilizzarli all\u2019interno del tuo training loop usuale. Tuttavia, per rendere le cose pi\xF9 semplici, \u{1F917} Transformers fornisce una classe "),qa=g("code"),Qr=d("Trainer"),Zr=d(" per PyTorch che aggiunge delle funzionalit\xE0 per l\u2019allenamento distribuito, precisione mista, e altro ancora. Per TensorFlow, puoi utilizzare il metodo "),Ma=g("code"),xr=d("fit"),Wr=d(" di "),sl=g("a"),Yr=d("Keras"),Xr=d(". Fai riferimento al "),zl=g("a"),ei=d("tutorial per il training"),ti=d(" per maggiori dettagli."),Vo=A(),P(Ct.$$.fragment),Uo=A(),tt=g("h3"),At=g("a"),Sa=g("span"),P(nl.$$.fragment),li=A(),Na=g("span"),ai=d("Salva un modello"),Jo=A(),P(yt.$$.fragment),Go=A(),Ge=g("p"),oi=d("Una caratteristica particolarmente interessante di \u{1F917} Transformers \xE8 la sua abilit\xE0 di salvare un modello e ri-caricarlo sia come modello di PyTorch che di TensorFlow. I parametri "),Pa=g("code"),si=d("from_pt"),ni=d(" o "),Da=g("code"),ri=d("from_tf"),ii=d(" possono convertire un modello da un framework all\u2019altro:"),Ko=A(),P(Tt.$$.fragment),this.h()},l(o){const b=Mu('[data-svelte="svelte-1phssyn"]',document.head);e=_(b,"META",{name:!0,content:!0}),b.forEach(n),a=y(o),t=_(o,"H1",{class:!0});var rl=f(t);l=_(rl,"A",{id:!0,class:!0,href:!0});var Ia=f(l);r=_(Ia,"SPAN",{});var Oa=f(r);O(c.$$.fragment,Oa),Oa.forEach(n),Ia.forEach(n),p=y(rl),m=_(rl,"SPAN",{});var Fa=f(m);v=h(Fa,"Quick tour"),Fa.forEach(n),rl.forEach(n),w=y(o),O(z.$$.fragment,o),S=y(o),q=_(o,"P",{});var lt=f(q);N=h(lt,"Entra in azione con \u{1F917} Transformers! Inizia utilizzando "),j=_(lt,"CODE",{});var La=f(j);M=h(La,"pipeline()"),La.forEach(n),k=h(lt," per un\u2019inferenza veloce, carica un modello pre-allenato e un tokenizer con una "),T=_(lt,"A",{href:!0});var Ha=f(T);F=h(Ha,"AutoClass"),Ha.forEach(n),G=h(lt," per risolvere i tuoi compiti legati a testo, immagini o audio."),lt.forEach(n),U=y(o),O(R.$$.fragment,o),W=y(o),K=_(o,"H2",{class:!0});var il=f(K);x=_(il,"A",{id:!0,class:!0,href:!0});var Ra=f(x);ne=_(Ra,"SPAN",{});var Ba=f(ne);O(oe.$$.fragment,Ba),Ba.forEach(n),Ra.forEach(n),se=y(il),de=_(il,"SPAN",{});var $i=f(de);ie=h($i,"Pipeline"),$i.forEach(n),il.forEach(n),he=y(o),re=_(o,"P",{});var ci=f(re);ee=_(ci,"CODE",{});var bi=f(ee);ce=h(bi,"pipeline()"),bi.forEach(n),ge=h(ci," \xE8 il modo pi\xF9 semplice per utilizzare un modello pre-allenato per un dato compito."),ci.forEach(n),H=y(o),O(J.$$.fragment,o),le=y(o),L=_(o,"P",{});var Zo=f(L);Q=h(Zo,"La "),ue=_(Zo,"CODE",{});var wi=f(ue);$e=h(wi,"pipeline()"),wi.forEach(n),X=h(Zo," supporta molti compiti comuni:"),Zo.forEach(n),Se=y(o),ae=_(o,"P",{});var ui=f(ae);Ne=_(ui,"STRONG",{});var ki=f(Ne);Ee=h(ki,"Testo"),ki.forEach(n),Ie=h(ui,":"),ui.forEach(n),be=y(o),te=_(o,"UL",{});var we=f(te);Oe=_(we,"LI",{});var zi=f(Oe);_s=h(zi,"Analisi del Sentimento (Sentiment Analysis, in inglese): classifica la polarit\xE0 di un testo dato."),zi.forEach(n),vs=y(we),Il=_(we,"LI",{});var Ei=f(Il);$s=h(Ei,"Generazione del Testo (Text Generation, in inglese): genera del testo a partire da un dato input."),Ei.forEach(n),bs=y(we),Ol=_(we,"LI",{});var ji=f(Ol);ws=h(ji,"Riconoscimento di Entit\xE0 (Name Entity Recognition o NER, in inglese): etichetta ogni parola con l\u2019entit\xE0 che questa rappresenta (persona, data, luogo, ecc.)."),ji.forEach(n),ks=y(we),Fl=_(we,"LI",{});var Ci=f(Fl);zs=h(Ci,"Rispondere a Domande (Question answering, in inglese): estrae la risposta da un contesto, dato del contesto e una domanda."),Ci.forEach(n),Es=y(we),Ll=_(we,"LI",{});var Ai=f(Ll);js=h(Ai,"Riempimento di Maschere (Fill-mask, in inglese): riempie gli spazi mancanti in un testo che ha parole mascherate."),Ai.forEach(n),Cs=y(we),Hl=_(we,"LI",{});var yi=f(Hl);As=h(yi,"Riassumere (Summarization, in inglese): genera una sintesi di una lunga sequenza di testo o di un documento."),yi.forEach(n),ys=y(we),Rl=_(we,"LI",{});var Ti=f(Rl);Ts=h(Ti,"Traduzione (Translation, in inglese): traduce un testo in un\u2019altra lingua."),Ti.forEach(n),qs=y(we),Bl=_(we,"LI",{});var qi=f(Bl);Ms=h(qi,"Estrazione di Caratteristiche (Feature Extraction, in inglese): crea un tensore che rappresenta un testo."),qi.forEach(n),we.forEach(n),Va=y(o),Mt=_(o,"P",{});var fi=f(Mt);Vl=_(fi,"STRONG",{});var Mi=f(Vl);Ss=h(Mi,"Immagini"),Mi.forEach(n),Ns=h(fi,":"),fi.forEach(n),Ua=y(o),Fe=_(o,"UL",{});var El=f(Fe);Ul=_(El,"LI",{});var Si=f(Ul);Ps=h(Si,"Classificazione di Immagini (Image Classification, in inglese): classifica un\u2019immagine."),Si.forEach(n),Ds=y(El),Jl=_(El,"LI",{});var Ni=f(Jl);Is=h(Ni,"Segmentazione di Immagini (Image Segmentation, in inglese): classifica ogni pixel di un\u2019immagine."),Ni.forEach(n),Os=y(El),Gl=_(El,"LI",{});var Pi=f(Gl);Fs=h(Pi,"Rilevazione di Oggetti (Object Detection, in inglese): rileva oggetti all\u2019interno di un\u2019immagine."),Pi.forEach(n),El.forEach(n),Ja=y(o),St=_(o,"P",{});var pi=f(St);Kl=_(pi,"STRONG",{});var Di=f(Kl);Ls=h(Di,"Audio"),Di.forEach(n),Hs=h(pi,":"),pi.forEach(n),Ga=y(o),at=_(o,"UL",{});var xo=f(at);Ql=_(xo,"LI",{});var Ii=f(Ql);Rs=h(Ii,"Classificazione di Audio (Audio Classification, in inglese): assegna un\u2019etichetta ad un segmento di audio dato."),Ii.forEach(n),Bs=y(xo),Zl=_(xo,"LI",{});var Oi=f(Zl);Vs=h(Oi,"Riconoscimento Vocale Automatico (Automatic Speech Recognition o ASR, in inglese): trascrive il contenuto di un audio dato in un testo."),Oi.forEach(n),xo.forEach(n),Ka=y(o),O(ot.$$.fragment,o),Qa=y(o),xe=_(o,"H3",{class:!0});var Wo=f(xe);st=_(Wo,"A",{id:!0,class:!0,href:!0});var Fi=f(st);xl=_(Fi,"SPAN",{});var Li=f(xl);O(Nt.$$.fragment,Li),Li.forEach(n),Fi.forEach(n),Us=y(Wo),Wl=_(Wo,"SPAN",{});var Hi=f(Wl);Js=h(Hi,"Utilizzo della Pipeline"),Hi.forEach(n),Wo.forEach(n),Za=y(o),nt=_(o,"P",{});var Yo=f(nt);Gs=h(Yo,"Nel seguente esempio, utilizzerai la "),Yl=_(Yo,"CODE",{});var Ri=f(Yl);Ks=h(Ri,"pipeline()"),Ri.forEach(n),Qs=h(Yo," per l\u2019analisi del sentimento."),Yo.forEach(n),xa=y(o),cl=_(o,"P",{});var Bi=f(cl);Zs=h(Bi,"Installa le seguenti dipendenze se non lo hai gi\xE0 fatto:"),Bi.forEach(n),Wa=y(o),O(rt.$$.fragment,o),Ya=y(o),it=_(o,"P",{});var Xo=f(it);xs=h(Xo,"Importa "),Xl=_(Xo,"CODE",{});var Vi=f(Xl);Ws=h(Vi,"pipeline()"),Vi.forEach(n),Ys=h(Xo," e specifica il compito che vuoi completare:"),Xo.forEach(n),Xa=y(o),O(Pt.$$.fragment,o),eo=y(o),Le=_(o,"P",{});var jl=f(Le);Xs=h(jl,"La pipeline scarica e salva il "),Dt=_(jl,"A",{href:!0,rel:!0});var Ui=f(Dt);en=h(Ui,"modello pre-allenato"),Ui.forEach(n),tn=h(jl," e il tokenizer per l\u2019analisi del sentimento. Se non avessimo scelto un modello, la pipeline ne avrebbe scelto uno di default. Ora puoi utilizzare il "),ea=_(jl,"CODE",{});var Ji=f(ea);ln=h(Ji,"classifier"),Ji.forEach(n),an=h(jl," sul tuo testo obiettivo:"),jl.forEach(n),to=y(o),O(It.$$.fragment,o),lo=y(o),ct=_(o,"P",{});var es=f(ct);on=h(es,"Per pi\xF9 di una frase, passa una lista di frasi alla "),ta=_(es,"CODE",{});var Gi=f(ta);sn=h(Gi,"pipeline()"),Gi.forEach(n),nn=h(es," la quale restituir\xE0 una lista di dizionari:"),es.forEach(n),ao=y(o),O(Ot.$$.fragment,o),oo=y(o),He=_(o,"P",{});var Cl=f(He);rn=h(Cl,"La "),la=_(Cl,"CODE",{});var Ki=f(la);cn=h(Ki,"pipeline()"),Ki.forEach(n),un=h(Cl," pu\xF2 anche iterare su un dataset intero. Inizia installando la libreria "),Ft=_(Cl,"A",{href:!0,rel:!0});var Qi=f(Ft);fn=h(Qi,"\u{1F917} Datasets"),Qi.forEach(n),pn=h(Cl,":"),Cl.forEach(n),so=y(o),O(Lt.$$.fragment,o),no=y(o),ut=_(o,"P",{});var ts=f(ut);mn=h(ts,"Crea una "),aa=_(ts,"CODE",{});var Zi=f(aa);dn=h(Zi,"pipeline()"),Zi.forEach(n),hn=h(ts," con il compito che vuoi risolvere e con il modello che vuoi utilizzare."),ts.forEach(n),ro=y(o),O(Ht.$$.fragment,o),io=y(o),Re=_(o,"P",{});var Al=f(Re);gn=h(Al,"Poi, carica un dataset (vedi \u{1F917} Datasets "),Rt=_(Al,"A",{href:!0,rel:!0});var xi=f(Rt);_n=h(xi,"Quick Start"),xi.forEach(n),vn=h(Al," per maggiori dettagli) sul quale vuoi iterare. Per esempio, carichiamo il dataset "),Bt=_(Al,"A",{href:!0,rel:!0});var Wi=f(Bt);$n=h(Wi,"MInDS-14"),Wi.forEach(n),bn=h(Al,":"),Al.forEach(n),co=y(o),O(Vt.$$.fragment,o),uo=y(o),ft=_(o,"P",{});var ls=f(ft);wn=h(ls,"Dobbiamo assicurarci che la frequenza di campionamento del set di dati corrisponda alla frequenza di campionamento con cui \xE8 stato addestrato "),oa=_(ls,"CODE",{});var Yi=f(oa);kn=h(Yi,"radiogroup-crits/wav2vec2-xls-r-1b-italian-doc4lm-5gram"),Yi.forEach(n),zn=h(ls,"."),ls.forEach(n),fo=y(o),O(Ut.$$.fragment,o),po=y(o),ul=_(o,"P",{});var Xi=f(ul);En=h(Xi,`I file audio vengono caricati automaticamente e ri-campionati quando chiamiamo la colonna \u201Caudio\u201D.
Estraiamo i vettori delle forme d\u2019onda grezze delle prime 4 osservazioni e passiamoli come lista alla pipeline:`),Xi.forEach(n),mo=y(o),O(Jt.$$.fragment,o),ho=y(o),pt=_(o,"P",{});var as=f(pt);jn=h(as,"Per un dataset pi\xF9 grande dove gli input sono di dimensione maggiore (come nel parlato/audio o nella visione), dovrai passare un generatore al posto di una lista che carica tutti gli input in memoria. Guarda la "),fl=_(as,"A",{href:!0});var ec=f(fl);Cn=h(ec,"documentazione della pipeline"),ec.forEach(n),An=h(as," per maggiori informazioni."),as.forEach(n),go=y(o),We=_(o,"H3",{class:!0});var os=f(We);mt=_(os,"A",{id:!0,class:!0,href:!0});var tc=f(mt);sa=_(tc,"SPAN",{});var lc=f(sa);O(Gt.$$.fragment,lc),lc.forEach(n),tc.forEach(n),yn=y(os),na=_(os,"SPAN",{});var ac=f(na);Tn=h(ac,"Utilizzare un altro modello e tokenizer nella pipeline"),ac.forEach(n),os.forEach(n),_o=y(o),je=_(o,"P",{});var Ke=f(je);qn=h(Ke,"La "),ra=_(Ke,"CODE",{});var oc=f(ra);Mn=h(oc,"pipeline()"),oc.forEach(n),Sn=h(Ke," pu\xF2 ospitare qualsiasi modello del "),Kt=_(Ke,"A",{href:!0,rel:!0});var sc=f(Kt);Nn=h(sc,"Model Hub"),sc.forEach(n),Pn=h(Ke,", rendendo semplice l\u2019adattamento della "),ia=_(Ke,"CODE",{});var nc=f(ia);Dn=h(nc,"pipeline()"),nc.forEach(n),In=h(Ke," per altri casi d\u2019uso. Per esempio, se si vuole un modello capace di trattare testo in francese, usa i tag presenti nel Model Hub in modo da filtrare per ottenere un modello appropriato. Il miglior risultato filtrato restituisce un modello multi-lingua "),Qt=_(Ke,"A",{href:!0,rel:!0});var rc=f(Qt);On=h(rc,"BERT model"),rc.forEach(n),Fn=h(Ke," fine-tuned per l\u2019analisi del sentimento. Ottimo, utilizziamo questo modello!"),Ke.forEach(n),vo=y(o),O(Zt.$$.fragment,o),$o=y(o),O(dt.$$.fragment,o),bo=y(o),Be=_(o,"P",{});var yl=f(Be);Ln=h(yl,"Poi puoi specificare il modello e il tokenizer nella "),ca=_(yl,"CODE",{});var ic=f(ca);Hn=h(ic,"pipeline()"),ic.forEach(n),Rn=h(yl,", e applicare il "),ua=_(yl,"CODE",{});var cc=f(ua);Bn=h(cc,"classifier"),cc.forEach(n),Vn=h(yl," sul tuo testo obiettivo:"),yl.forEach(n),wo=y(o),O(xt.$$.fragment,o),ko=y(o),Ve=_(o,"P",{});var Tl=f(Ve);Un=h(Tl,"Se non riesci a trovare un modello per il tuo caso d\u2019uso, dovrai fare fine-tuning di un modello pre-allenato sui tuoi dati. Dai un\u2019occhiata al nostro tutorial "),pl=_(Tl,"A",{href:!0});var uc=f(pl);Jn=h(uc,"fine-tuning tutorial"),uc.forEach(n),Gn=h(Tl," per imparare come. Infine, dopo che hai completato il fine-tuning del tuo modello pre-allenato, considera per favore di condividerlo (vedi il tutorial "),ml=_(Tl,"A",{href:!0});var fc=f(ml);Kn=h(fc,"qui"),fc.forEach(n),Qn=h(Tl,") con la comunit\xE0 sul Model Hub per democratizzare l\u2019NLP! \u{1F917}"),Tl.forEach(n),zo=y(o),Ye=_(o,"H2",{class:!0});var ss=f(Ye);ht=_(ss,"A",{id:!0,class:!0,href:!0});var pc=f(ht);fa=_(pc,"SPAN",{});var mc=f(fa);O(Wt.$$.fragment,mc),mc.forEach(n),pc.forEach(n),Zn=y(ss),pa=_(ss,"SPAN",{});var dc=f(pa);xn=h(dc,"AutoClass"),dc.forEach(n),ss.forEach(n),Eo=y(o),O(Yt.$$.fragment,o),jo=y(o),_e=_(o,"P",{});var Ce=f(_e);Wn=h(Ce,"Al suo interno, le classi "),ma=_(Ce,"CODE",{});var hc=f(ma);Yn=h(hc,"AutoModelForSequenceClassification"),hc.forEach(n),Xn=h(Ce," e "),da=_(Ce,"CODE",{});var gc=f(da);er=h(gc,"AutoTokenizer"),gc.forEach(n),tr=h(Ce," lavorano assieme per dare potere alla "),ha=_(Ce,"CODE",{});var _c=f(ha);lr=h(_c,"pipeline()"),_c.forEach(n),ar=h(Ce,". Una "),dl=_(Ce,"A",{href:!0});var vc=f(dl);or=h(vc,"AutoClass"),vc.forEach(n),sr=h(Ce," \xE8 una scorciatoia che automaticamente recupera l\u2019architettura di un modello pre-allenato a partire dal suo nome o path. Hai solo bisogno di selezionare la "),ga=_(Ce,"CODE",{});var $c=f(ga);nr=h($c,"AutoClass"),$c.forEach(n),rr=h(Ce," appropriata per il tuo compito e il suo tokenizer associato con "),_a=_(Ce,"CODE",{});var bc=f(_a);ir=h(bc,"AutoTokenizer"),bc.forEach(n),cr=h(Ce,"."),Ce.forEach(n),Co=y(o),Ue=_(o,"P",{});var ql=f(Ue);ur=h(ql,"Ritorniamo al nostro esempio e vediamo come puoi utilizzare la "),va=_(ql,"CODE",{});var wc=f(va);fr=h(wc,"AutoClass"),wc.forEach(n),pr=h(ql," per replicare i risultati della "),$a=_(ql,"CODE",{});var kc=f($a);mr=h(kc,"pipeline()"),kc.forEach(n),dr=h(ql,"."),ql.forEach(n),Ao=y(o),Xe=_(o,"H3",{class:!0});var ns=f(Xe);gt=_(ns,"A",{id:!0,class:!0,href:!0});var zc=f(gt);ba=_(zc,"SPAN",{});var Ec=f(ba);O(Xt.$$.fragment,Ec),Ec.forEach(n),zc.forEach(n),hr=y(ns),wa=_(ns,"SPAN",{});var jc=f(wa);gr=h(jc,"AutoTokenizer"),jc.forEach(n),ns.forEach(n),yo=y(o),Je=_(o,"P",{});var Ml=f(Je);_r=h(Ml,"Un tokenizer \xE8 responsabile dell\u2019elaborazione del testo in modo da trasformarlo in un formato comprensibile dal modello. Per prima cosa, il tokenizer divider\xE0 il testo in parole chiamate "),ka=_(Ml,"EM",{});var Cc=f(ka);vr=h(Cc,"token"),Cc.forEach(n),$r=h(Ml,". Ci sono diverse regole che governano il processo di tokenizzazione, tra cui come dividere una parola e a quale livello (impara di pi\xF9 sulla tokenizzazione "),hl=_(Ml,"A",{href:!0});var Ac=f(hl);br=h(Ac,"qui"),Ac.forEach(n),wr=h(Ml,"). La cosa pi\xF9 importante da ricordare comunque \xE8 che hai bisogno di inizializzare il tokenizer con lo stesso nome del modello in modo da assicurarti che stai utilizzando le stesse regole di tokenizzazione con cui il modello \xE8 stato pre-allenato."),Ml.forEach(n),To=y(o),_t=_(o,"P",{});var rs=f(_t);kr=h(rs,"Carica un tokenizer con "),za=_(rs,"CODE",{});var yc=f(za);zr=h(yc,"AutoTokenizer"),yc.forEach(n),Er=h(rs,":"),rs.forEach(n),qo=y(o),O(el.$$.fragment,o),Mo=y(o),vt=_(o,"P",{});var is=f(vt);jr=h(is,"Dopodich\xE9, il tokenizer converte i token in numeri in modo da costruire un tensore come input del modello. Questo \xE8 conosciuto come il "),Ea=_(is,"EM",{});var Tc=f(Ea);Cr=h(Tc,"vocabolario"),Tc.forEach(n),Ar=h(is," del modello."),is.forEach(n),So=y(o),gl=_(o,"P",{});var qc=f(gl);yr=h(qc,"Passa il tuo testo al tokenizer:"),qc.forEach(n),No=y(o),O(tl.$$.fragment,o),Po=y(o),_l=_(o,"P",{});var Mc=f(_l);Tr=h(Mc,"Il tokenizer restituir\xE0 un dizionario contenente:"),Mc.forEach(n),Do=y(o),$t=_(o,"UL",{});var cs=f($t);vl=_(cs,"LI",{});var mi=f(vl);$l=_(mi,"A",{href:!0});var Sc=f($l);qr=h(Sc,"input_ids"),Sc.forEach(n),Mr=h(mi,": rappresentazioni numeriche dei tuoi token."),mi.forEach(n),Sr=y(cs),bl=_(cs,"LI",{});var di=f(bl);wl=_(di,"A",{href:!0});var Nc=f(wl);Nr=h(Nc,"attention_mask"),Nc.forEach(n),Pr=h(di,": indica quali token devono essere presi in considerazione."),di.forEach(n),cs.forEach(n),Io=y(o),bt=_(o,"P",{});var us=f(bt);Dr=h(us,"Come con la "),ja=_(us,"CODE",{});var Pc=f(ja);Ir=h(Pc,"pipeline()"),Pc.forEach(n),Or=h(us,", il tokenizer accetter\xE0 una lista di input. In pi\xF9, il tokenizer pu\xF2 anche completare (pad, in inglese) e troncare il testo in modo da restituire un lotto (batch, in inglese) di lunghezza uniforme:"),us.forEach(n),Oo=y(o),O(wt.$$.fragment,o),Fo=y(o),kt=_(o,"P",{});var fs=f(kt);Fr=h(fs,"Leggi il tutorial sul "),kl=_(fs,"A",{href:!0});var Dc=f(kl);Lr=h(Dc,"preproccesing"),Dc.forEach(n),Hr=h(fs," per maggiori dettagli sulla tokenizzazione."),fs.forEach(n),Lo=y(o),et=_(o,"H3",{class:!0});var ps=f(et);zt=_(ps,"A",{id:!0,class:!0,href:!0});var Ic=f(zt);Ca=_(Ic,"SPAN",{});var Oc=f(Ca);O(ll.$$.fragment,Oc),Oc.forEach(n),Ic.forEach(n),Rr=y(ps),Aa=_(ps,"SPAN",{});var Fc=f(Aa);Br=h(Fc,"AutoModel"),Fc.forEach(n),ps.forEach(n),Ho=y(o),O(Et.$$.fragment,o),Ro=y(o),O(jt.$$.fragment,o),Bo=y(o),ve=_(o,"P",{});var Ae=f(ve);Vr=h(Ae,"I modelli sono "),al=_(Ae,"A",{href:!0,rel:!0});var Lc=f(al);ya=_(Lc,"CODE",{});var Hc=f(ya);Ur=h(Hc,"torch.nn.Module"),Hc.forEach(n),Lc.forEach(n),Jr=h(Ae," o "),ol=_(Ae,"A",{href:!0,rel:!0});var Rc=f(ol);Ta=_(Rc,"CODE",{});var Bc=f(Ta);Gr=h(Bc,"tf.keras.Model"),Bc.forEach(n),Rc.forEach(n),Kr=h(Ae," standard cos\xEC puoi utilizzarli all\u2019interno del tuo training loop usuale. Tuttavia, per rendere le cose pi\xF9 semplici, \u{1F917} Transformers fornisce una classe "),qa=_(Ae,"CODE",{});var Vc=f(qa);Qr=h(Vc,"Trainer"),Vc.forEach(n),Zr=h(Ae," per PyTorch che aggiunge delle funzionalit\xE0 per l\u2019allenamento distribuito, precisione mista, e altro ancora. Per TensorFlow, puoi utilizzare il metodo "),Ma=_(Ae,"CODE",{});var Uc=f(Ma);xr=h(Uc,"fit"),Uc.forEach(n),Wr=h(Ae," di "),sl=_(Ae,"A",{href:!0,rel:!0});var Jc=f(sl);Yr=h(Jc,"Keras"),Jc.forEach(n),Xr=h(Ae,". Fai riferimento al "),zl=_(Ae,"A",{href:!0});var Gc=f(zl);ei=h(Gc,"tutorial per il training"),Gc.forEach(n),ti=h(Ae," per maggiori dettagli."),Ae.forEach(n),Vo=y(o),O(Ct.$$.fragment,o),Uo=y(o),tt=_(o,"H3",{class:!0});var ms=f(tt);At=_(ms,"A",{id:!0,class:!0,href:!0});var Kc=f(At);Sa=_(Kc,"SPAN",{});var Qc=f(Sa);O(nl.$$.fragment,Qc),Qc.forEach(n),Kc.forEach(n),li=y(ms),Na=_(ms,"SPAN",{});var Zc=f(Na);ai=h(Zc,"Salva un modello"),Zc.forEach(n),ms.forEach(n),Jo=y(o),O(yt.$$.fragment,o),Go=y(o),Ge=_(o,"P",{});var Sl=f(Ge);oi=h(Sl,"Una caratteristica particolarmente interessante di \u{1F917} Transformers \xE8 la sua abilit\xE0 di salvare un modello e ri-caricarlo sia come modello di PyTorch che di TensorFlow. I parametri "),Pa=_(Sl,"CODE",{});var xc=f(Pa);si=h(xc,"from_pt"),xc.forEach(n),ni=h(Sl," o "),Da=_(Sl,"CODE",{});var Wc=f(Da);ri=h(Wc,"from_tf"),Wc.forEach(n),ii=h(Sl," possono convertire un modello da un framework all\u2019altro:"),Sl.forEach(n),Ko=y(o),O(Tt.$$.fragment,o),this.h()},h(){u(e,"name","hf:doc:metadata"),u(e,"content",JSON.stringify(Hp)),u(l,"id","quick-tour"),u(l,"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"),u(l,"href","#quick-tour"),u(t,"class","relative group"),u(T,"href","./model_doc/auto"),u(x,"id","pipeline"),u(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"),u(x,"href","#pipeline"),u(K,"class","relative group"),u(st,"id","utilizzo-della-pipeline"),u(st,"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"),u(st,"href","#utilizzo-della-pipeline"),u(xe,"class","relative group"),u(Dt,"href","https://huggingface.co/MilaNLProc/feel-it-italian-sentiment"),u(Dt,"rel","nofollow"),u(Ft,"href","https://huggingface.co/docs/datasets/"),u(Ft,"rel","nofollow"),u(Rt,"href","https://huggingface.co/docs/datasets/quickstart.html"),u(Rt,"rel","nofollow"),u(Bt,"href","https://huggingface.co/datasets/PolyAI/minds14"),u(Bt,"rel","nofollow"),u(fl,"href","./main_classes/pipelines"),u(mt,"id","utilizzare-un-altro-modello-e-tokenizer-nella-pipeline"),u(mt,"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"),u(mt,"href","#utilizzare-un-altro-modello-e-tokenizer-nella-pipeline"),u(We,"class","relative group"),u(Kt,"href","https://huggingface.co/models"),u(Kt,"rel","nofollow"),u(Qt,"href","https://huggingface.co/nlptown/bert-base-multilingual-uncased-sentiment"),u(Qt,"rel","nofollow"),u(pl,"href","./training"),u(ml,"href","./model_sharing"),u(ht,"id","autoclass"),u(ht,"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"),u(ht,"href","#autoclass"),u(Ye,"class","relative group"),u(dl,"href","./model_doc/auto"),u(gt,"id","autotokenizer"),u(gt,"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"),u(gt,"href","#autotokenizer"),u(Xe,"class","relative group"),u(hl,"href","./tokenizer_summary"),u($l,"href","./glossary#input-ids"),u(wl,"href",".glossary#attention-mask"),u(kl,"href","./preprocessing"),u(zt,"id","automodel"),u(zt,"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"),u(zt,"href","#automodel"),u(et,"class","relative group"),u(al,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),u(al,"rel","nofollow"),u(ol,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),u(ol,"rel","nofollow"),u(sl,"href","https://keras.io/"),u(sl,"rel","nofollow"),u(zl,"href","./training"),u(At,"id","salva-un-modello"),u(At,"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"),u(At,"href","#salva-un-modello"),u(tt,"class","relative group")},m(o,b){s(document.head,e),$(o,a,b),$(o,t,b),s(t,l),s(l,r),D(c,r,null),s(t,p),s(t,m),s(m,v),$(o,w,b),D(z,o,b),$(o,S,b),$(o,q,b),s(q,N),s(q,j),s(j,M),s(q,k),s(q,T),s(T,F),s(q,G),$(o,U,b),D(R,o,b),$(o,W,b),$(o,K,b),s(K,x),s(x,ne),D(oe,ne,null),s(K,se),s(K,de),s(de,ie),$(o,he,b),$(o,re,b),s(re,ee),s(ee,ce),s(re,ge),$(o,H,b),D(J,o,b),$(o,le,b),$(o,L,b),s(L,Q),s(L,ue),s(ue,$e),s(L,X),$(o,Se,b),$(o,ae,b),s(ae,Ne),s(Ne,Ee),s(ae,Ie),$(o,be,b),$(o,te,b),s(te,Oe),s(Oe,_s),s(te,vs),s(te,Il),s(Il,$s),s(te,bs),s(te,Ol),s(Ol,ws),s(te,ks),s(te,Fl),s(Fl,zs),s(te,Es),s(te,Ll),s(Ll,js),s(te,Cs),s(te,Hl),s(Hl,As),s(te,ys),s(te,Rl),s(Rl,Ts),s(te,qs),s(te,Bl),s(Bl,Ms),$(o,Va,b),$(o,Mt,b),s(Mt,Vl),s(Vl,Ss),s(Mt,Ns),$(o,Ua,b),$(o,Fe,b),s(Fe,Ul),s(Ul,Ps),s(Fe,Ds),s(Fe,Jl),s(Jl,Is),s(Fe,Os),s(Fe,Gl),s(Gl,Fs),$(o,Ja,b),$(o,St,b),s(St,Kl),s(Kl,Ls),s(St,Hs),$(o,Ga,b),$(o,at,b),s(at,Ql),s(Ql,Rs),s(at,Bs),s(at,Zl),s(Zl,Vs),$(o,Ka,b),D(ot,o,b),$(o,Qa,b),$(o,xe,b),s(xe,st),s(st,xl),D(Nt,xl,null),s(xe,Us),s(xe,Wl),s(Wl,Js),$(o,Za,b),$(o,nt,b),s(nt,Gs),s(nt,Yl),s(Yl,Ks),s(nt,Qs),$(o,xa,b),$(o,cl,b),s(cl,Zs),$(o,Wa,b),D(rt,o,b),$(o,Ya,b),$(o,it,b),s(it,xs),s(it,Xl),s(Xl,Ws),s(it,Ys),$(o,Xa,b),D(Pt,o,b),$(o,eo,b),$(o,Le,b),s(Le,Xs),s(Le,Dt),s(Dt,en),s(Le,tn),s(Le,ea),s(ea,ln),s(Le,an),$(o,to,b),D(It,o,b),$(o,lo,b),$(o,ct,b),s(ct,on),s(ct,ta),s(ta,sn),s(ct,nn),$(o,ao,b),D(Ot,o,b),$(o,oo,b),$(o,He,b),s(He,rn),s(He,la),s(la,cn),s(He,un),s(He,Ft),s(Ft,fn),s(He,pn),$(o,so,b),D(Lt,o,b),$(o,no,b),$(o,ut,b),s(ut,mn),s(ut,aa),s(aa,dn),s(ut,hn),$(o,ro,b),D(Ht,o,b),$(o,io,b),$(o,Re,b),s(Re,gn),s(Re,Rt),s(Rt,_n),s(Re,vn),s(Re,Bt),s(Bt,$n),s(Re,bn),$(o,co,b),D(Vt,o,b),$(o,uo,b),$(o,ft,b),s(ft,wn),s(ft,oa),s(oa,kn),s(ft,zn),$(o,fo,b),D(Ut,o,b),$(o,po,b),$(o,ul,b),s(ul,En),$(o,mo,b),D(Jt,o,b),$(o,ho,b),$(o,pt,b),s(pt,jn),s(pt,fl),s(fl,Cn),s(pt,An),$(o,go,b),$(o,We,b),s(We,mt),s(mt,sa),D(Gt,sa,null),s(We,yn),s(We,na),s(na,Tn),$(o,_o,b),$(o,je,b),s(je,qn),s(je,ra),s(ra,Mn),s(je,Sn),s(je,Kt),s(Kt,Nn),s(je,Pn),s(je,ia),s(ia,Dn),s(je,In),s(je,Qt),s(Qt,On),s(je,Fn),$(o,vo,b),D(Zt,o,b),$(o,$o,b),D(dt,o,b),$(o,bo,b),$(o,Be,b),s(Be,Ln),s(Be,ca),s(ca,Hn),s(Be,Rn),s(Be,ua),s(ua,Bn),s(Be,Vn),$(o,wo,b),D(xt,o,b),$(o,ko,b),$(o,Ve,b),s(Ve,Un),s(Ve,pl),s(pl,Jn),s(Ve,Gn),s(Ve,ml),s(ml,Kn),s(Ve,Qn),$(o,zo,b),$(o,Ye,b),s(Ye,ht),s(ht,fa),D(Wt,fa,null),s(Ye,Zn),s(Ye,pa),s(pa,xn),$(o,Eo,b),D(Yt,o,b),$(o,jo,b),$(o,_e,b),s(_e,Wn),s(_e,ma),s(ma,Yn),s(_e,Xn),s(_e,da),s(da,er),s(_e,tr),s(_e,ha),s(ha,lr),s(_e,ar),s(_e,dl),s(dl,or),s(_e,sr),s(_e,ga),s(ga,nr),s(_e,rr),s(_e,_a),s(_a,ir),s(_e,cr),$(o,Co,b),$(o,Ue,b),s(Ue,ur),s(Ue,va),s(va,fr),s(Ue,pr),s(Ue,$a),s($a,mr),s(Ue,dr),$(o,Ao,b),$(o,Xe,b),s(Xe,gt),s(gt,ba),D(Xt,ba,null),s(Xe,hr),s(Xe,wa),s(wa,gr),$(o,yo,b),$(o,Je,b),s(Je,_r),s(Je,ka),s(ka,vr),s(Je,$r),s(Je,hl),s(hl,br),s(Je,wr),$(o,To,b),$(o,_t,b),s(_t,kr),s(_t,za),s(za,zr),s(_t,Er),$(o,qo,b),D(el,o,b),$(o,Mo,b),$(o,vt,b),s(vt,jr),s(vt,Ea),s(Ea,Cr),s(vt,Ar),$(o,So,b),$(o,gl,b),s(gl,yr),$(o,No,b),D(tl,o,b),$(o,Po,b),$(o,_l,b),s(_l,Tr),$(o,Do,b),$(o,$t,b),s($t,vl),s(vl,$l),s($l,qr),s(vl,Mr),s($t,Sr),s($t,bl),s(bl,wl),s(wl,Nr),s(bl,Pr),$(o,Io,b),$(o,bt,b),s(bt,Dr),s(bt,ja),s(ja,Ir),s(bt,Or),$(o,Oo,b),D(wt,o,b),$(o,Fo,b),$(o,kt,b),s(kt,Fr),s(kt,kl),s(kl,Lr),s(kt,Hr),$(o,Lo,b),$(o,et,b),s(et,zt),s(zt,Ca),D(ll,Ca,null),s(et,Rr),s(et,Aa),s(Aa,Br),$(o,Ho,b),D(Et,o,b),$(o,Ro,b),D(jt,o,b),$(o,Bo,b),$(o,ve,b),s(ve,Vr),s(ve,al),s(al,ya),s(ya,Ur),s(ve,Jr),s(ve,ol),s(ol,Ta),s(Ta,Gr),s(ve,Kr),s(ve,qa),s(qa,Qr),s(ve,Zr),s(ve,Ma),s(Ma,xr),s(ve,Wr),s(ve,sl),s(sl,Yr),s(ve,Xr),s(ve,zl),s(zl,ei),s(ve,ti),$(o,Vo,b),D(Ct,o,b),$(o,Uo,b),$(o,tt,b),s(tt,At),s(At,Sa),D(nl,Sa,null),s(tt,li),s(tt,Na),s(Na,ai),$(o,Jo,b),D(yt,o,b),$(o,Go,b),$(o,Ge,b),s(Ge,oi),s(Ge,Pa),s(Pa,si),s(Ge,ni),s(Ge,Da),s(Da,ri),s(Ge,ii),$(o,Ko,b),D(Tt,o,b),Qo=!0},p(o,[b]){const rl={};b&2&&(rl.$$scope={dirty:b,ctx:o}),R.$set(rl);const Ia={};b&2&&(Ia.$$scope={dirty:b,ctx:o}),ot.$set(Ia);const Oa={};b&2&&(Oa.$$scope={dirty:b,ctx:o}),rt.$set(Oa);const Fa={};b&2&&(Fa.$$scope={dirty:b,ctx:o}),dt.$set(Fa);const lt={};b&2&&(lt.$$scope={dirty:b,ctx:o}),wt.$set(lt);const La={};b&2&&(La.$$scope={dirty:b,ctx:o}),Et.$set(La);const Ha={};b&2&&(Ha.$$scope={dirty:b,ctx:o}),jt.$set(Ha);const il={};b&2&&(il.$$scope={dirty:b,ctx:o}),Ct.$set(il);const Ra={};b&2&&(Ra.$$scope={dirty:b,ctx:o}),yt.$set(Ra);const Ba={};b&2&&(Ba.$$scope={dirty:b,ctx:o}),Tt.$set(Ba)},i(o){Qo||(E(c.$$.fragment,o),E(z.$$.fragment,o),E(R.$$.fragment,o),E(oe.$$.fragment,o),E(J.$$.fragment,o),E(ot.$$.fragment,o),E(Nt.$$.fragment,o),E(rt.$$.fragment,o),E(Pt.$$.fragment,o),E(It.$$.fragment,o),E(Ot.$$.fragment,o),E(Lt.$$.fragment,o),E(Ht.$$.fragment,o),E(Vt.$$.fragment,o),E(Ut.$$.fragment,o),E(Jt.$$.fragment,o),E(Gt.$$.fragment,o),E(Zt.$$.fragment,o),E(dt.$$.fragment,o),E(xt.$$.fragment,o),E(Wt.$$.fragment,o),E(Yt.$$.fragment,o),E(Xt.$$.fragment,o),E(el.$$.fragment,o),E(tl.$$.fragment,o),E(wt.$$.fragment,o),E(ll.$$.fragment,o),E(Et.$$.fragment,o),E(jt.$$.fragment,o),E(Ct.$$.fragment,o),E(nl.$$.fragment,o),E(yt.$$.fragment,o),E(Tt.$$.fragment,o),Qo=!0)},o(o){C(c.$$.fragment,o),C(z.$$.fragment,o),C(R.$$.fragment,o),C(oe.$$.fragment,o),C(J.$$.fragment,o),C(ot.$$.fragment,o),C(Nt.$$.fragment,o),C(rt.$$.fragment,o),C(Pt.$$.fragment,o),C(It.$$.fragment,o),C(Ot.$$.fragment,o),C(Lt.$$.fragment,o),C(Ht.$$.fragment,o),C(Vt.$$.fragment,o),C(Ut.$$.fragment,o),C(Jt.$$.fragment,o),C(Gt.$$.fragment,o),C(Zt.$$.fragment,o),C(dt.$$.fragment,o),C(xt.$$.fragment,o),C(Wt.$$.fragment,o),C(Yt.$$.fragment,o),C(Xt.$$.fragment,o),C(el.$$.fragment,o),C(tl.$$.fragment,o),C(wt.$$.fragment,o),C(ll.$$.fragment,o),C(Et.$$.fragment,o),C(jt.$$.fragment,o),C(Ct.$$.fragment,o),C(nl.$$.fragment,o),C(yt.$$.fragment,o),C(Tt.$$.fragment,o),Qo=!1},d(o){n(e),o&&n(a),o&&n(t),I(c),o&&n(w),I(z,o),o&&n(S),o&&n(q),o&&n(U),I(R,o),o&&n(W),o&&n(K),I(oe),o&&n(he),o&&n(re),o&&n(H),I(J,o),o&&n(le),o&&n(L),o&&n(Se),o&&n(ae),o&&n(be),o&&n(te),o&&n(Va),o&&n(Mt),o&&n(Ua),o&&n(Fe),o&&n(Ja),o&&n(St),o&&n(Ga),o&&n(at),o&&n(Ka),I(ot,o),o&&n(Qa),o&&n(xe),I(Nt),o&&n(Za),o&&n(nt),o&&n(xa),o&&n(cl),o&&n(Wa),I(rt,o),o&&n(Ya),o&&n(it),o&&n(Xa),I(Pt,o),o&&n(eo),o&&n(Le),o&&n(to),I(It,o),o&&n(lo),o&&n(ct),o&&n(ao),I(Ot,o),o&&n(oo),o&&n(He),o&&n(so),I(Lt,o),o&&n(no),o&&n(ut),o&&n(ro),I(Ht,o),o&&n(io),o&&n(Re),o&&n(co),I(Vt,o),o&&n(uo),o&&n(ft),o&&n(fo),I(Ut,o),o&&n(po),o&&n(ul),o&&n(mo),I(Jt,o),o&&n(ho),o&&n(pt),o&&n(go),o&&n(We),I(Gt),o&&n(_o),o&&n(je),o&&n(vo),I(Zt,o),o&&n($o),I(dt,o),o&&n(bo),o&&n(Be),o&&n(wo),I(xt,o),o&&n(ko),o&&n(Ve),o&&n(zo),o&&n(Ye),I(Wt),o&&n(Eo),I(Yt,o),o&&n(jo),o&&n(_e),o&&n(Co),o&&n(Ue),o&&n(Ao),o&&n(Xe),I(Xt),o&&n(yo),o&&n(Je),o&&n(To),o&&n(_t),o&&n(qo),I(el,o),o&&n(Mo),o&&n(vt),o&&n(So),o&&n(gl),o&&n(No),I(tl,o),o&&n(Po),o&&n(_l),o&&n(Do),o&&n($t),o&&n(Io),o&&n(bt),o&&n(Oo),I(wt,o),o&&n(Fo),o&&n(kt),o&&n(Lo),o&&n(et),I(ll),o&&n(Ho),I(Et,o),o&&n(Ro),I(jt,o),o&&n(Bo),o&&n(ve),o&&n(Vo),I(Ct,o),o&&n(Uo),o&&n(tt),I(nl),o&&n(Jo),I(yt,o),o&&n(Go),o&&n(Ge),o&&n(Ko),I(Tt,o)}}}const Hp={local:"quick-tour",sections:[{local:"pipeline",sections:[{local:"utilizzo-della-pipeline",title:"Utilizzo della Pipeline"},{local:"utilizzare-un-altro-modello-e-tokenizer-nella-pipeline",title:"Utilizzare un altro modello e tokenizer nella pipeline"}],title:"Pipeline"},{local:"autoclass",sections:[{local:"autotokenizer",title:"AutoTokenizer"},{local:"automodel",title:"AutoModel"},{local:"salva-un-modello",title:"Salva un modello"}],title:"AutoClass"}],title:"Quick tour"};function Rp(i){return hs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Up extends fe{constructor(e){super();pe(this,e,Rp,Lp,me,{})}}export{Up as default,Hp as metadata};
