import{s as na,o as ia,n as V}from"../chunks/scheduler.36a0863c.js";import{S as oa,i as ra,g as m,s as p,u as h,A as pa,h as u,f as s,c,j as x,v as g,y,k as _,o as z,a as n,w as b,d as M,t as w,x as v}from"../chunks/index.d0f7a4c4.js";import{T as Tt}from"../chunks/Tip.4c7d7eb1.js";import{Y as aa}from"../chunks/Youtube.d15bb502.js";import{I as ce}from"../chunks/IconCopyLink.bc5fad79.js";import{C}from"../chunks/CodeBlock.4236768d.js";import{D as ca}from"../chunks/DocNotebookDropdown.95febfe3.js";import{F as jt,M as X}from"../chunks/Markdown.2bf44d4a.js";function ma(j){let l,o=`Tutti gli esempi di codice presenti in questa documentazione hanno un pulsante in alto a sinistra che permette di selezionare tra PyTorch e TensorFlow. Se
questo non è presente, ci si aspetta che il codice funzioni per entrambi i backend senza alcun cambiamento.`;return{c(){l=m("p"),l.textContent=o},l(t){l=u(t,"P",{"data-svelte-h":!0}),y(l)!=="svelte-8wrg7y"&&(l.textContent=o)},m(t,i){n(t,l,i)},p:V,d(t){t&&s(l)}}}function ua(j){let l,o='Per maggiori dettagli legati alla <code>pipeline()</code> e ai compiti ad essa associati, fai riferimento alla documentazione <a href="./main_classes/pipelines">qui</a>.';return{c(){l=m("p"),l.innerHTML=o},l(t){l=u(t,"P",{"data-svelte-h":!0}),y(l)!=="svelte-1x9csbh"&&(l.innerHTML=o)},m(t,i){n(t,l,i)},p:V,d(t){t&&s(l)}}}function fa(j){let l,o;return l=new C({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRvcmNo",highlighted:"pip install torch",wrap:!1}}),{c(){h(l.$$.fragment)},l(t){g(l.$$.fragment,t)},m(t,i){b(l,t,i),o=!0},p:V,i(t){o||(M(l.$$.fragment,t),o=!0)},o(t){w(l.$$.fragment,t),o=!1},d(t){v(l,t)}}}function da(j){let l,o;return l=new X({props:{$$slots:{default:[fa]},$$scope:{ctx:j}}}),{c(){h(l.$$.fragment)},l(t){g(l.$$.fragment,t)},m(t,i){b(l,t,i),o=!0},p(t,i){const f={};i&2&&(f.$$scope={dirty:i,ctx:t}),l.$set(f)},i(t){o||(M(l.$$.fragment,t),o=!0)},o(t){w(l.$$.fragment,t),o=!1},d(t){v(l,t)}}}function $a(j){let l,o;return l=new C({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRlbnNvcmZsb3c=",highlighted:"pip install tensorflow",wrap:!1}}),{c(){h(l.$$.fragment)},l(t){g(l.$$.fragment,t)},m(t,i){b(l,t,i),o=!0},p:V,i(t){o||(M(l.$$.fragment,t),o=!0)},o(t){w(l.$$.fragment,t),o=!1},d(t){v(l,t)}}}function ha(j){let l,o;return l=new X({props:{$$slots:{default:[$a]},$$scope:{ctx:j}}}),{c(){h(l.$$.fragment)},l(t){g(l.$$.fragment,t)},m(t,i){b(l,t,i),o=!0},p(t,i){const f={};i&2&&(f.$$scope={dirty:i,ctx:t}),l.$set(f)},i(t){o||(M(l.$$.fragment,t),o=!0)},o(t){w(l.$$.fragment,t),o=!1},d(t){v(l,t)}}}function ga(j){let l,o="Usa <code>AutoModelForSequenceClassification</code> e <code>AutoTokenizer</code> per caricare il modello pre-allenato e il suo tokenizer associato (maggiori informazioni su una <code>AutoClass</code> in seguito):",t,i,f;return i=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZChtb2RlbF9uYW1lKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKG1vZGVsX25hbWUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForSequenceClassification.from_pretrained(model_name)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(model_name)`,wrap:!1}}),{c(){l=m("p"),l.innerHTML=o,t=p(),h(i.$$.fragment)},l(d){l=u(d,"P",{"data-svelte-h":!0}),y(l)!=="svelte-64igrm"&&(l.innerHTML=o),t=c(d),g(i.$$.fragment,d)},m(d,U){n(d,l,U),n(d,t,U),b(i,d,U),f=!0},p:V,i(d){f||(M(i.$$.fragment,d),f=!0)},o(d){w(i.$$.fragment,d),f=!1},d(d){d&&(s(l),s(t)),v(i,d)}}}function ba(j){let l,o;return l=new X({props:{$$slots:{default:[ga]},$$scope:{ctx:j}}}),{c(){h(l.$$.fragment)},l(t){g(l.$$.fragment,t)},m(t,i){b(l,t,i),o=!0},p(t,i){const f={};i&2&&(f.$$scope={dirty:i,ctx:t}),l.$set(f)},i(t){o||(M(l.$$.fragment,t),o=!0)},o(t){w(l.$$.fragment,t),o=!1},d(t){v(l,t)}}}function Ma(j){let l,o="Usa <code>TFAutoModelForSequenceClassification</code> e <code>AutoTokenizer</code> per caricare il modello pre-allenato e il suo tokenizer associato (maggiori informazioni su una <code>TFAutoClass</code> in seguito):",t,i,f;return i=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEFtb2RlbCUyMCUzRCUyMFRGQXV0b01vZGVsRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQobW9kZWxfbmFtZSklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZChtb2RlbF9uYW1lKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFAutoModelForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFAutoModelForSequenceClassification.from_pretrained(model_name)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(model_name)`,wrap:!1}}),{c(){l=m("p"),l.innerHTML=o,t=p(),h(i.$$.fragment)},l(d){l=u(d,"P",{"data-svelte-h":!0}),y(l)!=="svelte-1ihjf5u"&&(l.innerHTML=o),t=c(d),g(i.$$.fragment,d)},m(d,U){n(d,l,U),n(d,t,U),b(i,d,U),f=!0},p:V,i(d){f||(M(i.$$.fragment,d),f=!0)},o(d){w(i.$$.fragment,d),f=!1},d(d){d&&(s(l),s(t)),v(i,d)}}}function wa(j){let l,o;return l=new X({props:{$$slots:{default:[Ma]},$$scope:{ctx:j}}}),{c(){h(l.$$.fragment)},l(t){g(l.$$.fragment,t)},m(t,i){b(l,t,i),o=!0},p(t,i){const f={};i&2&&(f.$$scope={dirty:i,ctx:t}),l.$set(f)},i(t){o||(M(l.$$.fragment,t),o=!0)},o(t){w(l.$$.fragment,t),o=!1},d(t){v(l,t)}}}function va(j){let l,o;return l=new C({props:{code:"cHRfYmF0Y2glMjAlM0QlMjB0b2tlbml6ZXIoJTBBJTIwJTIwJTIwJTIwJTVCJTIyU2lhbW8lMjBtb2x0byUyMGZlbGljaSUyMGRpJTIwbW9zdHJhcnRpJTIwbGElMjBsaWJyZXJpYSUyMCVGMCU5RiVBNCU5NyUyMFRyYW5zZm9ybWVycy4lMjIlMkMlMjAlMjJTcGVyaWFtbyUyMHRlJTIwbm9uJTIwbGElMjBvZGllcmFpLiUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMHBhZGRpbmclM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwdHJ1bmNhdGlvbiUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjBtYXhfbGVuZ3RoJTNENTEyJTJDJTBBJTIwJTIwJTIwJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUyQyUwQSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>pt_batch = tokenizer(
<span class="hljs-meta">... </span>    [<span class="hljs-string">&quot;Siamo molto felici di mostrarti la libreria 🤗 Transformers.&quot;</span>, <span class="hljs-string">&quot;Speriamo te non la odierai.&quot;</span>],
<span class="hljs-meta">... </span>    padding=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    truncation=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    max_length=<span class="hljs-number">512</span>,
<span class="hljs-meta">... </span>    return_tensors=<span class="hljs-string">&quot;pt&quot;</span>,
<span class="hljs-meta">... </span>)`,wrap:!1}}),{c(){h(l.$$.fragment)},l(t){g(l.$$.fragment,t)},m(t,i){b(l,t,i),o=!0},p:V,i(t){o||(M(l.$$.fragment,t),o=!0)},o(t){w(l.$$.fragment,t),o=!1},d(t){v(l,t)}}}function ya(j){let l,o;return l=new X({props:{$$slots:{default:[va]},$$scope:{ctx:j}}}),{c(){h(l.$$.fragment)},l(t){g(l.$$.fragment,t)},m(t,i){b(l,t,i),o=!0},p(t,i){const f={};i&2&&(f.$$scope={dirty:i,ctx:t}),l.$set(f)},i(t){o||(M(l.$$.fragment,t),o=!0)},o(t){w(l.$$.fragment,t),o=!1},d(t){v(l,t)}}}function ja(j){let l,o;return l=new C({props:{code:"dGZfYmF0Y2glMjAlM0QlMjB0b2tlbml6ZXIoJTBBJTIwJTIwJTIwJTIwJTVCJTIyU2lhbW8lMjBtb2x0byUyMGZlbGljaSUyMGRpJTIwbW9zdHJhcnRpJTIwbGElMjBsaWJyZXJpYSUyMCVGMCU5RiVBNCU5NyUyMFRyYW5zZm9ybWVycy4lMjIlMkMlMjAlMjJTcGVyaWFtbyUyMHRlJTIwbm9uJTIwbGElMjBvZGllcmFpLiUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMHBhZGRpbmclM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwdHJ1bmNhdGlvbiUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjBtYXhfbGVuZ3RoJTNENTEyJTJDJTBBJTIwJTIwJTIwJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiUyQyUwQSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>tf_batch = tokenizer(
<span class="hljs-meta">... </span>    [<span class="hljs-string">&quot;Siamo molto felici di mostrarti la libreria 🤗 Transformers.&quot;</span>, <span class="hljs-string">&quot;Speriamo te non la odierai.&quot;</span>],
<span class="hljs-meta">... </span>    padding=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    truncation=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    max_length=<span class="hljs-number">512</span>,
<span class="hljs-meta">... </span>    return_tensors=<span class="hljs-string">&quot;tf&quot;</span>,
<span class="hljs-meta">... </span>)`,wrap:!1}}),{c(){h(l.$$.fragment)},l(t){g(l.$$.fragment,t)},m(t,i){b(l,t,i),o=!0},p:V,i(t){o||(M(l.$$.fragment,t),o=!0)},o(t){w(l.$$.fragment,t),o=!1},d(t){v(l,t)}}}function Ta(j){let l,o;return l=new X({props:{$$slots:{default:[ja]},$$scope:{ctx:j}}}),{c(){h(l.$$.fragment)},l(t){g(l.$$.fragment,t)},m(t,i){b(l,t,i),o=!0},p(t,i){const f={};i&2&&(f.$$scope={dirty:i,ctx:t}),l.$set(f)},i(t){o||(M(l.$$.fragment,t),o=!0)},o(t){w(l.$$.fragment,t),o=!1},d(t){v(l,t)}}}function _a(j){let l,o='Guarda il <a href="./task_summary">task summary</a> per sapere quale classe di <code>AutoModel</code> utilizzare per quale compito.';return{c(){l=m("p"),l.innerHTML=o},l(t){l=u(t,"P",{"data-svelte-h":!0}),y(l)!=="svelte-11t4fw3"&&(l.innerHTML=o)},m(t,i){n(t,l,i)},p:V,d(t){t&&s(l)}}}function ka(j){let l,o="🤗 Transformers fornisce un metodo semplice e unificato per caricare istanze pre-allenate. Questo significa che puoi caricare un <code>AutoModel</code> come caricheresti un <code>AutoTokenizer</code>. L’unica differenza è selezionare l’<code>AutoModel</code> corretto per il compito di interesse. Dato che stai facendo classificazione di testi, o sequenze, carica <code>AutoModelForSequenceClassification</code>:",t,i,f,d,U,k,R="Ora puoi passare il tuo lotto di input pre-processati direttamente al modello. Devi solo spacchettare il dizionario aggiungendo <code>**</code>:",Z,$,J,G,N="Il modello produrrà le attivazioni finali nell’attributo <code>logits</code>. Applica la funzione softmax a <code>logits</code> per ottenere le probabilità:",H,W,I;return i=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEFtb2RlbF9uYW1lJTIwJTNEJTIwJTIybmxwdG93biUyRmJlcnQtYmFzZS1tdWx0aWxpbmd1YWwtdW5jYXNlZC1zZW50aW1lbnQlMjIlMEFwdF9tb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKG1vZGVsX25hbWUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>model_name = <span class="hljs-string">&quot;nlptown/bert-base-multilingual-uncased-sentiment&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pt_model = AutoModelForSequenceClassification.from_pretrained(model_name)`,wrap:!1}}),d=new Tt({props:{$$slots:{default:[_a]},$$scope:{ctx:j}}}),$=new C({props:{code:"cHRfb3V0cHV0cyUyMCUzRCUyMHB0X21vZGVsKCoqcHRfYmF0Y2gp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>pt_outputs = pt_model(**pt_batch)',wrap:!1}}),W=new C({props:{code:"ZnJvbSUyMHRvcmNoJTIwaW1wb3J0JTIwbm4lMEElMEFwdF9wcmVkaWN0aW9ucyUyMCUzRCUyMG5uLmZ1bmN0aW9uYWwuc29mdG1heChwdF9vdXRwdXRzLmxvZ2l0cyUyQyUyMGRpbSUzRC0xKSUwQXByaW50KHB0X3ByZWRpY3Rpb25zKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> torch <span class="hljs-keyword">import</span> nn

<span class="hljs-meta">&gt;&gt;&gt; </span>pt_predictions = nn.functional.softmax(pt_outputs.logits, dim=-<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(pt_predictions)
tensor([[<span class="hljs-number">0.0041</span>, <span class="hljs-number">0.0037</span>, <span class="hljs-number">0.0203</span>, <span class="hljs-number">0.2005</span>, <span class="hljs-number">0.7713</span>],
        [<span class="hljs-number">0.3766</span>, <span class="hljs-number">0.3292</span>, <span class="hljs-number">0.1832</span>, <span class="hljs-number">0.0558</span>, <span class="hljs-number">0.0552</span>]], grad_fn=&lt;SoftmaxBackward0&gt;)`,wrap:!1}}),{c(){l=m("p"),l.innerHTML=o,t=p(),h(i.$$.fragment),f=p(),h(d.$$.fragment),U=p(),k=m("p"),k.innerHTML=R,Z=p(),h($.$$.fragment),J=p(),G=m("p"),G.innerHTML=N,H=p(),h(W.$$.fragment)},l(r){l=u(r,"P",{"data-svelte-h":!0}),y(l)!=="svelte-1fgrwgv"&&(l.innerHTML=o),t=c(r),g(i.$$.fragment,r),f=c(r),g(d.$$.fragment,r),U=c(r),k=u(r,"P",{"data-svelte-h":!0}),y(k)!=="svelte-17kjm32"&&(k.innerHTML=R),Z=c(r),g($.$$.fragment,r),J=c(r),G=u(r,"P",{"data-svelte-h":!0}),y(G)!=="svelte-1g2h8eb"&&(G.innerHTML=N),H=c(r),g(W.$$.fragment,r)},m(r,T){n(r,l,T),n(r,t,T),b(i,r,T),n(r,f,T),b(d,r,T),n(r,U,T),n(r,k,T),n(r,Z,T),b($,r,T),n(r,J,T),n(r,G,T),n(r,H,T),b(W,r,T),I=!0},p(r,T){const F={};T&2&&(F.$$scope={dirty:T,ctx:r}),d.$set(F)},i(r){I||(M(i.$$.fragment,r),M(d.$$.fragment,r),M($.$$.fragment,r),M(W.$$.fragment,r),I=!0)},o(r){w(i.$$.fragment,r),w(d.$$.fragment,r),w($.$$.fragment,r),w(W.$$.fragment,r),I=!1},d(r){r&&(s(l),s(t),s(f),s(U),s(k),s(Z),s(J),s(G),s(H)),v(i,r),v(d,r),v($,r),v(W,r)}}}function za(j){let l,o;return l=new X({props:{$$slots:{default:[ka]},$$scope:{ctx:j}}}),{c(){h(l.$$.fragment)},l(t){g(l.$$.fragment,t)},m(t,i){b(l,t,i),o=!0},p(t,i){const f={};i&2&&(f.$$scope={dirty:i,ctx:t}),l.$set(f)},i(t){o||(M(l.$$.fragment,t),o=!0)},o(t){w(l.$$.fragment,t),o=!1},d(t){v(l,t)}}}function Ja(j){let l,o='Guarda il <a href="./task_summary">task summary</a> per sapere quale classe di <code>AutoModel</code> utilizzare per quale compito.';return{c(){l=m("p"),l.innerHTML=o},l(t){l=u(t,"P",{"data-svelte-h":!0}),y(l)!=="svelte-11t4fw3"&&(l.innerHTML=o)},m(t,i){n(t,l,i)},p:V,d(t){t&&s(l)}}}function Ca(j){let l,o="🤗 Transformers fornisce un metodo semplice e unificato per caricare istanze pre-allenate. Questo significa che puoi caricare un <code>TFAutoModel</code> come caricheresti un <code>AutoTokenizer</code>. L’unica differenza è selezionare il <code>TFAutoModel</code> corretto per il compito di interesse. Dato che stai facendo classificazione di testi, o sequenze, carica <code>TFAutoModelForSequenceClassification</code>:",t,i,f,d,U,k,R="Ora puoi passare il tuo lotto di input pre-processati direttamente al modello passando le chiavi del dizionario al tensore:",Z,$,J,G,N="Il modello produrrà le attivazioni finali nell’attributo <code>logits</code>. Applica la funzione softmax a <code>logits</code> per ottenere le probabilità:",H,W,I;return i=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbiUwQSUwQW5vbWVfZGVsX21vZGVsbG8lMjAlM0QlMjAlMjJubHB0b3duJTJGYmVydC1iYXNlLW11bHRpbGluZ3VhbC11bmNhc2VkLXNlbnRpbWVudCUyMiUwQXRmX21vZGVsJTIwJTNEJTIwVEZBdXRvTW9kZWxGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZChub21lX2RlbF9tb2RlbGxvKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>nome_del_modello = <span class="hljs-string">&quot;nlptown/bert-base-multilingual-uncased-sentiment&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model = TFAutoModelForSequenceClassification.from_pretrained(nome_del_modello)`,wrap:!1}}),d=new Tt({props:{$$slots:{default:[Ja]},$$scope:{ctx:j}}}),$=new C({props:{code:"dGZfb3V0cHV0cyUyMCUzRCUyMHRmX21vZGVsKHRmX2JhdGNoKQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>tf_outputs = tf_model(tf_batch)',wrap:!1}}),W=new C({props:{code:"aW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEF0Zl9wcmVkaWN0aW9ucyUyMCUzRCUyMHRmLm5uLnNvZnRtYXgodGZfb3V0cHV0cy5sb2dpdHMlMkMlMjBheGlzJTNELTEpJTBBdGZfcHJlZGljdGlvbnM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tf_predictions = tf.nn.softmax(tf_outputs.logits, axis=-<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tf_predictions`,wrap:!1}}),{c(){l=m("p"),l.innerHTML=o,t=p(),h(i.$$.fragment),f=p(),h(d.$$.fragment),U=p(),k=m("p"),k.textContent=R,Z=p(),h($.$$.fragment),J=p(),G=m("p"),G.innerHTML=N,H=p(),h(W.$$.fragment)},l(r){l=u(r,"P",{"data-svelte-h":!0}),y(l)!=="svelte-12ss547"&&(l.innerHTML=o),t=c(r),g(i.$$.fragment,r),f=c(r),g(d.$$.fragment,r),U=c(r),k=u(r,"P",{"data-svelte-h":!0}),y(k)!=="svelte-1pbq5oa"&&(k.textContent=R),Z=c(r),g($.$$.fragment,r),J=c(r),G=u(r,"P",{"data-svelte-h":!0}),y(G)!=="svelte-1g2h8eb"&&(G.innerHTML=N),H=c(r),g(W.$$.fragment,r)},m(r,T){n(r,l,T),n(r,t,T),b(i,r,T),n(r,f,T),b(d,r,T),n(r,U,T),n(r,k,T),n(r,Z,T),b($,r,T),n(r,J,T),n(r,G,T),n(r,H,T),b(W,r,T),I=!0},p(r,T){const F={};T&2&&(F.$$scope={dirty:T,ctx:r}),d.$set(F)},i(r){I||(M(i.$$.fragment,r),M(d.$$.fragment,r),M($.$$.fragment,r),M(W.$$.fragment,r),I=!0)},o(r){w(i.$$.fragment,r),w(d.$$.fragment,r),w($.$$.fragment,r),w(W.$$.fragment,r),I=!1},d(r){r&&(s(l),s(t),s(f),s(U),s(k),s(Z),s(J),s(G),s(H)),v(i,r),v(d,r),v($,r),v(W,r)}}}function Ua(j){let l,o;return l=new X({props:{$$slots:{default:[Ca]},$$scope:{ctx:j}}}),{c(){h(l.$$.fragment)},l(t){g(l.$$.fragment,t)},m(t,i){b(l,t,i),o=!0},p(t,i){const f={};i&2&&(f.$$scope={dirty:i,ctx:t}),l.$set(f)},i(t){o||(M(l.$$.fragment,t),o=!0)},o(t){w(l.$$.fragment,t),o=!1},d(t){v(l,t)}}}function Za(j){let l,o=`Tutti i modelli di 🤗 Transformers (PyTorch e TensorFlow) restituiscono i tensori <em>prima</em> della funzione finale
di attivazione (come la softmax) perché la funzione di attivazione finale viene spesso unita a quella di perdita.`;return{c(){l=m("p"),l.innerHTML=o},l(t){l=u(t,"P",{"data-svelte-h":!0}),y(l)!=="svelte-7wdla3"&&(l.innerHTML=o)},m(t,i){n(t,l,i)},p:V,d(t){t&&s(l)}}}function xa(j){let l,o=`Gli output del modello di 🤗 Transformers sono delle dataclasses speciali in modo che i loro attributi vengano auto-completati all’interno di un IDE.
Gli output del modello si comportano anche come una tupla o un dizionario (ad esempio, puoi indicizzare con un intero, una slice o una stringa) nel qual caso gli attributi che sono <code>None</code> vengono ignorati.`;return{c(){l=m("p"),l.innerHTML=o},l(t){l=u(t,"P",{"data-svelte-h":!0}),y(l)!=="svelte-fglpz9"&&(l.innerHTML=o)},m(t,i){n(t,l,i)},p:V,d(t){t&&s(l)}}}function Ra(j){let l,o="Una volta completato il fine-tuning del tuo modello, puoi salvarlo con il suo tokenizer utilizzando <code>PreTrainedModel.save_pretrained()</code>:",t,i,f,d,U="Quando desideri utilizzare il tuo modello nuovamente, puoi ri-caricarlo con <code>PreTrainedModel.from_pretrained()</code>:",k,R,Z;return i=new C({props:{code:"cHRfc2F2ZV9kaXJlY3RvcnklMjAlM0QlMjAlMjIuJTJGcHRfc2F2ZV9wcmV0cmFpbmVkJTIyJTBBdG9rZW5pemVyLnNhdmVfcHJldHJhaW5lZChwdF9zYXZlX2RpcmVjdG9yeSklMEFwdF9tb2RlbC5zYXZlX3ByZXRyYWluZWQocHRfc2F2ZV9kaXJlY3Rvcnkp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>pt_save_directory = <span class="hljs-string">&quot;./pt_save_pretrained&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.save_pretrained(pt_save_directory)
<span class="hljs-meta">&gt;&gt;&gt; </span>pt_model.save_pretrained(pt_save_directory)`,wrap:!1}}),R=new C({props:{code:"cHRfbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjIuJTJGcHRfc2F2ZV9wcmV0cmFpbmVkJTIyKQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>pt_model = AutoModelForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;./pt_save_pretrained&quot;</span>)',wrap:!1}}),{c(){l=m("p"),l.innerHTML=o,t=p(),h(i.$$.fragment),f=p(),d=m("p"),d.innerHTML=U,k=p(),h(R.$$.fragment)},l($){l=u($,"P",{"data-svelte-h":!0}),y(l)!=="svelte-112corq"&&(l.innerHTML=o),t=c($),g(i.$$.fragment,$),f=c($),d=u($,"P",{"data-svelte-h":!0}),y(d)!=="svelte-fshbgg"&&(d.innerHTML=U),k=c($),g(R.$$.fragment,$)},m($,J){n($,l,J),n($,t,J),b(i,$,J),n($,f,J),n($,d,J),n($,k,J),b(R,$,J),Z=!0},p:V,i($){Z||(M(i.$$.fragment,$),M(R.$$.fragment,$),Z=!0)},o($){w(i.$$.fragment,$),w(R.$$.fragment,$),Z=!1},d($){$&&(s(l),s(t),s(f),s(d),s(k)),v(i,$),v(R,$)}}}function Ga(j){let l,o;return l=new X({props:{$$slots:{default:[Ra]},$$scope:{ctx:j}}}),{c(){h(l.$$.fragment)},l(t){g(l.$$.fragment,t)},m(t,i){b(l,t,i),o=!0},p(t,i){const f={};i&2&&(f.$$scope={dirty:i,ctx:t}),l.$set(f)},i(t){o||(M(l.$$.fragment,t),o=!0)},o(t){w(l.$$.fragment,t),o=!1},d(t){v(l,t)}}}function Wa(j){let l,o="Una volta completato il fine-tuning del tuo modello, puoi salvarlo con il suo tokenizer utilizzando <code>TFPreTrainedModel.save_pretrained()</code>:",t,i,f,d,U="Quando desideri utilizzare il tuo modello nuovamente, puoi ri-caricarlo con <code>TFPreTrainedModel.from_pretrained()</code>:",k,R,Z;return i=new C({props:{code:"dGZfc2F2ZV9kaXJlY3RvcnklMjAlM0QlMjAlMjIuJTJGdGZfc2F2ZV9wcmV0cmFpbmVkJTIyJTBBdG9rZW5pemVyLnNhdmVfcHJldHJhaW5lZCh0Zl9zYXZlX2RpcmVjdG9yeSklMEF0Zl9tb2RlbC5zYXZlX3ByZXRyYWluZWQodGZfc2F2ZV9kaXJlY3Rvcnkp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>tf_save_directory = <span class="hljs-string">&quot;./tf_save_pretrained&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.save_pretrained(tf_save_directory)
<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model.save_pretrained(tf_save_directory)`,wrap:!1}}),R=new C({props:{code:"dGZfbW9kZWwlMjAlM0QlMjBURkF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMi4lMkZ0Zl9zYXZlX3ByZXRyYWluZWQlMjIp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model = TFAutoModelForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;./tf_save_pretrained&quot;</span>)',wrap:!1}}),{c(){l=m("p"),l.innerHTML=o,t=p(),h(i.$$.fragment),f=p(),d=m("p"),d.innerHTML=U,k=p(),h(R.$$.fragment)},l($){l=u($,"P",{"data-svelte-h":!0}),y(l)!=="svelte-5qobr8"&&(l.innerHTML=o),t=c($),g(i.$$.fragment,$),f=c($),d=u($,"P",{"data-svelte-h":!0}),y(d)!=="svelte-15tj3au"&&(d.innerHTML=U),k=c($),g(R.$$.fragment,$)},m($,J){n($,l,J),n($,t,J),b(i,$,J),n($,f,J),n($,d,J),n($,k,J),b(R,$,J),Z=!0},p:V,i($){Z||(M(i.$$.fragment,$),M(R.$$.fragment,$),Z=!0)},o($){w(i.$$.fragment,$),w(R.$$.fragment,$),Z=!1},d($){$&&(s(l),s(t),s(f),s(d),s(k)),v(i,$),v(R,$)}}}function Ha(j){let l,o;return l=new X({props:{$$slots:{default:[Wa]},$$scope:{ctx:j}}}),{c(){h(l.$$.fragment)},l(t){g(l.$$.fragment,t)},m(t,i){b(l,t,i),o=!0},p(t,i){const f={};i&2&&(f.$$scope={dirty:i,ctx:t}),l.$set(f)},i(t){o||(M(l.$$.fragment,t),o=!0)},o(t){w(l.$$.fragment,t),o=!1},d(t){v(l,t)}}}function Va(j){let l,o;return l=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKHRmX3NhdmVfZGlyZWN0b3J5KSUwQXB0X21vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQodGZfc2F2ZV9kaXJlY3RvcnklMkMlMjBmcm9tX3RmJTNEVHJ1ZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(tf_save_directory)
<span class="hljs-meta">&gt;&gt;&gt; </span>pt_model = AutoModelForSequenceClassification.from_pretrained(tf_save_directory, from_tf=<span class="hljs-literal">True</span>)`,wrap:!1}}),{c(){h(l.$$.fragment)},l(t){g(l.$$.fragment,t)},m(t,i){b(l,t,i),o=!0},p:V,i(t){o||(M(l.$$.fragment,t),o=!0)},o(t){w(l.$$.fragment,t),o=!1},d(t){v(l,t)}}}function Fa(j){let l,o;return l=new X({props:{$$slots:{default:[Va]},$$scope:{ctx:j}}}),{c(){h(l.$$.fragment)},l(t){g(l.$$.fragment,t)},m(t,i){b(l,t,i),o=!0},p(t,i){const f={};i&2&&(f.$$scope={dirty:i,ctx:t}),l.$set(f)},i(t){o||(M(l.$$.fragment,t),o=!0)},o(t){w(l.$$.fragment,t),o=!1},d(t){v(l,t)}}}function Ia(j){let l,o;return l=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQocHRfc2F2ZV9kaXJlY3RvcnkpJTBBdGZfbW9kZWwlMjAlM0QlMjBURkF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKHB0X3NhdmVfZGlyZWN0b3J5JTJDJTIwZnJvbV9wdCUzRFRydWUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(pt_save_directory)
<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model = TFAutoModelForSequenceClassification.from_pretrained(pt_save_directory, from_pt=<span class="hljs-literal">True</span>)`,wrap:!1}}),{c(){h(l.$$.fragment)},l(t){g(l.$$.fragment,t)},m(t,i){b(l,t,i),o=!0},p:V,i(t){o||(M(l.$$.fragment,t),o=!0)},o(t){w(l.$$.fragment,t),o=!1},d(t){v(l,t)}}}function Xa(j){let l,o;return l=new X({props:{$$slots:{default:[Ia]},$$scope:{ctx:j}}}),{c(){h(l.$$.fragment)},l(t){g(l.$$.fragment,t)},m(t,i){b(l,t,i),o=!0},p(t,i){const f={};i&2&&(f.$$scope={dirty:i,ctx:t}),l.$set(f)},i(t){o||(M(l.$$.fragment,t),o=!0)},o(t){w(l.$$.fragment,t),o=!1},d(t){v(l,t)}}}function Na(j){let l,o,t,i,f,d,U,k,R,Z,$="Quick tour",J,G,N,H,W='Entra in azione con 🤗 Transformers! Inizia utilizzando <code>pipeline()</code> per un’inferenza veloce, carica un modello pre-allenato e un tokenizer con una <a href="./model_doc/auto">AutoClass</a> per risolvere i tuoi compiti legati a testo, immagini o audio.',I,r,T,F,S,_t,me,es,ht,os="Pipeline",It,ue,rs="<code>pipeline()</code> è il modo più semplice per utilizzare un modello pre-allenato per un dato compito.",Xt,fe,Nt,de,ps="La <code>pipeline()</code> supporta molti compiti comuni:",Lt,$e,cs="<strong>Testo</strong>:",qt,he,ms="<li>Analisi del Sentimento (Sentiment Analysis, in inglese): classifica la polarità di un testo dato.</li> <li>Generazione del Testo (Text Generation, in inglese): genera del testo a partire da un dato input.</li> <li>Riconoscimento di Entità (Name Entity Recognition o NER, in inglese): etichetta ogni parola con l’entità che questa rappresenta (persona, data, luogo, ecc.).</li> <li>Rispondere a Domande (Question answering, in inglese): estrae la risposta da un contesto, dato del contesto e una domanda.</li> <li>Riempimento di Maschere (Fill-mask, in inglese): riempie gli spazi mancanti in un testo che ha parole mascherate.</li> <li>Riassumere (Summarization, in inglese): genera una sintesi di una lunga sequenza di testo o di un documento.</li> <li>Traduzione (Translation, in inglese): traduce un testo in un’altra lingua.</li> <li>Estrazione di Caratteristiche (Feature Extraction, in inglese): crea un tensore che rappresenta un testo.</li>",At,ge,us="<strong>Immagini</strong>:",Bt,be,fs="<li>Classificazione di Immagini (Image Classification, in inglese): classifica un’immagine.</li> <li>Segmentazione di Immagini (Image Segmentation, in inglese): classifica ogni pixel di un’immagine.</li> <li>Rilevazione di Oggetti (Object Detection, in inglese): rileva oggetti all’interno di un’immagine.</li>",Et,Me,ds="<strong>Audio</strong>:",Yt,we,$s="<li>Classificazione di Audio (Audio Classification, in inglese): assegna un’etichetta ad un segmento di audio dato.</li> <li>Riconoscimento Vocale Automatico (Automatic Speech Recognition o ASR, in inglese): trascrive il contenuto di un audio dato in un testo.</li>",St,P,Pt,L,Q,kt,ve,ts,gt,hs="Utilizzo della Pipeline",Qt,ye,gs="Nel seguente esempio, utilizzerai la <code>pipeline()</code> per l’analisi del sentimento.",Dt,je,bs="Installa le seguenti dipendenze se non lo hai già fatto:",Kt,D,Ot,Te,Ms="Importa <code>pipeline()</code> e specifica il compito che vuoi completare:",el,_e,tl,ke,ws='La pipeline scarica e salva il <a href="https://huggingface.co/MilaNLProc/feel-it-italian-sentiment" rel="nofollow">modello pre-allenato</a> e il tokenizer per l’analisi del sentimento. Se non avessimo scelto un modello, la pipeline ne avrebbe scelto uno di default. Ora puoi utilizzare il <code>classifier</code> sul tuo testo obiettivo:',ll,ze,sl,Je,vs="Per più di una frase, passa una lista di frasi alla <code>pipeline()</code> la quale restituirà una lista di dizionari:",al,Ce,nl,Ue,ys='La <code>pipeline()</code> può anche iterare su un dataset intero. Inizia installando la libreria <a href="https://huggingface.co/docs/datasets/" rel="nofollow">🤗 Datasets</a>:',il,Ze,ol,xe,js="Crea una <code>pipeline()</code> con il compito che vuoi risolvere e con il modello che vuoi utilizzare.",rl,Re,pl,Ge,Ts='Poi, carica un dataset (vedi 🤗 Datasets <a href="https://huggingface.co/docs/datasets/quickstart.html" rel="nofollow">Quick Start</a> per maggiori dettagli) sul quale vuoi iterare. Per esempio, carichiamo il dataset <a href="https://huggingface.co/datasets/PolyAI/minds14" rel="nofollow">MInDS-14</a>:',cl,We,ml,He,_s="Dobbiamo assicurarci che la frequenza di campionamento del set di dati corrisponda alla frequenza di campionamento con cui è stato addestrato <code>radiogroup-crits/wav2vec2-xls-r-1b-italian-doc4lm-5gram</code>.",ul,Ve,fl,Fe,ks=`I file audio vengono caricati automaticamente e ri-campionati quando chiamiamo la colonna “audio”.
Estraiamo i vettori delle forme d’onda grezze delle prime 4 osservazioni e passiamoli come lista alla pipeline:`,dl,Ie,$l,Xe,zs='Per un dataset più grande dove gli input sono di dimensione maggiore (come nel parlato/audio o nella visione), dovrai passare un generatore al posto di una lista che carica tutti gli input in memoria. Guarda la <a href="./main_classes/pipelines">documentazione della pipeline</a> per maggiori informazioni.',hl,q,K,zt,Ne,ls,bt,Js="Utilizzare un altro modello e tokenizer nella pipeline",gl,Le,Cs='La <code>pipeline()</code> può ospitare qualsiasi modello del <a href="https://huggingface.co/models" rel="nofollow">Model Hub</a>, rendendo semplice l’adattamento della <code>pipeline()</code> per altri casi d’uso. Per esempio, se si vuole un modello capace di trattare testo in francese, usa i tag presenti nel Model Hub in modo da filtrare per ottenere un modello appropriato. Il miglior risultato filtrato restituisce un modello multi-lingua <a href="https://huggingface.co/nlptown/bert-base-multilingual-uncased-sentiment" rel="nofollow">BERT model</a> fine-tuned per l’analisi del sentimento. Ottimo, utilizziamo questo modello!',bl,qe,Ml,O,wl,Ae,Us="Poi puoi specificare il modello e il tokenizer nella <code>pipeline()</code>, e applicare il <code>classifier</code> sul tuo testo obiettivo:",vl,Be,yl,Ee,Zs='Se non riesci a trovare un modello per il tuo caso d’uso, dovrai fare fine-tuning di un modello pre-allenato sui tuoi dati. Dai un’occhiata al nostro tutorial <a href="./training">fine-tuning tutorial</a> per imparare come. Infine, dopo che hai completato il fine-tuning del tuo modello pre-allenato, considera per favore di condividerlo (vedi il tutorial <a href="./model_sharing">qui</a>) con la comunità sul Model Hub per democratizzare l’NLP! 🤗',jl,A,ee,Jt,Ye,ss,Mt,xs="AutoClass",Tl,Se,_l,Pe,Rs='Al suo interno, le classi <code>AutoModelForSequenceClassification</code> e <code>AutoTokenizer</code> lavorano assieme per dare potere alla <code>pipeline()</code>. Una <a href="./model_doc/auto">AutoClass</a> è una scorciatoia che automaticamente recupera l’architettura di un modello pre-allenato a partire dal suo nome o path. Hai solo bisogno di selezionare la <code>AutoClass</code> appropriata per il tuo compito e il suo tokenizer associato con <code>AutoTokenizer</code>.',kl,Qe,Gs="Ritorniamo al nostro esempio e vediamo come puoi utilizzare la <code>AutoClass</code> per replicare i risultati della <code>pipeline()</code>.",zl,B,te,Ct,De,as,wt,Ws="AutoTokenizer",Jl,Ke,Hs='Un tokenizer è responsabile dell’elaborazione del testo in modo da trasformarlo in un formato comprensibile dal modello. Per prima cosa, il tokenizer dividerà il testo in parole chiamate <em>token</em>. Ci sono diverse regole che governano il processo di tokenizzazione, tra cui come dividere una parola e a quale livello (impara di più sulla tokenizzazione <a href="./tokenizer_summary">qui</a>). La cosa più importante da ricordare comunque è che hai bisogno di inizializzare il tokenizer con lo stesso nome del modello in modo da assicurarti che stai utilizzando le stesse regole di tokenizzazione con cui il modello è stato pre-allenato.',Cl,Oe,Vs="Carica un tokenizer con <code>AutoTokenizer</code>:",Ul,et,Zl,tt,Fs="Dopodiché, il tokenizer converte i token in numeri in modo da costruire un tensore come input del modello. Questo è conosciuto come il <em>vocabolario</em> del modello.",xl,lt,Is="Passa il tuo testo al tokenizer:",Rl,st,Gl,at,Xs="Il tokenizer restituirà un dizionario contenente:",Wl,nt,Ns='<li><a href="./glossary#input-ids">input_ids</a>: rappresentazioni numeriche dei tuoi token.</li> <li><a href=".glossary#attention-mask">attention_mask</a>: indica quali token devono essere presi in considerazione.</li>',Hl,it,Ls="Come con la <code>pipeline()</code>, il tokenizer accetterà una lista di input. In più, il tokenizer può anche completare (pad, in inglese) e troncare il testo in modo da restituire un lotto (batch, in inglese) di lunghezza uniforme:",Vl,le,Fl,ot,qs='Leggi il tutorial sul <a href="./preprocessing">preprocessing</a> per maggiori dettagli sulla tokenizzazione.',Il,E,se,Ut,rt,ns,vt,As="AutoModel",Xl,ae,Nl,ne,Ll,pt,Bs='I modelli sono <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow"><code>torch.nn.Module</code></a> o <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow"><code>tf.keras.Model</code></a> standard così puoi utilizzarli all’interno del tuo training loop usuale. Tuttavia, per rendere le cose più semplici, 🤗 Transformers fornisce una classe <code>Trainer</code> per PyTorch che aggiunge delle funzionalità per l’allenamento distribuito, precisione mista, e altro ancora. Per TensorFlow, puoi utilizzare il metodo <code>fit</code> di <a href="https://keras.io/" rel="nofollow">Keras</a>. Fai riferimento al <a href="./training">tutorial per il training</a> per maggiori dettagli.',ql,ie,Al,Y,oe,Zt,ct,is,yt,Es="Salva un modello",Bl,re,El,mt,Ys="Una caratteristica particolarmente interessante di 🤗 Transformers è la sua abilità di salvare un modello e ri-caricarlo sia come modello di PyTorch che di TensorFlow. I parametri <code>from_pt</code> o <code>from_tf</code> possono convertire un modello da un framework all’altro:",Yl,pe,Sl,xt,Pl;return k=new ce({}),G=new ca({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/it/quicktour.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/it/pytorch/quicktour.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/it/tensorflow/quicktour.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/it/quicktour.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/it/pytorch/quicktour.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/it/tensorflow/quicktour.ipynb"}]}}),r=new Tt({props:{$$slots:{default:[ma]},$$scope:{ctx:j}}}),me=new ce({}),fe=new aa({props:{id:"tiZFewofSLM"}}),P=new Tt({props:{$$slots:{default:[ua]},$$scope:{ctx:j}}}),ve=new ce({}),D=new jt({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ha],pytorch:[da]},$$scope:{ctx:j}}}),_e=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBY2xhc3NpZmljYXRvcmUlMjAlM0QlMjBwaXBlbGluZSglMjJzZW50aW1lbnQtYW5hbHlzaXMlMjIlMkMlMjBtb2RlbCUzRCUyMk1pbGFOTFByb2MlMkZmZWVsLWl0LWl0YWxpYW4tc2VudGltZW50JTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>classificatore = pipeline(<span class="hljs-string">&quot;sentiment-analysis&quot;</span>, model=<span class="hljs-string">&quot;MilaNLProc/feel-it-italian-sentiment&quot;</span>)`,wrap:!1}}),ze=new C({props:{code:"Y2xhc3NpZmljYXRvcmUoJTIyU2lhbW8lMjBtb2x0byUyMGZlbGljaSUyMGRpJTIwbW9zdHJhcnRpJTIwbGElMjBsaWJyZXJpYSUyMCVGMCU5RiVBNCU5NyUyMFRyYW5zZm9ybWVycy4lMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>classificatore(<span class="hljs-string">&quot;Siamo molto felici di mostrarti la libreria 🤗 Transformers.&quot;</span>)
[{<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;positive&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9997</span>}]`,wrap:!1}}),Ce=new C({props:{code:"cmlzdWx0YXRpJTIwJTNEJTIwY2xhc3NpZmljYXRvcmUoJTBBJTIwJTIwJTIwJTIwJTVCJTIyU2lhbW8lMjBtb2x0byUyMGZlbGljaSUyMGRpJTIwbW9zdHJhcnRpJTIwbGElMjBsaWJyZXJpYSUyMCVGMCU5RiVBNCU5NyUyMFRyYW5zZm9ybWVycy4lMjIlMkMlMjAlMjJTcGVyaWFtbyUyMHRlJTIwbm9uJTIwbGElMjBvZGllcmFpLiUyMiU1RCUwQSklMEFmb3IlMjByaXN1bHRhdG8lMjBpbiUyMHJpc3VsdGF0aSUzQSUwQSUyMCUyMCUyMCUyMHByaW50KGYlMjJldGljaGV0dGElM0ElMjAlN0JyaXN1bHRhdG8lNUInbGFiZWwnJTVEJTdEJTJDJTIwY29uJTIwcHVudGVnZ2lvJTNBJTIwJTdCcm91bmQocmlzdWx0YXRvJTVCJ3Njb3JlJyU1RCUyQyUyMDQpJTdEJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>risultati = classificatore(
<span class="hljs-meta">... </span>    [<span class="hljs-string">&quot;Siamo molto felici di mostrarti la libreria 🤗 Transformers.&quot;</span>, <span class="hljs-string">&quot;Speriamo te non la odierai.&quot;</span>]
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> risultato <span class="hljs-keyword">in</span> risultati:
<span class="hljs-meta">... </span>    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;etichetta: <span class="hljs-subst">{risultato[<span class="hljs-string">&#x27;label&#x27;</span>]}</span>, con punteggio: <span class="hljs-subst">{<span class="hljs-built_in">round</span>(risultato[<span class="hljs-string">&#x27;score&#x27;</span>], <span class="hljs-number">4</span>)}</span>&quot;</span>)
etichetta: positive, con punteggio: <span class="hljs-number">0.9998</span>
etichetta: negative, con punteggio: <span class="hljs-number">0.9998</span>`,wrap:!1}}),Ze=new C({props:{code:"cGlwJTIwaW5zdGFsbCUyMGRhdGFzZXRzJTIw",highlighted:"pip install datasets ",wrap:!1}}),Re=new C({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwcGlwZWxpbmUlMEElMEFyaWNvbm9zY2l0b3JlX3ZvY2FsZSUyMCUzRCUyMHBpcGVsaW5lKCUwQSUyMCUyMCUyMCUyMCUyMmF1dG9tYXRpYy1zcGVlY2gtcmVjb2duaXRpb24lMjIlMkMlMjBtb2RlbCUzRCUyMnJhZGlvZ3JvdXAtY3JpdHMlMkZ3YXYydmVjMi14bHMtci0xYi1pdGFsaWFuLWRvYzRsbS01Z3JhbSUyMiUwQSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

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

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;PolyAI/minds14&quot;</span>, name=<span class="hljs-string">&quot;it-IT&quot;</span>, split=<span class="hljs-string">&quot;train&quot;</span>)`,wrap:!1}}),Ve=new C({props:{code:"ZGF0YXNldCUyMCUzRCUyMGRhdGFzZXQuY2FzdF9jb2x1bW4oJTIyYXVkaW8lMjIlMkMlMjBBdWRpbyhzYW1wbGluZ19yYXRlJTNEcmljb25vc2NpdG9yZV92b2NhbGUuZmVhdHVyZV9leHRyYWN0b3Iuc2FtcGxpbmdfcmF0ZSkp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.cast_column(<span class="hljs-string">&quot;audio&quot;</span>, Audio(sampling_rate=riconoscitore_vocale.feature_extractor.sampling_rate))',wrap:!1}}),Ie=new C({props:{code:"cmlzdWx0YXRvJTIwJTNEJTIwcmljb25vc2NpdG9yZV92b2NhbGUoZGF0YXNldCU1QiUzQTQlNUQlNUIlMjJhdWRpbyUyMiU1RCklMEFwcmludCglNUJkJTVCJTIydGV4dCUyMiU1RCUyMGZvciUyMGQlMjBpbiUyMHJpc3VsdGF0byU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>risultato = riconoscitore_vocale(dataset[:<span class="hljs-number">4</span>][<span class="hljs-string">&quot;audio&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>([d[<span class="hljs-string">&quot;text&quot;</span>] <span class="hljs-keyword">for</span> d <span class="hljs-keyword">in</span> risultato])
[<span class="hljs-string">&#x27;dovrei caricare dei soldi sul mio conto corrente&#x27;</span>, <span class="hljs-string">&#x27;buongiorno e senza vorrei depositare denaro sul mio conto corrente come devo fare per cortesia&#x27;</span>, <span class="hljs-string">&#x27;sì salve vorrei depositare del denaro sul mio conto&#x27;</span>, <span class="hljs-string">&#x27;e buon pomeriggio vorrei depositare dei soldi sul mio conto bancario volleo sapere come posso fare se e posso farlo online ed un altro conto o andandoo tramite bancomut&#x27;</span>]`,wrap:!1}}),Ne=new ce({}),qe=new C({props:{code:"bW9kZWxfbmFtZSUyMCUzRCUyMCUyMm5scHRvd24lMkZiZXJ0LWJhc2UtbXVsdGlsaW5ndWFsLXVuY2FzZWQtc2VudGltZW50JTIy",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model_name = <span class="hljs-string">&quot;nlptown/bert-base-multilingual-uncased-sentiment&quot;</span>',wrap:!1}}),O=new jt({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[wa],pytorch:[ba]},$$scope:{ctx:j}}}),Be=new C({props:{code:"Y2xhc3NpZmllciUyMCUzRCUyMHBpcGVsaW5lKCUyMnNlbnRpbWVudC1hbmFseXNpcyUyMiUyQyUyMG1vZGVsJTNEbW9kZWwlMkMlMjB0b2tlbml6ZXIlM0R0b2tlbml6ZXIpJTBBY2xhc3NpZmllciglMjJOb3VzJTIwc29tbWVzJTIwdHIlQzMlQThzJTIwaGV1cmV1eCUyMGRlJTIwdm91cyUyMHByJUMzJUE5c2VudGVyJTIwbGElMjBiaWJsaW90aCVDMyVBOHF1ZSUyMCVGMCU5RiVBNCU5NyUyMFRyYW5zZm9ybWVycy4lMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>classifier = pipeline(<span class="hljs-string">&quot;sentiment-analysis&quot;</span>, model=model, tokenizer=tokenizer)
<span class="hljs-meta">&gt;&gt;&gt; </span>classifier(<span class="hljs-string">&quot;Nous sommes très heureux de vous présenter la bibliothèque 🤗 Transformers.&quot;</span>)
[{<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;5 stars&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.7273</span>}]`,wrap:!1}}),Ye=new ce({}),Se=new aa({props:{id:"AhChOFRegn4"}}),De=new ce({}),et=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEFub21lX2RlbF9tb2RlbGxvJTIwJTNEJTIwJTIybmxwdG93biUyRmJlcnQtYmFzZS1tdWx0aWxpbmd1YWwtdW5jYXNlZC1zZW50aW1lbnQlMjIlMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZChub21lX2RlbF9tb2RlbGxvKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>nome_del_modello = <span class="hljs-string">&quot;nlptown/bert-base-multilingual-uncased-sentiment&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(nome_del_modello)`,wrap:!1}}),st=new C({props:{code:"ZW5jb2RpbmclMjAlM0QlMjB0b2tlbml6ZXIoJTIyU2lhbW8lMjBtb2x0byUyMGZlbGljaSUyMGRpJTIwbW9zdHJhcnRpJTIwbGElMjBsaWJyZXJpYSUyMCVGMCU5RiVBNCU5NyUyMFRyYW5zZm9ybWVycy4lMjIpJTBBcHJpbnQoZW5jb2Rpbmcp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(<span class="hljs-string">&quot;Siamo molto felici di mostrarti la libreria 🤗 Transformers.&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(encoding)
{<span class="hljs-string">&#x27;input_ids&#x27;</span>: [<span class="hljs-number">101</span>, <span class="hljs-number">56821</span>, <span class="hljs-number">10132</span>, <span class="hljs-number">14407</span>, <span class="hljs-number">13019</span>, <span class="hljs-number">13007</span>, <span class="hljs-number">10120</span>, <span class="hljs-number">47201</span>, <span class="hljs-number">10330</span>, <span class="hljs-number">10106</span>, <span class="hljs-number">91686</span>, <span class="hljs-number">100</span>, <span class="hljs-number">58263</span>, <span class="hljs-number">119</span>, <span class="hljs-number">102</span>],
<span class="hljs-string">&#x27;token_type_ids&#x27;</span>: [<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>],
<span class="hljs-string">&#x27;attention_mask&#x27;</span>: [<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>]}`,wrap:!1}}),le=new jt({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Ta],pytorch:[ya]},$$scope:{ctx:j}}}),rt=new ce({}),ae=new jt({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Ua],pytorch:[za]},$$scope:{ctx:j}}}),ne=new Tt({props:{$$slots:{default:[Za]},$$scope:{ctx:j}}}),ie=new Tt({props:{$$slots:{default:[xa]},$$scope:{ctx:j}}}),ct=new ce({}),re=new jt({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Ha],pytorch:[Ga]},$$scope:{ctx:j}}}),pe=new jt({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Xa],pytorch:[Fa]},$$scope:{ctx:j}}}),{c(){l=m("meta"),o=p(),t=m("p"),i=p(),f=m("h1"),d=m("a"),U=m("span"),h(k.$$.fragment),R=p(),Z=m("span"),Z.textContent=$,J=p(),h(G.$$.fragment),N=p(),H=m("p"),H.innerHTML=W,I=p(),h(r.$$.fragment),T=p(),F=m("h2"),S=m("a"),_t=m("span"),h(me.$$.fragment),es=p(),ht=m("span"),ht.textContent=os,It=p(),ue=m("p"),ue.innerHTML=rs,Xt=p(),h(fe.$$.fragment),Nt=p(),de=m("p"),de.innerHTML=ps,Lt=p(),$e=m("p"),$e.innerHTML=cs,qt=p(),he=m("ul"),he.innerHTML=ms,At=p(),ge=m("p"),ge.innerHTML=us,Bt=p(),be=m("ul"),be.innerHTML=fs,Et=p(),Me=m("p"),Me.innerHTML=ds,Yt=p(),we=m("ul"),we.innerHTML=$s,St=p(),h(P.$$.fragment),Pt=p(),L=m("h3"),Q=m("a"),kt=m("span"),h(ve.$$.fragment),ts=p(),gt=m("span"),gt.textContent=hs,Qt=p(),ye=m("p"),ye.innerHTML=gs,Dt=p(),je=m("p"),je.textContent=bs,Kt=p(),h(D.$$.fragment),Ot=p(),Te=m("p"),Te.innerHTML=Ms,el=p(),h(_e.$$.fragment),tl=p(),ke=m("p"),ke.innerHTML=ws,ll=p(),h(ze.$$.fragment),sl=p(),Je=m("p"),Je.innerHTML=vs,al=p(),h(Ce.$$.fragment),nl=p(),Ue=m("p"),Ue.innerHTML=ys,il=p(),h(Ze.$$.fragment),ol=p(),xe=m("p"),xe.innerHTML=js,rl=p(),h(Re.$$.fragment),pl=p(),Ge=m("p"),Ge.innerHTML=Ts,cl=p(),h(We.$$.fragment),ml=p(),He=m("p"),He.innerHTML=_s,ul=p(),h(Ve.$$.fragment),fl=p(),Fe=m("p"),Fe.textContent=ks,dl=p(),h(Ie.$$.fragment),$l=p(),Xe=m("p"),Xe.innerHTML=zs,hl=p(),q=m("h3"),K=m("a"),zt=m("span"),h(Ne.$$.fragment),ls=p(),bt=m("span"),bt.textContent=Js,gl=p(),Le=m("p"),Le.innerHTML=Cs,bl=p(),h(qe.$$.fragment),Ml=p(),h(O.$$.fragment),wl=p(),Ae=m("p"),Ae.innerHTML=Us,vl=p(),h(Be.$$.fragment),yl=p(),Ee=m("p"),Ee.innerHTML=Zs,jl=p(),A=m("h2"),ee=m("a"),Jt=m("span"),h(Ye.$$.fragment),ss=p(),Mt=m("span"),Mt.textContent=xs,Tl=p(),h(Se.$$.fragment),_l=p(),Pe=m("p"),Pe.innerHTML=Rs,kl=p(),Qe=m("p"),Qe.innerHTML=Gs,zl=p(),B=m("h3"),te=m("a"),Ct=m("span"),h(De.$$.fragment),as=p(),wt=m("span"),wt.textContent=Ws,Jl=p(),Ke=m("p"),Ke.innerHTML=Hs,Cl=p(),Oe=m("p"),Oe.innerHTML=Vs,Ul=p(),h(et.$$.fragment),Zl=p(),tt=m("p"),tt.innerHTML=Fs,xl=p(),lt=m("p"),lt.textContent=Is,Rl=p(),h(st.$$.fragment),Gl=p(),at=m("p"),at.textContent=Xs,Wl=p(),nt=m("ul"),nt.innerHTML=Ns,Hl=p(),it=m("p"),it.innerHTML=Ls,Vl=p(),h(le.$$.fragment),Fl=p(),ot=m("p"),ot.innerHTML=qs,Il=p(),E=m("h3"),se=m("a"),Ut=m("span"),h(rt.$$.fragment),ns=p(),vt=m("span"),vt.textContent=As,Xl=p(),h(ae.$$.fragment),Nl=p(),h(ne.$$.fragment),Ll=p(),pt=m("p"),pt.innerHTML=Bs,ql=p(),h(ie.$$.fragment),Al=p(),Y=m("h3"),oe=m("a"),Zt=m("span"),h(ct.$$.fragment),is=p(),yt=m("span"),yt.textContent=Es,Bl=p(),h(re.$$.fragment),El=p(),mt=m("p"),mt.innerHTML=Ys,Yl=p(),h(pe.$$.fragment),Sl=p(),xt=m("p"),this.h()},l(e){const a=pa("svelte-1phssyn",document.head);l=u(a,"META",{name:!0,content:!0}),a.forEach(s),o=c(e),t=u(e,"P",{}),x(t).forEach(s),i=c(e),f=u(e,"H1",{class:!0});var ut=x(f);d=u(ut,"A",{id:!0,class:!0,href:!0});var Rt=x(d);U=u(Rt,"SPAN",{});var Gt=x(U);g(k.$$.fragment,Gt),Gt.forEach(s),Rt.forEach(s),R=c(ut),Z=u(ut,"SPAN",{"data-svelte-h":!0}),y(Z)!=="svelte-btee2s"&&(Z.textContent=$),ut.forEach(s),J=c(e),g(G.$$.fragment,e),N=c(e),H=u(e,"P",{"data-svelte-h":!0}),y(H)!=="svelte-1elpc0g"&&(H.innerHTML=W),I=c(e),g(r.$$.fragment,e),T=c(e),F=u(e,"H2",{class:!0});var ft=x(F);S=u(ft,"A",{id:!0,class:!0,href:!0});var Wt=x(S);_t=u(Wt,"SPAN",{});var Ht=x(_t);g(me.$$.fragment,Ht),Ht.forEach(s),Wt.forEach(s),es=c(ft),ht=u(ft,"SPAN",{"data-svelte-h":!0}),y(ht)!=="svelte-1hivr8r"&&(ht.textContent=os),ft.forEach(s),It=c(e),ue=u(e,"P",{"data-svelte-h":!0}),y(ue)!=="svelte-1ytt2no"&&(ue.innerHTML=rs),Xt=c(e),g(fe.$$.fragment,e),Nt=c(e),de=u(e,"P",{"data-svelte-h":!0}),y(de)!=="svelte-mdjmm2"&&(de.innerHTML=ps),Lt=c(e),$e=u(e,"P",{"data-svelte-h":!0}),y($e)!=="svelte-worh5i"&&($e.innerHTML=cs),qt=c(e),he=u(e,"UL",{"data-svelte-h":!0}),y(he)!=="svelte-1e7qzwz"&&(he.innerHTML=ms),At=c(e),ge=u(e,"P",{"data-svelte-h":!0}),y(ge)!=="svelte-1p3xnk0"&&(ge.innerHTML=us),Bt=c(e),be=u(e,"UL",{"data-svelte-h":!0}),y(be)!=="svelte-1r93uab"&&(be.innerHTML=fs),Et=c(e),Me=u(e,"P",{"data-svelte-h":!0}),y(Me)!=="svelte-hdckv1"&&(Me.innerHTML=ds),Yt=c(e),we=u(e,"UL",{"data-svelte-h":!0}),y(we)!=="svelte-o2s2lz"&&(we.innerHTML=$s),St=c(e),g(P.$$.fragment,e),Pt=c(e),L=u(e,"H3",{class:!0});var dt=x(L);Q=u(dt,"A",{id:!0,class:!0,href:!0});var Vt=x(Q);kt=u(Vt,"SPAN",{});var Ft=x(kt);g(ve.$$.fragment,Ft),Ft.forEach(s),Vt.forEach(s),ts=c(dt),gt=u(dt,"SPAN",{"data-svelte-h":!0}),y(gt)!=="svelte-j8gtwj"&&(gt.textContent=hs),dt.forEach(s),Qt=c(e),ye=u(e,"P",{"data-svelte-h":!0}),y(ye)!=="svelte-1yvy2ke"&&(ye.innerHTML=gs),Dt=c(e),je=u(e,"P",{"data-svelte-h":!0}),y(je)!=="svelte-jq5tv3"&&(je.textContent=bs),Kt=c(e),g(D.$$.fragment,e),Ot=c(e),Te=u(e,"P",{"data-svelte-h":!0}),y(Te)!=="svelte-1ck58lr"&&(Te.innerHTML=Ms),el=c(e),g(_e.$$.fragment,e),tl=c(e),ke=u(e,"P",{"data-svelte-h":!0}),y(ke)!=="svelte-mfkosw"&&(ke.innerHTML=ws),ll=c(e),g(ze.$$.fragment,e),sl=c(e),Je=u(e,"P",{"data-svelte-h":!0}),y(Je)!=="svelte-21vcsp"&&(Je.innerHTML=vs),al=c(e),g(Ce.$$.fragment,e),nl=c(e),Ue=u(e,"P",{"data-svelte-h":!0}),y(Ue)!=="svelte-ms5dby"&&(Ue.innerHTML=ys),il=c(e),g(Ze.$$.fragment,e),ol=c(e),xe=u(e,"P",{"data-svelte-h":!0}),y(xe)!=="svelte-wg1lhp"&&(xe.innerHTML=js),rl=c(e),g(Re.$$.fragment,e),pl=c(e),Ge=u(e,"P",{"data-svelte-h":!0}),y(Ge)!=="svelte-1legdsp"&&(Ge.innerHTML=Ts),cl=c(e),g(We.$$.fragment,e),ml=c(e),He=u(e,"P",{"data-svelte-h":!0}),y(He)!=="svelte-11fvfrb"&&(He.innerHTML=_s),ul=c(e),g(Ve.$$.fragment,e),fl=c(e),Fe=u(e,"P",{"data-svelte-h":!0}),y(Fe)!=="svelte-aq6297"&&(Fe.textContent=ks),dl=c(e),g(Ie.$$.fragment,e),$l=c(e),Xe=u(e,"P",{"data-svelte-h":!0}),y(Xe)!=="svelte-4qw8v7"&&(Xe.innerHTML=zs),hl=c(e),q=u(e,"H3",{class:!0});var $t=x(q);K=u($t,"A",{id:!0,class:!0,href:!0});var Ss=x(K);zt=u(Ss,"SPAN",{});var Ps=x(zt);g(Ne.$$.fragment,Ps),Ps.forEach(s),Ss.forEach(s),ls=c($t),bt=u($t,"SPAN",{"data-svelte-h":!0}),y(bt)!=="svelte-1x6fzz"&&(bt.textContent=Js),$t.forEach(s),gl=c(e),Le=u(e,"P",{"data-svelte-h":!0}),y(Le)!=="svelte-1f97bcn"&&(Le.innerHTML=Cs),bl=c(e),g(qe.$$.fragment,e),Ml=c(e),g(O.$$.fragment,e),wl=c(e),Ae=u(e,"P",{"data-svelte-h":!0}),y(Ae)!=="svelte-gseo06"&&(Ae.innerHTML=Us),vl=c(e),g(Be.$$.fragment,e),yl=c(e),Ee=u(e,"P",{"data-svelte-h":!0}),y(Ee)!=="svelte-slx3it"&&(Ee.innerHTML=Zs),jl=c(e),A=u(e,"H2",{class:!0});var Ql=x(A);ee=u(Ql,"A",{id:!0,class:!0,href:!0});var Qs=x(ee);Jt=u(Qs,"SPAN",{});var Ds=x(Jt);g(Ye.$$.fragment,Ds),Ds.forEach(s),Qs.forEach(s),ss=c(Ql),Mt=u(Ql,"SPAN",{"data-svelte-h":!0}),y(Mt)!=="svelte-l9z4zy"&&(Mt.textContent=xs),Ql.forEach(s),Tl=c(e),g(Se.$$.fragment,e),_l=c(e),Pe=u(e,"P",{"data-svelte-h":!0}),y(Pe)!=="svelte-x634fr"&&(Pe.innerHTML=Rs),kl=c(e),Qe=u(e,"P",{"data-svelte-h":!0}),y(Qe)!=="svelte-gs7f79"&&(Qe.innerHTML=Gs),zl=c(e),B=u(e,"H3",{class:!0});var Dl=x(B);te=u(Dl,"A",{id:!0,class:!0,href:!0});var Ks=x(te);Ct=u(Ks,"SPAN",{});var Os=x(Ct);g(De.$$.fragment,Os),Os.forEach(s),Ks.forEach(s),as=c(Dl),wt=u(Dl,"SPAN",{"data-svelte-h":!0}),y(wt)!=="svelte-5wpjmf"&&(wt.textContent=Ws),Dl.forEach(s),Jl=c(e),Ke=u(e,"P",{"data-svelte-h":!0}),y(Ke)!=="svelte-1bqnhye"&&(Ke.innerHTML=Hs),Cl=c(e),Oe=u(e,"P",{"data-svelte-h":!0}),y(Oe)!=="svelte-182cse"&&(Oe.innerHTML=Vs),Ul=c(e),g(et.$$.fragment,e),Zl=c(e),tt=u(e,"P",{"data-svelte-h":!0}),y(tt)!=="svelte-moayds"&&(tt.innerHTML=Fs),xl=c(e),lt=u(e,"P",{"data-svelte-h":!0}),y(lt)!=="svelte-zrjuqi"&&(lt.textContent=Is),Rl=c(e),g(st.$$.fragment,e),Gl=c(e),at=u(e,"P",{"data-svelte-h":!0}),y(at)!=="svelte-mgopot"&&(at.textContent=Xs),Wl=c(e),nt=u(e,"UL",{"data-svelte-h":!0}),y(nt)!=="svelte-5gvcz"&&(nt.innerHTML=Ns),Hl=c(e),it=u(e,"P",{"data-svelte-h":!0}),y(it)!=="svelte-1gzve8v"&&(it.innerHTML=Ls),Vl=c(e),g(le.$$.fragment,e),Fl=c(e),ot=u(e,"P",{"data-svelte-h":!0}),y(ot)!=="svelte-1a2gmgw"&&(ot.innerHTML=qs),Il=c(e),E=u(e,"H3",{class:!0});var Kl=x(E);se=u(Kl,"A",{id:!0,class:!0,href:!0});var ea=x(se);Ut=u(ea,"SPAN",{});var ta=x(Ut);g(rt.$$.fragment,ta),ta.forEach(s),ea.forEach(s),ns=c(Kl),vt=u(Kl,"SPAN",{"data-svelte-h":!0}),y(vt)!=="svelte-12n7lj"&&(vt.textContent=As),Kl.forEach(s),Xl=c(e),g(ae.$$.fragment,e),Nl=c(e),g(ne.$$.fragment,e),Ll=c(e),pt=u(e,"P",{"data-svelte-h":!0}),y(pt)!=="svelte-lxcxy3"&&(pt.innerHTML=Bs),ql=c(e),g(ie.$$.fragment,e),Al=c(e),Y=u(e,"H3",{class:!0});var Ol=x(Y);oe=u(Ol,"A",{id:!0,class:!0,href:!0});var la=x(oe);Zt=u(la,"SPAN",{});var sa=x(Zt);g(ct.$$.fragment,sa),sa.forEach(s),la.forEach(s),is=c(Ol),yt=u(Ol,"SPAN",{"data-svelte-h":!0}),y(yt)!=="svelte-utynb5"&&(yt.textContent=Es),Ol.forEach(s),Bl=c(e),g(re.$$.fragment,e),El=c(e),mt=u(e,"P",{"data-svelte-h":!0}),y(mt)!=="svelte-1ld3j5t"&&(mt.innerHTML=Ys),Yl=c(e),g(pe.$$.fragment,e),Sl=c(e),xt=u(e,"P",{}),x(xt).forEach(s),this.h()},h(){_(l,"name","hf:doc:metadata"),_(l,"content",JSON.stringify(La)),_(d,"id","quick-tour"),_(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"),_(d,"href","#quick-tour"),_(f,"class","relative group"),_(S,"id","pipeline"),_(S,"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"),_(S,"href","#pipeline"),_(F,"class","relative group"),_(Q,"id","utilizzo-della-pipeline"),_(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"),_(Q,"href","#utilizzo-della-pipeline"),_(L,"class","relative group"),_(K,"id","utilizzare-un-altro-modello-e-tokenizer-nella-pipeline"),_(K,"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"),_(K,"href","#utilizzare-un-altro-modello-e-tokenizer-nella-pipeline"),_(q,"class","relative group"),_(ee,"id","autoclass"),_(ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),_(ee,"href","#autoclass"),_(A,"class","relative group"),_(te,"id","autotokenizer"),_(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"),_(te,"href","#autotokenizer"),_(B,"class","relative group"),_(se,"id","automodel"),_(se,"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"),_(se,"href","#automodel"),_(E,"class","relative group"),_(oe,"id","salva-un-modello"),_(oe,"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"),_(oe,"href","#salva-un-modello"),_(Y,"class","relative group")},m(e,a){z(document.head,l),n(e,o,a),n(e,t,a),n(e,i,a),n(e,f,a),z(f,d),z(d,U),b(k,U,null),z(f,R),z(f,Z),n(e,J,a),b(G,e,a),n(e,N,a),n(e,H,a),n(e,I,a),b(r,e,a),n(e,T,a),n(e,F,a),z(F,S),z(S,_t),b(me,_t,null),z(F,es),z(F,ht),n(e,It,a),n(e,ue,a),n(e,Xt,a),b(fe,e,a),n(e,Nt,a),n(e,de,a),n(e,Lt,a),n(e,$e,a),n(e,qt,a),n(e,he,a),n(e,At,a),n(e,ge,a),n(e,Bt,a),n(e,be,a),n(e,Et,a),n(e,Me,a),n(e,Yt,a),n(e,we,a),n(e,St,a),b(P,e,a),n(e,Pt,a),n(e,L,a),z(L,Q),z(Q,kt),b(ve,kt,null),z(L,ts),z(L,gt),n(e,Qt,a),n(e,ye,a),n(e,Dt,a),n(e,je,a),n(e,Kt,a),b(D,e,a),n(e,Ot,a),n(e,Te,a),n(e,el,a),b(_e,e,a),n(e,tl,a),n(e,ke,a),n(e,ll,a),b(ze,e,a),n(e,sl,a),n(e,Je,a),n(e,al,a),b(Ce,e,a),n(e,nl,a),n(e,Ue,a),n(e,il,a),b(Ze,e,a),n(e,ol,a),n(e,xe,a),n(e,rl,a),b(Re,e,a),n(e,pl,a),n(e,Ge,a),n(e,cl,a),b(We,e,a),n(e,ml,a),n(e,He,a),n(e,ul,a),b(Ve,e,a),n(e,fl,a),n(e,Fe,a),n(e,dl,a),b(Ie,e,a),n(e,$l,a),n(e,Xe,a),n(e,hl,a),n(e,q,a),z(q,K),z(K,zt),b(Ne,zt,null),z(q,ls),z(q,bt),n(e,gl,a),n(e,Le,a),n(e,bl,a),b(qe,e,a),n(e,Ml,a),b(O,e,a),n(e,wl,a),n(e,Ae,a),n(e,vl,a),b(Be,e,a),n(e,yl,a),n(e,Ee,a),n(e,jl,a),n(e,A,a),z(A,ee),z(ee,Jt),b(Ye,Jt,null),z(A,ss),z(A,Mt),n(e,Tl,a),b(Se,e,a),n(e,_l,a),n(e,Pe,a),n(e,kl,a),n(e,Qe,a),n(e,zl,a),n(e,B,a),z(B,te),z(te,Ct),b(De,Ct,null),z(B,as),z(B,wt),n(e,Jl,a),n(e,Ke,a),n(e,Cl,a),n(e,Oe,a),n(e,Ul,a),b(et,e,a),n(e,Zl,a),n(e,tt,a),n(e,xl,a),n(e,lt,a),n(e,Rl,a),b(st,e,a),n(e,Gl,a),n(e,at,a),n(e,Wl,a),n(e,nt,a),n(e,Hl,a),n(e,it,a),n(e,Vl,a),b(le,e,a),n(e,Fl,a),n(e,ot,a),n(e,Il,a),n(e,E,a),z(E,se),z(se,Ut),b(rt,Ut,null),z(E,ns),z(E,vt),n(e,Xl,a),b(ae,e,a),n(e,Nl,a),b(ne,e,a),n(e,Ll,a),n(e,pt,a),n(e,ql,a),b(ie,e,a),n(e,Al,a),n(e,Y,a),z(Y,oe),z(oe,Zt),b(ct,Zt,null),z(Y,is),z(Y,yt),n(e,Bl,a),b(re,e,a),n(e,El,a),n(e,mt,a),n(e,Yl,a),b(pe,e,a),n(e,Sl,a),n(e,xt,a),Pl=!0},p(e,[a]){const ut={};a&2&&(ut.$$scope={dirty:a,ctx:e}),r.$set(ut);const Rt={};a&2&&(Rt.$$scope={dirty:a,ctx:e}),P.$set(Rt);const Gt={};a&2&&(Gt.$$scope={dirty:a,ctx:e}),D.$set(Gt);const ft={};a&2&&(ft.$$scope={dirty:a,ctx:e}),O.$set(ft);const Wt={};a&2&&(Wt.$$scope={dirty:a,ctx:e}),le.$set(Wt);const Ht={};a&2&&(Ht.$$scope={dirty:a,ctx:e}),ae.$set(Ht);const dt={};a&2&&(dt.$$scope={dirty:a,ctx:e}),ne.$set(dt);const Vt={};a&2&&(Vt.$$scope={dirty:a,ctx:e}),ie.$set(Vt);const Ft={};a&2&&(Ft.$$scope={dirty:a,ctx:e}),re.$set(Ft);const $t={};a&2&&($t.$$scope={dirty:a,ctx:e}),pe.$set($t)},i(e){Pl||(M(k.$$.fragment,e),M(G.$$.fragment,e),M(r.$$.fragment,e),M(me.$$.fragment,e),M(fe.$$.fragment,e),M(P.$$.fragment,e),M(ve.$$.fragment,e),M(D.$$.fragment,e),M(_e.$$.fragment,e),M(ze.$$.fragment,e),M(Ce.$$.fragment,e),M(Ze.$$.fragment,e),M(Re.$$.fragment,e),M(We.$$.fragment,e),M(Ve.$$.fragment,e),M(Ie.$$.fragment,e),M(Ne.$$.fragment,e),M(qe.$$.fragment,e),M(O.$$.fragment,e),M(Be.$$.fragment,e),M(Ye.$$.fragment,e),M(Se.$$.fragment,e),M(De.$$.fragment,e),M(et.$$.fragment,e),M(st.$$.fragment,e),M(le.$$.fragment,e),M(rt.$$.fragment,e),M(ae.$$.fragment,e),M(ne.$$.fragment,e),M(ie.$$.fragment,e),M(ct.$$.fragment,e),M(re.$$.fragment,e),M(pe.$$.fragment,e),Pl=!0)},o(e){w(k.$$.fragment,e),w(G.$$.fragment,e),w(r.$$.fragment,e),w(me.$$.fragment,e),w(fe.$$.fragment,e),w(P.$$.fragment,e),w(ve.$$.fragment,e),w(D.$$.fragment,e),w(_e.$$.fragment,e),w(ze.$$.fragment,e),w(Ce.$$.fragment,e),w(Ze.$$.fragment,e),w(Re.$$.fragment,e),w(We.$$.fragment,e),w(Ve.$$.fragment,e),w(Ie.$$.fragment,e),w(Ne.$$.fragment,e),w(qe.$$.fragment,e),w(O.$$.fragment,e),w(Be.$$.fragment,e),w(Ye.$$.fragment,e),w(Se.$$.fragment,e),w(De.$$.fragment,e),w(et.$$.fragment,e),w(st.$$.fragment,e),w(le.$$.fragment,e),w(rt.$$.fragment,e),w(ae.$$.fragment,e),w(ne.$$.fragment,e),w(ie.$$.fragment,e),w(ct.$$.fragment,e),w(re.$$.fragment,e),w(pe.$$.fragment,e),Pl=!1},d(e){e&&(s(o),s(t),s(i),s(f),s(J),s(N),s(H),s(I),s(T),s(F),s(It),s(ue),s(Xt),s(Nt),s(de),s(Lt),s($e),s(qt),s(he),s(At),s(ge),s(Bt),s(be),s(Et),s(Me),s(Yt),s(we),s(St),s(Pt),s(L),s(Qt),s(ye),s(Dt),s(je),s(Kt),s(Ot),s(Te),s(el),s(tl),s(ke),s(ll),s(sl),s(Je),s(al),s(nl),s(Ue),s(il),s(ol),s(xe),s(rl),s(pl),s(Ge),s(cl),s(ml),s(He),s(ul),s(fl),s(Fe),s(dl),s($l),s(Xe),s(hl),s(q),s(gl),s(Le),s(bl),s(Ml),s(wl),s(Ae),s(vl),s(yl),s(Ee),s(jl),s(A),s(Tl),s(_l),s(Pe),s(kl),s(Qe),s(zl),s(B),s(Jl),s(Ke),s(Cl),s(Oe),s(Ul),s(Zl),s(tt),s(xl),s(lt),s(Rl),s(Gl),s(at),s(Wl),s(nt),s(Hl),s(it),s(Vl),s(Fl),s(ot),s(Il),s(E),s(Xl),s(Nl),s(Ll),s(pt),s(ql),s(Al),s(Y),s(Bl),s(El),s(mt),s(Yl),s(Sl),s(xt)),s(l),v(k),v(G,e),v(r,e),v(me),v(fe,e),v(P,e),v(ve),v(D,e),v(_e,e),v(ze,e),v(Ce,e),v(Ze,e),v(Re,e),v(We,e),v(Ve,e),v(Ie,e),v(Ne),v(qe,e),v(O,e),v(Be,e),v(Ye),v(Se,e),v(De),v(et,e),v(st,e),v(le,e),v(rt),v(ae,e),v(ne,e),v(ie,e),v(ct),v(re,e),v(pe,e)}}}const La={local:"quick-tour",sections:[{local:"pipeline",sections:[{local:"utilizzo-della-pipeline",title:"Utilizzo della Pipeline"},{local:"utilizzare-un-altro-modello-e-tokenizer-nella-pipeline",title:"Utilizzare un altro modello e tokenizer nella pipeline"}],title:"Pipeline"},{local:"autoclass",sections:[{local:"autotokenizer",title:"AutoTokenizer"},{local:"automodel",title:"AutoModel"},{local:"salva-un-modello",title:"Salva un modello"}],title:"AutoClass"}],title:"Quick tour"};function qa(j){return ia(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ka extends oa{constructor(l){super(),ra(this,l,qa,Na,na,{})}}export{Ka as component};
