import{s as ua,o as ja,n as ga}from"../chunks/scheduler.56730f09.js";import{S as fa,i as Ma,g as a,s as p,u as m,A as ya,h as n,f as e,c as i,j as o,v as u,y as h,k as r,o as c,a as l,w as j,d as g,t as f,x as M,m as xa,n as da}from"../chunks/index.ba464511.js";import{T as ma}from"../chunks/Tip.70442610.js";import{I as v}from"../chunks/IconCopyLink.89bde88e.js";import{C as x}from"../chunks/CodeBlock.2302fd0d.js";function Ja(Os){let y,d="지원하는 모든 태스크와 쓸 수 있는 매개변수를 담은 목록은 <code>pipeline()</code> 설명서를 참고해주세요.";return{c(){y=a("p"),y.innerHTML=d},l(J){y=n(J,"P",{"data-svelte-h":!0}),h(y)!=="svelte-15myyv1"&&(y.innerHTML=d)},m(J,se){l(J,y,se)},p:ga,d(J){J&&e(y)}}}function va(Os){let y;return{c(){y=xa("추론 엔진을 만드는 과정은 따로 페이지를 작성할만한 복잡한 주제입니다.")},l(d){y=da(d,"추론 엔진을 만드는 과정은 따로 페이지를 작성할만한 복잡한 주제입니다.")},m(d,J){l(d,y,J)},d(d){d&&e(y)}}}function wa(Os){let y,d,J,se,w,W,me,z,At,ee,sl="추론을 위한 Pipeline",be,F,el='<code>pipeline()</code>을 사용하면 언어, 컴퓨터 비전, 오디오 및 멀티모달 태스크에 대한 추론을 위해 <a href="https://huggingface.co/models" rel="nofollow">Hub</a>의 어떤 모델이든 쉽게 사용할 수 있습니다. 특정 분야에 대한 경험이 없거나, 모델을 이루는 코드가 익숙하지 않은 경우에도 <code>pipeline()</code>을 사용해서 추론할 수 있어요! 이 튜토리얼에서는 다음을 배워보겠습니다.',Ue,Q,tl="<li>추론을 위해 <code>pipeline()</code>을 사용하는 방법</li> <li>특정 토크나이저 또는 모델을 사용하는 방법</li> <li>언어, 컴퓨터 비전, 오디오 및 멀티모달 태스크에서 <code>pipeline()</code>을 사용하는 방법</li>",$e,B,Ze,T,H,ue,D,St,te,ll="Pipeline 사용하기",Ie,K,al="각 태스크마다 고유의 <code>pipeline()</code>이 있지만, 개별 파이프라인을 담고있는 추상화된 <code>pipeline()</code>를 사용하는 것이 일반적으로 더 간단합니다. <code>pipeline()</code>은 태스크에 알맞게 추론이 가능한 기본 모델과 전처리 클래스를 자동으로 로드합니다.",ke,O,nl="<li>먼저 <code>pipeline()</code>을 생성하고 태스크를 지정하세요.</li>",Ce,ss,Ge,N,pl="<li>그리고 <code>pipeline()</code>에 입력을 넣어주세요.</li>",_e,es,We,ts,il=`기대했던 결과가 아닌가요? Hub에서 <a href="https://huggingface.co/models?pipeline_tag=automatic-speech-recognition&amp;sort=downloads" rel="nofollow">가장 많이 다운로드된 자동 음성 인식 모델</a>로 더 나은 결과를 얻을 수 있는지 확인해보세요.
다음은 <a href="https://huggingface.co/openai/whisper-large" rel="nofollow">openai/whisper-large</a>로 시도해보겠습니다.`,Be,ls,He,as,rl=`훨씬 더 나아졌군요!
Hub의 모델들은 여러 다양한 언어와 전문분야를 아우르기 때문에 꼭 자신의 언어나 분야에 특화된 모델을 찾아보시기 바랍니다.
브라우저를 벗어날 필요없이 Hub에서 직접 모델의 출력을 확인하고 다른 모델과 비교해서 자신의 상황에 더 적합한지, 애매한 입력을 더 잘 처리하는지도 확인할 수 있습니다.
만약 상황에 알맞는 모델을 없다면 언제나 직접 <a href="training">훈련</a>시킬 수 있습니다!`,Ne,ns,hl="입력이 여러 개 있는 경우, 리스트 형태로 전달할 수 있습니다.",Ee,ps,Xe,is,cl="전체 데이터세트을 순회하거나 웹서버에 올려두어 추론에 사용하고 싶다면, 각 상세 페이지를 참조하세요.",Re,rs,ol='<a href="#using-pipelines-on-a-dataset">데이터세트에서 Pipeline 사용하기</a>',Ve,hs,ml='<a href="./pipeline_webserver">웹서버에서 Pipeline 사용하기</a>',Ye,b,E,je,cs,qt,le,ul="매개변수",Ae,os,jl=`<code>pipeline()</code>은 많은 매개변수를 지원합니다. 특정 태스크용인 것도 있고, 범용인 것도 있습니다.
일반적으로 원하는 위치에 어디든 매개변수를 넣을 수 있습니다.`,Se,ms,qe,us,gl="중요한 3가지 매개변수를 살펴보겠습니다.",Le,U,X,ge,js,Lt,ae,fl="기기(device)",Pe,gs,Ml=`<code>device=n</code>처럼 기기를 지정하면 파이프라인이 자동으로 해당 기기에 모델을 배치합니다.
파이토치에서나 텐서플로우에서도 모두 작동합니다.`,ze,fs,Fe,Ms,yl='모델이 GPU 하나에 돌아가기 버겁다면, <code>device_map=&quot;auto&quot;</code>를 지정해서 🤗 <a href="https://huggingface.co/docs/accelerate" rel="nofollow">Accelerate</a>가 모델 가중치를 어떻게 로드하고 저장할지 자동으로 결정하도록 할 수 있습니다.',Qe,ys,De,$,R,fe,xs,Pt,ne,xl="배치 사이즈",Ke,ds,dl='기본적으로 파이프라인은 <a href="https://huggingface.co/docs/transformers/main_classes/pipelines#pipeline-batching" rel="nofollow">여기</a>에 나온 이유로 추론을 일괄 처리하지 않습니다. 간단히 설명하자면 일괄 처리가 반드시 더 빠르지 않고 오히려 더 느려질 수도 있기 때문입니다.',Oe,Js,Jl="하지만 자신의 상황에 적합하다면, 이렇게 사용하세요.",st,vs,et,ws,vl=`파이프라인 위 제공된 10개의 오디오 파일을 추가로 처리하는 코드 없이 (일괄 처리에 보다 효과적인 GPU 위) 모델에 2개씩 전달합니다.
출력은 일괄 처리하지 않았을 때와 똑같아야 합니다. 파이프라인에서 속도를 더 낼 수도 있는 방법 중 하나일 뿐입니다.`,tt,Ts,wl='파이프라인은 일괄 처리의 복잡한 부분을 줄여주기도 합니다. (예를 들어 긴 오디오 파일처럼) 여러 부분으로 나눠야 모델이 처리할 수 있는 것을 <a href="./main_classes/pipelines#pipeline-chunk-batching"><em>chunk batching</em></a>이라고 하는데, 파이프라인을 사용하면 자동으로 나눠줍니다.',lt,Z,V,Me,bs,zt,pe,Tl="특정 태스크용 매개변수",at,Us,bl=`각 태스크마다 구현할 때 유연성과 옵션을 제공하기 위해 태스크용 매개변수가 있습니다.
예를 들어 <code>transformers.AutomaticSpeechRecognitionPipeline.__call__()</code> 메서드에는 동영상의 자막을 넣을 때 유용할 것 같은 <code>return_timestamps</code> 매개변수가 있습니다.`,nt,$s,pt,Zs,Ul="보시다시피 모델이 텍스트를 추론할 뿐만 아니라 각 단어를 말한 시점까지도 출력했습니다.",it,Is,$l=`태스크마다 다양한 매개변수를 가지고 있는데요. 원하는 태스크의 API를 참조해서 바꿔볼 수 있는 여러 매개변수를 살펴보세요!
지금까지 다뤄본 <code>AutomaticSpeechRecognitionPipeline</code>에는 <code>chunk_length_s</code> 매개변수가 있습니다. 영화나 1시간 분량의 동영상의 자막 작업을 할 때처럼, 일반적으로 모델이 자체적으로 처리할 수 없는 매우 긴 오디오 파일을 처리할 때 유용하죠.`,rt,ks,Zl='도움이 될 만한 매개변수를 찾지 못했다면 언제든지 <a href="https://github.com/huggingface/transformers/issues/new?assignees=&amp;labels=feature&amp;template=feature-request.yml" rel="nofollow">요청</a>해주세요!',ht,I,Y,ye,Cs,Ft,ie,Il="데이터세트에서 Pipeline 사용하기",ct,Gs,kl="파이프라인은 대규모 데이터세트에서도 추론 작업을 할 수 있습니다. 이때 이터레이터를 사용하는 걸 추천드립니다.",ot,_s,mt,Ws,Cl='이터레이터 <code>data()</code>는 각 결과를 호출마다 생성하고, 파이프라인은 입력이 순회할 수 있는 자료구조임을 자동으로 인식하여 GPU에서 기존 데이터가 처리되는 동안 새로운 데이터를 가져오기 시작합니다.(이때 내부적으로 <a href="https://pytorch.org/docs/stable/data.html#torch.utils.data.DataLoader" rel="nofollow">DataLoader</a>를 사용해요.) 이 과정은 전체 데이터세트를 메모리에 적재하지 않고도 GPU에 최대한 빠르게 새로운 작업을 공급할 수 있기 때문에 중요합니다.',ut,Bs,Gl="그리고 일괄 처리가 더 빠를 수 있기 때문에, <code>batch_size</code> 매개변수를 조정해봐도 좋아요.",jt,Hs,_l='데이터세트를 순회하는 가장 간단한 방법은 🤗 <a href="https://github.com/huggingface/datasets/" rel="nofollow">Datasets</a>를 활용하는 것인데요.',gt,Ns,ft,k,A,xe,Es,Qt,re,Wl="웹서버에서 Pipeline 사용하기",Mt,S,yt,Xs,Bl='<a href="./pipeline_webserver">Link</a>',xt,C,q,de,Rs,Dt,he,Hl="비전 Pipeline",dt,Vs,Nl="비전 태스크를 위해 <code>pipeline()</code>을 사용하는 일은 거의 동일합니다.",Jt,Ys,El="태스크를 지정하고 이미지를 분류기에 전달하면 됩니다. 이미지는 인터넷 링크 또는 로컬 경로의 형태로 전달해주세요. 예를 들어 아래에 표시된 고양이는 어떤 종인가요?",vt,As,Xl='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg" alt="pipeline-cat-chonk"/>',wt,Ss,Tt,G,L,Je,qs,Kt,ce,Rl="텍스트 Pipeline",bt,Ls,Vl="NLP 태스크를 위해 <code>pipeline()</code>을 사용하는 일도 거의 동일합니다.",Ut,Ps,$t,_,P,ve,zs,Ot,oe,Yl="멀티모달 Pipeline",Zt,Fs,Al="<code>pipeline()</code>은 여러 모달리티(역주: 오디오, 비디오, 텍스트와 같은 데이터 형태)를 지원합니다. 예시로 시각적 질의응답(VQA; Visual Question Answering) 태스크는 텍스트와 이미지를 모두 사용합니다. 그 어떤 이미지 링크나 묻고 싶은 질문도 자유롭게 전달할 수 있습니다. 이미지는 URL 또는 로컬 경로의 형태로 전달해주세요.",It,Qs,Sl='예를 들어 이 <a href="https://huggingface.co/spaces/impira/docquery/resolve/2359223c1837a7587402bda0f2643382a6eefeab/invoice.png" rel="nofollow">거래명세서 사진</a>에서 거래명세서 번호를 묻고 싶다면,',kt,Ds,Ct,we,Gt;return z=new v({}),B=new ma({props:{$$slots:{default:[Ja]},$$scope:{ctx:Os}}}),D=new v({}),ss=new x({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBZ2VuZXJhdG9yJTIwJTNEJTIwcGlwZWxpbmUodGFzayUzRCUyMmF1dG9tYXRpYy1zcGVlY2gtcmVjb2duaXRpb24lMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>generator = pipeline(task=<span class="hljs-string">&quot;automatic-speech-recognition&quot;</span>)`,wrap:!1}}),es=new x({props:{code:"Z2VuZXJhdG9yKCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRk5hcnNpbCUyRmFzcl9kdW1teSUyRnJlc29sdmUlMkZtYWluJTJGbWxrLmZsYWMlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>generator(<span class="hljs-string">&quot;https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac&quot;</span>)
{<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;I HAVE A DREAM BUT ONE DAY THIS NATION WILL RISE UP LIVE UP THE TRUE MEANING OF ITS TREES&#x27;</span>}`,wrap:!1}}),ls=new x({props:{code:"Z2VuZXJhdG9yJTIwJTNEJTIwcGlwZWxpbmUobW9kZWwlM0QlMjJvcGVuYWklMkZ3aGlzcGVyLWxhcmdlJTIyKSUwQWdlbmVyYXRvciglMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZOYXJzaWwlMkZhc3JfZHVtbXklMkZyZXNvbHZlJTJGbWFpbiUyRm1say5mbGFjJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>generator = pipeline(model=<span class="hljs-string">&quot;openai/whisper-large&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>generator(<span class="hljs-string">&quot;https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac&quot;</span>)
{<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27; I have a dream that one day this nation will rise up and live out the true meaning of its creed.&#x27;</span>}`,wrap:!1}}),ps=new x({props:{code:"Z2VuZXJhdG9yKCUwQSUyMCUyMCUyMCUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRk5hcnNpbCUyRmFzcl9kdW1teSUyRnJlc29sdmUlMkZtYWluJTJGbWxrLmZsYWMlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZOYXJzaWwlMkZhc3JfZHVtbXklMkZyZXNvbHZlJTJGbWFpbiUyRjEuZmxhYyUyMiUyQyUwQSUyMCUyMCUyMCUyMCU1RCUwQSk=",highlighted:`generator(
    [
        <span class="hljs-string">&quot;https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac&quot;</span>,
        <span class="hljs-string">&quot;https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/1.flac&quot;</span>,
    ]
)`,wrap:!1}}),cs=new v({}),ms=new x({props:{code:"Z2VuZXJhdG9yKG1vZGVsJTNEJTIyb3BlbmFpJTJGd2hpc3Blci1sYXJnZSUyMiUyQyUyMG15X3BhcmFtZXRlciUzRDEpJTBBb3V0JTIwJTNEJTIwZ2VuZXJhdGUoLi4uKSUyMCUyMCUyMyUyMFRoaXMlMjB3aWxsJTIwdXNlJTIwJTYwbXlfcGFyYW1ldGVyJTNEMSU2MC4lMEFvdXQlMjAlM0QlMjBnZW5lcmF0ZSguLi4lMkMlMjBteV9wYXJhbWV0ZXIlM0QyKSUyMCUyMCUyMyUyMFRoaXMlMjB3aWxsJTIwb3ZlcnJpZGUlMjBhbmQlMjB1c2UlMjAlNjBteV9wYXJhbWV0ZXIlM0QyJTYwLiUwQW91dCUyMCUzRCUyMGdlbmVyYXRlKC4uLiklMjAlMjAlMjMlMjBUaGlzJTIwd2lsbCUyMGdvJTIwYmFjayUyMHRvJTIwdXNpbmclMjAlNjBteV9wYXJhbWV0ZXIlM0QxJTYwLg==",highlighted:'generator(model=<span class="hljs-string">&quot;openai/whisper-large&quot;</span>, my_parameter=<span class="hljs-number">1</span>)\nout = generate(...)  <span class="hljs-comment"># This will use `my_parameter=1`.</span>\nout = generate(..., my_parameter=<span class="hljs-number">2</span>)  <span class="hljs-comment"># This will override and use `my_parameter=2`.</span>\nout = generate(...)  <span class="hljs-comment"># This will go back to using `my_parameter=1`.</span>',wrap:!1}}),js=new v({}),fs=new x({props:{code:"Z2VuZXJhdG9yKG1vZGVsJTNEJTIyb3BlbmFpJTJGd2hpc3Blci1sYXJnZSUyMiUyQyUyMGRldmljZSUzRDAp",highlighted:'generator(model=<span class="hljs-string">&quot;openai/whisper-large&quot;</span>, device=<span class="hljs-number">0</span>)',wrap:!1}}),ys=new x({props:{code:"JTIzIXBpcCUyMGluc3RhbGwlMjBhY2NlbGVyYXRlJTBBZ2VuZXJhdG9yKG1vZGVsJTNEJTIyb3BlbmFpJTJGd2hpc3Blci1sYXJnZSUyMiUyQyUyMGRldmljZV9tYXAlM0QlMjJhdXRvJTIyKQ==",highlighted:`<span class="hljs-comment">#!pip install accelerate</span>
generator(model=<span class="hljs-string">&quot;openai/whisper-large&quot;</span>, device_map=<span class="hljs-string">&quot;auto&quot;</span>)`,wrap:!1}}),xs=new v({}),vs=new x({props:{code:"Z2VuZXJhdG9yKG1vZGVsJTNEJTIyb3BlbmFpJTJGd2hpc3Blci1sYXJnZSUyMiUyQyUyMGRldmljZSUzRDAlMkMlMjBiYXRjaF9zaXplJTNEMiklMEFhdWRpb19maWxlbmFtZXMlMjAlM0QlMjAlNUJmJTIyYXVkaW9fJTdCaSU3RC5mbGFjJTIyJTIwZm9yJTIwaSUyMGluJTIwcmFuZ2UoMTApJTVEJTBBdGV4dHMlMjAlM0QlMjBnZW5lcmF0b3IoYXVkaW9fZmlsZW5hbWVzKQ==",highlighted:`generator(model=<span class="hljs-string">&quot;openai/whisper-large&quot;</span>, device=<span class="hljs-number">0</span>, batch_size=<span class="hljs-number">2</span>)
audio_filenames = [<span class="hljs-string">f&quot;audio_<span class="hljs-subst">{i}</span>.flac&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">10</span>)]
texts = generator(audio_filenames)`,wrap:!1}}),bs=new v({}),$s=new x({props:{code:"JTIzJTIwTm90JTIwdXNpbmclMjB3aGlzcGVyJTJDJTIwYXMlMjBpdCUyMGNhbm5vdCUyMHByb3ZpZGUlMjB0aW1lc3RhbXBzLiUwQWdlbmVyYXRvciUyMCUzRCUyMHBpcGVsaW5lKG1vZGVsJTNEJTIyZmFjZWJvb2slMkZ3YXYydmVjMi1sYXJnZS05NjBoLWx2NjAtc2VsZiUyMiUyQyUyMHJldHVybl90aW1lc3RhbXBzJTNEJTIyd29yZCUyMiklMEFnZW5lcmF0b3IoJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGTmFyc2lsJTJGYXNyX2R1bW15JTJGcmVzb2x2ZSUyRm1haW4lMkZtbGsuZmxhYyUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Not using whisper, as it cannot provide timestamps.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generator = pipeline(model=<span class="hljs-string">&quot;facebook/wav2vec2-large-960h-lv60-self&quot;</span>, return_timestamps=<span class="hljs-string">&quot;word&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>generator(<span class="hljs-string">&quot;https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac&quot;</span>)
{<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;I HAVE A DREAM BUT ONE DAY THIS NATION WILL RISE UP AND LIVE OUT THE TRUE MEANING OF ITS CREED&#x27;</span>, <span class="hljs-string">&#x27;chunks&#x27;</span>: [{<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;I&#x27;</span>, <span class="hljs-string">&#x27;timestamp&#x27;</span>: (<span class="hljs-number">1.22</span>, <span class="hljs-number">1.24</span>)}, {<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;HAVE&#x27;</span>, <span class="hljs-string">&#x27;timestamp&#x27;</span>: (<span class="hljs-number">1.42</span>, <span class="hljs-number">1.58</span>)}, {<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;A&#x27;</span>, <span class="hljs-string">&#x27;timestamp&#x27;</span>: (<span class="hljs-number">1.66</span>, <span class="hljs-number">1.68</span>)}, {<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;DREAM&#x27;</span>, <span class="hljs-string">&#x27;timestamp&#x27;</span>: (<span class="hljs-number">1.76</span>, <span class="hljs-number">2.14</span>)}, {<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;BUT&#x27;</span>, <span class="hljs-string">&#x27;timestamp&#x27;</span>: (<span class="hljs-number">3.68</span>, <span class="hljs-number">3.8</span>)}, {<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;ONE&#x27;</span>, <span class="hljs-string">&#x27;timestamp&#x27;</span>: (<span class="hljs-number">3.94</span>, <span class="hljs-number">4.06</span>)}, {<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;DAY&#x27;</span>, <span class="hljs-string">&#x27;timestamp&#x27;</span>: (<span class="hljs-number">4.16</span>, <span class="hljs-number">4.3</span>)}, {<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;THIS&#x27;</span>, <span class="hljs-string">&#x27;timestamp&#x27;</span>: (<span class="hljs-number">6.36</span>, <span class="hljs-number">6.54</span>)}, {<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;NATION&#x27;</span>, <span class="hljs-string">&#x27;timestamp&#x27;</span>: (<span class="hljs-number">6.68</span>, <span class="hljs-number">7.1</span>)}, {<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;WILL&#x27;</span>, <span class="hljs-string">&#x27;timestamp&#x27;</span>: (<span class="hljs-number">7.32</span>, <span class="hljs-number">7.56</span>)}, {<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;RISE&#x27;</span>, <span class="hljs-string">&#x27;timestamp&#x27;</span>: (<span class="hljs-number">7.8</span>, <span class="hljs-number">8.26</span>)}, {<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;UP&#x27;</span>, <span class="hljs-string">&#x27;timestamp&#x27;</span>: (<span class="hljs-number">8.38</span>, <span class="hljs-number">8.48</span>)}, {<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;AND&#x27;</span>, <span class="hljs-string">&#x27;timestamp&#x27;</span>: (<span class="hljs-number">10.08</span>, <span class="hljs-number">10.18</span>)}, {<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;LIVE&#x27;</span>, <span class="hljs-string">&#x27;timestamp&#x27;</span>: (<span class="hljs-number">10.26</span>, <span class="hljs-number">10.48</span>)}, {<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;OUT&#x27;</span>, <span class="hljs-string">&#x27;timestamp&#x27;</span>: (<span class="hljs-number">10.58</span>, <span class="hljs-number">10.7</span>)}, {<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;THE&#x27;</span>, <span class="hljs-string">&#x27;timestamp&#x27;</span>: (<span class="hljs-number">10.82</span>, <span class="hljs-number">10.9</span>)}, {<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;TRUE&#x27;</span>, <span class="hljs-string">&#x27;timestamp&#x27;</span>: (<span class="hljs-number">10.98</span>, <span class="hljs-number">11.18</span>)}, {<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;MEANING&#x27;</span>, <span class="hljs-string">&#x27;timestamp&#x27;</span>: (<span class="hljs-number">11.26</span>, <span class="hljs-number">11.58</span>)}, {<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;OF&#x27;</span>, <span class="hljs-string">&#x27;timestamp&#x27;</span>: (<span class="hljs-number">11.66</span>, <span class="hljs-number">11.7</span>)}, {<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;ITS&#x27;</span>, <span class="hljs-string">&#x27;timestamp&#x27;</span>: (<span class="hljs-number">11.76</span>, <span class="hljs-number">11.88</span>)}, {<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;CREED&#x27;</span>, <span class="hljs-string">&#x27;timestamp&#x27;</span>: (<span class="hljs-number">12.0</span>, <span class="hljs-number">12.38</span>)}]}`,wrap:!1}}),Cs=new v({}),_s=new x({props:{code:"ZGVmJTIwZGF0YSgpJTNBJTBBJTIwJTIwJTIwJTIwZm9yJTIwaSUyMGluJTIwcmFuZ2UoMTAwMCklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjB5aWVsZCUyMGYlMjJNeSUyMGV4YW1wbGUlMjAlN0JpJTdEJTIyJTBBJTBBJTBBcGlwZSUyMCUzRCUyMHBpcGUobW9kZWwlM0QlMjJncHQyJTIyJTJDJTIwZGV2aWNlJTNEMCklMEFnZW5lcmF0ZWRfY2hhcmFjdGVycyUyMCUzRCUyMDAlMEFmb3IlMjBvdXQlMjBpbiUyMHBpcGUoZGF0YSgpKSUzQSUwQSUyMCUyMCUyMCUyMGdlbmVyYXRlZF9jaGFyYWN0ZXJzJTIwJTJCJTNEJTIwbGVuKG91dCU1QiUyMmdlbmVyYXRlZF90ZXh0JTIyJTVEKQ==",highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">data</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">1000</span>):
        <span class="hljs-keyword">yield</span> <span class="hljs-string">f&quot;My example <span class="hljs-subst">{i}</span>&quot;</span>


pipe = pipe(model=<span class="hljs-string">&quot;gpt2&quot;</span>, device=<span class="hljs-number">0</span>)
generated_characters = <span class="hljs-number">0</span>
<span class="hljs-keyword">for</span> out <span class="hljs-keyword">in</span> pipe(data()):
    generated_characters += <span class="hljs-built_in">len</span>(out[<span class="hljs-string">&quot;generated_text&quot;</span>])`,wrap:!1}}),Ns=new x({props:{code:"JTIzJTIwS2V5RGF0YXNldCUyMGlzJTIwYSUyMHV0aWwlMjB0aGF0JTIwd2lsbCUyMGp1c3QlMjBvdXRwdXQlMjB0aGUlMjBpdGVtJTIwd2UncmUlMjBpbnRlcmVzdGVkJTIwaW4uJTBBZnJvbSUyMHRyYW5zZm9ybWVycy5waXBlbGluZXMucHRfdXRpbHMlMjBpbXBvcnQlMjBLZXlEYXRhc2V0JTBBJTBBcGlwZSUyMCUzRCUyMHBpcGVsaW5lKG1vZGVsJTNEJTIyaGYtaW50ZXJuYWwtdGVzdGluZyUyRnRpbnktcmFuZG9tLXdhdjJ2ZWMyJTIyJTJDJTIwZGV2aWNlJTNEMCklMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmhmLWludGVybmFsLXRlc3RpbmclMkZsaWJyaXNwZWVjaF9hc3JfZHVtbXklMjIlMkMlMjAlMjJjbGVhbiUyMiUyQyUyMHNwbGl0JTNEJTIydmFsaWRhdGlvbiU1QiUzQTEwJTVEJTIyKSUwQSUwQWZvciUyMG91dCUyMGluJTIwcGlwZShLZXlEYXRhc2V0KGRhdGFzZXQlNUIlMjJhdWRpbyUyMiU1RCkpJTNBJTBBJTIwJTIwJTIwJTIwcHJpbnQob3V0KQ==",highlighted:`<span class="hljs-comment"># KeyDataset is a util that will just output the item we&#x27;re interested in.</span>
<span class="hljs-keyword">from</span> transformers.pipelines.pt_utils <span class="hljs-keyword">import</span> KeyDataset

pipe = pipeline(model=<span class="hljs-string">&quot;hf-internal-testing/tiny-random-wav2vec2&quot;</span>, device=<span class="hljs-number">0</span>)
dataset = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_dummy&quot;</span>, <span class="hljs-string">&quot;clean&quot;</span>, split=<span class="hljs-string">&quot;validation[:10]&quot;</span>)

<span class="hljs-keyword">for</span> out <span class="hljs-keyword">in</span> pipe(KeyDataset(dataset[<span class="hljs-string">&quot;audio&quot;</span>])):
    <span class="hljs-built_in">print</span>(out)`,wrap:!1}}),Es=new v({}),S=new ma({props:{$$slots:{default:[va]},$$scope:{ctx:Os}}}),Rs=new v({}),Ss=new x({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBdmlzaW9uX2NsYXNzaWZpZXIlMjAlM0QlMjBwaXBlbGluZShtb2RlbCUzRCUyMmdvb2dsZSUyRnZpdC1iYXNlLXBhdGNoMTYtMjI0JTIyKSUwQXByZWRzJTIwJTNEJTIwdmlzaW9uX2NsYXNzaWZpZXIoJTBBJTIwJTIwJTIwJTIwaW1hZ2VzJTNEJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGaHVnZ2luZ2ZhY2UlMkZkb2N1bWVudGF0aW9uLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTJGcGlwZWxpbmUtY2F0LWNob25rLmpwZWclMjIlMEEpJTBBcHJlZHMlMjAlM0QlMjAlNUIlN0IlMjJzY29yZSUyMiUzQSUyMHJvdW5kKHByZWQlNUIlMjJzY29yZSUyMiU1RCUyQyUyMDQpJTJDJTIwJTIybGFiZWwlMjIlM0ElMjBwcmVkJTVCJTIybGFiZWwlMjIlNUQlN0QlMjBmb3IlMjBwcmVkJTIwaW4lMjBwcmVkcyU1RCUwQXByZWRz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>vision_classifier = pipeline(model=<span class="hljs-string">&quot;google/vit-base-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>preds = vision_classifier(
<span class="hljs-meta">... </span>    images=<span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>preds = [{<span class="hljs-string">&quot;score&quot;</span>: <span class="hljs-built_in">round</span>(pred[<span class="hljs-string">&quot;score&quot;</span>], <span class="hljs-number">4</span>), <span class="hljs-string">&quot;label&quot;</span>: pred[<span class="hljs-string">&quot;label&quot;</span>]} <span class="hljs-keyword">for</span> pred <span class="hljs-keyword">in</span> preds]
<span class="hljs-meta">&gt;&gt;&gt; </span>preds
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.4335</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;lynx, catamount&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.0348</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;cougar, puma, catamount, mountain lion, painter, panther, Felis concolor&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.0324</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;snow leopard, ounce, Panthera uncia&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.0239</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;Egyptian cat&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.0229</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;tiger cat&#x27;</span>}]`,wrap:!1}}),qs=new v({}),Ps=new x({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBJTIzJTIwVGhpcyUyMG1vZGVsJTIwaXMlMjBhJTIwJTYwemVyby1zaG90LWNsYXNzaWZpY2F0aW9uJTYwJTIwbW9kZWwuJTBBJTIzJTIwSXQlMjB3aWxsJTIwY2xhc3NpZnklMjB0ZXh0JTJDJTIwZXhjZXB0JTIweW91JTIwYXJlJTIwZnJlZSUyMHRvJTIwY2hvb3NlJTIwYW55JTIwbGFiZWwlMjB5b3UlMjBtaWdodCUyMGltYWdpbmUlMEFjbGFzc2lmaWVyJTIwJTNEJTIwcGlwZWxpbmUobW9kZWwlM0QlMjJmYWNlYm9vayUyRmJhcnQtbGFyZ2UtbW5saSUyMiklMEFjbGFzc2lmaWVyKCUwQSUyMCUyMCUyMCUyMCUyMkklMjBoYXZlJTIwYSUyMHByb2JsZW0lMjB3aXRoJTIwbXklMjBpcGhvbmUlMjB0aGF0JTIwbmVlZHMlMjB0byUyMGJlJTIwcmVzb2x2ZWQlMjBhc2FwISElMjIlMkMlMEElMjAlMjAlMjAlMjBjYW5kaWRhdGVfbGFiZWxzJTNEJTVCJTIydXJnZW50JTIyJTJDJTIwJTIybm90JTIwdXJnZW50JTIyJTJDJTIwJTIycGhvbmUlMjIlMkMlMjAlMjJ0YWJsZXQlMjIlMkMlMjAlMjJjb21wdXRlciUyMiU1RCUyQyUwQSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># This model is a \`zero-shot-classification\` model.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># It will classify text, except you are free to choose any label you might imagine</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>classifier = pipeline(model=<span class="hljs-string">&quot;facebook/bart-large-mnli&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>classifier(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;I have a problem with my iphone that needs to be resolved asap!!&quot;</span>,
<span class="hljs-meta">... </span>    candidate_labels=[<span class="hljs-string">&quot;urgent&quot;</span>, <span class="hljs-string">&quot;not urgent&quot;</span>, <span class="hljs-string">&quot;phone&quot;</span>, <span class="hljs-string">&quot;tablet&quot;</span>, <span class="hljs-string">&quot;computer&quot;</span>],
<span class="hljs-meta">... </span>)
{<span class="hljs-string">&#x27;sequence&#x27;</span>: <span class="hljs-string">&#x27;I have a problem with my iphone that needs to be resolved asap!!&#x27;</span>, <span class="hljs-string">&#x27;labels&#x27;</span>: [<span class="hljs-string">&#x27;urgent&#x27;</span>, <span class="hljs-string">&#x27;phone&#x27;</span>, <span class="hljs-string">&#x27;computer&#x27;</span>, <span class="hljs-string">&#x27;not urgent&#x27;</span>, <span class="hljs-string">&#x27;tablet&#x27;</span>], <span class="hljs-string">&#x27;scores&#x27;</span>: [<span class="hljs-number">0.504</span>, <span class="hljs-number">0.479</span>, <span class="hljs-number">0.013</span>, <span class="hljs-number">0.003</span>, <span class="hljs-number">0.002</span>]}`,wrap:!1}}),zs=new v({}),Ds=new x({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBdnFhJTIwJTNEJTIwcGlwZWxpbmUobW9kZWwlM0QlMjJpbXBpcmElMkZsYXlvdXRsbS1kb2N1bWVudC1xYSUyMiklMEF2cWEoJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0QlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGc3BhY2VzJTJGaW1waXJhJTJGZG9jcXVlcnklMkZyZXNvbHZlJTJGMjM1OTIyM2MxODM3YTc1ODc0MDJiZGEwZjI2NDMzODJhNmVlZmVhYiUyRmludm9pY2UucG5nJTIyJTJDJTBBJTIwJTIwJTIwJTIwcXVlc3Rpb24lM0QlMjJXaGF0JTIwaXMlMjB0aGUlMjBpbnZvaWNlJTIwbnVtYmVyJTNGJTIyJTJDJTBBKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>vqa = pipeline(model=<span class="hljs-string">&quot;impira/layoutlm-document-qa&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>vqa(
<span class="hljs-meta">... </span>    image=<span class="hljs-string">&quot;https://huggingface.co/spaces/impira/docquery/resolve/2359223c1837a7587402bda0f2643382a6eefeab/invoice.png&quot;</span>,
<span class="hljs-meta">... </span>    question=<span class="hljs-string">&quot;What is the invoice number?&quot;</span>,
<span class="hljs-meta">... </span>)
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.42514941096305847</span>, <span class="hljs-string">&#x27;answer&#x27;</span>: <span class="hljs-string">&#x27;us-001&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">16</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">16</span>}]`,wrap:!1}}),{c(){y=a("meta"),d=p(),J=a("p"),se=p(),w=a("h1"),W=a("a"),me=a("span"),m(z.$$.fragment),At=p(),ee=a("span"),ee.textContent=sl,be=p(),F=a("p"),F.innerHTML=el,Ue=p(),Q=a("ul"),Q.innerHTML=tl,$e=p(),m(B.$$.fragment),Ze=p(),T=a("h2"),H=a("a"),ue=a("span"),m(D.$$.fragment),St=p(),te=a("span"),te.textContent=ll,Ie=p(),K=a("p"),K.innerHTML=al,ke=p(),O=a("ol"),O.innerHTML=nl,Ce=p(),m(ss.$$.fragment),Ge=p(),N=a("ol"),N.innerHTML=pl,_e=p(),m(es.$$.fragment),We=p(),ts=a("p"),ts.innerHTML=il,Be=p(),m(ls.$$.fragment),He=p(),as=a("p"),as.innerHTML=rl,Ne=p(),ns=a("p"),ns.textContent=hl,Ee=p(),m(ps.$$.fragment),Xe=p(),is=a("p"),is.textContent=cl,Re=p(),rs=a("p"),rs.innerHTML=ol,Ve=p(),hs=a("p"),hs.innerHTML=ml,Ye=p(),b=a("h2"),E=a("a"),je=a("span"),m(cs.$$.fragment),qt=p(),le=a("span"),le.textContent=ul,Ae=p(),os=a("p"),os.innerHTML=jl,Se=p(),m(ms.$$.fragment),qe=p(),us=a("p"),us.textContent=gl,Le=p(),U=a("h3"),X=a("a"),ge=a("span"),m(js.$$.fragment),Lt=p(),ae=a("span"),ae.textContent=fl,Pe=p(),gs=a("p"),gs.innerHTML=Ml,ze=p(),m(fs.$$.fragment),Fe=p(),Ms=a("p"),Ms.innerHTML=yl,Qe=p(),m(ys.$$.fragment),De=p(),$=a("h3"),R=a("a"),fe=a("span"),m(xs.$$.fragment),Pt=p(),ne=a("span"),ne.textContent=xl,Ke=p(),ds=a("p"),ds.innerHTML=dl,Oe=p(),Js=a("p"),Js.textContent=Jl,st=p(),m(vs.$$.fragment),et=p(),ws=a("p"),ws.textContent=vl,tt=p(),Ts=a("p"),Ts.innerHTML=wl,lt=p(),Z=a("h3"),V=a("a"),Me=a("span"),m(bs.$$.fragment),zt=p(),pe=a("span"),pe.textContent=Tl,at=p(),Us=a("p"),Us.innerHTML=bl,nt=p(),m($s.$$.fragment),pt=p(),Zs=a("p"),Zs.textContent=Ul,it=p(),Is=a("p"),Is.innerHTML=$l,rt=p(),ks=a("p"),ks.innerHTML=Zl,ht=p(),I=a("h2"),Y=a("a"),ye=a("span"),m(Cs.$$.fragment),Ft=p(),ie=a("span"),ie.textContent=Il,ct=p(),Gs=a("p"),Gs.textContent=kl,ot=p(),m(_s.$$.fragment),mt=p(),Ws=a("p"),Ws.innerHTML=Cl,ut=p(),Bs=a("p"),Bs.innerHTML=Gl,jt=p(),Hs=a("p"),Hs.innerHTML=_l,gt=p(),m(Ns.$$.fragment),ft=p(),k=a("h2"),A=a("a"),xe=a("span"),m(Es.$$.fragment),Qt=p(),re=a("span"),re.textContent=Wl,Mt=p(),m(S.$$.fragment),yt=p(),Xs=a("p"),Xs.innerHTML=Bl,xt=p(),C=a("h2"),q=a("a"),de=a("span"),m(Rs.$$.fragment),Dt=p(),he=a("span"),he.textContent=Hl,dt=p(),Vs=a("p"),Vs.innerHTML=Nl,Jt=p(),Ys=a("p"),Ys.textContent=El,vt=p(),As=a("p"),As.innerHTML=Xl,wt=p(),m(Ss.$$.fragment),Tt=p(),G=a("h3"),L=a("a"),Je=a("span"),m(qs.$$.fragment),Kt=p(),ce=a("span"),ce.textContent=Rl,bt=p(),Ls=a("p"),Ls.innerHTML=Vl,Ut=p(),m(Ps.$$.fragment),$t=p(),_=a("h3"),P=a("a"),ve=a("span"),m(zs.$$.fragment),Ot=p(),oe=a("span"),oe.textContent=Yl,Zt=p(),Fs=a("p"),Fs.innerHTML=Al,It=p(),Qs=a("p"),Qs.innerHTML=Sl,kt=p(),m(Ds.$$.fragment),Ct=p(),we=a("p"),this.h()},l(s){const t=ya("svelte-1phssyn",document.head);y=n(t,"META",{name:!0,content:!0}),t.forEach(e),d=i(s),J=n(s,"P",{}),o(J).forEach(e),se=i(s),w=n(s,"H1",{class:!0});var Ks=o(w);W=n(Ks,"A",{id:!0,class:!0,href:!0});var Te=o(W);me=n(Te,"SPAN",{});var ql=o(me);u(z.$$.fragment,ql),ql.forEach(e),Te.forEach(e),At=i(Ks),ee=n(Ks,"SPAN",{"data-svelte-h":!0}),h(ee)!=="svelte-1093n1t"&&(ee.textContent=sl),Ks.forEach(e),be=i(s),F=n(s,"P",{"data-svelte-h":!0}),h(F)!=="svelte-1vatch6"&&(F.innerHTML=el),Ue=i(s),Q=n(s,"UL",{"data-svelte-h":!0}),h(Q)!=="svelte-out62x"&&(Q.innerHTML=tl),$e=i(s),u(B.$$.fragment,s),Ze=i(s),T=n(s,"H2",{class:!0});var _t=o(T);H=n(_t,"A",{id:!0,class:!0,href:!0});var Ll=o(H);ue=n(Ll,"SPAN",{});var Pl=o(ue);u(D.$$.fragment,Pl),Pl.forEach(e),Ll.forEach(e),St=i(_t),te=n(_t,"SPAN",{"data-svelte-h":!0}),h(te)!=="svelte-jmyl22"&&(te.textContent=ll),_t.forEach(e),Ie=i(s),K=n(s,"P",{"data-svelte-h":!0}),h(K)!=="svelte-bbumtz"&&(K.innerHTML=al),ke=i(s),O=n(s,"OL",{"data-svelte-h":!0}),h(O)!=="svelte-nj7nls"&&(O.innerHTML=nl),Ce=i(s),u(ss.$$.fragment,s),Ge=i(s),N=n(s,"OL",{start:!0,"data-svelte-h":!0}),h(N)!=="svelte-11chogp"&&(N.innerHTML=pl),_e=i(s),u(es.$$.fragment,s),We=i(s),ts=n(s,"P",{"data-svelte-h":!0}),h(ts)!=="svelte-1rd37fa"&&(ts.innerHTML=il),Be=i(s),u(ls.$$.fragment,s),He=i(s),as=n(s,"P",{"data-svelte-h":!0}),h(as)!=="svelte-y7t7qo"&&(as.innerHTML=rl),Ne=i(s),ns=n(s,"P",{"data-svelte-h":!0}),h(ns)!=="svelte-zsvuyl"&&(ns.textContent=hl),Ee=i(s),u(ps.$$.fragment,s),Xe=i(s),is=n(s,"P",{"data-svelte-h":!0}),h(is)!=="svelte-1vp9ifi"&&(is.textContent=cl),Re=i(s),rs=n(s,"P",{"data-svelte-h":!0}),h(rs)!=="svelte-1xs3lm2"&&(rs.innerHTML=ol),Ve=i(s),hs=n(s,"P",{"data-svelte-h":!0}),h(hs)!=="svelte-15l4sro"&&(hs.innerHTML=ml),Ye=i(s),b=n(s,"H2",{class:!0});var Wt=o(b);E=n(Wt,"A",{id:!0,class:!0,href:!0});var zl=o(E);je=n(zl,"SPAN",{});var Fl=o(je);u(cs.$$.fragment,Fl),Fl.forEach(e),zl.forEach(e),qt=i(Wt),le=n(Wt,"SPAN",{"data-svelte-h":!0}),h(le)!=="svelte-kl1ld5"&&(le.textContent=ul),Wt.forEach(e),Ae=i(s),os=n(s,"P",{"data-svelte-h":!0}),h(os)!=="svelte-1244bc1"&&(os.innerHTML=jl),Se=i(s),u(ms.$$.fragment,s),qe=i(s),us=n(s,"P",{"data-svelte-h":!0}),h(us)!=="svelte-1jztyi7"&&(us.textContent=gl),Le=i(s),U=n(s,"H3",{class:!0});var Bt=o(U);X=n(Bt,"A",{id:!0,class:!0,href:!0});var Ql=o(X);ge=n(Ql,"SPAN",{});var Dl=o(ge);u(js.$$.fragment,Dl),Dl.forEach(e),Ql.forEach(e),Lt=i(Bt),ae=n(Bt,"SPAN",{"data-svelte-h":!0}),h(ae)!=="svelte-td91da"&&(ae.textContent=fl),Bt.forEach(e),Pe=i(s),gs=n(s,"P",{"data-svelte-h":!0}),h(gs)!=="svelte-br6mir"&&(gs.innerHTML=Ml),ze=i(s),u(fs.$$.fragment,s),Fe=i(s),Ms=n(s,"P",{"data-svelte-h":!0}),h(Ms)!=="svelte-tw46zj"&&(Ms.innerHTML=yl),Qe=i(s),u(ys.$$.fragment,s),De=i(s),$=n(s,"H3",{class:!0});var Ht=o($);R=n(Ht,"A",{id:!0,class:!0,href:!0});var Kl=o(R);fe=n(Kl,"SPAN",{});var Ol=o(fe);u(xs.$$.fragment,Ol),Ol.forEach(e),Kl.forEach(e),Pt=i(Ht),ne=n(Ht,"SPAN",{"data-svelte-h":!0}),h(ne)!=="svelte-1nbih0x"&&(ne.textContent=xl),Ht.forEach(e),Ke=i(s),ds=n(s,"P",{"data-svelte-h":!0}),h(ds)!=="svelte-huy7ji"&&(ds.innerHTML=dl),Oe=i(s),Js=n(s,"P",{"data-svelte-h":!0}),h(Js)!=="svelte-1n85mqc"&&(Js.textContent=Jl),st=i(s),u(vs.$$.fragment,s),et=i(s),ws=n(s,"P",{"data-svelte-h":!0}),h(ws)!=="svelte-un1mpj"&&(ws.textContent=vl),tt=i(s),Ts=n(s,"P",{"data-svelte-h":!0}),h(Ts)!=="svelte-kkwlue"&&(Ts.innerHTML=wl),lt=i(s),Z=n(s,"H3",{class:!0});var Nt=o(Z);V=n(Nt,"A",{id:!0,class:!0,href:!0});var sa=o(V);Me=n(sa,"SPAN",{});var ea=o(Me);u(bs.$$.fragment,ea),ea.forEach(e),sa.forEach(e),zt=i(Nt),pe=n(Nt,"SPAN",{"data-svelte-h":!0}),h(pe)!=="svelte-1oqq3aw"&&(pe.textContent=Tl),Nt.forEach(e),at=i(s),Us=n(s,"P",{"data-svelte-h":!0}),h(Us)!=="svelte-1dji2ce"&&(Us.innerHTML=bl),nt=i(s),u($s.$$.fragment,s),pt=i(s),Zs=n(s,"P",{"data-svelte-h":!0}),h(Zs)!=="svelte-ca1hoe"&&(Zs.textContent=Ul),it=i(s),Is=n(s,"P",{"data-svelte-h":!0}),h(Is)!=="svelte-5jhx5r"&&(Is.innerHTML=$l),rt=i(s),ks=n(s,"P",{"data-svelte-h":!0}),h(ks)!=="svelte-10oc2m6"&&(ks.innerHTML=Zl),ht=i(s),I=n(s,"H2",{class:!0});var Et=o(I);Y=n(Et,"A",{id:!0,class:!0,href:!0});var ta=o(Y);ye=n(ta,"SPAN",{});var la=o(ye);u(Cs.$$.fragment,la),la.forEach(e),ta.forEach(e),Ft=i(Et),ie=n(Et,"SPAN",{"data-svelte-h":!0}),h(ie)!=="svelte-ja2a2"&&(ie.textContent=Il),Et.forEach(e),ct=i(s),Gs=n(s,"P",{"data-svelte-h":!0}),h(Gs)!=="svelte-1yx6z1v"&&(Gs.textContent=kl),ot=i(s),u(_s.$$.fragment,s),mt=i(s),Ws=n(s,"P",{"data-svelte-h":!0}),h(Ws)!=="svelte-1mcnqfe"&&(Ws.innerHTML=Cl),ut=i(s),Bs=n(s,"P",{"data-svelte-h":!0}),h(Bs)!=="svelte-3vkfgr"&&(Bs.innerHTML=Gl),jt=i(s),Hs=n(s,"P",{"data-svelte-h":!0}),h(Hs)!=="svelte-1mid7p9"&&(Hs.innerHTML=_l),gt=i(s),u(Ns.$$.fragment,s),ft=i(s),k=n(s,"H2",{class:!0});var Xt=o(k);A=n(Xt,"A",{id:!0,class:!0,href:!0});var aa=o(A);xe=n(aa,"SPAN",{});var na=o(xe);u(Es.$$.fragment,na),na.forEach(e),aa.forEach(e),Qt=i(Xt),re=n(Xt,"SPAN",{"data-svelte-h":!0}),h(re)!=="svelte-1wmcsht"&&(re.textContent=Wl),Xt.forEach(e),Mt=i(s),u(S.$$.fragment,s),yt=i(s),Xs=n(s,"P",{"data-svelte-h":!0}),h(Xs)!=="svelte-52dmam"&&(Xs.innerHTML=Bl),xt=i(s),C=n(s,"H2",{class:!0});var Rt=o(C);q=n(Rt,"A",{id:!0,class:!0,href:!0});var pa=o(q);de=n(pa,"SPAN",{});var ia=o(de);u(Rs.$$.fragment,ia),ia.forEach(e),pa.forEach(e),Dt=i(Rt),he=n(Rt,"SPAN",{"data-svelte-h":!0}),h(he)!=="svelte-txahw9"&&(he.textContent=Hl),Rt.forEach(e),dt=i(s),Vs=n(s,"P",{"data-svelte-h":!0}),h(Vs)!=="svelte-1da9k29"&&(Vs.innerHTML=Nl),Jt=i(s),Ys=n(s,"P",{"data-svelte-h":!0}),h(Ys)!=="svelte-k4rfwb"&&(Ys.textContent=El),vt=i(s),As=n(s,"P",{"data-svelte-h":!0}),h(As)!=="svelte-1bks2jw"&&(As.innerHTML=Xl),wt=i(s),u(Ss.$$.fragment,s),Tt=i(s),G=n(s,"H3",{class:!0});var Vt=o(G);L=n(Vt,"A",{id:!0,class:!0,href:!0});var ra=o(L);Je=n(ra,"SPAN",{});var ha=o(Je);u(qs.$$.fragment,ha),ha.forEach(e),ra.forEach(e),Kt=i(Vt),ce=n(Vt,"SPAN",{"data-svelte-h":!0}),h(ce)!=="svelte-phco8g"&&(ce.textContent=Rl),Vt.forEach(e),bt=i(s),Ls=n(s,"P",{"data-svelte-h":!0}),h(Ls)!=="svelte-1959qy1"&&(Ls.innerHTML=Vl),Ut=i(s),u(Ps.$$.fragment,s),$t=i(s),_=n(s,"H3",{class:!0});var Yt=o(_);P=n(Yt,"A",{id:!0,class:!0,href:!0});var ca=o(P);ve=n(ca,"SPAN",{});var oa=o(ve);u(zs.$$.fragment,oa),oa.forEach(e),ca.forEach(e),Ot=i(Yt),oe=n(Yt,"SPAN",{"data-svelte-h":!0}),h(oe)!=="svelte-qyir59"&&(oe.textContent=Yl),Yt.forEach(e),Zt=i(s),Fs=n(s,"P",{"data-svelte-h":!0}),h(Fs)!=="svelte-59rxv8"&&(Fs.innerHTML=Al),It=i(s),Qs=n(s,"P",{"data-svelte-h":!0}),h(Qs)!=="svelte-1pyosm6"&&(Qs.innerHTML=Sl),kt=i(s),u(Ds.$$.fragment,s),Ct=i(s),we=n(s,"P",{}),o(we).forEach(e),this.h()},h(){r(y,"name","hf:doc:metadata"),r(y,"content",JSON.stringify(Ta)),r(W,"id","pipelines-for-inference"),r(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"),r(W,"href","#pipelines-for-inference"),r(w,"class","relative group"),r(H,"id","pipeline-usage"),r(H,"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"),r(H,"href","#pipeline-usage"),r(T,"class","relative group"),r(N,"start","2"),r(E,"id","parameters"),r(E,"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"),r(E,"href","#parameters"),r(b,"class","relative group"),r(X,"id","device"),r(X,"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"),r(X,"href","#device"),r(U,"class","relative group"),r(R,"id","batch-size"),r(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"),r(R,"href","#batch-size"),r($,"class","relative group"),r(V,"id","task-specific-parameters"),r(V,"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"),r(V,"href","#task-specific-parameters"),r(Z,"class","relative group"),r(Y,"id","using-pipelines-on-a-dataset"),r(Y,"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"),r(Y,"href","#using-pipelines-on-a-dataset"),r(I,"class","relative group"),r(A,"id","using-pipelines-for-a-webserver"),r(A,"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"),r(A,"href","#using-pipelines-for-a-webserver"),r(k,"class","relative group"),r(q,"id","vision-pipeline"),r(q,"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"),r(q,"href","#vision-pipeline"),r(C,"class","relative group"),r(L,"id","text-pipeline"),r(L,"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"),r(L,"href","#text-pipeline"),r(G,"class","relative group"),r(P,"id","multimodal-pipeline"),r(P,"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"),r(P,"href","#multimodal-pipeline"),r(_,"class","relative group")},m(s,t){c(document.head,y),l(s,d,t),l(s,J,t),l(s,se,t),l(s,w,t),c(w,W),c(W,me),j(z,me,null),c(w,At),c(w,ee),l(s,be,t),l(s,F,t),l(s,Ue,t),l(s,Q,t),l(s,$e,t),j(B,s,t),l(s,Ze,t),l(s,T,t),c(T,H),c(H,ue),j(D,ue,null),c(T,St),c(T,te),l(s,Ie,t),l(s,K,t),l(s,ke,t),l(s,O,t),l(s,Ce,t),j(ss,s,t),l(s,Ge,t),l(s,N,t),l(s,_e,t),j(es,s,t),l(s,We,t),l(s,ts,t),l(s,Be,t),j(ls,s,t),l(s,He,t),l(s,as,t),l(s,Ne,t),l(s,ns,t),l(s,Ee,t),j(ps,s,t),l(s,Xe,t),l(s,is,t),l(s,Re,t),l(s,rs,t),l(s,Ve,t),l(s,hs,t),l(s,Ye,t),l(s,b,t),c(b,E),c(E,je),j(cs,je,null),c(b,qt),c(b,le),l(s,Ae,t),l(s,os,t),l(s,Se,t),j(ms,s,t),l(s,qe,t),l(s,us,t),l(s,Le,t),l(s,U,t),c(U,X),c(X,ge),j(js,ge,null),c(U,Lt),c(U,ae),l(s,Pe,t),l(s,gs,t),l(s,ze,t),j(fs,s,t),l(s,Fe,t),l(s,Ms,t),l(s,Qe,t),j(ys,s,t),l(s,De,t),l(s,$,t),c($,R),c(R,fe),j(xs,fe,null),c($,Pt),c($,ne),l(s,Ke,t),l(s,ds,t),l(s,Oe,t),l(s,Js,t),l(s,st,t),j(vs,s,t),l(s,et,t),l(s,ws,t),l(s,tt,t),l(s,Ts,t),l(s,lt,t),l(s,Z,t),c(Z,V),c(V,Me),j(bs,Me,null),c(Z,zt),c(Z,pe),l(s,at,t),l(s,Us,t),l(s,nt,t),j($s,s,t),l(s,pt,t),l(s,Zs,t),l(s,it,t),l(s,Is,t),l(s,rt,t),l(s,ks,t),l(s,ht,t),l(s,I,t),c(I,Y),c(Y,ye),j(Cs,ye,null),c(I,Ft),c(I,ie),l(s,ct,t),l(s,Gs,t),l(s,ot,t),j(_s,s,t),l(s,mt,t),l(s,Ws,t),l(s,ut,t),l(s,Bs,t),l(s,jt,t),l(s,Hs,t),l(s,gt,t),j(Ns,s,t),l(s,ft,t),l(s,k,t),c(k,A),c(A,xe),j(Es,xe,null),c(k,Qt),c(k,re),l(s,Mt,t),j(S,s,t),l(s,yt,t),l(s,Xs,t),l(s,xt,t),l(s,C,t),c(C,q),c(q,de),j(Rs,de,null),c(C,Dt),c(C,he),l(s,dt,t),l(s,Vs,t),l(s,Jt,t),l(s,Ys,t),l(s,vt,t),l(s,As,t),l(s,wt,t),j(Ss,s,t),l(s,Tt,t),l(s,G,t),c(G,L),c(L,Je),j(qs,Je,null),c(G,Kt),c(G,ce),l(s,bt,t),l(s,Ls,t),l(s,Ut,t),j(Ps,s,t),l(s,$t,t),l(s,_,t),c(_,P),c(P,ve),j(zs,ve,null),c(_,Ot),c(_,oe),l(s,Zt,t),l(s,Fs,t),l(s,It,t),l(s,Qs,t),l(s,kt,t),j(Ds,s,t),l(s,Ct,t),l(s,we,t),Gt=!0},p(s,[t]){const Ks={};t&2&&(Ks.$$scope={dirty:t,ctx:s}),B.$set(Ks);const Te={};t&2&&(Te.$$scope={dirty:t,ctx:s}),S.$set(Te)},i(s){Gt||(g(z.$$.fragment,s),g(B.$$.fragment,s),g(D.$$.fragment,s),g(ss.$$.fragment,s),g(es.$$.fragment,s),g(ls.$$.fragment,s),g(ps.$$.fragment,s),g(cs.$$.fragment,s),g(ms.$$.fragment,s),g(js.$$.fragment,s),g(fs.$$.fragment,s),g(ys.$$.fragment,s),g(xs.$$.fragment,s),g(vs.$$.fragment,s),g(bs.$$.fragment,s),g($s.$$.fragment,s),g(Cs.$$.fragment,s),g(_s.$$.fragment,s),g(Ns.$$.fragment,s),g(Es.$$.fragment,s),g(S.$$.fragment,s),g(Rs.$$.fragment,s),g(Ss.$$.fragment,s),g(qs.$$.fragment,s),g(Ps.$$.fragment,s),g(zs.$$.fragment,s),g(Ds.$$.fragment,s),Gt=!0)},o(s){f(z.$$.fragment,s),f(B.$$.fragment,s),f(D.$$.fragment,s),f(ss.$$.fragment,s),f(es.$$.fragment,s),f(ls.$$.fragment,s),f(ps.$$.fragment,s),f(cs.$$.fragment,s),f(ms.$$.fragment,s),f(js.$$.fragment,s),f(fs.$$.fragment,s),f(ys.$$.fragment,s),f(xs.$$.fragment,s),f(vs.$$.fragment,s),f(bs.$$.fragment,s),f($s.$$.fragment,s),f(Cs.$$.fragment,s),f(_s.$$.fragment,s),f(Ns.$$.fragment,s),f(Es.$$.fragment,s),f(S.$$.fragment,s),f(Rs.$$.fragment,s),f(Ss.$$.fragment,s),f(qs.$$.fragment,s),f(Ps.$$.fragment,s),f(zs.$$.fragment,s),f(Ds.$$.fragment,s),Gt=!1},d(s){s&&(e(d),e(J),e(se),e(w),e(be),e(F),e(Ue),e(Q),e($e),e(Ze),e(T),e(Ie),e(K),e(ke),e(O),e(Ce),e(Ge),e(N),e(_e),e(We),e(ts),e(Be),e(He),e(as),e(Ne),e(ns),e(Ee),e(Xe),e(is),e(Re),e(rs),e(Ve),e(hs),e(Ye),e(b),e(Ae),e(os),e(Se),e(qe),e(us),e(Le),e(U),e(Pe),e(gs),e(ze),e(Fe),e(Ms),e(Qe),e(De),e($),e(Ke),e(ds),e(Oe),e(Js),e(st),e(et),e(ws),e(tt),e(Ts),e(lt),e(Z),e(at),e(Us),e(nt),e(pt),e(Zs),e(it),e(Is),e(rt),e(ks),e(ht),e(I),e(ct),e(Gs),e(ot),e(mt),e(Ws),e(ut),e(Bs),e(jt),e(Hs),e(gt),e(ft),e(k),e(Mt),e(yt),e(Xs),e(xt),e(C),e(dt),e(Vs),e(Jt),e(Ys),e(vt),e(As),e(wt),e(Tt),e(G),e(bt),e(Ls),e(Ut),e($t),e(_),e(Zt),e(Fs),e(It),e(Qs),e(kt),e(Ct),e(we)),e(y),M(z),M(B,s),M(D),M(ss,s),M(es,s),M(ls,s),M(ps,s),M(cs),M(ms,s),M(js),M(fs,s),M(ys,s),M(xs),M(vs,s),M(bs),M($s,s),M(Cs),M(_s,s),M(Ns,s),M(Es),M(S,s),M(Rs),M(Ss,s),M(qs),M(Ps,s),M(zs),M(Ds,s)}}}const Ta={local:"pipelines-for-inference",sections:[{local:"pipeline-usage",title:"Pipeline 사용하기"},{local:"parameters",sections:[{local:"device",title:"기기(device)"},{local:"batch-size",title:"배치 사이즈"},{local:"task-specific-parameters",title:"특정 태스크용 매개변수"}],title:"매개변수"},{local:"using-pipelines-on-a-dataset",title:"데이터세트에서 Pipeline 사용하기"},{local:"using-pipelines-for-a-webserver",title:"웹서버에서 Pipeline 사용하기"},{local:"vision-pipeline",sections:[{local:"text-pipeline",title:"텍스트 Pipeline"},{local:"multimodal-pipeline",title:"멀티모달 Pipeline"}],title:"비전 Pipeline"}],title:"추론을 위한 Pipeline"};function ba(Os){return ja(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ca extends fa{constructor(y){super(),Ma(this,y,ba,wa,ua,{})}}export{Ca as component};
