import{s as os,o as cs,n as Ms}from"../chunks/scheduler.56730f09.js";import{S as ms,i as hs,g as p,s as a,u as M,m as ys,A as ds,h as i,f as l,c as n,j as f,v as m,y as r,n as us,k as o,o as c,a as s,w as h,d as y,t as d,x as u}from"../chunks/index.ba464511.js";import{T as fs}from"../chunks/Tip.70442610.js";import{I as He}from"../chunks/IconCopyLink.89bde88e.js";import{C as w}from"../chunks/CodeBlock.2302fd0d.js";import{D as ws}from"../chunks/DocNotebookDropdown.68fd8653.js";function Js(et){let J,E=`많은 이미지 캡션 데이터세트에는 이미지당 여러 개의 캡션이 포함되어 있습니다.
이러한 경우, 일반적으로 학습 중에 사용 가능한 캡션 중에서 무작위로 샘플을 추출합니다.`;return{c(){J=p("p"),J.textContent=E},l(b){J=i(b,"P",{"data-svelte-h":!0}),r(J)!=="svelte-82zair"&&(J.textContent=E)},m(b,Ee){s(b,J,Ee)},p:Ms,d(b){b&&l(J)}}}function bs(et){let J,E,b,Ee,T,_,Fe,X,rl,Xe,dl="이미지 캡셔닝",tt,V,lt,Y,ul=`이미지 캡셔닝(Image captioning)은 주어진 이미지에 대한 캡션을 예측하는 작업입니다.
이미지 캡셔닝은 시각 장애인이 다양한 상황을 탐색하는 데 도움을 줄 수 있도록 시각 장애인을 보조하는 등 실생활에서 흔히 활용됩니다.
따라서 이미지 캡셔닝은 이미지를 설명함으로써 사람들의 콘텐츠 접근성을 개선하는 데 도움이 됩니다.`,st,N,fl="이 가이드에서는 소개할 내용은 아래와 같습니다:",at,z,wl="<li>이미지 캡셔닝 모델을 파인튜닝합니다.</li> <li>파인튜닝된 모델을 추론에 사용합니다.</li>",nt,Q,Jl="시작하기 전에 필요한 모든 라이브러리가 설치되어 있는지 확인하세요:",pt,A,it,F,bl=`Hugging Face 계정에 로그인하면 모델을 업로드하고 커뮤니티에 공유할 수 있습니다.
토큰을 입력하여 로그인하세요.`,rt,S,ot,U,k,Se,q,ol,Ve,Tl="포켓몬 BLIP 캡션 데이터세트 가져오기",ct,L,Ul=`{이미지-캡션} 쌍으로 구성된 데이터세트를 가져오려면 🤗 Dataset 라이브러리를 사용합니다.
PyTorch에서 자신만의 이미지 캡션 데이터세트를 만들려면 <a href="https://github.com/NielsRogge/Transformers-Tutorials/blob/master/GIT/Fine_tune_GIT_on_an_image_captioning_dataset.ipynb" rel="nofollow">이 노트북</a>을 참조하세요.`,Mt,P,mt,K,ht,D,jl="이 데이터세트는 <code>image</code>와 <code>text</code>라는 두 특성을 가지고 있습니다.",yt,x,dt,O,gl="[~datasets.Dataset.train_test_split] 메소드를 사용하여 데이터세트의 학습 분할을 학습 및 테스트 세트로 나눕니다:",ut,ee,ft,te,vl=`학습 세트의 샘플 몇 개를 시각화해 봅시다.
Let’s visualize a couple of samples from the training set.`,wt,le,Jt,I,Cl='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/sample_training_images_image_cap.png" alt="Sample training images"/>',bt,j,B,qe,se,cl,Ye,$l="데이터세트 전처리",Tt,ae,_l="데이터세트에는 이미지와 텍스트라는 두 가지 양식이 있기 때문에, 전처리 파이프라인에서 이미지와 캡션을 모두 전처리합니다.",Ut,ne,kl="전처리 작업을 위해, 파인튜닝하려는 모델에 연결된 프로세서 클래스를 가져옵니다.",jt,pe,gt,ie,xl="프로세서는 내부적으로 크기 조정 및 픽셀 크기 조정을 포함한 이미지 전처리를 수행하고 캡션을 토큰화합니다.",vt,re,Ct,oe,Il="데이터세트가 준비되었으니 이제 파인튜닝을 위해 모델을 설정할 수 있습니다.",$t,g,W,Le,ce,Ml,Ne,Bl="기본 모델 가져오기",_t,Me,Wl='<a href="https://huggingface.co/microsoft/git-base" rel="nofollow">“microsoft/git-base”</a>를 <a href="https://huggingface.co/docs/transformers/model_doc/auto#transformers.AutoModelForCausalLM" rel="nofollow"><code>AutoModelForCausalLM</code></a> 객체로 가져옵니다.',kt,me,xt,v,Z,Pe,he,ml,ze,Zl="평가",It,ye,Gl=`이미지 캡션 모델은 일반적으로 <a href="https://huggingface.co/spaces/evaluate-metric/rouge" rel="nofollow">Rouge 점수</a> 또는 <a href="https://huggingface.co/spaces/evaluate-metric/wer" rel="nofollow">단어 오류율(Word Error Rate)</a>로 평가합니다.
이 가이드에서는 단어 오류율(WER)을 사용합니다.`,Bt,de,Rl=`이를 위해 🤗 Evaluate 라이브러리를 사용합니다.
WER의 잠재적 제한 사항 및 기타 문제점은 <a href="https://huggingface.co/spaces/evaluate-metric/wer" rel="nofollow">이 가이드</a>를 참조하세요.`,Wt,ue,Zt,C,G,Ke,fe,hl,Qe,Hl="학습!",Gt,we,El="이제 모델 파인튜닝을 시작할 준비가 되었습니다. 이를 위해 🤗 <code>Trainer</code>를 사용합니다.",Rt,Je,Xl="먼저, <code>TrainingArguments</code>를 사용하여 학습 인수를 정의합니다.",Ht,be,Et,Te,Vl="학습 인수를 데이터세트, 모델과 함께 🤗 Trainer에 전달합니다.",Xt,Ue,Vt,je,Yl="학습을 시작하려면 <code>Trainer</code> 객체에서 <code>train()</code>을 호출하기만 하면 됩니다.",Yt,ge,Nt,ve,Nl="학습이 진행되면서 학습 손실이 원활하게 감소하는 것을 볼 수 있습니다.",zt,Ce,zl="학습이 완료되면 모든 사람이 모델을 사용할 수 있도록 <code>push_to_hub()</code> 메소드를 사용하여 모델을 허브에 공유하세요:",Qt,$e,At,$,R,De,_e,yl,Ae,Ql="추론",Ft,ke,Al="<code>test_ds</code>에서 샘플 이미지를 가져와 모델을 테스트합니다.",St,xe,qt,H,Fl='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/test_image_image_cap.png" alt="Test image"/>',Lt,Ie,Pt,Be,Sl="<code>generate</code>를 호출하고 예측을 디코딩합니다.",Kt,We,Dt,Ze,Ot,Ge,ql="파인튜닝된 모델이 꽤 괜찮은 캡션을 생성한 것 같습니다!",el,Oe,tl;return X=new He({}),V=new ws({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/ko/image_captioning.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/ko/pytorch/image_captioning.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/ko/tensorflow/image_captioning.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/image_captioning.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/pytorch/image_captioning.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/tensorflow/image_captioning.ipynb"}]}}),A=new w({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyUyMGRhdGFzZXRzJTIwZXZhbHVhdGUlMjAtcSUwQXBpcCUyMGluc3RhbGwlMjBqaXdlciUyMC1x",highlighted:`pip install transformers datasets evaluate -q
pip install jiwer -q`,wrap:!1}}),S=new w({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMG5vdGVib29rX2xvZ2luJTBBJTBBbm90ZWJvb2tfbG9naW4oKQ==",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> notebook_login

notebook_login()`,wrap:!1}}),q=new He({}),P=new w({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZHMlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIybGFtYmRhbGFicyUyRnBva2Vtb24tYmxpcC1jYXB0aW9ucyUyMiklMEFkcw==",highlighted:`<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

ds = load_dataset(<span class="hljs-string">&quot;lambdalabs/pokemon-blip-captions&quot;</span>)
ds`,wrap:!1}}),K=new w({props:{code:"RGF0YXNldERpY3QoJTdCJTBBJTIwJTIwJTIwJTIwdHJhaW4lM0ElMjBEYXRhc2V0KCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGZlYXR1cmVzJTNBJTIwJTVCJ2ltYWdlJyUyQyUyMCd0ZXh0JyU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG51bV9yb3dzJTNBJTIwODMzJTBBJTIwJTIwJTIwJTIwJTdEKSUwQSU3RCk=",highlighted:`DatasetDict({
    train: Dataset({
        features: [<span class="hljs-string">&#x27;image&#x27;</span>, <span class="hljs-string">&#x27;text&#x27;</span>],
        num_rows: 833
    })
})`,wrap:!1}}),x=new fs({props:{$$slots:{default:[Js]},$$scope:{ctx:et}}}),ee=new w({props:{code:"ZHMlMjAlM0QlMjBkcyU1QiUyMnRyYWluJTIyJTVELnRyYWluX3Rlc3Rfc3BsaXQodGVzdF9zaXplJTNEMC4xKSUwQXRyYWluX2RzJTIwJTNEJTIwZHMlNUIlMjJ0cmFpbiUyMiU1RCUwQXRlc3RfZHMlMjAlM0QlMjBkcyU1QiUyMnRlc3QlMjIlNUQ=",highlighted:`ds = ds[<span class="hljs-string">&quot;train&quot;</span>].train_test_split(test_size=<span class="hljs-number">0.1</span>)
train_ds = ds[<span class="hljs-string">&quot;train&quot;</span>]
test_ds = ds[<span class="hljs-string">&quot;test&quot;</span>]`,wrap:!1}}),le=new w({props:{code:"ZnJvbSUyMHRleHR3cmFwJTIwaW1wb3J0JTIwd3JhcCUwQWltcG9ydCUyMG1hdHBsb3RsaWIucHlwbG90JTIwYXMlMjBwbHQlMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEElMEElMEFkZWYlMjBwbG90X2ltYWdlcyhpbWFnZXMlMkMlMjBjYXB0aW9ucyklM0ElMEElMjAlMjAlMjAlMjBwbHQuZmlndXJlKGZpZ3NpemUlM0QoMjAlMkMlMjAyMCkpJTBBJTIwJTIwJTIwJTIwZm9yJTIwaSUyMGluJTIwcmFuZ2UobGVuKGltYWdlcykpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwYXglMjAlM0QlMjBwbHQuc3VicGxvdCgxJTJDJTIwbGVuKGltYWdlcyklMkMlMjBpJTIwJTJCJTIwMSklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBjYXB0aW9uJTIwJTNEJTIwY2FwdGlvbnMlNUJpJTVEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwY2FwdGlvbiUyMCUzRCUyMCUyMiU1Q24lMjIuam9pbih3cmFwKGNhcHRpb24lMkMlMjAxMikpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcGx0LnRpdGxlKGNhcHRpb24pJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcGx0Lmltc2hvdyhpbWFnZXMlNUJpJTVEKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHBsdC5heGlzKCUyMm9mZiUyMiklMEElMEElMEFzYW1wbGVfaW1hZ2VzX3RvX3Zpc3VhbGl6ZSUyMCUzRCUyMCU1Qm5wLmFycmF5KHRyYWluX2RzJTVCaSU1RCU1QiUyMmltYWdlJTIyJTVEKSUyMGZvciUyMGklMjBpbiUyMHJhbmdlKDUpJTVEJTBBc2FtcGxlX2NhcHRpb25zJTIwJTNEJTIwJTVCdHJhaW5fZHMlNUJpJTVEJTVCJTIydGV4dCUyMiU1RCUyMGZvciUyMGklMjBpbiUyMHJhbmdlKDUpJTVEJTBBcGxvdF9pbWFnZXMoc2FtcGxlX2ltYWdlc190b192aXN1YWxpemUlMkMlMjBzYW1wbGVfY2FwdGlvbnMp",highlighted:`<span class="hljs-keyword">from</span> textwrap <span class="hljs-keyword">import</span> wrap
<span class="hljs-keyword">import</span> matplotlib.pyplot <span class="hljs-keyword">as</span> plt
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np


<span class="hljs-keyword">def</span> <span class="hljs-title function_">plot_images</span>(<span class="hljs-params">images, captions</span>):
    plt.figure(figsize=(<span class="hljs-number">20</span>, <span class="hljs-number">20</span>))
    <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-built_in">len</span>(images)):
        ax = plt.subplot(<span class="hljs-number">1</span>, <span class="hljs-built_in">len</span>(images), i + <span class="hljs-number">1</span>)
        caption = captions[i]
        caption = <span class="hljs-string">&quot;\\n&quot;</span>.join(wrap(caption, <span class="hljs-number">12</span>))
        plt.title(caption)
        plt.imshow(images[i])
        plt.axis(<span class="hljs-string">&quot;off&quot;</span>)


sample_images_to_visualize = [np.array(train_ds[i][<span class="hljs-string">&quot;image&quot;</span>]) <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-number">5</span>)]
sample_captions = [train_ds[i][<span class="hljs-string">&quot;text&quot;</span>] <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-number">5</span>)]
plot_images(sample_images_to_visualize, sample_captions)`,wrap:!1}}),se=new He({}),pe=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMEElMEFjaGVja3BvaW50JTIwJTNEJTIwJTIybWljcm9zb2Z0JTJGZ2l0LWJhc2UlMjIlMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZChjaGVja3BvaW50KQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor

checkpoint = <span class="hljs-string">&quot;microsoft/git-base&quot;</span>
processor = AutoProcessor.from_pretrained(checkpoint)`,wrap:!1}}),re=new w({props:{code:"ZGVmJTIwdHJhbnNmb3JtcyhleGFtcGxlX2JhdGNoKSUzQSUwQSUyMCUyMCUyMCUyMGltYWdlcyUyMCUzRCUyMCU1QnglMjBmb3IlMjB4JTIwaW4lMjBleGFtcGxlX2JhdGNoJTVCJTIyaW1hZ2UlMjIlNUQlNUQlMEElMjAlMjAlMjAlMjBjYXB0aW9ucyUyMCUzRCUyMCU1QnglMjBmb3IlMjB4JTIwaW4lMjBleGFtcGxlX2JhdGNoJTVCJTIydGV4dCUyMiU1RCU1RCUwQSUyMCUyMCUyMCUyMGlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZXMlMkMlMjB0ZXh0JTNEY2FwdGlvbnMlMkMlMjBwYWRkaW5nJTNEJTIybWF4X2xlbmd0aCUyMiklMEElMjAlMjAlMjAlMjBpbnB1dHMudXBkYXRlKCU3QiUyMmxhYmVscyUyMiUzQSUyMGlucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCU3RCklMEElMjAlMjAlMjAlMjByZXR1cm4lMjBpbnB1dHMlMEElMEElMEF0cmFpbl9kcy5zZXRfdHJhbnNmb3JtKHRyYW5zZm9ybXMpJTBBdGVzdF9kcy5zZXRfdHJhbnNmb3JtKHRyYW5zZm9ybXMp",highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">transforms</span>(<span class="hljs-params">example_batch</span>):
    images = [x <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> example_batch[<span class="hljs-string">&quot;image&quot;</span>]]
    captions = [x <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> example_batch[<span class="hljs-string">&quot;text&quot;</span>]]
    inputs = processor(images=images, text=captions, padding=<span class="hljs-string">&quot;max_length&quot;</span>)
    inputs.update({<span class="hljs-string">&quot;labels&quot;</span>: inputs[<span class="hljs-string">&quot;input_ids&quot;</span>]})
    <span class="hljs-keyword">return</span> inputs


train_ds.set_transform(transforms)
test_ds.set_transform(transforms)`,wrap:!1}}),ce=new He({}),me=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTBBJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoY2hlY2twb2ludCk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM

model = AutoModelForCausalLM.from_pretrained(checkpoint)`,wrap:!1}}),he=new He({}),ue=new w({props:{code:"ZnJvbSUyMGV2YWx1YXRlJTIwaW1wb3J0JTIwbG9hZCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBd2VyJTIwJTNEJTIwbG9hZCglMjJ3ZXIlMjIpJTBBJTBBJTBBZGVmJTIwY29tcHV0ZV9tZXRyaWNzKGV2YWxfcHJlZCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMkMlMjBsYWJlbHMlMjAlM0QlMjBldmFsX3ByZWQlMEElMjAlMjAlMjAlMjBwcmVkaWN0ZWQlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KC0xKSUwQSUyMCUyMCUyMCUyMGRlY29kZWRfbGFiZWxzJTIwJTNEJTIwcHJvY2Vzc29yLmJhdGNoX2RlY29kZShsYWJlbHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklMEElMjAlMjAlMjAlMjBkZWNvZGVkX3ByZWRpY3Rpb25zJTIwJTNEJTIwcHJvY2Vzc29yLmJhdGNoX2RlY29kZShwcmVkaWN0ZWQlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklMEElMjAlMjAlMjAlMjB3ZXJfc2NvcmUlMjAlM0QlMjB3ZXIuY29tcHV0ZShwcmVkaWN0aW9ucyUzRGRlY29kZWRfcHJlZGljdGlvbnMlMkMlMjByZWZlcmVuY2VzJTNEZGVjb2RlZF9sYWJlbHMpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTdCJTIyd2VyX3Njb3JlJTIyJTNBJTIwd2VyX3Njb3JlJTdE",highlighted:`<span class="hljs-keyword">from</span> evaluate <span class="hljs-keyword">import</span> load
<span class="hljs-keyword">import</span> torch

wer = load(<span class="hljs-string">&quot;wer&quot;</span>)


<span class="hljs-keyword">def</span> <span class="hljs-title function_">compute_metrics</span>(<span class="hljs-params">eval_pred</span>):
    logits, labels = eval_pred
    predicted = logits.argmax(-<span class="hljs-number">1</span>)
    decoded_labels = processor.batch_decode(labels, skip_special_tokens=<span class="hljs-literal">True</span>)
    decoded_predictions = processor.batch_decode(predicted, skip_special_tokens=<span class="hljs-literal">True</span>)
    wer_score = wer.compute(predictions=decoded_predictions, references=decoded_labels)
    <span class="hljs-keyword">return</span> {<span class="hljs-string">&quot;wer_score&quot;</span>: wer_score}`,wrap:!1}}),fe=new He({}),be=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluaW5nQXJndW1lbnRzJTJDJTIwVHJhaW5lciUwQSUwQW1vZGVsX25hbWUlMjAlM0QlMjBjaGVja3BvaW50LnNwbGl0KCUyMiUyRiUyMiklNUIxJTVEJTBBJTBBdHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0RmJTIyJTdCbW9kZWxfbmFtZSU3RC1wb2tlbW9uJTIyJTJDJTBBJTIwJTIwJTIwJTIwbGVhcm5pbmdfcmF0ZSUzRDVlLTUlMkMlMEElMjAlMjAlMjAlMjBudW1fdHJhaW5fZXBvY2hzJTNENTAlMkMlMEElMjAlMjAlMjAlMjBmcDE2JTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMHBlcl9kZXZpY2VfdHJhaW5fYmF0Y2hfc2l6ZSUzRDMyJTJDJTBBJTIwJTIwJTIwJTIwcGVyX2RldmljZV9ldmFsX2JhdGNoX3NpemUlM0QzMiUyQyUwQSUyMCUyMCUyMCUyMGdyYWRpZW50X2FjY3VtdWxhdGlvbl9zdGVwcyUzRDIlMkMlMEElMjAlMjAlMjAlMjBzYXZlX3RvdGFsX2xpbWl0JTNEMyUyQyUwQSUyMCUyMCUyMCUyMGV2YWx1YXRpb25fc3RyYXRlZ3klM0QlMjJzdGVwcyUyMiUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfc3RlcHMlM0Q1MCUyQyUwQSUyMCUyMCUyMCUyMHNhdmVfc3RyYXRlZ3klM0QlMjJzdGVwcyUyMiUyQyUwQSUyMCUyMCUyMCUyMHNhdmVfc3RlcHMlM0Q1MCUyQyUwQSUyMCUyMCUyMCUyMGxvZ2dpbmdfc3RlcHMlM0Q1MCUyQyUwQSUyMCUyMCUyMCUyMHJlbW92ZV91bnVzZWRfY29sdW1ucyUzREZhbHNlJTJDJTBBJTIwJTIwJTIwJTIwcHVzaF90b19odWIlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwbGFiZWxfbmFtZXMlM0QlNUIlMjJsYWJlbHMlMjIlNUQlMkMlMEElMjAlMjAlMjAlMjBsb2FkX2Jlc3RfbW9kZWxfYXRfZW5kJTNEVHJ1ZSUyQyUwQSk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments, Trainer

model_name = checkpoint.split(<span class="hljs-string">&quot;/&quot;</span>)[<span class="hljs-number">1</span>]

training_args = TrainingArguments(
    output_dir=<span class="hljs-string">f&quot;<span class="hljs-subst">{model_name}</span>-pokemon&quot;</span>,
    learning_rate=<span class="hljs-number">5e-5</span>,
    num_train_epochs=<span class="hljs-number">50</span>,
    fp16=<span class="hljs-literal">True</span>,
    per_device_train_batch_size=<span class="hljs-number">32</span>,
    per_device_eval_batch_size=<span class="hljs-number">32</span>,
    gradient_accumulation_steps=<span class="hljs-number">2</span>,
    save_total_limit=<span class="hljs-number">3</span>,
    evaluation_strategy=<span class="hljs-string">&quot;steps&quot;</span>,
    eval_steps=<span class="hljs-number">50</span>,
    save_strategy=<span class="hljs-string">&quot;steps&quot;</span>,
    save_steps=<span class="hljs-number">50</span>,
    logging_steps=<span class="hljs-number">50</span>,
    remove_unused_columns=<span class="hljs-literal">False</span>,
    push_to_hub=<span class="hljs-literal">True</span>,
    label_names=[<span class="hljs-string">&quot;labels&quot;</span>],
    load_best_model_at_end=<span class="hljs-literal">True</span>,
)`,wrap:!1}}),Ue=new w({props:{code:"dHJhaW5lciUyMCUzRCUyMFRyYWluZXIoJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0Rtb2RlbCUyQyUwQSUyMCUyMCUyMCUyMGFyZ3MlM0R0cmFpbmluZ19hcmdzJTJDJTBBJTIwJTIwJTIwJTIwdHJhaW5fZGF0YXNldCUzRHRyYWluX2RzJTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9kYXRhc2V0JTNEdGVzdF9kcyUyQyUwQSUyMCUyMCUyMCUyMGNvbXB1dGVfbWV0cmljcyUzRGNvbXB1dGVfbWV0cmljcyUyQyUwQSk=",highlighted:`trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=train_ds,
    eval_dataset=test_ds,
    compute_metrics=compute_metrics,
)`,wrap:!1}}),ge=new w({props:{code:"dHJhaW5lci50cmFpbigp",highlighted:"trainer.train()",wrap:!1}}),$e=new w({props:{code:"dHJhaW5lci5wdXNoX3RvX2h1Yigp",highlighted:"trainer.push_to_hub()",wrap:!1}}),_e=new He({}),xe=new w({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZzYXlha3BhdWwlMkZzYW1wbGUtZGF0YXNldHMlMkZyZXNvbHZlJTJGbWFpbiUyRnBva2Vtb24ucG5nJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBaW1hZ2U=",highlighted:`<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> requests

url = <span class="hljs-string">&quot;https://huggingface.co/datasets/sayakpaul/sample-datasets/resolve/main/pokemon.png&quot;</span>
image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
image`,wrap:!1}}),Ie=new w({props:{code:"ZGV2aWNlJTIwJTNEJTIwJTIyY3VkYSUyMiUyMGlmJTIwdG9yY2guY3VkYS5pc19hdmFpbGFibGUoKSUyMGVsc2UlMjAlMjJjcHUlMjIlMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS50byhkZXZpY2UpJTBBcGl4ZWxfdmFsdWVzJTIwJTNEJTIwaW5wdXRzLnBpeGVsX3ZhbHVlcw==",highlighted:`device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>

inputs = processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(device)
pixel_values = inputs.pixel_values`,wrap:!1}}),We=new w({props:{code:"Z2VuZXJhdGVkX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKHBpeGVsX3ZhbHVlcyUzRHBpeGVsX3ZhbHVlcyUyQyUyMG1heF9sZW5ndGglM0Q1MCklMEFnZW5lcmF0ZWRfY2FwdGlvbiUyMCUzRCUyMHByb2Nlc3Nvci5iYXRjaF9kZWNvZGUoZ2VuZXJhdGVkX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSU1QjAlNUQlMEFwcmludChnZW5lcmF0ZWRfY2FwdGlvbik=",highlighted:`generated_ids = model.generate(pixel_values=pixel_values, max_length=<span class="hljs-number">50</span>)
generated_caption = processor.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]
<span class="hljs-built_in">print</span>(generated_caption)`,wrap:!1}}),Ze=new w({props:{code:"YSUyMGRyYXdpbmclMjBvZiUyMGElMjBwaW5rJTIwYW5kJTIwYmx1ZSUyMHBva2Vtb24=",highlighted:"a drawing of a pink and blue pokemon",wrap:!1}}),{c(){J=p("meta"),E=a(),b=p("p"),Ee=a(),T=p("h1"),_=p("a"),Fe=p("span"),M(X.$$.fragment),rl=a(),Xe=p("span"),Xe.textContent=dl,tt=a(),M(V.$$.fragment),lt=a(),Y=p("p"),Y.textContent=ul,st=a(),N=p("p"),N.textContent=fl,at=a(),z=p("ul"),z.innerHTML=wl,nt=a(),Q=p("p"),Q.textContent=Jl,pt=a(),M(A.$$.fragment),it=a(),F=p("p"),F.textContent=bl,rt=a(),M(S.$$.fragment),ot=a(),U=p("h2"),k=p("a"),Se=p("span"),M(q.$$.fragment),ol=a(),Ve=p("span"),Ve.textContent=Tl,ct=a(),L=p("p"),L.innerHTML=Ul,Mt=a(),M(P.$$.fragment),mt=a(),M(K.$$.fragment),ht=a(),D=p("p"),D.innerHTML=jl,yt=a(),M(x.$$.fragment),dt=a(),O=p("p"),O.textContent=gl,ut=a(),M(ee.$$.fragment),ft=a(),te=p("p"),te.textContent=vl,wt=a(),M(le.$$.fragment),Jt=a(),I=p("div"),I.innerHTML=Cl,bt=a(),j=p("h2"),B=p("a"),qe=p("span"),M(se.$$.fragment),cl=a(),Ye=p("span"),Ye.textContent=$l,Tt=a(),ae=p("p"),ae.textContent=_l,Ut=a(),ne=p("p"),ne.textContent=kl,jt=a(),M(pe.$$.fragment),gt=a(),ie=p("p"),ie.textContent=xl,vt=a(),M(re.$$.fragment),Ct=a(),oe=p("p"),oe.textContent=Il,$t=a(),g=p("h2"),W=p("a"),Le=p("span"),M(ce.$$.fragment),Ml=a(),Ne=p("span"),Ne.textContent=Bl,_t=a(),Me=p("p"),Me.innerHTML=Wl,kt=a(),M(me.$$.fragment),xt=a(),v=p("h2"),Z=p("a"),Pe=p("span"),M(he.$$.fragment),ml=a(),ze=p("span"),ze.textContent=Zl,It=a(),ye=p("p"),ye.innerHTML=Gl,Bt=a(),de=p("p"),de.innerHTML=Rl,Wt=a(),M(ue.$$.fragment),Zt=a(),C=p("h2"),G=p("a"),Ke=p("span"),M(fe.$$.fragment),hl=a(),Qe=p("span"),Qe.textContent=Hl,Gt=a(),we=p("p"),we.innerHTML=El,Rt=a(),Je=p("p"),Je.innerHTML=Xl,Ht=a(),M(be.$$.fragment),Et=a(),Te=p("p"),Te.textContent=Vl,Xt=a(),M(Ue.$$.fragment),Vt=a(),je=p("p"),je.innerHTML=Yl,Yt=a(),M(ge.$$.fragment),Nt=a(),ve=p("p"),ve.textContent=Nl,zt=a(),Ce=p("p"),Ce.innerHTML=zl,Qt=a(),M($e.$$.fragment),At=a(),$=p("h2"),R=p("a"),De=p("span"),M(_e.$$.fragment),yl=a(),Ae=p("span"),Ae.textContent=Ql,Ft=a(),ke=p("p"),ke.innerHTML=Al,St=a(),M(xe.$$.fragment),qt=a(),H=p("div"),H.innerHTML=Fl,Lt=ys(`
    
