import{s as is,o as os,n as Y}from"../chunks/scheduler.36a0863c.js";import{S as rs,i as ps,g as m,s as o,r as g,A as cs,h as d,f as s,c as r,j as as,u as $,x as f,k as ls,y as us,a,v as h,d as b,t as y,w as j}from"../chunks/index.9c13489a.js";import{T as wt}from"../chunks/Tip.3b06990e.js";import{C as w}from"../chunks/CodeBlock.05d8ec32.js";import{F as ns,M as Zt}from"../chunks/Markdown.88297c0b.js";import{H as Je}from"../chunks/Heading.7a254a62.js";function ms(q){let l,u='Puoi anche salvare il file di configurazione come dizionario oppure come la differenza tra gli attributi della tua configurazione personalizzata e gli attributi della configurazione predefinita! Guarda la documentazione <a href="main_classes/configuration">configuration</a> per più dettagli.';return{c(){l=m("p"),l.innerHTML=u},l(n){l=d(n,"P",{"data-svelte-h":!0}),f(l)!=="svelte-15jhhcb"&&(l.innerHTML=u)},m(n,p){a(n,l,p)},p:Y,d(n){n&&s(l)}}}function ds(q){let l,u="Carica gli attributi della tua configurazione personalizzata nel modello:",n,p,M,v,R="Questo crea modelli con valori casuali invece di pesi pre-allenati. Non sarai in grado di usare questo modello per niente di utile finché non lo alleni. L’allenamento è un processo costoso e che richiede tempo . Generalmente è meglio usare un modello pre-allenato per ottenere risultati migliori velocemente, utilizzando solo una frazione delle risorse neccesarie per l’allenamento.",k,z,Z="Crea un modello pre-allenato con <code>from_pretrained()</code>:",c,_,V,C,U="Quando carichi pesi pre-allenati, la configurazione del modello predefinito è automaticamente caricata se il modello è fornito da 🤗 Transformers. Tuttavia, puoi ancora sostituire gli attributi - alcuni o tutti - di configurazione del modello predefinito con i tuoi se lo desideri:",x,J,W;return p=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERpc3RpbEJlcnRNb2RlbCUwQSUwQW15X2NvbmZpZyUyMCUzRCUyMERpc3RpbEJlcnRDb25maWcuZnJvbV9wcmV0cmFpbmVkKCUyMi4lMkZ5b3VyX21vZGVsX3NhdmVfcGF0aCUyRm15X2NvbmZpZy5qc29uJTIyKSUwQW1vZGVsJTIwJTNEJTIwRGlzdGlsQmVydE1vZGVsKG15X2NvbmZpZyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DistilBertModel

<span class="hljs-meta">&gt;&gt;&gt; </span>my_config = DistilBertConfig.from_pretrained(<span class="hljs-string">&quot;./your_model_save_path/my_config.json&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DistilBertModel(my_config)`,wrap:!1}}),_=new w({props:{code:"bW9kZWwlMjAlM0QlMjBEaXN0aWxCZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkJTIyKQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model = DistilBertModel.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)',wrap:!1}}),J=new w({props:{code:"bW9kZWwlMjAlM0QlMjBEaXN0aWxCZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkJTIyJTJDJTIwY29uZmlnJTNEbXlfY29uZmlnKQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model = DistilBertModel.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>, config=my_config)',wrap:!1}}),{c(){l=m("p"),l.textContent=u,n=o(),g(p.$$.fragment),M=o(),v=m("p"),v.textContent=R,k=o(),z=m("p"),z.innerHTML=Z,c=o(),g(_.$$.fragment),V=o(),C=m("p"),C.textContent=U,x=o(),g(J.$$.fragment)},l(i){l=d(i,"P",{"data-svelte-h":!0}),f(l)!=="svelte-1cmkkoy"&&(l.textContent=u),n=r(i),$(p.$$.fragment,i),M=r(i),v=d(i,"P",{"data-svelte-h":!0}),f(v)!=="svelte-zq50ce"&&(v.textContent=R),k=r(i),z=d(i,"P",{"data-svelte-h":!0}),f(z)!=="svelte-so9er"&&(z.innerHTML=Z),c=r(i),$(_.$$.fragment,i),V=r(i),C=d(i,"P",{"data-svelte-h":!0}),f(C)!=="svelte-1qjkbx4"&&(C.textContent=U),x=r(i),$(J.$$.fragment,i)},m(i,T){a(i,l,T),a(i,n,T),h(p,i,T),a(i,M,T),a(i,v,T),a(i,k,T),a(i,z,T),a(i,c,T),h(_,i,T),a(i,V,T),a(i,C,T),a(i,x,T),h(J,i,T),W=!0},p:Y,i(i){W||(b(p.$$.fragment,i),b(_.$$.fragment,i),b(J.$$.fragment,i),W=!0)},o(i){y(p.$$.fragment,i),y(_.$$.fragment,i),y(J.$$.fragment,i),W=!1},d(i){i&&(s(l),s(n),s(M),s(v),s(k),s(z),s(c),s(V),s(C),s(x)),j(p,i),j(_,i),j(J,i)}}}function fs(q){let l,u;return l=new Zt({props:{$$slots:{default:[ds]},$$scope:{ctx:q}}}),{c(){g(l.$$.fragment)},l(n){$(l.$$.fragment,n)},m(n,p){h(l,n,p),u=!0},p(n,p){const M={};p&2&&(M.$$scope={dirty:p,ctx:n}),l.$set(M)},i(n){u||(b(l.$$.fragment,n),u=!0)},o(n){y(l.$$.fragment,n),u=!1},d(n){j(l,n)}}}function gs(q){let l,u="Carica gli attributi di configurazione personalizzati nel modello:",n,p,M,v,R="Questo crea modelli con valori casuali invece di pesi pre-allenati. Non sarai in grado di usare questo modello per niente di utile finché non lo alleni. L’allenamento è un processo costoso e che richiede tempo . Generalmente è meglio usare un modello pre-allenato per ottenere risultati migliori velocemente, utilizzando solo una frazione delle risorse neccesarie per l’allenamento.",k,z,Z="Crea un modello pre-allenoto con <code>from_pretrained()</code>:",c,_,V,C,U="Quando carichi pesi pre-allenati, la configurazione del modello predefinito è automaticamente caricato se il modello è fornito da 🤗 Transformers. Tuttavia, puoi ancora sostituire gli attributi - alcuni o tutti - di configurazione del modello predefinito con i tuoi se lo desideri:",x,J,W;return p=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGRGlzdGlsQmVydE1vZGVsJTBBJTBBbXlfY29uZmlnJTIwJTNEJTIwRGlzdGlsQmVydENvbmZpZy5mcm9tX3ByZXRyYWluZWQoJTIyLiUyRnlvdXJfbW9kZWxfc2F2ZV9wYXRoJTJGbXlfY29uZmlnLmpzb24lMjIpJTBBdGZfbW9kZWwlMjAlM0QlMjBURkRpc3RpbEJlcnRNb2RlbChteV9jb25maWcp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFDistilBertModel

<span class="hljs-meta">&gt;&gt;&gt; </span>my_config = DistilBertConfig.from_pretrained(<span class="hljs-string">&quot;./your_model_save_path/my_config.json&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model = TFDistilBertModel(my_config)`,wrap:!1}}),_=new w({props:{code:"dGZfbW9kZWwlMjAlM0QlMjBURkRpc3RpbEJlcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQlMjIp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model = TFDistilBertModel.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)',wrap:!1}}),J=new w({props:{code:"dGZfbW9kZWwlMjAlM0QlMjBURkRpc3RpbEJlcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQlMjIlMkMlMjBjb25maWclM0RteV9jb25maWcp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model = TFDistilBertModel.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>, config=my_config)',wrap:!1}}),{c(){l=m("p"),l.textContent=u,n=o(),g(p.$$.fragment),M=o(),v=m("p"),v.textContent=R,k=o(),z=m("p"),z.innerHTML=Z,c=o(),g(_.$$.fragment),V=o(),C=m("p"),C.textContent=U,x=o(),g(J.$$.fragment)},l(i){l=d(i,"P",{"data-svelte-h":!0}),f(l)!=="svelte-1hu91xr"&&(l.textContent=u),n=r(i),$(p.$$.fragment,i),M=r(i),v=d(i,"P",{"data-svelte-h":!0}),f(v)!=="svelte-zq50ce"&&(v.textContent=R),k=r(i),z=d(i,"P",{"data-svelte-h":!0}),f(z)!=="svelte-3b4nvp"&&(z.innerHTML=Z),c=r(i),$(_.$$.fragment,i),V=r(i),C=d(i,"P",{"data-svelte-h":!0}),f(C)!=="svelte-16aucye"&&(C.textContent=U),x=r(i),$(J.$$.fragment,i)},m(i,T){a(i,l,T),a(i,n,T),h(p,i,T),a(i,M,T),a(i,v,T),a(i,k,T),a(i,z,T),a(i,c,T),h(_,i,T),a(i,V,T),a(i,C,T),a(i,x,T),h(J,i,T),W=!0},p:Y,i(i){W||(b(p.$$.fragment,i),b(_.$$.fragment,i),b(J.$$.fragment,i),W=!0)},o(i){y(p.$$.fragment,i),y(_.$$.fragment,i),y(J.$$.fragment,i),W=!1},d(i){i&&(s(l),s(n),s(M),s(v),s(k),s(z),s(c),s(V),s(C),s(x)),j(p,i),j(_,i),j(J,i)}}}function $s(q){let l,u;return l=new Zt({props:{$$slots:{default:[gs]},$$scope:{ctx:q}}}),{c(){g(l.$$.fragment)},l(n){$(l.$$.fragment,n)},m(n,p){h(l,n,p),u=!0},p(n,p){const M={};p&2&&(M.$$scope={dirty:p,ctx:n}),l.$set(M)},i(n){u||(b(l.$$.fragment,n),u=!0)},o(n){y(l.$$.fragment,n),u=!1},d(n){j(l,n)}}}function hs(q){let l,u="Per esempio, <code>DistilBertForSequenceClassification</code> è un modello DistilBERT base con una testa di classificazione per sequenze. La sequenza di classificazione head è uno strato lineare sopra gli output ragruppati.",n,p,M,v,R="Riutilizza facilmente questo checkpoint per un’altra attività passando ad un model head differente. Per un attività di risposta alle domande, utilizzerai il model head <code>DistilBertForQuestionAnswering</code>. La head per compiti di question answering è simile alla classificazione di sequenza head tranne per il fatto che è uno strato lineare sopra l’output degli stati nascosti (hidden states in inglese)",k,z,Z;return p=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERpc3RpbEJlcnRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBJTBBbW9kZWwlMjAlM0QlMjBEaXN0aWxCZXJ0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DistilBertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>model = DistilBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)`,wrap:!1}}),z=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERpc3RpbEJlcnRGb3JRdWVzdGlvbkFuc3dlcmluZyUwQSUwQW1vZGVsJTIwJTNEJTIwRGlzdGlsQmVydEZvclF1ZXN0aW9uQW5zd2VyaW5nLmZyb21fcHJldHJhaW5lZCglMjJkaXN0aWxiZXJ0LWJhc2UtdW5jYXNlZCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DistilBertForQuestionAnswering

<span class="hljs-meta">&gt;&gt;&gt; </span>model = DistilBertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)`,wrap:!1}}),{c(){l=m("p"),l.innerHTML=u,n=o(),g(p.$$.fragment),M=o(),v=m("p"),v.innerHTML=R,k=o(),g(z.$$.fragment)},l(c){l=d(c,"P",{"data-svelte-h":!0}),f(l)!=="svelte-1u5umc5"&&(l.innerHTML=u),n=r(c),$(p.$$.fragment,c),M=r(c),v=d(c,"P",{"data-svelte-h":!0}),f(v)!=="svelte-3acy4z"&&(v.innerHTML=R),k=r(c),$(z.$$.fragment,c)},m(c,_){a(c,l,_),a(c,n,_),h(p,c,_),a(c,M,_),a(c,v,_),a(c,k,_),h(z,c,_),Z=!0},p:Y,i(c){Z||(b(p.$$.fragment,c),b(z.$$.fragment,c),Z=!0)},o(c){y(p.$$.fragment,c),y(z.$$.fragment,c),Z=!1},d(c){c&&(s(l),s(n),s(M),s(v),s(k)),j(p,c),j(z,c)}}}function bs(q){let l,u;return l=new Zt({props:{$$slots:{default:[hs]},$$scope:{ctx:q}}}),{c(){g(l.$$.fragment)},l(n){$(l.$$.fragment,n)},m(n,p){h(l,n,p),u=!0},p(n,p){const M={};p&2&&(M.$$scope={dirty:p,ctx:n}),l.$set(M)},i(n){u||(b(l.$$.fragment,n),u=!0)},o(n){y(l.$$.fragment,n),u=!1},d(n){j(l,n)}}}function ys(q){let l,u="Per esempio, <code>TFDistilBertForSequenceClassification</code> è un modello DistilBERT base con classificazione di sequenza head. La classificazione di sequenza head è uno strato lineare sopra gli output raggruppati.",n,p,M,v,R="Riutilizza facilmente questo checkpoint per un altra attività passando ad un modello head diverso. Per un attività di risposta alle domande, utilizzerai il model head <code>TFDistilBertForQuestionAnswering</code>. Il head di risposta alle domande è simile alla sequenza di classificazione head tranne per il fatto che è uno strato lineare sopra l’output degli stati nascosti (hidden states in inglese)",k,z,Z;return p=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGRGlzdGlsQmVydEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0Zl9tb2RlbCUyMCUzRCUyMFRGRGlzdGlsQmVydEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFDistilBertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model = TFDistilBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)`,wrap:!1}}),z=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGRGlzdGlsQmVydEZvclF1ZXN0aW9uQW5zd2VyaW5nJTBBJTBBdGZfbW9kZWwlMjAlM0QlMjBURkRpc3RpbEJlcnRGb3JRdWVzdGlvbkFuc3dlcmluZy5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFDistilBertForQuestionAnswering

