import{s as hl,o as gl,n as Zt}from"../chunks/scheduler.36a0863c.js";import{S as yl,i as Tl,g as u,s,r as f,A as Ul,h as c,f as l,c as o,j as Rt,u as w,x as d,k as wl,y as Lt,a,v as J,d as h,t as g,w as y}from"../chunks/index.9c13489a.js";import{C as U}from"../chunks/CodeBlock.05d8ec32.js";import{F as Jl,M as zt}from"../chunks/Markdown.88297c0b.js";import{H as j}from"../chunks/Heading.7a254a62.js";function _l(_){let i,M='Lo script di esempio scarica e pre-processa un dataset dalla libreria 🤗 <a href="https://huggingface.co/docs/datasets/" rel="nofollow">Datasets</a>. Successivamente, lo script esegue il fine-tuning su un dataset usando il <a href="https://huggingface.co/docs/transformers/main_classes/trainer" rel="nofollow">Trainer</a> su un’architettura che supporta la summarization. Il seguente esempio mostra come eseguire il fine-tuning di <a href="https://huggingface.co/google-t5/t5-small" rel="nofollow">T5-small</a> sul dataset <a href="https://huggingface.co/datasets/cnn_dailymail" rel="nofollow">CNN/DailyMail</a>. Il modello T5 richiede un parametro addizionale <code>source_prefix</code> a causa del modo in cui è stato addestrato. Questo prefisso permette a T5 di sapere che si tratta di un task di summarization.',r,m,p;return m=new U({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjBnb29nbGUtdDUlMkZ0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfbmFtZSUyMGNubl9kYWlseW1haWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfY29uZmlnJTIwJTIyMy4wLjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXNvdXJjZV9wcmVmaXglMjAlMjJzdW1tYXJpemUlM0ElMjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLW91dHB1dF9kaXIlMjAlMkZ0bXAlMkZ0c3Qtc3VtbWFyaXphdGlvbiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNENCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV9ldmFsX2JhdGNoX3NpemUlM0Q0JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdmVyd3JpdGVfb3V0cHV0X2RpciUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcHJlZGljdF93aXRoX2dlbmVyYXRl",highlighted:`python examples/pytorch/summarization/run_summarization.py \\
    --model_name_or_path google-t5/t5-small \\
    --do_train \\
    --do_eval \\
    --dataset_name cnn_dailymail \\
    --dataset_config <span class="hljs-string">&quot;3.0.0&quot;</span> \\
    --source_prefix <span class="hljs-string">&quot;summarize: &quot;</span> \\
    --output_dir /tmp/tst-summarization \\
    --per_device_train_batch_size=4 \\
    --per_device_eval_batch_size=4 \\
    --overwrite_output_dir \\
    --predict_with_generate`,wrap:!1}}),{c(){i=u("p"),i.innerHTML=M,r=s(),f(m.$$.fragment)},l(n){i=c(n,"P",{"data-svelte-h":!0}),d(i)!=="svelte-1c47yw4"&&(i.innerHTML=M),r=o(n),w(m.$$.fragment,n)},m(n,T){a(n,i,T),a(n,r,T),J(m,n,T),p=!0},p:Zt,i(n){p||(h(m.$$.fragment,n),p=!0)},o(n){g(m.$$.fragment,n),p=!1},d(n){n&&(l(i),l(r)),y(m,n)}}}function jl(_){let i,M;return i=new zt({props:{$$slots:{default:[_l]},$$scope:{ctx:_}}}),{c(){f(i.$$.fragment)},l(r){w(i.$$.fragment,r)},m(r,m){J(i,r,m),M=!0},p(r,m){const p={};m&2&&(p.$$scope={dirty:m,ctx:r}),i.$set(p)},i(r){M||(h(i.$$.fragment,r),M=!0)},o(r){g(i.$$.fragment,r),M=!1},d(r){y(i,r)}}}function bl(_){let i,M='Lo script di esempio scarica e pre-processa un dataset dalla libreria 🤗 <a href="https://huggingface.co/docs/datasets/" rel="nofollow">Datasets</a>. Successivamente, lo script esegue il fine-tuning su un dataset usando Keras su un’architettura che supporta la summarization. Il seguente esempio mostra come eseguire il fine-tuning di <a href="https://huggingface.co/google-t5/t5-small" rel="nofollow">T5-small</a> sul dataset <a href="https://huggingface.co/datasets/cnn_dailymail" rel="nofollow">CNN/DailyMail</a>. Il modello T5 richiede un parametro addizionale <code>source_prefix</code> a causa del modo in cui è stato addestrato. Questo prefisso permette a T5 di sapere che si tratta di un task di summarization.',r,m,p;return m=new U({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZ0ZW5zb3JmbG93JTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTIwJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjBnb29nbGUtdDUlMkZ0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZGF0YXNldF9uYW1lJTIwY25uX2RhaWx5bWFpbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZGF0YXNldF9jb25maWclMjAlMjIzLjAuMCUyMiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tb3V0cHV0X2RpciUyMCUyRnRtcCUyRnRzdC1zdW1tYXJpemF0aW9uJTIwJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX3RyYWluX2JhdGNoX3NpemUlMjA4JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX2V2YWxfYmF0Y2hfc2l6ZSUyMDE2JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1udW1fdHJhaW5fZXBvY2hzJTIwMyUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWw=",highlighted:`python examples/tensorflow/summarization/run_summarization.py  \\
    --model_name_or_path google-t5/t5-small \\
    --dataset_name cnn_dailymail \\
    --dataset_config <span class="hljs-string">&quot;3.0.0&quot;</span> \\
    --output_dir /tmp/tst-summarization  \\
    --per_device_train_batch_size 8 \\
    --per_device_eval_batch_size 16 \\
    --num_train_epochs 3 \\
    --do_train \\
    --do_eval`,wrap:!1}}),{c(){i=u("p"),i.innerHTML=M,r=s(),f(m.$$.fragment)},l(n){i=c(n,"P",{"data-svelte-h":!0}),d(i)!=="svelte-11ga8js"&&(i.innerHTML=M),r=o(n),w(m.$$.fragment,n)},m(n,T){a(n,i,T),a(n,r,T),J(m,n,T),p=!0},p:Zt,i(n){p||(h(m.$$.fragment,n),p=!0)},o(n){g(m.$$.fragment,n),p=!1},d(n){n&&(l(i),l(r)),y(m,n)}}}function vl(_){let i,M;return i=new zt({props:{$$slots:{default:[bl]},$$scope:{ctx:_}}}),{c(){f(i.$$.fragment)},l(r){w(i.$$.fragment,r)},m(r,m){J(i,r,m),M=!0},p(r,m){const p={};m&2&&(p.$$scope={dirty:m,ctx:r}),i.$set(p)},i(r){M||(h(i.$$.fragment,r),M=!0)},o(r){g(i.$$.fragment,r),M=!1},d(r){y(i,r)}}}function $l(_){let i,M='Le Tensor Processing Units (TPU) sono state progettate per migliorare le prestazioni. PyTorch supporta le TPU con il compilatore per deep learning <a href="https://www.tensorflow.org/xla" rel="nofollow">XLA</a> (guarda <a href="https://github.com/pytorch/xla/blob/master/README.md" rel="nofollow">questo link</a> per maggiori dettagli). Per usare una TPU, avvia lo script <code>xla_spawn.py</code> e usa l’argomento <code>num_cores</code> per impostare il numero di core TPU che intendi usare.',r,m,p;return m=new U({props:{code:"cHl0aG9uJTIweGxhX3NwYXduLnB5JTIwLS1udW1fY29yZXMlMjA4JTIwJTVDJTBBJTIwJTIwJTIwJTIwc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjBnb29nbGUtdDUlMkZ0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfbmFtZSUyMGNubl9kYWlseW1haWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfY29uZmlnJTIwJTIyMy4wLjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXNvdXJjZV9wcmVmaXglMjAlMjJzdW1tYXJpemUlM0ElMjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLW91dHB1dF9kaXIlMjAlMkZ0bXAlMkZ0c3Qtc3VtbWFyaXphdGlvbiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNENCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV9ldmFsX2JhdGNoX3NpemUlM0Q0JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdmVyd3JpdGVfb3V0cHV0X2RpciUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcHJlZGljdF93aXRoX2dlbmVyYXRl",highlighted:`python xla_spawn.py --num_cores 8 \\
    summarization/run_summarization.py \\
    --model_name_or_path google-t5/t5-small \\
    --do_train \\
    --do_eval \\
    --dataset_name cnn_dailymail \\
    --dataset_config <span class="hljs-string">&quot;3.0.0&quot;</span> \\
    --source_prefix <span class="hljs-string">&quot;summarize: &quot;</span> \\
    --output_dir /tmp/tst-summarization \\
    --per_device_train_batch_size=4 \\
    --per_device_eval_batch_size=4 \\
    --overwrite_output_dir \\
    --predict_with_generate`,wrap:!1}}),{c(){i=u("p"),i.innerHTML=M,r=s(),f(m.$$.fragment)},l(n){i=c(n,"P",{"data-svelte-h":!0}),d(i)!=="svelte-1ndgg9f"&&(i.innerHTML=M),r=o(n),w(m.$$.fragment,n)},m(n,T){a(n,i,T),a(n,r,T),J(m,n,T),p=!0},p:Zt,i(n){p||(h(m.$$.fragment,n),p=!0)},o(n){g(m.$$.fragment,n),p=!1},d(n){n&&(l(i),l(r)),y(m,n)}}}function Cl(_){let i,M;return i=new zt({props:{$$slots:{default:[$l]},$$scope:{ctx:_}}}),{c(){f(i.$$.fragment)},l(r){w(i.$$.fragment,r)},m(r,m){J(i,r,m),M=!0},p(r,m){const p={};m&2&&(p.$$scope={dirty:m,ctx:r}),i.$set(p)},i(r){M||(h(i.$$.fragment,r),M=!0)},o(r){g(i.$$.fragment,r),M=!1},d(r){y(i,r)}}}function Xl(_){let i,M='Le Tensor Processing Units (TPU) sono state progettate per migliorare le prestazioni. Gli script TensorFlow utilizzano una <a href="https://www.tensorflow.org/guide/distributed_training#tpustrategy" rel="nofollow"><code>TPUStrategy</code></a> per eseguire l’addestramento su TPU. Per usare una TPU, passa il nome della risorsa TPU all’argomento <code>tpu</code>.',r,m,p;return m=new U({props:{code:"cHl0aG9uJTIwcnVuX3N1bW1hcml6YXRpb24ucHklMjAlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXRwdSUyMG5hbWVfb2ZfdHB1X3Jlc291cmNlJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjBnb29nbGUtdDUlMkZ0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZGF0YXNldF9uYW1lJTIwY25uX2RhaWx5bWFpbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZGF0YXNldF9jb25maWclMjAlMjIzLjAuMCUyMiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tb3V0cHV0X2RpciUyMCUyRnRtcCUyRnRzdC1zdW1tYXJpemF0aW9uJTIwJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX3RyYWluX2JhdGNoX3NpemUlMjA4JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX2V2YWxfYmF0Y2hfc2l6ZSUyMDE2JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1udW1fdHJhaW5fZXBvY2hzJTIwMyUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWw=",highlighted:`python run_summarization.py  \\
    --tpu name_of_tpu_resource \\
    --model_name_or_path google-t5/t5-small \\
    --dataset_name cnn_dailymail \\
    --dataset_config <span class="hljs-string">&quot;3.0.0&quot;</span> \\
    --output_dir /tmp/tst-summarization  \\
    --per_device_train_batch_size 8 \\
    --per_device_eval_batch_size 16 \\
    --num_train_epochs 3 \\
    --do_train \\
    --do_eval`,wrap:!1}}),{c(){i=u("p"),i.innerHTML=M,r=s(),f(m.$$.fragment)},l(n){i=c(n,"P",{"data-svelte-h":!0}),d(i)!=="svelte-11qd6ng"&&(i.innerHTML=M),r=o(n),w(m.$$.fragment,n)},m(n,T){a(n,i,T),a(n,r,T),J(m,n,T),p=!0},p:Zt,i(n){p||(h(m.$$.fragment,n),p=!0)},o(n){g(m.$$.fragment,n),p=!1},d(n){n&&(l(i),l(r)),y(m,n)}}}function Il(_){let i,M;return i=new zt({props:{$$slots:{default:[Xl]},$$scope:{ctx:_}}}),{c(){f(i.$$.fragment)},l(r){w(i.$$.fragment,r)},m(r,m){J(i,r,m),M=!0},p(r,m){const p={};m&2&&(p.$$scope={dirty:m,ctx:r}),i.$set(p)},i(r){M||(h(i.$$.fragment,r),M=!0)},o(r){g(i.$$.fragment,r),M=!1},d(r){y(i,r)}}}function Al(_){let i,M,r,m,p,n,T,Nt='Insieme ai <a href="./noteboks/README">notebooks</a> 🤗 Transformers, ci sono anche esempi di script che dimostrano come addestrare un modello per un task con <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch" rel="nofollow">PyTorch</a>, <a href="https://github.com/huggingface/transformers/tree/main/examples/tensorflow" rel="nofollow">TensorFlow</a>, o <a href="https://github.com/huggingface/transformers/tree/main/examples/flax" rel="nofollow">JAX/Flax</a>.',Ie,C,Vt='Troverai anche script che abbiamo usato nei nostri <a href="https://github.com/huggingface/transformers/tree/main/examples/research_projects" rel="nofollow">progetti di ricerca</a> e <a href="https://github.com/huggingface/transformers/tree/main/examples/legacy" rel="nofollow">precedenti esempi</a> a cui contribuisce per lo più la comunità. Questi script non sono attivamente mantenuti e richiedono una specifica versione di 🤗 Transformers che sarà molto probabilmente incompatibile con l’ultima versione della libreria.',Ae,X,xt="Non è dato per scontato che gli script di esempio funzionino senza apportare modifiche per ogni problema, bensì potrebbe essere necessario adattare lo script al tuo caso specifico. Per aiutarti in ciò, la maggioranza degli script espone le modalità di pre-processamento dei dati, consentendoti di modificare lo script come preferisci.",We,I,Bt='Per qualsiasi feature che vorresti implementare in uno script d’esempio, per favore discutine nel <a href="https://discuss.huggingface.co/" rel="nofollow">forum</a> o in un’<a href="https://github.com/huggingface/transformers/issues" rel="nofollow">issue</a> prima di inviare una Pull Request. Mentre accogliamo con piacere la correzione di bug, è più improbabile che faremo la stessa con una PR che aggiunge funzionalità sacrificando la leggibilità.',Ze,A,Ft='Questa guida ti mostrerà come eseguire uno script di esempio relativo al task di summarization in <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/summarization" rel="nofollow">PyTorch</a> e <a href="https://github.com/huggingface/transformers/tree/main/examples/tensorflow/summarization" rel="nofollow">TensorFlow</a>. Tutti gli esempi funzioneranno con entrambi i framework a meno che non sia specificato altrimenti.',ze,W,Ge,Z,Yt="Per eseguire con successo l’ultima versione degli script di esempio, devi <strong>installare 🤗 Transformers dalla fonte</strong> in un nuovo ambiente virtuale:",Re,z,Le,G,St="Per le precedenti versioni degli script di esempio, clicca sul pulsante di seguito:",Ne,R,Et='<summary>Esempi per versioni precedenti di 🤗 Transformers</summary> <ul><li><a href="https://github.com/huggingface/transformers/tree/v4.5.1/examples">v4.5.1</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v4.4.2/examples">v4.4.2</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v4.3.3/examples">v4.3.3</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v4.2.2/examples">v4.2.2</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v4.1.1/examples">v4.1.1</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v4.0.1/examples">v4.0.1</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v3.5.1/examples">v3.5.1</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v3.4.0/examples">v3.4.0</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v3.3.1/examples">v3.3.1</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v3.2.0/examples">v3.2.0</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v3.1.0/examples">v3.1.0</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v3.0.2/examples">v3.0.2</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v2.11.0/examples">v2.11.0</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v2.10.0/examples">v2.10.0</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v2.9.1/examples">v2.9.1</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v2.8.0/examples">v2.8.0</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v2.7.0/examples">v2.7.0</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v2.6.0/examples">v2.6.0</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v2.5.1/examples">v2.5.1</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v2.4.0/examples">v2.4.0</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v2.3.0/examples">v2.3.0</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v2.2.0/examples">v2.2.0</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v2.1.0/examples">v2.1.1</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v2.0.0/examples">v2.0.0</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v1.2.0/examples">v1.2.0</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v1.1.0/examples">v1.1.0</a></li> <li><a href="https://github.com/huggingface/transformers/tree/v1.0.0/examples">v1.0.0</a></li></ul>',Ve,L,kt="Successivamente, cambia la tua attuale copia di 🤗 Transformers specificandone la versione, ad esempio v3.5.1:",xe,N,Be,V,Ht="Dopo aver configurato correttamente la versione della libreria, naviga nella cartella degli esempi di tua scelta e installa i requisiti:",Fe,x,Ye,B,Se,b,Ee,F,ke,Y,Qt='Il <a href="https://huggingface.co/docs/transformers/main_classes/trainer" rel="nofollow">Trainer</a> supporta l’addestramento distribuito e la precisione mista, che significa che puoi anche usarla in uno script. Per abilitare entrambe le funzionalità:',He,S,Pt="<li>Aggiunto l’argomento <code>fp16</code> per abilitare la precisione mista.</li> <li>Imposta un numero di GPU da usare con l’argomento <code>nproc_per_node</code>.</li>",Qe,E,Pe,k,qt='Gli script TensorFlow utilizzano una <a href="https://www.tensorflow.org/guide/distributed_training#mirroredstrategy" rel="nofollow"><code>MirroredStrategy</code></a> per il training distribuito e non devi aggiungere alcun argomento addizionale allo script di training. Lo script TensorFlow userà multiple GPU in modo predefinito se quest’ultime sono disponibili:',qe,H,De,v,Oe,Q,Ke,P,Dt='🤗 <a href="https://huggingface.co/docs/accelerate" rel="nofollow">Accelerate</a> è una libreria compatibile solo con PyTorch che offre un metodo unificato per addestrare modelli su diverse tipologie di configurazioni (CPU, multiple GPU, TPU) mantenendo una completa visibilità rispetto al ciclo di training di PyTorch. Assicurati di aver effettuato l’installazione di 🤗 Accelerate, nel caso non lo avessi fatto:',et,$,Ce,Ot="Nota: dato che Accelerate è in rapido sviluppo, è necessario installare la versione proveniente da git per eseguire gli script:",Gt,q,tt,D,Kt="Invece che usare lo script <code>run_summarization.py</code>, devi usare lo script <code>run_summarization_no_trainer.py</code>. Gli script supportati in 🤗 Accelerate avranno un file chiamato <code>task_no_trainer.py</code> nella rispettiva cartella. Per iniziare, esegui il seguente comando per creare e salvare un file di configurazione:",lt,O,at,K,el="Testa la tua configurazione per assicurarti della sua correttezza:",it,ee,rt,te,tl="Ora sei pronto per avviare l’addestramento:",nt,le,st,ae,ot,ie,ll="Lo script di summarization supporta dataset personalizzati purché siano file CSV o JSON Line. Quando usi il tuo dataset, devi specificare diversi argomenti aggiuntivi:",mt,re,al="<li><code>train_file</code> e <code>validation_file</code> specificano dove si trovano i file di addestramento e validazione.</li> <li><code>text_column</code> è il file di input da riassumere.</li> <li><code>summary_column</code> è il file di destinazione per l’output.</li>",pt,ne,il="Uno script di summarization usando un dataset personalizzato sarebbe simile a questo:",ut,se,ct,oe,Mt,me,rl="È spesso una buona idea avviare il tuo script su un numero inferiore di esempi tratti dal dataset, per assicurarti che tutto funzioni come previsto prima di eseguire lo script sull’intero dataset, che potrebbe necessitare di ore. Usa i seguenti argomenti per limitare il dataset ad un massimo numero di esempi:",dt,pe,nl="<li><code>max_train_samples</code></li> <li><code>max_eval_samples</code></li> <li><code>max_predict_samples</code></li>",ft,ue,wt,ce,sl="Non tutti gli esempi di script supportano l’argomento <code>max_predict_samples</code>. Se non sei sicuro circa il supporto di questo argomento da parte del tuo script, aggiungi l’argomento <code>-h</code> per controllare:",Jt,Me,ht,de,gt,fe,ol="Un’altra utile opzione è riavviare un addestramento da un checkpoint precedente. Questo garantirà che tu possa riprendere da dove hai interrotto senza ricominciare se l’addestramento viene interrotto. Ci sono due metodi per riavviare l’addestramento da un checkpoint:",yt,we,ml="Il primo metodo usa l’argomento <code>output_dir previous_output_dir</code> per riavviare l’addestramento dall’ultima versione del checkpoint contenuto in <code>output_dir</code>. In questo caso, dovresti rimuovere <code>overwrite_output_dir</code>:",Tt,Je,Ut,he,pl="Il secondo metodo usa l’argomento <code>resume_from_checkpoint path_to_specific_checkpoint</code> per riavviare un addestramento da una specifica cartella di checkpoint.",_t,ge,jt,ye,bt,Te,ul='Tutti gli script possono caricare il tuo modello finale al <a href="https://huggingface.co/models" rel="nofollow">Model Hub</a>. Prima di iniziare, assicurati di aver effettuato l’accesso su Hugging Face:',vt,Ue,$t,_e,cl="Poi, aggiungi l’argomento <code>push_to_hub</code> allo script. Questo argomento consentirà di creare un repository con il tuo username Hugging Face e la cartella specificata in <code>output_dir</code>.",Ct,je,Ml="Per dare uno specifico nome al repository, usa l’argomento <code>push_to_hub_model_id</code>. Il repository verrà automaticamente elencata sotto al tuo namespace.",Xt,be,dl="Il seguente esempio mostra come caricare un modello specificando il nome del repository:",It,ve,At,Xe,Wt;return p=new j({props:{title:"Addestramento con script",local:"addestramento-con-script",headingTag:"h1"}}),W=new j({props:{title:"Installazione",local:"installazione",headingTag:"h2"}}),z=new U({props:{code:"Z2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZodWdnaW5nZmFjZSUyRnRyYW5zZm9ybWVycyUwQWNkJTIwdHJhbnNmb3JtZXJzJTBBcGlwJTIwaW5zdGFsbCUyMC4=",highlighted:`git <span class="hljs-built_in">clone</span> https://github.com/huggingface/transformers
<span class="hljs-built_in">cd</span> transformers
pip install .`,wrap:!1}}),N=new U({props:{code:"Z2l0JTIwY2hlY2tvdXQlMjB0YWdzJTJGdjMuNS4x",highlighted:"git checkout tags/v3.5.1",wrap:!1}}),x=new U({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1yJTIwcmVxdWlyZW1lbnRzLnR4dA==",highlighted:"pip install -r requirements.txt",wrap:!1}}),B=new j({props:{title:"Esegui uno script",local:"esegui-uno-script",headingTag:"h2"}}),b=new Jl({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[vl],pytorch:[jl]},$$scope:{ctx:_}}}),F=new j({props:{title:"Addestramento distribuito e precisione mista",local:"addestramento-distribuito-e-precisione-mista",headingTag:"h2"}}),E=new U({props:{code:"dG9yY2hydW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLW5wcm9jX3Blcl9ub2RlJTIwOCUyMHB5dG9yY2glMkZzdW1tYXJpemF0aW9uJTJGcnVuX3N1bW1hcml6YXRpb24ucHklMjAlNUMlMEElMjAlMjAlMjAlMjAtLWZwMTYlMjAlNUMlMEElMjAlMjAlMjAlMjAtLW1vZGVsX25hbWVfb3JfcGF0aCUyMGdvb2dsZS10NSUyRnQ1LXNtYWxsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kb190cmFpbiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fZXZhbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZGF0YXNldF9uYW1lJTIwY25uX2RhaWx5bWFpbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZGF0YXNldF9jb25maWclMjAlMjIzLjAuMCUyMiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tc291cmNlX3ByZWZpeCUyMCUyMnN1bW1hcml6ZSUzQSUyMCUyMiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tb3V0cHV0X2RpciUyMCUyRnRtcCUyRnRzdC1zdW1tYXJpemF0aW9uJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX3RyYWluX2JhdGNoX3NpemUlM0Q0JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX2V2YWxfYmF0Y2hfc2l6ZSUzRDQlMjAlNUMlMEElMjAlMjAlMjAlMjAtLW92ZXJ3cml0ZV9vdXRwdXRfZGlyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wcmVkaWN0X3dpdGhfZ2VuZXJhdGU=",highlighted:`torchrun \\
    --nproc_per_node 8 pytorch/summarization/run_summarization.py \\
    --fp16 \\
    --model_name_or_path google-t5/t5-small \\
    --do_train \\
    --do_eval \\
    --dataset_name cnn_dailymail \\
    --dataset_config <span class="hljs-string">&quot;3.0.0&quot;</span> \\
    --source_prefix <span class="hljs-string">&quot;summarize: &quot;</span> \\
    --output_dir /tmp/tst-summarization \\
    --per_device_train_batch_size=4 \\
    --per_device_eval_batch_size=4 \\
    --overwrite_output_dir \\
    --predict_with_generate`,wrap:!1}}),H=new j({props:{title:"Esegui uno script su TPU",local:"esegui-uno-script-su-tpu",headingTag:"h2"}}),v=new Jl({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Il],pytorch:[Cl]},$$scope:{ctx:_}}}),Q=new j({props:{title:"Esegui uno script con 🤗 Accelerate",local:"esegui-uno-script-con--accelerate",headingTag:"h2"}}),q=new U({props:{code:"cGlwJTIwaW5zdGFsbCUyMGdpdCUyQmh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmh1Z2dpbmdmYWNlJTJGYWNjZWxlcmF0ZQ==",highlighted:"pip install git+https://github.com/huggingface/accelerate",wrap:!1}}),O=new U({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZw==",highlighted:"accelerate config",wrap:!1}}),ee=new U({props:{code:"YWNjZWxlcmF0ZSUyMHRlc3Q=",highlighted:'accelerate <span class="hljs-built_in">test</span>',wrap:!1}}),le=new U({props:{code:"YWNjZWxlcmF0ZSUyMGxhdW5jaCUyMHJ1bl9zdW1tYXJpemF0aW9uX25vX3RyYWluZXIucHklMjAlNUMlMEElMjAlMjAlMjAlMjAtLW1vZGVsX25hbWVfb3JfcGF0aCUyMGdvb2dsZS10NSUyRnQ1LXNtYWxsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kYXRhc2V0X25hbWUlMjBjbm5fZGFpbHltYWlsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kYXRhc2V0X2NvbmZpZyUyMCUyMjMuMC4wJTIyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1zb3VyY2VfcHJlZml4JTIwJTIyc3VtbWFyaXplJTNBJTIwJTIyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdXRwdXRfZGlyJTIwfiUyRnRtcCUyRnRzdC1zdW1tYXJpemF0aW9u",highlighted:`accelerate launch run_summarization_no_trainer.py \\
    --model_name_or_path google-t5/t5-small \\
    --dataset_name cnn_dailymail \\
    --dataset_config <span class="hljs-string">&quot;3.0.0&quot;</span> \\
    --source_prefix <span class="hljs-string">&quot;summarize: &quot;</span> \\
    --output_dir ~/tmp/tst-summarization`,wrap:!1}}),ae=new j({props:{title:"Uso di un dataset personalizzato",local:"uso-di-un-dataset-personalizzato",headingTag:"h2"}}),se=new U({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjBnb29nbGUtdDUlMkZ0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXRyYWluX2ZpbGUlMjBwYXRoX3RvX2Nzdl9vcl9qc29ubGluZXNfZmlsZSUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tdmFsaWRhdGlvbl9maWxlJTIwcGF0aF90b19jc3Zfb3JfanNvbmxpbmVzX2ZpbGUlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXRleHRfY29sdW1uJTIwdGV4dF9jb2x1bW5fbmFtZSUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tc3VtbWFyeV9jb2x1bW4lMjBzdW1tYXJ5X2NvbHVtbl9uYW1lJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1zb3VyY2VfcHJlZml4JTIwJTIyc3VtbWFyaXplJTNBJTIwJTIyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdXRwdXRfZGlyJTIwJTJGdG1wJTJGdHN0LXN1bW1hcml6YXRpb24lMjAlNUMlMEElMjAlMjAlMjAlMjAtLW92ZXJ3cml0ZV9vdXRwdXRfZGlyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX3RyYWluX2JhdGNoX3NpemUlM0Q0JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX2V2YWxfYmF0Y2hfc2l6ZSUzRDQlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXByZWRpY3Rfd2l0aF9nZW5lcmF0ZQ==",highlighted:`python examples/pytorch/summarization/run_summarization.py \\
    --model_name_or_path google-t5/t5-small \\
    --do_train \\
    --do_eval \\
    --train_file path_to_csv_or_jsonlines_file \\
    --validation_file path_to_csv_or_jsonlines_file \\
    --text_column text_column_name \\
    --summary_column summary_column_name \\
    --source_prefix <span class="hljs-string">&quot;summarize: &quot;</span> \\
    --output_dir /tmp/tst-summarization \\
    --overwrite_output_dir \\
    --per_device_train_batch_size=4 \\
    --per_device_eval_batch_size=4 \\
    --predict_with_generate`,wrap:!1}}),oe=new j({props:{title:"Testare uno script",local:"testare-uno-script",headingTag:"h2"}}),ue=new U({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjBnb29nbGUtdDUlMkZ0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tbWF4X3RyYWluX3NhbXBsZXMlMjA1MCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tbWF4X2V2YWxfc2FtcGxlcyUyMDUwJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tYXhfcHJlZGljdF9zYW1wbGVzJTIwNTAlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX3RyYWluJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kb19ldmFsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kYXRhc2V0X25hbWUlMjBjbm5fZGFpbHltYWlsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kYXRhc2V0X2NvbmZpZyUyMCUyMjMuMC4wJTIyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1zb3VyY2VfcHJlZml4JTIwJTIyc3VtbWFyaXplJTNBJTIwJTIyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdXRwdXRfZGlyJTIwJTJGdG1wJTJGdHN0LXN1bW1hcml6YXRpb24lMjAlNUMlMEElMjAlMjAlMjAlMjAtLXBlcl9kZXZpY2VfdHJhaW5fYmF0Y2hfc2l6ZSUzRDQlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXBlcl9kZXZpY2VfZXZhbF9iYXRjaF9zaXplJTNENCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tb3ZlcndyaXRlX291dHB1dF9kaXIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXByZWRpY3Rfd2l0aF9nZW5lcmF0ZQ==",highlighted:`python examples/pytorch/summarization/run_summarization.py \\
    --model_name_or_path google-t5/t5-small \\
    --max_train_samples 50 \\
    --max_eval_samples 50 \\
    --max_predict_samples 50 \\
    --do_train \\
    --do_eval \\
    --dataset_name cnn_dailymail \\
    --dataset_config <span class="hljs-string">&quot;3.0.0&quot;</span> \\
    --source_prefix <span class="hljs-string">&quot;summarize: &quot;</span> \\
    --output_dir /tmp/tst-summarization \\
    --per_device_train_batch_size=4 \\
    --per_device_eval_batch_size=4 \\
    --overwrite_output_dir \\
    --predict_with_generate`,wrap:!1}}),Me=new U({props:{code:"ZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTIwLWg=",highlighted:"examples/pytorch/summarization/run_summarization.py -h",wrap:!1}}),de=new j({props:{title:"Riavviare addestramento da un checkpoint",local:"riavviare-addestramento-da-un-checkpoint",headingTag:"h2"}}),Je=new U({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjBnb29nbGUtdDUlMkZ0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfbmFtZSUyMGNubl9kYWlseW1haWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfY29uZmlnJTIwJTIyMy4wLjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXNvdXJjZV9wcmVmaXglMjAlMjJzdW1tYXJpemUlM0ElMjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLW91dHB1dF9kaXIlMjAlMkZ0bXAlMkZ0c3Qtc3VtbWFyaXphdGlvbiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNENCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV9ldmFsX2JhdGNoX3NpemUlM0Q0JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdXRwdXRfZGlyJTIwcHJldmlvdXNfb3V0cHV0X2RpciUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcHJlZGljdF93aXRoX2dlbmVyYXRl",highlighted:`python examples/pytorch/summarization/run_summarization.py
    --model_name_or_path google-t5/t5-small \\
    --do_train \\
    --do_eval \\
    --dataset_name cnn_dailymail \\
    --dataset_config <span class="hljs-string">&quot;3.0.0&quot;</span> \\
    --source_prefix <span class="hljs-string">&quot;summarize: &quot;</span> \\
    --output_dir /tmp/tst-summarization \\
    --per_device_train_batch_size=4 \\
    --per_device_eval_batch_size=4 \\
    --output_dir previous_output_dir \\
    --predict_with_generate`,wrap:!1}}),ge=new U({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjBnb29nbGUtdDUlMkZ0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfbmFtZSUyMGNubl9kYWlseW1haWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfY29uZmlnJTIwJTIyMy4wLjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXNvdXJjZV9wcmVmaXglMjAlMjJzdW1tYXJpemUlM0ElMjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLW91dHB1dF9kaXIlMjAlMkZ0bXAlMkZ0c3Qtc3VtbWFyaXphdGlvbiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNENCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV9ldmFsX2JhdGNoX3NpemUlM0Q0JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdmVyd3JpdGVfb3V0cHV0X2RpciUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcmVzdW1lX2Zyb21fY2hlY2twb2ludCUyMHBhdGhfdG9fc3BlY2lmaWNfY2hlY2twb2ludCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcHJlZGljdF93aXRoX2dlbmVyYXRl",highlighted:`python examples/pytorch/summarization/run_summarization.py
    --model_name_or_path google-t5/t5-small \\
    --do_train \\
    --do_eval \\
    --dataset_name cnn_dailymail \\
    --dataset_config <span class="hljs-string">&quot;3.0.0&quot;</span> \\
    --source_prefix <span class="hljs-string">&quot;summarize: &quot;</span> \\
    --output_dir /tmp/tst-summarization \\
    --per_device_train_batch_size=4 \\
    --per_device_eval_batch_size=4 \\
    --overwrite_output_dir \\
    --resume_from_checkpoint path_to_specific_checkpoint \\
    --predict_with_generate`,wrap:!1}}),ye=new j({props:{title:"Condividi il tuo modello",local:"condividi-il-tuo-modello",headingTag:"h2"}}),Ue=new U({props:{code:"aHVnZ2luZ2ZhY2UtY2xpJTIwbG9naW4=",highlighted:"huggingface-cli login",wrap:!1}}),ve=new U({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjBnb29nbGUtdDUlMkZ0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfbmFtZSUyMGNubl9kYWlseW1haWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfY29uZmlnJTIwJTIyMy4wLjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXNvdXJjZV9wcmVmaXglMjAlMjJzdW1tYXJpemUlM0ElMjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXB1c2hfdG9faHViJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wdXNoX3RvX2h1Yl9tb2RlbF9pZCUyMGZpbmV0dW5lZC10NS1jbm5fZGFpbHltYWlsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdXRwdXRfZGlyJTIwJTJGdG1wJTJGdHN0LXN1bW1hcml6YXRpb24lMjAlNUMlMEElMjAlMjAlMjAlMjAtLXBlcl9kZXZpY2VfdHJhaW5fYmF0Y2hfc2l6ZSUzRDQlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXBlcl9kZXZpY2VfZXZhbF9iYXRjaF9zaXplJTNENCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tb3ZlcndyaXRlX291dHB1dF9kaXIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXByZWRpY3Rfd2l0aF9nZW5lcmF0ZQ==",highlighted:`python examples/pytorch/summarization/run_summarization.py
    --model_name_or_path google-t5/t5-small \\
    --do_train \\
    --do_eval \\
    --dataset_name cnn_dailymail \\
    --dataset_config <span class="hljs-string">&quot;3.0.0&quot;</span> \\
    --source_prefix <span class="hljs-string">&quot;summarize: &quot;</span> \\
    --push_to_hub \\
    --push_to_hub_model_id finetuned-t5-cnn_dailymail \\
    --output_dir /tmp/tst-summarization \\
    --per_device_train_batch_size=4 \\
    --per_device_eval_batch_size=4 \\
    --overwrite_output_dir \\
    --predict_with_generate`,wrap:!1}}),{c(){i=u("meta"),M=s(),r=u("p"),m=s(),f(p.$$.fragment),n=s(),T=u("p"),T.innerHTML=Nt,Ie=s(),C=u("p"),C.innerHTML=Vt,Ae=s(),X=u("p"),X.textContent=xt,We=s(),I=u("p"),I.innerHTML=Bt,Ze=s(),A=u("p"),A.innerHTML=Ft,ze=s(),f(W.$$.fragment),Ge=s(),Z=u("p"),Z.innerHTML=Yt,Re=s(),f(z.$$.fragment),Le=s(),G=u("p"),G.textContent=St,Ne=s(),R=u("details"),R.innerHTML=Et,Ve=s(),L=u("p"),L.textContent=kt,xe=s(),f(N.$$.fragment),Be=s(),V=u("p"),V.textContent=Ht,Fe=s(),f(x.$$.fragment),Ye=s(),f(B.$$.fragment),Se=s(),f(b.$$.fragment),Ee=s(),f(F.$$.fragment),ke=s(),Y=u("p"),Y.innerHTML=Qt,He=s(),S=u("ul"),S.innerHTML=Pt,Qe=s(),f(E.$$.fragment),Pe=s(),k=u("p"),k.innerHTML=qt,qe=s(),f(H.$$.fragment),De=s(),f(v.$$.fragment),Oe=s(),f(Q.$$.fragment),Ke=s(),P=u("p"),P.innerHTML=Dt,et=s(),$=u("blockquote"),Ce=u("p"),Ce.textContent=Ot,Gt=s(),f(q.$$.fragment),tt=s(),D=u("p"),D.innerHTML=Kt,lt=s(),f(O.$$.fragment),at=s(),K=u("p"),K.textContent=el,it=s(),f(ee.$$.fragment),rt=s(),te=u("p"),te.textContent=tl,nt=s(),f(le.$$.fragment),st=s(),f(ae.$$.fragment),ot=s(),ie=u("p"),ie.textContent=ll,mt=s(),re=u("ul"),re.innerHTML=al,pt=s(),ne=u("p"),ne.textContent=il,ut=s(),f(se.$$.fragment),ct=s(),f(oe.$$.fragment),Mt=s(),me=u("p"),me.textContent=rl,dt=s(),pe=u("ul"),pe.innerHTML=nl,ft=s(),f(ue.$$.fragment),wt=s(),ce=u("p"),ce.innerHTML=sl,Jt=s(),f(Me.$$.fragment),ht=s(),f(de.$$.fragment),gt=s(),fe=u("p"),fe.textContent=ol,yt=s(),we=u("p"),we.innerHTML=ml,Tt=s(),f(Je.$$.fragment),Ut=s(),he=u("p"),he.innerHTML=pl,_t=s(),f(ge.$$.fragment),jt=s(),f(ye.$$.fragment),bt=s(),Te=u("p"),Te.innerHTML=ul,vt=s(),f(Ue.$$.fragment),$t=s(),_e=u("p"),_e.innerHTML=cl,Ct=s(),je=u("p"),je.innerHTML=Ml,Xt=s(),be=u("p"),be.textContent=dl,It=s(),f(ve.$$.fragment),At=s(),Xe=u("p"),this.h()},l(e){const t=Ul("svelte-u9bgzb",document.head);i=c(t,"META",{name:!0,content:!0}),t.forEach(l),M=o(e),r=c(e,"P",{}),Rt(r).forEach(l),m=o(e),w(p.$$.fragment,e),n=o(e),T=c(e,"P",{"data-svelte-h":!0}),d(T)!=="svelte-dlbwfe"&&(T.innerHTML=Nt),Ie=o(e),C=c(e,"P",{"data-svelte-h":!0}),d(C)!=="svelte-p3vgrn"&&(C.innerHTML=Vt),Ae=o(e),X=c(e,"P",{"data-svelte-h":!0}),d(X)!=="svelte-3iprul"&&(X.textContent=xt),We=o(e),I=c(e,"P",{"data-svelte-h":!0}),d(I)!=="svelte-skpcg4"&&(I.innerHTML=Bt),Ze=o(e),A=c(e,"P",{"data-svelte-h":!0}),d(A)!=="svelte-1dty626"&&(A.innerHTML=Ft),ze=o(e),w(W.$$.fragment,e),Ge=o(e),Z=c(e,"P",{"data-svelte-h":!0}),d(Z)!=="svelte-1miqfm2"&&(Z.innerHTML=Yt),Re=o(e),w(z.$$.fragment,e),Le=o(e),G=c(e,"P",{"data-svelte-h":!0}),d(G)!=="svelte-b2rskv"&&(G.textContent=St),Ne=o(e),R=c(e,"DETAILS",{"data-svelte-h":!0}),d(R)!=="svelte-ytnfkk"&&(R.innerHTML=Et),Ve=o(e),L=c(e,"P",{"data-svelte-h":!0}),d(L)!=="svelte-cm69sz"&&(L.textContent=kt),xe=o(e),w(N.$$.fragment,e),Be=o(e),V=c(e,"P",{"data-svelte-h":!0}),d(V)!=="svelte-2jautu"&&(V.textContent=Ht),Fe=o(e),w(x.$$.fragment,e),Ye=o(e),w(B.$$.fragment,e),Se=o(e),w(b.$$.fragment,e),Ee=o(e),w(F.$$.fragment,e),ke=o(e),Y=c(e,"P",{"data-svelte-h":!0}),d(Y)!=="svelte-143nmbm"&&(Y.innerHTML=Qt),He=o(e),S=c(e,"UL",{"data-svelte-h":!0}),d(S)!=="svelte-1ld4sku"&&(S.innerHTML=Pt),Qe=o(e),w(E.$$.fragment,e),Pe=o(e),k=c(e,"P",{"data-svelte-h":!0}),d(k)!=="svelte-3o4ent"&&(k.innerHTML=qt),qe=o(e),w(H.$$.fragment,e),De=o(e),w(v.$$.fragment,e),Oe=o(e),w(Q.$$.fragment,e),Ke=o(e),P=c(e,"P",{"data-svelte-h":!0}),d(P)!=="svelte-10zit0a"&&(P.innerHTML=Dt),et=o(e),$=c(e,"BLOCKQUOTE",{});var $e=Rt($);Ce=c($e,"P",{"data-svelte-h":!0}),d(Ce)!=="svelte-1ehqze5"&&(Ce.textContent=Ot),Gt=o($e),w(q.$$.fragment,$e),$e.forEach(l),tt=o(e),D=c(e,"P",{"data-svelte-h":!0}),d(D)!=="svelte-1b94v6a"&&(D.innerHTML=Kt),lt=o(e),w(O.$$.fragment,e),at=o(e),K=c(e,"P",{"data-svelte-h":!0}),d(K)!=="svelte-13dqlnm"&&(K.textContent=el),it=o(e),w(ee.$$.fragment,e),rt=o(e),te=c(e,"P",{"data-svelte-h":!0}),d(te)!=="svelte-azupwy"&&(te.textContent=tl),nt=o(e),w(le.$$.fragment,e),st=o(e),w(ae.$$.fragment,e),ot=o(e),ie=c(e,"P",{"data-svelte-h":!0}),d(ie)!=="svelte-3m0es0"&&(ie.textContent=ll),mt=o(e),re=c(e,"UL",{"data-svelte-h":!0}),d(re)!=="svelte-1msqo4o"&&(re.innerHTML=al),pt=o(e),ne=c(e,"P",{"data-svelte-h":!0}),d(ne)!=="svelte-1cj93yk"&&(ne.textContent=il),ut=o(e),w(se.$$.fragment,e),ct=o(e),w(oe.$$.fragment,e),Mt=o(e),me=c(e,"P",{"data-svelte-h":!0}),d(me)!=="svelte-1sqi69s"&&(me.textContent=rl),dt=o(e),pe=c(e,"UL",{"data-svelte-h":!0}),d(pe)!=="svelte-14g5f8g"&&(pe.innerHTML=nl),ft=o(e),w(ue.$$.fragment,e),wt=o(e),ce=c(e,"P",{"data-svelte-h":!0}),d(ce)!=="svelte-lpiiy4"&&(ce.innerHTML=sl),Jt=o(e),w(Me.$$.fragment,e),ht=o(e),w(de.$$.fragment,e),gt=o(e),fe=c(e,"P",{"data-svelte-h":!0}),d(fe)!=="svelte-1ojfq0o"&&(fe.textContent=ol),yt=o(e),we=c(e,"P",{"data-svelte-h":!0}),d(we)!=="svelte-er6rqd"&&(we.innerHTML=ml),Tt=o(e),w(Je.$$.fragment,e),Ut=o(e),he=c(e,"P",{"data-svelte-h":!0}),d(he)!=="svelte-vzkarm"&&(he.innerHTML=pl),_t=o(e),w(ge.$$.fragment,e),jt=o(e),w(ye.$$.fragment,e),bt=o(e),Te=c(e,"P",{"data-svelte-h":!0}),d(Te)!=="svelte-5tj2pz"&&(Te.innerHTML=ul),vt=o(e),w(Ue.$$.fragment,e),$t=o(e),_e=c(e,"P",{"data-svelte-h":!0}),d(_e)!=="svelte-gmt2gy"&&(_e.innerHTML=cl),Ct=o(e),je=c(e,"P",{"data-svelte-h":!0}),d(je)!=="svelte-3hq370"&&(je.innerHTML=Ml),Xt=o(e),be=c(e,"P",{"data-svelte-h":!0}),d(be)!=="svelte-1doeu81"&&(be.textContent=dl),It=o(e),w(ve.$$.fragment,e),At=o(e),Xe=c(e,"P",{}),Rt(Xe).forEach(l),this.h()},h(){wl(i,"name","hf:doc:metadata"),wl(i,"content",Wl)},m(e,t){Lt(document.head,i),a(e,M,t),a(e,r,t),a(e,m,t),J(p,e,t),a(e,n,t),a(e,T,t),a(e,Ie,t),a(e,C,t),a(e,Ae,t),a(e,X,t),a(e,We,t),a(e,I,t),a(e,Ze,t),a(e,A,t),a(e,ze,t),J(W,e,t),a(e,Ge,t),a(e,Z,t),a(e,Re,t),J(z,e,t),a(e,Le,t),a(e,G,t),a(e,Ne,t),a(e,R,t),a(e,Ve,t),a(e,L,t),a(e,xe,t),J(N,e,t),a(e,Be,t),a(e,V,t),a(e,Fe,t),J(x,e,t),a(e,Ye,t),J(B,e,t),a(e,Se,t),J(b,e,t),a(e,Ee,t),J(F,e,t),a(e,ke,t),a(e,Y,t),a(e,He,t),a(e,S,t),a(e,Qe,t),J(E,e,t),a(e,Pe,t),a(e,k,t),a(e,qe,t),J(H,e,t),a(e,De,t),J(v,e,t),a(e,Oe,t),J(Q,e,t),a(e,Ke,t),a(e,P,t),a(e,et,t),a(e,$,t),Lt($,Ce),Lt($,Gt),J(q,$,null),a(e,tt,t),a(e,D,t),a(e,lt,t),J(O,e,t),a(e,at,t),a(e,K,t),a(e,it,t),J(ee,e,t),a(e,rt,t),a(e,te,t),a(e,nt,t),J(le,e,t),a(e,st,t),J(ae,e,t),a(e,ot,t),a(e,ie,t),a(e,mt,t),a(e,re,t),a(e,pt,t),a(e,ne,t),a(e,ut,t),J(se,e,t),a(e,ct,t),J(oe,e,t),a(e,Mt,t),a(e,me,t),a(e,dt,t),a(e,pe,t),a(e,ft,t),J(ue,e,t),a(e,wt,t),a(e,ce,t),a(e,Jt,t),J(Me,e,t),a(e,ht,t),J(de,e,t),a(e,gt,t),a(e,fe,t),a(e,yt,t),a(e,we,t),a(e,Tt,t),J(Je,e,t),a(e,Ut,t),a(e,he,t),a(e,_t,t),J(ge,e,t),a(e,jt,t),J(ye,e,t),a(e,bt,t),a(e,Te,t),a(e,vt,t),J(Ue,e,t),a(e,$t,t),a(e,_e,t),a(e,Ct,t),a(e,je,t),a(e,Xt,t),a(e,be,t),a(e,It,t),J(ve,e,t),a(e,At,t),a(e,Xe,t),Wt=!0},p(e,[t]){const $e={};t&2&&($e.$$scope={dirty:t,ctx:e}),b.$set($e);const fl={};t&2&&(fl.$$scope={dirty:t,ctx:e}),v.$set(fl)},i(e){Wt||(h(p.$$.fragment,e),h(W.$$.fragment,e),h(z.$$.fragment,e),h(N.$$.fragment,e),h(x.$$.fragment,e),h(B.$$.fragment,e),h(b.$$.fragment,e),h(F.$$.fragment,e),h(E.$$.fragment,e),h(H.$$.fragment,e),h(v.$$.fragment,e),h(Q.$$.fragment,e),h(q.$$.fragment,e),h(O.$$.fragment,e),h(ee.$$.fragment,e),h(le.$$.fragment,e),h(ae.$$.fragment,e),h(se.$$.fragment,e),h(oe.$$.fragment,e),h(ue.$$.fragment,e),h(Me.$$.fragment,e),h(de.$$.fragment,e),h(Je.$$.fragment,e),h(ge.$$.fragment,e),h(ye.$$.fragment,e),h(Ue.$$.fragment,e),h(ve.$$.fragment,e),Wt=!0)},o(e){g(p.$$.fragment,e),g(W.$$.fragment,e),g(z.$$.fragment,e),g(N.$$.fragment,e),g(x.$$.fragment,e),g(B.$$.fragment,e),g(b.$$.fragment,e),g(F.$$.fragment,e),g(E.$$.fragment,e),g(H.$$.fragment,e),g(v.$$.fragment,e),g(Q.$$.fragment,e),g(q.$$.fragment,e),g(O.$$.fragment,e),g(ee.$$.fragment,e),g(le.$$.fragment,e),g(ae.$$.fragment,e),g(se.$$.fragment,e),g(oe.$$.fragment,e),g(ue.$$.fragment,e),g(Me.$$.fragment,e),g(de.$$.fragment,e),g(Je.$$.fragment,e),g(ge.$$.fragment,e),g(ye.$$.fragment,e),g(Ue.$$.fragment,e),g(ve.$$.fragment,e),Wt=!1},d(e){e&&(l(M),l(r),l(m),l(n),l(T),l(Ie),l(C),l(Ae),l(X),l(We),l(I),l(Ze),l(A),l(ze),l(Ge),l(Z),l(Re),l(Le),l(G),l(Ne),l(R),l(Ve),l(L),l(xe),l(Be),l(V),l(Fe),l(Ye),l(Se),l(Ee),l(ke),l(Y),l(He),l(S),l(Qe),l(Pe),l(k),l(qe),l(De),l(Oe),l(Ke),l(P),l(et),l($),l(tt),l(D),l(lt),l(at),l(K),l(it),l(rt),l(te),l(nt),l(st),l(ot),l(ie),l(mt),l(re),l(pt),l(ne),l(ut),l(ct),l(Mt),l(me),l(dt),l(pe),l(ft),l(wt),l(ce),l(Jt),l(ht),l(gt),l(fe),l(yt),l(we),l(Tt),l(Ut),l(he),l(_t),l(jt),l(bt),l(Te),l(vt),l($t),l(_e),l(Ct),l(je),l(Xt),l(be),l(It),l(At),l(Xe)),l(i),y(p,e),y(W,e),y(z,e),y(N,e),y(x,e),y(B,e),y(b,e),y(F,e),y(E,e),y(H,e),y(v,e),y(Q,e),y(q),y(O,e),y(ee,e),y(le,e),y(ae,e),y(se,e),y(oe,e),y(ue,e),y(Me,e),y(de,e),y(Je,e),y(ge,e),y(ye,e),y(Ue,e),y(ve,e)}}}const Wl='{"title":"Addestramento con script","local":"addestramento-con-script","sections":[{"title":"Installazione","local":"installazione","sections":[],"depth":2},{"title":"Esegui uno script","local":"esegui-uno-script","sections":[],"depth":2},{"title":"Addestramento distribuito e precisione mista","local":"addestramento-distribuito-e-precisione-mista","sections":[],"depth":2},{"title":"Esegui uno script su TPU","local":"esegui-uno-script-su-tpu","sections":[],"depth":2},{"title":"Esegui uno script con 🤗 Accelerate","local":"esegui-uno-script-con--accelerate","sections":[],"depth":2},{"title":"Uso di un dataset personalizzato","local":"uso-di-un-dataset-personalizzato","sections":[],"depth":2},{"title":"Testare uno script","local":"testare-uno-script","sections":[],"depth":2},{"title":"Riavviare addestramento da un checkpoint","local":"riavviare-addestramento-da-un-checkpoint","sections":[],"depth":2},{"title":"Condividi il tuo modello","local":"condividi-il-tuo-modello","sections":[],"depth":2}],"depth":1}';function Zl(_){return gl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Vl extends yl{constructor(i){super(),Tl(this,i,Zl,Al,hl,{})}}export{Vl as component};
