import{s as ca,o as ua,n as se}from"../chunks/scheduler.36a0863c.js";import{S as ma,i as da,g as p,s as o,u as g,A as fa,h as c,f as t,c as r,j as J,v as $,y as d,k as w,o as q,a,w as y,d as v,t as b,x as j}from"../chunks/index.d0f7a4c4.js";import{T as hs}from"../chunks/Tip.4c7d7eb1.js";import{I as Se}from"../chunks/IconCopyLink.bc5fad79.js";import{C}from"../chunks/CodeBlock.69433f87.js";import{F as pa,M as gs}from"../chunks/Markdown.1d1f160a.js";function ha(Z){let l,f='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=p("p"),l.innerHTML=f},l(n){l=c(n,"P",{"data-svelte-h":!0}),d(l)!=="svelte-15jhhcb"&&(l.innerHTML=f)},m(n,u){a(n,l,u)},p:se,d(n){n&&t(l)}}}function ga(Z){let l,f="Carica gli attributi della tua configurazione personalizzata nel modello:",n,u,h,_,W="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.",T,k,x="Crea un modello pre-allenato con <code>from_pretrained()</code>:",m,z,U,R,F="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:",E,V,G;return u=new C({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)`}}),z=new C({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>)'}}),V=new C({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)'}}),{c(){l=p("p"),l.textContent=f,n=o(),g(u.$$.fragment),h=o(),_=p("p"),_.textContent=W,T=o(),k=p("p"),k.innerHTML=x,m=o(),g(z.$$.fragment),U=o(),R=p("p"),R.textContent=F,E=o(),g(V.$$.fragment)},l(i){l=c(i,"P",{"data-svelte-h":!0}),d(l)!=="svelte-1cmkkoy"&&(l.textContent=f),n=r(i),$(u.$$.fragment,i),h=r(i),_=c(i,"P",{"data-svelte-h":!0}),d(_)!=="svelte-zq50ce"&&(_.textContent=W),T=r(i),k=c(i,"P",{"data-svelte-h":!0}),d(k)!=="svelte-so9er"&&(k.innerHTML=x),m=r(i),$(z.$$.fragment,i),U=r(i),R=c(i,"P",{"data-svelte-h":!0}),d(R)!=="svelte-1qjkbx4"&&(R.textContent=F),E=r(i),$(V.$$.fragment,i)},m(i,M){a(i,l,M),a(i,n,M),y(u,i,M),a(i,h,M),a(i,_,M),a(i,T,M),a(i,k,M),a(i,m,M),y(z,i,M),a(i,U,M),a(i,R,M),a(i,E,M),y(V,i,M),G=!0},p:se,i(i){G||(v(u.$$.fragment,i),v(z.$$.fragment,i),v(V.$$.fragment,i),G=!0)},o(i){b(u.$$.fragment,i),b(z.$$.fragment,i),b(V.$$.fragment,i),G=!1},d(i){i&&(t(l),t(n),t(h),t(_),t(T),t(k),t(m),t(U),t(R),t(E)),j(u,i),j(z,i),j(V,i)}}}function $a(Z){let l,f;return l=new gs({props:{$$slots:{default:[ga]},$$scope:{ctx:Z}}}),{c(){g(l.$$.fragment)},l(n){$(l.$$.fragment,n)},m(n,u){y(l,n,u),f=!0},p(n,u){const h={};u&2&&(h.$$scope={dirty:u,ctx:n}),l.$set(h)},i(n){f||(v(l.$$.fragment,n),f=!0)},o(n){b(l.$$.fragment,n),f=!1},d(n){j(l,n)}}}function ya(Z){let l,f="Carica gli attributi di configurazione personalizzati nel modello:",n,u,h,_,W="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.",T,k,x="Crea un modello pre-allenoto con <code>from_pretrained()</code>:",m,z,U,R,F="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:",E,V,G;return u=new C({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)`}}),z=new C({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>)'}}),V=new C({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)'}}),{c(){l=p("p"),l.textContent=f,n=o(),g(u.$$.fragment),h=o(),_=p("p"),_.textContent=W,T=o(),k=p("p"),k.innerHTML=x,m=o(),g(z.$$.fragment),U=o(),R=p("p"),R.textContent=F,E=o(),g(V.$$.fragment)},l(i){l=c(i,"P",{"data-svelte-h":!0}),d(l)!=="svelte-1hu91xr"&&(l.textContent=f),n=r(i),$(u.$$.fragment,i),h=r(i),_=c(i,"P",{"data-svelte-h":!0}),d(_)!=="svelte-zq50ce"&&(_.textContent=W),T=r(i),k=c(i,"P",{"data-svelte-h":!0}),d(k)!=="svelte-3b4nvp"&&(k.innerHTML=x),m=r(i),$(z.$$.fragment,i),U=r(i),R=c(i,"P",{"data-svelte-h":!0}),d(R)!=="svelte-16aucye"&&(R.textContent=F),E=r(i),$(V.$$.fragment,i)},m(i,M){a(i,l,M),a(i,n,M),y(u,i,M),a(i,h,M),a(i,_,M),a(i,T,M),a(i,k,M),a(i,m,M),y(z,i,M),a(i,U,M),a(i,R,M),a(i,E,M),y(V,i,M),G=!0},p:se,i(i){G||(v(u.$$.fragment,i),v(z.$$.fragment,i),v(V.$$.fragment,i),G=!0)},o(i){b(u.$$.fragment,i),b(z.$$.fragment,i),b(V.$$.fragment,i),G=!1},d(i){i&&(t(l),t(n),t(h),t(_),t(T),t(k),t(m),t(U),t(R),t(E)),j(u,i),j(z,i),j(V,i)}}}function va(Z){let l,f;return l=new gs({props:{$$slots:{default:[ya]},$$scope:{ctx:Z}}}),{c(){g(l.$$.fragment)},l(n){$(l.$$.fragment,n)},m(n,u){y(l,n,u),f=!0},p(n,u){const h={};u&2&&(h.$$scope={dirty:u,ctx:n}),l.$set(h)},i(n){f||(v(l.$$.fragment,n),f=!0)},o(n){b(l.$$.fragment,n),f=!1},d(n){j(l,n)}}}function ba(Z){let l,f="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,u,h,_,W="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)",T,k,x;return u=new C({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>)`}}),k=new C({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>)`}}),{c(){l=p("p"),l.innerHTML=f,n=o(),g(u.$$.fragment),h=o(),_=p("p"),_.innerHTML=W,T=o(),g(k.$$.fragment)},l(m){l=c(m,"P",{"data-svelte-h":!0}),d(l)!=="svelte-1u5umc5"&&(l.innerHTML=f),n=r(m),$(u.$$.fragment,m),h=r(m),_=c(m,"P",{"data-svelte-h":!0}),d(_)!=="svelte-3acy4z"&&(_.innerHTML=W),T=r(m),$(k.$$.fragment,m)},m(m,z){a(m,l,z),a(m,n,z),y(u,m,z),a(m,h,z),a(m,_,z),a(m,T,z),y(k,m,z),x=!0},p:se,i(m){x||(v(u.$$.fragment,m),v(k.$$.fragment,m),x=!0)},o(m){b(u.$$.fragment,m),b(k.$$.fragment,m),x=!1},d(m){m&&(t(l),t(n),t(h),t(_),t(T)),j(u,m),j(k,m)}}}function ja(Z){let l,f;return l=new gs({props:{$$slots:{default:[ba]},$$scope:{ctx:Z}}}),{c(){g(l.$$.fragment)},l(n){$(l.$$.fragment,n)},m(n,u){y(l,n,u),f=!0},p(n,u){const h={};u&2&&(h.$$scope={dirty:u,ctx:n}),l.$set(h)},i(n){f||(v(l.$$.fragment,n),f=!0)},o(n){b(l.$$.fragment,n),f=!1},d(n){j(l,n)}}}function _a(Z){let l,f="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,u,h,_,W="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)",T,k,x;return u=new C({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>)`}}),k=new C({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>)`}}),{c(){l=p("p"),l.innerHTML=f,n=o(),g(u.$$.fragment),h=o(),_=p("p"),_.innerHTML=W,T=o(),g(k.$$.fragment)},l(m){l=c(m,"P",{"data-svelte-h":!0}),d(l)!=="svelte-12mkr0g"&&(l.innerHTML=f),n=r(m),$(u.$$.fragment,m),h=r(m),_=c(m,"P",{"data-svelte-h":!0}),d(_)!=="svelte-1gxw94o"&&(_.innerHTML=W),T=r(m),$(k.$$.fragment,m)},m(m,z){a(m,l,z),a(m,n,z),y(u,m,z),a(m,h,z),a(m,_,z),a(m,T,z),y(k,m,z),x=!0},p:se,i(m){x||(v(u.$$.fragment,m),v(k.$$.fragment,m),x=!0)},o(m){b(u.$$.fragment,m),b(k.$$.fragment,m),x=!1},d(m){m&&(t(l),t(n),t(h),t(_),t(T)),j(u,m),j(k,m)}}}function za(Z){let l,f;return l=new gs({props:{$$slots:{default:[_a]},$$scope:{ctx:Z}}}),{c(){g(l.$$.fragment)},l(n){$(l.$$.fragment,n)},m(n,u){y(l,n,u),f=!0},p(n,u){const h={};u&2&&(h.$$scope={dirty:u,ctx:n}),l.$set(h)},i(n){f||(v(l.$$.fragment,n),f=!0)},o(n){b(l.$$.fragment,n),f=!1},d(n){j(l,n)}}}function Ma(Z){let l,f='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=p("p"),l.innerHTML=f},l(n){l=c(n,"P",{"data-svelte-h":!0}),d(l)!=="svelte-1jbik8k"&&(l.innerHTML=f)},m(n,u){a(n,l,u)},p:se,d(n){n&&t(l)}}}function ka(Z){let l,f="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=p("p"),l.innerHTML=f},l(n){l=c(n,"P",{"data-svelte-h":!0}),d(l)!=="svelte-1ar4vf4"&&(l.innerHTML=f)},m(n,u){a(n,l,u)},p:se,d(n){n&&t(l)}}}function wa(Z){let l,f="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=p("p"),l.innerHTML=f},l(n){l=c(n,"P",{"data-svelte-h":!0}),d(l)!=="svelte-10hto70"&&(l.innerHTML=f)},m(n,u){a(n,l,u)},p:se,d(n){n&&t(l)}}}function qa(Z){let l,f,n,u,h,_,W,T,k,x,m="Crea un'architettura personalizzata",z,U,R='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:',F,E,V="<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>",G,i,M,st,ae,$s,De,zs="Configurazione",dt,le,Ms='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.',ft,ne,ks='Dai un’occhiata più da vicino a <a href="model_doc/distilbert">DistilBERT</a> accedendo a <code>DistilBertConfig</code> per ispezionare i suoi attributi:',ht,ie,gt,oe,ws="<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:",$t,re,qs="<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>",yt,pe,vt,ce,Ts="Nella funzione <code>from_pretrained()</code> possono essere modificati gli attributi del modello pre-allenato:",bt,ue,jt,me,Zs="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:",_t,de,zt,fe,Cs="Per riutilizzare la configurazione del file, caricalo con <code>from_pretrained()</code>:",Mt,he,kt,N,wt,H,Q,at,ge,ys,Ae,Js="Modello",qt,$e,xs='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.',Tt,P,Zt,X,I,lt,ye,vs,Ke,Rs="Model head",Ct,ve,Vs="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).",Jt,S,xt,B,D,nt,be,bs,Oe,Ws="Tokenizer",Rt,je,Us='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:',Vt,_e,Es='<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>',Wt,ze,Gs="Entrambi i tokenizer supportano metodi comuni come la codifica e la decodifica, l’aggiunta di nuovi token e la gestione di token speciali.",Ut,A,Et,Me,Fs="Se hai addestrato il tuo tokenizer, puoi crearne uno dal tuo file <em>vocabolario</em>:",Gt,ke,Ft,we,Hs="È 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>:",Ht,qe,Xt,Te,Xs="Crea un tokenizer veloce con la classe <code>DistilBertTokenizerFast</code>:",Bt,Ze,Yt,K,Lt,Y,O,it,Ce,js,et,Bs="Estrattore Di Feature",Nt,Je,Ys="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.",Qt,xe,Ls='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:',Pt,Re,It,ee,St,Ve,Ns="Modifica uno qualsiasi dei parametri <code>ViTFeatureExtractor</code> per creare il tuo estrattore di caratteristiche personalizzato:",Dt,We,At,Ue,Qs="Per gli input audio, puoi creare un <code>Wav2Vec2FeatureExtractor</code> e personalizzare i parametri in modo simile:",Kt,Ee,Ot,L,te,ot,Ge,_s,tt,Ps="Processore",es,Fe,Is="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.",ts,He,Ss="Crea un estrattore di feature per gestire gli input audio:",ss,Xe,as,Be,Ds="Crea un tokenizer per gestire gli input di testo:",ls,Ye,ns,Le,As="Combinare l’estrattore di caratteristiche e il tokenizer in <code>Wav2Vec2Processor</code>:",is,Ne,os,Qe,Ks="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.",rs,rt,ps;return T=new Se({}),ae=new Se({}),ie=new C({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>
}`}}),pe=new C({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>
}`}}),ue=new C({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>)'}}),de=new C({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>)'}}),he=new C({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>)'}}),N=new hs({props:{$$slots:{default:[ha]},$$scope:{ctx:Z}}}),ge=new Se({}),P=new pa({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[va],pytorch:[$a]},$$scope:{ctx:Z}}}),ye=new Se({}),S=new pa({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[za],pytorch:[ja]},$$scope:{ctx:Z}}}),be=new Se({}),A=new hs({props:{warning:!0,$$slots:{default:[Ma]},$$scope:{ctx:Z}}}),ke=new C({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>)`}}),qe=new C({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>)`}}),Ze=new C({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>)`}}),K=new hs({props:{$$slots:{default:[ka]},$$scope:{ctx:Z}}}),Ce=new Se({}),Re=new C({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>
}`}}),ee=new hs({props:{$$slots:{default:[wa]},$$scope:{ctx:Z}}}),We=new C({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>
}`}}),Ee=new C({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>
}`}}),Ge=new Se({}),Xe=new C({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>)`}}),Ye=new C({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>)`}}),Ne=new C({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)`}}),{c(){l=p("meta"),f=o(),n=p("p"),u=o(),h=p("h1"),_=p("a"),W=p("span"),g(T.$$.fragment),k=o(),x=p("span"),x.textContent=m,z=o(),U=p("p"),U.innerHTML=R,F=o(),E=p("ul"),E.innerHTML=V,G=o(),i=p("h2"),M=p("a"),st=p("span"),g(ae.$$.fragment),$s=o(),De=p("span"),De.textContent=zs,dt=o(),le=p("p"),le.innerHTML=Ms,ft=o(),ne=p("p"),ne.innerHTML=ks,ht=o(),g(ie.$$.fragment),gt=o(),oe=p("p"),oe.innerHTML=ws,$t=o(),re=p("ul"),re.innerHTML=qs,yt=o(),g(pe.$$.fragment),vt=o(),ce=p("p"),ce.innerHTML=Ts,bt=o(),g(ue.$$.fragment),jt=o(),me=p("p"),me.innerHTML=Zs,_t=o(),g(de.$$.fragment),zt=o(),fe=p("p"),fe.innerHTML=Cs,Mt=o(),g(he.$$.fragment),kt=o(),g(N.$$.fragment),wt=o(),H=p("h2"),Q=p("a"),at=p("span"),g(ge.$$.fragment),ys=o(),Ae=p("span"),Ae.textContent=Js,qt=o(),$e=p("p"),$e.innerHTML=xs,Tt=o(),g(P.$$.fragment),Zt=o(),X=p("h3"),I=p("a"),lt=p("span"),g(ye.$$.fragment),vs=o(),Ke=p("span"),Ke.textContent=Rs,Ct=o(),ve=p("p"),ve.innerHTML=Vs,Jt=o(),g(S.$$.fragment),xt=o(),B=p("h2"),D=p("a"),nt=p("span"),g(be.$$.fragment),bs=o(),Oe=p("span"),Oe.textContent=Ws,Rt=o(),je=p("p"),je.innerHTML=Us,Vt=o(),_e=p("ul"),_e.innerHTML=Es,Wt=o(),ze=p("p"),ze.textContent=Gs,Ut=o(),g(A.$$.fragment),Et=o(),Me=p("p"),Me.innerHTML=Fs,Gt=o(),g(ke.$$.fragment),Ft=o(),we=p("p"),we.innerHTML=Hs,Ht=o(),g(qe.$$.fragment),Xt=o(),Te=p("p"),Te.innerHTML=Xs,Bt=o(),g(Ze.$$.fragment),Yt=o(),g(K.$$.fragment),Lt=o(),Y=p("h2"),O=p("a"),it=p("span"),g(Ce.$$.fragment),js=o(),et=p("span"),et.textContent=Bs,Nt=o(),Je=p("p"),Je.innerHTML=Ys,Qt=o(),xe=p("p"),xe.innerHTML=Ls,Pt=o(),g(Re.$$.fragment),It=o(),g(ee.$$.fragment),St=o(),Ve=p("p"),Ve.innerHTML=Ns,Dt=o(),g(We.$$.fragment),At=o(),Ue=p("p"),Ue.innerHTML=Qs,Kt=o(),g(Ee.$$.fragment),Ot=o(),L=p("h2"),te=p("a"),ot=p("span"),g(Ge.$$.fragment),_s=o(),tt=p("span"),tt.textContent=Ps,es=o(),Fe=p("p"),Fe.innerHTML=Is,ts=o(),He=p("p"),He.textContent=Ss,ss=o(),g(Xe.$$.fragment),as=o(),Be=p("p"),Be.textContent=Ds,ls=o(),g(Ye.$$.fragment),ns=o(),Le=p("p"),Le.innerHTML=As,is=o(),g(Ne.$$.fragment),os=o(),Qe=p("p"),Qe.textContent=Ks,rs=o(),rt=p("p"),this.h()},l(e){const s=fa("svelte-1phssyn",document.head);l=c(s,"META",{name:!0,content:!0}),s.forEach(t),f=r(e),n=c(e,"P",{}),J(n).forEach(t),u=r(e),h=c(e,"H1",{class:!0});var Pe=J(h);_=c(Pe,"A",{id:!0,class:!0,href:!0});var pt=J(_);W=c(pt,"SPAN",{});var ct=J(W);$(T.$$.fragment,ct),ct.forEach(t),pt.forEach(t),k=r(Pe),x=c(Pe,"SPAN",{"data-svelte-h":!0}),d(x)!=="svelte-1dlr0jf"&&(x.textContent=m),Pe.forEach(t),z=r(e),U=c(e,"P",{"data-svelte-h":!0}),d(U)!=="svelte-1pk49vt"&&(U.innerHTML=R),F=r(e),E=c(e,"UL",{"data-svelte-h":!0}),d(E)!=="svelte-1i4pxwa"&&(E.innerHTML=V),G=r(e),i=c(e,"H2",{class:!0});var Ie=J(i);M=c(Ie,"A",{id:!0,class:!0,href:!0});var ut=J(M);st=c(ut,"SPAN",{});var mt=J(st);$(ae.$$.fragment,mt),mt.forEach(t),ut.forEach(t),$s=r(Ie),De=c(Ie,"SPAN",{"data-svelte-h":!0}),d(De)!=="svelte-180u59c"&&(De.textContent=zs),Ie.forEach(t),dt=r(e),le=c(e,"P",{"data-svelte-h":!0}),d(le)!=="svelte-1g7k4fs"&&(le.innerHTML=Ms),ft=r(e),ne=c(e,"P",{"data-svelte-h":!0}),d(ne)!=="svelte-zjobm7"&&(ne.innerHTML=ks),ht=r(e),$(ie.$$.fragment,e),gt=r(e),oe=c(e,"P",{"data-svelte-h":!0}),d(oe)!=="svelte-1nu4if9"&&(oe.innerHTML=ws),$t=r(e),re=c(e,"UL",{"data-svelte-h":!0}),d(re)!=="svelte-timpd0"&&(re.innerHTML=qs),yt=r(e),$(pe.$$.fragment,e),vt=r(e),ce=c(e,"P",{"data-svelte-h":!0}),d(ce)!=="svelte-1vxy6m3"&&(ce.innerHTML=Ts),bt=r(e),$(ue.$$.fragment,e),jt=r(e),me=c(e,"P",{"data-svelte-h":!0}),d(me)!=="svelte-rceoh2"&&(me.innerHTML=Zs),_t=r(e),$(de.$$.fragment,e),zt=r(e),fe=c(e,"P",{"data-svelte-h":!0}),d(fe)!=="svelte-10zc6fb"&&(fe.innerHTML=Cs),Mt=r(e),$(he.$$.fragment,e),kt=r(e),$(N.$$.fragment,e),wt=r(e),H=c(e,"H2",{class:!0});var cs=J(H);Q=c(cs,"A",{id:!0,class:!0,href:!0});var Os=J(Q);at=c(Os,"SPAN",{});var ea=J(at);$(ge.$$.fragment,ea),ea.forEach(t),Os.forEach(t),ys=r(cs),Ae=c(cs,"SPAN",{"data-svelte-h":!0}),d(Ae)!=="svelte-szu843"&&(Ae.textContent=Js),cs.forEach(t),qt=r(e),$e=c(e,"P",{"data-svelte-h":!0}),d($e)!=="svelte-105dxgk"&&($e.innerHTML=xs),Tt=r(e),$(P.$$.fragment,e),Zt=r(e),X=c(e,"H3",{class:!0});var us=J(X);I=c(us,"A",{id:!0,class:!0,href:!0});var ta=J(I);lt=c(ta,"SPAN",{});var sa=J(lt);$(ye.$$.fragment,sa),sa.forEach(t),ta.forEach(t),vs=r(us),Ke=c(us,"SPAN",{"data-svelte-h":!0}),d(Ke)!=="svelte-1tftj86"&&(Ke.textContent=Rs),us.forEach(t),Ct=r(e),ve=c(e,"P",{"data-svelte-h":!0}),d(ve)!=="svelte-1ir6m4o"&&(ve.innerHTML=Vs),Jt=r(e),$(S.$$.fragment,e),xt=r(e),B=c(e,"H2",{class:!0});var ms=J(B);D=c(ms,"A",{id:!0,class:!0,href:!0});var aa=J(D);nt=c(aa,"SPAN",{});var la=J(nt);$(be.$$.fragment,la),la.forEach(t),aa.forEach(t),bs=r(ms),Oe=c(ms,"SPAN",{"data-svelte-h":!0}),d(Oe)!=="svelte-1txg6py"&&(Oe.textContent=Ws),ms.forEach(t),Rt=r(e),je=c(e,"P",{"data-svelte-h":!0}),d(je)!=="svelte-u9n0xn"&&(je.innerHTML=Us),Vt=r(e),_e=c(e,"UL",{"data-svelte-h":!0}),d(_e)!=="svelte-1bupnko"&&(_e.innerHTML=Es),Wt=r(e),ze=c(e,"P",{"data-svelte-h":!0}),d(ze)!=="svelte-10hgx86"&&(ze.textContent=Gs),Ut=r(e),$(A.$$.fragment,e),Et=r(e),Me=c(e,"P",{"data-svelte-h":!0}),d(Me)!=="svelte-19yqkad"&&(Me.innerHTML=Fs),Gt=r(e),$(ke.$$.fragment,e),Ft=r(e),we=c(e,"P",{"data-svelte-h":!0}),d(we)!=="svelte-tgkt2x"&&(we.innerHTML=Hs),Ht=r(e),$(qe.$$.fragment,e),Xt=r(e),Te=c(e,"P",{"data-svelte-h":!0}),d(Te)!=="svelte-cd6sn7"&&(Te.innerHTML=Xs),Bt=r(e),$(Ze.$$.fragment,e),Yt=r(e),$(K.$$.fragment,e),Lt=r(e),Y=c(e,"H2",{class:!0});var ds=J(Y);O=c(ds,"A",{id:!0,class:!0,href:!0});var na=J(O);it=c(na,"SPAN",{});var ia=J(it);$(Ce.$$.fragment,ia),ia.forEach(t),na.forEach(t),js=r(ds),et=c(ds,"SPAN",{"data-svelte-h":!0}),d(et)!=="svelte-1e3kxgr"&&(et.textContent=Bs),ds.forEach(t),Nt=r(e),Je=c(e,"P",{"data-svelte-h":!0}),d(Je)!=="svelte-1wdma6m"&&(Je.innerHTML=Ys),Qt=r(e),xe=c(e,"P",{"data-svelte-h":!0}),d(xe)!=="svelte-172gwou"&&(xe.innerHTML=Ls),Pt=r(e),$(Re.$$.fragment,e),It=r(e),$(ee.$$.fragment,e),St=r(e),Ve=c(e,"P",{"data-svelte-h":!0}),d(Ve)!=="svelte-s82mgl"&&(Ve.innerHTML=Ns),Dt=r(e),$(We.$$.fragment,e),At=r(e),Ue=c(e,"P",{"data-svelte-h":!0}),d(Ue)!=="svelte-10s4a3d"&&(Ue.innerHTML=Qs),Kt=r(e),$(Ee.$$.fragment,e),Ot=r(e),L=c(e,"H2",{class:!0});var fs=J(L);te=c(fs,"A",{id:!0,class:!0,href:!0});var oa=J(te);ot=c(oa,"SPAN",{});var ra=J(ot);$(Ge.$$.fragment,ra),ra.forEach(t),oa.forEach(t),_s=r(fs),tt=c(fs,"SPAN",{"data-svelte-h":!0}),d(tt)!=="svelte-zt5b6s"&&(tt.textContent=Ps),fs.forEach(t),es=r(e),Fe=c(e,"P",{"data-svelte-h":!0}),d(Fe)!=="svelte-eo5266"&&(Fe.innerHTML=Is),ts=r(e),He=c(e,"P",{"data-svelte-h":!0}),d(He)!=="svelte-s1q7lo"&&(He.textContent=Ss),ss=r(e),$(Xe.$$.fragment,e),as=r(e),Be=c(e,"P",{"data-svelte-h":!0}),d(Be)!=="svelte-14d8if5"&&(Be.textContent=Ds),ls=r(e),$(Ye.$$.fragment,e),ns=r(e),Le=c(e,"P",{"data-svelte-h":!0}),d(Le)!=="svelte-bpecop"&&(Le.innerHTML=As),is=r(e),$(Ne.$$.fragment,e),os=r(e),Qe=c(e,"P",{"data-svelte-h":!0}),d(Qe)!=="svelte-13i7cen"&&(Qe.textContent=Ks),rs=r(e),rt=c(e,"P",{}),J(rt).forEach(t),this.h()},h(){w(l,"name","hf:doc:metadata"),w(l,"content",JSON.stringify(Ta)),w(_,"id","crea-unarchitettura-personalizzata"),w(_,"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"),w(_,"href","#crea-unarchitettura-personalizzata"),w(h,"class","relative group"),w(M,"id","configurazione"),w(M,"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"),w(M,"href","#configurazione"),w(i,"class","relative group"),w(Q,"id","modello"),w(Q,"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"),w(Q,"href","#modello"),w(H,"class","relative group"),w(I,"id","model-head"),w(I,"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"),w(I,"href","#model-head"),w(X,"class","relative group"),w(D,"id","tokenizer"),w(D,"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"),w(D,"href","#tokenizer"),w(B,"class","relative group"),w(O,"id","estrattore-di-feature"),w(O,"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"),w(O,"href","#estrattore-di-feature"),w(Y,"class","relative group"),w(te,"id","processore"),w(te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),w(te,"href","#processore"),w(L,"class","relative group")},m(e,s){q(document.head,l),a(e,f,s),a(e,n,s),a(e,u,s),a(e,h,s),q(h,_),q(_,W),y(T,W,null),q(h,k),q(h,x),a(e,z,s),a(e,U,s),a(e,F,s),a(e,E,s),a(e,G,s),a(e,i,s),q(i,M),q(M,st),y(ae,st,null),q(i,$s),q(i,De),a(e,dt,s),a(e,le,s),a(e,ft,s),a(e,ne,s),a(e,ht,s),y(ie,e,s),a(e,gt,s),a(e,oe,s),a(e,$t,s),a(e,re,s),a(e,yt,s),y(pe,e,s),a(e,vt,s),a(e,ce,s),a(e,bt,s),y(ue,e,s),a(e,jt,s),a(e,me,s),a(e,_t,s),y(de,e,s),a(e,zt,s),a(e,fe,s),a(e,Mt,s),y(he,e,s),a(e,kt,s),y(N,e,s),a(e,wt,s),a(e,H,s),q(H,Q),q(Q,at),y(ge,at,null),q(H,ys),q(H,Ae),a(e,qt,s),a(e,$e,s),a(e,Tt,s),y(P,e,s),a(e,Zt,s),a(e,X,s),q(X,I),q(I,lt),y(ye,lt,null),q(X,vs),q(X,Ke),a(e,Ct,s),a(e,ve,s),a(e,Jt,s),y(S,e,s),a(e,xt,s),a(e,B,s),q(B,D),q(D,nt),y(be,nt,null),q(B,bs),q(B,Oe),a(e,Rt,s),a(e,je,s),a(e,Vt,s),a(e,_e,s),a(e,Wt,s),a(e,ze,s),a(e,Ut,s),y(A,e,s),a(e,Et,s),a(e,Me,s),a(e,Gt,s),y(ke,e,s),a(e,Ft,s),a(e,we,s),a(e,Ht,s),y(qe,e,s),a(e,Xt,s),a(e,Te,s),a(e,Bt,s),y(Ze,e,s),a(e,Yt,s),y(K,e,s),a(e,Lt,s),a(e,Y,s),q(Y,O),q(O,it),y(Ce,it,null),q(Y,js),q(Y,et),a(e,Nt,s),a(e,Je,s),a(e,Qt,s),a(e,xe,s),a(e,Pt,s),y(Re,e,s),a(e,It,s),y(ee,e,s),a(e,St,s),a(e,Ve,s),a(e,Dt,s),y(We,e,s),a(e,At,s),a(e,Ue,s),a(e,Kt,s),y(Ee,e,s),a(e,Ot,s),a(e,L,s),q(L,te),q(te,ot),y(Ge,ot,null),q(L,_s),q(L,tt),a(e,es,s),a(e,Fe,s),a(e,ts,s),a(e,He,s),a(e,ss,s),y(Xe,e,s),a(e,as,s),a(e,Be,s),a(e,ls,s),y(Ye,e,s),a(e,ns,s),a(e,Le,s),a(e,is,s),y(Ne,e,s),a(e,os,s),a(e,Qe,s),a(e,rs,s),a(e,rt,s),ps=!0},p(e,[s]){const Pe={};s&2&&(Pe.$$scope={dirty:s,ctx:e}),N.$set(Pe);const pt={};s&2&&(pt.$$scope={dirty:s,ctx:e}),P.$set(pt);const ct={};s&2&&(ct.$$scope={dirty:s,ctx:e}),S.$set(ct);const Ie={};s&2&&(Ie.$$scope={dirty:s,ctx:e}),A.$set(Ie);const ut={};s&2&&(ut.$$scope={dirty:s,ctx:e}),K.$set(ut);const mt={};s&2&&(mt.$$scope={dirty:s,ctx:e}),ee.$set(mt)},i(e){ps||(v(T.$$.fragment,e),v(ae.$$.fragment,e),v(ie.$$.fragment,e),v(pe.$$.fragment,e),v(ue.$$.fragment,e),v(de.$$.fragment,e),v(he.$$.fragment,e),v(N.$$.fragment,e),v(ge.$$.fragment,e),v(P.$$.fragment,e),v(ye.$$.fragment,e),v(S.$$.fragment,e),v(be.$$.fragment,e),v(A.$$.fragment,e),v(ke.$$.fragment,e),v(qe.$$.fragment,e),v(Ze.$$.fragment,e),v(K.$$.fragment,e),v(Ce.$$.fragment,e),v(Re.$$.fragment,e),v(ee.$$.fragment,e),v(We.$$.fragment,e),v(Ee.$$.fragment,e),v(Ge.$$.fragment,e),v(Xe.$$.fragment,e),v(Ye.$$.fragment,e),v(Ne.$$.fragment,e),ps=!0)},o(e){b(T.$$.fragment,e),b(ae.$$.fragment,e),b(ie.$$.fragment,e),b(pe.$$.fragment,e),b(ue.$$.fragment,e),b(de.$$.fragment,e),b(he.$$.fragment,e),b(N.$$.fragment,e),b(ge.$$.fragment,e),b(P.$$.fragment,e),b(ye.$$.fragment,e),b(S.$$.fragment,e),b(be.$$.fragment,e),b(A.$$.fragment,e),b(ke.$$.fragment,e),b(qe.$$.fragment,e),b(Ze.$$.fragment,e),b(K.$$.fragment,e),b(Ce.$$.fragment,e),b(Re.$$.fragment,e),b(ee.$$.fragment,e),b(We.$$.fragment,e),b(Ee.$$.fragment,e),b(Ge.$$.fragment,e),b(Xe.$$.fragment,e),b(Ye.$$.fragment,e),b(Ne.$$.fragment,e),ps=!1},d(e){e&&(t(f),t(n),t(u),t(h),t(z),t(U),t(F),t(E),t(G),t(i),t(dt),t(le),t(ft),t(ne),t(ht),t(gt),t(oe),t($t),t(re),t(yt),t(vt),t(ce),t(bt),t(jt),t(me),t(_t),t(zt),t(fe),t(Mt),t(kt),t(wt),t(H),t(qt),t($e),t(Tt),t(Zt),t(X),t(Ct),t(ve),t(Jt),t(xt),t(B),t(Rt),t(je),t(Vt),t(_e),t(Wt),t(ze),t(Ut),t(Et),t(Me),t(Gt),t(Ft),t(we),t(Ht),t(Xt),t(Te),t(Bt),t(Yt),t(Lt),t(Y),t(Nt),t(Je),t(Qt),t(xe),t(Pt),t(It),t(St),t(Ve),t(Dt),t(At),t(Ue),t(Kt),t(Ot),t(L),t(es),t(Fe),t(ts),t(He),t(ss),t(as),t(Be),t(ls),t(ns),t(Le),t(is),t(os),t(Qe),t(rs),t(rt)),t(l),j(T),j(ae),j(ie,e),j(pe,e),j(ue,e),j(de,e),j(he,e),j(N,e),j(ge),j(P,e),j(ye),j(S,e),j(be),j(A,e),j(ke,e),j(qe,e),j(Ze,e),j(K,e),j(Ce),j(Re,e),j(ee,e),j(We,e),j(Ee,e),j(Ge),j(Xe,e),j(Ye,e),j(Ne,e)}}}const Ta={local:"crea-unarchitettura-personalizzata",sections:[{local:"configurazione",title:"Configurazione"},{local:"modello",sections:[{local:"model-head",title:"Model head"}],title:"Modello"},{local:"tokenizer",title:"Tokenizer"},{local:"estrattore-di-feature",title:"Estrattore Di Feature"},{local:"processore",title:"Processore"}],title:"Crea un'architettura personalizzata "};function Za(Z){return ua(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ua extends ma{constructor(l){super(),da(this,l,Za,qa,ca,{})}}export{Ua as component};