모델에 사용할 이미지를 준비합니다.

	`),M(Ie.$$.fragment),Pt=a(),Be=p("p"),Be.innerHTML=Sl,Kt=a(),M(We.$$.fragment),Dt=a(),M(Ze.$$.fragment),Ot=a(),Ge=p("p"),Ge.textContent=ql,el=a(),Oe=p("p"),this.h()},l(e){const t=ds("svelte-1phssyn",document.head);J=i(t,"META",{name:!0,content:!0}),t.forEach(l),E=n(e),b=i(e,"P",{}),f(b).forEach(l),Ee=n(e),T=i(e,"H1",{class:!0});var Re=f(T);_=i(Re,"A",{id:!0,class:!0,href:!0});var Ll=f(_);Fe=i(Ll,"SPAN",{});var Pl=f(Fe);m(X.$$.fragment,Pl),Pl.forEach(l),Ll.forEach(l),rl=n(Re),Xe=i(Re,"SPAN",{"data-svelte-h":!0}),r(Xe)!=="svelte-ognkif"&&(Xe.textContent=dl),Re.forEach(l),tt=n(e),m(V.$$.fragment,e),lt=n(e),Y=i(e,"P",{"data-svelte-h":!0}),r(Y)!=="svelte-1sz2sm4"&&(Y.textContent=ul),st=n(e),N=i(e,"P",{"data-svelte-h":!0}),r(N)!=="svelte-tq3033"&&(N.textContent=fl),at=n(e),z=i(e,"UL",{"data-svelte-h":!0}),r(z)!=="svelte-htt0z1"&&(z.innerHTML=wl),nt=n(e),Q=i(e,"P",{"data-svelte-h":!0}),r(Q)!=="svelte-18iigii"&&(Q.textContent=Jl),pt=n(e),m(A.$$.fragment,e),it=n(e),F=i(e,"P",{"data-svelte-h":!0}),r(F)!=="svelte-9xxxb4"&&(F.textContent=bl),rt=n(e),m(S.$$.fragment,e),ot=n(e),U=i(e,"H2",{class:!0});var ll=f(U);k=i(ll,"A",{id:!0,class:!0,href:!0});var Kl=f(k);Se=i(Kl,"SPAN",{});var Dl=f(Se);m(q.$$.fragment,Dl),Dl.forEach(l),Kl.forEach(l),ol=n(ll),Ve=i(ll,"SPAN",{"data-svelte-h":!0}),r(Ve)!=="svelte-11d7k0u"&&(Ve.textContent=Tl),ll.forEach(l),ct=n(e),L=i(e,"P",{"data-svelte-h":!0}),r(L)!=="svelte-fdtyxx"&&(L.innerHTML=Ul),Mt=n(e),m(P.$$.fragment,e),mt=n(e),m(K.$$.fragment,e),ht=n(e),D=i(e,"P",{"data-svelte-h":!0}),r(D)!=="svelte-1ff7g97"&&(D.innerHTML=jl),yt=n(e),m(x.$$.fragment,e),dt=n(e),O=i(e,"P",{"data-svelte-h":!0}),r(O)!=="svelte-1s0k73q"&&(O.textContent=gl),ut=n(e),m(ee.$$.fragment,e),ft=n(e),te=i(e,"P",{"data-svelte-h":!0}),r(te)!=="svelte-1xgsiym"&&(te.textContent=vl),wt=n(e),m(le.$$.fragment,e),Jt=n(e),I=i(e,"DIV",{class:!0,"data-svelte-h":!0}),r(I)!=="svelte-1qemygy"&&(I.innerHTML=Cl),bt=n(e),j=i(e,"H2",{class:!0});var sl=f(j);B=i(sl,"A",{id:!0,class:!0,href:!0});var Ol=f(B);qe=i(Ol,"SPAN",{});var es=f(qe);m(se.$$.fragment,es),es.forEach(l),Ol.forEach(l),cl=n(sl),Ye=i(sl,"SPAN",{"data-svelte-h":!0}),r(Ye)!=="svelte-2b1odz"&&(Ye.textContent=$l),sl.forEach(l),Tt=n(e),ae=i(e,"P",{"data-svelte-h":!0}),r(ae)!=="svelte-15c40fh"&&(ae.textContent=_l),Ut=n(e),ne=i(e,"P",{"data-svelte-h":!0}),r(ne)!=="svelte-aj1022"&&(ne.textContent=kl),jt=n(e),m(pe.$$.fragment,e),gt=n(e),ie=i(e,"P",{"data-svelte-h":!0}),r(ie)!=="svelte-lek9ik"&&(ie.textContent=xl),vt=n(e),m(re.$$.fragment,e),Ct=n(e),oe=i(e,"P",{"data-svelte-h":!0}),r(oe)!=="svelte-x9apz1"&&(oe.textContent=Il),$t=n(e),g=i(e,"H2",{class:!0});var al=f(g);W=i(al,"A",{id:!0,class:!0,href:!0});var ts=f(W);Le=i(ts,"SPAN",{});var ls=f(Le);m(ce.$$.fragment,ls),ls.forEach(l),ts.forEach(l),Ml=n(al),Ne=i(al,"SPAN",{"data-svelte-h":!0}),r(Ne)!=="svelte-1qab98d"&&(Ne.textContent=Bl),al.forEach(l),_t=n(e),Me=i(e,"P",{"data-svelte-h":!0}),r(Me)!=="svelte-1ifqfke"&&(Me.innerHTML=Wl),kt=n(e),m(me.$$.fragment,e),xt=n(e),v=i(e,"H2",{class:!0});var nl=f(v);Z=i(nl,"A",{id:!0,class:!0,href:!0});var ss=f(Z);Pe=i(ss,"SPAN",{});var as=f(Pe);m(he.$$.fragment,as),as.forEach(l),ss.forEach(l),ml=n(nl),ze=i(nl,"SPAN",{"data-svelte-h":!0}),r(ze)!=="svelte-fd7xxy"&&(ze.textContent=Zl),nl.forEach(l),It=n(e),ye=i(e,"P",{"data-svelte-h":!0}),r(ye)!=="svelte-1i0maa4"&&(ye.innerHTML=Gl),Bt=n(e),de=i(e,"P",{"data-svelte-h":!0}),r(de)!=="svelte-gcfhpv"&&(de.innerHTML=Rl),Wt=n(e),m(ue.$$.fragment,e),Zt=n(e),C=i(e,"H2",{class:!0});var pl=f(C);G=i(pl,"A",{id:!0,class:!0,href:!0});var ns=f(G);Ke=i(ns,"SPAN",{});var ps=f(Ke);m(fe.$$.fragment,ps),ps.forEach(l),ns.forEach(l),hl=n(pl),Qe=i(pl,"SPAN",{"data-svelte-h":!0}),r(Qe)!=="svelte-1rc7mi6"&&(Qe.textContent=Hl),pl.forEach(l),Gt=n(e),we=i(e,"P",{"data-svelte-h":!0}),r(we)!=="svelte-1p0jzke"&&(we.innerHTML=El),Rt=n(e),Je=i(e,"P",{"data-svelte-h":!0}),r(Je)!=="svelte-1rmrex2"&&(Je.innerHTML=Xl),Ht=n(e),m(be.$$.fragment,e),Et=n(e),Te=i(e,"P",{"data-svelte-h":!0}),r(Te)!=="svelte-14i42sb"&&(Te.textContent=Vl),Xt=n(e),m(Ue.$$.fragment,e),Vt=n(e),je=i(e,"P",{"data-svelte-h":!0}),r(je)!=="svelte-14yorud"&&(je.innerHTML=Yl),Yt=n(e),m(ge.$$.fragment,e),Nt=n(e),ve=i(e,"P",{"data-svelte-h":!0}),r(ve)!=="svelte-cnq009"&&(ve.textContent=Nl),zt=n(e),Ce=i(e,"P",{"data-svelte-h":!0}),r(Ce)!=="svelte-106657s"&&(Ce.innerHTML=zl),Qt=n(e),m($e.$$.fragment,e),At=n(e),$=i(e,"H2",{class:!0});var il=f($);R=i(il,"A",{id:!0,class:!0,href:!0});var is=f(R);De=i(is,"SPAN",{});var rs=f(De);m(_e.$$.fragment,rs),rs.forEach(l),is.forEach(l),yl=n(il),Ae=i(il,"SPAN",{"data-svelte-h":!0}),r(Ae)!=="svelte-8litrx"&&(Ae.textContent=Ql),il.forEach(l),Ft=n(e),ke=i(e,"P",{"data-svelte-h":!0}),r(ke)!=="svelte-noj8gs"&&(ke.innerHTML=Al),St=n(e),m(xe.$$.fragment,e),qt=n(e),H=i(e,"DIV",{class:!0,"data-svelte-h":!0}),r(H)!=="svelte-yvzmn4"&&(H.innerHTML=Fl),Lt=us(e,`
    
