import{s as Jl,o as gl,n as Rt}from"../chunks/scheduler.25b97de1.js";import{S as Ul,i as _l,g as u,s as r,r as c,A as jl,h as M,f as l,c as n,j as Nt,u as h,x as J,k as yl,y as Vt,a,v as d,d as w,t as y,w as T}from"../chunks/index.d9030fc9.js";import{C as U}from"../chunks/CodeBlock.e6cd0d95.js";import{F as Tl,M as Gt}from"../chunks/Markdown.7217f838.js";import{H as j,E as bl}from"../chunks/EditOnGithub.91d95064.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/google-t5/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:"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=f,s=r(),c(m.$$.fragment)},l(o){i=M(o,"P",{"data-svelte-h":!0}),J(i)!=="svelte-v5e4st"&&(i.innerHTML=f),s=n(o),h(m.$$.fragment,o)},m(o,g){a(o,i,g),a(o,s,g),d(m,o,g),p=!0},p:Rt,i(o){p||(w(m.$$.fragment,o),p=!0)},o(o){y(m.$$.fragment,o),p=!1},d(o){o&&(l(i),l(s)),T(m,o)}}}function Cl(_){let i,f;return i=new Gt({props:{$$slots:{default:[$l]},$$scope:{ctx:_}}}),{c(){c(i.$$.fragment)},l(s){h(i.$$.fragment,s)},m(s,m){d(i,s,m),f=!0},p(s,m){const p={};m&2&&(p.$$scope={dirty:m,ctx:s}),i.$set(p)},i(s){f||(w(i.$$.fragment,s),f=!0)},o(s){y(i.$$.fragment,s),f=!1},d(s){T(i,s)}}}function Xl(_){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/google-t5/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:"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=f,s=r(),c(m.$$.fragment)},l(o){i=M(o,"P",{"data-svelte-h":!0}),J(i)!=="svelte-1aaykpp"&&(i.innerHTML=f),s=n(o),h(m.$$.fragment,o)},m(o,g){a(o,i,g),a(o,s,g),d(m,o,g),p=!0},p:Rt,i(o){p||(w(m.$$.fragment,o),p=!0)},o(o){y(m.$$.fragment,o),p=!1},d(o){o&&(l(i),l(s)),T(m,o)}}}function vl(_){let i,f;return i=new Gt({props:{$$slots:{default:[Xl]},$$scope:{ctx:_}}}),{c(){c(i.$$.fragment)},l(s){h(i.$$.fragment,s)},m(s,m){d(i,s,m),f=!0},p(s,m){const p={};m&2&&(p.$$scope={dirty:m,ctx:s}),i.$set(p)},i(s){f||(w(i.$$.fragment,s),f=!0)},o(s){y(i.$$.fragment,s),f=!1},d(s){T(i,s)}}}function Il(_){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:"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=f,s=r(),c(m.$$.fragment)},l(o){i=M(o,"P",{"data-svelte-h":!0}),J(i)!=="svelte-j1gqk0"&&(i.innerHTML=f),s=n(o),h(m.$$.fragment,o)},m(o,g){a(o,i,g),a(o,s,g),d(m,o,g),p=!0},p:Rt,i(o){p||(w(m.$$.fragment,o),p=!0)},o(o){y(m.$$.fragment,o),p=!1},d(o){o&&(l(i),l(s)),T(m,o)}}}function Al(_){let i,f;return i=new Gt({props:{$$slots:{default:[Il]},$$scope:{ctx:_}}}),{c(){c(i.$$.fragment)},l(s){h(i.$$.fragment,s)},m(s,m){d(i,s,m),f=!0},p(s,m){const p={};m&2&&(p.$$scope={dirty:m,ctx:s}),i.$set(p)},i(s){f||(w(i.$$.fragment,s),f=!0)},o(s){y(i.$$.fragment,s),f=!1},d(s){T(i,s)}}}function Wl(_){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:"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=f,s=r(),c(m.$$.fragment)},l(o){i=M(o,"P",{"data-svelte-h":!0}),J(i)!=="svelte-1ww3mmi"&&(i.innerHTML=f),s=n(o),h(m.$$.fragment,o)},m(o,g){a(o,i,g),a(o,s,g),d(m,o,g),p=!0},p:Rt,i(o){p||(w(m.$$.fragment,o),p=!0)},o(o){y(m.$$.fragment,o),p=!1},d(o){o&&(l(i),l(s)),T(m,o)}}}function Zl(_){let i,f;return i=new Gt({props:{$$slots:{default:[Wl]},$$scope:{ctx:_}}}),{c(){c(i.$$.fragment)},l(s){h(i.$$.fragment,s)},m(s,m){d(i,s,m),f=!0},p(s,m){const p={};m&2&&(p.$$scope={dirty:m,ctx:s}),i.$set(p)},i(s){f||(w(i.$$.fragment,s),f=!0)},o(s){y(i.$$.fragment,s),f=!1},d(s){T(i,s)}}}function xl(_){let i,f,s,m,p,o,g,zt='Along with the 🤗 Transformers <a href="./notebooks">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>.',Ae,X,Bt='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.',We,v,Ft="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.",Ze,I,Yt='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.',xe,A,kt='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.',Re,W,Ge,Z,St="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,Ne,R,Ht="For older versions of the example scripts, click on the toggle below:",Ve,G,Et='<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>',ze,L,Qt="Then switch your current clone of 🤗 Transformers to a specific version, like v3.5.1 for example:",Be,N,Fe,V,Pt="After you’ve setup the correct library version, navigate to the example folder of your choice and install the example specific requirements:",Ye,z,ke,B,Se,b,He,F,Ee,Y,Dt='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:',Qe,k,qt="<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>",Pe,S,De,H,Ot='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,Oe,$,Ke,Q,et,P,Kt='🤗 <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:',tt,C,ve,el="Note: As Accelerate is rapidly developing, the git version of accelerate must be installed to run the scripts",Lt,D,lt,q,tl="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:",at,O,it,K,ll="Test your setup to make sure it is configured correctly:",st,ee,rt,te,al="Now you are ready to launch the training:",nt,le,ot,ae,mt,ie,il="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:",pt,se,sl="<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>",ut,re,rl="A summarization script using a custom dataset would look like this:",Mt,ne,ft,oe,ct,me,nl="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:",ht,pe,ol="<li><code>max_train_samples</code></li> <li><code>max_eval_samples</code></li> <li><code>max_predict_samples</code></li>",dt,ue,wt,Me,ml="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:",yt,fe,Tt,ce,Jt,he,pl="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.",gt,de,ul="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>:",Ut,we,_t,ye,Ml="The second method uses the <code>resume_from_checkpoint path_to_specific_checkpoint</code> argument to resume training from a specific checkpoint folder.",jt,Te,bt,Je,$t,ge,fl='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:',Ct,Ue,Xt,_e,cl="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>.",vt,je,hl="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.",It,be,dl="The following example shows how to upload a model with a specific repository name:",At,$e,Wt,Ce,Zt,Ie,xt;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 Tl({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[vl],pytorch:[Cl]},$$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:"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}}),E=new j({props:{title:"Run a script on a TPU",local:"run-a-script-on-a-tpu",headingTag:"h2"}}),$=new Tl({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Zl],pytorch:[Al]},$$scope:{ctx:_}}}),Q=new j({props:{title:"Run a script with 🤗 Accelerate",local:"run-a-script-with--accelerate",headingTag:"h2"}}),D=new U({props:{code:"cGlwJTIwaW5zdGFsbCUyMGdpdCUyQmh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmh1Z2dpbmdmYWNlJTJGYWNjZWxlcmF0ZQ==",highlighted:"pip install git+https://github.com/huggingface/accelerate",wrap:!1}}),O=new U({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZw==",highlighted:"accelerate config",wrap:!1}}),ee=new U({props:{code:"YWNjZWxlcmF0ZSUyMHRlc3Q=",highlighted:'accelerate <span class="hljs-built_in">test</span>',wrap:!1}}),le=new U({props:{code:"YWNjZWxlcmF0ZSUyMGxhdW5jaCUyMHJ1bl9zdW1tYXJpemF0aW9uX25vX3RyYWluZXIucHklMjAlNUMlMEElMjAlMjAlMjAlMjAtLW1vZGVsX25hbWVfb3JfcGF0aCUyMGdvb2dsZS10NSUyRnQ1LXNtYWxsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kYXRhc2V0X25hbWUlMjBjbm5fZGFpbHltYWlsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kYXRhc2V0X2NvbmZpZyUyMCUyMjMuMC4wJTIyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1zb3VyY2VfcHJlZml4JTIwJTIyc3VtbWFyaXplJTNBJTIwJTIyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdXRwdXRfZGlyJTIwfiUyRnRtcCUyRnRzdC1zdW1tYXJpemF0aW9u",highlighted:`accelerate launch run_summarization_no_trainer.py \\
    --model_name_or_path google-t5/t5-small \\
    --dataset_name cnn_dailymail \\
    --dataset_config <span class="hljs-string">&quot;3.0.0&quot;</span> \\
    --source_prefix <span class="hljs-string">&quot;summarize: &quot;</span> \\
    --output_dir ~/tmp/tst-summarization`,wrap:!1}}),ae=new j({props:{title:"Use a custom dataset",local:"use-a-custom-dataset",headingTag:"h2"}}),ne=new U({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjBnb29nbGUtdDUlMkZ0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXRyYWluX2ZpbGUlMjBwYXRoX3RvX2Nzdl9vcl9qc29ubGluZXNfZmlsZSUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tdmFsaWRhdGlvbl9maWxlJTIwcGF0aF90b19jc3Zfb3JfanNvbmxpbmVzX2ZpbGUlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXRleHRfY29sdW1uJTIwdGV4dF9jb2x1bW5fbmFtZSUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tc3VtbWFyeV9jb2x1bW4lMjBzdW1tYXJ5X2NvbHVtbl9uYW1lJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1zb3VyY2VfcHJlZml4JTIwJTIyc3VtbWFyaXplJTNBJTIwJTIyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdXRwdXRfZGlyJTIwJTJGdG1wJTJGdHN0LXN1bW1hcml6YXRpb24lMjAlNUMlMEElMjAlMjAlMjAlMjAtLW92ZXJ3cml0ZV9vdXRwdXRfZGlyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX3RyYWluX2JhdGNoX3NpemUlM0Q0JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX2V2YWxfYmF0Y2hfc2l6ZSUzRDQlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXByZWRpY3Rfd2l0aF9nZW5lcmF0ZQ==",highlighted:`python examples/pytorch/summarization/run_summarization.py \\
    --model_name_or_path google-t5/t5-small \\
    --do_train \\
    --do_eval \\
    --train_file path_to_csv_or_jsonlines_file \\
    --validation_file path_to_csv_or_jsonlines_file \\
    --text_column text_column_name \\
    --summary_column summary_column_name \\
    --source_prefix <span class="hljs-string">&quot;summarize: &quot;</span> \\
    --output_dir /tmp/tst-summarization \\
    --overwrite_output_dir \\
    --per_device_train_batch_size=4 \\
    --per_device_eval_batch_size=4 \\
    --predict_with_generate`,wrap:!1}}),oe=new j({props:{title:"Test a script",local:"test-a-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}}),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:"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}}),Te=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}}),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:"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 bl({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/run_scripts.md"}}),{c(){i=u("meta"),f=r(),s=u("p"),m=r(),c(p.$$.fragment),o=r(),g=u("p"),g.innerHTML=zt,Ae=r(),X=u("p"),X.innerHTML=Bt,We=r(),v=u("p"),v.textContent=Ft,Ze=r(),I=u("p"),I.innerHTML=Yt,xe=r(),A=u("p"),A.innerHTML=kt,Re=r(),c(W.$$.fragment),Ge=r(),Z=u("p"),Z.innerHTML=St,Le=r(),c(x.$$.fragment),Ne=r(),R=u("p"),R.textContent=Ht,Ve=r(),G=u("details"),G.innerHTML=Et,ze=r(),L=u("p"),L.textContent=Qt,Be=r(),c(N.$$.fragment),Fe=r(),V=u("p"),V.textContent=Pt,Ye=r(),c(z.$$.fragment),ke=r(),c(B.$$.fragment),Se=r(),c(b.$$.fragment),He=r(),c(F.$$.fragment),Ee=r(),Y=u("p"),Y.innerHTML=Dt,Qe=r(),k=u("ul"),k.innerHTML=qt,Pe=r(),c(S.$$.fragment),De=r(),H=u("p"),H.innerHTML=Ot,qe=r(),c(E.$$.fragment),Oe=r(),c($.$$.fragment),Ke=r(),c(Q.$$.fragment),et=r(),P=u("p"),P.innerHTML=Kt,tt=r(),C=u("blockquote"),ve=u("p"),ve.textContent=el,Lt=r(),c(D.$$.fragment),lt=r(),q=u("p"),q.innerHTML=tl,at=r(),c(O.$$.fragment),it=r(),K=u("p"),K.textContent=ll,st=r(),c(ee.$$.fragment),rt=r(),te=u("p"),te.textContent=al,nt=r(),c(le.$$.fragment),ot=r(),c(ae.$$.fragment),mt=r(),ie=u("p"),ie.textContent=il,pt=r(),se=u("ul"),se.innerHTML=sl,ut=r(),re=u("p"),re.textContent=rl,Mt=r(),c(ne.$$.fragment),ft=r(),c(oe.$$.fragment),ct=r(),me=u("p"),me.textContent=nl,ht=r(),pe=u("ul"),pe.innerHTML=ol,dt=r(),c(ue.$$.fragment),wt=r(),Me=u("p"),Me.innerHTML=ml,yt=r(),c(fe.$$.fragment),Tt=r(),c(ce.$$.fragment),Jt=r(),he=u("p"),he.textContent=pl,gt=r(),de=u("p"),de.innerHTML=ul,Ut=r(),c(we.$$.fragment),_t=r(),ye=u("p"),ye.innerHTML=Ml,jt=r(),c(Te.$$.fragment),bt=r(),c(Je.$$.fragment),$t=r(),ge=u("p"),ge.innerHTML=fl,Ct=r(),c(Ue.$$.fragment),Xt=r(),_e=u("p"),_e.innerHTML=cl,vt=r(),je=u("p"),je.innerHTML=hl,It=r(),be=u("p"),be.textContent=dl,At=r(),c($e.$$.fragment),Wt=r(),c(Ce.$$.fragment),Zt=r(),Ie=u("p"),this.h()},l(e){const t=jl("svelte-u9bgzb",document.head);i=M(t,"META",{name:!0,content:!0}),t.forEach(l),f=n(e),s=M(e,"P",{}),Nt(s).forEach(l),m=n(e),h(p.$$.fragment,e),o=n(e),g=M(e,"P",{"data-svelte-h":!0}),J(g)!=="svelte-1c1p3io"&&(g.innerHTML=zt),Ae=n(e),X=M(e,"P",{"data-svelte-h":!0}),J(X)!=="svelte-1gwco66"&&(X.innerHTML=Bt),We=n(e),v=M(e,"P",{"data-svelte-h":!0}),J(v)!=="svelte-ehpuaj"&&(v.textContent=Ft),Ze=n(e),I=M(e,"P",{"data-svelte-h":!0}),J(I)!=="svelte-z30sjv"&&(I.innerHTML=Yt),xe=n(e),A=M(e,"P",{"data-svelte-h":!0}),J(A)!=="svelte-1muwvtv"&&(A.innerHTML=kt),Re=n(e),h(W.$$.fragment,e),Ge=n(e),Z=M(e,"P",{"data-svelte-h":!0}),J(Z)!=="svelte-1mgxfwl"&&(Z.innerHTML=St),Le=n(e),h(x.$$.fragment,e),Ne=n(e),R=M(e,"P",{"data-svelte-h":!0}),J(R)!=="svelte-1xawyut"&&(R.textContent=Ht),Ve=n(e),G=M(e,"DETAILS",{"data-svelte-h":!0}),J(G)!=="svelte-145d76l"&&(G.innerHTML=Et),ze=n(e),L=M(e,"P",{"data-svelte-h":!0}),J(L)!=="svelte-64mt19"&&(L.textContent=Qt),Be=n(e),h(N.$$.fragment,e),Fe=n(e),V=M(e,"P",{"data-svelte-h":!0}),J(V)!=="svelte-fgl2z5"&&(V.textContent=Pt),Ye=n(e),h(z.$$.fragment,e),ke=n(e),h(B.$$.fragment,e),Se=n(e),h(b.$$.fragment,e),He=n(e),h(F.$$.fragment,e),Ee=n(e),Y=M(e,"P",{"data-svelte-h":!0}),J(Y)!=="svelte-1c1svkh"&&(Y.innerHTML=Dt),Qe=n(e),k=M(e,"UL",{"data-svelte-h":!0}),J(k)!=="svelte-12spge2"&&(k.innerHTML=qt),Pe=n(e),h(S.$$.fragment,e),De=n(e),H=M(e,"P",{"data-svelte-h":!0}),J(H)!=="svelte-1l3ohuh"&&(H.innerHTML=Ot),qe=n(e),h(E.$$.fragment,e),Oe=n(e),h($.$$.fragment,e),Ke=n(e),h(Q.$$.fragment,e),et=n(e),P=M(e,"P",{"data-svelte-h":!0}),J(P)!=="svelte-12o0ukl"&&(P.innerHTML=Kt),tt=n(e),C=M(e,"BLOCKQUOTE",{});var Xe=Nt(C);ve=M(Xe,"P",{"data-svelte-h":!0}),J(ve)!=="svelte-j7gn57"&&(ve.textContent=el),Lt=n(Xe),h(D.$$.fragment,Xe),Xe.forEach(l),lt=n(e),q=M(e,"P",{"data-svelte-h":!0}),J(q)!=="svelte-4ovdqo"&&(q.innerHTML=tl),at=n(e),h(O.$$.fragment,e),it=n(e),K=M(e,"P",{"data-svelte-h":!0}),J(K)!=="svelte-182jy9q"&&(K.textContent=ll),st=n(e),h(ee.$$.fragment,e),rt=n(e),te=M(e,"P",{"data-svelte-h":!0}),J(te)!=="svelte-15segnh"&&(te.textContent=al),nt=n(e),h(le.$$.fragment,e),ot=n(e),h(ae.$$.fragment,e),mt=n(e),ie=M(e,"P",{"data-svelte-h":!0}),J(ie)!=="svelte-102gssu"&&(ie.textContent=il),pt=n(e),se=M(e,"UL",{"data-svelte-h":!0}),J(se)!=="svelte-1jtimg7"&&(se.innerHTML=sl),ut=n(e),re=M(e,"P",{"data-svelte-h":!0}),J(re)!=="svelte-1xw9de2"&&(re.textContent=rl),Mt=n(e),h(ne.$$.fragment,e),ft=n(e),h(oe.$$.fragment,e),ct=n(e),me=M(e,"P",{"data-svelte-h":!0}),J(me)!=="svelte-1djig5e"&&(me.textContent=nl),ht=n(e),pe=M(e,"UL",{"data-svelte-h":!0}),J(pe)!=="svelte-14g5f8g"&&(pe.innerHTML=ol),dt=n(e),h(ue.$$.fragment,e),wt=n(e),Me=M(e,"P",{"data-svelte-h":!0}),J(Me)!=="svelte-1rlkz6g"&&(Me.innerHTML=ml),yt=n(e),h(fe.$$.fragment,e),Tt=n(e),h(ce.$$.fragment,e),Jt=n(e),he=M(e,"P",{"data-svelte-h":!0}),J(he)!=="svelte-pdl903"&&(he.textContent=pl),gt=n(e),de=M(e,"P",{"data-svelte-h":!0}),J(de)!=="svelte-1gat20q"&&(de.innerHTML=ul),Ut=n(e),h(we.$$.fragment,e),_t=n(e),ye=M(e,"P",{"data-svelte-h":!0}),J(ye)!=="svelte-z1wjdg"&&(ye.innerHTML=Ml),jt=n(e),h(Te.$$.fragment,e),bt=n(e),h(Je.$$.fragment,e),$t=n(e),ge=M(e,"P",{"data-svelte-h":!0}),J(ge)!=="svelte-1l22jqe"&&(ge.innerHTML=fl),Ct=n(e),h(Ue.$$.fragment,e),Xt=n(e),_e=M(e,"P",{"data-svelte-h":!0}),J(_e)!=="svelte-27u38x"&&(_e.innerHTML=cl),vt=n(e),je=M(e,"P",{"data-svelte-h":!0}),J(je)!=="svelte-1pe9yqy"&&(je.innerHTML=hl),It=n(e),be=M(e,"P",{"data-svelte-h":!0}),J(be)!=="svelte-qg1y4e"&&(be.textContent=dl),At=n(e),h($e.$$.fragment,e),Wt=n(e),h(Ce.$$.fragment,e),Zt=n(e),Ie=M(e,"P",{}),Nt(Ie).forEach(l),this.h()},h(){yl(i,"name","hf:doc:metadata"),yl(i,"content",Rl)},m(e,t){Vt(document.head,i),a(e,f,t),a(e,s,t),a(e,m,t),d(p,e,t),a(e,o,t),a(e,g,t),a(e,Ae,t),a(e,X,t),a(e,We,t),a(e,v,t),a(e,Ze,t),a(e,I,t),a(e,xe,t),a(e,A,t),a(e,Re,t),d(W,e,t),a(e,Ge,t),a(e,Z,t),a(e,Le,t),d(x,e,t),a(e,Ne,t),a(e,R,t),a(e,Ve,t),a(e,G,t),a(e,ze,t),a(e,L,t),a(e,Be,t),d(N,e,t),a(e,Fe,t),a(e,V,t),a(e,Ye,t),d(z,e,t),a(e,ke,t),d(B,e,t),a(e,Se,t),d(b,e,t),a(e,He,t),d(F,e,t),a(e,Ee,t),a(e,Y,t),a(e,Qe,t),a(e,k,t),a(e,Pe,t),d(S,e,t),a(e,De,t),a(e,H,t),a(e,qe,t),d(E,e,t),a(e,Oe,t),d($,e,t),a(e,Ke,t),d(Q,e,t),a(e,et,t),a(e,P,t),a(e,tt,t),a(e,C,t),Vt(C,ve),Vt(C,Lt),d(D,C,null),a(e,lt,t),a(e,q,t),a(e,at,t),d(O,e,t),a(e,it,t),a(e,K,t),a(e,st,t),d(ee,e,t),a(e,rt,t),a(e,te,t),a(e,nt,t),d(le,e,t),a(e,ot,t),d(ae,e,t),a(e,mt,t),a(e,ie,t),a(e,pt,t),a(e,se,t),a(e,ut,t),a(e,re,t),a(e,Mt,t),d(ne,e,t),a(e,ft,t),d(oe,e,t),a(e,ct,t),a(e,me,t),a(e,ht,t),a(e,pe,t),a(e,dt,t),d(ue,e,t),a(e,wt,t),a(e,Me,t),a(e,yt,t),d(fe,e,t),a(e,Tt,t),d(ce,e,t),a(e,Jt,t),a(e,he,t),a(e,gt,t),a(e,de,t),a(e,Ut,t),d(we,e,t),a(e,_t,t),a(e,ye,t),a(e,jt,t),d(Te,e,t),a(e,bt,t),d(Je,e,t),a(e,$t,t),a(e,ge,t),a(e,Ct,t),d(Ue,e,t),a(e,Xt,t),a(e,_e,t),a(e,vt,t),a(e,je,t),a(e,It,t),a(e,be,t),a(e,At,t),d($e,e,t),a(e,Wt,t),d(Ce,e,t),a(e,Zt,t),a(e,Ie,t),xt=!0},p(e,[t]){const Xe={};t&2&&(Xe.$$scope={dirty:t,ctx:e}),b.$set(Xe);const wl={};t&2&&(wl.$$scope={dirty:t,ctx:e}),$.$set(wl)},i(e){xt||(w(p.$$.fragment,e),w(W.$$.fragment,e),w(x.$$.fragment,e),w(N.$$.fragment,e),w(z.$$.fragment,e),w(B.$$.fragment,e),w(b.$$.fragment,e),w(F.$$.fragment,e),w(S.$$.fragment,e),w(E.$$.fragment,e),w($.$$.fragment,e),w(Q.$$.fragment,e),w(D.$$.fragment,e),w(O.$$.fragment,e),w(ee.$$.fragment,e),w(le.$$.fragment,e),w(ae.$$.fragment,e),w(ne.$$.fragment,e),w(oe.$$.fragment,e),w(ue.$$.fragment,e),w(fe.$$.fragment,e),w(ce.$$.fragment,e),w(we.$$.fragment,e),w(Te.$$.fragment,e),w(Je.$$.fragment,e),w(Ue.$$.fragment,e),w($e.$$.fragment,e),w(Ce.$$.fragment,e),xt=!0)},o(e){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(D.$$.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),y(Ce.$$.fragment,e),xt=!1},d(e){e&&(l(f),l(s),l(m),l(o),l(g),l(Ae),l(X),l(We),l(v),l(Ze),l(I),l(xe),l(A),l(Re),l(Ge),l(Z),l(Le),l(Ne),l(R),l(Ve),l(G),l(ze),l(L),l(Be),l(Fe),l(V),l(Ye),l(ke),l(Se),l(He),l(Ee),l(Y),l(Qe),l(k),l(Pe),l(De),l(H),l(qe),l(Oe),l(Ke),l(et),l(P),l(tt),l(C),l(lt),l(q),l(at),l(it),l(K),l(st),l(rt),l(te),l(nt),l(ot),l(mt),l(ie),l(pt),l(se),l(ut),l(re),l(Mt),l(ft),l(ct),l(me),l(ht),l(pe),l(dt),l(wt),l(Me),l(yt),l(Tt),l(Jt),l(he),l(gt),l(de),l(Ut),l(_t),l(ye),l(jt),l(bt),l($t),l(ge),l(Ct),l(Xt),l(_e),l(vt),l(je),l(It),l(be),l(At),l(Wt),l(Zt),l(Ie)),l(i),T(p,e),T(W,e),T(x,e),T(N,e),T(z,e),T(B,e),T(b,e),T(F,e),T(S,e),T(E,e),T($,e),T(Q,e),T(D),T(O,e),T(ee,e),T(le,e),T(ae,e),T(ne,e),T(oe,e),T(ue,e),T(fe,e),T(ce,e),T(we,e),T(Te,e),T(Je,e),T(Ue,e),T($e,e),T(Ce,e)}}}const Rl='{"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 Gl(_){return gl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Fl extends Ul{constructor(i){super(),_l(this,i,Gl,xl,Jl,{})}}export{Fl as component};
