import{s as yl,o as Tl,n as Zt}from"../chunks/scheduler.9bc65507.js";import{S as Jl,i as gl,g as u,s as n,r as h,A as Ul,h as M,f as l,c as o,j as Lt,u as d,x as c,k as dl,y as Vt,a,v as w,d as y,t as T,w as J}from"../chunks/index.707bf1b6.js";import{C as U}from"../chunks/CodeBlock.54a9f38d.js";import{F as wl,M as xt}from"../chunks/Markdown.8ab98a13.js";import{H as j}from"../chunks/Heading.342b1fa6.js";function _l(_){let i,f='The example script downloads and preprocesses a dataset from the 🤗 <a href="https://huggingface.co/docs/datasets/" rel="nofollow">Datasets</a> library. Then the script fine-tunes a dataset with the <a href="https://huggingface.co/docs/transformers/main_classes/trainer" rel="nofollow">Trainer</a> on an architecture that supports summarization. The following example shows how to fine-tune <a href="https://huggingface.co/t5-small" rel="nofollow">T5-small</a> on the <a href="https://huggingface.co/datasets/cnn_dailymail" rel="nofollow">CNN/DailyMail</a> dataset. The T5 model requires an additional <code>source_prefix</code> argument due to how it was trained. This prompt lets T5 know this is a summarization task.',s,m,p;return m=new U({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjB0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfbmFtZSUyMGNubl9kYWlseW1haWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfY29uZmlnJTIwJTIyMy4wLjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXNvdXJjZV9wcmVmaXglMjAlMjJzdW1tYXJpemUlM0ElMjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLW91dHB1dF9kaXIlMjAlMkZ0bXAlMkZ0c3Qtc3VtbWFyaXphdGlvbiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNENCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV9ldmFsX2JhdGNoX3NpemUlM0Q0JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdmVyd3JpdGVfb3V0cHV0X2RpciUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcHJlZGljdF93aXRoX2dlbmVyYXRl",highlighted:`python examples/pytorch/summarization/run_summarization.py \\
    --model_name_or_path 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=f,s=n(),h(m.$$.fragment)},l(r){i=M(r,"P",{"data-svelte-h":!0}),c(i)!=="svelte-6b87gj"&&(i.innerHTML=f),s=o(r),d(m.$$.fragment,r)},m(r,g){a(r,i,g),a(r,s,g),w(m,r,g),p=!0},p:Zt,i(r){p||(y(m.$$.fragment,r),p=!0)},o(r){T(m.$$.fragment,r),p=!1},d(r){r&&(l(i),l(s)),J(m,r)}}}function jl(_){let i,f;return i=new xt({props:{$$slots:{default:[_l]},$$scope:{ctx:_}}}),{c(){h(i.$$.fragment)},l(s){d(i.$$.fragment,s)},m(s,m){w(i,s,m),f=!0},p(s,m){const p={};m&2&&(p.$$scope={dirty:m,ctx:s}),i.$set(p)},i(s){f||(y(i.$$.fragment,s),f=!0)},o(s){T(i.$$.fragment,s),f=!1},d(s){J(i,s)}}}function bl(_){let i,f='The example script downloads and preprocesses a dataset from the 🤗 <a href="https://huggingface.co/docs/datasets/" rel="nofollow">Datasets</a> library. Then the script fine-tunes a dataset using Keras on an architecture that supports summarization. The following example shows how to fine-tune <a href="https://huggingface.co/t5-small" rel="nofollow">T5-small</a> on the <a href="https://huggingface.co/datasets/cnn_dailymail" rel="nofollow">CNN/DailyMail</a> dataset. The T5 model requires an additional <code>source_prefix</code> argument due to how it was trained. This prompt lets T5 know this is a summarization task.',s,m,p;return m=new U({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZ0ZW5zb3JmbG93JTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTIwJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjB0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZGF0YXNldF9uYW1lJTIwY25uX2RhaWx5bWFpbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZGF0YXNldF9jb25maWclMjAlMjIzLjAuMCUyMiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tb3V0cHV0X2RpciUyMCUyRnRtcCUyRnRzdC1zdW1tYXJpemF0aW9uJTIwJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX3RyYWluX2JhdGNoX3NpemUlMjA4JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX2V2YWxfYmF0Y2hfc2l6ZSUyMDE2JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1udW1fdHJhaW5fZXBvY2hzJTIwMyUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWw=",highlighted:`python examples/tensorflow/summarization/run_summarization.py  \\
    --model_name_or_path 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=f,s=n(),h(m.$$.fragment)},l(r){i=M(r,"P",{"data-svelte-h":!0}),c(i)!=="svelte-1yayoxz"&&(i.innerHTML=f),s=o(r),d(m.$$.fragment,r)},m(r,g){a(r,i,g),a(r,s,g),w(m,r,g),p=!0},p:Zt,i(r){p||(y(m.$$.fragment,r),p=!0)},o(r){T(m.$$.fragment,r),p=!1},d(r){r&&(l(i),l(s)),J(m,r)}}}function $l(_){let i,f;return i=new xt({props:{$$slots:{default:[bl]},$$scope:{ctx:_}}}),{c(){h(i.$$.fragment)},l(s){d(i.$$.fragment,s)},m(s,m){w(i,s,m),f=!0},p(s,m){const p={};m&2&&(p.$$scope={dirty:m,ctx:s}),i.$set(p)},i(s){f||(y(i.$$.fragment,s),f=!0)},o(s){T(i.$$.fragment,s),f=!1},d(s){J(i,s)}}}function Cl(_){let i,f='Tensor Processing Units (TPUs) are specifically designed to accelerate performance. PyTorch supports TPUs with the <a href="https://www.tensorflow.org/xla" rel="nofollow">XLA</a> deep learning compiler (see <a href="https://github.com/pytorch/xla/blob/master/README.md" rel="nofollow">here</a> for more details). To use a TPU, launch the <code>xla_spawn.py</code> script and use the <code>num_cores</code> argument to set the number of TPU cores you want to use.',s,m,p;return m=new U({props:{code:"cHl0aG9uJTIweGxhX3NwYXduLnB5JTIwLS1udW1fY29yZXMlMjA4JTIwJTVDJTBBJTIwJTIwJTIwJTIwc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjB0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfbmFtZSUyMGNubl9kYWlseW1haWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfY29uZmlnJTIwJTIyMy4wLjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXNvdXJjZV9wcmVmaXglMjAlMjJzdW1tYXJpemUlM0ElMjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLW91dHB1dF9kaXIlMjAlMkZ0bXAlMkZ0c3Qtc3VtbWFyaXphdGlvbiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNENCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV9ldmFsX2JhdGNoX3NpemUlM0Q0JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdmVyd3JpdGVfb3V0cHV0X2RpciUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcHJlZGljdF93aXRoX2dlbmVyYXRl",highlighted:`python xla_spawn.py --num_cores 8 \\
    summarization/run_summarization.py \\
    --model_name_or_path 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=f,s=n(),h(m.$$.fragment)},l(r){i=M(r,"P",{"data-svelte-h":!0}),c(i)!=="svelte-j1gqk0"&&(i.innerHTML=f),s=o(r),d(m.$$.fragment,r)},m(r,g){a(r,i,g),a(r,s,g),w(m,r,g),p=!0},p:Zt,i(r){p||(y(m.$$.fragment,r),p=!0)},o(r){T(m.$$.fragment,r),p=!1},d(r){r&&(l(i),l(s)),J(m,r)}}}function Xl(_){let i,f;return i=new xt({props:{$$slots:{default:[Cl]},$$scope:{ctx:_}}}),{c(){h(i.$$.fragment)},l(s){d(i.$$.fragment,s)},m(s,m){w(i,s,m),f=!0},p(s,m){const p={};m&2&&(p.$$scope={dirty:m,ctx:s}),i.$set(p)},i(s){f||(y(i.$$.fragment,s),f=!0)},o(s){T(i.$$.fragment,s),f=!1},d(s){J(i,s)}}}function vl(_){let i,f='Tensor Processing Units (TPUs) are specifically designed to accelerate performance. TensorFlow scripts utilize a <a href="https://www.tensorflow.org/guide/distributed_training#tpustrategy" rel="nofollow"><code>TPUStrategy</code></a> for training on TPUs. To use a TPU, pass the name of the TPU resource to the <code>tpu</code> argument.',s,m,p;return m=new U({props:{code:"cHl0aG9uJTIwcnVuX3N1bW1hcml6YXRpb24ucHklMjAlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXRwdSUyMG5hbWVfb2ZfdHB1X3Jlc291cmNlJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjB0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZGF0YXNldF9uYW1lJTIwY25uX2RhaWx5bWFpbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZGF0YXNldF9jb25maWclMjAlMjIzLjAuMCUyMiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tb3V0cHV0X2RpciUyMCUyRnRtcCUyRnRzdC1zdW1tYXJpemF0aW9uJTIwJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX3RyYWluX2JhdGNoX3NpemUlMjA4JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX2V2YWxfYmF0Y2hfc2l6ZSUyMDE2JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1udW1fdHJhaW5fZXBvY2hzJTIwMyUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWw=",highlighted:`python run_summarization.py  \\
    --tpu name_of_tpu_resource \\
    --model_name_or_path 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=f,s=n(),h(m.$$.fragment)},l(r){i=M(r,"P",{"data-svelte-h":!0}),c(i)!=="svelte-1ww3mmi"&&(i.innerHTML=f),s=o(r),d(m.$$.fragment,r)},m(r,g){a(r,i,g),a(r,s,g),w(m,r,g),p=!0},p:Zt,i(r){p||(y(m.$$.fragment,r),p=!0)},o(r){T(m.$$.fragment,r),p=!1},d(r){r&&(l(i),l(s)),J(m,r)}}}function Il(_){let i,f;return i=new xt({props:{$$slots:{default:[vl]},$$scope:{ctx:_}}}),{c(){h(i.$$.fragment)},l(s){d(i.$$.fragment,s)},m(s,m){w(i,s,m),f=!0},p(s,m){const p={};m&2&&(p.$$scope={dirty:m,ctx:s}),i.$set(p)},i(s){f||(y(i.$$.fragment,s),f=!0)},o(s){T(i.$$.fragment,s),f=!1},d(s){J(i,s)}}}function Al(_){let i,f,s,m,p,r,g,Nt='Along with the 🤗 Transformers <a href="./noteboks/README">notebooks</a>, there are also example scripts demonstrating how to train a model for a task with <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>, or <a href="https://github.com/huggingface/transformers/tree/main/examples/flax" rel="nofollow">JAX/Flax</a>.',Ie,X,Gt='You will also find scripts we’ve used in our <a href="https://github.com/huggingface/transformers/tree/main/examples/research_projects" rel="nofollow">research projects</a> and <a href="https://github.com/huggingface/transformers/tree/main/examples/legacy" rel="nofollow">legacy examples</a> which are mostly community contributed. These scripts are not actively maintained and require a specific version of 🤗 Transformers that will most likely be incompatible with the latest version of the library.',Ae,v,zt="The example scripts are not expected to work out-of-the-box on every problem, and you may need to adapt the script to the problem you’re trying to solve. To help you with this, most of the scripts fully expose how data is preprocessed, allowing you to edit it as necessary for your use case.",We,I,Bt='For any feature you’d like to implement in an example script, please discuss it on the <a href="https://discuss.huggingface.co/" rel="nofollow">forum</a> or in an <a href="https://github.com/huggingface/transformers/issues" rel="nofollow">issue</a> before submitting a Pull Request. While we welcome bug fixes, it is unlikely we will merge a Pull Request that adds more functionality at the cost of readability.',Ze,A,Ft='This guide will show you how to run an example summarization training script in <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/summarization" rel="nofollow">PyTorch</a> and <a href="https://github.com/huggingface/transformers/tree/main/examples/tensorflow/summarization" rel="nofollow">TensorFlow</a>. All examples are expected to work with both frameworks unless otherwise specified.',xe,W,Re,Z,Yt="To successfully run the latest version of the example scripts, you have to <strong>install 🤗 Transformers from source</strong> in a new virtual environment:",Le,x,Ve,R,kt="For older versions of the example scripts, click on the toggle below:",Ne,L,St='<summary>Examples for older versions of 🤗 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>',Ge,V,Ht="Then switch your current clone of 🤗 Transformers to a specific version, like v3.5.1 for example:",ze,N,Be,G,Et="After you’ve setup the correct library version, navigate to the example folder of your choice and install the example specific requirements:",Fe,z,Ye,B,ke,b,Se,F,He,Y,Qt='The <a href="https://huggingface.co/docs/transformers/main_classes/trainer" rel="nofollow">Trainer</a> supports distributed training and mixed precision, which means you can also use it in a script. To enable both of these features:',Ee,k,Pt="<li>Add the <code>fp16</code> argument to enable mixed precision.</li> <li>Set the number of GPUs to use with the <code>nproc_per_node</code> argument.</li>",Qe,S,Pe,H,qt='TensorFlow scripts utilize a <a href="https://www.tensorflow.org/guide/distributed_training#mirroredstrategy" rel="nofollow"><code>MirroredStrategy</code></a> for distributed training, and you don’t need to add any additional arguments to the training script. The TensorFlow script will use multiple GPUs by default if they are available.',qe,E,De,$,Oe,Q,Ke,P,Dt='🤗 <a href="https://huggingface.co/docs/accelerate" rel="nofollow">Accelerate</a> is a PyTorch-only library that offers a unified method for training a model on several types of setups (CPU-only, multiple GPUs, TPUs) while maintaining complete visibility into the PyTorch training loop. Make sure you have 🤗 Accelerate installed if you don’t already have it:',et,C,Xe,Ot="Note: As Accelerate is rapidly developing, the git version of accelerate must be installed to run the scripts",Rt,q,tt,D,Kt="Instead of the <code>run_summarization.py</code> script, you need to use the <code>run_summarization_no_trainer.py</code> script. 🤗 Accelerate supported scripts will have a <code>task_no_trainer.py</code> file in the folder. Begin by running the following command to create and save a configuration file:",lt,O,at,K,el="Test your setup to make sure it is configured correctly:",it,ee,st,te,tl="Now you are ready to launch the training:",rt,le,nt,ae,ot,ie,ll="The summarization script supports custom datasets as long as they are a CSV or JSON Line file. When you use your own dataset, you need to specify several additional arguments:",mt,se,al="<li><code>train_file</code> and <code>validation_file</code> specify the path to your training and validation files.</li> <li><code>text_column</code> is the input text to summarize.</li> <li><code>summary_column</code> is the target text to output.</li>",pt,re,il="A summarization script using a custom dataset would look like this:",ut,ne,Mt,oe,ft,me,sl="It is often a good idea to run your script on a smaller number of dataset examples to ensure everything works as expected before committing to an entire dataset which may take hours to complete. Use the following arguments to truncate the dataset to a maximum number of samples:",ct,pe,rl="<li><code>max_train_samples</code></li> <li><code>max_eval_samples</code></li> <li><code>max_predict_samples</code></li>",ht,ue,dt,Me,nl="Not all example scripts support the <code>max_predict_samples</code> argument. If you aren’t sure whether your script supports this argument, add the <code>-h</code> argument to check:",wt,fe,yt,ce,Tt,he,ol="Another helpful option to enable is resuming training from a previous checkpoint. This will ensure you can pick up where you left off without starting over if your training gets interrupted. There are two methods to resume training from a checkpoint.",Jt,de,ml="The first method uses the <code>output_dir previous_output_dir</code> argument to resume training from the latest checkpoint stored in <code>output_dir</code>. In this case, you should remove <code>overwrite_output_dir</code>:",gt,we,Ut,ye,pl="The second method uses the <code>resume_from_checkpoint path_to_specific_checkpoint</code> argument to resume training from a specific checkpoint folder.",_t,Te,jt,Je,bt,ge,ul='All scripts can upload your final model to the <a href="https://huggingface.co/models" rel="nofollow">Model Hub</a>. Make sure you are logged into Hugging Face before you begin:',$t,Ue,Ct,_e,Ml="Then add the <code>push_to_hub</code> argument to the script. This argument will create a repository with your Hugging Face username and the folder name specified in <code>output_dir</code>.",Xt,je,fl="To give your repository a specific name, use the <code>push_to_hub_model_id</code> argument to add it. The repository will be automatically listed under your namespace.",vt,be,cl="The following example shows how to upload a model with a specific repository name:",It,$e,At,ve,Wt;return p=new j({props:{title:"Train with a script",local:"train-with-a-script",headingTag:"h1"}}),W=new j({props:{title:"Setup",local:"setup",headingTag:"h2"}}),x=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}}),z=new U({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1yJTIwcmVxdWlyZW1lbnRzLnR4dA==",highlighted:"pip install -r requirements.txt",wrap:!1}}),B=new j({props:{title:"Run a script",local:"run-a-script",headingTag:"h2"}}),b=new wl({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[$l],pytorch:[jl]},$$scope:{ctx:_}}}),F=new j({props:{title:"Distributed training and mixed precision",local:"distributed-training-and-mixed-precision",headingTag:"h2"}}),S=new U({props:{code:"cHl0aG9uJTIwLW0lMjB0b3JjaC5kaXN0cmlidXRlZC5sYXVuY2glMjAlNUMlMEElMjAlMjAlMjAlMjAtLW5wcm9jX3Blcl9ub2RlJTIwOCUyMHB5dG9yY2glMkZzdW1tYXJpemF0aW9uJTJGcnVuX3N1bW1hcml6YXRpb24ucHklMjAlNUMlMEElMjAlMjAlMjAlMjAtLWZwMTYlMjAlNUMlMEElMjAlMjAlMjAlMjAtLW1vZGVsX25hbWVfb3JfcGF0aCUyMHQ1LXNtYWxsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kb190cmFpbiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fZXZhbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZGF0YXNldF9uYW1lJTIwY25uX2RhaWx5bWFpbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZGF0YXNldF9jb25maWclMjAlMjIzLjAuMCUyMiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tc291cmNlX3ByZWZpeCUyMCUyMnN1bW1hcml6ZSUzQSUyMCUyMiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tb3V0cHV0X2RpciUyMCUyRnRtcCUyRnRzdC1zdW1tYXJpemF0aW9uJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX3RyYWluX2JhdGNoX3NpemUlM0Q0JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX2V2YWxfYmF0Y2hfc2l6ZSUzRDQlMjAlNUMlMEElMjAlMjAlMjAlMjAtLW92ZXJ3cml0ZV9vdXRwdXRfZGlyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wcmVkaWN0X3dpdGhfZ2VuZXJhdGU=",highlighted:`python -m torch.distributed.launch \\
    --nproc_per_node 8 pytorch/summarization/run_summarization.py \\
    --fp16 \\
    --model_name_or_path 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}}),E=new j({props:{title:"Run a script on a TPU",local:"run-a-script-on-a-tpu",headingTag:"h2"}}),$=new wl({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Il],pytorch:[Xl]},$$scope:{ctx:_}}}),Q=new j({props:{title:"Run a script with 🤗 Accelerate",local:"run-a-script-with--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:"YWNjZWxlcmF0ZSUyMGxhdW5jaCUyMHJ1bl9zdW1tYXJpemF0aW9uX25vX3RyYWluZXIucHklMjAlNUMlMEElMjAlMjAlMjAlMjAtLW1vZGVsX25hbWVfb3JfcGF0aCUyMHQ1LXNtYWxsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kYXRhc2V0X25hbWUlMjBjbm5fZGFpbHltYWlsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kYXRhc2V0X2NvbmZpZyUyMCUyMjMuMC4wJTIyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1zb3VyY2VfcHJlZml4JTIwJTIyc3VtbWFyaXplJTNBJTIwJTIyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdXRwdXRfZGlyJTIwfiUyRnRtcCUyRnRzdC1zdW1tYXJpemF0aW9u",highlighted:`accelerate launch run_summarization_no_trainer.py \\
    --model_name_or_path 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:"Use a custom dataset",local:"use-a-custom-dataset",headingTag:"h2"}}),ne=new U({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjB0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXRyYWluX2ZpbGUlMjBwYXRoX3RvX2Nzdl9vcl9qc29ubGluZXNfZmlsZSUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tdmFsaWRhdGlvbl9maWxlJTIwcGF0aF90b19jc3Zfb3JfanNvbmxpbmVzX2ZpbGUlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXRleHRfY29sdW1uJTIwdGV4dF9jb2x1bW5fbmFtZSUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tc3VtbWFyeV9jb2x1bW4lMjBzdW1tYXJ5X2NvbHVtbl9uYW1lJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1zb3VyY2VfcHJlZml4JTIwJTIyc3VtbWFyaXplJTNBJTIwJTIyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdXRwdXRfZGlyJTIwJTJGdG1wJTJGdHN0LXN1bW1hcml6YXRpb24lMjAlNUMlMEElMjAlMjAlMjAlMjAtLW92ZXJ3cml0ZV9vdXRwdXRfZGlyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX3RyYWluX2JhdGNoX3NpemUlM0Q0JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX2V2YWxfYmF0Y2hfc2l6ZSUzRDQlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXByZWRpY3Rfd2l0aF9nZW5lcmF0ZQ==",highlighted:`python examples/pytorch/summarization/run_summarization.py \\
    --model_name_or_path 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:"Test a script",local:"test-a-script",headingTag:"h2"}}),ue=new U({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjB0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tbWF4X3RyYWluX3NhbXBsZXMlMjA1MCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tbWF4X2V2YWxfc2FtcGxlcyUyMDUwJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tYXhfcHJlZGljdF9zYW1wbGVzJTIwNTAlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX3RyYWluJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kb19ldmFsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kYXRhc2V0X25hbWUlMjBjbm5fZGFpbHltYWlsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kYXRhc2V0X2NvbmZpZyUyMCUyMjMuMC4wJTIyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1zb3VyY2VfcHJlZml4JTIwJTIyc3VtbWFyaXplJTNBJTIwJTIyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdXRwdXRfZGlyJTIwJTJGdG1wJTJGdHN0LXN1bW1hcml6YXRpb24lMjAlNUMlMEElMjAlMjAlMjAlMjAtLXBlcl9kZXZpY2VfdHJhaW5fYmF0Y2hfc2l6ZSUzRDQlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXBlcl9kZXZpY2VfZXZhbF9iYXRjaF9zaXplJTNENCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tb3ZlcndyaXRlX291dHB1dF9kaXIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXByZWRpY3Rfd2l0aF9nZW5lcmF0ZQ==",highlighted:`python examples/pytorch/summarization/run_summarization.py \\
    --model_name_or_path 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}}),fe=new U({props:{code:"ZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTIwLWg=",highlighted:"examples/pytorch/summarization/run_summarization.py -h",wrap:!1}}),ce=new j({props:{title:"Resume training from checkpoint",local:"resume-training-from-checkpoint",headingTag:"h2"}}),we=new U({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjB0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfbmFtZSUyMGNubl9kYWlseW1haWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfY29uZmlnJTIwJTIyMy4wLjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXNvdXJjZV9wcmVmaXglMjAlMjJzdW1tYXJpemUlM0ElMjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLW91dHB1dF9kaXIlMjAlMkZ0bXAlMkZ0c3Qtc3VtbWFyaXphdGlvbiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNENCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV9ldmFsX2JhdGNoX3NpemUlM0Q0JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdXRwdXRfZGlyJTIwcHJldmlvdXNfb3V0cHV0X2RpciUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcHJlZGljdF93aXRoX2dlbmVyYXRl",highlighted:`python examples/pytorch/summarization/run_summarization.py
    --model_name_or_path 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}}),Te=new U({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjB0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfbmFtZSUyMGNubl9kYWlseW1haWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfY29uZmlnJTIwJTIyMy4wLjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXNvdXJjZV9wcmVmaXglMjAlMjJzdW1tYXJpemUlM0ElMjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLW91dHB1dF9kaXIlMjAlMkZ0bXAlMkZ0c3Qtc3VtbWFyaXphdGlvbiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNENCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV9ldmFsX2JhdGNoX3NpemUlM0Q0JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdmVyd3JpdGVfb3V0cHV0X2RpciUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcmVzdW1lX2Zyb21fY2hlY2twb2ludCUyMHBhdGhfdG9fc3BlY2lmaWNfY2hlY2twb2ludCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcHJlZGljdF93aXRoX2dlbmVyYXRl",highlighted:`python examples/pytorch/summarization/run_summarization.py
    --model_name_or_path 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}}),Je=new j({props:{title:"Share your model",local:"share-your-model",headingTag:"h2"}}),Ue=new U({props:{code:"aHVnZ2luZ2ZhY2UtY2xpJTIwbG9naW4=",highlighted:"huggingface-cli login",wrap:!1}}),$e=new U({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjB0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfbmFtZSUyMGNubl9kYWlseW1haWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfY29uZmlnJTIwJTIyMy4wLjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXNvdXJjZV9wcmVmaXglMjAlMjJzdW1tYXJpemUlM0ElMjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXB1c2hfdG9faHViJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wdXNoX3RvX2h1Yl9tb2RlbF9pZCUyMGZpbmV0dW5lZC10NS1jbm5fZGFpbHltYWlsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdXRwdXRfZGlyJTIwJTJGdG1wJTJGdHN0LXN1bW1hcml6YXRpb24lMjAlNUMlMEElMjAlMjAlMjAlMjAtLXBlcl9kZXZpY2VfdHJhaW5fYmF0Y2hfc2l6ZSUzRDQlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXBlcl9kZXZpY2VfZXZhbF9iYXRjaF9zaXplJTNENCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tb3ZlcndyaXRlX291dHB1dF9kaXIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXByZWRpY3Rfd2l0aF9nZW5lcmF0ZQ==",highlighted:`python examples/pytorch/summarization/run_summarization.py
    --model_name_or_path 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"),f=n(),s=u("p"),m=n(),h(p.$$.fragment),r=n(),g=u("p"),g.innerHTML=Nt,Ie=n(),X=u("p"),X.innerHTML=Gt,Ae=n(),v=u("p"),v.textContent=zt,We=n(),I=u("p"),I.innerHTML=Bt,Ze=n(),A=u("p"),A.innerHTML=Ft,xe=n(),h(W.$$.fragment),Re=n(),Z=u("p"),Z.innerHTML=Yt,Le=n(),h(x.$$.fragment),Ve=n(),R=u("p"),R.textContent=kt,Ne=n(),L=u("details"),L.innerHTML=St,Ge=n(),V=u("p"),V.textContent=Ht,ze=n(),h(N.$$.fragment),Be=n(),G=u("p"),G.textContent=Et,Fe=n(),h(z.$$.fragment),Ye=n(),h(B.$$.fragment),ke=n(),h(b.$$.fragment),Se=n(),h(F.$$.fragment),He=n(),Y=u("p"),Y.innerHTML=Qt,Ee=n(),k=u("ul"),k.innerHTML=Pt,Qe=n(),h(S.$$.fragment),Pe=n(),H=u("p"),H.innerHTML=qt,qe=n(),h(E.$$.fragment),De=n(),h($.$$.fragment),Oe=n(),h(Q.$$.fragment),Ke=n(),P=u("p"),P.innerHTML=Dt,et=n(),C=u("blockquote"),Xe=u("p"),Xe.textContent=Ot,Rt=n(),h(q.$$.fragment),tt=n(),D=u("p"),D.innerHTML=Kt,lt=n(),h(O.$$.fragment),at=n(),K=u("p"),K.textContent=el,it=n(),h(ee.$$.fragment),st=n(),te=u("p"),te.textContent=tl,rt=n(),h(le.$$.fragment),nt=n(),h(ae.$$.fragment),ot=n(),ie=u("p"),ie.textContent=ll,mt=n(),se=u("ul"),se.innerHTML=al,pt=n(),re=u("p"),re.textContent=il,ut=n(),h(ne.$$.fragment),Mt=n(),h(oe.$$.fragment),ft=n(),me=u("p"),me.textContent=sl,ct=n(),pe=u("ul"),pe.innerHTML=rl,ht=n(),h(ue.$$.fragment),dt=n(),Me=u("p"),Me.innerHTML=nl,wt=n(),h(fe.$$.fragment),yt=n(),h(ce.$$.fragment),Tt=n(),he=u("p"),he.textContent=ol,Jt=n(),de=u("p"),de.innerHTML=ml,gt=n(),h(we.$$.fragment),Ut=n(),ye=u("p"),ye.innerHTML=pl,_t=n(),h(Te.$$.fragment),jt=n(),h(Je.$$.fragment),bt=n(),ge=u("p"),ge.innerHTML=ul,$t=n(),h(Ue.$$.fragment),Ct=n(),_e=u("p"),_e.innerHTML=Ml,Xt=n(),je=u("p"),je.innerHTML=fl,vt=n(),be=u("p"),be.textContent=cl,It=n(),h($e.$$.fragment),At=n(),ve=u("p"),this.h()},l(e){const t=Ul("svelte-u9bgzb",document.head);i=M(t,"META",{name:!0,content:!0}),t.forEach(l),f=o(e),s=M(e,"P",{}),Lt(s).forEach(l),m=o(e),d(p.$$.fragment,e),r=o(e),g=M(e,"P",{"data-svelte-h":!0}),c(g)!=="svelte-bqhkw2"&&(g.innerHTML=Nt),Ie=o(e),X=M(e,"P",{"data-svelte-h":!0}),c(X)!=="svelte-1gwco66"&&(X.innerHTML=Gt),Ae=o(e),v=M(e,"P",{"data-svelte-h":!0}),c(v)!=="svelte-ehpuaj"&&(v.textContent=zt),We=o(e),I=M(e,"P",{"data-svelte-h":!0}),c(I)!=="svelte-z30sjv"&&(I.innerHTML=Bt),Ze=o(e),A=M(e,"P",{"data-svelte-h":!0}),c(A)!=="svelte-1muwvtv"&&(A.innerHTML=Ft),xe=o(e),d(W.$$.fragment,e),Re=o(e),Z=M(e,"P",{"data-svelte-h":!0}),c(Z)!=="svelte-1mgxfwl"&&(Z.innerHTML=Yt),Le=o(e),d(x.$$.fragment,e),Ve=o(e),R=M(e,"P",{"data-svelte-h":!0}),c(R)!=="svelte-1xawyut"&&(R.textContent=kt),Ne=o(e),L=M(e,"DETAILS",{"data-svelte-h":!0}),c(L)!=="svelte-145d76l"&&(L.innerHTML=St),Ge=o(e),V=M(e,"P",{"data-svelte-h":!0}),c(V)!=="svelte-64mt19"&&(V.textContent=Ht),ze=o(e),d(N.$$.fragment,e),Be=o(e),G=M(e,"P",{"data-svelte-h":!0}),c(G)!=="svelte-fgl2z5"&&(G.textContent=Et),Fe=o(e),d(z.$$.fragment,e),Ye=o(e),d(B.$$.fragment,e),ke=o(e),d(b.$$.fragment,e),Se=o(e),d(F.$$.fragment,e),He=o(e),Y=M(e,"P",{"data-svelte-h":!0}),c(Y)!=="svelte-1c1svkh"&&(Y.innerHTML=Qt),Ee=o(e),k=M(e,"UL",{"data-svelte-h":!0}),c(k)!=="svelte-12spge2"&&(k.innerHTML=Pt),Qe=o(e),d(S.$$.fragment,e),Pe=o(e),H=M(e,"P",{"data-svelte-h":!0}),c(H)!=="svelte-1l3ohuh"&&(H.innerHTML=qt),qe=o(e),d(E.$$.fragment,e),De=o(e),d($.$$.fragment,e),Oe=o(e),d(Q.$$.fragment,e),Ke=o(e),P=M(e,"P",{"data-svelte-h":!0}),c(P)!=="svelte-12o0ukl"&&(P.innerHTML=Dt),et=o(e),C=M(e,"BLOCKQUOTE",{});var Ce=Lt(C);Xe=M(Ce,"P",{"data-svelte-h":!0}),c(Xe)!=="svelte-j7gn57"&&(Xe.textContent=Ot),Rt=o(Ce),d(q.$$.fragment,Ce),Ce.forEach(l),tt=o(e),D=M(e,"P",{"data-svelte-h":!0}),c(D)!=="svelte-4ovdqo"&&(D.innerHTML=Kt),lt=o(e),d(O.$$.fragment,e),at=o(e),K=M(e,"P",{"data-svelte-h":!0}),c(K)!=="svelte-182jy9q"&&(K.textContent=el),it=o(e),d(ee.$$.fragment,e),st=o(e),te=M(e,"P",{"data-svelte-h":!0}),c(te)!=="svelte-15segnh"&&(te.textContent=tl),rt=o(e),d(le.$$.fragment,e),nt=o(e),d(ae.$$.fragment,e),ot=o(e),ie=M(e,"P",{"data-svelte-h":!0}),c(ie)!=="svelte-102gssu"&&(ie.textContent=ll),mt=o(e),se=M(e,"UL",{"data-svelte-h":!0}),c(se)!=="svelte-1jtimg7"&&(se.innerHTML=al),pt=o(e),re=M(e,"P",{"data-svelte-h":!0}),c(re)!=="svelte-1xw9de2"&&(re.textContent=il),ut=o(e),d(ne.$$.fragment,e),Mt=o(e),d(oe.$$.fragment,e),ft=o(e),me=M(e,"P",{"data-svelte-h":!0}),c(me)!=="svelte-1djig5e"&&(me.textContent=sl),ct=o(e),pe=M(e,"UL",{"data-svelte-h":!0}),c(pe)!=="svelte-14g5f8g"&&(pe.innerHTML=rl),ht=o(e),d(ue.$$.fragment,e),dt=o(e),Me=M(e,"P",{"data-svelte-h":!0}),c(Me)!=="svelte-1rlkz6g"&&(Me.innerHTML=nl),wt=o(e),d(fe.$$.fragment,e),yt=o(e),d(ce.$$.fragment,e),Tt=o(e),he=M(e,"P",{"data-svelte-h":!0}),c(he)!=="svelte-pdl903"&&(he.textContent=ol),Jt=o(e),de=M(e,"P",{"data-svelte-h":!0}),c(de)!=="svelte-1gat20q"&&(de.innerHTML=ml),gt=o(e),d(we.$$.fragment,e),Ut=o(e),ye=M(e,"P",{"data-svelte-h":!0}),c(ye)!=="svelte-z1wjdg"&&(ye.innerHTML=pl),_t=o(e),d(Te.$$.fragment,e),jt=o(e),d(Je.$$.fragment,e),bt=o(e),ge=M(e,"P",{"data-svelte-h":!0}),c(ge)!=="svelte-1l22jqe"&&(ge.innerHTML=ul),$t=o(e),d(Ue.$$.fragment,e),Ct=o(e),_e=M(e,"P",{"data-svelte-h":!0}),c(_e)!=="svelte-27u38x"&&(_e.innerHTML=Ml),Xt=o(e),je=M(e,"P",{"data-svelte-h":!0}),c(je)!=="svelte-1pe9yqy"&&(je.innerHTML=fl),vt=o(e),be=M(e,"P",{"data-svelte-h":!0}),c(be)!=="svelte-qg1y4e"&&(be.textContent=cl),It=o(e),d($e.$$.fragment,e),At=o(e),ve=M(e,"P",{}),Lt(ve).forEach(l),this.h()},h(){dl(i,"name","hf:doc:metadata"),dl(i,"content",Wl)},m(e,t){Vt(document.head,i),a(e,f,t),a(e,s,t),a(e,m,t),w(p,e,t),a(e,r,t),a(e,g,t),a(e,Ie,t),a(e,X,t),a(e,Ae,t),a(e,v,t),a(e,We,t),a(e,I,t),a(e,Ze,t),a(e,A,t),a(e,xe,t),w(W,e,t),a(e,Re,t),a(e,Z,t),a(e,Le,t),w(x,e,t),a(e,Ve,t),a(e,R,t),a(e,Ne,t),a(e,L,t),a(e,Ge,t),a(e,V,t),a(e,ze,t),w(N,e,t),a(e,Be,t),a(e,G,t),a(e,Fe,t),w(z,e,t),a(e,Ye,t),w(B,e,t),a(e,ke,t),w(b,e,t),a(e,Se,t),w(F,e,t),a(e,He,t),a(e,Y,t),a(e,Ee,t),a(e,k,t),a(e,Qe,t),w(S,e,t),a(e,Pe,t),a(e,H,t),a(e,qe,t),w(E,e,t),a(e,De,t),w($,e,t),a(e,Oe,t),w(Q,e,t),a(e,Ke,t),a(e,P,t),a(e,et,t),a(e,C,t),Vt(C,Xe),Vt(C,Rt),w(q,C,null),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,it,t),w(ee,e,t),a(e,st,t),a(e,te,t),a(e,rt,t),w(le,e,t),a(e,nt,t),w(ae,e,t),a(e,ot,t),a(e,ie,t),a(e,mt,t),a(e,se,t),a(e,pt,t),a(e,re,t),a(e,ut,t),w(ne,e,t),a(e,Mt,t),w(oe,e,t),a(e,ft,t),a(e,me,t),a(e,ct,t),a(e,pe,t),a(e,ht,t),w(ue,e,t),a(e,dt,t),a(e,Me,t),a(e,wt,t),w(fe,e,t),a(e,yt,t),w(ce,e,t),a(e,Tt,t),a(e,he,t),a(e,Jt,t),a(e,de,t),a(e,gt,t),w(we,e,t),a(e,Ut,t),a(e,ye,t),a(e,_t,t),w(Te,e,t),a(e,jt,t),w(Je,e,t),a(e,bt,t),a(e,ge,t),a(e,$t,t),w(Ue,e,t),a(e,Ct,t),a(e,_e,t),a(e,Xt,t),a(e,je,t),a(e,vt,t),a(e,be,t),a(e,It,t),w($e,e,t),a(e,At,t),a(e,ve,t),Wt=!0},p(e,[t]){const Ce={};t&2&&(Ce.$$scope={dirty:t,ctx:e}),b.$set(Ce);const hl={};t&2&&(hl.$$scope={dirty:t,ctx:e}),$.$set(hl)},i(e){Wt||(y(p.$$.fragment,e),y(W.$$.fragment,e),y(x.$$.fragment,e),y(N.$$.fragment,e),y(z.$$.fragment,e),y(B.$$.fragment,e),y(b.$$.fragment,e),y(F.$$.fragment,e),y(S.$$.fragment,e),y(E.$$.fragment,e),y($.$$.fragment,e),y(Q.$$.fragment,e),y(q.$$.fragment,e),y(O.$$.fragment,e),y(ee.$$.fragment,e),y(le.$$.fragment,e),y(ae.$$.fragment,e),y(ne.$$.fragment,e),y(oe.$$.fragment,e),y(ue.$$.fragment,e),y(fe.$$.fragment,e),y(ce.$$.fragment,e),y(we.$$.fragment,e),y(Te.$$.fragment,e),y(Je.$$.fragment,e),y(Ue.$$.fragment,e),y($e.$$.fragment,e),Wt=!0)},o(e){T(p.$$.fragment,e),T(W.$$.fragment,e),T(x.$$.fragment,e),T(N.$$.fragment,e),T(z.$$.fragment,e),T(B.$$.fragment,e),T(b.$$.fragment,e),T(F.$$.fragment,e),T(S.$$.fragment,e),T(E.$$.fragment,e),T($.$$.fragment,e),T(Q.$$.fragment,e),T(q.$$.fragment,e),T(O.$$.fragment,e),T(ee.$$.fragment,e),T(le.$$.fragment,e),T(ae.$$.fragment,e),T(ne.$$.fragment,e),T(oe.$$.fragment,e),T(ue.$$.fragment,e),T(fe.$$.fragment,e),T(ce.$$.fragment,e),T(we.$$.fragment,e),T(Te.$$.fragment,e),T(Je.$$.fragment,e),T(Ue.$$.fragment,e),T($e.$$.fragment,e),Wt=!1},d(e){e&&(l(f),l(s),l(m),l(r),l(g),l(Ie),l(X),l(Ae),l(v),l(We),l(I),l(Ze),l(A),l(xe),l(Re),l(Z),l(Le),l(Ve),l(R),l(Ne),l(L),l(Ge),l(V),l(ze),l(Be),l(G),l(Fe),l(Ye),l(ke),l(Se),l(He),l(Y),l(Ee),l(k),l(Qe),l(Pe),l(H),l(qe),l(De),l(Oe),l(Ke),l(P),l(et),l(C),l(tt),l(D),l(lt),l(at),l(K),l(it),l(st),l(te),l(rt),l(nt),l(ot),l(ie),l(mt),l(se),l(pt),l(re),l(ut),l(Mt),l(ft),l(me),l(ct),l(pe),l(ht),l(dt),l(Me),l(wt),l(yt),l(Tt),l(he),l(Jt),l(de),l(gt),l(Ut),l(ye),l(_t),l(jt),l(bt),l(ge),l($t),l(Ct),l(_e),l(Xt),l(je),l(vt),l(be),l(It),l(At),l(ve)),l(i),J(p,e),J(W,e),J(x,e),J(N,e),J(z,e),J(B,e),J(b,e),J(F,e),J(S,e),J(E,e),J($,e),J(Q,e),J(q),J(O,e),J(ee,e),J(le,e),J(ae,e),J(ne,e),J(oe,e),J(ue,e),J(fe,e),J(ce,e),J(we,e),J(Te,e),J(Je,e),J(Ue,e),J($e,e)}}}const Wl='{"title":"Train with a script","local":"train-with-a-script","sections":[{"title":"Setup","local":"setup","sections":[],"depth":2},{"title":"Run a script","local":"run-a-script","sections":[],"depth":2},{"title":"Distributed training and mixed precision","local":"distributed-training-and-mixed-precision","sections":[],"depth":2},{"title":"Run a script on a TPU","local":"run-a-script-on-a-tpu","sections":[],"depth":2},{"title":"Run a script with 🤗 Accelerate","local":"run-a-script-with--accelerate","sections":[],"depth":2},{"title":"Use a custom dataset","local":"use-a-custom-dataset","sections":[],"depth":2},{"title":"Test a script","local":"test-a-script","sections":[],"depth":2},{"title":"Resume training from checkpoint","local":"resume-training-from-checkpoint","sections":[],"depth":2},{"title":"Share your model","local":"share-your-model","sections":[],"depth":2}],"depth":1}';function Zl(_){return Tl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Gl extends Jl{constructor(i){super(),gl(this,i,Zl,Al,yl,{})}}export{Gl as component};
