import{s as yl,o as Tl,n as Gt}from"../chunks/scheduler.36a0863c.js";import{S as Ul,i as _l,g as u,s as n,r as d,A as bl,h as c,f as l,c as s,j as Nt,u as f,x as y,k as Jl,y as Vt,a,v as w,d as h,t as J,w as g}from"../chunks/index.9c13489a.js";import{C as U}from"../chunks/CodeBlock.05d8ec32.js";import{F as gl,M as Rt}from"../chunks/Markdown.88297c0b.js";import{H as b,E as jl}from"../chunks/EditOnGithub.e88f2b7b.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=n(),d(m.$$.fragment)},l(o){i=c(o,"P",{"data-svelte-h":!0}),y(i)!=="svelte-1c47yw4"&&(i.innerHTML=M),r=s(o),f(m.$$.fragment,o)},m(o,T){a(o,i,T),a(o,r,T),w(m,o,T),p=!0},p:Gt,i(o){p||(h(m.$$.fragment,o),p=!0)},o(o){J(m.$$.fragment,o),p=!1},d(o){o&&(l(i),l(r)),g(m,o)}}}function vl(_){let i,M;return i=new Rt({props:{$$slots:{default:[$l]},$$scope:{ctx:_}}}),{c(){d(i.$$.fragment)},l(r){f(i.$$.fragment,r)},m(r,m){w(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){J(i.$$.fragment,r),M=!1},d(r){g(i,r)}}}function Cl(_){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=n(),d(m.$$.fragment)},l(o){i=c(o,"P",{"data-svelte-h":!0}),y(i)!=="svelte-11ga8js"&&(i.innerHTML=M),r=s(o),f(m.$$.fragment,o)},m(o,T){a(o,i,T),a(o,r,T),w(m,o,T),p=!0},p:Gt,i(o){p||(h(m.$$.fragment,o),p=!0)},o(o){J(m.$$.fragment,o),p=!1},d(o){o&&(l(i),l(r)),g(m,o)}}}function Xl(_){let i,M;return i=new Rt({props:{$$slots:{default:[Cl]},$$scope:{ctx:_}}}),{c(){d(i.$$.fragment)},l(r){f(i.$$.fragment,r)},m(r,m){w(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){J(i.$$.fragment,r),M=!1},d(r){g(i,r)}}}function Il(_){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=n(),d(m.$$.fragment)},l(o){i=c(o,"P",{"data-svelte-h":!0}),y(i)!=="svelte-1ndgg9f"&&(i.innerHTML=M),r=s(o),f(m.$$.fragment,o)},m(o,T){a(o,i,T),a(o,r,T),w(m,o,T),p=!0},p:Gt,i(o){p||(h(m.$$.fragment,o),p=!0)},o(o){J(m.$$.fragment,o),p=!1},d(o){o&&(l(i),l(r)),g(m,o)}}}function Al(_){let i,M;return i=new Rt({props:{$$slots:{default:[Il]},$$scope:{ctx:_}}}),{c(){d(i.$$.fragment)},l(r){f(i.$$.fragment,r)},m(r,m){w(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){J(i.$$.fragment,r),M=!1},d(r){g(i,r)}}}function Wl(_){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=n(),d(m.$$.fragment)},l(o){i=c(o,"P",{"data-svelte-h":!0}),y(i)!=="svelte-11qd6ng"&&(i.innerHTML=M),r=s(o),f(m.$$.fragment,o)},m(o,T){a(o,i,T),a(o,r,T),w(m,o,T),p=!0},p:Gt,i(o){p||(h(m.$$.fragment,o),p=!0)},o(o){J(m.$$.fragment,o),p=!1},d(o){o&&(l(i),l(r)),g(m,o)}}}function Zl(_){let i,M;return i=new Rt({props:{$$slots:{default:[Wl]},$$scope:{ctx:_}}}),{c(){d(i.$$.fragment)},l(r){f(i.$$.fragment,r)},m(r,m){w(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){J(i.$$.fragment,r),M=!1},d(r){g(i,r)}}}function zl(_){let i,M,r,m,p,o,T,xt='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>.',Ae,C,Bt='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.',We,X,Ft="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.",Ze,I,Yt='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,St='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.',Ge,W,Re,Z,Et="Per eseguire con successo l’ultima versione degli script di esempio, devi <strong>installare 🤗 Transformers dalla fonte</strong> in un nuovo ambiente virtuale:",Le,z,Ne,G,kt="Per le precedenti versioni degli script di esempio, clicca sul pulsante di seguito:",Ve,R,Ht='<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>',xe,L,Qt="Successivamente, cambia la tua attuale copia di 🤗 Transformers specificandone la versione, ad esempio v3.5.1:",Be,N,Fe,V,Pt="Dopo aver configurato correttamente la versione della libreria, naviga nella cartella degli esempi di tua scelta e installa i requisiti:",Ye,x,Se,B,Ee,j,ke,F,He,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à:',Qe,S,Dt="<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>",Pe,E,qe,k,Ot='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:',De,H,Oe,$,Ke,Q,et,P,Kt='🤗 <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:',tt,v,Xe,el="Nota: dato che Accelerate è in rapido sviluppo, è necessario installare la versione proveniente da git per eseguire gli script:",Lt,q,lt,D,tl="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:",at,O,it,K,ll="Testa la tua configurazione per assicurarti della sua correttezza:",rt,ee,nt,te,al="Ora sei pronto per avviare l’addestramento:",st,le,ot,ae,mt,ie,il="Lo script di summarization supporta dataset personalizzati purché siano file CSV o JSON Line. Quando usi il tuo dataset, devi specificare diversi argomenti aggiuntivi:",pt,re,rl="<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>",ut,ne,nl="Uno script di summarization usando un dataset personalizzato sarebbe simile a questo:",ct,se,Mt,oe,dt,me,sl="È 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:",ft,pe,ol="<li><code>max_train_samples</code></li> <li><code>max_eval_samples</code></li> <li><code>max_predict_samples</code></li>",wt,ue,ht,ce,ml="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,gt,de,yt,fe,pl="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:",Tt,we,ul="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>:",Ut,he,_t,Je,cl="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.",bt,ge,jt,ye,$t,Te,Ml='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,Ct,_e,dl="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>.",Xt,be,fl="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.",It,je,wl="Il seguente esempio mostra come caricare un modello specificando il nome del repository:",At,$e,Wt,ve,Zt,Ie,zt;return p=new b({props:{title:"Addestramento con script",local:"addestramento-con-script",headingTag:"h1"}}),W=new b({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 b({props:{title:"Esegui uno script",local:"esegui-uno-script",headingTag:"h2"}}),j=new gl({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Xl],pytorch:[vl]},$$scope:{ctx:_}}}),F=new b({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 b({props:{title:"Esegui uno script su TPU",local:"esegui-uno-script-su-tpu",headingTag:"h2"}}),$=new gl({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Zl],pytorch:[Al]},$$scope:{ctx:_}}}),Q=new b({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 b({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 b({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 b({props:{title:"Riavviare addestramento da un checkpoint",local:"riavviare-addestramento-da-un-checkpoint",headingTag:"h2"}}),he=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 b({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}}),$e=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}}),ve=new jl({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/it/run_scripts.md"}}),{c(){i=u("meta"),M=n(),r=u("p"),m=n(),d(p.$$.fragment),o=n(),T=u("p"),T.innerHTML=xt,Ae=n(),C=u("p"),C.innerHTML=Bt,We=n(),X=u("p"),X.textContent=Ft,Ze=n(),I=u("p"),I.innerHTML=Yt,ze=n(),A=u("p"),A.innerHTML=St,Ge=n(),d(W.$$.fragment),Re=n(),Z=u("p"),Z.innerHTML=Et,Le=n(),d(z.$$.fragment),Ne=n(),G=u("p"),G.textContent=kt,Ve=n(),R=u("details"),R.innerHTML=Ht,xe=n(),L=u("p"),L.textContent=Qt,Be=n(),d(N.$$.fragment),Fe=n(),V=u("p"),V.textContent=Pt,Ye=n(),d(x.$$.fragment),Se=n(),d(B.$$.fragment),Ee=n(),d(j.$$.fragment),ke=n(),d(F.$$.fragment),He=n(),Y=u("p"),Y.innerHTML=qt,Qe=n(),S=u("ul"),S.innerHTML=Dt,Pe=n(),d(E.$$.fragment),qe=n(),k=u("p"),k.innerHTML=Ot,De=n(),d(H.$$.fragment),Oe=n(),d($.$$.fragment),Ke=n(),d(Q.$$.fragment),et=n(),P=u("p"),P.innerHTML=Kt,tt=n(),v=u("blockquote"),Xe=u("p"),Xe.textContent=el,Lt=n(),d(q.$$.fragment),lt=n(),D=u("p"),D.innerHTML=tl,at=n(),d(O.$$.fragment),it=n(),K=u("p"),K.textContent=ll,rt=n(),d(ee.$$.fragment),nt=n(),te=u("p"),te.textContent=al,st=n(),d(le.$$.fragment),ot=n(),d(ae.$$.fragment),mt=n(),ie=u("p"),ie.textContent=il,pt=n(),re=u("ul"),re.innerHTML=rl,ut=n(),ne=u("p"),ne.textContent=nl,ct=n(),d(se.$$.fragment),Mt=n(),d(oe.$$.fragment),dt=n(),me=u("p"),me.textContent=sl,ft=n(),pe=u("ul"),pe.innerHTML=ol,wt=n(),d(ue.$$.fragment),ht=n(),ce=u("p"),ce.innerHTML=ml,Jt=n(),d(Me.$$.fragment),gt=n(),d(de.$$.fragment),yt=n(),fe=u("p"),fe.textContent=pl,Tt=n(),we=u("p"),we.innerHTML=ul,Ut=n(),d(he.$$.fragment),_t=n(),Je=u("p"),Je.innerHTML=cl,bt=n(),d(ge.$$.fragment),jt=n(),d(ye.$$.fragment),$t=n(),Te=u("p"),Te.innerHTML=Ml,vt=n(),d(Ue.$$.fragment),Ct=n(),_e=u("p"),_e.innerHTML=dl,Xt=n(),be=u("p"),be.innerHTML=fl,It=n(),je=u("p"),je.textContent=wl,At=n(),d($e.$$.fragment),Wt=n(),d(ve.$$.fragment),Zt=n(),Ie=u("p"),this.h()},l(e){const t=bl("svelte-u9bgzb",document.head);i=c(t,"META",{name:!0,content:!0}),t.forEach(l),M=s(e),r=c(e,"P",{}),Nt(r).forEach(l),m=s(e),f(p.$$.fragment,e),o=s(e),T=c(e,"P",{"data-svelte-h":!0}),y(T)!=="svelte-dlbwfe"&&(T.innerHTML=xt),Ae=s(e),C=c(e,"P",{"data-svelte-h":!0}),y(C)!=="svelte-p3vgrn"&&(C.innerHTML=Bt),We=s(e),X=c(e,"P",{"data-svelte-h":!0}),y(X)!=="svelte-3iprul"&&(X.textContent=Ft),Ze=s(e),I=c(e,"P",{"data-svelte-h":!0}),y(I)!=="svelte-skpcg4"&&(I.innerHTML=Yt),ze=s(e),A=c(e,"P",{"data-svelte-h":!0}),y(A)!=="svelte-1dty626"&&(A.innerHTML=St),Ge=s(e),f(W.$$.fragment,e),Re=s(e),Z=c(e,"P",{"data-svelte-h":!0}),y(Z)!=="svelte-1miqfm2"&&(Z.innerHTML=Et),Le=s(e),f(z.$$.fragment,e),Ne=s(e),G=c(e,"P",{"data-svelte-h":!0}),y(G)!=="svelte-b2rskv"&&(G.textContent=kt),Ve=s(e),R=c(e,"DETAILS",{"data-svelte-h":!0}),y(R)!=="svelte-ytnfkk"&&(R.innerHTML=Ht),xe=s(e),L=c(e,"P",{"data-svelte-h":!0}),y(L)!=="svelte-cm69sz"&&(L.textContent=Qt),Be=s(e),f(N.$$.fragment,e),Fe=s(e),V=c(e,"P",{"data-svelte-h":!0}),y(V)!=="svelte-2jautu"&&(V.textContent=Pt),Ye=s(e),f(x.$$.fragment,e),Se=s(e),f(B.$$.fragment,e),Ee=s(e),f(j.$$.fragment,e),ke=s(e),f(F.$$.fragment,e),He=s(e),Y=c(e,"P",{"data-svelte-h":!0}),y(Y)!=="svelte-143nmbm"&&(Y.innerHTML=qt),Qe=s(e),S=c(e,"UL",{"data-svelte-h":!0}),y(S)!=="svelte-1ld4sku"&&(S.innerHTML=Dt),Pe=s(e),f(E.$$.fragment,e),qe=s(e),k=c(e,"P",{"data-svelte-h":!0}),y(k)!=="svelte-3o4ent"&&(k.innerHTML=Ot),De=s(e),f(H.$$.fragment,e),Oe=s(e),f($.$$.fragment,e),Ke=s(e),f(Q.$$.fragment,e),et=s(e),P=c(e,"P",{"data-svelte-h":!0}),y(P)!=="svelte-10zit0a"&&(P.innerHTML=Kt),tt=s(e),v=c(e,"BLOCKQUOTE",{});var Ce=Nt(v);Xe=c(Ce,"P",{"data-svelte-h":!0}),y(Xe)!=="svelte-1ehqze5"&&(Xe.textContent=el),Lt=s(Ce),f(q.$$.fragment,Ce),Ce.forEach(l),lt=s(e),D=c(e,"P",{"data-svelte-h":!0}),y(D)!=="svelte-1b94v6a"&&(D.innerHTML=tl),at=s(e),f(O.$$.fragment,e),it=s(e),K=c(e,"P",{"data-svelte-h":!0}),y(K)!=="svelte-13dqlnm"&&(K.textContent=ll),rt=s(e),f(ee.$$.fragment,e),nt=s(e),te=c(e,"P",{"data-svelte-h":!0}),y(te)!=="svelte-azupwy"&&(te.textContent=al),st=s(e),f(le.$$.fragment,e),ot=s(e),f(ae.$$.fragment,e),mt=s(e),ie=c(e,"P",{"data-svelte-h":!0}),y(ie)!=="svelte-3m0es0"&&(ie.textContent=il),pt=s(e),re=c(e,"UL",{"data-svelte-h":!0}),y(re)!=="svelte-1msqo4o"&&(re.innerHTML=rl),ut=s(e),ne=c(e,"P",{"data-svelte-h":!0}),y(ne)!=="svelte-1cj93yk"&&(ne.textContent=nl),ct=s(e),f(se.$$.fragment,e),Mt=s(e),f(oe.$$.fragment,e),dt=s(e),me=c(e,"P",{"data-svelte-h":!0}),y(me)!=="svelte-1sqi69s"&&(me.textContent=sl),ft=s(e),pe=c(e,"UL",{"data-svelte-h":!0}),y(pe)!=="svelte-14g5f8g"&&(pe.innerHTML=ol),wt=s(e),f(ue.$$.fragment,e),ht=s(e),ce=c(e,"P",{"data-svelte-h":!0}),y(ce)!=="svelte-lpiiy4"&&(ce.innerHTML=ml),Jt=s(e),f(Me.$$.fragment,e),gt=s(e),f(de.$$.fragment,e),yt=s(e),fe=c(e,"P",{"data-svelte-h":!0}),y(fe)!=="svelte-1ojfq0o"&&(fe.textContent=pl),Tt=s(e),we=c(e,"P",{"data-svelte-h":!0}),y(we)!=="svelte-er6rqd"&&(we.innerHTML=ul),Ut=s(e),f(he.$$.fragment,e),_t=s(e),Je=c(e,"P",{"data-svelte-h":!0}),y(Je)!=="svelte-vzkarm"&&(Je.innerHTML=cl),bt=s(e),f(ge.$$.fragment,e),jt=s(e),f(ye.$$.fragment,e),$t=s(e),Te=c(e,"P",{"data-svelte-h":!0}),y(Te)!=="svelte-5tj2pz"&&(Te.innerHTML=Ml),vt=s(e),f(Ue.$$.fragment,e),Ct=s(e),_e=c(e,"P",{"data-svelte-h":!0}),y(_e)!=="svelte-gmt2gy"&&(_e.innerHTML=dl),Xt=s(e),be=c(e,"P",{"data-svelte-h":!0}),y(be)!=="svelte-3hq370"&&(be.innerHTML=fl),It=s(e),je=c(e,"P",{"data-svelte-h":!0}),y(je)!=="svelte-1doeu81"&&(je.textContent=wl),At=s(e),f($e.$$.fragment,e),Wt=s(e),f(ve.$$.fragment,e),Zt=s(e),Ie=c(e,"P",{}),Nt(Ie).forEach(l),this.h()},h(){Jl(i,"name","hf:doc:metadata"),Jl(i,"content",Gl)},m(e,t){Vt(document.head,i),a(e,M,t),a(e,r,t),a(e,m,t),w(p,e,t),a(e,o,t),a(e,T,t),a(e,Ae,t),a(e,C,t),a(e,We,t),a(e,X,t),a(e,Ze,t),a(e,I,t),a(e,ze,t),a(e,A,t),a(e,Ge,t),w(W,e,t),a(e,Re,t),a(e,Z,t),a(e,Le,t),w(z,e,t),a(e,Ne,t),a(e,G,t),a(e,Ve,t),a(e,R,t),a(e,xe,t),a(e,L,t),a(e,Be,t),w(N,e,t),a(e,Fe,t),a(e,V,t),a(e,Ye,t),w(x,e,t),a(e,Se,t),w(B,e,t),a(e,Ee,t),w(j,e,t),a(e,ke,t),w(F,e,t),a(e,He,t),a(e,Y,t),a(e,Qe,t),a(e,S,t),a(e,Pe,t),w(E,e,t),a(e,qe,t),a(e,k,t),a(e,De,t),w(H,e,t),a(e,Oe,t),w($,e,t),a(e,Ke,t),w(Q,e,t),a(e,et,t),a(e,P,t),a(e,tt,t),a(e,v,t),Vt(v,Xe),Vt(v,Lt),w(q,v,null),a(e,lt,t),a(e,D,t),a(e,at,t),w(O,e,t),a(e,it,t),a(e,K,t),a(e,rt,t),w(ee,e,t),a(e,nt,t),a(e,te,t),a(e,st,t),w(le,e,t),a(e,ot,t),w(ae,e,t),a(e,mt,t),a(e,ie,t),a(e,pt,t),a(e,re,t),a(e,ut,t),a(e,ne,t),a(e,ct,t),w(se,e,t),a(e,Mt,t),w(oe,e,t),a(e,dt,t),a(e,me,t),a(e,ft,t),a(e,pe,t),a(e,wt,t),w(ue,e,t),a(e,ht,t),a(e,ce,t),a(e,Jt,t),w(Me,e,t),a(e,gt,t),w(de,e,t),a(e,yt,t),a(e,fe,t),a(e,Tt,t),a(e,we,t),a(e,Ut,t),w(he,e,t),a(e,_t,t),a(e,Je,t),a(e,bt,t),w(ge,e,t),a(e,jt,t),w(ye,e,t),a(e,$t,t),a(e,Te,t),a(e,vt,t),w(Ue,e,t),a(e,Ct,t),a(e,_e,t),a(e,Xt,t),a(e,be,t),a(e,It,t),a(e,je,t),a(e,At,t),w($e,e,t),a(e,Wt,t),w(ve,e,t),a(e,Zt,t),a(e,Ie,t),zt=!0},p(e,[t]){const Ce={};t&2&&(Ce.$$scope={dirty:t,ctx:e}),j.$set(Ce);const hl={};t&2&&(hl.$$scope={dirty:t,ctx:e}),$.$set(hl)},i(e){zt||(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(j.$$.fragment,e),h(F.$$.fragment,e),h(E.$$.fragment,e),h(H.$$.fragment,e),h($.$$.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(he.$$.fragment,e),h(ge.$$.fragment,e),h(ye.$$.fragment,e),h(Ue.$$.fragment,e),h($e.$$.fragment,e),h(ve.$$.fragment,e),zt=!0)},o(e){J(p.$$.fragment,e),J(W.$$.fragment,e),J(z.$$.fragment,e),J(N.$$.fragment,e),J(x.$$.fragment,e),J(B.$$.fragment,e),J(j.$$.fragment,e),J(F.$$.fragment,e),J(E.$$.fragment,e),J(H.$$.fragment,e),J($.$$.fragment,e),J(Q.$$.fragment,e),J(q.$$.fragment,e),J(O.$$.fragment,e),J(ee.$$.fragment,e),J(le.$$.fragment,e),J(ae.$$.fragment,e),J(se.$$.fragment,e),J(oe.$$.fragment,e),J(ue.$$.fragment,e),J(Me.$$.fragment,e),J(de.$$.fragment,e),J(he.$$.fragment,e),J(ge.$$.fragment,e),J(ye.$$.fragment,e),J(Ue.$$.fragment,e),J($e.$$.fragment,e),J(ve.$$.fragment,e),zt=!1},d(e){e&&(l(M),l(r),l(m),l(o),l(T),l(Ae),l(C),l(We),l(X),l(Ze),l(I),l(ze),l(A),l(Ge),l(Re),l(Z),l(Le),l(Ne),l(G),l(Ve),l(R),l(xe),l(L),l(Be),l(Fe),l(V),l(Ye),l(Se),l(Ee),l(ke),l(He),l(Y),l(Qe),l(S),l(Pe),l(qe),l(k),l(De),l(Oe),l(Ke),l(et),l(P),l(tt),l(v),l(lt),l(D),l(at),l(it),l(K),l(rt),l(nt),l(te),l(st),l(ot),l(mt),l(ie),l(pt),l(re),l(ut),l(ne),l(ct),l(Mt),l(dt),l(me),l(ft),l(pe),l(wt),l(ht),l(ce),l(Jt),l(gt),l(yt),l(fe),l(Tt),l(we),l(Ut),l(_t),l(Je),l(bt),l(jt),l($t),l(Te),l(vt),l(Ct),l(_e),l(Xt),l(be),l(It),l(je),l(At),l(Wt),l(Zt),l(Ie)),l(i),g(p,e),g(W,e),g(z,e),g(N,e),g(x,e),g(B,e),g(j,e),g(F,e),g(E,e),g(H,e),g($,e),g(Q,e),g(q),g(O,e),g(ee,e),g(le,e),g(ae,e),g(se,e),g(oe,e),g(ue,e),g(Me,e),g(de,e),g(he,e),g(ge,e),g(ye,e),g(Ue,e),g($e,e),g(ve,e)}}}const Gl='{"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 Rl(_){return Tl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Fl extends Ul{constructor(i){super(),_l(this,i,Rl,zl,yl,{})}}export{Fl as component};
