import{s as os,o as cs,n as Ms}from"../chunks/scheduler.889ebb13.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.8980e686.js";import{T as fs}from"../chunks/Tip.7191df11.js";import{I as Ht}from"../chunks/IconCopyLink.357761cd.js";import{C as w}from"../chunks/CodeBlock.25fc3430.js";import{D as ws}from"../chunks/DocNotebookDropdown.f8a50280.js";function Js(te){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,Et){s(b,J,Et)},p:Ms,d(b){b&&l(J)}}}function bs(te){let J,E,b,Et,T,_,Ft,X,rl,Xt,dl="이미지 캡셔닝",ee,V,le,Y,ul=`이미지 캡셔닝(Image captioning)은 주어진 이미지에 대한 캡션을 예측하는 작업입니다.
이미지 캡셔닝은 시각 장애인이 다양한 상황을 탐색하는 데 도움을 줄 수 있도록 시각 장애인을 보조하는 등 실생활에서 흔히 활용됩니다.
따라서 이미지 캡셔닝은 이미지를 설명함으로써 사람들의 콘텐츠 접근성을 개선하는 데 도움이 됩니다.`,se,N,fl="이 가이드에서는 소개할 내용은 아래와 같습니다:",ae,z,wl="<li>이미지 캡셔닝 모델을 파인튜닝합니다.</li> <li>파인튜닝된 모델을 추론에 사용합니다.</li>",ne,Q,Jl="시작하기 전에 필요한 모든 라이브러리가 설치되어 있는지 확인하세요:",pe,A,ie,F,bl=`Hugging Face 계정에 로그인하면 모델을 업로드하고 커뮤니티에 공유할 수 있습니다.
토큰을 입력하여 로그인하세요.`,re,S,oe,U,k,St,q,ol,Vt,Tl="포켓몬 BLIP 캡션 데이터세트 가져오기",ce,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>을 참조하세요.`,Me,P,me,K,he,D,jl="이 데이터세트는 <code>image</code>와 <code>text</code>라는 두 특성을 가지고 있습니다.",ye,x,de,O,gl="[~datasets.Dataset.train_test_split] 메소드를 사용하여 데이터세트의 학습 분할을 학습 및 테스트 세트로 나눕니다:",ue,tt,fe,et,vl=`학습 세트의 샘플 몇 개를 시각화해 봅시다.
Let’s visualize a couple of samples from the training set.`,we,lt,Je,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"/>',be,j,B,qt,st,cl,Yt,$l="데이터세트 전처리",Te,at,_l="데이터세트에는 이미지와 텍스트라는 두 가지 양식이 있기 때문에, 전처리 파이프라인에서 이미지와 캡션을 모두 전처리합니다.",Ue,nt,kl="전처리 작업을 위해, 파인튜닝하려는 모델에 연결된 프로세서 클래스를 가져옵니다.",je,pt,ge,it,xl="프로세서는 내부적으로 크기 조정 및 픽셀 크기 조정을 포함한 이미지 전처리를 수행하고 캡션을 토큰화합니다.",ve,rt,Ce,ot,Il="데이터세트가 준비되었으니 이제 파인튜닝을 위해 모델을 설정할 수 있습니다.",$e,g,W,Lt,ct,Ml,Nt,Bl="기본 모델 가져오기",_e,Mt,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> 객체로 가져옵니다.',ke,mt,xe,v,Z,Pt,ht,ml,zt,Zl="평가",Ie,yt,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)을 사용합니다.`,Be,dt,Rl=`이를 위해 🤗 Evaluate 라이브러리를 사용합니다.
WER의 잠재적 제한 사항 및 기타 문제점은 <a href="https://huggingface.co/spaces/evaluate-metric/wer" rel="nofollow">이 가이드</a>를 참조하세요.`,We,ut,Ze,C,G,Kt,ft,hl,Qt,Hl="학습!",Ge,wt,El="이제 모델 파인튜닝을 시작할 준비가 되었습니다. 이를 위해 🤗 <code>Trainer</code>를 사용합니다.",Re,Jt,Xl="먼저, <code>TrainingArguments</code>를 사용하여 학습 인수를 정의합니다.",He,bt,Ee,Tt,Vl="학습 인수를 데이터세트, 모델과 함께 🤗 Trainer에 전달합니다.",Xe,Ut,Ve,jt,Yl="학습을 시작하려면 <code>Trainer</code> 객체에서 <code>train()</code>을 호출하기만 하면 됩니다.",Ye,gt,Ne,vt,Nl="학습이 진행되면서 학습 손실이 원활하게 감소하는 것을 볼 수 있습니다.",ze,Ct,zl="학습이 완료되면 모든 사람이 모델을 사용할 수 있도록 <code>push_to_hub()</code> 메소드를 사용하여 모델을 허브에 공유하세요:",Qe,$t,Ae,$,R,Dt,_t,yl,At,Ql="추론",Fe,kt,Al="<code>test_ds</code>에서 샘플 이미지를 가져와 모델을 테스트합니다.",Se,xt,qe,H,Fl='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/test_image_image_cap.png" alt="Test image"/>',Le,It,Pe,Bt,Sl="<code>generate</code>를 호출하고 예측을 디코딩합니다.",Ke,Wt,De,Zt,Oe,Gt,ql="파인튜닝된 모델이 꽤 괜찮은 캡션을 생성한 것 같습니다!",tl,Ot,el;return X=new Ht({}),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`}}),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()`}}),q=new Ht({}),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`}}),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
    })
})`}}),x=new fs({props:{$$slots:{default:[Js]},$$scope:{ctx:te}}}),tt=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>]`}}),lt=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)`}}),st=new Ht({}),pt=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)`}}),rt=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)`}}),ct=new Ht({}),mt=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)`}}),ht=new Ht({}),ut=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}`}}),ft=new Ht({}),bt=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>,
)`}}),Ut=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,
)`}}),gt=new w({props:{code:"dHJhaW5lci50cmFpbigp",highlighted:"trainer.train()"}}),$t=new w({props:{code:"dHJhaW5lci5wdXNoX3RvX2h1Yigp",highlighted:"trainer.push_to_hub()"}}),_t=new Ht({}),xt=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`}}),It=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`}}),Wt=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)`}}),Zt=new w({props:{code:"YSUyMGRyYXdpbmclMjBvZiUyMGElMjBwaW5rJTIwYW5kJTIwYmx1ZSUyMHBva2Vtb24=",highlighted:"a drawing of a pink and blue pokemon"}}),{c(){J=p("meta"),E=a(),b=p("p"),Et=a(),T=p("h1"),_=p("a"),Ft=p("span"),M(X.$$.fragment),rl=a(),Xt=p("span"),Xt.textContent=dl,ee=a(),M(V.$$.fragment),le=a(),Y=p("p"),Y.textContent=ul,se=a(),N=p("p"),N.textContent=fl,ae=a(),z=p("ul"),z.innerHTML=wl,ne=a(),Q=p("p"),Q.textContent=Jl,pe=a(),M(A.$$.fragment),ie=a(),F=p("p"),F.textContent=bl,re=a(),M(S.$$.fragment),oe=a(),U=p("h2"),k=p("a"),St=p("span"),M(q.$$.fragment),ol=a(),Vt=p("span"),Vt.textContent=Tl,ce=a(),L=p("p"),L.innerHTML=Ul,Me=a(),M(P.$$.fragment),me=a(),M(K.$$.fragment),he=a(),D=p("p"),D.innerHTML=jl,ye=a(),M(x.$$.fragment),de=a(),O=p("p"),O.textContent=gl,ue=a(),M(tt.$$.fragment),fe=a(),et=p("p"),et.textContent=vl,we=a(),M(lt.$$.fragment),Je=a(),I=p("div"),I.innerHTML=Cl,be=a(),j=p("h2"),B=p("a"),qt=p("span"),M(st.$$.fragment),cl=a(),Yt=p("span"),Yt.textContent=$l,Te=a(),at=p("p"),at.textContent=_l,Ue=a(),nt=p("p"),nt.textContent=kl,je=a(),M(pt.$$.fragment),ge=a(),it=p("p"),it.textContent=xl,ve=a(),M(rt.$$.fragment),Ce=a(),ot=p("p"),ot.textContent=Il,$e=a(),g=p("h2"),W=p("a"),Lt=p("span"),M(ct.$$.fragment),Ml=a(),Nt=p("span"),Nt.textContent=Bl,_e=a(),Mt=p("p"),Mt.innerHTML=Wl,ke=a(),M(mt.$$.fragment),xe=a(),v=p("h2"),Z=p("a"),Pt=p("span"),M(ht.$$.fragment),ml=a(),zt=p("span"),zt.textContent=Zl,Ie=a(),yt=p("p"),yt.innerHTML=Gl,Be=a(),dt=p("p"),dt.innerHTML=Rl,We=a(),M(ut.$$.fragment),Ze=a(),C=p("h2"),G=p("a"),Kt=p("span"),M(ft.$$.fragment),hl=a(),Qt=p("span"),Qt.textContent=Hl,Ge=a(),wt=p("p"),wt.innerHTML=El,Re=a(),Jt=p("p"),Jt.innerHTML=Xl,He=a(),M(bt.$$.fragment),Ee=a(),Tt=p("p"),Tt.textContent=Vl,Xe=a(),M(Ut.$$.fragment),Ve=a(),jt=p("p"),jt.innerHTML=Yl,Ye=a(),M(gt.$$.fragment),Ne=a(),vt=p("p"),vt.textContent=Nl,ze=a(),Ct=p("p"),Ct.innerHTML=zl,Qe=a(),M($t.$$.fragment),Ae=a(),$=p("h2"),R=p("a"),Dt=p("span"),M(_t.$$.fragment),yl=a(),At=p("span"),At.textContent=Ql,Fe=a(),kt=p("p"),kt.innerHTML=Al,Se=a(),M(xt.$$.fragment),qe=a(),H=p("div"),H.innerHTML=Fl,Le=ys(`
    
