import{s as Tl,o as hl,n as xt}from"../chunks/scheduler.d586627e.js";import{S as yl,i as Ul,g as u,s,r as M,A as gl,h as c,f as l,c as i,j as fl,u as f,x as y,k as wl,y as _l,a,v as w,d as J,t as T,w as h}from"../chunks/index.8589a59c.js";import{C as g}from"../chunks/CodeBlock.47c46d2c.js";import{F as Jl,M as Gt}from"../chunks/Markdown.67fc2fa9.js";import{H as j,E as jl}from"../chunks/EditOnGithub.073dfa26.js";function bl(_){let o,d='O script de exemplo baixa e pré-processa um conjunto de dados da biblioteca 🤗 <a href="https://huggingface.co/docs/datasets/" rel="nofollow">Datasets</a>. Em seguida, o script ajusta um conjunto de dados com o <a href="https://huggingface.co/docs/transformers/main_classes/trainer" rel="nofollow">Trainer</a> em uma arquitetura que oferece suporte à sumarização. O exemplo a seguir mostra como ajustar <a href="https://huggingface.co/google-t5/t5-small" rel="nofollow">T5-small</a> no conjunto de dados <a href="https://huggingface.co/datasets/cnn_dailymail" rel="nofollow">CNN/DailyMail</a>. O modelo T5 requer um argumento <code>source_prefix</code> adicional devido à forma como foi treinado. Este prompt informa ao T5 que esta é uma tarefa de sumarização.',r,m,p;return m=new g({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(){o=u("p"),o.innerHTML=d,r=s(),M(m.$$.fragment)},l(n){o=c(n,"P",{"data-svelte-h":!0}),y(o)!=="svelte-q9th7l"&&(o.innerHTML=d),r=i(n),f(m.$$.fragment,n)},m(n,U){a(n,o,U),a(n,r,U),w(m,n,U),p=!0},p:xt,i(n){p||(J(m.$$.fragment,n),p=!0)},o(n){T(m.$$.fragment,n),p=!1},d(n){n&&(l(o),l(r)),h(m,n)}}}function $l(_){let o,d;return o=new Gt({props:{$$slots:{default:[bl]},$$scope:{ctx:_}}}),{c(){M(o.$$.fragment)},l(r){f(o.$$.fragment,r)},m(r,m){w(o,r,m),d=!0},p(r,m){const p={};m&2&&(p.$$scope={dirty:m,ctx:r}),o.$set(p)},i(r){d||(J(o.$$.fragment,r),d=!0)},o(r){T(o.$$.fragment,r),d=!1},d(r){h(o,r)}}}function Cl(_){let o,d='Este outro script de exemplo baixa e pré-processa um conjunto de dados da biblioteca 🤗 <a href="https://huggingface.co/docs/datasets/" rel="nofollow">Datasets</a>. Em seguida, o script ajusta um conjunto de dados usando Keras em uma arquitetura que oferece suporte à sumarização. O exemplo a seguir mostra como ajustar <a href="https://huggingface.co/google-t5/t5-small" rel="nofollow">T5-small</a> no conjunto de dados <a href="https://huggingface.co/datasets/cnn_dailymail" rel="nofollow">CNN/DailyMail</a>. O modelo T5 requer um argumento <code>source_prefix</code> adicional devido à forma como foi treinado. Este prompt informa ao T5 que esta é uma tarefa de sumarização.',r,m,p;return m=new g({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(){o=u("p"),o.innerHTML=d,r=s(),M(m.$$.fragment)},l(n){o=c(n,"P",{"data-svelte-h":!0}),y(o)!=="svelte-16hxpjr"&&(o.innerHTML=d),r=i(n),f(m.$$.fragment,n)},m(n,U){a(n,o,U),a(n,r,U),w(m,n,U),p=!0},p:xt,i(n){p||(J(m.$$.fragment,n),p=!0)},o(n){T(m.$$.fragment,n),p=!1},d(n){n&&(l(o),l(r)),h(m,n)}}}function vl(_){let o,d;return o=new Gt({props:{$$slots:{default:[Cl]},$$scope:{ctx:_}}}),{c(){M(o.$$.fragment)},l(r){f(o.$$.fragment,r)},m(r,m){w(o,r,m),d=!0},p(r,m){const p={};m&2&&(p.$$scope={dirty:m,ctx:r}),o.$set(p)},i(r){d||(J(o.$$.fragment,r),d=!0)},o(r){T(o.$$.fragment,r),d=!1},d(r){h(o,r)}}}function Xl(_){let o,d='As Unidades de Processamento de Tensor (TPUs) são projetadas especificamente para acelerar o desempenho. O PyTorch oferece suporte a TPUs com o compilador de aprendizado profundo <a href="https://www.tensorflow.org/xla" rel="nofollow">XLA</a> (consulte <a href="https://github.com/pytorch/xla/blob/master/README.md" rel="nofollow">aqui</a> para mais detalhes). Para usar uma TPU, inicie o script <code>xla_spawn.py</code> e use o argumento <code>num_cores</code> para definir o número de núcleos de TPU que você deseja usar.',r,m,p;return m=new g({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(){o=u("p"),o.innerHTML=d,r=s(),M(m.$$.fragment)},l(n){o=c(n,"P",{"data-svelte-h":!0}),y(o)!=="svelte-1b34dtk"&&(o.innerHTML=d),r=i(n),f(m.$$.fragment,n)},m(n,U){a(n,o,U),a(n,r,U),w(m,n,U),p=!0},p:xt,i(n){p||(J(m.$$.fragment,n),p=!0)},o(n){T(m.$$.fragment,n),p=!1},d(n){n&&(l(o),l(r)),h(m,n)}}}function Al(_){let o,d;return o=new Gt({props:{$$slots:{default:[Xl]},$$scope:{ctx:_}}}),{c(){M(o.$$.fragment)},l(r){f(o.$$.fragment,r)},m(r,m){w(o,r,m),d=!0},p(r,m){const p={};m&2&&(p.$$scope={dirty:m,ctx:r}),o.$set(p)},i(r){d||(J(o.$$.fragment,r),d=!0)},o(r){T(o.$$.fragment,r),d=!1},d(r){h(o,r)}}}function Il(_){let o,d='As Unidades de Processamento de Tensor (TPUs) são projetadas especificamente para acelerar o desempenho. Os scripts do TensorFlow utilizam uma <a href="https://www.tensorflow.org/guide/distributed_training#tpustrategy" rel="nofollow"><code>TPUStrategy</code></a> para treinamento em TPUs. Para usar uma TPU, passe o nome do recurso TPU para o argumento <code>tpu</code>.',r,m,p;return m=new g({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(){o=u("p"),o.innerHTML=d,r=s(),M(m.$$.fragment)},l(n){o=c(n,"P",{"data-svelte-h":!0}),y(o)!=="svelte-1w2p7mg"&&(o.innerHTML=d),r=i(n),f(m.$$.fragment,n)},m(n,U){a(n,o,U),a(n,r,U),w(m,n,U),p=!0},p:xt,i(n){p||(J(m.$$.fragment,n),p=!0)},o(n){T(m.$$.fragment,n),p=!1},d(n){n&&(l(o),l(r)),h(m,n)}}}function Wl(_){let o,d;return o=new Gt({props:{$$slots:{default:[Il]},$$scope:{ctx:_}}}),{c(){M(o.$$.fragment)},l(r){f(o.$$.fragment,r)},m(r,m){w(o,r,m),d=!0},p(r,m){const p={};m&2&&(p.$$scope={dirty:m,ctx:r}),o.$set(p)},i(r){d||(J(o.$$.fragment,r),d=!0)},o(r){T(o.$$.fragment,r),d=!1},d(r){h(o,r)}}}function Zl(_){let o,d,r,m,p,n,U,Rt='Junto com os 🤗 Transformers <a href="./notebooks">notebooks</a>, também há scripts de exemplo demonstrando como treinar um modelo para uma tarefa com <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> ou <a href="https://github.com/huggingface/transformers/tree/main/examples/flax" rel="nofollow">JAX/Flax</a>.',Xe,C,zt='Você também encontrará scripts que usamos em nossos <a href="https://github.com/huggingface/transformers/tree/main/examples/research_projects" rel="nofollow">projetos de pesquisa</a> e <a href="https://github.com/huggingface/transformers/tree/main/examples/legacy" rel="nofollow">exemplos legados</a> que são principalmente contribuições da comunidade. Esses scripts não são mantidos ativamente e exigem uma versão específica de 🤗 Transformers que provavelmente será incompatível com a versão mais recente da biblioteca.',Ae,v,Lt="Não se espera que os scripts de exemplo funcionem imediatamente em todos os problemas, você pode precisar adaptar o script ao problema que está tentando resolver. Para ajudá-lo com isso, a maioria dos scripts expõe totalmente como os dados são pré-processados, permitindo que você os edite conforme necessário para seu caso de uso.",Ie,X,Nt='Para qualquer recurso que você gostaria de implementar em um script de exemplo, discuta-o no <a href="https://discuss.huggingface.co/" rel="nofollow">fórum</a> ou em uma <a href="https://github.com/huggingface/transformers/issues" rel="nofollow">issue</a> antes de enviar um Pull Request. Embora recebamos correções de bugs, é improvável que mesclaremos um Pull Request que adicione mais funcionalidades ao custo de legibilidade.',We,A,Vt='Este guia mostrará como executar um exemplo de script de treinamento de sumarização em <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>. Espera-se que todos os exemplos funcionem com ambas as estruturas, a menos que especificado de outra forma.',Ze,I,xe,W,Bt="Para executar com êxito a versão mais recente dos scripts de exemplo, você precisa <strong>instalar o 🤗 Transformers da fonte</strong> em um novo ambiente virtual:",Ge,Z,Re,x,Ft="Para versões mais antigas dos scripts de exemplo, clique no botão abaixo:",ze,G,Yt='<summary>Exemplos para versões antigas dos 🤗 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>',Le,R,Et="Em seguida, mude seu clone atual dos 🤗 Transformers para uma versão específica, como v3.5.1, por exemplo:",Ne,z,Ve,L,St="Depois de configurar a versão correta da biblioteca, navegue até a pasta de exemplo de sua escolha e instale os requisitos específicos do exemplo:",Be,N,Fe,V,Ye,b,Ee,B,Se,F,Ht='O <a href="https://huggingface.co/docs/transformers/main_classes/trainer" rel="nofollow">Trainer</a> oferece suporte a treinamento distribuído e precisão mista, o que significa que você também pode usá-lo em um script. Para habilitar esses dois recursos:',He,Y,kt="<li>Adicione o argumento <code>fp16</code> para habilitar a precisão mista.</li> <li>Defina o número de GPUs a serem usadas com o argumento <code>nproc_per_node</code>.</li>",ke,E,Qe,S,Qt='Os scripts do TensorFlow utilizam um <a href="https://www.tensorflow.org/guide/distributed_training#mirroredstrategy" rel="nofollow"><code>MirroredStrategy</code></a> para treinamento distribuído, e você não precisa adicionar argumentos adicionais ao script de treinamento. O script do TensorFlow usará várias GPUs por padrão, se estiverem disponíveis.',qe,H,Pe,$,De,k,Oe,Q,qt='🤗 <a href="https://huggingface.co/docs/accelerate" rel="nofollow">Accelerate</a> é uma biblioteca somente do PyTorch que oferece um método unificado para treinar um modelo em vários tipos de configurações (CPU, multiplas GPUs, TPUs), mantendo visibilidade no loop de treinamento do PyTorch. Certifique-se de ter o 🤗 Accelerate instalado se ainda não o tiver:',Ke,q,Pt="<p>Nota: Como o Accelerate está se desenvolvendo rapidamente, a versão git do Accelerate deve ser instalada para executar os scripts</p>",et,P,tt,D,Dt="Em vez do script <code>run_summarization.py</code>, você precisa usar o script <code>run_summarization_no_trainer.py</code>. Os scripts suportados pelo 🤗 Accelerate terão um arquivo <code>task_no_trainer.py</code> na pasta. Comece executando o seguinte comando para criar e salvar um arquivo de configuração:",lt,O,at,K,Ot="Teste sua configuração para garantir que ela esteja corretamente configurada :",ot,ee,rt,te,Kt="Agora você está pronto para iniciar o treinamento:",st,le,it,ae,nt,oe,el="O script de resumo oferece suporte a conjuntos de dados personalizados, desde que sejam um arquivo CSV ou JSON. Ao usar seu próprio conjunto de dados, você precisa especificar vários argumentos adicionais:",mt,re,tl="<li><code>train_file</code> e <code>validation_file</code> especificam o caminho para seus arquivos de treinamento e validação respectivamente.</li> <li><code>text_column</code> é o texto de entrada para sumarização.</li> <li><code>summary_column</code> é o texto de destino para saída.</li>",pt,se,ll="Um script para sumarização usando um conjunto de dados customizado ficaria assim:",ut,ie,ct,ne,dt,me,al="Geralmente, é uma boa ideia executar seu script em um número menor de exemplos de conjuntos de dados para garantir que tudo funcione conforme o esperado antes de se comprometer com um conjunto de dados inteiro, que pode levar horas para ser concluído. Use os seguintes argumentos para truncar o conjunto de dados para um número máximo de amostras:",Mt,pe,ol="<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,rl="Nem todos os scripts de exemplo suportam o argumento <code>max_predict_samples</code>. Se você não tiver certeza se seu script suporta este argumento, adicione o argumento <code>-h</code> para verificar:",Jt,de,Tt,Me,ht,fe,sl="Outra opção útil para habilitar é retomar o treinamento de um checkpoint anterior. Isso garantirá que você possa continuar de onde parou sem recomeçar se o seu treinamento for interrompido. Existem dois métodos para retomar o treinamento a partir de um checkpoint.",yt,we,il="O primeiro método usa o argumento <code>output_dir previous_output_dir</code> para retomar o treinamento do último checkpoint armazenado em <code>output_dir</code>. Neste caso, você deve remover <code>overwrite_output_dir</code>:",Ut,Je,gt,Te,nl="O segundo método usa o argumento <code>resume_from_checkpoint path_to_specific_checkpoint</code> para retomar o treinamento de uma pasta de checkpoint específica.",_t,he,jt,ye,bt,Ue,ml='Todos os scripts podem enviar seu modelo final para o <a href="https://huggingface.co/models" rel="nofollow">Model Hub</a>. Certifique-se de estar conectado ao Hugging Face antes de começar:',$t,ge,Ct,_e,pl="Em seguida, adicione o argumento <code>push_to_hub</code> ao script. Este argumento criará um repositório com seu nome de usuário do Hugging Face e o nome da pasta especificado em <code>output_dir</code>.",vt,je,ul="Para dar um nome específico ao seu repositório, use o argumento <code>push_to_hub_model_id</code> para adicioná-lo. O repositório será listado automaticamente em seu namespace.",Xt,be,cl="O exemplo a seguir mostra como fazer upload de um modelo com um nome de repositório específico:",At,$e,It,Ce,Wt,ve,Zt;return p=new j({props:{title:"Treinamento a partir de um script",local:"treinamento-a-partir-de-um-script",headingTag:"h1"}}),I=new j({props:{title:"Configuração",local:"configuração",headingTag:"h2"}}),Z=new g({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}}),z=new g({props:{code:"Z2l0JTIwY2hlY2tvdXQlMjB0YWdzJTJGdjMuNS4x",highlighted:"git checkout tags/v3.5.1",wrap:!1}}),N=new g({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1yJTIwcmVxdWlyZW1lbnRzLnR4dA==",highlighted:"pip install -r requirements.txt",wrap:!1}}),V=new j({props:{title:"Executando um script",local:"executando-um-script",headingTag:"h2"}}),b=new Jl({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[vl],pytorch:[$l]},$$scope:{ctx:_}}}),B=new j({props:{title:"Treinamento distribuído e precisão mista",local:"treinamento-distribuído-e-precisão-mista",headingTag:"h2"}}),E=new g({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:"Executando um script em uma TPU",local:"executando-um-script-em-uma-tpu",headingTag:"h2"}}),$=new Jl({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Wl],pytorch:[Al]},$$scope:{ctx:_}}}),k=new j({props:{title:"Execute um script com 🤗 Accelerate",local:"execute-um-script-com--accelerate",headingTag:"h2"}}),P=new g({props:{code:"cGlwJTIwaW5zdGFsbCUyMGdpdCUyQmh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmh1Z2dpbmdmYWNlJTJGYWNjZWxlcmF0ZQ==",highlighted:"pip install git+https://github.com/huggingface/accelerate",wrap:!1}}),O=new g({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZw==",highlighted:"accelerate config",wrap:!1}}),ee=new g({props:{code:"YWNjZWxlcmF0ZSUyMHRlc3Q=",highlighted:'accelerate <span class="hljs-built_in">test</span>',wrap:!1}}),le=new g({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:"Usando um conjunto de dados personalizado",local:"usando-um-conjunto-de-dados-personalizado",headingTag:"h2"}}),ie=new g({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}}),ne=new j({props:{title:"Testando um script",local:"testando-um-script",headingTag:"h2"}}),ue=new g({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}}),de=new g({props:{code:"ZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTIwLWg=",highlighted:"examples/pytorch/summarization/run_summarization.py -h",wrap:!1}}),Me=new j({props:{title:"Retomar o treinamento a partir de um checkpoint",local:"retomar-o-treinamento-a-partir-de-um-checkpoint",headingTag:"h2"}}),Je=new g({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}}),he=new g({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:"Compartilhando seu modelo",local:"compartilhando-seu-modelo",headingTag:"h2"}}),ge=new g({props:{code:"aHVnZ2luZ2ZhY2UtY2xpJTIwbG9naW4=",highlighted:"huggingface-cli login",wrap:!1}}),$e=new g({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}}),Ce=new jl({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/pt/run_scripts.md"}}),{c(){o=u("meta"),d=s(),r=u("p"),m=s(),M(p.$$.fragment),n=s(),U=u("p"),U.innerHTML=Rt,Xe=s(),C=u("p"),C.innerHTML=zt,Ae=s(),v=u("p"),v.textContent=Lt,Ie=s(),X=u("p"),X.innerHTML=Nt,We=s(),A=u("p"),A.innerHTML=Vt,Ze=s(),M(I.$$.fragment),xe=s(),W=u("p"),W.innerHTML=Bt,Ge=s(),M(Z.$$.fragment),Re=s(),x=u("p"),x.textContent=Ft,ze=s(),G=u("details"),G.innerHTML=Yt,Le=s(),R=u("p"),R.textContent=Et,Ne=s(),M(z.$$.fragment),Ve=s(),L=u("p"),L.textContent=St,Be=s(),M(N.$$.fragment),Fe=s(),M(V.$$.fragment),Ye=s(),M(b.$$.fragment),Ee=s(),M(B.$$.fragment),Se=s(),F=u("p"),F.innerHTML=Ht,He=s(),Y=u("ul"),Y.innerHTML=kt,ke=s(),M(E.$$.fragment),Qe=s(),S=u("p"),S.innerHTML=Qt,qe=s(),M(H.$$.fragment),Pe=s(),M($.$$.fragment),De=s(),M(k.$$.fragment),Oe=s(),Q=u("p"),Q.innerHTML=qt,Ke=s(),q=u("blockquote"),q.innerHTML=Pt,et=s(),M(P.$$.fragment),tt=s(),D=u("p"),D.innerHTML=Dt,lt=s(),M(O.$$.fragment),at=s(),K=u("p"),K.textContent=Ot,ot=s(),M(ee.$$.fragment),rt=s(),te=u("p"),te.textContent=Kt,st=s(),M(le.$$.fragment),it=s(),M(ae.$$.fragment),nt=s(),oe=u("p"),oe.textContent=el,mt=s(),re=u("ul"),re.innerHTML=tl,pt=s(),se=u("p"),se.textContent=ll,ut=s(),M(ie.$$.fragment),ct=s(),M(ne.$$.fragment),dt=s(),me=u("p"),me.textContent=al,Mt=s(),pe=u("ul"),pe.innerHTML=ol,ft=s(),M(ue.$$.fragment),wt=s(),ce=u("p"),ce.innerHTML=rl,Jt=s(),M(de.$$.fragment),Tt=s(),M(Me.$$.fragment),ht=s(),fe=u("p"),fe.textContent=sl,yt=s(),we=u("p"),we.innerHTML=il,Ut=s(),M(Je.$$.fragment),gt=s(),Te=u("p"),Te.innerHTML=nl,_t=s(),M(he.$$.fragment),jt=s(),M(ye.$$.fragment),bt=s(),Ue=u("p"),Ue.innerHTML=ml,$t=s(),M(ge.$$.fragment),Ct=s(),_e=u("p"),_e.innerHTML=pl,vt=s(),je=u("p"),je.innerHTML=ul,Xt=s(),be=u("p"),be.textContent=cl,At=s(),M($e.$$.fragment),It=s(),M(Ce.$$.fragment),Wt=s(),ve=u("p"),this.h()},l(e){const t=gl("svelte-u9bgzb",document.head);o=c(t,"META",{name:!0,content:!0}),t.forEach(l),d=i(e),r=c(e,"P",{}),fl(r).forEach(l),m=i(e),f(p.$$.fragment,e),n=i(e),U=c(e,"P",{"data-svelte-h":!0}),y(U)!=="svelte-46qbsw"&&(U.innerHTML=Rt),Xe=i(e),C=c(e,"P",{"data-svelte-h":!0}),y(C)!=="svelte-193tgo3"&&(C.innerHTML=zt),Ae=i(e),v=c(e,"P",{"data-svelte-h":!0}),y(v)!=="svelte-8z8nq0"&&(v.textContent=Lt),Ie=i(e),X=c(e,"P",{"data-svelte-h":!0}),y(X)!=="svelte-w3fb29"&&(X.innerHTML=Nt),We=i(e),A=c(e,"P",{"data-svelte-h":!0}),y(A)!=="svelte-tmubfg"&&(A.innerHTML=Vt),Ze=i(e),f(I.$$.fragment,e),xe=i(e),W=c(e,"P",{"data-svelte-h":!0}),y(W)!=="svelte-c4dhuj"&&(W.innerHTML=Bt),Ge=i(e),f(Z.$$.fragment,e),Re=i(e),x=c(e,"P",{"data-svelte-h":!0}),y(x)!=="svelte-4fhjsu"&&(x.textContent=Ft),ze=i(e),G=c(e,"DETAILS",{"data-svelte-h":!0}),y(G)!=="svelte-1c3acog"&&(G.innerHTML=Yt),Le=i(e),R=c(e,"P",{"data-svelte-h":!0}),y(R)!=="svelte-v80c9w"&&(R.textContent=Et),Ne=i(e),f(z.$$.fragment,e),Ve=i(e),L=c(e,"P",{"data-svelte-h":!0}),y(L)!=="svelte-1w5msn7"&&(L.textContent=St),Be=i(e),f(N.$$.fragment,e),Fe=i(e),f(V.$$.fragment,e),Ye=i(e),f(b.$$.fragment,e),Ee=i(e),f(B.$$.fragment,e),Se=i(e),F=c(e,"P",{"data-svelte-h":!0}),y(F)!=="svelte-1vdz8vp"&&(F.innerHTML=Ht),He=i(e),Y=c(e,"UL",{"data-svelte-h":!0}),y(Y)!=="svelte-1sfer6l"&&(Y.innerHTML=kt),ke=i(e),f(E.$$.fragment,e),Qe=i(e),S=c(e,"P",{"data-svelte-h":!0}),y(S)!=="svelte-1ozm0fq"&&(S.innerHTML=Qt),qe=i(e),f(H.$$.fragment,e),Pe=i(e),f($.$$.fragment,e),De=i(e),f(k.$$.fragment,e),Oe=i(e),Q=c(e,"P",{"data-svelte-h":!0}),y(Q)!=="svelte-kfoy5a"&&(Q.innerHTML=qt),Ke=i(e),q=c(e,"BLOCKQUOTE",{"data-svelte-h":!0}),y(q)!=="svelte-1si1pwr"&&(q.innerHTML=Pt),et=i(e),f(P.$$.fragment,e),tt=i(e),D=c(e,"P",{"data-svelte-h":!0}),y(D)!=="svelte-1p6qhuk"&&(D.innerHTML=Dt),lt=i(e),f(O.$$.fragment,e),at=i(e),K=c(e,"P",{"data-svelte-h":!0}),y(K)!=="svelte-v0yg1a"&&(K.textContent=Ot),ot=i(e),f(ee.$$.fragment,e),rt=i(e),te=c(e,"P",{"data-svelte-h":!0}),y(te)!=="svelte-10n12rp"&&(te.textContent=Kt),st=i(e),f(le.$$.fragment,e),it=i(e),f(ae.$$.fragment,e),nt=i(e),oe=c(e,"P",{"data-svelte-h":!0}),y(oe)!=="svelte-1tr1qyx"&&(oe.textContent=el),mt=i(e),re=c(e,"UL",{"data-svelte-h":!0}),y(re)!=="svelte-u3lbwq"&&(re.innerHTML=tl),pt=i(e),se=c(e,"P",{"data-svelte-h":!0}),y(se)!=="svelte-l4fums"&&(se.textContent=ll),ut=i(e),f(ie.$$.fragment,e),ct=i(e),f(ne.$$.fragment,e),dt=i(e),me=c(e,"P",{"data-svelte-h":!0}),y(me)!=="svelte-vgh2yq"&&(me.textContent=al),Mt=i(e),pe=c(e,"UL",{"data-svelte-h":!0}),y(pe)!=="svelte-14g5f8g"&&(pe.innerHTML=ol),ft=i(e),f(ue.$$.fragment,e),wt=i(e),ce=c(e,"P",{"data-svelte-h":!0}),y(ce)!=="svelte-1wibhqw"&&(ce.innerHTML=rl),Jt=i(e),f(de.$$.fragment,e),Tt=i(e),f(Me.$$.fragment,e),ht=i(e),fe=c(e,"P",{"data-svelte-h":!0}),y(fe)!=="svelte-1lboxzr"&&(fe.textContent=sl),yt=i(e),we=c(e,"P",{"data-svelte-h":!0}),y(we)!=="svelte-1f0pc55"&&(we.innerHTML=il),Ut=i(e),f(Je.$$.fragment,e),gt=i(e),Te=c(e,"P",{"data-svelte-h":!0}),y(Te)!=="svelte-uyp5k"&&(Te.innerHTML=nl),_t=i(e),f(he.$$.fragment,e),jt=i(e),f(ye.$$.fragment,e),bt=i(e),Ue=c(e,"P",{"data-svelte-h":!0}),y(Ue)!=="svelte-1hmop2a"&&(Ue.innerHTML=ml),$t=i(e),f(ge.$$.fragment,e),Ct=i(e),_e=c(e,"P",{"data-svelte-h":!0}),y(_e)!=="svelte-pdghl6"&&(_e.innerHTML=pl),vt=i(e),je=c(e,"P",{"data-svelte-h":!0}),y(je)!=="svelte-c00xox"&&(je.innerHTML=ul),Xt=i(e),be=c(e,"P",{"data-svelte-h":!0}),y(be)!=="svelte-14hz8jj"&&(be.textContent=cl),At=i(e),f($e.$$.fragment,e),It=i(e),f(Ce.$$.fragment,e),Wt=i(e),ve=c(e,"P",{}),fl(ve).forEach(l),this.h()},h(){wl(o,"name","hf:doc:metadata"),wl(o,"content",xl)},m(e,t){_l(document.head,o),a(e,d,t),a(e,r,t),a(e,m,t),w(p,e,t),a(e,n,t),a(e,U,t),a(e,Xe,t),a(e,C,t),a(e,Ae,t),a(e,v,t),a(e,Ie,t),a(e,X,t),a(e,We,t),a(e,A,t),a(e,Ze,t),w(I,e,t),a(e,xe,t),a(e,W,t),a(e,Ge,t),w(Z,e,t),a(e,Re,t),a(e,x,t),a(e,ze,t),a(e,G,t),a(e,Le,t),a(e,R,t),a(e,Ne,t),w(z,e,t),a(e,Ve,t),a(e,L,t),a(e,Be,t),w(N,e,t),a(e,Fe,t),w(V,e,t),a(e,Ye,t),w(b,e,t),a(e,Ee,t),w(B,e,t),a(e,Se,t),a(e,F,t),a(e,He,t),a(e,Y,t),a(e,ke,t),w(E,e,t),a(e,Qe,t),a(e,S,t),a(e,qe,t),w(H,e,t),a(e,Pe,t),w($,e,t),a(e,De,t),w(k,e,t),a(e,Oe,t),a(e,Q,t),a(e,Ke,t),a(e,q,t),a(e,et,t),w(P,e,t),a(e,tt,t),a(e,D,t),a(e,lt,t),w(O,e,t),a(e,at,t),a(e,K,t),a(e,ot,t),w(ee,e,t),a(e,rt,t),a(e,te,t),a(e,st,t),w(le,e,t),a(e,it,t),w(ae,e,t),a(e,nt,t),a(e,oe,t),a(e,mt,t),a(e,re,t),a(e,pt,t),a(e,se,t),a(e,ut,t),w(ie,e,t),a(e,ct,t),w(ne,e,t),a(e,dt,t),a(e,me,t),a(e,Mt,t),a(e,pe,t),a(e,ft,t),w(ue,e,t),a(e,wt,t),a(e,ce,t),a(e,Jt,t),w(de,e,t),a(e,Tt,t),w(Me,e,t),a(e,ht,t),a(e,fe,t),a(e,yt,t),a(e,we,t),a(e,Ut,t),w(Je,e,t),a(e,gt,t),a(e,Te,t),a(e,_t,t),w(he,e,t),a(e,jt,t),w(ye,e,t),a(e,bt,t),a(e,Ue,t),a(e,$t,t),w(ge,e,t),a(e,Ct,t),a(e,_e,t),a(e,vt,t),a(e,je,t),a(e,Xt,t),a(e,be,t),a(e,At,t),w($e,e,t),a(e,It,t),w(Ce,e,t),a(e,Wt,t),a(e,ve,t),Zt=!0},p(e,[t]){const dl={};t&2&&(dl.$$scope={dirty:t,ctx:e}),b.$set(dl);const Ml={};t&2&&(Ml.$$scope={dirty:t,ctx:e}),$.$set(Ml)},i(e){Zt||(J(p.$$.fragment,e),J(I.$$.fragment,e),J(Z.$$.fragment,e),J(z.$$.fragment,e),J(N.$$.fragment,e),J(V.$$.fragment,e),J(b.$$.fragment,e),J(B.$$.fragment,e),J(E.$$.fragment,e),J(H.$$.fragment,e),J($.$$.fragment,e),J(k.$$.fragment,e),J(P.$$.fragment,e),J(O.$$.fragment,e),J(ee.$$.fragment,e),J(le.$$.fragment,e),J(ae.$$.fragment,e),J(ie.$$.fragment,e),J(ne.$$.fragment,e),J(ue.$$.fragment,e),J(de.$$.fragment,e),J(Me.$$.fragment,e),J(Je.$$.fragment,e),J(he.$$.fragment,e),J(ye.$$.fragment,e),J(ge.$$.fragment,e),J($e.$$.fragment,e),J(Ce.$$.fragment,e),Zt=!0)},o(e){T(p.$$.fragment,e),T(I.$$.fragment,e),T(Z.$$.fragment,e),T(z.$$.fragment,e),T(N.$$.fragment,e),T(V.$$.fragment,e),T(b.$$.fragment,e),T(B.$$.fragment,e),T(E.$$.fragment,e),T(H.$$.fragment,e),T($.$$.fragment,e),T(k.$$.fragment,e),T(P.$$.fragment,e),T(O.$$.fragment,e),T(ee.$$.fragment,e),T(le.$$.fragment,e),T(ae.$$.fragment,e),T(ie.$$.fragment,e),T(ne.$$.fragment,e),T(ue.$$.fragment,e),T(de.$$.fragment,e),T(Me.$$.fragment,e),T(Je.$$.fragment,e),T(he.$$.fragment,e),T(ye.$$.fragment,e),T(ge.$$.fragment,e),T($e.$$.fragment,e),T(Ce.$$.fragment,e),Zt=!1},d(e){e&&(l(d),l(r),l(m),l(n),l(U),l(Xe),l(C),l(Ae),l(v),l(Ie),l(X),l(We),l(A),l(Ze),l(xe),l(W),l(Ge),l(Re),l(x),l(ze),l(G),l(Le),l(R),l(Ne),l(Ve),l(L),l(Be),l(Fe),l(Ye),l(Ee),l(Se),l(F),l(He),l(Y),l(ke),l(Qe),l(S),l(qe),l(Pe),l(De),l(Oe),l(Q),l(Ke),l(q),l(et),l(tt),l(D),l(lt),l(at),l(K),l(ot),l(rt),l(te),l(st),l(it),l(nt),l(oe),l(mt),l(re),l(pt),l(se),l(ut),l(ct),l(dt),l(me),l(Mt),l(pe),l(ft),l(wt),l(ce),l(Jt),l(Tt),l(ht),l(fe),l(yt),l(we),l(Ut),l(gt),l(Te),l(_t),l(jt),l(bt),l(Ue),l($t),l(Ct),l(_e),l(vt),l(je),l(Xt),l(be),l(At),l(It),l(Wt),l(ve)),l(o),h(p,e),h(I,e),h(Z,e),h(z,e),h(N,e),h(V,e),h(b,e),h(B,e),h(E,e),h(H,e),h($,e),h(k,e),h(P,e),h(O,e),h(ee,e),h(le,e),h(ae,e),h(ie,e),h(ne,e),h(ue,e),h(de,e),h(Me,e),h(Je,e),h(he,e),h(ye,e),h(ge,e),h($e,e),h(Ce,e)}}}const xl='{"title":"Treinamento a partir de um script","local":"treinamento-a-partir-de-um-script","sections":[{"title":"Configuração","local":"configuração","sections":[],"depth":2},{"title":"Executando um script","local":"executando-um-script","sections":[],"depth":2},{"title":"Treinamento distribuído e precisão mista","local":"treinamento-distribuído-e-precisão-mista","sections":[],"depth":2},{"title":"Executando um script em uma TPU","local":"executando-um-script-em-uma-tpu","sections":[],"depth":2},{"title":"Execute um script com 🤗 Accelerate","local":"execute-um-script-com--accelerate","sections":[],"depth":2},{"title":"Usando um conjunto de dados personalizado","local":"usando-um-conjunto-de-dados-personalizado","sections":[],"depth":2},{"title":"Testando um script","local":"testando-um-script","sections":[],"depth":2},{"title":"Retomar o treinamento a partir de um checkpoint","local":"retomar-o-treinamento-a-partir-de-um-checkpoint","sections":[],"depth":2},{"title":"Compartilhando seu modelo","local":"compartilhando-seu-modelo","sections":[],"depth":2}],"depth":1}';function Gl(_){return hl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Bl extends yl{constructor(o){super(),Ul(this,o,Gl,Zl,Tl,{})}}export{Bl as component};