<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model = TFDistilBertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)`,wrap:!1}}),{c(){l=m("p"),l.innerHTML=u,n=o(),g(p.$$.fragment),M=o(),v=m("p"),v.innerHTML=R,k=o(),g(z.$$.fragment)},l(c){l=d(c,"P",{"data-svelte-h":!0}),f(l)!=="svelte-12mkr0g"&&(l.innerHTML=u),n=r(c),$(p.$$.fragment,c),M=r(c),v=d(c,"P",{"data-svelte-h":!0}),f(v)!=="svelte-1gxw94o"&&(v.innerHTML=R),k=r(c),$(z.$$.fragment,c)},m(c,_){a(c,l,_),a(c,n,_),h(p,c,_),a(c,M,_),a(c,v,_),a(c,k,_),h(z,c,_),Z=!0},p:Y,i(c){Z||(b(p.$$.fragment,c),b(z.$$.fragment,c),Z=!0)},o(c){y(p.$$.fragment,c),y(z.$$.fragment,c),Z=!1},d(c){c&&(s(l),s(n),s(M),s(v),s(k)),j(p,c),j(z,c)}}}function js(q){let l,u;return l=new Zt({props:{$$slots:{default:[ys]},$$scope:{ctx:q}}}),{c(){g(l.$$.fragment)},l(n){$(l.$$.fragment,n)},m(n,p){h(l,n,p),u=!0},p(n,p){const M={};p&2&&(M.$$scope={dirty:p,ctx:n}),l.$set(M)},i(n){u||(b(l.$$.fragment,n),u=!0)},o(n){y(l.$$.fragment,n),u=!1},d(n){j(l,n)}}}function Ms(q){let l,u='Non tutti i modelli supportano un tokenizer veloce. Dai un’occhiata a questo <a href="index#supported-frameworks">tabella</a> per verificare se un modello ha il supporto per tokenizer veloce.';return{c(){l=m("p"),l.innerHTML=u},l(n){l=d(n,"P",{"data-svelte-h":!0}),f(l)!=="svelte-1jbik8k"&&(l.innerHTML=u)},m(n,p){a(n,l,p)},p:Y,d(n){n&&s(l)}}}function vs(q){let l,u="Per l’impostazione predefinita, <code>AutoTokenizer</code> proverà a caricare un tokenizer veloce. Puoi disabilitare questo comportamento impostando <code>use_fast=False</code> in <code>from_pretrained</code>.";return{c(){l=m("p"),l.innerHTML=u},l(n){l=d(n,"P",{"data-svelte-h":!0}),f(l)!=="svelte-1ar4vf4"&&(l.innerHTML=u)},m(n,p){a(n,l,p)},p:Y,d(n){n&&s(l)}}}function zs(q){let l,u="Se non stai cercando alcuna personalizzazione, usa il metodo <code>from_pretrained</code> per caricare i parametri di default dell’estrattore di caratteristiche di un modello.";return{c(){l=m("p"),l.innerHTML=u},l(n){l=d(n,"P",{"data-svelte-h":!0}),f(l)!=="svelte-10hto70"&&(l.innerHTML=u)},m(n,p){a(n,l,p)},p:Y,d(n){n&&s(l)}}}function _s(q){let l,u,n,p,M,v,R,k='Una <a href="model_doc/auto"><code>AutoClass</code></a> deduce automaticamente il modello dell’architettura e scarica la configurazione e i pesi pre-allenati. Generalmente, noi consigliamo di usare un <code>AutoClass</code> per produrre un codice indipendente dal checkpoint. Ma gli utenti che desiderano un controllo maggiore su parametri specifici del modello possono creare un modello 🤗 Transformers personalizzato da poche classi base. Questo potrebbe essere particolarmente utile per qualunque persona sia interessata nel studiare, allenare o sperimentare con un modello 🤗 Transformers. In questa guida, approfondisci la creazione di un modello personalizzato senza <code>AutoClass</code>. Impara come:',z,Z,c="<li>Caricare e personalizzare una configurazione del modello.</li> <li>Creare un’architettura modello.</li> <li>Creare un tokenizer lento e veloce per il testo.</li> <li>Creare un estrattore di caratteristiche per attività riguardanti audio o immagini.</li> <li>Creare un processore per attività multimodali.</li>",_,V,C,U,x='Una <a href="main_classes/configuration">configurazione</a> si riferisce agli attributi specifici di un modello. Ogni configurazione del modello ha attributi diversi; per esempio, tutti i modelli npl hanno questi attributi in comune <code>hidden_size</code>, <code>num_attention_heads</code>, <code>num_hidden_layers</code> e <code>vocab_size</code>. Questi attributi specificano il numero di attention heads o strati nascosti con cui costruire un modello.',J,W,i='Dai un’occhiata più da vicino a <a href="model_doc/distilbert">DistilBERT</a> accedendo a <code>DistilBertConfig</code> per ispezionare i suoi attributi:',T,L,Ve,Q,kt="<code>DistilBertConfig</code> mostra tutti gli attributi predefiniti usati per costruire una base <code>DistilBertModel</code>. Tutti gli attributi sono personalizzabili, creando uno spazio per sperimentare. Per esempio, puoi configurare un modello predefinito per:",We,N,Ct="<li>Provare un funzione di attivazione diversa con il parametro <code>activation</code>.</li> <li>Utilizzare tasso di drop out più elevato per le probalità di attention con il parametro <code>attention_dropout</code>.</li>",Ue,I,xe,P,Jt="Nella funzione <code>from_pretrained()</code> possono essere modificati gli attributi del modello pre-allenato:",Ge,D,Fe,S,Rt="Quando la configurazione del modello ti soddisfa, la puoi salvare con <code>save_pretrained()</code>. Il file della tua configurazione è memorizzato come file JSON nella save directory specificata:",Xe,A,He,K,Vt="Per riutilizzare la configurazione del file, caricalo con <code>from_pretrained()</code>:",Ee,O,Be,G,Ye,ee,Le,te,Wt='Il prossimo passo e di creare <a href="main_classes/models">modello</a>. Il modello - vagamente riferito anche come architettura - definisce cosa ogni strato deve fare e quali operazioni stanno succedendo. Attributi come <code>num_hidden_layers</code> provenienti dalla configurazione sono usati per definire l’architettura. Ogni modello condivide la classe base <code>PreTrainedModel</code> e alcuni metodi comuni come il ridimensionamento degli input embeddings e la soppressione delle self-attention heads . Inoltre, tutti i modelli sono la sottoclasse di <a href="https://pytorch.org/docs/stable/generated/torch.nn.Module.html" rel="nofollow"><code>torch.nn.Module</code></a>, <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow"><code>tf.keras.Model</code></a> o <a href="https://flax.readthedocs.io/en/latest/flax.linen.html#module" rel="nofollow"><code>flax.linen.Module</code></a>. Cio significa che i modelli sono compatibili con l’uso di ciascun di framework.',Qe,F,Ne,se,Ie,ae,Ut="A questo punto, hai un modello DistilBERT base i cui output sono gli <em>hidden states</em> (in italiano stati nascosti). Gli stati nascosti sono passati come input a un model head per produrre l’output finale. 🤗 Transformers fornisce un model head diverso per ogni attività fintanto che il modello supporta l’attività  (i.e., non puoi usare DistilBERT per un attività sequence-to-sequence come la traduzione).",Pe,X,De,le,Se,ne,xt='L’ultima classe base di cui hai bisogno prima di utilizzare un modello per i dati testuali è un <a href="main_classes/tokenizer">tokenizer</a> per convertire il testo grezzo in tensori. Ci sono due tipi di tokenizer che puoi usare con 🤗 Transformers:',Ae,ie,Gt='<li><code>PreTrainedTokenizer</code>: un’implementazione Python di un tokenizer.</li> <li><code>PreTrainedTokenizerFast</code>: un tokenizer dalla nostra libreria <a href="https://huggingface.co/docs/tokenizers/python/latest/" rel="nofollow">🤗 Tokenizer</a> basata su Rust. Questo tipo di tokenizer è significativamente più veloce, specialmente durante la batch tokenization, grazie alla sua implementazione Rust. Il tokenizer veloce offre anche metodi aggiuntivi come <em>offset mapping</em> che associa i token alle loro parole o caratteri originali.</li>',Ke,oe,Ft="Entrambi i tokenizer supportano metodi comuni come la codifica e la decodifica, l’aggiunta di nuovi token e la gestione di token speciali.",Oe,H,et,re,Xt="Se hai addestrato il tuo tokenizer, puoi crearne uno dal tuo file <em>vocabolario</em>:",tt,pe,st,ce,Ht="È importante ricordare che il vocabolario di un tokenizer personalizzato sarà diverso dal vocabolario generato dal tokenizer di un modello preallenato. È necessario utilizzare il vocabolario di un modello preallenato se si utilizza un modello preallenato, altrimenti gli input non avranno senso. Crea un tokenizer con il vocabolario di un modello preallenato con la classe <code>DistilBertTokenizer</code>:",at,ue,lt,me,Et="Crea un tokenizer veloce con la classe <code>DistilBertTokenizerFast</code>:",nt,de,it,E,ot,fe,rt,ge,Bt="Un estrattore di caratteristiche (feature in inglese) elabora input audio o immagini. Eredita dalla classe <code>FeatureExtractionMixin</code> base e può anche ereditare dalla classe <code>ImageFeatureExtractionMixin</code> per l’elaborazione delle caratteristiche dell’immagine o dalla classe <code>SequenceFeatureExtractor</code> per l’elaborazione degli input audio.",pt,$e,Yt='A seconda che tu stia lavorando a un’attività audio o visiva, crea un estrattore di caratteristiche associato al modello che stai utilizzando. Ad esempio, crea un <code>ViTFeatureExtractor</code> predefinito se stai usando <a href="model_doc/vit">ViT</a> per la classificazione delle immagini:',ct,he,ut,B,mt,be,Lt="Modifica uno qualsiasi dei parametri <code>ViTFeatureExtractor</code> per creare il tuo estrattore di caratteristiche personalizzato:",dt,ye,ft,je,Qt="Per gli input audio, puoi creare un <code>Wav2Vec2FeatureExtractor</code> e personalizzare i parametri in modo simile:",gt,Me,$t,ve,ht,ze,Nt="Per modelli che supportano attività multimodali, 🤗 Transformers offre una classe di processore che racchiude comodamente un estrattore di caratteristiche e un tokenizer in un unico oggetto. Ad esempio, utilizziamo <code>Wav2Vec2Processor</code> per un’attività di riconoscimento vocale automatico (ASR). ASR trascrive l’audio in testo, quindi avrai bisogno di un estrattore di caratteristiche e di un tokenizer.",bt,_e,It="Crea un estrattore di feature per gestire gli input audio:",yt,Te,jt,qe,Pt="Crea un tokenizer per gestire gli input di testo:",Mt,we,vt,Ze,Dt="Combinare l’estrattore di caratteristiche e il tokenizer in <code>Wav2Vec2Processor</code>:",zt,ke,_t,Ce,St="Con due classi di base - configurazione e modello - e una classe di preelaborazione aggiuntiva (tokenizer, estrattore di caratteristiche o processore), puoi creare qualsiasi modello supportato da 🤗 Transformers. Ognuna di queste classi base è configurabile, consentendoti di utilizzare gli attributi specifici che desideri. È possibile impostare facilmente un modello per l’addestramento o modificare un modello preallenato esistente per la messa a punto.",Tt,Re,qt;return M=new Je({props:{title:"Crea un’architettura personalizzata",local:"crea-unarchitettura-personalizzata",headingTag:"h1"}}),V=new Je({props:{title:"Configurazione",local:"configurazione",headingTag:"h2"}}),L=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERpc3RpbEJlcnRDb25maWclMEElMEFjb25maWclMjAlM0QlMjBEaXN0aWxCZXJ0Q29uZmlnKCklMEFwcmludChjb25maWcp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DistilBertConfig

<span class="hljs-meta">&gt;&gt;&gt; </span>config = DistilBertConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(config)
DistilBertConfig {
  <span class="hljs-string">&quot;activation&quot;</span>: <span class="hljs-string">&quot;gelu&quot;</span>,
  <span class="hljs-string">&quot;attention_dropout&quot;</span>: <span class="hljs-number">0.1</span>,
  <span class="hljs-string">&quot;dim&quot;</span>: <span class="hljs-number">768</span>,
  <span class="hljs-string">&quot;dropout&quot;</span>: <span class="hljs-number">0.1</span>,
  <span class="hljs-string">&quot;hidden_dim&quot;</span>: <span class="hljs-number">3072</span>,
  <span class="hljs-string">&quot;initializer_range&quot;</span>: <span class="hljs-number">0.02</span>,
  <span class="hljs-string">&quot;max_position_embeddings&quot;</span>: <span class="hljs-number">512</span>,
  <span class="hljs-string">&quot;model_type&quot;</span>: <span class="hljs-string">&quot;distilbert&quot;</span>,
  <span class="hljs-string">&quot;n_heads&quot;</span>: <span class="hljs-number">12</span>,
  <span class="hljs-string">&quot;n_layers&quot;</span>: <span class="hljs-number">6</span>,
  <span class="hljs-string">&quot;pad_token_id&quot;</span>: <span class="hljs-number">0</span>,
  <span class="hljs-string">&quot;qa_dropout&quot;</span>: <span class="hljs-number">0.1</span>,
  <span class="hljs-string">&quot;seq_classif_dropout&quot;</span>: <span class="hljs-number">0.2</span>,
  <span class="hljs-string">&quot;sinusoidal_pos_embds&quot;</span>: false,
  <span class="hljs-string">&quot;transformers_version&quot;</span>: <span class="hljs-string">&quot;4.16.2&quot;</span>,
  <span class="hljs-string">&quot;vocab_size&quot;</span>: <span class="hljs-number">30522</span>
}`,wrap:!1}}),I=new w({props:{code:"bXlfY29uZmlnJTIwJTNEJTIwRGlzdGlsQmVydENvbmZpZyhhY3RpdmF0aW9uJTNEJTIycmVsdSUyMiUyQyUyMGF0dGVudGlvbl9kcm9wb3V0JTNEMC40KSUwQXByaW50KG15X2NvbmZpZyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>my_config = DistilBertConfig(activation=<span class="hljs-string">&quot;relu&quot;</span>, attention_dropout=<span class="hljs-number">0.4</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(my_config)
DistilBertConfig {
  <span class="hljs-string">&quot;activation&quot;</span>: <span class="hljs-string">&quot;relu&quot;</span>,
  <span class="hljs-string">&quot;attention_dropout&quot;</span>: <span class="hljs-number">0.4</span>,
  <span class="hljs-string">&quot;dim&quot;</span>: <span class="hljs-number">768</span>,
  <span class="hljs-string">&quot;dropout&quot;</span>: <span class="hljs-number">0.1</span>,
  <span class="hljs-string">&quot;hidden_dim&quot;</span>: <span class="hljs-number">3072</span>,
  <span class="hljs-string">&quot;initializer_range&quot;</span>: <span class="hljs-number">0.02</span>,
  <span class="hljs-string">&quot;max_position_embeddings&quot;</span>: <span class="hljs-number">512</span>,
  <span class="hljs-string">&quot;model_type&quot;</span>: <span class="hljs-string">&quot;distilbert&quot;</span>,
  <span class="hljs-string">&quot;n_heads&quot;</span>: <span class="hljs-number">12</span>,
  <span class="hljs-string">&quot;n_layers&quot;</span>: <span class="hljs-number">6</span>,
  <span class="hljs-string">&quot;pad_token_id&quot;</span>: <span class="hljs-number">0</span>,
  <span class="hljs-string">&quot;qa_dropout&quot;</span>: <span class="hljs-number">0.1</span>,
  <span class="hljs-string">&quot;seq_classif_dropout&quot;</span>: <span class="hljs-number">0.2</span>,
  <span class="hljs-string">&quot;sinusoidal_pos_embds&quot;</span>: false,
  <span class="hljs-string">&quot;transformers_version&quot;</span>: <span class="hljs-string">&quot;4.16.2&quot;</span>,
  <span class="hljs-string">&quot;vocab_size&quot;</span>: <span class="hljs-number">30522</span>
}`,wrap:!1}}),D=new w({props:{code:"bXlfY29uZmlnJTIwJTNEJTIwRGlzdGlsQmVydENvbmZpZy5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQlMjIlMkMlMjBhY3RpdmF0aW9uJTNEJTIycmVsdSUyMiUyQyUyMGF0dGVudGlvbl9kcm9wb3V0JTNEMC40KQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>my_config = DistilBertConfig.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>, activation=<span class="hljs-string">&quot;relu&quot;</span>, attention_dropout=<span class="hljs-number">0.4</span>)',wrap:!1}}),A=new w({props:{code:"bXlfY29uZmlnLnNhdmVfcHJldHJhaW5lZChzYXZlX2RpcmVjdG9yeSUzRCUyMi4lMkZ5b3VyX21vZGVsX3NhdmVfcGF0aCUyMik=",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>my_config.save_pretrained(save_directory=<span class="hljs-string">&quot;./your_model_save_path&quot;</span>)',wrap:!1}}),O=new w({props:{code:"bXlfY29uZmlnJTIwJTNEJTIwRGlzdGlsQmVydENvbmZpZy5mcm9tX3ByZXRyYWluZWQoJTIyLiUyRnlvdXJfbW9kZWxfc2F2ZV9wYXRoJTJGbXlfY29uZmlnLmpzb24lMjIp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>my_config = DistilBertConfig.from_pretrained(<span class="hljs-string">&quot;./your_model_save_path/my_config.json&quot;</span>)',wrap:!1}}),G=new wt({props:{$$slots:{default:[ms]},$$scope:{ctx:q}}}),ee=new Je({props:{title:"Modello",local:"modello",headingTag:"h2"}}),F=new ns({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[$s],pytorch:[fs]},$$scope:{ctx:q}}}),se=new Je({props:{title:"Model head",local:"model-head",headingTag:"h3"}}),X=new ns({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[js],pytorch:[bs]},$$scope:{ctx:q}}}),le=new Je({props:{title:"Tokenizer",local:"tokenizer",headingTag:"h2"}}),H=new wt({props:{warning:!0,$$slots:{default:[Ms]},$$scope:{ctx:q}}}),pe=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERpc3RpbEJlcnRUb2tlbml6ZXIlMEElMEFteV90b2tlbml6ZXIlMjAlM0QlMjBEaXN0aWxCZXJ0VG9rZW5pemVyKHZvY2FiX2ZpbGUlM0QlMjJteV92b2NhYl9maWxlLnR4dCUyMiUyQyUyMGRvX2xvd2VyX2Nhc2UlM0RGYWxzZSUyQyUyMHBhZGRpbmdfc2lkZSUzRCUyMmxlZnQlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DistilBertTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>my_tokenizer = DistilBertTokenizer(vocab_file=<span class="hljs-string">&quot;my_vocab_file.txt&quot;</span>, do_lower_case=<span class="hljs-literal">False</span>, padding_side=<span class="hljs-string">&quot;left&quot;</span>)`,wrap:!1}}),ue=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERpc3RpbEJlcnRUb2tlbml6ZXIlMEElMEFzbG93X3Rva2VuaXplciUyMCUzRCUyMERpc3RpbEJlcnRUb2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DistilBertTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>slow_tokenizer = DistilBertTokenizer.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)`,wrap:!1}}),de=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERpc3RpbEJlcnRUb2tlbml6ZXJGYXN0JTBBJTBBZmFzdF90b2tlbml6ZXIlMjAlM0QlMjBEaXN0aWxCZXJ0VG9rZW5pemVyRmFzdC5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DistilBertTokenizerFast

<span class="hljs-meta">&gt;&gt;&gt; </span>fast_tokenizer = DistilBertTokenizerFast.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)`,wrap:!1}}),E=new wt({props:{$$slots:{default:[vs]},$$scope:{ctx:q}}}),fe=new Je({props:{title:"Estrattore Di Feature",local:"estrattore-di-feature",headingTag:"h2"}}),he=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpVEZlYXR1cmVFeHRyYWN0b3IlMEElMEF2aXRfZXh0cmFjdG9yJTIwJTNEJTIwVmlURmVhdHVyZUV4dHJhY3RvcigpJTBBcHJpbnQodml0X2V4dHJhY3Rvcik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ViTFeatureExtractor