모델에 사용할 이미지를 준비합니다.

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

	`),m(It.$$.fragment,t),Pe=n(t),Bt=i(t,"P",{"data-svelte-h":!0}),r(Bt)!=="svelte-1o736s1"&&(Bt.innerHTML=Sl),Ke=n(t),m(Wt.$$.fragment,t),De=n(t),m(Zt.$$.fragment,t),Oe=n(t),Gt=i(t,"P",{"data-svelte-h":!0}),r(Gt)!=="svelte-1ye6o6q"&&(Gt.textContent=ql),tl=n(t),Ot=i(t,"P",{}),f(Ot).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(t,e){c(document.head,J),s(t,E,e),s(t,b,e),s(t,Et,e),s(t,T,e),c(T,_),c(_,Ft),h(X,Ft,null),c(T,rl),c(T,Xt),s(t,ee,e),h(V,t,e),s(t,le,e),s(t,Y,e),s(t,se,e),s(t,N,e),s(t,ae,e),s(t,z,e),s(t,ne,e),s(t,Q,e),s(t,pe,e),h(A,t,e),s(t,ie,e),s(t,F,e),s(t,re,e),h(S,t,e),s(t,oe,e),s(t,U,e),c(U,k),c(k,St),h(q,St,null),c(U,ol),c(U,Vt),s(t,ce,e),s(t,L,e),s(t,Me,e),h(P,t,e),s(t,me,e),h(K,t,e),s(t,he,e),s(t,D,e),s(t,ye,e),h(x,t,e),s(t,de,e),s(t,O,e),s(t,ue,e),h(tt,t,e),s(t,fe,e),s(t,et,e),s(t,we,e),h(lt,t,e),s(t,Je,e),s(t,I,e),s(t,be,e),s(t,j,e),c(j,B),c(B,qt),h(st,qt,null),c(j,cl),c(j,Yt),s(t,Te,e),s(t,at,e),s(t,Ue,e),s(t,nt,e),s(t,je,e),h(pt,t,e),s(t,ge,e),s(t,it,e),s(t,ve,e),h(rt,t,e),s(t,Ce,e),s(t,ot,e),s(t,$e,e),s(t,g,e),c(g,W),c(W,Lt),h(ct,Lt,null),c(g,Ml),c(g,Nt),s(t,_e,e),s(t,Mt,e),s(t,ke,e),h(mt,t,e),s(t,xe,e),s(t,v,e),c(v,Z),c(Z,Pt),h(ht,Pt,null),c(v,ml),c(v,zt),s(t,Ie,e),s(t,yt,e),s(t,Be,e),s(t,dt,e),s(t,We,e),h(ut,t,e),s(t,Ze,e),s(t,C,e),c(C,G),c(G,Kt),h(ft,Kt,null),c(C,hl),c(C,Qt),s(t,Ge,e),s(t,wt,e),s(t,Re,e),s(t,Jt,e),s(t,He,e),h(bt,t,e),s(t,Ee,e),s(t,Tt,e),s(t,Xe,e),h(Ut,t,e),s(t,Ve,e),s(t,jt,e),s(t,Ye,e),h(gt,t,e),s(t,Ne,e),s(t,vt,e),s(t,ze,e),s(t,Ct,e),s(t,Qe,e),h($t,t,e),s(t,Ae,e),s(t,$,e),c($,R),c(R,Dt),h(_t,Dt,null),c($,yl),c($,At),s(t,Fe,e),s(t,kt,e),s(t,Se,e),h(xt,t,e),s(t,qe,e),s(t,H,e),s(t,Le,e),h(It,t,e),s(t,Pe,e),s(t,Bt,e),s(t,Ke,e),h(Wt,t,e),s(t,De,e),h(Zt,t,e),s(t,Oe,e),s(t,Gt,e),s(t,tl,e),s(t,Ot,e),el=!0},p(t,[e]){const Rt={};e&2&&(Rt.$$scope={dirty:e,ctx:t}),x.$set(Rt)},i(t){el||(y(X.$$.fragment,t),y(V.$$.fragment,t),y(A.$$.fragment,t),y(S.$$.fragment,t),y(q.$$.fragment,t),y(P.$$.fragment,t),y(K.$$.fragment,t),y(x.$$.fragment,t),y(tt.$$.fragment,t),y(lt.$$.fragment,t),y(st.$$.fragment,t),y(pt.$$.fragment,t),y(rt.$$.fragment,t),y(ct.$$.fragment,t),y(mt.$$.fragment,t),y(ht.$$.fragment,t),y(ut.$$.fragment,t),y(ft.$$.fragment,t),y(bt.$$.fragment,t),y(Ut.$$.fragment,t),y(gt.$$.fragment,t),y($t.$$.fragment,t),y(_t.$$.fragment,t),y(xt.$$.fragment,t),y(It.$$.fragment,t),y(Wt.$$.fragment,t),y(Zt.$$.fragment,t),el=!0)},o(t){d(X.$$.fragment,t),d(V.$$.fragment,t),d(A.$$.fragment,t),d(S.$$.fragment,t),d(q.$$.fragment,t),d(P.$$.fragment,t),d(K.$$.fragment,t),d(x.$$.fragment,t),d(tt.$$.fragment,t),d(lt.$$.fragment,t),d(st.$$.fragment,t),d(pt.$$.fragment,t),d(rt.$$.fragment,t),d(ct.$$.fragment,t),d(mt.$$.fragment,t),d(ht.$$.fragment,t),d(ut.$$.fragment,t),d(ft.$$.fragment,t),d(bt.$$.fragment,t),d(Ut.$$.fragment,t),d(gt.$$.fragment,t),d($t.$$.fragment,t),d(_t.$$.fragment,t),d(xt.$$.fragment,t),d(It.$$.fragment,t),d(Wt.$$.fragment,t),d(Zt.$$.fragment,t),el=!1},d(t){t&&(l(E),l(b),l(Et),l(T),l(ee),l(le),l(Y),l(se),l(N),l(ae),l(z),l(ne),l(Q),l(pe),l(ie),l(F),l(re),l(oe),l(U),l(ce),l(L),l(Me),l(me),l(he),l(D),l(ye),l(de),l(O),l(ue),l(fe),l(et),l(we),l(Je),l(I),l(be),l(j),l(Te),l(at),l(Ue),l(nt),l(je),l(ge),l(it),l(ve),l(Ce),l(ot),l($e),l(g),l(_e),l(Mt),l(ke),l(xe),l(v),l(Ie),l(yt),l(Be),l(dt),l(We),l(Ze),l(C),l(Ge),l(wt),l(Re),l(Jt),l(He),l(Ee),l(Tt),l(Xe),l(Ve),l(jt),l(Ye),l(Ne),l(vt),l(ze),l(Ct),l(Qe),l(Ae),l($),l(Fe),l(kt),l(Se),l(qe),l(H),l(Le),l(Pe),l(Bt),l(Ke),l(De),l(Oe),l(Gt),l(tl),l(Ot)),l(J),u(X),u(V,t),u(A,t),u(S,t),u(q),u(P,t),u(K,t),u(x,t),u(tt,t),u(lt,t),u(st),u(pt,t),u(rt,t),u(ct),u(mt,t),u(ht),u(ut,t),u(ft),u(bt,t),u(Ut,t),u(gt,t),u($t,t),u(_t),u(xt,t),u(It,t),u(Wt,t),u(Zt,t)}}}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(te){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};