모델에 사용할 이미지를 준비합니다.

	`),m(Ie.$$.fragment,e),Pt=n(e),Be=i(e,"P",{"data-svelte-h":!0}),r(Be)!=="svelte-1o736s1"&&(Be.innerHTML=Sl),Kt=n(e),m(We.$$.fragment,e),Dt=n(e),m(Ze.$$.fragment,e),Ot=n(e),Ge=i(e,"P",{"data-svelte-h":!0}),r(Ge)!=="svelte-1ye6o6q"&&(Ge.textContent=ql),el=n(e),Oe=i(e,"P",{}),f(Oe).forEach(l),this.h()},h(){o(J,"name","hf:doc:metadata"),o(J,"content",JSON.stringify(Ts)),o(_,"id","image-captioning"),o(_,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),o(_,"href","#image-captioning"),o(T,"class","relative group"),o(k,"id","load-the-pokmon-blip-captions-dataset"),o(k,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),o(k,"href","#load-the-pokmon-blip-captions-dataset"),o(U,"class","relative group"),o(I,"class","flex justify-center"),o(B,"id","preprocess-the-dataset"),o(B,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),o(B,"href","#preprocess-the-dataset"),o(j,"class","relative group"),o(W,"id","load-a-base-model"),o(W,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),o(W,"href","#load-a-base-model"),o(g,"class","relative group"),o(Z,"id","evaluate"),o(Z,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),o(Z,"href","#evaluate"),o(v,"class","relative group"),o(G,"id","train!"),o(G,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),o(G,"href","#train!"),o(C,"class","relative group"),o(R,"id","inference"),o(R,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),o(R,"href","#inference"),o($,"class","relative group"),o(H,"class","flex justify-center")},m(e,t){c(document.head,J),s(e,E,t),s(e,b,t),s(e,Ee,t),s(e,T,t),c(T,_),c(_,Fe),h(X,Fe,null),c(T,rl),c(T,Xe),s(e,tt,t),h(V,e,t),s(e,lt,t),s(e,Y,t),s(e,st,t),s(e,N,t),s(e,at,t),s(e,z,t),s(e,nt,t),s(e,Q,t),s(e,pt,t),h(A,e,t),s(e,it,t),s(e,F,t),s(e,rt,t),h(S,e,t),s(e,ot,t),s(e,U,t),c(U,k),c(k,Se),h(q,Se,null),c(U,ol),c(U,Ve),s(e,ct,t),s(e,L,t),s(e,Mt,t),h(P,e,t),s(e,mt,t),h(K,e,t),s(e,ht,t),s(e,D,t),s(e,yt,t),h(x,e,t),s(e,dt,t),s(e,O,t),s(e,ut,t),h(ee,e,t),s(e,ft,t),s(e,te,t),s(e,wt,t),h(le,e,t),s(e,Jt,t),s(e,I,t),s(e,bt,t),s(e,j,t),c(j,B),c(B,qe),h(se,qe,null),c(j,cl),c(j,Ye),s(e,Tt,t),s(e,ae,t),s(e,Ut,t),s(e,ne,t),s(e,jt,t),h(pe,e,t),s(e,gt,t),s(e,ie,t),s(e,vt,t),h(re,e,t),s(e,Ct,t),s(e,oe,t),s(e,$t,t),s(e,g,t),c(g,W),c(W,Le),h(ce,Le,null),c(g,Ml),c(g,Ne),s(e,_t,t),s(e,Me,t),s(e,kt,t),h(me,e,t),s(e,xt,t),s(e,v,t),c(v,Z),c(Z,Pe),h(he,Pe,null),c(v,ml),c(v,ze),s(e,It,t),s(e,ye,t),s(e,Bt,t),s(e,de,t),s(e,Wt,t),h(ue,e,t),s(e,Zt,t),s(e,C,t),c(C,G),c(G,Ke),h(fe,Ke,null),c(C,hl),c(C,Qe),s(e,Gt,t),s(e,we,t),s(e,Rt,t),s(e,Je,t),s(e,Ht,t),h(be,e,t),s(e,Et,t),s(e,Te,t),s(e,Xt,t),h(Ue,e,t),s(e,Vt,t),s(e,je,t),s(e,Yt,t),h(ge,e,t),s(e,Nt,t),s(e,ve,t),s(e,zt,t),s(e,Ce,t),s(e,Qt,t),h($e,e,t),s(e,At,t),s(e,$,t),c($,R),c(R,De),h(_e,De,null),c($,yl),c($,Ae),s(e,Ft,t),s(e,ke,t),s(e,St,t),h(xe,e,t),s(e,qt,t),s(e,H,t),s(e,Lt,t),h(Ie,e,t),s(e,Pt,t),s(e,Be,t),s(e,Kt,t),h(We,e,t),s(e,Dt,t),h(Ze,e,t),s(e,Ot,t),s(e,Ge,t),s(e,el,t),s(e,Oe,t),tl=!0},p(e,[t]){const Re={};t&2&&(Re.$$scope={dirty:t,ctx:e}),x.$set(Re)},i(e){tl||(y(X.$$.fragment,e),y(V.$$.fragment,e),y(A.$$.fragment,e),y(S.$$.fragment,e),y(q.$$.fragment,e),y(P.$$.fragment,e),y(K.$$.fragment,e),y(x.$$.fragment,e),y(ee.$$.fragment,e),y(le.$$.fragment,e),y(se.$$.fragment,e),y(pe.$$.fragment,e),y(re.$$.fragment,e),y(ce.$$.fragment,e),y(me.$$.fragment,e),y(he.$$.fragment,e),y(ue.$$.fragment,e),y(fe.$$.fragment,e),y(be.$$.fragment,e),y(Ue.$$.fragment,e),y(ge.$$.fragment,e),y($e.$$.fragment,e),y(_e.$$.fragment,e),y(xe.$$.fragment,e),y(Ie.$$.fragment,e),y(We.$$.fragment,e),y(Ze.$$.fragment,e),tl=!0)},o(e){d(X.$$.fragment,e),d(V.$$.fragment,e),d(A.$$.fragment,e),d(S.$$.fragment,e),d(q.$$.fragment,e),d(P.$$.fragment,e),d(K.$$.fragment,e),d(x.$$.fragment,e),d(ee.$$.fragment,e),d(le.$$.fragment,e),d(se.$$.fragment,e),d(pe.$$.fragment,e),d(re.$$.fragment,e),d(ce.$$.fragment,e),d(me.$$.fragment,e),d(he.$$.fragment,e),d(ue.$$.fragment,e),d(fe.$$.fragment,e),d(be.$$.fragment,e),d(Ue.$$.fragment,e),d(ge.$$.fragment,e),d($e.$$.fragment,e),d(_e.$$.fragment,e),d(xe.$$.fragment,e),d(Ie.$$.fragment,e),d(We.$$.fragment,e),d(Ze.$$.fragment,e),tl=!1},d(e){e&&(l(E),l(b),l(Ee),l(T),l(tt),l(lt),l(Y),l(st),l(N),l(at),l(z),l(nt),l(Q),l(pt),l(it),l(F),l(rt),l(ot),l(U),l(ct),l(L),l(Mt),l(mt),l(ht),l(D),l(yt),l(dt),l(O),l(ut),l(ft),l(te),l(wt),l(Jt),l(I),l(bt),l(j),l(Tt),l(ae),l(Ut),l(ne),l(jt),l(gt),l(ie),l(vt),l(Ct),l(oe),l($t),l(g),l(_t),l(Me),l(kt),l(xt),l(v),l(It),l(ye),l(Bt),l(de),l(Wt),l(Zt),l(C),l(Gt),l(we),l(Rt),l(Je),l(Ht),l(Et),l(Te),l(Xt),l(Vt),l(je),l(Yt),l(Nt),l(ve),l(zt),l(Ce),l(Qt),l(At),l($),l(Ft),l(ke),l(St),l(qt),l(H),l(Lt),l(Pt),l(Be),l(Kt),l(Dt),l(Ot),l(Ge),l(el),l(Oe)),l(J),u(X),u(V,e),u(A,e),u(S,e),u(q),u(P,e),u(K,e),u(x,e),u(ee,e),u(le,e),u(se),u(pe,e),u(re,e),u(ce),u(me,e),u(he),u(ue,e),u(fe),u(be,e),u(Ue,e),u(ge,e),u($e,e),u(_e),u(xe,e),u(Ie,e),u(We,e),u(Ze,e)}}}const Ts={local:"image-captioning",sections:[{local:"load-the-pokmon-blip-captions-dataset",title:"포켓몬 BLIP 캡션 데이터세트 가져오기"},{local:"preprocess-the-dataset",title:"데이터세트 전처리"},{local:"load-a-base-model",title:"기본 모델 가져오기"},{local:"evaluate",title:"평가"},{local:"train!",title:"학습!"},{local:"inference",title:"추론"}],title:"이미지 캡셔닝"};function Us(et){return cs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ks extends ms{constructor(J){super(),hs(this,J,Us,bs,os,{})}}export{ks as component};
