import{s as hl,o as Ul,n as xe}from"../chunks/scheduler.bdbef820.js";import{S as _l,i as gl,g as o,s as r,r as c,A as jl,h as f,f as l,c as s,j as Ve,u as w,x as h,k as Tl,y as Ne,a,v as J,d as y,t as T,w as d}from"../chunks/index.33f81d56.js";import{C as _}from"../chunks/CodeBlock.362b34a4.js";import{F as dl,M as Re}from"../chunks/Markdown.03194dea.js";import{H as j,E as $l}from"../chunks/EditOnGithub.a9246e21.js";function bl(g){let n,u=`예제 스크립트는 🤗 <a href="https://huggingface.co/docs/datasets/" rel="nofollow">Datasets</a> 라이브러리에서 데이터 세트를 다운로드하고 전처리합니다.
그런 다음 스크립트는 요약 기능을 지원하는 아키텍처에서 <a href="https://huggingface.co/docs/transformers/main_classes/trainer" rel="nofollow">Trainer</a>를 사용하여 데이터 세트를 미세 조정합니다.
다음 예는 <a href="https://huggingface.co/datasets/cnn_dailymail" rel="nofollow">CNN/DailyMail</a> 데이터 세트에서 <a href="https://huggingface.co/google-t5/t5-small" rel="nofollow">T5-small</a>을 미세 조정합니다.
T5 모델은 훈련 방식에 따라 추가 <code>source_prefix</code> 인수가 필요하며, 이 프롬프트는 요약 작업임을 T5에 알려줍니다.`,i,m,p;return m=new _({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(){n=o("p"),n.innerHTML=u,i=r(),c(m.$$.fragment)},l(M){n=f(M,"P",{"data-svelte-h":!0}),h(n)!=="svelte-3keakm"&&(n.innerHTML=u),i=s(M),w(m.$$.fragment,M)},m(M,U){a(M,n,U),a(M,i,U),J(m,M,U),p=!0},p:xe,i(M){p||(y(m.$$.fragment,M),p=!0)},o(M){T(m.$$.fragment,M),p=!1},d(M){M&&(l(n),l(i)),d(m,M)}}}function Cl(g){let n,u;return n=new Re({props:{$$slots:{default:[bl]},$$scope:{ctx:g}}}),{c(){c(n.$$.fragment)},l(i){w(n.$$.fragment,i)},m(i,m){J(n,i,m),u=!0},p(i,m){const p={};m&2&&(p.$$scope={dirty:m,ctx:i}),n.$set(p)},i(i){u||(y(n.$$.fragment,i),u=!0)},o(i){T(n.$$.fragment,i),u=!1},d(i){d(n,i)}}}function Xl(g){let n,u=`예제 스크립트는 🤗 <a href="https://huggingface.co/docs/datasets/" rel="nofollow">Datasets</a> 라이브러리에서 데이터 세트를 다운로드하고 전처리합니다.
그런 다음 스크립트는 요약 기능을 지원하는 아키텍처에서 Keras를 사용하여 데이터 세트를 미세 조정합니다.
다음 예는 <a href="https://huggingface.co/datasets/cnn_dailymail" rel="nofollow">CNN/DailyMail</a> 데이터 세트에서 <a href="https://huggingface.co/google-t5/t5-small" rel="nofollow">T5-small</a>을 미세 조정합니다.
T5 모델은 훈련 방식에 따라 추가 <code>source_prefix</code> 인수가 필요하며, 이 프롬프트는 요약 작업임을 T5에 알려줍니다.`,i,m,p;return m=new _({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(){n=o("p"),n.innerHTML=u,i=r(),c(m.$$.fragment)},l(M){n=f(M,"P",{"data-svelte-h":!0}),h(n)!=="svelte-12wph1d"&&(n.innerHTML=u),i=s(M),w(m.$$.fragment,M)},m(M,U){a(M,n,U),a(M,i,U),J(m,M,U),p=!0},p:xe,i(M){p||(y(m.$$.fragment,M),p=!0)},o(M){T(m.$$.fragment,M),p=!1},d(M){M&&(l(n),l(i)),d(m,M)}}}function Il(g){let n,u;return n=new Re({props:{$$slots:{default:[Xl]},$$scope:{ctx:g}}}),{c(){c(n.$$.fragment)},l(i){w(n.$$.fragment,i)},m(i,m){J(n,i,m),u=!0},p(i,m){const p={};m&2&&(p.$$scope={dirty:m,ctx:i}),n.$set(p)},i(i){u||(y(n.$$.fragment,i),u=!0)},o(i){T(n.$$.fragment,i),u=!1},d(i){d(n,i)}}}function Al(g){let n,u=`Tensor Processing Units (TPUs)는 성능을 가속화하기 위해 특별히 설계되었습니다.
PyTorch는 <a href="https://www.tensorflow.org/xla" rel="nofollow">XLA</a> 딥러닝 컴파일러와 함께 TPU를 지원합니다(자세한 내용은 <a href="https://github.com/pytorch/xla/blob/master/README.md" rel="nofollow">여기</a> 참조).
TPU를 사용하려면 <code>xla_spawn.py</code> 스크립트를 실행하고 <code>num_cores</code> 인수를 사용하여 사용하려는 TPU 코어 수를 설정합니다.`,i,m,p;return m=new _({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(){n=o("p"),n.innerHTML=u,i=r(),c(m.$$.fragment)},l(M){n=f(M,"P",{"data-svelte-h":!0}),h(n)!=="svelte-1uupy1q"&&(n.innerHTML=u),i=s(M),w(m.$$.fragment,M)},m(M,U){a(M,n,U),a(M,i,U),J(m,M,U),p=!0},p:xe,i(M){p||(y(m.$$.fragment,M),p=!0)},o(M){T(m.$$.fragment,M),p=!1},d(M){M&&(l(n),l(i)),d(m,M)}}}function vl(g){let n,u;return n=new Re({props:{$$slots:{default:[Al]},$$scope:{ctx:g}}}),{c(){c(n.$$.fragment)},l(i){w(n.$$.fragment,i)},m(i,m){J(n,i,m),u=!0},p(i,m){const p={};m&2&&(p.$$scope={dirty:m,ctx:i}),n.$set(p)},i(i){u||(y(n.$$.fragment,i),u=!0)},o(i){T(n.$$.fragment,i),u=!1},d(i){d(n,i)}}}function Wl(g){let n,u=`Tensor Processing Units (TPUs)는 성능을 가속화하기 위해 특별히 설계되었습니다.
TensorFlow 스크립트는 TPU를 훈련에 사용하기 위해 <a href="https://www.tensorflow.org/guide/distributed_training#tpustrategy" rel="nofollow"><code>TPUStrategy</code></a>를 활용합니다.
TPU를 사용하려면 TPU 리소스의 이름을 <code>tpu</code> 인수에 전달합니다.`,i,m,p;return m=new _({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(){n=o("p"),n.innerHTML=u,i=r(),c(m.$$.fragment)},l(M){n=f(M,"P",{"data-svelte-h":!0}),h(n)!=="svelte-14rbp0b"&&(n.innerHTML=u),i=s(M),w(m.$$.fragment,M)},m(M,U){a(M,n,U),a(M,i,U),J(m,M,U),p=!0},p:xe,i(M){p||(y(m.$$.fragment,M),p=!0)},o(M){T(m.$$.fragment,M),p=!1},d(M){M&&(l(n),l(i)),d(m,M)}}}function Zl(g){let n,u;return n=new Re({props:{$$slots:{default:[Wl]},$$scope:{ctx:g}}}),{c(){c(n.$$.fragment)},l(i){w(n.$$.fragment,i)},m(i,m){J(n,i,m),u=!0},p(i,m){const p={};m&2&&(p.$$scope={dirty:m,ctx:i}),n.$set(p)},i(i){u||(y(n.$$.fragment,i),u=!0)},o(i){T(n.$$.fragment,i),u=!1},d(i){d(n,i)}}}function Gl(g){let n,u,i,m,p,M,U,Be='🤗 Transformers 노트북과 함께 <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>, 또는 <a href="https://github.com/huggingface/transformers/tree/main/examples/flax" rel="nofollow">JAX/Flax</a>를 사용해 특정 태스크에 대한 모델을 훈련하는 방법을 보여주는 예제 스크립트도 있습니다.',vt,X,Fe=`또한 <a href="https://github.com/huggingface/transformers/tree/main/examples/research_projects" rel="nofollow">연구 프로젝트</a> 및 <a href="https://github.com/huggingface/transformers/tree/main/examples/legacy" rel="nofollow">레거시 예제</a>에서 대부분 커뮤니티에서 제공한 스크립트를 찾을 수 있습니다.
이러한 스크립트는 적극적으로 유지 관리되지 않으며 최신 버전의 라이브러리와 호환되지 않을 가능성이 높은 특정 버전의 🤗 Transformers를 필요로 합니다.`,Wt,I,ze=`예제 스크립트가 모든 문제에서 바로 작동하는 것은 아니며, 해결하려는 문제에 맞게 스크립트를 변경해야 할 수도 있습니다.
이를 위해 대부분의 스크립트에는 데이터 전처리 방법이 나와있어 필요에 따라 수정할 수 있습니다.`,Zt,A,Ye=`예제 스크립트에 구현하고 싶은 기능이 있으면 pull request를 제출하기 전에 <a href="https://discuss.huggingface.co/" rel="nofollow">포럼</a> 또는 <a href="https://github.com/huggingface/transformers/issues" rel="nofollow">이슈</a>에서 논의해 주세요.
버그 수정은 환영하지만 가독성을 희생하면서까지 더 많은 기능을 추가하는 pull request는 병합(merge)하지 않을 가능성이 높습니다.`,Gt,v,Se=`이 가이드에서는 <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/summarization" rel="nofollow">PyTorch</a> 및 <a href="https://github.com/huggingface/transformers/tree/main/examples/tensorflow/summarization" rel="nofollow">TensorFlow</a>에서 요약 훈련하는
스크립트 예제를 실행하는 방법을 설명합니다.
특별한 설명이 없는 한 모든 예제는 두 프레임워크 모두에서 작동할 것으로 예상됩니다.`,xt,W,Rt,Z,He="최신 버전의 예제 스크립트를 성공적으로 실행하려면 새 가상 환경에서 <strong>소스로부터 🤗 Transformers를 설치</strong>해야 합니다:",Lt,G,Vt,x,Ee="이전 버전의 예제 스크립트를 보려면 아래 토글을 클릭하세요:",Nt,R,ke='<summary>이전 버전의 🤗 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>',Bt,L,Qe="그리고 다음과 같이 복제(clone)해온 🤗 Transformers 버전을 특정 버전(예: v3.5.1)으로 전환하세요:",Ft,V,zt,N,Pe="올바른 라이브러리 버전을 설정한 후 원하는 예제 폴더로 이동하여 예제별로 라이브러리에 대한 요구 사항(requirements)을 설치합니다:",Yt,B,St,F,Ht,$,Et,z,kt,Y,De=`<a href="https://huggingface.co/docs/transformers/main_classes/trainer" rel="nofollow">Trainer</a> 클래스는 분산 훈련과 혼합 정밀도(mixed precision)를 지원하므로 스크립트에서도 사용할 수 있습니다.
이 두 가지 기능을 모두 활성화하려면 다음 두 가지를 설정해야 합니다:`,Qt,S,qe="<li><code>fp16</code> 인수를 추가해 혼합 정밀도(mixed precision)를 활성화합니다.</li> <li><code>nproc_per_node</code> 인수를 추가해 사용할 GPU 개수를 설정합니다.</li>",Pt,H,Dt,E,Oe=`TensorFlow 스크립트는 분산 훈련을 위해 <a href="https://www.tensorflow.org/guide/distributed_training#mirroredstrategy" rel="nofollow"><code>MirroredStrategy</code></a>를 활용하며, 훈련 스크립트에 인수를 추가할 필요가 없습니다.
다중 GPU 환경이라면, TensorFlow 스크립트는 기본적으로 여러 개의 GPU를 사용합니다.`,qt,k,Ot,b,Kt,Q,te,P,Ke=`🤗 <a href="https://huggingface.co/docs/accelerate" rel="nofollow">Accelerate</a>는 PyTorch 훈련 과정에 대한 완전한 가시성을 유지하면서 여러 유형의 설정(CPU 전용, 다중 GPU, TPU)에서 모델을 훈련할 수 있는 통합 방법을 제공하는 PyTorch 전용 라이브러리입니다.
🤗 Accelerate가 설치되어 있는지 확인하세요:`,ee,C,It,tl="참고: Accelerate는 빠르게 개발 중이므로 스크립트를 실행하려면 accelerate를 설치해야 합니다.",Le,D,le,q,el=`<code>run_summarization.py</code> 스크립트 대신 <code>run_summarization_no_trainer.py</code> 스크립트를 사용해야 합니다.
🤗 Accelerate 클래스가 지원되는 스크립트는 폴더에 <code>task_no_trainer.py</code> 파일이 있습니다.
다음 명령을 실행하여 구성 파일을 생성하고 저장합니다:`,ae,O,ne,K,ll="설정을 테스트하여 올바르게 구성되었는지 확인합니다:",ie,tt,re,et,al="이제 훈련을 시작할 준비가 되었습니다:",se,lt,Me,at,me,nt,nl=`요약 스크립트는 사용자 지정 데이터 세트가 CSV 또는 JSON 파일인 경우 지원합니다.
사용자 지정 데이터 세트를 사용하는 경우에는 몇 가지 추가 인수를 지정해야 합니다:`,pe,it,il="<li><code>train_file</code>과 <code>validation_file</code>은 훈련 및 검증 파일의 경로를 지정합니다.</li> <li><code>text_column</code>은 요약할 입력 텍스트입니다.</li> <li><code>summary_column</code>은 출력할 대상 텍스트입니다.</li>",oe,rt,rl="사용자 지정 데이터 세트를 사용하는 요약 스크립트는 다음과 같습니다:",fe,st,ue,Mt,ce,mt,sl="전체 데이터 세트를 대상으로 훈련을 완료하는데 꽤 오랜 시간이 걸리기 때문에, 작은 데이터 세트에서 모든 것이 예상대로 실행되는지 확인하는 것이 좋습니다.",we,pt,Ml="다음 인수를 사용하여 데이터 세트를 최대 샘플 수로 잘라냅니다:",Je,ot,ml="<li><code>max_train_samples</code></li> <li><code>max_eval_samples</code></li> <li><code>max_predict_samples</code></li>",ye,ft,Te,ut,pl=`모든 예제 스크립트가 <code>max_predict_samples</code> 인수를 지원하지는 않습니다.
스크립트가 이 인수를 지원하는지 확실하지 않은 경우 <code>-h</code> 인수를 추가하여 확인하세요:`,de,ct,he,wt,Ue,Jt,ol=`또 다른 유용한 옵션은 이전 체크포인트에서 훈련을 재개하는 것입니다.
이렇게 하면 훈련이 중단되더라도 처음부터 다시 시작하지 않고 중단한 부분부터 다시 시작할 수 있습니다.
체크포인트에서 훈련을 재개하는 방법에는 두 가지가 있습니다.`,_e,yt,fl=`첫 번째는 <code>output_dir previous_output_dir</code> 인수를 사용하여 <code>output_dir</code>에 저장된 최신 체크포인트부터 훈련을 재개하는 방법입니다.
이 경우 <code>overwrite_output_dir</code>을 제거해야 합니다:`,ge,Tt,je,dt,ul="두 번째는 <code>resume_from_checkpoint path_to_specific_checkpoint</code> 인수를 사용하여 특정 체크포인트 폴더에서 훈련을 재개하는 방법입니다.",$e,ht,be,Ut,Ce,_t,cl=`모든 스크립트는 최종 모델을 <a href="https://huggingface.co/models" rel="nofollow">Model Hub</a>에 업로드할 수 있습니다.
시작하기 전에 Hugging Face에 로그인했는지 확인하세요:`,Xe,gt,Ie,jt,wl=`그런 다음 스크립트에 <code>push_to_hub</code> 인수를 추가합니다.
이 인수는 Hugging Face 사용자 이름과 <code>output_dir</code>에 지정된 폴더 이름으로 저장소를 생성합니다.`,Ae,$t,Jl=`저장소에 특정 이름을 지정하려면 <code>push_to_hub_model_id</code> 인수를 사용하여 추가합니다.
저장소는 네임스페이스 아래에 자동으로 나열됩니다.
다음 예는 특정 저장소 이름으로 모델을 업로드하는 방법입니다:`,ve,bt,We,Ct,Ze,At,Ge;return p=new j({props:{title:"스크립트로 실행하기",local:"train-with-a-script",headingTag:"h1"}}),W=new j({props:{title:"설정하기",local:"setup",headingTag:"h2"}}),G=new _({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}}),V=new _({props:{code:"Z2l0JTIwY2hlY2tvdXQlMjB0YWdzJTJGdjMuNS4x",highlighted:"git checkout tags/v3.5.1",wrap:!1}}),B=new _({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1yJTIwcmVxdWlyZW1lbnRzLnR4dA==",highlighted:"pip install -r requirements.txt",wrap:!1}}),F=new j({props:{title:"스크립트 실행하기",local:"run-a-script",headingTag:"h2"}}),$=new dl({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Il],pytorch:[Cl]},$$scope:{ctx:g}}}),z=new j({props:{title:"혼합 정밀도(mixed precision)로 분산 훈련하기",local:"distributed-training-and-mixed-precision",headingTag:"h2"}}),H=new _({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}}),k=new j({props:{title:"TPU 위에서 스크립트 실행하기",local:"run-a-script-on-a-tpu",headingTag:"h2"}}),b=new dl({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Zl],pytorch:[vl]},$$scope:{ctx:g}}}),Q=new j({props:{title:"🤗 Accelerate로 스크립트 실행하기",local:"run-a-script-with-accelerate",headingTag:"h2"}}),D=new _({props:{code:"cGlwJTIwaW5zdGFsbCUyMGdpdCUyQmh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmh1Z2dpbmdmYWNlJTJGYWNjZWxlcmF0ZQ==",highlighted:"pip install git+https://github.com/huggingface/accelerate",wrap:!1}}),O=new _({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZw==",highlighted:"accelerate config",wrap:!1}}),tt=new _({props:{code:"YWNjZWxlcmF0ZSUyMHRlc3Q=",highlighted:'accelerate <span class="hljs-built_in">test</span>',wrap:!1}}),lt=new _({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}}),at=new j({props:{title:"사용자 정의 데이터 세트 사용하기",local:"use-a-custom-dataset",headingTag:"h2"}}),st=new _({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}}),Mt=new j({props:{title:"스크립트 테스트하기",local:"test-a-script",headingTag:"h2"}}),ft=new _({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}}),ct=new _({props:{code:"ZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTIwLWg=",highlighted:"examples/pytorch/summarization/run_summarization.py -h",wrap:!1}}),wt=new j({props:{title:"체크포인트(checkpoint)에서 훈련 이어서 하기",local:"resume-training-from-checkpoint",headingTag:"h2"}}),Tt=new _({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}}),ht=new _({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}}),Ut=new j({props:{title:"모델 공유하기",local:"share-your-model",headingTag:"h2"}}),gt=new _({props:{code:"aHVnZ2luZ2ZhY2UtY2xpJTIwbG9naW4=",highlighted:"huggingface-cli login",wrap:!1}}),bt=new _({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}}),Ct=new $l({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ko/run_scripts.md"}}),{c(){n=o("meta"),u=r(),i=o("p"),m=r(),c(p.$$.fragment),M=r(),U=o("p"),U.innerHTML=Be,vt=r(),X=o("p"),X.innerHTML=Fe,Wt=r(),I=o("p"),I.textContent=ze,Zt=r(),A=o("p"),A.innerHTML=Ye,Gt=r(),v=o("p"),v.innerHTML=Se,xt=r(),c(W.$$.fragment),Rt=r(),Z=o("p"),Z.innerHTML=He,Lt=r(),c(G.$$.fragment),Vt=r(),x=o("p"),x.textContent=Ee,Nt=r(),R=o("details"),R.innerHTML=ke,Bt=r(),L=o("p"),L.textContent=Qe,Ft=r(),c(V.$$.fragment),zt=r(),N=o("p"),N.textContent=Pe,Yt=r(),c(B.$$.fragment),St=r(),c(F.$$.fragment),Ht=r(),c($.$$.fragment),Et=r(),c(z.$$.fragment),kt=r(),Y=o("p"),Y.innerHTML=De,Qt=r(),S=o("ul"),S.innerHTML=qe,Pt=r(),c(H.$$.fragment),Dt=r(),E=o("p"),E.innerHTML=Oe,qt=r(),c(k.$$.fragment),Ot=r(),c(b.$$.fragment),Kt=r(),c(Q.$$.fragment),te=r(),P=o("p"),P.innerHTML=Ke,ee=r(),C=o("blockquote"),It=o("p"),It.textContent=tl,Le=r(),c(D.$$.fragment),le=r(),q=o("p"),q.innerHTML=el,ae=r(),c(O.$$.fragment),ne=r(),K=o("p"),K.textContent=ll,ie=r(),c(tt.$$.fragment),re=r(),et=o("p"),et.textContent=al,se=r(),c(lt.$$.fragment),Me=r(),c(at.$$.fragment),me=r(),nt=o("p"),nt.textContent=nl,pe=r(),it=o("ul"),it.innerHTML=il,oe=r(),rt=o("p"),rt.textContent=rl,fe=r(),c(st.$$.fragment),ue=r(),c(Mt.$$.fragment),ce=r(),mt=o("p"),mt.textContent=sl,we=r(),pt=o("p"),pt.textContent=Ml,Je=r(),ot=o("ul"),ot.innerHTML=ml,ye=r(),c(ft.$$.fragment),Te=r(),ut=o("p"),ut.innerHTML=pl,de=r(),c(ct.$$.fragment),he=r(),c(wt.$$.fragment),Ue=r(),Jt=o("p"),Jt.textContent=ol,_e=r(),yt=o("p"),yt.innerHTML=fl,ge=r(),c(Tt.$$.fragment),je=r(),dt=o("p"),dt.innerHTML=ul,$e=r(),c(ht.$$.fragment),be=r(),c(Ut.$$.fragment),Ce=r(),_t=o("p"),_t.innerHTML=cl,Xe=r(),c(gt.$$.fragment),Ie=r(),jt=o("p"),jt.innerHTML=wl,Ae=r(),$t=o("p"),$t.innerHTML=Jl,ve=r(),c(bt.$$.fragment),We=r(),c(Ct.$$.fragment),Ze=r(),At=o("p"),this.h()},l(t){const e=jl("svelte-u9bgzb",document.head);n=f(e,"META",{name:!0,content:!0}),e.forEach(l),u=s(t),i=f(t,"P",{}),Ve(i).forEach(l),m=s(t),w(p.$$.fragment,t),M=s(t),U=f(t,"P",{"data-svelte-h":!0}),h(U)!=="svelte-cb9dpp"&&(U.innerHTML=Be),vt=s(t),X=f(t,"P",{"data-svelte-h":!0}),h(X)!=="svelte-xygtck"&&(X.innerHTML=Fe),Wt=s(t),I=f(t,"P",{"data-svelte-h":!0}),h(I)!=="svelte-19ose0k"&&(I.textContent=ze),Zt=s(t),A=f(t,"P",{"data-svelte-h":!0}),h(A)!=="svelte-mixhy4"&&(A.innerHTML=Ye),Gt=s(t),v=f(t,"P",{"data-svelte-h":!0}),h(v)!=="svelte-1980krf"&&(v.innerHTML=Se),xt=s(t),w(W.$$.fragment,t),Rt=s(t),Z=f(t,"P",{"data-svelte-h":!0}),h(Z)!=="svelte-1ducwvi"&&(Z.innerHTML=He),Lt=s(t),w(G.$$.fragment,t),Vt=s(t),x=f(t,"P",{"data-svelte-h":!0}),h(x)!=="svelte-i8u7rm"&&(x.textContent=Ee),Nt=s(t),R=f(t,"DETAILS",{"data-svelte-h":!0}),h(R)!=="svelte-1pp84xd"&&(R.innerHTML=ke),Bt=s(t),L=f(t,"P",{"data-svelte-h":!0}),h(L)!=="svelte-18cv2w9"&&(L.textContent=Qe),Ft=s(t),w(V.$$.fragment,t),zt=s(t),N=f(t,"P",{"data-svelte-h":!0}),h(N)!=="svelte-1avflzf"&&(N.textContent=Pe),Yt=s(t),w(B.$$.fragment,t),St=s(t),w(F.$$.fragment,t),Ht=s(t),w($.$$.fragment,t),Et=s(t),w(z.$$.fragment,t),kt=s(t),Y=f(t,"P",{"data-svelte-h":!0}),h(Y)!=="svelte-1vvgf5c"&&(Y.innerHTML=De),Qt=s(t),S=f(t,"UL",{"data-svelte-h":!0}),h(S)!=="svelte-1wysnl1"&&(S.innerHTML=qe),Pt=s(t),w(H.$$.fragment,t),Dt=s(t),E=f(t,"P",{"data-svelte-h":!0}),h(E)!=="svelte-ps369g"&&(E.innerHTML=Oe),qt=s(t),w(k.$$.fragment,t),Ot=s(t),w(b.$$.fragment,t),Kt=s(t),w(Q.$$.fragment,t),te=s(t),P=f(t,"P",{"data-svelte-h":!0}),h(P)!=="svelte-1mmj90o"&&(P.innerHTML=Ke),ee=s(t),C=f(t,"BLOCKQUOTE",{});var Xt=Ve(C);It=f(Xt,"P",{"data-svelte-h":!0}),h(It)!=="svelte-18nhjp2"&&(It.textContent=tl),Le=s(Xt),w(D.$$.fragment,Xt),Xt.forEach(l),le=s(t),q=f(t,"P",{"data-svelte-h":!0}),h(q)!=="svelte-dnc8lj"&&(q.innerHTML=el),ae=s(t),w(O.$$.fragment,t),ne=s(t),K=f(t,"P",{"data-svelte-h":!0}),h(K)!=="svelte-1wr3wvk"&&(K.textContent=ll),ie=s(t),w(tt.$$.fragment,t),re=s(t),et=f(t,"P",{"data-svelte-h":!0}),h(et)!=="svelte-dp0etk"&&(et.textContent=al),se=s(t),w(lt.$$.fragment,t),Me=s(t),w(at.$$.fragment,t),me=s(t),nt=f(t,"P",{"data-svelte-h":!0}),h(nt)!=="svelte-8q6g2t"&&(nt.textContent=nl),pe=s(t),it=f(t,"UL",{"data-svelte-h":!0}),h(it)!=="svelte-1o9guy1"&&(it.innerHTML=il),oe=s(t),rt=f(t,"P",{"data-svelte-h":!0}),h(rt)!=="svelte-1gh72vz"&&(rt.textContent=rl),fe=s(t),w(st.$$.fragment,t),ue=s(t),w(Mt.$$.fragment,t),ce=s(t),mt=f(t,"P",{"data-svelte-h":!0}),h(mt)!=="svelte-e7bxnz"&&(mt.textContent=sl),we=s(t),pt=f(t,"P",{"data-svelte-h":!0}),h(pt)!=="svelte-4bvtew"&&(pt.textContent=Ml),Je=s(t),ot=f(t,"UL",{"data-svelte-h":!0}),h(ot)!=="svelte-14g5f8g"&&(ot.innerHTML=ml),ye=s(t),w(ft.$$.fragment,t),Te=s(t),ut=f(t,"P",{"data-svelte-h":!0}),h(ut)!=="svelte-11kw235"&&(ut.innerHTML=pl),de=s(t),w(ct.$$.fragment,t),he=s(t),w(wt.$$.fragment,t),Ue=s(t),Jt=f(t,"P",{"data-svelte-h":!0}),h(Jt)!=="svelte-13nxa0f"&&(Jt.textContent=ol),_e=s(t),yt=f(t,"P",{"data-svelte-h":!0}),h(yt)!=="svelte-1w6ffz1"&&(yt.innerHTML=fl),ge=s(t),w(Tt.$$.fragment,t),je=s(t),dt=f(t,"P",{"data-svelte-h":!0}),h(dt)!=="svelte-y9guuv"&&(dt.innerHTML=ul),$e=s(t),w(ht.$$.fragment,t),be=s(t),w(Ut.$$.fragment,t),Ce=s(t),_t=f(t,"P",{"data-svelte-h":!0}),h(_t)!=="svelte-4xiptz"&&(_t.innerHTML=cl),Xe=s(t),w(gt.$$.fragment,t),Ie=s(t),jt=f(t,"P",{"data-svelte-h":!0}),h(jt)!=="svelte-1cbnpsr"&&(jt.innerHTML=wl),Ae=s(t),$t=f(t,"P",{"data-svelte-h":!0}),h($t)!=="svelte-gowp8l"&&($t.innerHTML=Jl),ve=s(t),w(bt.$$.fragment,t),We=s(t),w(Ct.$$.fragment,t),Ze=s(t),At=f(t,"P",{}),Ve(At).forEach(l),this.h()},h(){Tl(n,"name","hf:doc:metadata"),Tl(n,"content",xl)},m(t,e){Ne(document.head,n),a(t,u,e),a(t,i,e),a(t,m,e),J(p,t,e),a(t,M,e),a(t,U,e),a(t,vt,e),a(t,X,e),a(t,Wt,e),a(t,I,e),a(t,Zt,e),a(t,A,e),a(t,Gt,e),a(t,v,e),a(t,xt,e),J(W,t,e),a(t,Rt,e),a(t,Z,e),a(t,Lt,e),J(G,t,e),a(t,Vt,e),a(t,x,e),a(t,Nt,e),a(t,R,e),a(t,Bt,e),a(t,L,e),a(t,Ft,e),J(V,t,e),a(t,zt,e),a(t,N,e),a(t,Yt,e),J(B,t,e),a(t,St,e),J(F,t,e),a(t,Ht,e),J($,t,e),a(t,Et,e),J(z,t,e),a(t,kt,e),a(t,Y,e),a(t,Qt,e),a(t,S,e),a(t,Pt,e),J(H,t,e),a(t,Dt,e),a(t,E,e),a(t,qt,e),J(k,t,e),a(t,Ot,e),J(b,t,e),a(t,Kt,e),J(Q,t,e),a(t,te,e),a(t,P,e),a(t,ee,e),a(t,C,e),Ne(C,It),Ne(C,Le),J(D,C,null),a(t,le,e),a(t,q,e),a(t,ae,e),J(O,t,e),a(t,ne,e),a(t,K,e),a(t,ie,e),J(tt,t,e),a(t,re,e),a(t,et,e),a(t,se,e),J(lt,t,e),a(t,Me,e),J(at,t,e),a(t,me,e),a(t,nt,e),a(t,pe,e),a(t,it,e),a(t,oe,e),a(t,rt,e),a(t,fe,e),J(st,t,e),a(t,ue,e),J(Mt,t,e),a(t,ce,e),a(t,mt,e),a(t,we,e),a(t,pt,e),a(t,Je,e),a(t,ot,e),a(t,ye,e),J(ft,t,e),a(t,Te,e),a(t,ut,e),a(t,de,e),J(ct,t,e),a(t,he,e),J(wt,t,e),a(t,Ue,e),a(t,Jt,e),a(t,_e,e),a(t,yt,e),a(t,ge,e),J(Tt,t,e),a(t,je,e),a(t,dt,e),a(t,$e,e),J(ht,t,e),a(t,be,e),J(Ut,t,e),a(t,Ce,e),a(t,_t,e),a(t,Xe,e),J(gt,t,e),a(t,Ie,e),a(t,jt,e),a(t,Ae,e),a(t,$t,e),a(t,ve,e),J(bt,t,e),a(t,We,e),J(Ct,t,e),a(t,Ze,e),a(t,At,e),Ge=!0},p(t,[e]){const Xt={};e&2&&(Xt.$$scope={dirty:e,ctx:t}),$.$set(Xt);const yl={};e&2&&(yl.$$scope={dirty:e,ctx:t}),b.$set(yl)},i(t){Ge||(y(p.$$.fragment,t),y(W.$$.fragment,t),y(G.$$.fragment,t),y(V.$$.fragment,t),y(B.$$.fragment,t),y(F.$$.fragment,t),y($.$$.fragment,t),y(z.$$.fragment,t),y(H.$$.fragment,t),y(k.$$.fragment,t),y(b.$$.fragment,t),y(Q.$$.fragment,t),y(D.$$.fragment,t),y(O.$$.fragment,t),y(tt.$$.fragment,t),y(lt.$$.fragment,t),y(at.$$.fragment,t),y(st.$$.fragment,t),y(Mt.$$.fragment,t),y(ft.$$.fragment,t),y(ct.$$.fragment,t),y(wt.$$.fragment,t),y(Tt.$$.fragment,t),y(ht.$$.fragment,t),y(Ut.$$.fragment,t),y(gt.$$.fragment,t),y(bt.$$.fragment,t),y(Ct.$$.fragment,t),Ge=!0)},o(t){T(p.$$.fragment,t),T(W.$$.fragment,t),T(G.$$.fragment,t),T(V.$$.fragment,t),T(B.$$.fragment,t),T(F.$$.fragment,t),T($.$$.fragment,t),T(z.$$.fragment,t),T(H.$$.fragment,t),T(k.$$.fragment,t),T(b.$$.fragment,t),T(Q.$$.fragment,t),T(D.$$.fragment,t),T(O.$$.fragment,t),T(tt.$$.fragment,t),T(lt.$$.fragment,t),T(at.$$.fragment,t),T(st.$$.fragment,t),T(Mt.$$.fragment,t),T(ft.$$.fragment,t),T(ct.$$.fragment,t),T(wt.$$.fragment,t),T(Tt.$$.fragment,t),T(ht.$$.fragment,t),T(Ut.$$.fragment,t),T(gt.$$.fragment,t),T(bt.$$.fragment,t),T(Ct.$$.fragment,t),Ge=!1},d(t){t&&(l(u),l(i),l(m),l(M),l(U),l(vt),l(X),l(Wt),l(I),l(Zt),l(A),l(Gt),l(v),l(xt),l(Rt),l(Z),l(Lt),l(Vt),l(x),l(Nt),l(R),l(Bt),l(L),l(Ft),l(zt),l(N),l(Yt),l(St),l(Ht),l(Et),l(kt),l(Y),l(Qt),l(S),l(Pt),l(Dt),l(E),l(qt),l(Ot),l(Kt),l(te),l(P),l(ee),l(C),l(le),l(q),l(ae),l(ne),l(K),l(ie),l(re),l(et),l(se),l(Me),l(me),l(nt),l(pe),l(it),l(oe),l(rt),l(fe),l(ue),l(ce),l(mt),l(we),l(pt),l(Je),l(ot),l(ye),l(Te),l(ut),l(de),l(he),l(Ue),l(Jt),l(_e),l(yt),l(ge),l(je),l(dt),l($e),l(be),l(Ce),l(_t),l(Xe),l(Ie),l(jt),l(Ae),l($t),l(ve),l(We),l(Ze),l(At)),l(n),d(p,t),d(W,t),d(G,t),d(V,t),d(B,t),d(F,t),d($,t),d(z,t),d(H,t),d(k,t),d(b,t),d(Q,t),d(D),d(O,t),d(tt,t),d(lt,t),d(at,t),d(st,t),d(Mt,t),d(ft,t),d(ct,t),d(wt,t),d(Tt,t),d(ht,t),d(Ut,t),d(gt,t),d(bt,t),d(Ct,t)}}}const xl='{"title":"스크립트로 실행하기","local":"train-with-a-script","sections":[{"title":"설정하기","local":"setup","sections":[],"depth":2},{"title":"스크립트 실행하기","local":"run-a-script","sections":[],"depth":2},{"title":"혼합 정밀도(mixed precision)로 분산 훈련하기","local":"distributed-training-and-mixed-precision","sections":[],"depth":2},{"title":"TPU 위에서 스크립트 실행하기","local":"run-a-script-on-a-tpu","sections":[],"depth":2},{"title":"🤗 Accelerate로 스크립트 실행하기","local":"run-a-script-with-accelerate","sections":[],"depth":2},{"title":"사용자 정의 데이터 세트 사용하기","local":"use-a-custom-dataset","sections":[],"depth":2},{"title":"스크립트 테스트하기","local":"test-a-script","sections":[],"depth":2},{"title":"체크포인트(checkpoint)에서 훈련 이어서 하기","local":"resume-training-from-checkpoint","sections":[],"depth":2},{"title":"모델 공유하기","local":"share-your-model","sections":[],"depth":2}],"depth":1}';function Rl(g){return Ul(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class zl extends _l{constructor(n){super(),gl(this,n,Rl,Gl,hl,{})}}export{zl as component};