<span class="hljs-meta">&gt;&gt;&gt; </span>vit_extractor = ViTFeatureExtractor()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(vit_extractor)
ViTFeatureExtractor {
  <span class="hljs-string">&quot;do_normalize&quot;</span>: true,
  <span class="hljs-string">&quot;do_resize&quot;</span>: true,
  <span class="hljs-string">&quot;feature_extractor_type&quot;</span>: <span class="hljs-string">&quot;ViTFeatureExtractor&quot;</span>,
  <span class="hljs-string">&quot;image_mean&quot;</span>: [
    <span class="hljs-number">0.5</span>,
    <span class="hljs-number">0.5</span>,
    <span class="hljs-number">0.5</span>
  ],
  <span class="hljs-string">&quot;image_std&quot;</span>: [
    <span class="hljs-number">0.5</span>,
    <span class="hljs-number">0.5</span>,
    <span class="hljs-number">0.5</span>
  ],
  <span class="hljs-string">&quot;resample&quot;</span>: <span class="hljs-number">2</span>,
  <span class="hljs-string">&quot;size&quot;</span>: <span class="hljs-number">224</span>
}`,wrap:!1}}),B=new wt({props:{$$slots:{default:[zs]},$$scope:{ctx:q}}}),ye=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpVEZlYXR1cmVFeHRyYWN0b3IlMEElMEFteV92aXRfZXh0cmFjdG9yJTIwJTNEJTIwVmlURmVhdHVyZUV4dHJhY3RvcihyZXNhbXBsZSUzRCUyMlBJTC5JbWFnZS5CT1glMjIlMkMlMjBkb19ub3JtYWxpemUlM0RGYWxzZSUyQyUyMGltYWdlX21lYW4lM0QlNUIwLjMlMkMlMjAwLjMlMkMlMjAwLjMlNUQpJTBBcHJpbnQobXlfdml0X2V4dHJhY3Rvcik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ViTFeatureExtractor

<span class="hljs-meta">&gt;&gt;&gt; </span>my_vit_extractor = ViTFeatureExtractor(resample=<span class="hljs-string">&quot;PIL.Image.BOX&quot;</span>, do_normalize=<span class="hljs-literal">False</span>, image_mean=[<span class="hljs-number">0.3</span>, <span class="hljs-number">0.3</span>, <span class="hljs-number">0.3</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(my_vit_extractor)
ViTFeatureExtractor {
  <span class="hljs-string">&quot;do_normalize&quot;</span>: false,
  <span class="hljs-string">&quot;do_resize&quot;</span>: true,
  <span class="hljs-string">&quot;feature_extractor_type&quot;</span>: <span class="hljs-string">&quot;ViTFeatureExtractor&quot;</span>,
  <span class="hljs-string">&quot;image_mean&quot;</span>: [
    <span class="hljs-number">0.3</span>,
    <span class="hljs-number">0.3</span>,
    <span class="hljs-number">0.3</span>
  ],
  <span class="hljs-string">&quot;image_std&quot;</span>: [
    <span class="hljs-number">0.5</span>,
    <span class="hljs-number">0.5</span>,
    <span class="hljs-number">0.5</span>
  ],
  <span class="hljs-string">&quot;resample&quot;</span>: <span class="hljs-string">&quot;PIL.Image.BOX&quot;</span>,
  <span class="hljs-string">&quot;size&quot;</span>: <span class="hljs-number">224</span>
}`,wrap:!1}}),Me=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFdhdjJWZWMyRmVhdHVyZUV4dHJhY3RvciUwQSUwQXcydjJfZXh0cmFjdG9yJTIwJTNEJTIwV2F2MlZlYzJGZWF0dXJlRXh0cmFjdG9yKCklMEFwcmludCh3MnYyX2V4dHJhY3Rvcik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2FeatureExtractor

<span class="hljs-meta">&gt;&gt;&gt; </span>w2v2_extractor = Wav2Vec2FeatureExtractor()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(w2v2_extractor)
Wav2Vec2FeatureExtractor {
  <span class="hljs-string">&quot;do_normalize&quot;</span>: true,
  <span class="hljs-string">&quot;feature_extractor_type&quot;</span>: <span class="hljs-string">&quot;Wav2Vec2FeatureExtractor&quot;</span>,
  <span class="hljs-string">&quot;feature_size&quot;</span>: <span class="hljs-number">1</span>,
  <span class="hljs-string">&quot;padding_side&quot;</span>: <span class="hljs-string">&quot;right&quot;</span>,
  <span class="hljs-string">&quot;padding_value&quot;</span>: <span class="hljs-number">0.0</span>,
  <span class="hljs-string">&quot;return_attention_mask&quot;</span>: false,
  <span class="hljs-string">&quot;sampling_rate&quot;</span>: <span class="hljs-number">16000</span>
}`,wrap:!1}}),ve=new Je({props:{title:"Processore",local:"processore",headingTag:"h2"}}),Te=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFdhdjJWZWMyRmVhdHVyZUV4dHJhY3RvciUwQSUwQWZlYXR1cmVfZXh0cmFjdG9yJTIwJTNEJTIwV2F2MlZlYzJGZWF0dXJlRXh0cmFjdG9yKHBhZGRpbmdfdmFsdWUlM0QxLjAlMkMlMjBkb19ub3JtYWxpemUlM0RUcnVlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2FeatureExtractor

<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = Wav2Vec2FeatureExtractor(padding_value=<span class="hljs-number">1.0</span>, do_normalize=<span class="hljs-literal">True</span>)`,wrap:!1}}),we=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFdhdjJWZWMyQ1RDVG9rZW5pemVyJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwV2F2MlZlYzJDVENUb2tlbml6ZXIodm9jYWJfZmlsZSUzRCUyMm15X3ZvY2FiX2ZpbGUudHh0JTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2CTCTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = Wav2Vec2CTCTokenizer(vocab_file=<span class="hljs-string">&quot;my_vocab_file.txt&quot;</span>)`,wrap:!1}}),ke=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFdhdjJWZWMyUHJvY2Vzc29yJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwV2F2MlZlYzJQcm9jZXNzb3IoZmVhdHVyZV9leHRyYWN0b3IlM0RmZWF0dXJlX2V4dHJhY3RvciUyQyUyMHRva2VuaXplciUzRHRva2VuaXplcik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2Processor

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = Wav2Vec2Processor(feature_extractor=feature_extractor, tokenizer=tokenizer)`,wrap:!1}}),{c(){l=m("meta"),u=o(),n=m("p"),p=o(),g(M.$$.fragment),v=o(),R=m("p"),R.innerHTML=k,z=o(),Z=m("ul"),Z.innerHTML=c,_=o(),g(V.$$.fragment),C=o(),U=m("p"),U.innerHTML=x,J=o(),W=m("p"),W.innerHTML=i,T=o(),g(L.$$.fragment),Ve=o(),Q=m("p"),Q.innerHTML=kt,We=o(),N=m("ul"),N.innerHTML=Ct,Ue=o(),g(I.$$.fragment),xe=o(),P=m("p"),P.innerHTML=Jt,Ge=o(),g(D.$$.fragment),Fe=o(),S=m("p"),S.innerHTML=Rt,Xe=o(),g(A.$$.fragment),He=o(),K=m("p"),K.innerHTML=Vt,Ee=o(),g(O.$$.fragment),Be=o(),g(G.$$.fragment),Ye=o(),g(ee.$$.fragment),Le=o(),te=m("p"),te.innerHTML=Wt,Qe=o(),g(F.$$.fragment),Ne=o(),g(se.$$.fragment),Ie=o(),ae=m("p"),ae.innerHTML=Ut,Pe=o(),g(X.$$.fragment),De=o(),g(le.$$.fragment),Se=o(),ne=m("p"),ne.innerHTML=xt,Ae=o(),ie=m("ul"),ie.innerHTML=Gt,Ke=o(),oe=m("p"),oe.textContent=Ft,Oe=o(),g(H.$$.fragment),et=o(),re=m("p"),re.innerHTML=Xt,tt=o(),g(pe.$$.fragment),st=o(),ce=m("p"),ce.innerHTML=Ht,at=o(),g(ue.$$.fragment),lt=o(),me=m("p"),me.innerHTML=Et,nt=o(),g(de.$$.fragment),it=o(),g(E.$$.fragment),ot=o(),g(fe.$$.fragment),rt=o(),ge=m("p"),ge.innerHTML=Bt,pt=o(),$e=m("p"),$e.innerHTML=Yt,ct=o(),g(he.$$.fragment),ut=o(),g(B.$$.fragment),mt=o(),be=m("p"),be.innerHTML=Lt,dt=o(),g(ye.$$.fragment),ft=o(),je=m("p"),je.innerHTML=Qt,gt=o(),g(Me.$$.fragment),$t=o(),g(ve.$$.fragment),ht=o(),ze=m("p"),ze.innerHTML=Nt,bt=o(),_e=m("p"),_e.textContent=It,yt=o(),g(Te.$$.fragment),jt=o(),qe=m("p"),qe.textContent=Pt,Mt=o(),g(we.$$.fragment),vt=o(),Ze=m("p"),Ze.innerHTML=Dt,zt=o(),g(ke.$$.fragment),_t=o(),Ce=m("p"),Ce.textContent=St,Tt=o(),Re=m("p"),this.h()},l(e){const t=cs("svelte-u9bgzb",document.head);l=d(t,"META",{name:!0,content:!0}),t.forEach(s),u=r(e),n=d(e,"P",{}),as(n).forEach(s),p=r(e),$(M.$$.fragment,e),v=r(e),R=d(e,"P",{"data-svelte-h":!0}),f(R)!=="svelte-1pk49vt"&&(R.innerHTML=k),z=r(e),Z=d(e,"UL",{"data-svelte-h":!0}),f(Z)!=="svelte-1i4pxwa"&&(Z.innerHTML=c),_=r(e),$(V.$$.fragment,e),C=r(e),U=d(e,"P",{"data-svelte-h":!0}),f(U)!=="svelte-1g7k4fs"&&(U.innerHTML=x),J=r(e),W=d(e,"P",{"data-svelte-h":!0}),f(W)!=="svelte-zjobm7"&&(W.innerHTML=i),T=r(e),$(L.$$.fragment,e),Ve=r(e),Q=d(e,"P",{"data-svelte-h":!0}),f(Q)!=="svelte-1nu4if9"&&(Q.innerHTML=kt),We=r(e),N=d(e,"UL",{"data-svelte-h":!0}),f(N)!=="svelte-timpd0"&&(N.innerHTML=Ct),Ue=r(e),$(I.$$.fragment,e),xe=r(e),P=d(e,"P",{"data-svelte-h":!0}),f(P)!=="svelte-1vxy6m3"&&(P.innerHTML=Jt),Ge=r(e),$(D.$$.fragment,e),Fe=r(e),S=d(e,"P",{"data-svelte-h":!0}),f(S)!=="svelte-rceoh2"&&(S.innerHTML=Rt),Xe=r(e),$(A.$$.fragment,e),He=r(e),K=d(e,"P",{"data-svelte-h":!0}),f(K)!=="svelte-10zc6fb"&&(K.innerHTML=Vt),Ee=r(e),$(O.$$.fragment,e),Be=r(e),$(G.$$.fragment,e),Ye=r(e),$(ee.$$.fragment,e),Le=r(e),te=d(e,"P",{"data-svelte-h":!0}),f(te)!=="svelte-105dxgk"&&(te.innerHTML=Wt),Qe=r(e),$(F.$$.fragment,e),Ne=r(e),$(se.$$.fragment,e),Ie=r(e),ae=d(e,"P",{"data-svelte-h":!0}),f(ae)!=="svelte-1ir6m4o"&&(ae.innerHTML=Ut),Pe=r(e),$(X.$$.fragment,e),De=r(e),$(le.$$.fragment,e),Se=r(e),ne=d(e,"P",{"data-svelte-h":!0}),f(ne)!=="svelte-u9n0xn"&&(ne.innerHTML=xt),Ae=r(e),ie=d(e,"UL",{"data-svelte-h":!0}),f(ie)!=="svelte-1bupnko"&&(ie.innerHTML=Gt),Ke=r(e),oe=d(e,"P",{"data-svelte-h":!0}),f(oe)!=="svelte-10hgx86"&&(oe.textContent=Ft),Oe=r(e),$(H.$$.fragment,e),et=r(e),re=d(e,"P",{"data-svelte-h":!0}),f(re)!=="svelte-19yqkad"&&(re.innerHTML=Xt),tt=r(e),$(pe.$$.fragment,e),st=r(e),ce=d(e,"P",{"data-svelte-h":!0}),f(ce)!=="svelte-tgkt2x"&&(ce.innerHTML=Ht),at=r(e),$(ue.$$.fragment,e),lt=r(e),me=d(e,"P",{"data-svelte-h":!0}),f(me)!=="svelte-cd6sn7"&&(me.innerHTML=Et),nt=r(e),$(de.$$.fragment,e),it=r(e),$(E.$$.fragment,e),ot=r(e),$(fe.$$.fragment,e),rt=r(e),ge=d(e,"P",{"data-svelte-h":!0}),f(ge)!=="svelte-1wdma6m"&&(ge.innerHTML=Bt),pt=r(e),$e=d(e,"P",{"data-svelte-h":!0}),f($e)!=="svelte-172gwou"&&($e.innerHTML=Yt),ct=r(e),$(he.$$.fragment,e),ut=r(e),$(B.$$.fragment,e),mt=r(e),be=d(e,"P",{"data-svelte-h":!0}),f(be)!=="svelte-s82mgl"&&(be.innerHTML=Lt),dt=r(e),$(ye.$$.fragment,e),ft=r(e),je=d(e,"P",{"data-svelte-h":!0}),f(je)!=="svelte-10s4a3d"&&(je.innerHTML=Qt),gt=r(e),$(Me.$$.fragment,e),$t=r(e),$(ve.$$.fragment,e),ht=r(e),ze=d(e,"P",{"data-svelte-h":!0}),f(ze)!=="svelte-eo5266"&&(ze.innerHTML=Nt),bt=r(e),_e=d(e,"P",{"data-svelte-h":!0}),f(_e)!=="svelte-s1q7lo"&&(_e.textContent=It),yt=r(e),$(Te.$$.fragment,e),jt=r(e),qe=d(e,"P",{"data-svelte-h":!0}),f(qe)!=="svelte-14d8if5"&&(qe.textContent=Pt),Mt=r(e),$(we.$$.fragment,e),vt=r(e),Ze=d(e,"P",{"data-svelte-h":!0}),f(Ze)!=="svelte-bpecop"&&(Ze.innerHTML=Dt),zt=r(e),$(ke.$$.fragment,e),_t=r(e),Ce=d(e,"P",{"data-svelte-h":!0}),f(Ce)!=="svelte-13i7cen"&&(Ce.textContent=St),Tt=r(e),Re=d(e,"P",{}),as(Re).forEach(s),this.h()},h(){ls(l,"name","hf:doc:metadata"),ls(l,"content",Ts)},m(e,t){us(document.head,l),a(e,u,t),a(e,n,t),a(e,p,t),h(M,e,t),a(e,v,t),a(e,R,t),a(e,z,t),a(e,Z,t),a(e,_,t),h(V,e,t),a(e,C,t),a(e,U,t),a(e,J,t),a(e,W,t),a(e,T,t),h(L,e,t),a(e,Ve,t),a(e,Q,t),a(e,We,t),a(e,N,t),a(e,Ue,t),h(I,e,t),a(e,xe,t),a(e,P,t),a(e,Ge,t),h(D,e,t),a(e,Fe,t),a(e,S,t),a(e,Xe,t),h(A,e,t),a(e,He,t),a(e,K,t),a(e,Ee,t),h(O,e,t),a(e,Be,t),h(G,e,t),a(e,Ye,t),h(ee,e,t),a(e,Le,t),a(e,te,t),a(e,Qe,t),h(F,e,t),a(e,Ne,t),h(se,e,t),a(e,Ie,t),a(e,ae,t),a(e,Pe,t),h(X,e,t),a(e,De,t),h(le,e,t),a(e,Se,t),a(e,ne,t),a(e,Ae,t),a(e,ie,t),a(e,Ke,t),a(e,oe,t),a(e,Oe,t),h(H,e,t),a(e,et,t),a(e,re,t),a(e,tt,t),h(pe,e,t),a(e,st,t),a(e,ce,t),a(e,at,t),h(ue,e,t),a(e,lt,t),a(e,me,t),a(e,nt,t),h(de,e,t),a(e,it,t),h(E,e,t),a(e,ot,t),h(fe,e,t),a(e,rt,t),a(e,ge,t),a(e,pt,t),a(e,$e,t),a(e,ct,t),h(he,e,t),a(e,ut,t),h(B,e,t),a(e,mt,t),a(e,be,t),a(e,dt,t),h(ye,e,t),a(e,ft,t),a(e,je,t),a(e,gt,t),h(Me,e,t),a(e,$t,t),h(ve,e,t),a(e,ht,t),a(e,ze,t),a(e,bt,t),a(e,_e,t),a(e,yt,t),h(Te,e,t),a(e,jt,t),a(e,qe,t),a(e,Mt,t),h(we,e,t),a(e,vt,t),a(e,Ze,t),a(e,zt,t),h(ke,e,t),a(e,_t,t),a(e,Ce,t),a(e,Tt,t),a(e,Re,t),qt=!0},p(e,[t]){const At={};t&2&&(At.$$scope={dirty:t,ctx:e}),G.$set(At);const Kt={};t&2&&(Kt.$$scope={dirty:t,ctx:e}),F.$set(Kt);const Ot={};t&2&&(Ot.$$scope={dirty:t,ctx:e}),X.$set(Ot);const es={};t&2&&(es.$$scope={dirty:t,ctx:e}),H.$set(es);const ts={};t&2&&(ts.$$scope={dirty:t,ctx:e}),E.$set(ts);const ss={};t&2&&(ss.$$scope={dirty:t,ctx:e}),B.$set(ss)},i(e){qt||(b(M.$$.fragment,e),b(V.$$.fragment,e),b(L.$$.fragment,e),b(I.$$.fragment,e),b(D.$$.fragment,e),b(A.$$.fragment,e),b(O.$$.fragment,e),b(G.$$.fragment,e),b(ee.$$.fragment,e),b(F.$$.fragment,e),b(se.$$.fragment,e),b(X.$$.fragment,e),b(le.$$.fragment,e),b(H.$$.fragment,e),b(pe.$$.fragment,e),b(ue.$$.fragment,e),b(de.$$.fragment,e),b(E.$$.fragment,e),b(fe.$$.fragment,e),b(he.$$.fragment,e),b(B.$$.fragment,e),b(ye.$$.fragment,e),b(Me.$$.fragment,e),b(ve.$$.fragment,e),b(Te.$$.fragment,e),b(we.$$.fragment,e),b(ke.$$.fragment,e),qt=!0)},o(e){y(M.$$.fragment,e),y(V.$$.fragment,e),y(L.$$.fragment,e),y(I.$$.fragment,e),y(D.$$.fragment,e),y(A.$$.fragment,e),y(O.$$.fragment,e),y(G.$$.fragment,e),y(ee.$$.fragment,e),y(F.$$.fragment,e),y(se.$$.fragment,e),y(X.$$.fragment,e),y(le.$$.fragment,e),y(H.$$.fragment,e),y(pe.$$.fragment,e),y(ue.$$.fragment,e),y(de.$$.fragment,e),y(E.$$.fragment,e),y(fe.$$.fragment,e),y(he.$$.fragment,e),y(B.$$.fragment,e),y(ye.$$.fragment,e),y(Me.$$.fragment,e),y(ve.$$.fragment,e),y(Te.$$.fragment,e),y(we.$$.fragment,e),y(ke.$$.fragment,e),qt=!1},d(e){e&&(s(u),s(n),s(p),s(v),s(R),s(z),s(Z),s(_),s(C),s(U),s(J),s(W),s(T),s(Ve),s(Q),s(We),s(N),s(Ue),s(xe),s(P),s(Ge),s(Fe),s(S),s(Xe),s(He),s(K),s(Ee),s(Be),s(Ye),s(Le),s(te),s(Qe),s(Ne),s(Ie),s(ae),s(Pe),s(De),s(Se),s(ne),s(Ae),s(ie),s(Ke),s(oe),s(Oe),s(et),s(re),s(tt),s(st),s(ce),s(at),s(lt),s(me),s(nt),s(it),s(ot),s(rt),s(ge),s(pt),s($e),s(ct),s(ut),s(mt),s(be),s(dt),s(ft),s(je),s(gt),s($t),s(ht),s(ze),s(bt),s(_e),s(yt),s(jt),s(qe),s(Mt),s(vt),s(Ze),s(zt),s(_t),s(Ce),s(Tt),s(Re)),s(l),j(M,e),j(V,e),j(L,e),j(I,e),j(D,e),j(A,e),j(O,e),j(G,e),j(ee,e),j(F,e),j(se,e),j(X,e),j(le,e),j(H,e),j(pe,e),j(ue,e),j(de,e),j(E,e),j(fe,e),j(he,e),j(B,e),j(ye,e),j(Me,e),j(ve,e),j(Te,e),j(we,e),j(ke,e)}}}const Ts='{"title":"Crea un’architettura personalizzata","local":"crea-unarchitettura-personalizzata","sections":[{"title":"Configurazione","local":"configurazione","sections":[],"depth":2},{"title":"Modello","local":"modello","sections":[{"title":"Model head","local":"model-head","sections":[],"depth":3}],"depth":2},{"title":"Tokenizer","local":"tokenizer","sections":[],"depth":2},{"title":"Estrattore Di Feature","local":"estrattore-di-feature","sections":[],"depth":2},{"title":"Processore","local":"processore","sections":[],"depth":2}],"depth":1}';function qs(q){return os(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Vs extends rs{constructor(l){super(),ps(this,l,qs,_s,is,{})}}export{Vs as component};
