import{S as _I,i as bI,s as vI,e as n,k as p,w as _,t as o,M as wI,c as a,d as s,m as c,a as r,x as b,h as i,b as d,G as e,g as h,y as v,q as w,o as x,B as k,v as xI,L as C}from"../../chunks/vendor-hf-doc-builder.js";import{T as gI}from"../../chunks/Tip-hf-doc-builder.js";import{D as $}from"../../chunks/Docstring-hf-doc-builder.js";import{C as E}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as q}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as D}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function kI(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline, AutoModelForTokenClassification, AutoTokenizer

# Sentiment analysis pipeline
analyzer = pipeline("sentiment-analysis")

# Question answering pipeline, specifying the checkpoint identifier
oracle = pipeline(
    "question-answering", model="distilbert-base-cased-distilled-squad", tokenizer="bert-base-cased"
)

# Named entity recognition pipeline, passing in a specific model and tokenizer
model = AutoModelForTokenClassification.from_pretrained("dbmdz/bert-large-cased-finetuned-conll03-english")
tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")
recognizer = pipeline("ner", model=model, tokenizer=tokenizer)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline, AutoModelForTokenClassification, AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Sentiment analysis pipeline</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>analyzer = pipeline(<span class="hljs-string">&quot;sentiment-analysis&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Question answering pipeline, specifying the checkpoint identifier</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>oracle = pipeline(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;question-answering&quot;</span>, model=<span class="hljs-string">&quot;distilbert-base-cased-distilled-squad&quot;</span>, tokenizer=<span class="hljs-string">&quot;bert-base-cased&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Named entity recognition pipeline, passing in a specific model and tokenizer</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForTokenClassification.from_pretrained(<span class="hljs-string">&quot;dbmdz/bert-large-cased-finetuned-conll03-english&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>recognizer = pipeline(<span class="hljs-string">&quot;ner&quot;</span>, model=model, tokenizer=tokenizer)`}}),{c(){u=n("p"),T=o("Examples:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Examples:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function yI(j){let u,T,y,f,P;return{c(){u=n("p"),T=o(`However, this is not automatically a win for performance. It can be either a 10x speedup or 5x slowdown depending
on hardware, data and the actual model being used.`),y=p(),f=n("p"),P=o("Example where it\u2019s mostly a speedup:")},l(l){u=a(l,"P",{});var g=r(u);T=i(g,`However, this is not automatically a win for performance. It can be either a 10x speedup or 5x slowdown depending
on hardware, data and the actual model being used.`),g.forEach(s),y=c(l),f=a(l,"P",{});var He=r(f);P=i(He,"Example where it\u2019s mostly a speedup:"),He.forEach(s)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),h(l,f,g),e(f,P)},d(l){l&&s(u),l&&s(y),l&&s(f)}}}function PI(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline

classifier = pipeline(model="superb/wav2vec2-base-superb-ks")
classifier("https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/1.flac")`,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>classifier = pipeline(model=<span class="hljs-string">&quot;superb/wav2vec2-base-superb-ks&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>classifier(<span class="hljs-string">&quot;https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/1.flac&quot;</span>)
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.997</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;_unknown_&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.002</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;left&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.0</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;yes&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.0</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;down&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.0</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;stop&#x27;</span>}]`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function TI(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline

transcriber = pipeline(model="openai/whisper-base")
transcriber("https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/1.flac")`,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>transcriber = pipeline(model=<span class="hljs-string">&quot;openai/whisper-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>transcriber(<span class="hljs-string">&quot;https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/1.flac&quot;</span>)
{<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27; He hoped there would be stew for dinner, turnips and carrots and bruised potatoes and fat mutton pieces to be ladled out in thick, peppered flour-fatten sauce.&#x27;</span>}`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function $I(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline

depth_estimator = pipeline(task="depth-estimation", model="Intel/dpt-large")
output = depth_estimator("http://images.cocodataset.org/val2017/000000039769.jpg")
# This is a tensor with the values being the depth expressed in meters for each pixel
output["predicted_depth"].shape`,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>depth_estimator = pipeline(task=<span class="hljs-string">&quot;depth-estimation&quot;</span>, model=<span class="hljs-string">&quot;Intel/dpt-large&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>output = depth_estimator(<span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># This is a tensor with the values being the depth expressed in meters for each pixel</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>output[<span class="hljs-string">&quot;predicted_depth&quot;</span>].shape
torch.Size([<span class="hljs-number">1</span>, <span class="hljs-number">384</span>, <span class="hljs-number">384</span>])`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function jI(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline

classifier = pipeline(model="microsoft/beit-base-patch16-224-pt22k-ft22k")
classifier("https://huggingface.co/datasets/Narsil/image_dummy/raw/main/parrots.png")`,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>classifier = pipeline(model=<span class="hljs-string">&quot;microsoft/beit-base-patch16-224-pt22k-ft22k&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>classifier(<span class="hljs-string">&quot;https://huggingface.co/datasets/Narsil/image_dummy/raw/main/parrots.png&quot;</span>)
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.442</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;macaw&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.088</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;popinjay&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.075</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;parrot&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.073</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;parodist, lampooner&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.046</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;poll, poll_parrot&#x27;</span>}]`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function EI(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline

segmenter = pipeline(model="facebook/detr-resnet-50-panoptic")
segments = segmenter("https://huggingface.co/datasets/Narsil/image_dummy/raw/main/parrots.png")
len(segments)

segments[0]["label"]

segments[1]["label"]

type(segments[0]["mask"])  # This is a black and white mask showing where is the bird on the original image.

segments[0]["mask"].size`,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>segmenter = pipeline(model=<span class="hljs-string">&quot;facebook/detr-resnet-50-panoptic&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>segments = segmenter(<span class="hljs-string">&quot;https://huggingface.co/datasets/Narsil/image_dummy/raw/main/parrots.png&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">len</span>(segments)
<span class="hljs-number">2</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>segments[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;label&quot;</span>]
<span class="hljs-string">&#x27;bird&#x27;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>segments[<span class="hljs-number">1</span>][<span class="hljs-string">&quot;label&quot;</span>]
<span class="hljs-string">&#x27;bird&#x27;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">type</span>(segments[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;mask&quot;</span>])  <span class="hljs-comment"># This is a black and white mask showing where is the bird on the original image.</span>
&lt;<span class="hljs-keyword">class</span> <span class="hljs-string">&#x27;PIL.Image.Image&#x27;</span>&gt;

<span class="hljs-meta">&gt;&gt;&gt; </span>segments[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;mask&quot;</span>].size
(<span class="hljs-number">768</span>, <span class="hljs-number">512</span>)`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function qI(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline

detector = pipeline(model="facebook/detr-resnet-50")
detector("https://huggingface.co/datasets/Narsil/image_dummy/raw/main/parrots.png")

# x, y  are expressed relative to the top left hand corner.`,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>detector = pipeline(model=<span class="hljs-string">&quot;facebook/detr-resnet-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>detector(<span class="hljs-string">&quot;https://huggingface.co/datasets/Narsil/image_dummy/raw/main/parrots.png&quot;</span>)
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.997</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;bird&#x27;</span>, <span class="hljs-string">&#x27;box&#x27;</span>: {<span class="hljs-string">&#x27;xmin&#x27;</span>: <span class="hljs-number">69</span>, <span class="hljs-string">&#x27;ymin&#x27;</span>: <span class="hljs-number">171</span>, <span class="hljs-string">&#x27;xmax&#x27;</span>: <span class="hljs-number">396</span>, <span class="hljs-string">&#x27;ymax&#x27;</span>: <span class="hljs-number">507</span>}}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.999</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;bird&#x27;</span>, <span class="hljs-string">&#x27;box&#x27;</span>: {<span class="hljs-string">&#x27;xmin&#x27;</span>: <span class="hljs-number">398</span>, <span class="hljs-string">&#x27;ymin&#x27;</span>: <span class="hljs-number">105</span>, <span class="hljs-string">&#x27;xmax&#x27;</span>: <span class="hljs-number">767</span>, <span class="hljs-string">&#x27;ymax&#x27;</span>: <span class="hljs-number">507</span>}}]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># x, y  are expressed relative to the top left hand corner.</span>`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function AI(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline

classifier = pipeline(model="openai/clip-vit-large-patch14")
classifier(
    "https://huggingface.co/datasets/Narsil/image_dummy/raw/main/parrots.png",
    candidate_labels=["animals", "humans", "landscape"],
)

classifier(
    "https://huggingface.co/datasets/Narsil/image_dummy/raw/main/parrots.png",
    candidate_labels=["black and white", "photorealist", "painting"],
)`,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>classifier = pipeline(model=<span class="hljs-string">&quot;openai/clip-vit-large-patch14&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>classifier(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/Narsil/image_dummy/raw/main/parrots.png&quot;</span>,
<span class="hljs-meta">... </span>    candidate_labels=[<span class="hljs-string">&quot;animals&quot;</span>, <span class="hljs-string">&quot;humans&quot;</span>, <span class="hljs-string">&quot;landscape&quot;</span>],
<span class="hljs-meta">... </span>)
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.965</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;animals&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.03</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;humans&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.005</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;landscape&#x27;</span>}]

<span class="hljs-meta">&gt;&gt;&gt; </span>classifier(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/Narsil/image_dummy/raw/main/parrots.png&quot;</span>,
<span class="hljs-meta">... </span>    candidate_labels=[<span class="hljs-string">&quot;black and white&quot;</span>, <span class="hljs-string">&quot;photorealist&quot;</span>, <span class="hljs-string">&quot;painting&quot;</span>],
<span class="hljs-meta">... </span>)
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.996</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;black and white&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.003</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;photorealist&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.0</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;painting&#x27;</span>}]`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function DI(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline

detector = pipeline(model="google/owlvit-base-patch32", task="zero-shot-object-detection")
detector(
    "http://images.cocodataset.org/val2017/000000039769.jpg",
    candidate_labels=["cat", "couch"],
)

detector(
    "https://huggingface.co/datasets/Narsil/image_dummy/raw/main/parrots.png",
    candidate_labels=["head", "bird"],
)`,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>detector = pipeline(model=<span class="hljs-string">&quot;google/owlvit-base-patch32&quot;</span>, task=<span class="hljs-string">&quot;zero-shot-object-detection&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>detector(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>,
<span class="hljs-meta">... </span>    candidate_labels=[<span class="hljs-string">&quot;cat&quot;</span>, <span class="hljs-string">&quot;couch&quot;</span>],
<span class="hljs-meta">... </span>)
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.287</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;cat&#x27;</span>, <span class="hljs-string">&#x27;box&#x27;</span>: {<span class="hljs-string">&#x27;xmin&#x27;</span>: <span class="hljs-number">324</span>, <span class="hljs-string">&#x27;ymin&#x27;</span>: <span class="hljs-number">20</span>, <span class="hljs-string">&#x27;xmax&#x27;</span>: <span class="hljs-number">640</span>, <span class="hljs-string">&#x27;ymax&#x27;</span>: <span class="hljs-number">373</span>}}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.254</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;cat&#x27;</span>, <span class="hljs-string">&#x27;box&#x27;</span>: {<span class="hljs-string">&#x27;xmin&#x27;</span>: <span class="hljs-number">1</span>, <span class="hljs-string">&#x27;ymin&#x27;</span>: <span class="hljs-number">55</span>, <span class="hljs-string">&#x27;xmax&#x27;</span>: <span class="hljs-number">315</span>, <span class="hljs-string">&#x27;ymax&#x27;</span>: <span class="hljs-number">472</span>}}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.121</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;couch&#x27;</span>, <span class="hljs-string">&#x27;box&#x27;</span>: {<span class="hljs-string">&#x27;xmin&#x27;</span>: <span class="hljs-number">4</span>, <span class="hljs-string">&#x27;ymin&#x27;</span>: <span class="hljs-number">0</span>, <span class="hljs-string">&#x27;xmax&#x27;</span>: <span class="hljs-number">642</span>, <span class="hljs-string">&#x27;ymax&#x27;</span>: <span class="hljs-number">476</span>}}]

<span class="hljs-meta">&gt;&gt;&gt; </span>detector(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/Narsil/image_dummy/raw/main/parrots.png&quot;</span>,
<span class="hljs-meta">... </span>    candidate_labels=[<span class="hljs-string">&quot;head&quot;</span>, <span class="hljs-string">&quot;bird&quot;</span>],
<span class="hljs-meta">... </span>)
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.119</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;bird&#x27;</span>, <span class="hljs-string">&#x27;box&#x27;</span>: {<span class="hljs-string">&#x27;xmin&#x27;</span>: <span class="hljs-number">71</span>, <span class="hljs-string">&#x27;ymin&#x27;</span>: <span class="hljs-number">170</span>, <span class="hljs-string">&#x27;xmax&#x27;</span>: <span class="hljs-number">410</span>, <span class="hljs-string">&#x27;ymax&#x27;</span>: <span class="hljs-number">508</span>}}]`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function CI(j){let u,T,y,f,P;return f=new E({props:{code:`conversation = Conversation("Going to the movies tonight - any suggestions?")

# Steps usually performed by the model when generating a response:
# 1. Mark the user input as processed (moved to the history)
conversation.mark_processed()
# 2. Append a mode response
conversation.append_response("The Big lebowski.")

conversation.add_user_input("Is it good?")`,highlighted:`conversation = Conversation(<span class="hljs-string">&quot;Going to the movies tonight - any suggestions?&quot;</span>)

<span class="hljs-comment"># Steps usually performed by the model when generating a response:</span>
<span class="hljs-comment"># 1. Mark the user input as processed (moved to the history)</span>
conversation.mark_processed()
<span class="hljs-comment"># 2. Append a mode response</span>
conversation.append_response(<span class="hljs-string">&quot;The Big lebowski.&quot;</span>)

conversation.add_user_input(<span class="hljs-string">&quot;Is it good?&quot;</span>)`}}),{c(){u=n("p"),T=o("Usage:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Usage:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function zI(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline, Conversation

chatbot = pipeline(model="microsoft/DialoGPT-medium")
conversation = Conversation("Going to the movies tonight - any suggestions?")
conversation = chatbot(conversation)
conversation.generated_responses[-1]

conversation.add_user_input("Is it an action movie?")
conversation = chatbot(conversation)
conversation.generated_responses[-1]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline, Conversation

<span class="hljs-meta">&gt;&gt;&gt; </span>chatbot = pipeline(model=<span class="hljs-string">&quot;microsoft/DialoGPT-medium&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>conversation = Conversation(<span class="hljs-string">&quot;Going to the movies tonight - any suggestions?&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>conversation = chatbot(conversation)
<span class="hljs-meta">&gt;&gt;&gt; </span>conversation.generated_responses[-<span class="hljs-number">1</span>]
<span class="hljs-string">&#x27;The Big Lebowski&#x27;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>conversation.add_user_input(<span class="hljs-string">&quot;Is it an action movie?&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>conversation = chatbot(conversation)
<span class="hljs-meta">&gt;&gt;&gt; </span>conversation.generated_responses[-<span class="hljs-number">1</span>]
<span class="hljs-string">&quot;It&#x27;s a comedy.&quot;</span>`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function II(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline

fill_masker = pipeline(model="bert-base-uncased")
fill_masker("This is a simple [MASK].")`,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>fill_masker = pipeline(model=<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>fill_masker(<span class="hljs-string">&quot;This is a simple [MASK].&quot;</span>)
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.042</span>, <span class="hljs-string">&#x27;token&#x27;</span>: <span class="hljs-number">3291</span>, <span class="hljs-string">&#x27;token_str&#x27;</span>: <span class="hljs-string">&#x27;problem&#x27;</span>, <span class="hljs-string">&#x27;sequence&#x27;</span>: <span class="hljs-string">&#x27;this is a simple problem.&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.031</span>, <span class="hljs-string">&#x27;token&#x27;</span>: <span class="hljs-number">3160</span>, <span class="hljs-string">&#x27;token_str&#x27;</span>: <span class="hljs-string">&#x27;question&#x27;</span>, <span class="hljs-string">&#x27;sequence&#x27;</span>: <span class="hljs-string">&#x27;this is a simple question.&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.03</span>, <span class="hljs-string">&#x27;token&#x27;</span>: <span class="hljs-number">8522</span>, <span class="hljs-string">&#x27;token_str&#x27;</span>: <span class="hljs-string">&#x27;equation&#x27;</span>, <span class="hljs-string">&#x27;sequence&#x27;</span>: <span class="hljs-string">&#x27;this is a simple equation.&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.027</span>, <span class="hljs-string">&#x27;token&#x27;</span>: <span class="hljs-number">2028</span>, <span class="hljs-string">&#x27;token_str&#x27;</span>: <span class="hljs-string">&#x27;one&#x27;</span>, <span class="hljs-string">&#x27;sequence&#x27;</span>: <span class="hljs-string">&#x27;this is a simple one.&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.024</span>, <span class="hljs-string">&#x27;token&#x27;</span>: <span class="hljs-number">3627</span>, <span class="hljs-string">&#x27;token_str&#x27;</span>: <span class="hljs-string">&#x27;rule&#x27;</span>, <span class="hljs-string">&#x27;sequence&#x27;</span>: <span class="hljs-string">&#x27;this is a simple rule.&#x27;</span>}]`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function SI(j){let u,T,y,f,P;return{c(){u=n("p"),T=o(`This pipeline only works for inputs with exactly one token masked. Experimental: We added support for multiple
masks. The returned values are raw model output, and correspond to disjoint probabilities where one might expect
joint probabilities (See `),y=n("a"),f=o("discussion"),P=o(")."),this.h()},l(l){u=a(l,"P",{});var g=r(u);T=i(g,`This pipeline only works for inputs with exactly one token masked. Experimental: We added support for multiple
masks. The returned values are raw model output, and correspond to disjoint probabilities where one might expect
joint probabilities (See `),y=a(g,"A",{href:!0,rel:!0});var He=r(y);f=i(He,"discussion"),He.forEach(s),P=i(g,")."),g.forEach(s),this.h()},h(){d(y,"href","https://github.com/huggingface/transformers/pull/10222"),d(y,"rel","nofollow")},m(l,g){h(l,u,g),e(u,T),e(u,y),e(y,f),e(u,P)},d(l){l&&s(u)}}}function MI(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline

token_classifier = pipeline(model="Jean-Baptiste/camembert-ner", aggregation_strategy="simple")
sentence = "Je m'appelle jean-baptiste et je vis \xE0 montr\xE9al"
tokens = token_classifier(sentence)
tokens

token = tokens[0]
# Start and end provide an easy way to highlight words in the original text.
sentence[token["start"] : token["end"]]

# Some models use the same idea to do part of speech.
syntaxer = pipeline(model="vblagoje/bert-english-uncased-finetuned-pos", aggregation_strategy="simple")
syntaxer("My name is Sarah and I live in London")`,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>token_classifier = pipeline(model=<span class="hljs-string">&quot;Jean-Baptiste/camembert-ner&quot;</span>, aggregation_strategy=<span class="hljs-string">&quot;simple&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>sentence = <span class="hljs-string">&quot;Je m&#x27;appelle jean-baptiste et je vis \xE0 montr\xE9al&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokens = token_classifier(sentence)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokens
[{<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;PER&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9931</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;jean-baptiste&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">12</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">26</span>}, {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;LOC&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.998</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;montr\xE9al&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">38</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">47</span>}]

<span class="hljs-meta">&gt;&gt;&gt; </span>token = tokens[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Start and end provide an easy way to highlight words in the original text.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>sentence[token[<span class="hljs-string">&quot;start&quot;</span>] : token[<span class="hljs-string">&quot;end&quot;</span>]]
<span class="hljs-string">&#x27; jean-baptiste&#x27;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Some models use the same idea to do part of speech.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>syntaxer = pipeline(model=<span class="hljs-string">&quot;vblagoje/bert-english-uncased-finetuned-pos&quot;</span>, aggregation_strategy=<span class="hljs-string">&quot;simple&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>syntaxer(<span class="hljs-string">&quot;My name is Sarah and I live in London&quot;</span>)
[{<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;PRON&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.999</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;my&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">0</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">2</span>}, {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;NOUN&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.997</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;name&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">3</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">7</span>}, {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;AUX&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.994</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;is&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">8</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">10</span>}, {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;PROPN&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.999</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;sarah&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">11</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">16</span>}, {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;CCONJ&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.999</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;and&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">17</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">20</span>}, {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;PRON&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.999</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;i&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">21</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">22</span>}, {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;VERB&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.998</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;live&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">23</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">27</span>}, {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;ADP&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.999</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;in&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">28</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">30</span>}, {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;PROPN&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.999</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;london&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">31</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">37</span>}]`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function FI(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline

oracle = pipeline(model="deepset/roberta-base-squad2")
oracle(question="Where do I live?", context="My name is Wolfgang and I live in Berlin")`,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>oracle = pipeline(model=<span class="hljs-string">&quot;deepset/roberta-base-squad2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>oracle(question=<span class="hljs-string">&quot;Where do I live?&quot;</span>, context=<span class="hljs-string">&quot;My name is Wolfgang and I live in Berlin&quot;</span>)
{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9191</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">34</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">40</span>, <span class="hljs-string">&#x27;answer&#x27;</span>: <span class="hljs-string">&#x27;Berlin&#x27;</span>}`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function LI(j){let u,T,y,f,P;return f=new E({props:{code:`# use bart in pytorch
summarizer = pipeline("summarization")
summarizer("An apple a day, keeps the doctor away", min_length=5, max_length=20)

# use t5 in tf
summarizer = pipeline("summarization", model="t5-base", tokenizer="t5-base", framework="tf")
summarizer("An apple a day, keeps the doctor away", min_length=5, max_length=20)`,highlighted:`<span class="hljs-comment"># use bart in pytorch</span>
summarizer = pipeline(<span class="hljs-string">&quot;summarization&quot;</span>)
summarizer(<span class="hljs-string">&quot;An apple a day, keeps the doctor away&quot;</span>, min_length=<span class="hljs-number">5</span>, max_length=<span class="hljs-number">20</span>)

<span class="hljs-comment"># use t5 in tf</span>
summarizer = pipeline(<span class="hljs-string">&quot;summarization&quot;</span>, model=<span class="hljs-string">&quot;t5-base&quot;</span>, tokenizer=<span class="hljs-string">&quot;t5-base&quot;</span>, framework=<span class="hljs-string">&quot;tf&quot;</span>)
summarizer(<span class="hljs-string">&quot;An apple a day, keeps the doctor away&quot;</span>, min_length=<span class="hljs-number">5</span>, max_length=<span class="hljs-number">20</span>)`}}),{c(){u=n("p"),T=o("Usage:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Usage:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function OI(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline

oracle = pipeline(model="google/tapas-base-finetuned-wtq")
table = {
    "Repository": ["Transformers", "Datasets", "Tokenizers"],
    "Stars": ["36542", "4512", "3934"],
    "Contributors": ["651", "77", "34"],
    "Programming language": ["Python", "Python", "Rust, Python and NodeJS"],
}
oracle(query="How many stars does the transformers repository have?", table=table)`,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>oracle = pipeline(model=<span class="hljs-string">&quot;google/tapas-base-finetuned-wtq&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>table = {
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Repository&quot;</span>: [<span class="hljs-string">&quot;Transformers&quot;</span>, <span class="hljs-string">&quot;Datasets&quot;</span>, <span class="hljs-string">&quot;Tokenizers&quot;</span>],
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Stars&quot;</span>: [<span class="hljs-string">&quot;36542&quot;</span>, <span class="hljs-string">&quot;4512&quot;</span>, <span class="hljs-string">&quot;3934&quot;</span>],
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Contributors&quot;</span>: [<span class="hljs-string">&quot;651&quot;</span>, <span class="hljs-string">&quot;77&quot;</span>, <span class="hljs-string">&quot;34&quot;</span>],
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Programming language&quot;</span>: [<span class="hljs-string">&quot;Python&quot;</span>, <span class="hljs-string">&quot;Python&quot;</span>, <span class="hljs-string">&quot;Rust, Python and NodeJS&quot;</span>],
<span class="hljs-meta">... </span>}
<span class="hljs-meta">&gt;&gt;&gt; </span>oracle(query=<span class="hljs-string">&quot;How many stars does the transformers repository have?&quot;</span>, table=table)
{<span class="hljs-string">&#x27;answer&#x27;</span>: <span class="hljs-string">&#x27;AVERAGE &gt; 36542&#x27;</span>, <span class="hljs-string">&#x27;coordinates&#x27;</span>: [(<span class="hljs-number">0</span>, <span class="hljs-number">1</span>)], <span class="hljs-string">&#x27;cells&#x27;</span>: [<span class="hljs-string">&#x27;36542&#x27;</span>], <span class="hljs-string">&#x27;aggregator&#x27;</span>: <span class="hljs-string">&#x27;AVERAGE&#x27;</span>}`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function NI(j){let u,T,y,f,P;return f=new E({props:{code:`data = {
    "actors": ["brad pitt", "leonardo di caprio", "george clooney"],
    "age": ["56", "45", "59"],
    "number of movies": ["87", "53", "69"],
    "date of birth": ["7 february 1967", "10 june 1996", "28 november 1967"],
}`,highlighted:`data = {
    <span class="hljs-string">&quot;actors&quot;</span>: [<span class="hljs-string">&quot;brad pitt&quot;</span>, <span class="hljs-string">&quot;leonardo di caprio&quot;</span>, <span class="hljs-string">&quot;george clooney&quot;</span>],
    <span class="hljs-string">&quot;age&quot;</span>: [<span class="hljs-string">&quot;56&quot;</span>, <span class="hljs-string">&quot;45&quot;</span>, <span class="hljs-string">&quot;59&quot;</span>],
    <span class="hljs-string">&quot;number of movies&quot;</span>: [<span class="hljs-string">&quot;87&quot;</span>, <span class="hljs-string">&quot;53&quot;</span>, <span class="hljs-string">&quot;69&quot;</span>],
    <span class="hljs-string">&quot;date of birth&quot;</span>: [<span class="hljs-string">&quot;7 february 1967&quot;</span>, <span class="hljs-string">&quot;10 june 1996&quot;</span>, <span class="hljs-string">&quot;28 november 1967&quot;</span>],
}`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function UI(j){let u,T,y,f,P;return f=new E({props:{code:`import pandas as pd

table = pd.DataFrame.from_dict(data)`,highlighted:`<span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd

table = pd.DataFrame.from_dict(data)`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function GI(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline

classifier = pipeline(model="distilbert-base-uncased-finetuned-sst-2-english")
classifier("This movie is disgustingly good !")

classifier("Director tried too much.")`,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>classifier = pipeline(model=<span class="hljs-string">&quot;distilbert-base-uncased-finetuned-sst-2-english&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>classifier(<span class="hljs-string">&quot;This movie is disgustingly good !&quot;</span>)
[{<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;POSITIVE&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">1.0</span>}]

<span class="hljs-meta">&gt;&gt;&gt; </span>classifier(<span class="hljs-string">&quot;Director tried too much.&quot;</span>)
[{<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;NEGATIVE&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.996</span>}]`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function RI(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline

generator = pipeline(model="gpt2")
generator("I can't believe you did such a ", do_sample=False)

# These parameters will return suggestions, and only the newly created text making it easier for prompting suggestions.
outputs = generator("My tart needs some", num_return_sequences=4, return_full_text=False)`,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(model=<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>generator(<span class="hljs-string">&quot;I can&#x27;t believe you did such a &quot;</span>, do_sample=<span class="hljs-literal">False</span>)
[{<span class="hljs-string">&#x27;generated_text&#x27;</span>: <span class="hljs-string">&quot;I can&#x27;t believe you did such a icky thing to me. I&#x27;m so sorry. I&#x27;m so sorry. I&#x27;m so sorry. I&#x27;m so sorry. I&#x27;m so sorry. I&#x27;m so sorry. I&#x27;m so sorry. I&quot;</span>}]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># These parameters will return suggestions, and only the newly created text making it easier for prompting suggestions.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = generator(<span class="hljs-string">&quot;My tart needs some&quot;</span>, num_return_sequences=<span class="hljs-number">4</span>, return_full_text=<span class="hljs-literal">False</span>)`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function QI(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline

generator = pipeline(model="mrm8488/t5-base-finetuned-question-generation-ap")
generator(
    "answer: Manuel context: Manuel has created RuPERTa-base with the support of HF-Transformers and Google"
)`,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(model=<span class="hljs-string">&quot;mrm8488/t5-base-finetuned-question-generation-ap&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>generator(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;answer: Manuel context: Manuel has created RuPERTa-base with the support of HF-Transformers and Google&quot;</span>
<span class="hljs-meta">... </span>)
[{<span class="hljs-string">&#x27;generated_text&#x27;</span>: <span class="hljs-string">&#x27;question: Who created the RuPERTa-base?&#x27;</span>}]`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function HI(j){let u,T,y,f,P;return f=new E({props:{code:`text2text_generator = pipeline("text2text-generation")
text2text_generator("question: What is 42 ? context: 42 is the answer to life, the universe and everything")`,highlighted:`text2text_generator = pipeline(<span class="hljs-string">&quot;text2text-generation&quot;</span>)
text2text_generator(<span class="hljs-string">&quot;question: What is 42 ? context: 42 is the answer to life, the universe and everything&quot;</span>)`}}),{c(){u=n("p"),T=o("Usage:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Usage:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function VI(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline

token_classifier = pipeline(model="Jean-Baptiste/camembert-ner", aggregation_strategy="simple")
sentence = "Je m'appelle jean-baptiste et je vis \xE0 montr\xE9al"
tokens = token_classifier(sentence)
tokens

token = tokens[0]
# Start and end provide an easy way to highlight words in the original text.
sentence[token["start"] : token["end"]]

# Some models use the same idea to do part of speech.
syntaxer = pipeline(model="vblagoje/bert-english-uncased-finetuned-pos", aggregation_strategy="simple")
syntaxer("My name is Sarah and I live in London")`,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>token_classifier = pipeline(model=<span class="hljs-string">&quot;Jean-Baptiste/camembert-ner&quot;</span>, aggregation_strategy=<span class="hljs-string">&quot;simple&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>sentence = <span class="hljs-string">&quot;Je m&#x27;appelle jean-baptiste et je vis \xE0 montr\xE9al&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokens = token_classifier(sentence)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokens
[{<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;PER&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9931</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;jean-baptiste&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">12</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">26</span>}, {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;LOC&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.998</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;montr\xE9al&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">38</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">47</span>}]

<span class="hljs-meta">&gt;&gt;&gt; </span>token = tokens[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Start and end provide an easy way to highlight words in the original text.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>sentence[token[<span class="hljs-string">&quot;start&quot;</span>] : token[<span class="hljs-string">&quot;end&quot;</span>]]
<span class="hljs-string">&#x27; jean-baptiste&#x27;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Some models use the same idea to do part of speech.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>syntaxer = pipeline(model=<span class="hljs-string">&quot;vblagoje/bert-english-uncased-finetuned-pos&quot;</span>, aggregation_strategy=<span class="hljs-string">&quot;simple&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>syntaxer(<span class="hljs-string">&quot;My name is Sarah and I live in London&quot;</span>)
[{<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;PRON&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.999</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;my&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">0</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">2</span>}, {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;NOUN&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.997</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;name&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">3</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">7</span>}, {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;AUX&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.994</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;is&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">8</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">10</span>}, {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;PROPN&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.999</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;sarah&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">11</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">16</span>}, {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;CCONJ&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.999</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;and&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">17</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">20</span>}, {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;PRON&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.999</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;i&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">21</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">22</span>}, {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;VERB&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.998</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;live&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">23</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">27</span>}, {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;ADP&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.999</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;in&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">28</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">30</span>}, {<span class="hljs-string">&#x27;entity_group&#x27;</span>: <span class="hljs-string">&#x27;PROPN&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.999</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;london&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">31</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">37</span>}]`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function WI(j){let u,T,y,f,P;return f=new E({props:{code:`en_fr_translator = pipeline("translation_en_to_fr")
en_fr_translator("How old are you?")`,highlighted:`en_fr_translator = pipeline(<span class="hljs-string">&quot;translation_en_to_fr&quot;</span>)
en_fr_translator(<span class="hljs-string">&quot;How old are you?&quot;</span>)`}}),{c(){u=n("p"),T=o("Usage:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Usage:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function BI(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline

oracle = pipeline(model="facebook/bart-large-mnli")
oracle(
    "I have a problem with my iphone that needs to be resolved asap!!",
    candidate_labels=["urgent", "not urgent", "phone", "tablet", "computer"],
)

oracle(
    "I have a problem with my iphone that needs to be resolved asap!!",
    candidate_labels=["english", "german"],
)`,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>oracle = pipeline(model=<span class="hljs-string">&quot;facebook/bart-large-mnli&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>oracle(
<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>]}

<span class="hljs-meta">&gt;&gt;&gt; </span>oracle(
<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;english&quot;</span>, <span class="hljs-string">&quot;german&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;english&#x27;</span>, <span class="hljs-string">&#x27;german&#x27;</span>], <span class="hljs-string">&#x27;scores&#x27;</span>: [<span class="hljs-number">0.814</span>, <span class="hljs-number">0.186</span>]}`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function ZI(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline

document_qa = pipeline(model="impira/layoutlm-document-qa")
document_qa(
    image="https://huggingface.co/spaces/impira/docquery/resolve/2359223c1837a7587402bda0f2643382a6eefeab/invoice.png",
    question="What is the invoice number?",
)`,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>document_qa = pipeline(model=<span class="hljs-string">&quot;impira/layoutlm-document-qa&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>document_qa(
<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.425</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>}]`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function YI(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline

extractor = pipeline(model="bert-base-uncased", task="feature-extraction")
result = extractor("This is a simple test.", return_tensors=True)
result.shape  # This is a tensor of shape [1, sequence_lenth, hidden_dimension] representing the input string.`,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>extractor = pipeline(model=<span class="hljs-string">&quot;bert-base-uncased&quot;</span>, task=<span class="hljs-string">&quot;feature-extraction&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>result = extractor(<span class="hljs-string">&quot;This is a simple test.&quot;</span>, return_tensors=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>result.shape  <span class="hljs-comment"># This is a tensor of shape [1, sequence_lenth, hidden_dimension] representing the input string.</span>
torch.Size([<span class="hljs-number">1</span>, <span class="hljs-number">8</span>, <span class="hljs-number">768</span>])`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function KI(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline

captioner = pipeline(model="ydshieh/vit-gpt2-coco-en")
captioner("https://huggingface.co/datasets/Narsil/image_dummy/raw/main/parrots.png")`,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>captioner = pipeline(model=<span class="hljs-string">&quot;ydshieh/vit-gpt2-coco-en&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>captioner(<span class="hljs-string">&quot;https://huggingface.co/datasets/Narsil/image_dummy/raw/main/parrots.png&quot;</span>)
[{<span class="hljs-string">&#x27;generated_text&#x27;</span>: <span class="hljs-string">&#x27;two birds are standing next to each other &#x27;</span>}]`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function XI(j){let u,T,y,f,P;return f=new E({props:{code:`from transformers import pipeline

oracle = pipeline(model="dandelin/vilt-b32-finetuned-vqa")
image_url = "https://huggingface.co/datasets/Narsil/image_dummy/raw/main/lena.png"
oracle(question="What is she wearing ?", image=image_url)

oracle(question="What is she wearing ?", image=image_url, top_k=1)

oracle(question="Is this a person ?", image=image_url, top_k=1)

oracle(question="Is this a man ?", image=image_url, top_k=1)`,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>oracle = pipeline(model=<span class="hljs-string">&quot;dandelin/vilt-b32-finetuned-vqa&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_url = <span class="hljs-string">&quot;https://huggingface.co/datasets/Narsil/image_dummy/raw/main/lena.png&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>oracle(question=<span class="hljs-string">&quot;What is she wearing ?&quot;</span>, image=image_url)
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.948</span>, <span class="hljs-string">&#x27;answer&#x27;</span>: <span class="hljs-string">&#x27;hat&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.009</span>, <span class="hljs-string">&#x27;answer&#x27;</span>: <span class="hljs-string">&#x27;fedora&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.003</span>, <span class="hljs-string">&#x27;answer&#x27;</span>: <span class="hljs-string">&#x27;clothes&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.003</span>, <span class="hljs-string">&#x27;answer&#x27;</span>: <span class="hljs-string">&#x27;sun hat&#x27;</span>}, {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.002</span>, <span class="hljs-string">&#x27;answer&#x27;</span>: <span class="hljs-string">&#x27;nothing&#x27;</span>}]

<span class="hljs-meta">&gt;&gt;&gt; </span>oracle(question=<span class="hljs-string">&quot;What is she wearing ?&quot;</span>, image=image_url, top_k=<span class="hljs-number">1</span>)
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.948</span>, <span class="hljs-string">&#x27;answer&#x27;</span>: <span class="hljs-string">&#x27;hat&#x27;</span>}]

<span class="hljs-meta">&gt;&gt;&gt; </span>oracle(question=<span class="hljs-string">&quot;Is this a person ?&quot;</span>, image=image_url, top_k=<span class="hljs-number">1</span>)
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.993</span>, <span class="hljs-string">&#x27;answer&#x27;</span>: <span class="hljs-string">&#x27;yes&#x27;</span>}]

<span class="hljs-meta">&gt;&gt;&gt; </span>oracle(question=<span class="hljs-string">&quot;Is this a man ?&quot;</span>, image=image_url, top_k=<span class="hljs-number">1</span>)
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.996</span>, <span class="hljs-string">&#x27;answer&#x27;</span>: <span class="hljs-string">&#x27;no&#x27;</span>}]`}}),{c(){u=n("p"),T=o("Example:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Example:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function JI(j){let u,T,y,f,P;return f=new E({props:{code:`# Explicitly ask for tensor allocation on CUDA device :0
pipe = pipeline(..., device=0)
with pipe.device_placement():
    # Every framework specific tensor allocation will be done on the request device
    output = pipe(...)`,highlighted:`<span class="hljs-comment"># Explicitly ask for tensor allocation on CUDA device :0</span>
pipe = pipeline(..., device=<span class="hljs-number">0</span>)
<span class="hljs-keyword">with</span> pipe.device_placement():
    <span class="hljs-comment"># Every framework specific tensor allocation will be done on the request device</span>
    output = pipe(...)`}}),{c(){u=n("p"),T=o("Examples:"),y=p(),_(f.$$.fragment)},l(l){u=a(l,"P",{});var g=r(u);T=i(g,"Examples:"),g.forEach(s),y=c(l),b(f.$$.fragment,l)},m(l,g){h(l,u,g),e(u,T),h(l,y,g),v(f,l,g),P=!0},p:C,i(l){P||(w(f.$$.fragment,l),P=!0)},o(l){x(f.$$.fragment,l),P=!1},d(l){l&&s(u),l&&s(y),k(f,l)}}}function eS(j){let u,T,y,f,P,l,g,He,Ev,wg,Ps,qv,jl,Av,Dv,xg,El,Cv,kg,Ts,Na,zv,ql,Iv,Sv,Mv,Ie,Fv,Al,Lv,Ov,Dl,Nv,Uv,Cl,Gv,Rv,zl,Qv,Hv,yg,dt,$s,cd,Ua,Vv,dd,Wv,Pg,js,Bv,md,Zv,Yv,Tg,Il,Kv,$g,Ga,jg,Es,Xv,Ra,Jv,ew,Eg,Qa,qg,qs,tw,hd,sw,nw,Ag,Ha,Dg,As,aw,fd,rw,ow,Cg,Va,zg,Sl,iw,Ig,Wa,Sg,ge,Ba,lw,Za,pw,Ml,cw,dw,mw,ud,hw,fw,mt,Ya,uw,Fl,gw,_w,bw,Ka,vw,Ll,ww,xw,kw,gd,yw,Pw,Ds,Mg,ht,Cs,_d,Xa,Tw,bd,$w,Fg,Je,jw,vd,Ew,qw,wd,Aw,Dw,Lg,Ja,Og,zs,Ng,er,Ug,tr,Gg,Ol,Cw,Rg,sr,Qg,Is,zw,xd,Iw,Sw,Hg,nr,Vg,Nl,Mw,Wg,Ul,Fw,Bg,_e,kd,yd,Pd,Lw,Ow,Td,$d,Nw,Uw,jd,Ed,Gw,Rw,ar,qd,Qw,Hw,ft,Ad,Vw,Ww,Dd,Bw,Zw,Cd,Yw,Kw,zd,Id,Xw,Zg,ut,Ss,Sd,rr,Jw,Md,ex,Yg,Ve,Fd,tx,sx,Ld,nx,ax,Od,rx,ox,Kg,et,ix,Nd,lx,px,Ud,cx,dx,Xg,or,Jg,Gl,mx,e_,ir,t_,Rl,hx,s_,Ms,fx,Gd,ux,gx,n_,gt,Fs,Rd,lr,_x,Qd,bx,a_,Ql,vx,r_,Ls,wx,Hd,xx,kx,o_,Hl,yx,i_,Vl,Vd,Px,l_,pr,p_,Wl,Tx,c_,_t,Os,Wd,cr,$x,Bd,jx,d_,Bl,Zl,Ex,m_,bt,Ns,Zd,dr,qx,Yd,Ax,h_,Yl,Dx,f_,vt,Us,Kd,mr,Cx,Xd,zx,u_,Q,hr,Ix,fr,Sx,Jd,Mx,Fx,Lx,Gs,Ox,Kl,Nx,Xl,Ux,Gx,wt,Rx,Jl,Qx,Hx,em,Vx,Wx,Bx,ur,Zx,gr,Yx,Kx,Xx,Rs,_r,Jx,br,e1,ep,t1,s1,g_,xt,Qs,tm,vr,n1,sm,a1,__,ie,wr,r1,nm,o1,i1,am,l1,p1,Hs,c1,tp,d1,sp,m1,h1,Vs,xr,f1,kr,u1,np,g1,_1,b_,kt,Ws,rm,yr,b1,om,v1,v_,ap,w1,w_,yt,Bs,im,Pr,x1,lm,k1,x_,H,Tr,y1,$r,P1,pm,T1,$1,j1,Zs,E1,rp,q1,op,A1,D1,Pt,C1,ip,z1,I1,cm,S1,M1,F1,jr,L1,Er,O1,N1,U1,Ys,qr,G1,dm,R1,k_,Tt,Ks,mm,Ar,Q1,hm,H1,y_,V,Dr,V1,Cr,W1,fm,B1,Z1,Y1,Xs,K1,lp,X1,pp,J1,ek,$t,tk,cp,sk,nk,um,ak,rk,ok,zr,ik,Ir,lk,pk,ck,Js,Sr,dk,gm,mk,P_,jt,en,_m,Mr,hk,bm,fk,T_,le,Fr,uk,Lr,gk,vm,_k,bk,vk,tn,wk,Et,xk,dp,kk,yk,wm,Pk,Tk,$k,Or,jk,Nr,Ek,qk,Ak,sn,Ur,Dk,xm,Ck,$_,qt,nn,km,Gr,zk,ym,Ik,j_,W,Rr,Sk,Qr,Mk,Pm,Fk,Lk,Ok,an,Nk,mp,Uk,hp,Gk,Rk,At,Qk,fp,Hk,Vk,Tm,Wk,Bk,Zk,Hr,Yk,Vr,Kk,Xk,Jk,rn,Wr,ey,$m,ty,E_,Dt,on,jm,Br,sy,Em,ny,q_,B,Zr,ay,Ct,ry,qm,oy,iy,Am,ly,py,cy,ln,dy,up,my,gp,hy,fy,zt,uy,_p,gy,_y,Dm,by,vy,wy,Yr,xy,Kr,ky,yy,Py,pn,Xr,Ty,Cm,$y,A_,It,cn,zm,Jr,jy,Im,Ey,D_,Z,eo,qy,St,Ay,Sm,Dy,Cy,Mm,zy,Iy,Sy,dn,My,bp,Fy,vp,Ly,Oy,Mt,Ny,wp,Uy,Gy,Fm,Ry,Qy,Hy,to,Vy,so,Wy,By,Zy,mn,no,Yy,Lm,Ky,C_,Ft,hn,Om,ao,Xy,Nm,Jy,z_,xp,eP,I_,Lt,fn,Um,ro,tP,Gm,sP,S_,Y,oo,nP,We,aP,kp,rP,oP,yp,iP,lP,Rm,pP,cP,dP,un,mP,gn,io,hP,lo,fP,Qm,uP,gP,_P,_n,po,bP,Hm,vP,wP,tt,co,xP,Vm,kP,yP,Se,PP,Wm,TP,$P,Bm,jP,EP,Zm,qP,AP,Ym,DP,CP,zP,bn,mo,IP,Be,SP,Km,MP,FP,Xm,LP,OP,Jm,NP,UP,M_,K,ho,GP,eh,RP,QP,vn,HP,Pp,VP,Tp,WP,BP,Ot,ZP,$p,YP,KP,th,XP,JP,e0,Me,t0,sh,s0,n0,nh,a0,r0,ah,o0,i0,fo,l0,p0,c0,wn,uo,d0,rh,m0,F_,Nt,xn,oh,go,h0,ih,f0,L_,O,_o,u0,Ut,g0,lh,_0,b0,jp,v0,w0,x0,kn,k0,Ep,y0,qp,P0,T0,Gt,$0,Ap,j0,E0,ph,q0,A0,D0,bo,C0,vo,z0,I0,S0,yn,M0,Pn,wo,F0,ch,L0,O_,Rt,Tn,dh,xo,O0,mh,N0,N_,S,ko,U0,Qt,G0,hh,R0,Q0,Dp,H0,V0,W0,$n,B0,Cp,Z0,zp,Y0,K0,Ht,X0,Ip,J0,eT,fh,tT,sT,nT,yo,aT,Po,rT,oT,iT,st,To,lT,uh,pT,cT,gh,dT,mT,jn,$o,hT,_h,fT,uT,En,jo,gT,bh,_T,bT,qn,Eo,vT,vh,wT,U_,An,xT,Sp,kT,yT,G_,Vt,Dn,wh,qo,PT,xh,TT,R_,M,Ao,$T,Wt,jT,kh,ET,qT,Mp,AT,DT,CT,Cn,zT,Fp,IT,Lp,ST,MT,Bt,FT,Op,LT,OT,yh,NT,UT,GT,Do,RT,Co,QT,HT,VT,zn,zo,WT,Ph,BT,ZT,nt,Io,YT,Zt,KT,Th,XT,JT,$h,e$,t$,s$,jh,n$,a$,In,So,r$,Eh,o$,Q_,Yt,Sn,qh,Mo,i$,Ah,l$,H_,pe,Fo,p$,Dh,c$,d$,Kt,m$,Np,h$,f$,Ch,u$,g$,_$,G,b$,zh,v$,w$,Ih,x$,k$,Sh,y$,P$,Mh,T$,$$,Fh,j$,E$,Lh,q$,A$,Lo,D$,C$,Oo,z$,I$,Mn,S$,Fn,No,M$,Oh,F$,V_,Xt,Ln,Nh,Uo,L$,Uh,O$,W_,X,Go,N$,Ro,U$,Gh,G$,R$,Q$,On,H$,Up,V$,Gp,W$,B$,Jt,Z$,Rp,Y$,K$,Rh,X$,J$,e4,Qo,t4,Ho,s4,n4,a4,ae,Vo,r4,Qh,o4,i4,ce,Hh,Vh,l4,p4,Wh,Bh,c4,d4,Zh,Yh,m4,h4,Kh,Xh,f4,u4,Jh,ef,g4,_4,tf,sf,b4,v4,nf,af,w4,x4,Wo,k4,rf,y4,P4,T4,Nn,$4,of,j4,E4,Un,B_,es,Gn,lf,Bo,q4,pf,A4,Z_,N,Zo,D4,ts,C4,cf,z4,I4,Qp,S4,M4,F4,Rn,L4,Hp,O4,Vp,N4,U4,ss,G4,Wp,R4,Q4,df,H4,V4,W4,Yo,B4,mf,Z4,Y4,K4,Ko,X4,Xo,J4,e7,t7,Qn,Jo,s7,hf,n7,Y_,ns,Hn,ff,ei,a7,uf,r7,K_,J,ti,o7,si,i7,gf,l7,p7,c7,Vn,d7,Bp,m7,Zp,h7,f7,as,u7,Yp,g7,_7,_f,b7,v7,w7,ni,x7,ai,k7,y7,P7,Wn,ri,T7,bf,$7,X_,rs,Bn,vf,oi,j7,wf,E7,J_,F,ii,q7,xf,A7,D7,Zn,C7,Kp,z7,Xp,I7,S7,os,M7,Jp,F7,L7,kf,O7,N7,U7,Yn,G7,li,R7,Q7,pi,H7,V7,Kn,W7,Xn,ci,B7,yf,Z7,Y7,Jn,di,K7,Pf,X7,eb,is,ea,Tf,mi,J7,$f,ej,tb,I,hi,tj,ls,sj,jf,nj,aj,ec,rj,oj,ij,ta,lj,tc,pj,sc,cj,dj,ps,mj,nc,hj,fj,Ef,uj,gj,_j,fi,bj,ui,vj,wj,xj,sa,gi,kj,qf,yj,Pj,at,_i,Tj,Af,$j,jj,Df,Ej,qj,na,bi,Aj,Cf,Dj,Cj,aa,vi,zj,zf,Ij,Sj,ra,wi,Mj,If,Fj,sb,cs,oa,Sf,xi,Lj,Mf,Oj,nb,de,ki,Nj,Ff,Uj,Gj,ds,Rj,ac,Qj,Hj,Lf,Vj,Wj,Bj,ia,Zj,yi,Yj,Kj,Pi,Xj,Jj,la,e5,pa,Ti,t5,Of,s5,ab,ms,ca,Nf,$i,n5,Uf,a5,rb,U,ji,r5,Ze,o5,Gf,i5,l5,Rf,p5,c5,Qf,d5,m5,h5,Ye,f5,Hf,u5,g5,Vf,_5,b5,Wf,v5,w5,x5,da,k5,rc,y5,oc,P5,T5,hs,$5,ic,j5,E5,Bf,q5,A5,D5,Ei,C5,qi,z5,I5,S5,ma,Ai,M5,Di,F5,lc,L5,O5,ob,fs,ha,Zf,Ci,N5,Yf,U5,ib,pc,G5,lb,us,fa,Kf,zi,R5,Xf,Q5,pb,ee,Ii,H5,Si,V5,Jf,W5,B5,Z5,ua,Y5,cc,K5,dc,X5,J5,gs,eE,mc,tE,sE,eu,nE,aE,rE,Mi,oE,Fi,iE,lE,pE,Ne,Li,cE,Oi,dE,tu,mE,hE,fE,su,uE,gE,Ke,nu,au,_E,bE,ru,ou,vE,wE,iu,lu,xE,kE,pu,cu,yE,cb,_s,ga,du,Ni,PE,mu,TE,db,te,Ui,$E,hu,jE,EE,_a,qE,hc,AE,fc,DE,CE,bs,zE,uc,IE,SE,fu,ME,FE,LE,Gi,OE,Ri,NE,UE,GE,ba,Qi,RE,uu,QE,mb,vs,va,gu,Hi,HE,_u,VE,hb,se,Vi,WE,Wi,BE,bu,ZE,YE,KE,wa,XE,gc,JE,_c,eq,tq,vu,sq,nq,Bi,aq,Zi,rq,oq,iq,xa,Yi,lq,wu,pq,fb,ws,ka,xu,Ki,cq,ku,dq,ub,ne,Xi,mq,Ji,hq,yu,fq,uq,gq,ya,_q,bc,bq,vc,vq,wq,xs,xq,wc,kq,yq,Pu,Pq,Tq,$q,el,jq,tl,Eq,qq,Aq,rt,sl,Dq,Tu,Cq,zq,Xe,$u,ju,Iq,Sq,Eu,qu,Mq,Fq,Au,Du,Lq,Oq,Cu,zu,Nq,gb,ks,Pa,Iu,nl,Uq,xc,Gq,Su,Rq,_b,A,al,Qq,Mu,Hq,Vq,Fu,Wq,Bq,Lu,Zq,Yq,Ou,Kq,Xq,Fe,Jq,kc,e3,t3,Nu,s3,n3,Uu,a3,r3,Gu,o3,i3,l3,Ta,rl,p3,Ru,c3,d3,ot,ol,m3,Qu,h3,f3,$a,u3,ja,il,g3,Hu,_3,b3,Ea,ll,v3,pl,w3,Vu,x3,k3,y3,qa,cl,P3,dl,T3,Wu,$3,j3,E3,Aa,ml,q3,ys,A3,Bu,D3,C3,Zu,z3,I3,S3,Da,hl,M3,Yu,F3,L3,Ca,fl,O3,ul,N3,Ku,U3,G3,bb;return l=new q({}),Ua=new q({}),Ga=new E({props:{code:`pipe = pipeline("text-classification")
pipe("This restaurant is awesome")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipeline(<span class="hljs-string">&quot;text-classification&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe(<span class="hljs-string">&quot;This restaurant is awesome&quot;</span>)
[{<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;POSITIVE&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9998743534088135</span>}]`}}),Qa=new E({props:{code:`pipe = pipeline(model="roberta-large-mnli")
pipe("This restaurant is awesome")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipeline(model=<span class="hljs-string">&quot;roberta-large-mnli&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe(<span class="hljs-string">&quot;This restaurant is awesome&quot;</span>)
[{<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;POSITIVE&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9998743534088135</span>}]`}}),Ha=new E({props:{code:`pipe = pipeline("text-classification")
pipe(["This restaurant is awesome", "This restaurant is aweful"])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipeline(<span class="hljs-string">&quot;text-classification&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe([<span class="hljs-string">&quot;This restaurant is awesome&quot;</span>, <span class="hljs-string">&quot;This restaurant is aweful&quot;</span>])
[{<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;POSITIVE&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9998743534088135</span>},
 {<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;NEGATIVE&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9996669292449951</span>}]`}}),Va=new E({props:{code:`import datasets
from transformers import pipeline
from transformers.pipelines.pt_utils import KeyDataset
from tqdm.auto import tqdm

pipe = pipeline("automatic-speech-recognition", model="facebook/wav2vec2-base-960h", device=0)
dataset = datasets.load_dataset("superb", name="asr", split="test")

# KeyDataset (only *pt*) will simply return the item in the dict returned by the dataset item
# as we're not interested in the *target* part of the dataset. For sentence pair use KeyPairDataset
for out in tqdm(pipe(KeyDataset(dataset, "file"))):
    print(out)
    # {"text": "NUMBER TEN FRESH NELLY IS WAITING ON YOU GOOD NIGHT HUSBAND"}
    # {"text": ....}
    # ....`,highlighted:`<span class="hljs-keyword">import</span> datasets
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline
<span class="hljs-keyword">from</span> transformers.pipelines.pt_utils <span class="hljs-keyword">import</span> KeyDataset
<span class="hljs-keyword">from</span> tqdm.auto <span class="hljs-keyword">import</span> tqdm

pipe = pipeline(<span class="hljs-string">&quot;automatic-speech-recognition&quot;</span>, model=<span class="hljs-string">&quot;facebook/wav2vec2-base-960h&quot;</span>, device=<span class="hljs-number">0</span>)
dataset = datasets.load_dataset(<span class="hljs-string">&quot;superb&quot;</span>, name=<span class="hljs-string">&quot;asr&quot;</span>, split=<span class="hljs-string">&quot;test&quot;</span>)

<span class="hljs-comment"># KeyDataset (only *pt*) will simply return the item in the dict returned by the dataset item</span>
<span class="hljs-comment"># as we&#x27;re not interested in the *target* part of the dataset. For sentence pair use KeyPairDataset</span>
<span class="hljs-keyword">for</span> out <span class="hljs-keyword">in</span> tqdm(pipe(KeyDataset(dataset, <span class="hljs-string">&quot;file&quot;</span>))):
    <span class="hljs-built_in">print</span>(out)
    <span class="hljs-comment"># {&quot;text&quot;: &quot;NUMBER TEN FRESH NELLY IS WAITING ON YOU GOOD NIGHT HUSBAND&quot;}</span>
    <span class="hljs-comment"># {&quot;text&quot;: ....}</span>
    <span class="hljs-comment"># ....</span>`}}),Wa=new E({props:{code:`from transformers import pipeline

pipe = pipeline("text-classification")


def data():
    while True:
        # This could come from a dataset, a database, a queue or HTTP request
        # in a server
        # Caveat: because this is iterative, you cannot use \`num_workers > 1\` variable
        # to use multiple threads to preprocess data. You can still have 1 thread that
        # does the preprocessing while the main runs the big inference
        yield "This is a test"


for out in pipe(data()):
    print(out)
    # {"text": "NUMBER TEN FRESH NELLY IS WAITING ON YOU GOOD NIGHT HUSBAND"}
    # {"text": ....}
    # ....`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

pipe = pipeline(<span class="hljs-string">&quot;text-classification&quot;</span>)


<span class="hljs-keyword">def</span> <span class="hljs-title function_">data</span>():
    <span class="hljs-keyword">while</span> <span class="hljs-literal">True</span>:
        <span class="hljs-comment"># This could come from a dataset, a database, a queue or HTTP request</span>
        <span class="hljs-comment"># in a server</span>
        <span class="hljs-comment"># Caveat: because this is iterative, you cannot use \`num_workers &gt; 1\` variable</span>
        <span class="hljs-comment"># to use multiple threads to preprocess data. You can still have 1 thread that</span>
        <span class="hljs-comment"># does the preprocessing while the main runs the big inference</span>
        <span class="hljs-keyword">yield</span> <span class="hljs-string">&quot;This is a test&quot;</span>


<span class="hljs-keyword">for</span> out <span class="hljs-keyword">in</span> pipe(data()):
    <span class="hljs-built_in">print</span>(out)
    <span class="hljs-comment"># {&quot;text&quot;: &quot;NUMBER TEN FRESH NELLY IS WAITING ON YOU GOOD NIGHT HUSBAND&quot;}</span>
    <span class="hljs-comment"># {&quot;text&quot;: ....}</span>
    <span class="hljs-comment"># ....</span>`}}),Ba=new $({props:{name:"transformers.pipeline",anchor:"transformers.pipeline",parameters:[{name:"task",val:": str = None"},{name:"model",val:": typing.Optional = None"},{name:"config",val:": typing.Union[str, transformers.configuration_utils.PretrainedConfig, NoneType] = None"},{name:"tokenizer",val:": typing.Union[str, transformers.tokenization_utils.PreTrainedTokenizer, transformers.tokenization_utils_fast.PreTrainedTokenizerFast, NoneType] = None"},{name:"feature_extractor",val:": typing.Union[str, ForwardRef('SequenceFeatureExtractor'), NoneType] = None"},{name:"framework",val:": typing.Optional[str] = None"},{name:"revision",val:": typing.Optional[str] = None"},{name:"use_fast",val:": bool = True"},{name:"use_auth_token",val:": typing.Union[bool, str, NoneType] = None"},{name:"device",val:": typing.Union[int, str, ForwardRef('torch.device'), NoneType] = None"},{name:"device_map",val:" = None"},{name:"torch_dtype",val:" = None"},{name:"trust_remote_code",val:": typing.Optional[bool] = None"},{name:"model_kwargs",val:": typing.Dict[str, typing.Any] = None"},{name:"pipeline_class",val:": typing.Optional[typing.Any] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.pipeline.task",description:`<strong>task</strong> (<code>str</code>) &#x2014;
The task defining which pipeline will be returned. Currently accepted tasks are:</p>
<ul>
<li><code>&quot;audio-classification&quot;</code>: will return a <a href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.AudioClassificationPipeline">AudioClassificationPipeline</a>.</li>
<li><code>&quot;automatic-speech-recognition&quot;</code>: will return a <a href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.AutomaticSpeechRecognitionPipeline">AutomaticSpeechRecognitionPipeline</a>.</li>
<li><code>&quot;conversational&quot;</code>: will return a <a href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.ConversationalPipeline">ConversationalPipeline</a>.</li>
<li><code>&quot;feature-extraction&quot;</code>: will return a <a href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.FeatureExtractionPipeline">FeatureExtractionPipeline</a>.</li>
<li><code>&quot;fill-mask&quot;</code>: will return a <a href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.FillMaskPipeline">FillMaskPipeline</a>:.</li>
<li><code>&quot;image-classification&quot;</code>: will return a <a href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.ImageClassificationPipeline">ImageClassificationPipeline</a>.</li>
<li><code>&quot;question-answering&quot;</code>: will return a <a href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.QuestionAnsweringPipeline">QuestionAnsweringPipeline</a>.</li>
<li><code>&quot;table-question-answering&quot;</code>: will return a <a href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.TableQuestionAnsweringPipeline">TableQuestionAnsweringPipeline</a>.</li>
<li><code>&quot;text2text-generation&quot;</code>: will return a <a href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.Text2TextGenerationPipeline">Text2TextGenerationPipeline</a>.</li>
<li><code>&quot;text-classification&quot;</code> (alias <code>&quot;sentiment-analysis&quot;</code> available): will return a
<a href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.TextClassificationPipeline">TextClassificationPipeline</a>.</li>
<li><code>&quot;text-generation&quot;</code>: will return a <a href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.TextGenerationPipeline">TextGenerationPipeline</a>:.</li>
<li><code>&quot;token-classification&quot;</code> (alias <code>&quot;ner&quot;</code> available): will return a <a href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.TokenClassificationPipeline">TokenClassificationPipeline</a>.</li>
<li><code>&quot;translation&quot;</code>: will return a <a href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.TranslationPipeline">TranslationPipeline</a>.</li>
<li><code>&quot;translation_xx_to_yy&quot;</code>: will return a <a href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.TranslationPipeline">TranslationPipeline</a>.</li>
<li><code>&quot;summarization&quot;</code>: will return a <a href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.SummarizationPipeline">SummarizationPipeline</a>.</li>
<li><code>&quot;zero-shot-classification&quot;</code>: will return a <a href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.ZeroShotClassificationPipeline">ZeroShotClassificationPipeline</a>.</li>
</ul>`,name:"task"},{anchor:"transformers.pipeline.model",description:`<strong>model</strong> (<code>str</code> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>, <em>optional</em>) &#x2014;
The model that will be used by the pipeline to make predictions. This can be a model identifier or an
actual instance of a pretrained model inheriting from <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> (for PyTorch) or
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> (for TensorFlow).</p>
<p>If not provided, the default for the <code>task</code> will be loaded.`,name:"model"},{anchor:"transformers.pipeline.config",description:`<strong>config</strong> (<code>str</code> or <a href="/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a>, <em>optional</em>) &#x2014;
The configuration that will be used by the pipeline to instantiate the model. This can be a model
identifier or an actual pretrained model configuration inheriting from <a href="/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a>.</p>
<p>If not provided, the default configuration file for the requested model will be used. That means that if
<code>model</code> is given, its default configuration will be used. However, if <code>model</code> is not supplied, this
<code>task</code>&#x2019;s default model&#x2019;s config is used instead.`,name:"config"},{anchor:"transformers.pipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>str</code> or <a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>, <em>optional</em>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This can be a model
identifier or an actual pretrained tokenizer inheriting from <a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.</p>
<p>If not provided, the default tokenizer for the given <code>model</code> will be loaded (if it is a string). If <code>model</code>
is not specified or not a string, then the default tokenizer for <code>config</code> is loaded (if it is a string).
However, if <code>config</code> is also not given or not a string, then the default tokenizer for the given <code>task</code>
will be loaded.`,name:"tokenizer"},{anchor:"transformers.pipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>str</code> or <code>PreTrainedFeatureExtractor</code>, <em>optional</em>) &#x2014;
The feature extractor that will be used by the pipeline to encode data for the model. This can be a model
identifier or an actual pretrained feature extractor inheriting from <code>PreTrainedFeatureExtractor</code>.</p>
<p>Feature extractors are used for non-NLP models, such as Speech or Vision models as well as multi-modal
models. Multi-modal models will also require a tokenizer to be passed.</p>
<p>If not provided, the default feature extractor for the given <code>model</code> will be loaded (if it is a string). If
<code>model</code> is not specified or not a string, then the default feature extractor for <code>config</code> is loaded (if it
is a string). However, if <code>config</code> is also not given or not a string, then the default feature extractor
for the given <code>task</code> will be loaded.`,name:"feature_extractor"},{anchor:"transformers.pipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.pipeline.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
When passing a task name or a string model identifier: The specific model version to use. It can be a
branch name, a tag name, or a commit id, since we use a git-based system for storing models and other
artifacts on huggingface.co, so <code>revision</code> can be any identifier allowed by git.`,name:"revision"},{anchor:"transformers.pipeline.use_fast",description:`<strong>use_fast</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use a Fast tokenizer if possible (a <a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a>).`,name:"use_fast"},{anchor:"transformers.pipeline.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, will use the token generated
when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"use_auth_token"},{anchor:"transformers.pipeline.device",description:`<strong>device</strong> (<code>int</code> or <code>str</code> or <code>torch.device</code>) &#x2014;
Defines the device (<em>e.g.</em>, <code>&quot;cpu&quot;</code>, <code>&quot;cuda:1&quot;</code>, <code>&quot;mps&quot;</code>, or a GPU ordinal rank like <code>1</code>) on which this
pipeline will be allocated.`,name:"device"},{anchor:"transformers.pipeline.device_map",description:`<strong>device_map</strong> (<code>str</code> or <code>Dict[str, Union[int, str, torch.device]</code>, <em>optional</em>) &#x2014;
Sent directly as <code>model_kwargs</code> (just a simpler shortcut). When <code>accelerate</code> library is present, set
<code>device_map=&quot;auto&quot;</code> to compute the most optimized <code>device_map</code> automatically. <a href="https://huggingface.co/docs/accelerate/main/en/big_modeling#accelerate.cpu_offload" rel="nofollow">More
information</a></p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p>Do not use <code>device_map</code> AND <code>device</code> at the same time as they will conflict</p>

					</div>`,name:"device_map"},{anchor:"transformers.pipeline.torch_dtype",description:`<strong>torch_dtype</strong> (<code>str</code> or <code>torch.dtype</code>, <em>optional</em>) &#x2014;
Sent directly as <code>model_kwargs</code> (just a simpler shortcut) to use the available precision for this model
(<code>torch.float16</code>, <code>torch.bfloat16</code>, &#x2026; or <code>&quot;auto&quot;</code>).`,name:"torch_dtype"},{anchor:"transformers.pipeline.trust_remote_code",description:`<strong>trust_remote_code</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to allow for custom code defined on the Hub in their own modeling, configuration,
tokenization or even pipeline files. This option should only be set to <code>True</code> for repositories you trust
and in which you have read the code, as it will execute code present on the Hub on your local machine.
model_kwargs &#x2014;
Additional dictionary of keyword arguments passed along to the model&#x2019;s <code>from_pretrained(..., **model_kwargs)</code> function.
kwargs &#x2014;
Additional keyword arguments passed along to the specific pipeline init (see the documentation for the
corresponding pipeline class for possible values).`,name:"trust_remote_code"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/__init__.py#L459",returnDescription:`
<p>A suitable pipeline for the task.</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.Pipeline"
>Pipeline</a></p>
`}}),Ds=new D({props:{anchor:"transformers.pipeline.example",$$slots:{default:[kI]},$$scope:{ctx:j}}}),Xa=new q({}),Ja=new E({props:{code:`from transformers import pipeline
from transformers.pipelines.pt_utils import KeyDataset
import datasets

dataset = datasets.load_dataset("imdb", name="plain_text", split="unsupervised")
pipe = pipeline("text-classification", device=0)
for out in pipe(KeyDataset(dataset, "text"), batch_size=8, truncation="only_first"):
    print(out)
    # [{'label': 'POSITIVE', 'score': 0.9998743534088135}]
    # Exactly the same output as before, but the content are passed
    # as batches to the model`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline
<span class="hljs-keyword">from</span> transformers.pipelines.pt_utils <span class="hljs-keyword">import</span> KeyDataset
<span class="hljs-keyword">import</span> datasets

dataset = datasets.load_dataset(<span class="hljs-string">&quot;imdb&quot;</span>, name=<span class="hljs-string">&quot;plain_text&quot;</span>, split=<span class="hljs-string">&quot;unsupervised&quot;</span>)
pipe = pipeline(<span class="hljs-string">&quot;text-classification&quot;</span>, device=<span class="hljs-number">0</span>)
<span class="hljs-keyword">for</span> out <span class="hljs-keyword">in</span> pipe(KeyDataset(dataset, <span class="hljs-string">&quot;text&quot;</span>), batch_size=<span class="hljs-number">8</span>, truncation=<span class="hljs-string">&quot;only_first&quot;</span>):
    <span class="hljs-built_in">print</span>(out)
    <span class="hljs-comment"># [{&#x27;label&#x27;: &#x27;POSITIVE&#x27;, &#x27;score&#x27;: 0.9998743534088135}]</span>
    <span class="hljs-comment"># Exactly the same output as before, but the content are passed</span>
    <span class="hljs-comment"># as batches to the model</span>`}}),zs=new gI({props:{warning:!0,$$slots:{default:[yI]},$$scope:{ctx:j}}}),er=new E({props:{code:`from transformers import pipeline
from torch.utils.data import Dataset
from tqdm.auto import tqdm

pipe = pipeline("text-classification", device=0)


class MyDataset(Dataset):
    def __len__(self):
        return 5000

    def __getitem__(self, i):
        return "This is a test"


dataset = MyDataset()

for batch_size in [1, 8, 64, 256]:
    print("-" * 30)
    print(f"Streaming batch_size={batch_size}")
    for out in tqdm(pipe(dataset, batch_size=batch_size), total=len(dataset)):
        pass`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline
<span class="hljs-keyword">from</span> torch.utils.data <span class="hljs-keyword">import</span> Dataset
<span class="hljs-keyword">from</span> tqdm.auto <span class="hljs-keyword">import</span> tqdm

pipe = pipeline(<span class="hljs-string">&quot;text-classification&quot;</span>, device=<span class="hljs-number">0</span>)


<span class="hljs-keyword">class</span> <span class="hljs-title class_">MyDataset</span>(<span class="hljs-title class_ inherited__">Dataset</span>):
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__len__</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> <span class="hljs-number">5000</span>

    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__getitem__</span>(<span class="hljs-params">self, i</span>):
        <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;This is a test&quot;</span>


dataset = MyDataset()

<span class="hljs-keyword">for</span> batch_size <span class="hljs-keyword">in</span> [<span class="hljs-number">1</span>, <span class="hljs-number">8</span>, <span class="hljs-number">64</span>, <span class="hljs-number">256</span>]:
    <span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;-&quot;</span> * <span class="hljs-number">30</span>)
    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Streaming batch_size=<span class="hljs-subst">{batch_size}</span>&quot;</span>)
    <span class="hljs-keyword">for</span> out <span class="hljs-keyword">in</span> tqdm(pipe(dataset, batch_size=batch_size), total=<span class="hljs-built_in">len</span>(dataset)):
        <span class="hljs-keyword">pass</span>`}}),tr=new E({props:{code:`# On GTX 970
------------------------------
Streaming no batching
100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 5000/5000 [00:26<00:00, 187.52it/s]
------------------------------
Streaming batch_size=8
100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 5000/5000 [00:04<00:00, 1205.95it/s]
------------------------------
Streaming batch_size=64
100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 5000/5000 [00:02<00:00, 2478.24it/s]
------------------------------
Streaming batch_size=256
100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 5000/5000 [00:01<00:00, 2554.43it/s]
(diminishing returns, saturated the GPU)`,highlighted:`<span class="hljs-section"># On GTX 970
------------------------------</span>
Streaming no batching
100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 5000/5000 [00:26&lt;00:00, 187.52it/s]
<span class="hljs-code">------------------------------
Streaming batch_size=8
100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 5000/5000 [00:04&lt;00:00, 1205.95it/s]
------------------------------</span>
Streaming batch<span class="hljs-emphasis">_size=64
100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 5000/5000 [00:02&lt;00:00, 2478.24it/s]
------------------------------
Streaming batch_</span>size=256
100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 5000/5000 [00:01&lt;00:00, 2554.43it/s]
(diminishing returns, saturated the GPU)`}}),sr=new E({props:{code:`class MyDataset(Dataset):
    def __len__(self):
        return 5000

    def __getitem__(self, i):
        if i % 64 == 0:
            n = 100
        else:
            n = 1
        return "This is a test" * n`,highlighted:`<span class="hljs-keyword">class</span> <span class="hljs-title class_">MyDataset</span>(<span class="hljs-title class_ inherited__">Dataset</span>):
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__len__</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> <span class="hljs-number">5000</span>

    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__getitem__</span>(<span class="hljs-params">self, i</span>):
        <span class="hljs-keyword">if</span> i % <span class="hljs-number">64</span> == <span class="hljs-number">0</span>:
            n = <span class="hljs-number">100</span>
        <span class="hljs-keyword">else</span>:
            n = <span class="hljs-number">1</span>
        <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;This is a test&quot;</span> * n`}}),nr=new E({props:{code:`------------------------------
Streaming no batching
100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 1000/1000 [00:05<00:00, 183.69it/s]
------------------------------
Streaming batch_size=8
100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 1000/1000 [00:03<00:00, 265.74it/s]
------------------------------
Streaming batch_size=64
100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 1000/1000 [00:26<00:00, 37.80it/s]
------------------------------
Streaming batch_size=256
  0%|                                                                                 | 0/1000 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/home/nicolas/src/transformers/test.py", line 42, in <module>
    for out in tqdm(pipe(dataset, batch_size=256), total=len(dataset)):
....
    q = q / math.sqrt(dim_per_head)  # (bs, n_heads, q_length, dim_per_head)
RuntimeError: CUDA out of memory. Tried to allocate 376.00 MiB (GPU 0; 3.95 GiB total capacity; 1.72 GiB already allocated; 354.88 MiB free; 2.46 GiB reserved in total by PyTorch)`,highlighted:`<span class="hljs-comment">------------------------------</span>
Streaming no batching
<span class="hljs-number">100</span>%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| <span class="hljs-number">1000</span>/<span class="hljs-number">1000</span> [<span class="hljs-number">00</span>:<span class="hljs-number">05</span>&lt;<span class="hljs-number">00</span>:<span class="hljs-number">00</span>, <span class="hljs-number">183.69</span><span class="hljs-keyword">it</span>/s]
<span class="hljs-comment">------------------------------</span>
Streaming batch_size=<span class="hljs-number">8</span>
<span class="hljs-number">100</span>%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| <span class="hljs-number">1000</span>/<span class="hljs-number">1000</span> [<span class="hljs-number">00</span>:<span class="hljs-number">03</span>&lt;<span class="hljs-number">00</span>:<span class="hljs-number">00</span>, <span class="hljs-number">265.74</span><span class="hljs-keyword">it</span>/s]
<span class="hljs-comment">------------------------------</span>
Streaming batch_size=<span class="hljs-number">64</span>
<span class="hljs-number">100</span>%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| <span class="hljs-number">1000</span>/<span class="hljs-number">1000</span> [<span class="hljs-number">00</span>:<span class="hljs-number">26</span>&lt;<span class="hljs-number">00</span>:<span class="hljs-number">00</span>, <span class="hljs-number">37.80</span><span class="hljs-keyword">it</span>/s]
<span class="hljs-comment">------------------------------</span>
Streaming batch_size=<span class="hljs-number">256</span>
  <span class="hljs-number">0</span>%|                                                                                 | <span class="hljs-number">0</span>/<span class="hljs-number">1000</span> [<span class="hljs-number">00</span>:<span class="hljs-number">00</span><span class="hljs-meta">&lt;?</span>, ?<span class="hljs-keyword">it</span>/s]
Traceback (most recent call <span class="hljs-keyword">last</span>):
  File <span class="hljs-string">&quot;/home/nicolas/src/transformers/test.py&quot;</span>, <span class="hljs-built_in">line</span> <span class="hljs-number">42</span>, <span class="hljs-keyword">in</span> &lt;module&gt;
    <span class="hljs-keyword">for</span> out <span class="hljs-keyword">in</span> tqdm(pipe(dataset, batch_size=<span class="hljs-number">256</span>), total=<span class="hljs-built_in">len</span>(dataset)):
....
    q = q / math.<span class="hljs-built_in">sqrt</span>(dim_per_head)  <span class="hljs-comment"># (bs, n_heads, q_length, dim_per_head)</span>
RuntimeError: CUDA out <span class="hljs-keyword">of</span> memory. Tried <span class="hljs-built_in">to</span> allocate <span class="hljs-number">376.00</span> MiB (GPU <span class="hljs-number">0</span>; <span class="hljs-number">3.95</span> GiB total capacity; <span class="hljs-number">1.72</span> GiB already allocated; <span class="hljs-number">354.88</span> MiB free; <span class="hljs-number">2.46</span> GiB reserved <span class="hljs-keyword">in</span> total <span class="hljs-keyword">by</span> PyTorch)`}}),rr=new q({}),or=new E({props:{code:`preprocessed = pipe.preprocess(inputs)
model_outputs = pipe.forward(preprocessed)
outputs = pipe.postprocess(model_outputs)`,highlighted:`preprocessed = pipe.preprocess(inputs)
model_outputs = pipe.forward(preprocessed)
outputs = pipe.postprocess(model_outputs)`}}),ir=new E({props:{code:`all_model_outputs = []
for preprocessed in pipe.preprocess(inputs):
    model_outputs = pipe.forward(preprocessed)
    all_model_outputs.append(model_outputs)
outputs = pipe.postprocess(all_model_outputs)`,highlighted:`all_model_outputs = []
<span class="hljs-keyword">for</span> preprocessed <span class="hljs-keyword">in</span> pipe.preprocess(inputs):
    model_outputs = pipe.forward(preprocessed)
    all_model_outputs.append(model_outputs)
outputs = pipe.postprocess(all_model_outputs)`}}),lr=new q({}),pr=new E({props:{code:`class MyPipeline(TextClassificationPipeline):
    def postprocess():
        # Your code goes here
        scores = scores * 100
        # And here


my_pipeline = MyPipeline(model=model, tokenizer=tokenizer, ...)
# or if you use *pipeline* function, then:
my_pipeline = pipeline(model="xxxx", pipeline_class=MyPipeline)`,highlighted:`<span class="hljs-keyword">class</span> <span class="hljs-title class_">MyPipeline</span>(<span class="hljs-title class_ inherited__">TextClassificationPipeline</span>):
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">postprocess</span>():
        <span class="hljs-comment"># Your code goes here</span>
        scores = scores * <span class="hljs-number">100</span>
        <span class="hljs-comment"># And here</span>


my_pipeline = MyPipeline(model=model, tokenizer=tokenizer, ...)
<span class="hljs-comment"># or if you use *pipeline* function, then:</span>
my_pipeline = pipeline(model=<span class="hljs-string">&quot;xxxx&quot;</span>, pipeline_class=MyPipeline)`}}),cr=new q({}),dr=new q({}),mr=new q({}),hr=new $({props:{name:"class transformers.AudioClassificationPipeline",anchor:"transformers.AudioClassificationPipeline",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.AudioClassificationPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.AudioClassificationPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.AudioClassificationPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.AudioClassificationPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.AudioClassificationPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.AudioClassificationPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.AudioClassificationPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.AudioClassificationPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.AudioClassificationPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.AudioClassificationPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/audio_classification.py#L68"}}),Gs=new D({props:{anchor:"transformers.AudioClassificationPipeline.example",$$slots:{default:[PI]},$$scope:{ctx:j}}}),_r=new $({props:{name:"__call__",anchor:"transformers.AudioClassificationPipeline.__call__",parameters:[{name:"inputs",val:": typing.Union[numpy.ndarray, bytes, str]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.AudioClassificationPipeline.__call__.inputs",description:`<strong>inputs</strong> (<code>np.ndarray</code> or <code>bytes</code> or <code>str</code>) &#x2014;
The inputs is either a raw waveform (<code>np.ndarray</code> of shape (n, ) of type <code>np.float32</code> or <code>np.float64</code>)
at the correct sampling rate (no further check will be done) or a <code>str</code> that is the filename of the
audio file, the file will be read at the correct sampling rate to get the waveform using <em>ffmpeg</em>. This
requires <em>ffmpeg</em> to be installed on the system. If <em>inputs</em> is <code>bytes</code> it is supposed to be the
content of an audio file and is interpreted by <em>ffmpeg</em> in the same way.`,name:"inputs"},{anchor:"transformers.AudioClassificationPipeline.__call__.top_k",description:`<strong>top_k</strong> (<code>int</code>, <em>optional</em>, defaults to None) &#x2014;
The number of top labels that will be returned by the pipeline. If the provided number is <code>None</code> or
higher than the number of labels available in the model configuration, it will default to the number of
labels.`,name:"top_k"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/audio_classification.py#L104",returnDescription:`
<ul>
<li><strong>label</strong> (<code>str</code>) \u2014 The label predicted.</li>
<li><strong>score</strong> (<code>float</code>) \u2014 The corresponding probability.</li>
</ul>
`,returnType:`
<p>A list of <code>dict</code> with the following keys</p>
`}}),vr=new q({}),wr=new $({props:{name:"class transformers.AutomaticSpeechRecognitionPipeline",anchor:"transformers.AutomaticSpeechRecognitionPipeline",parameters:[{name:"feature_extractor",val:": typing.Union[ForwardRef('SequenceFeatureExtractor'), str]"},{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.AutomaticSpeechRecognitionPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.AutomaticSpeechRecognitionPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.AutomaticSpeechRecognitionPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/feature_extractor#transformers.SequenceFeatureExtractor">SequenceFeatureExtractor</a>) &#x2014;
The feature extractor that will be used by the pipeline to encode waveform for the model.`,name:"feature_extractor"},{anchor:"transformers.AutomaticSpeechRecognitionPipeline.chunk_length_s",description:`<strong>chunk_length_s</strong> (<code>float</code>, <em>optional</em>, defaults to 0) &#x2014;
The input length for in each chunk. If <code>chunk_length_s = 0</code> then chunking is disabled (default). Only
available for CTC models, e.g. <a href="/docs/transformers/v4.25.1/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC">Wav2Vec2ForCTC</a>.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>For more information on how to effectively use <code>chunk_length_s</code>, please have a look at the <a href="https://huggingface.co/blog/asr-chunking" rel="nofollow">ASR chunking
blog post</a>.</p>

					</div>`,name:"chunk_length_s"},{anchor:"transformers.AutomaticSpeechRecognitionPipeline.stride_length_s",description:`<strong>stride_length_s</strong> (<code>float</code>, <em>optional</em>, defaults to <code>chunk_length_s / 6</code>) &#x2014;
The length of stride on the left and right of each chunk. Used only with <code>chunk_length_s &gt; 0</code>. This enables
the model to <em>see</em> more context and infer letters better than without this context but the pipeline
discards the stride bits at the end to make the final reconstitution as perfect as possible.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>For more information on how to effectively use <code>stride_length_s</code>, please have a look at the <a href="https://huggingface.co/blog/asr-chunking" rel="nofollow">ASR chunking
blog post</a>.</p>

					</div>`,name:"stride_length_s"},{anchor:"transformers.AutomaticSpeechRecognitionPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed. If no framework is specified, will default to the one currently installed. If no framework is
specified and both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if
no model is provided.`,name:"framework"},{anchor:"transformers.AutomaticSpeechRecognitionPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id.`,name:"device"},{anchor:"transformers.AutomaticSpeechRecognitionPipeline.decoder",description:`<strong>decoder</strong> (<code>pyctcdecode.BeamSearchDecoderCTC</code>, <em>optional</em>) &#x2014;
<a href="https://github.com/kensho-technologies/pyctcdecode/blob/2fd33dc37c4111417e08d89ccd23d28e9b308d19/pyctcdecode/decoder.py#L180" rel="nofollow">PyCTCDecode&#x2019;s
BeamSearchDecoderCTC</a>
can be passed for language model boosted decoding. See <a href="/docs/transformers/v4.25.1/en/model_doc/wav2vec2#transformers.Wav2Vec2ProcessorWithLM">Wav2Vec2ProcessorWithLM</a> for more information.`,name:"decoder"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/automatic_speech_recognition.py#L104"}}),Hs=new D({props:{anchor:"transformers.AutomaticSpeechRecognitionPipeline.example",$$slots:{default:[TI]},$$scope:{ctx:j}}}),xr=new $({props:{name:"__call__",anchor:"transformers.AutomaticSpeechRecognitionPipeline.__call__",parameters:[{name:"inputs",val:": typing.Union[numpy.ndarray, bytes, str]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.AutomaticSpeechRecognitionPipeline.__call__.inputs",description:`<strong>inputs</strong> (<code>np.ndarray</code> or <code>bytes</code> or <code>str</code> or <code>dict</code>) &#x2014;
The inputs is either :<ul>
<li><code>str</code> that is the filename of the audio file, the file will be read at the correct sampling rate
to get the waveform using <em>ffmpeg</em>. This requires <em>ffmpeg</em> to be installed on the system.</li>
<li><code>bytes</code> it is supposed to be the content of an audio file and is interpreted by <em>ffmpeg</em> in the
same way.</li>
<li>(<code>np.ndarray</code> of shape (n, ) of type <code>np.float32</code> or <code>np.float64</code>)
Raw audio at the correct sampling rate (no further check will be done)</li>
<li><code>dict</code> form can be used to pass raw audio sampled at arbitrary <code>sampling_rate</code> and let this
pipeline do the resampling. The dict must be in the format <code>{&quot;sampling_rate&quot;: int, &quot;raw&quot;: np.array}</code> with optionally a <code>&quot;stride&quot;: (left: int, right: int)</code> than can ask the pipeline to
treat the first <code>left</code> samples and last <code>right</code> samples to be ignored in decoding (but used at
inference to provide more context to the model). Only use <code>stride</code> with CTC models.</li>
</ul>`,name:"inputs"},{anchor:"transformers.AutomaticSpeechRecognitionPipeline.__call__.return_timestamps",description:`<strong>return_timestamps</strong> (<em>optional</em>, <code>str</code>) &#x2014;
Only available for pure CTC models. If set to <code>&quot;char&quot;</code>, the pipeline will return <code>timestamps</code> along the
text for every character in the text. For instance if you get <code>[{&quot;text&quot;: &quot;h&quot;, &quot;timestamps&quot;: (0.5,0.6), {&quot;text&quot;: &quot;i&quot;, &quot;timestamps&quot;: (0.7, .9)}]</code>, then it means the model predicts that the letter &#x201C;h&#x201D; was
pronounced after <code>0.5</code> and before <code>0.6</code> seconds. If set to <code>&quot;word&quot;</code>, the pipeline will return
<code>timestamps</code> along the text for every word in the text. For instance if you get <code>[{&quot;text&quot;: &quot;hi &quot;, &quot;timestamps&quot;: (0.5,0.9), {&quot;text&quot;: &quot;there&quot;, &quot;timestamps&quot;: (1.0, .1.5)}]</code>, then it means the model
predicts that the word &#x201C;hi&#x201D; was pronounced after <code>0.5</code> and before <code>0.9</code> seconds.`,name:"return_timestamps"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/automatic_speech_recognition.py#L191",returnDescription:`
<p>A dictionary with the following keys:</p>
<ul>
<li><strong>text</strong> (<code>str</code> ) \u2014 The recognized text.</li>
<li><strong>chunks</strong> (<em>optional(, <code>List[Dict]</code>)
When using <code>return_timestamps</code>, the <code>chunks</code> will become a list containing all the various text
chunks identified by the model, </em>e.g.* <code>[&#123;"text": "hi ", "timestamps": (0.5,0.9), &#123;"text": "there", "timestamps": (1.0, 1.5)&#125;]</code>. The original full text can roughly be recovered by doing
<code>"".join(chunk["text"] for chunk in output["chunks"])</code>.</li>
</ul>
`,returnType:`
<p><code>Dict</code></p>
`}}),yr=new q({}),Pr=new q({}),Tr=new $({props:{name:"class transformers.DepthEstimationPipeline",anchor:"transformers.DepthEstimationPipeline",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DepthEstimationPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.DepthEstimationPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.DepthEstimationPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.DepthEstimationPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.DepthEstimationPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.DepthEstimationPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.DepthEstimationPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.DepthEstimationPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.DepthEstimationPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.DepthEstimationPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/depth_estimation.py#L23"}}),Zs=new D({props:{anchor:"transformers.DepthEstimationPipeline.example",$$slots:{default:[$I]},$$scope:{ctx:j}}}),qr=new $({props:{name:"__call__",anchor:"transformers.DepthEstimationPipeline.__call__",parameters:[{name:"images",val:": typing.Union[str, typing.List[str], ForwardRef('Image.Image'), typing.List[ForwardRef('Image.Image')]]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DepthEstimationPipeline.__call__.images",description:`<strong>images</strong> (<code>str</code>, <code>List[str]</code>, <code>PIL.Image</code> or <code>List[PIL.Image]</code>) &#x2014;
The pipeline handles three types of images:</p>
<ul>
<li>A string containing a http link pointing to an image</li>
<li>A string containing a local path to an image</li>
<li>An image loaded in PIL directly</li>
</ul>
<p>The pipeline accepts either a single image or a batch of images, which must then be passed as a string.
Images in a batch must all be in the same format: all as http links, all as local paths, or all as PIL
images.`,name:"images"},{anchor:"transformers.DepthEstimationPipeline.__call__.top_k",description:`<strong>top_k</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
The number of top labels that will be returned by the pipeline. If the provided number is higher than
the number of labels available in the model configuration, it will default to the number of labels.`,name:"top_k"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/depth_estimation.py#L53",returnDescription:`
<p>A dictionary or a list of dictionaries containing result. If the input is a single image, will return a
dictionary, if the input is a list of several images, will return a list of dictionaries corresponding to
the images.</p>
<p>The dictionaries contain the following keys:</p>
<ul>
<li><strong>label</strong> (<code>str</code>) \u2014 The label identified by the model.</li>
<li><strong>score</strong> (<code>int</code>) \u2014 The score attributed by the model for that label.</li>
</ul>
`}}),Ar=new q({}),Dr=new $({props:{name:"class transformers.ImageClassificationPipeline",anchor:"transformers.ImageClassificationPipeline",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ImageClassificationPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.ImageClassificationPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.ImageClassificationPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.ImageClassificationPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.ImageClassificationPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.ImageClassificationPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.ImageClassificationPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.ImageClassificationPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.ImageClassificationPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.ImageClassificationPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/image_classification.py#L32"}}),Xs=new D({props:{anchor:"transformers.ImageClassificationPipeline.example",$$slots:{default:[jI]},$$scope:{ctx:j}}}),Sr=new $({props:{name:"__call__",anchor:"transformers.ImageClassificationPipeline.__call__",parameters:[{name:"images",val:": typing.Union[str, typing.List[str], ForwardRef('Image.Image'), typing.List[ForwardRef('Image.Image')]]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ImageClassificationPipeline.__call__.images",description:`<strong>images</strong> (<code>str</code>, <code>List[str]</code>, <code>PIL.Image</code> or <code>List[PIL.Image]</code>) &#x2014;
The pipeline handles three types of images:</p>
<ul>
<li>A string containing a http link pointing to an image</li>
<li>A string containing a local path to an image</li>
<li>An image loaded in PIL directly</li>
</ul>
<p>The pipeline accepts either a single image or a batch of images, which must then be passed as a string.
Images in a batch must all be in the same format: all as http links, all as local paths, or all as PIL
images.`,name:"images"},{anchor:"transformers.ImageClassificationPipeline.__call__.top_k",description:`<strong>top_k</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
The number of top labels that will be returned by the pipeline. If the provided number is higher than
the number of labels available in the model configuration, it will default to the number of labels.`,name:"top_k"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/image_classification.py#L71",returnDescription:`
<p>A dictionary or a list of dictionaries containing result. If the input is a single image, will return a
dictionary, if the input is a list of several images, will return a list of dictionaries corresponding to
the images.</p>
<p>The dictionaries contain the following keys:</p>
<ul>
<li><strong>label</strong> (<code>str</code>) \u2014 The label identified by the model.</li>
<li><strong>score</strong> (<code>int</code>) \u2014 The score attributed by the model for that label.</li>
</ul>
`}}),Mr=new q({}),Fr=new $({props:{name:"class transformers.ImageSegmentationPipeline",anchor:"transformers.ImageSegmentationPipeline",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ImageSegmentationPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.ImageSegmentationPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.ImageSegmentationPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.ImageSegmentationPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.ImageSegmentationPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.ImageSegmentationPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.ImageSegmentationPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.ImageSegmentationPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.ImageSegmentationPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.ImageSegmentationPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/image_segmentation.py#L30"}}),tn=new D({props:{anchor:"transformers.ImageSegmentationPipeline.example",$$slots:{default:[EI]},$$scope:{ctx:j}}}),Ur=new $({props:{name:"__call__",anchor:"transformers.ImageSegmentationPipeline.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ImageSegmentationPipeline.__call__.images",description:`<strong>images</strong> (<code>str</code>, <code>List[str]</code>, <code>PIL.Image</code> or <code>List[PIL.Image]</code>) &#x2014;
The pipeline handles three types of images:</p>
<ul>
<li>A string containing an HTTP(S) link pointing to an image</li>
<li>A string containing a local path to an image</li>
<li>An image loaded in PIL directly</li>
</ul>
<p>The pipeline accepts either a single image or a batch of images. Images in a batch must all be in the
same format: all as HTTP(S) links, all as local paths, or all as PIL images.`,name:"images"},{anchor:"transformers.ImageSegmentationPipeline.__call__.subtask",description:`<strong>subtask</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Segmentation task to be performed, choose [<code>semantic</code>, <code>instance</code> and <code>panoptic</code>] depending on model
capabilities. If not set, the pipeline will attempt tp resolve in the following order:
<code>panoptic</code>, <code>instance</code>, <code>semantic</code>.`,name:"subtask"},{anchor:"transformers.ImageSegmentationPipeline.__call__.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.9) &#x2014;
Probability threshold to filter out predicted masks.`,name:"threshold"},{anchor:"transformers.ImageSegmentationPipeline.__call__.mask_threshold",description:`<strong>mask_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014;
Threshold to use when turning the predicted masks into binary values.`,name:"mask_threshold"},{anchor:"transformers.ImageSegmentationPipeline.__call__.overlap_mask_area_threshold",description:`<strong>overlap_mask_area_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014;
Mask overlap threshold to eliminate small, disconnected segments.`,name:"overlap_mask_area_threshold"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/image_segmentation.py#L94",returnDescription:`
<p>A dictionary or a list of dictionaries containing the result. If the input is a single image, will return a
list of dictionaries, if the input is a list of several images, will return a list of list of dictionaries
corresponding to each image.</p>
<p>The dictionaries contain the mask, label and score (where applicable) of each detected object and contains
the following keys:</p>
<ul>
<li><strong>label</strong> (<code>str</code>) \u2014 The class label identified by the model.</li>
<li><strong>mask</strong> (<code>PIL.Image</code>) \u2014 A binary mask of the detected object as a Pil Image of shape (width, height) of
the original image. Returns a mask filled with zeros if no object is found.</li>
<li><strong>score</strong> (<em>optional</em> <code>float</code>) \u2014 Optionally, when the model is capable of estimating a confidence of the
\u201Cobject\u201D described by the label and the mask.</li>
</ul>
`}}),Gr=new q({}),Rr=new $({props:{name:"class transformers.ObjectDetectionPipeline",anchor:"transformers.ObjectDetectionPipeline",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ObjectDetectionPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.ObjectDetectionPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.ObjectDetectionPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.ObjectDetectionPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.ObjectDetectionPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.ObjectDetectionPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.ObjectDetectionPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.ObjectDetectionPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.ObjectDetectionPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.ObjectDetectionPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/object_detection.py#L24"}}),an=new D({props:{anchor:"transformers.ObjectDetectionPipeline.example",$$slots:{default:[qI]},$$scope:{ctx:j}}}),Wr=new $({props:{name:"__call__",anchor:"transformers.ObjectDetectionPipeline.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ObjectDetectionPipeline.__call__.images",description:`<strong>images</strong> (<code>str</code>, <code>List[str]</code>, <code>PIL.Image</code> or <code>List[PIL.Image]</code>) &#x2014;
The pipeline handles three types of images:</p>
<ul>
<li>A string containing an HTTP(S) link pointing to an image</li>
<li>A string containing a local path to an image</li>
<li>An image loaded in PIL directly</li>
</ul>
<p>The pipeline accepts either a single image or a batch of images. Images in a batch must all be in the
same format: all as HTTP(S) links, all as local paths, or all as PIL images.`,name:"images"},{anchor:"transformers.ObjectDetectionPipeline.__call__.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.9) &#x2014;
The probability necessary to make a prediction.`,name:"threshold"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/object_detection.py#L66",returnDescription:`
<p>A list of dictionaries or a list of list of dictionaries containing the result. If the input is a single
image, will return a list of dictionaries, if the input is a list of several images, will return a list of
list of dictionaries corresponding to each image.</p>
<p>The dictionaries contain the following keys:</p>
<ul>
<li><strong>label</strong> (<code>str</code>) \u2014 The class label identified by the model.</li>
<li><strong>score</strong> (<code>float</code>) \u2014 The score attributed by the model for that label.</li>
<li><strong>box</strong> (<code>List[Dict[str, int]]</code>) \u2014 The bounding box of detected object in image\u2019s original size.</li>
</ul>
`}}),Br=new q({}),Zr=new $({props:{name:"class transformers.ZeroShotImageClassificationPipeline",anchor:"transformers.ZeroShotImageClassificationPipeline",parameters:[{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ZeroShotImageClassificationPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.ZeroShotImageClassificationPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.ZeroShotImageClassificationPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.ZeroShotImageClassificationPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.ZeroShotImageClassificationPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.ZeroShotImageClassificationPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.ZeroShotImageClassificationPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.ZeroShotImageClassificationPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.ZeroShotImageClassificationPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.ZeroShotImageClassificationPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/zero_shot_image_classification.py#L31"}}),ln=new D({props:{anchor:"transformers.ZeroShotImageClassificationPipeline.example",$$slots:{default:[AI]},$$scope:{ctx:j}}}),Xr=new $({props:{name:"__call__",anchor:"transformers.ZeroShotImageClassificationPipeline.__call__",parameters:[{name:"images",val:": typing.Union[str, typing.List[str], ForwardRef('Image'), typing.List[ForwardRef('Image')]]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ZeroShotImageClassificationPipeline.__call__.images",description:`<strong>images</strong> (<code>str</code>, <code>List[str]</code>, <code>PIL.Image</code> or <code>List[PIL.Image]</code>) &#x2014;
The pipeline handles three types of images:</p>
<ul>
<li>A string containing a http link pointing to an image</li>
<li>A string containing a local path to an image</li>
<li>An image loaded in PIL directly</li>
</ul>`,name:"images"},{anchor:"transformers.ZeroShotImageClassificationPipeline.__call__.candidate_labels",description:`<strong>candidate_labels</strong> (<code>List[str]</code>) &#x2014;
The candidate labels for this image`,name:"candidate_labels"},{anchor:"transformers.ZeroShotImageClassificationPipeline.__call__.hypothesis_template",description:`<strong>hypothesis_template</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;This is a photo of {}&quot;</code>) &#x2014;
The sentence used in cunjunction with <em>candidate_labels</em> to attempt the image classification by
replacing the placeholder with the candidate_labels. Then likelihood is estimated by using
logits_per_image`,name:"hypothesis_template"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/zero_shot_image_classification.py#L71",returnDescription:`
<p>A list of dictionaries containing result, one dictionnary per proposed label. The dictionaries contain the
following keys:</p>
<ul>
<li><strong>label</strong> (<code>str</code>) \u2014 The label identified by the model. It is one of the suggested <code>candidate_label</code>.</li>
<li><strong>score</strong> (<code>float</code>) \u2014 The score attributed by the model for that label (between 0 and 1).</li>
</ul>
`}}),Jr=new q({}),eo=new $({props:{name:"class transformers.ZeroShotObjectDetectionPipeline",anchor:"transformers.ZeroShotObjectDetectionPipeline",parameters:[{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ZeroShotObjectDetectionPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.ZeroShotObjectDetectionPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.ZeroShotObjectDetectionPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.ZeroShotObjectDetectionPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.ZeroShotObjectDetectionPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.ZeroShotObjectDetectionPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.ZeroShotObjectDetectionPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.ZeroShotObjectDetectionPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.ZeroShotObjectDetectionPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.ZeroShotObjectDetectionPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/zero_shot_object_detection.py#L23"}}),dn=new D({props:{anchor:"transformers.ZeroShotObjectDetectionPipeline.example",$$slots:{default:[DI]},$$scope:{ctx:j}}}),no=new $({props:{name:"__call__",anchor:"transformers.ZeroShotObjectDetectionPipeline.__call__",parameters:[{name:"image",val:": typing.Union[str, ForwardRef('Image.Image'), typing.List[typing.Dict[str, typing.Any]]]"},{name:"candidate_labels",val:": typing.Union[str, typing.List[str]] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ZeroShotObjectDetectionPipeline.__call__.image",description:`<strong>image</strong> (<code>str</code>, <code>PIL.Image</code> or <code>List[Dict[str, Any]]</code>) &#x2014;
The pipeline handles three types of images:</p>
<ul>
<li>A string containing an http url pointing to an image</li>
<li>A string containing a local path to an image</li>
<li>An image loaded in PIL directly</li>
</ul>
<p>You can use this parameter to send directly a list of images, or a dataset or a generator like so:`,name:"image"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/zero_shot_object_detection.py#L65",returnDescription:`
<p>A list of lists containing prediction results, one list per input image. Each list contains dictionaries
with the following keys:</p>
<ul>
<li><strong>label</strong> (<code>str</code>) \u2014 Text query corresponding to the found object.</li>
<li><strong>score</strong> (<code>float</code>) \u2014 Score corresponding to the object (between 0 and 1).</li>
<li><strong>box</strong> (<code>Dict[str,int]</code>) \u2014 Bounding box of the detected object in image\u2019s original size. It is a
dictionary with <code>x_min</code>, <code>x_max</code>, <code>y_min</code>, <code>y_max</code> keys.</li>
</ul>
`}}),ao=new q({}),ro=new q({}),oo=new $({props:{name:"class transformers.Conversation",anchor:"transformers.Conversation",parameters:[{name:"text",val:": str = None"},{name:"conversation_id",val:": UUID = None"},{name:"past_user_inputs",val:" = None"},{name:"generated_responses",val:" = None"}],parametersDescription:[{anchor:"transformers.Conversation.text",description:`<strong>text</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The initial user input to start the conversation. If not provided, a user input needs to be provided
manually using the <a href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.Conversation.add_user_input">add_user_input()</a> method before the conversation can begin.`,name:"text"},{anchor:"transformers.Conversation.conversation_id",description:`<strong>conversation_id</strong> (<code>uuid.UUID</code>, <em>optional</em>) &#x2014;
Unique identifier for the conversation. If not provided, a random UUID4 id will be assigned to the
conversation.`,name:"conversation_id"},{anchor:"transformers.Conversation.past_user_inputs",description:`<strong>past_user_inputs</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
Eventual past history of the conversation of the user. You don&#x2019;t need to pass it manually if you use the
pipeline interactively but if you want to recreate history you need to set both <code>past_user_inputs</code> and
<code>generated_responses</code> with equal length lists of strings`,name:"past_user_inputs"},{anchor:"transformers.Conversation.generated_responses",description:`<strong>generated_responses</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
Eventual past history of the conversation of the model. You don&#x2019;t need to pass it manually if you use the
pipeline interactively but if you want to recreate history you need to set both <code>past_user_inputs</code> and
<code>generated_responses</code> with equal length lists of strings`,name:"generated_responses"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/conversational.py#L18"}}),un=new D({props:{anchor:"transformers.Conversation.example",$$slots:{default:[CI]},$$scope:{ctx:j}}}),io=new $({props:{name:"add_user_input",anchor:"transformers.Conversation.add_user_input",parameters:[{name:"text",val:": str"},{name:"overwrite",val:": bool = False"}],parametersDescription:[{anchor:"transformers.Conversation.add_user_input.text",description:"<strong>text</strong> (<code>str</code>) &#x2014; The user input for the next conversation round.",name:"text"},{anchor:"transformers.Conversation.add_user_input.overwrite",description:`<strong>overwrite</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not existing and unprocessed user input should be overwritten when this function is called.`,name:"overwrite"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/conversational.py#L82"}}),po=new $({props:{name:"append_response",anchor:"transformers.Conversation.append_response",parameters:[{name:"response",val:": str"}],parametersDescription:[{anchor:"transformers.Conversation.append_response.response",description:"<strong>response</strong> (<code>str</code>) &#x2014; The model generated response.",name:"response"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/conversational.py#L115"}}),co=new $({props:{name:"iter_texts",anchor:"transformers.Conversation.iter_texts",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/conversational.py#L124"}}),mo=new $({props:{name:"mark_processed",anchor:"transformers.Conversation.mark_processed",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/conversational.py#L106"}}),ho=new $({props:{name:"class transformers.ConversationalPipeline",anchor:"transformers.ConversationalPipeline",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ConversationalPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.ConversationalPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.ConversationalPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.ConversationalPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.ConversationalPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.ConversationalPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.ConversationalPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.ConversationalPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.ConversationalPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.ConversationalPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"},{anchor:"transformers.ConversationalPipeline.min_length_for_response",description:`<strong>min_length_for_response</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The minimum length (in number of tokens) for a response.`,name:"min_length_for_response"},{anchor:"transformers.ConversationalPipeline.minimum_tokens",description:`<strong>minimum_tokens</strong> (<code>int</code>, <em>optional</em>, defaults to 10) &#x2014;
The minimum length of tokens to leave for a response.`,name:"minimum_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/conversational.py#L163"}}),vn=new D({props:{anchor:"transformers.ConversationalPipeline.example",$$slots:{default:[zI]},$$scope:{ctx:j}}}),uo=new $({props:{name:"__call__",anchor:"transformers.ConversationalPipeline.__call__",parameters:[{name:"conversations",val:": typing.Union[transformers.pipelines.conversational.Conversation, typing.List[transformers.pipelines.conversational.Conversation]]"},{name:"num_workers",val:" = 0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ConversationalPipeline.__call__.conversations",description:`<strong>conversations</strong> (a <a href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.Conversation">Conversation</a> or a list of <a href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.Conversation">Conversation</a>) &#x2014;
Conversations to generate responses for.`,name:"conversations"},{anchor:"transformers.ConversationalPipeline.__call__.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to clean up the potential extra spaces in the text output.
generate_kwargs &#x2014;
Additional keyword arguments to pass along to the generate method of the model (see the generate method
corresponding to your framework <a href="./model#generative-models">here</a>).`,name:"clean_up_tokenization_spaces"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/conversational.py#L222",returnDescription:`
<p>Conversation(s) with updated generated responses for those
containing a new user input.</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.Conversation"
>Conversation</a> or a list of <a
  href="/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.Conversation"
>Conversation</a></p>
`}}),go=new q({}),_o=new $({props:{name:"class transformers.FillMaskPipeline",anchor:"transformers.FillMaskPipeline",parameters:[{name:"model",val:": typing.Union[ForwardRef('PreTrainedModel'), ForwardRef('TFPreTrainedModel')]"},{name:"tokenizer",val:": typing.Optional[transformers.tokenization_utils.PreTrainedTokenizer] = None"},{name:"feature_extractor",val:": typing.Optional[ForwardRef('SequenceFeatureExtractor')] = None"},{name:"modelcard",val:": typing.Optional[transformers.modelcard.ModelCard] = None"},{name:"framework",val:": typing.Optional[str] = None"},{name:"task",val:": str = ''"},{name:"args_parser",val:": ArgumentHandler = None"},{name:"device",val:": typing.Union[int, str, ForwardRef('torch.device')] = -1"},{name:"binary_output",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FillMaskPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.FillMaskPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.FillMaskPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.FillMaskPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.FillMaskPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.FillMaskPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.FillMaskPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.FillMaskPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.FillMaskPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.FillMaskPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"},{anchor:"transformers.FillMaskPipeline.top_k",description:`<strong>top_k</strong> (<code>int</code>, defaults to 5) &#x2014;
The number of predictions to return.`,name:"top_k"},{anchor:"transformers.FillMaskPipeline.targets",description:`<strong>targets</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
When passed, the model will limit the scores to the passed targets instead of looking up in the whole
vocab. If the provided targets are not in the model vocab, they will be tokenized and the first resulting
token will be used (with a warning, and that might be slower).`,name:"targets"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/fill_mask.py#L34"}}),kn=new D({props:{anchor:"transformers.FillMaskPipeline.example",$$slots:{default:[II]},$$scope:{ctx:j}}}),yn=new gI({props:{$$slots:{default:[SI]},$$scope:{ctx:j}}}),wo=new $({props:{name:"__call__",anchor:"transformers.FillMaskPipeline.__call__",parameters:[{name:"inputs",val:""},{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FillMaskPipeline.__call__.args",description:`<strong>args</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
One or several texts (or one list of prompts) with masked tokens.`,name:"args"},{anchor:"transformers.FillMaskPipeline.__call__.targets",description:`<strong>targets</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
When passed, the model will limit the scores to the passed targets instead of looking up in the whole
vocab. If the provided targets are not in the model vocab, they will be tokenized and the first
resulting token will be used (with a warning, and that might be slower).`,name:"targets"},{anchor:"transformers.FillMaskPipeline.__call__.top_k",description:`<strong>top_k</strong> (<code>int</code>, <em>optional</em>) &#x2014;
When passed, overrides the number of predictions to return.`,name:"top_k"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/fill_mask.py#L217",returnDescription:`
<p>Each result comes as list of dictionaries with the following keys:</p>
<ul>
<li><strong>sequence</strong> (<code>str</code>) \u2014 The corresponding input with the mask token prediction.</li>
<li><strong>score</strong> (<code>float</code>) \u2014 The corresponding probability.</li>
<li><strong>token</strong> (<code>int</code>) \u2014 The predicted token id (to replace the masked one).</li>
<li><strong>token</strong> (<code>str</code>) \u2014 The predicted token (to replace the masked one).</li>
</ul>
`,returnType:`
<p>A list or a list of list of <code>dict</code></p>
`}}),xo=new q({}),ko=new $({props:{name:"class transformers.TokenClassificationPipeline",anchor:"transformers.TokenClassificationPipeline",parameters:[{name:"args_parser",val:" = <transformers.pipelines.token_classification.TokenClassificationArgumentHandler object at 0x7fe13c528bb0>"},{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TokenClassificationPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.TokenClassificationPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.TokenClassificationPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.TokenClassificationPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.TokenClassificationPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.TokenClassificationPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.TokenClassificationPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.TokenClassificationPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.TokenClassificationPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.TokenClassificationPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"},{anchor:"transformers.TokenClassificationPipeline.ignore_labels",description:`<strong>ignore_labels</strong> (<code>List[str]</code>, defaults to <code>[&quot;O&quot;]</code>) &#x2014;
A list of labels to ignore.`,name:"ignore_labels"},{anchor:"transformers.TokenClassificationPipeline.grouped_entities",description:`<strong>grouped_entities</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
DEPRECATED, use <code>aggregation_strategy</code> instead. Whether or not to group the tokens corresponding to the
same entity together in the predictions or not.`,name:"grouped_entities"},{anchor:"transformers.TokenClassificationPipeline.aggregation_strategy",description:`<strong>aggregation_strategy</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;none&quot;</code>) &#x2014;
The strategy to fuse (or not) tokens based on the model prediction.</p>
<ul>
<li>&#x201C;none&#x201D; : Will simply not do any aggregation and simply return raw results from the model</li>
<li>&#x201C;simple&#x201D; : Will attempt to group entities following the default schema. (A, B-TAG), (B, I-TAG), (C,
I-TAG), (D, B-TAG2) (E, B-TAG2) will end up being [{&#x201C;word&#x201D;: ABC, &#x201C;entity&#x201D;: &#x201C;TAG&#x201D;}, {&#x201C;word&#x201D;: &#x201C;D&#x201D;,
&#x201C;entity&#x201D;: &#x201C;TAG2&#x201D;}, {&#x201C;word&#x201D;: &#x201C;E&#x201D;, &#x201C;entity&#x201D;: &#x201C;TAG2&#x201D;}] Notice that two consecutive B tags will end up as
different entities. On word based languages, we might end up splitting words undesirably : Imagine
Microsoft being tagged as [{&#x201C;word&#x201D;: &#x201C;Micro&#x201D;, &#x201C;entity&#x201D;: &#x201C;ENTERPRISE&#x201D;}, {&#x201C;word&#x201D;: &#x201C;soft&#x201D;, &#x201C;entity&#x201D;:
&#x201C;NAME&#x201D;}]. Look for FIRST, MAX, AVERAGE for ways to mitigate that and disambiguate words (on languages
that support that meaning, which is basically tokens separated by a space). These mitigations will
only work on real words, &#x201C;New york&#x201D; might still be tagged with two different entities.</li>
<li>&#x201C;first&#x201D; : (works only on word based models) Will use the <code>SIMPLE</code> strategy except that words, cannot
end up with different tags. Words will simply use the tag of the first token of the word when there
is ambiguity.</li>
<li>&#x201C;average&#x201D; : (works only on word based models) Will use the <code>SIMPLE</code> strategy except that words,
cannot end up with different tags. scores will be averaged first across tokens, and then the maximum
label is applied.</li>
<li>&#x201C;max&#x201D; : (works only on word based models) Will use the <code>SIMPLE</code> strategy except that words, cannot
end up with different tags. Word entity will simply be the token with the maximum score.</li>
</ul>`,name:"aggregation_strategy"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/token_classification.py#L86"}}),$n=new D({props:{anchor:"transformers.TokenClassificationPipeline.example",$$slots:{default:[MI]},$$scope:{ctx:j}}}),To=new $({props:{name:"aggregate_words",anchor:"transformers.TokenClassificationPipeline.aggregate_words",parameters:[{name:"entities",val:": typing.List[dict]"},{name:"aggregation_strategy",val:": AggregationStrategy"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/token_classification.py#L393"}}),$o=new $({props:{name:"gather_pre_entities",anchor:"transformers.TokenClassificationPipeline.gather_pre_entities",parameters:[{name:"sentence",val:": str"},{name:"input_ids",val:": ndarray"},{name:"scores",val:": ndarray"},{name:"offset_mapping",val:": typing.Union[typing.List[typing.Tuple[int, int]], NoneType]"},{name:"special_tokens_mask",val:": ndarray"},{name:"aggregation_strategy",val:": AggregationStrategy"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/token_classification.py#L282"}}),jo=new $({props:{name:"group_entities",anchor:"transformers.TokenClassificationPipeline.group_entities",parameters:[{name:"entities",val:": typing.List[dict]"}],parametersDescription:[{anchor:"transformers.TokenClassificationPipeline.group_entities.entities",description:"<strong>entities</strong> (<code>dict</code>) &#x2014; The entities predicted by the pipeline.",name:"entities"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/token_classification.py#L455"}}),Eo=new $({props:{name:"group_sub_entities",anchor:"transformers.TokenClassificationPipeline.group_sub_entities",parameters:[{name:"entities",val:": typing.List[dict]"}],parametersDescription:[{anchor:"transformers.TokenClassificationPipeline.group_sub_entities.entities",description:"<strong>entities</strong> (<code>dict</code>) &#x2014; The entities predicted by the pipeline.",name:"entities"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/token_classification.py#L420"}}),qo=new q({}),Ao=new $({props:{name:"class transformers.QuestionAnsweringPipeline",anchor:"transformers.QuestionAnsweringPipeline",parameters:[{name:"model",val:": typing.Union[ForwardRef('PreTrainedModel'), ForwardRef('TFPreTrainedModel')]"},{name:"tokenizer",val:": PreTrainedTokenizer"},{name:"modelcard",val:": typing.Optional[transformers.modelcard.ModelCard] = None"},{name:"framework",val:": typing.Optional[str] = None"},{name:"device",val:": int = -1"},{name:"task",val:": str = ''"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.QuestionAnsweringPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.QuestionAnsweringPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.QuestionAnsweringPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.QuestionAnsweringPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.QuestionAnsweringPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.QuestionAnsweringPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.QuestionAnsweringPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.QuestionAnsweringPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.QuestionAnsweringPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.QuestionAnsweringPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/question_answering.py#L224"}}),Cn=new D({props:{anchor:"transformers.QuestionAnsweringPipeline.example",$$slots:{default:[FI]},$$scope:{ctx:j}}}),zo=new $({props:{name:"__call__",anchor:"transformers.QuestionAnsweringPipeline.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.QuestionAnsweringPipeline.__call__.args",description:`<strong>args</strong> (<code>SquadExample</code> or a list of <code>SquadExample</code>) &#x2014;
One or several <code>SquadExample</code> containing the question and context.`,name:"args"},{anchor:"transformers.QuestionAnsweringPipeline.__call__.X",description:`<strong>X</strong> (<code>SquadExample</code> or a list of <code>SquadExample</code>, <em>optional</em>) &#x2014;
One or several <code>SquadExample</code> containing the question and context (will be treated the same way as if
passed as the first positional argument).`,name:"X"},{anchor:"transformers.QuestionAnsweringPipeline.__call__.data",description:`<strong>data</strong> (<code>SquadExample</code> or a list of <code>SquadExample</code>, <em>optional</em>) &#x2014;
One or several <code>SquadExample</code> containing the question and context (will be treated the same way as if
passed as the first positional argument).`,name:"data"},{anchor:"transformers.QuestionAnsweringPipeline.__call__.question",description:`<strong>question</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
One or several question(s) (must be used in conjunction with the <code>context</code> argument).`,name:"question"},{anchor:"transformers.QuestionAnsweringPipeline.__call__.context",description:`<strong>context</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
One or several context(s) associated with the question(s) (must be used in conjunction with the
<code>question</code> argument).`,name:"context"},{anchor:"transformers.QuestionAnsweringPipeline.__call__.topk",description:`<strong>topk</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of answers to return (will be chosen by order of likelihood). Note that we return less than
topk answers if there are not enough options available within the context.`,name:"topk"},{anchor:"transformers.QuestionAnsweringPipeline.__call__.doc_stride",description:`<strong>doc_stride</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
If the context is too long to fit with the question for the model, it will be split in several chunks
with some overlap. This argument controls the size of that overlap.`,name:"doc_stride"},{anchor:"transformers.QuestionAnsweringPipeline.__call__.max_answer_len",description:`<strong>max_answer_len</strong> (<code>int</code>, <em>optional</em>, defaults to 15) &#x2014;
The maximum length of predicted answers (e.g., only answers with a shorter length are considered).`,name:"max_answer_len"},{anchor:"transformers.QuestionAnsweringPipeline.__call__.max_seq_len",description:`<strong>max_seq_len</strong> (<code>int</code>, <em>optional</em>, defaults to 384) &#x2014;
The maximum length of the total sentence (context + question) in tokens of each chunk passed to the
model. The context will be split in several chunks (using <code>doc_stride</code> as overlap) if needed.`,name:"max_seq_len"},{anchor:"transformers.QuestionAnsweringPipeline.__call__.max_question_len",description:`<strong>max_question_len</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
The maximum length of the question after tokenization. It will be truncated if needed.`,name:"max_question_len"},{anchor:"transformers.QuestionAnsweringPipeline.__call__.handle_impossible_answer",description:`<strong>handle_impossible_answer</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not we accept impossible as an answer.`,name:"handle_impossible_answer"},{anchor:"transformers.QuestionAnsweringPipeline.__call__.align_to_words",description:`<strong>align_to_words</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Attempts to align the answer to real words. Improves quality on space separated langages. Might hurt on
non-space-separated languages (like Japanese or Chinese)`,name:"align_to_words"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/question_answering.py#L342",returnDescription:`
<p>Each result comes as a dictionary with the following keys:</p>
<ul>
<li><strong>score</strong> (<code>float</code>) \u2014 The probability associated to the answer.</li>
<li><strong>start</strong> (<code>int</code>) \u2014 The character start index of the answer (in the tokenized version of the input).</li>
<li><strong>end</strong> (<code>int</code>) \u2014 The character end index of the answer (in the tokenized version of the input).</li>
<li><strong>answer</strong> (<code>str</code>) \u2014 The answer to the question.</li>
</ul>
`,returnType:`
<p>A <code>dict</code> or a list of <code>dict</code></p>
`}}),Io=new $({props:{name:"create_sample",anchor:"transformers.QuestionAnsweringPipeline.create_sample",parameters:[{name:"question",val:": typing.Union[str, typing.List[str]]"},{name:"context",val:": typing.Union[str, typing.List[str]]"}],parametersDescription:[{anchor:"transformers.QuestionAnsweringPipeline.create_sample.question",description:"<strong>question</strong> (<code>str</code> or <code>List[str]</code>) &#x2014; The question(s) asked.",name:"question"},{anchor:"transformers.QuestionAnsweringPipeline.create_sample.context",description:"<strong>context</strong> (<code>str</code> or <code>List[str]</code>) &#x2014; The context(s) in which we will look for the answer.",name:"context"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/question_answering.py#L277",returnDescription:`
<p>The corresponding <code>SquadExample</code> grouping question and context.</p>
`,returnType:`
<p>One or a list of <code>SquadExample</code></p>
`}}),So=new $({props:{name:"span_to_answer",anchor:"transformers.QuestionAnsweringPipeline.span_to_answer",parameters:[{name:"text",val:": str"},{name:"start",val:": int"},{name:"end",val:": int"}],parametersDescription:[{anchor:"transformers.QuestionAnsweringPipeline.span_to_answer.text",description:"<strong>text</strong> (<code>str</code>) &#x2014; The actual context to extract the answer from.",name:"text"},{anchor:"transformers.QuestionAnsweringPipeline.span_to_answer.start",description:"<strong>start</strong> (<code>int</code>) &#x2014; The answer starting token index.",name:"start"},{anchor:"transformers.QuestionAnsweringPipeline.span_to_answer.end",description:"<strong>end</strong> (<code>int</code>) &#x2014; The answer end token index.",name:"end"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/question_answering.py#L618",returnDescription:`
<p>str, \u2018start\u2019: int, \u2018end\u2019: int}\`</p>
`,returnType:`
<p>Dictionary like \`{\u2018answer\u2019</p>
`}}),Mo=new q({}),Fo=new $({props:{name:"class transformers.SummarizationPipeline",anchor:"transformers.SummarizationPipeline",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.SummarizationPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.SummarizationPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.SummarizationPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.SummarizationPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.SummarizationPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.SummarizationPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.SummarizationPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.SummarizationPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.SummarizationPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.SummarizationPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/text2text_generation.py#L213"}}),Mn=new D({props:{anchor:"transformers.SummarizationPipeline.example",$$slots:{default:[LI]},$$scope:{ctx:j}}}),No=new $({props:{name:"__call__",anchor:"transformers.SummarizationPipeline.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.SummarizationPipeline.__call__.documents",description:`<strong>documents</strong> (<em>str</em> or <code>List[str]</code>) &#x2014;
One or several articles (or one list of articles) to summarize.`,name:"documents"},{anchor:"transformers.SummarizationPipeline.__call__.return_text",description:`<strong>return_text</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to include the decoded texts in the outputs`,name:"return_text"},{anchor:"transformers.SummarizationPipeline.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to include the tensors of predictions (as token indices) in the outputs.`,name:"return_tensors"},{anchor:"transformers.SummarizationPipeline.__call__.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to clean up the potential extra spaces in the text output.
generate_kwargs &#x2014;
Additional keyword arguments to pass along to the generate method of the model (see the generate method
corresponding to your framework <a href="./model#generative-models">here</a>).`,name:"clean_up_tokenization_spaces"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/text2text_generation.py#L241",returnDescription:`
<p>Each result comes as a dictionary with the following keys:</p>
<ul>
<li><strong>summary_text</strong> (<code>str</code>, present when <code>return_text=True</code>) \u2014 The summary of the corresponding input.</li>
<li><strong>summary_token_ids</strong> (<code>torch.Tensor</code> or <code>tf.Tensor</code>, present when <code>return_tensors=True</code>) \u2014 The token
ids of the summary.</li>
</ul>
`,returnType:`
<p>A list or a list of list of <code>dict</code></p>
`}}),Uo=new q({}),Go=new $({props:{name:"class transformers.TableQuestionAnsweringPipeline",anchor:"transformers.TableQuestionAnsweringPipeline",parameters:[{name:"args_parser",val:" = <transformers.pipelines.table_question_answering.TableQuestionAnsweringArgumentHandler object at 0x7fe13c51d2e0>"},{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TableQuestionAnsweringPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.TableQuestionAnsweringPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.TableQuestionAnsweringPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.TableQuestionAnsweringPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.TableQuestionAnsweringPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.TableQuestionAnsweringPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.TableQuestionAnsweringPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.TableQuestionAnsweringPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.TableQuestionAnsweringPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.TableQuestionAnsweringPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/table_question_answering.py#L89"}}),On=new D({props:{anchor:"transformers.TableQuestionAnsweringPipeline.example",$$slots:{default:[OI]},$$scope:{ctx:j}}}),Vo=new $({props:{name:"__call__",anchor:"transformers.TableQuestionAnsweringPipeline.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TableQuestionAnsweringPipeline.__call__.table",description:`<strong>table</strong> (<code>pd.DataFrame</code> or <code>Dict</code>) &#x2014;
Pandas DataFrame or dictionary that will be converted to a DataFrame containing all the table values.
See above for an example of dictionary.`,name:"table"},{anchor:"transformers.TableQuestionAnsweringPipeline.__call__.query",description:`<strong>query</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
Query or list of queries that will be sent to the model alongside the table.`,name:"query"},{anchor:"transformers.TableQuestionAnsweringPipeline.__call__.sequential",description:`<strong>sequential</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to do inference sequentially or as a batch. Batching is faster, but models like SQA require the
inference to be done sequentially to extract relations within sequences, given their conversational
nature.`,name:"sequential"},{anchor:"transformers.TableQuestionAnsweringPipeline.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.25.1/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.TableQuestionAnsweringPipeline.__call__.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <code>TapasTruncationStrategy</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls truncation. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;drop_rows_to_fit&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code>
or to the maximum acceptable input length for the model if that argument is not provided. This will
truncate row by row, removing rows from the table.</li>
<li><code>False</code> or <code>&apos;do_not_truncate&apos;</code> (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).</li>
</ul>`,name:"truncation"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/table_question_answering.py#L274",returnDescription:`
<p>Each result is a dictionary with the following
keys:</p>
<ul>
<li><strong>answer</strong> (<code>str</code>) \u2014 The answer of the query given the table. If there is an aggregator, the answer will
be preceded by <code>AGGREGATOR &gt;</code>.</li>
<li><strong>coordinates</strong> (<code>List[Tuple[int, int]]</code>) \u2014 Coordinates of the cells of the answers.</li>
<li><strong>cells</strong> (<code>List[str]</code>) \u2014 List of strings made up of the answer cell values.</li>
<li><strong>aggregator</strong> (<code>str</code>) \u2014 If the model has an aggregator, this returns the aggregator.</li>
</ul>
`,returnType:`
<p>A dictionary or a list of dictionaries containing results</p>
`}}),Nn=new D({props:{anchor:"transformers.TableQuestionAnsweringPipeline.__call__.example",$$slots:{default:[NI]},$$scope:{ctx:j}}}),Un=new D({props:{anchor:"transformers.TableQuestionAnsweringPipeline.__call__.example-2",$$slots:{default:[UI]},$$scope:{ctx:j}}}),Bo=new q({}),Zo=new $({props:{name:"class transformers.TextClassificationPipeline",anchor:"transformers.TextClassificationPipeline",parameters:[{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TextClassificationPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.TextClassificationPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.TextClassificationPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.TextClassificationPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.TextClassificationPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.TextClassificationPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.TextClassificationPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.TextClassificationPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.TextClassificationPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.TextClassificationPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"},{anchor:"transformers.TextClassificationPipeline.return_all_scores",description:`<strong>return_all_scores</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to return all prediction scores or just the one of the predicted class.`,name:"return_all_scores"},{anchor:"transformers.TextClassificationPipeline.function_to_apply",description:`<strong>function_to_apply</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;default&quot;</code>) &#x2014;
The function to apply to the model outputs in order to retrieve the scores. Accepts four different values:</p>
<ul>
<li><code>&quot;default&quot;</code>: if the model has a single label, will apply the sigmoid function on the output. If the model
has several labels, will apply the softmax function on the output.</li>
<li><code>&quot;sigmoid&quot;</code>: Applies the sigmoid function on the output.</li>
<li><code>&quot;softmax&quot;</code>: Applies the softmax function on the output.</li>
<li><code>&quot;none&quot;</code>: Does not apply any function on the output.</li>
</ul>`,name:"function_to_apply"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/text_classification.py#L48"}}),Rn=new D({props:{anchor:"transformers.TextClassificationPipeline.example",$$slots:{default:[GI]},$$scope:{ctx:j}}}),Jo=new $({props:{name:"__call__",anchor:"transformers.TextClassificationPipeline.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TextClassificationPipeline.__call__.args",description:`<strong>args</strong> (<code>str</code> or <code>List[str]</code> or <code>Dict[str]</code>, or <code>List[Dict[str]]</code>) &#x2014;
One or several texts to classify. In order to use text pairs for your classification, you can send a
dictionnary containing <code>{&quot;text&quot;, &quot;text_pair&quot;}</code> keys, or a list of those.`,name:"args"},{anchor:"transformers.TextClassificationPipeline.__call__.top_k",description:`<strong>top_k</strong> (<code>int</code>, <em>optional</em>, defaults to <code>1</code>) &#x2014;
How many results to return.`,name:"top_k"},{anchor:"transformers.TextClassificationPipeline.__call__.function_to_apply",description:`<strong>function_to_apply</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;default&quot;</code>) &#x2014;
The function to apply to the model outputs in order to retrieve the scores. Accepts four different
values:</p>
<p>If this argument is not specified, then it will apply the following functions according to the number
of labels:</p>
<ul>
<li>If the model has a single label, will apply the sigmoid function on the output.</li>
<li>If the model has several labels, will apply the softmax function on the output.</li>
</ul>
<p>Possible values are:</p>
<ul>
<li><code>&quot;sigmoid&quot;</code>: Applies the sigmoid function on the output.</li>
<li><code>&quot;softmax&quot;</code>: Applies the softmax function on the output.</li>
<li><code>&quot;none&quot;</code>: Does not apply any function on the output.</li>
</ul>`,name:"function_to_apply"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/text_classification.py#L121",returnDescription:`
<p>Each result comes as list of dictionaries with the following keys:</p>
<ul>
<li><strong>label</strong> (<code>str</code>) \u2014 The label predicted.</li>
<li><strong>score</strong> (<code>float</code>) \u2014 The corresponding probability.</li>
</ul>
<p>If <code>top_k</code> is used, one such dictionary is returned per label.</p>
`,returnType:`
<p>A list or a list of list of <code>dict</code></p>
`}}),ei=new q({}),ti=new $({props:{name:"class transformers.TextGenerationPipeline",anchor:"transformers.TextGenerationPipeline",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TextGenerationPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.TextGenerationPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.TextGenerationPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.TextGenerationPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.TextGenerationPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.TextGenerationPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.TextGenerationPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.TextGenerationPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.TextGenerationPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.TextGenerationPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/text_generation.py#L21"}}),Vn=new D({props:{anchor:"transformers.TextGenerationPipeline.example",$$slots:{default:[RI]},$$scope:{ctx:j}}}),ri=new $({props:{name:"__call__",anchor:"transformers.TextGenerationPipeline.__call__",parameters:[{name:"text_inputs",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TextGenerationPipeline.__call__.args",description:`<strong>args</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
One or several prompts (or one list of prompts) to complete.`,name:"args"},{anchor:"transformers.TextGenerationPipeline.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to include the tensors of predictions (as token indices) in the outputs.`,name:"return_tensors"},{anchor:"transformers.TextGenerationPipeline.__call__.return_text",description:`<strong>return_text</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to include the decoded texts in the outputs.`,name:"return_text"},{anchor:"transformers.TextGenerationPipeline.__call__.return_full_text",description:`<strong>return_full_text</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to <code>False</code> only added text is returned, otherwise the full text is returned Only meaningful if
<em>return_text</em> is set to True.`,name:"return_full_text"},{anchor:"transformers.TextGenerationPipeline.__call__.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to clean up the potential extra spaces in the text output.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.TextGenerationPipeline.__call__.prefix",description:`<strong>prefix</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Prefix added to prompt.`,name:"prefix"},{anchor:"transformers.TextGenerationPipeline.__call__.handle_long_generation",description:`<strong>handle_long_generation</strong> (<code>str</code>, <em>optional</em>) &#x2014;
By default, this pipelines does not handle long generation (ones that exceed in one form or the other
the model maximum length). There is no perfect way to adress this (more info
:<a href="https://github.com/huggingface/transformers/issues/14033#issuecomment-948385227" rel="nofollow">https://github.com/huggingface/transformers/issues/14033#issuecomment-948385227</a>). This provides common
strategies to work around that problem depending on your use case.</p>
<ul>
<li><code>None</code> : default strategy where nothing in particular happens</li>
<li><code>&quot;hole&quot;</code>: Truncates left of input, and leaves a gap wide enough to let generation happen (might
truncate a lot of the prompt and not suitable when generation exceed the model capacity)</li>
</ul>
<p>generate_kwargs &#x2014;
Additional keyword arguments to pass along to the generate method of the model (see the generate method
corresponding to your framework <a href="./model#generative-models">here</a>).`,name:"handle_long_generation"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/text_generation.py#L163",returnDescription:`
<p>Each result comes as a dictionary with the following keys:</p>
<ul>
<li><strong>generated_text</strong> (<code>str</code>, present when <code>return_text=True</code>) \u2014 The generated text.</li>
<li><strong>generated_token_ids</strong> (<code>torch.Tensor</code> or <code>tf.Tensor</code>, present when <code>return_tensors=True</code>) \u2014 The token
ids of the generated text.</li>
</ul>
`,returnType:`
<p>A list or a list of list of <code>dict</code></p>
`}}),oi=new q({}),ii=new $({props:{name:"class transformers.Text2TextGenerationPipeline",anchor:"transformers.Text2TextGenerationPipeline",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Text2TextGenerationPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.Text2TextGenerationPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.Text2TextGenerationPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.Text2TextGenerationPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.Text2TextGenerationPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.Text2TextGenerationPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.Text2TextGenerationPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.Text2TextGenerationPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.Text2TextGenerationPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.Text2TextGenerationPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/text2text_generation.py#L26"}}),Zn=new D({props:{anchor:"transformers.Text2TextGenerationPipeline.example",$$slots:{default:[QI]},$$scope:{ctx:j}}}),Kn=new D({props:{anchor:"transformers.Text2TextGenerationPipeline.example-2",$$slots:{default:[HI]},$$scope:{ctx:j}}}),ci=new $({props:{name:"__call__",anchor:"transformers.Text2TextGenerationPipeline.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Text2TextGenerationPipeline.__call__.args",description:`<strong>args</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
Input text for the encoder.`,name:"args"},{anchor:"transformers.Text2TextGenerationPipeline.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to include the tensors of predictions (as token indices) in the outputs.`,name:"return_tensors"},{anchor:"transformers.Text2TextGenerationPipeline.__call__.return_text",description:`<strong>return_text</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to include the decoded texts in the outputs.`,name:"return_text"},{anchor:"transformers.Text2TextGenerationPipeline.__call__.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to clean up the potential extra spaces in the text output.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.Text2TextGenerationPipeline.__call__.truncation",description:`<strong>truncation</strong> (<code>TruncationStrategy</code>, <em>optional</em>, defaults to <code>TruncationStrategy.DO_NOT_TRUNCATE</code>) &#x2014;
The truncation strategy for the tokenization within the pipeline. <code>TruncationStrategy.DO_NOT_TRUNCATE</code>
(default) will never truncate, but it is sometimes desirable to truncate the input to fit the model&#x2019;s
max_length instead of throwing an error down the line.
generate_kwargs &#x2014;
Additional keyword arguments to pass along to the generate method of the model (see the generate method
corresponding to your framework <a href="./model#generative-models">here</a>).`,name:"truncation"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/text2text_generation.py#L136",returnDescription:`
<p>Each result comes as a dictionary with the following keys:</p>
<ul>
<li><strong>generated_text</strong> (<code>str</code>, present when <code>return_text=True</code>) \u2014 The generated text.</li>
<li><strong>generated_token_ids</strong> (<code>torch.Tensor</code> or <code>tf.Tensor</code>, present when <code>return_tensors=True</code>) \u2014 The token
ids of the generated text.</li>
</ul>
`,returnType:`
<p>A list or a list of list of <code>dict</code></p>
`}}),di=new $({props:{name:"check_inputs",anchor:"transformers.Text2TextGenerationPipeline.check_inputs",parameters:[{name:"input_length",val:": int"},{name:"min_length",val:": int"},{name:"max_length",val:": int"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/text2text_generation.py#L109"}}),mi=new q({}),hi=new $({props:{name:"class transformers.TokenClassificationPipeline",anchor:"transformers.TokenClassificationPipeline",parameters:[{name:"args_parser",val:" = <transformers.pipelines.token_classification.TokenClassificationArgumentHandler object at 0x7fe13c528bb0>"},{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TokenClassificationPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.TokenClassificationPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.TokenClassificationPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.TokenClassificationPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.TokenClassificationPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.TokenClassificationPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.TokenClassificationPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.TokenClassificationPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.TokenClassificationPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.TokenClassificationPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"},{anchor:"transformers.TokenClassificationPipeline.ignore_labels",description:`<strong>ignore_labels</strong> (<code>List[str]</code>, defaults to <code>[&quot;O&quot;]</code>) &#x2014;
A list of labels to ignore.`,name:"ignore_labels"},{anchor:"transformers.TokenClassificationPipeline.grouped_entities",description:`<strong>grouped_entities</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
DEPRECATED, use <code>aggregation_strategy</code> instead. Whether or not to group the tokens corresponding to the
same entity together in the predictions or not.`,name:"grouped_entities"},{anchor:"transformers.TokenClassificationPipeline.aggregation_strategy",description:`<strong>aggregation_strategy</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;none&quot;</code>) &#x2014;
The strategy to fuse (or not) tokens based on the model prediction.</p>
<ul>
<li>&#x201C;none&#x201D; : Will simply not do any aggregation and simply return raw results from the model</li>
<li>&#x201C;simple&#x201D; : Will attempt to group entities following the default schema. (A, B-TAG), (B, I-TAG), (C,
I-TAG), (D, B-TAG2) (E, B-TAG2) will end up being [{&#x201C;word&#x201D;: ABC, &#x201C;entity&#x201D;: &#x201C;TAG&#x201D;}, {&#x201C;word&#x201D;: &#x201C;D&#x201D;,
&#x201C;entity&#x201D;: &#x201C;TAG2&#x201D;}, {&#x201C;word&#x201D;: &#x201C;E&#x201D;, &#x201C;entity&#x201D;: &#x201C;TAG2&#x201D;}] Notice that two consecutive B tags will end up as
different entities. On word based languages, we might end up splitting words undesirably : Imagine
Microsoft being tagged as [{&#x201C;word&#x201D;: &#x201C;Micro&#x201D;, &#x201C;entity&#x201D;: &#x201C;ENTERPRISE&#x201D;}, {&#x201C;word&#x201D;: &#x201C;soft&#x201D;, &#x201C;entity&#x201D;:
&#x201C;NAME&#x201D;}]. Look for FIRST, MAX, AVERAGE for ways to mitigate that and disambiguate words (on languages
that support that meaning, which is basically tokens separated by a space). These mitigations will
only work on real words, &#x201C;New york&#x201D; might still be tagged with two different entities.</li>
<li>&#x201C;first&#x201D; : (works only on word based models) Will use the <code>SIMPLE</code> strategy except that words, cannot
end up with different tags. Words will simply use the tag of the first token of the word when there
is ambiguity.</li>
<li>&#x201C;average&#x201D; : (works only on word based models) Will use the <code>SIMPLE</code> strategy except that words,
cannot end up with different tags. scores will be averaged first across tokens, and then the maximum
label is applied.</li>
<li>&#x201C;max&#x201D; : (works only on word based models) Will use the <code>SIMPLE</code> strategy except that words, cannot
end up with different tags. Word entity will simply be the token with the maximum score.</li>
</ul>`,name:"aggregation_strategy"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/token_classification.py#L86"}}),ta=new D({props:{anchor:"transformers.TokenClassificationPipeline.example",$$slots:{default:[VI]},$$scope:{ctx:j}}}),gi=new $({props:{name:"__call__",anchor:"transformers.TokenClassificationPipeline.__call__",parameters:[{name:"inputs",val:": typing.Union[str, typing.List[str]]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TokenClassificationPipeline.__call__.inputs",description:`<strong>inputs</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
One or several texts (or one list of texts) for token classification.`,name:"inputs"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/token_classification.py#L186",returnDescription:`
<p>Each result comes as a list of dictionaries (one for each token in the
corresponding input, or each entity if this pipeline was instantiated with an aggregation_strategy) with
the following keys:</p>
<ul>
<li><strong>word</strong> (<code>str</code>) \u2014 The token/word classified. This is obtained by decoding the selected tokens. If you
want to have the exact string in the original sentence, use <code>start</code> and <code>end</code>.</li>
<li><strong>score</strong> (<code>float</code>) \u2014 The corresponding probability for <code>entity</code>.</li>
<li><strong>entity</strong> (<code>str</code>) \u2014 The entity predicted for that token/word (it is named <em>entity_group</em> when
<em>aggregation_strategy</em> is not <code>"none"</code>.</li>
<li><strong>index</strong> (<code>int</code>, only present when <code>aggregation_strategy="none"</code>) \u2014 The index of the corresponding
token in the sentence.</li>
<li><strong>start</strong> (<code>int</code>, <em>optional</em>) \u2014 The index of the start of the corresponding entity in the sentence. Only
exists if the offsets are available within the tokenizer</li>
<li><strong>end</strong> (<code>int</code>, <em>optional</em>) \u2014 The index of the end of the corresponding entity in the sentence. Only
exists if the offsets are available within the tokenizer</li>
</ul>
`,returnType:`
<p>A list or a list of list of <code>dict</code></p>
`}}),_i=new $({props:{name:"aggregate_words",anchor:"transformers.TokenClassificationPipeline.aggregate_words",parameters:[{name:"entities",val:": typing.List[dict]"},{name:"aggregation_strategy",val:": AggregationStrategy"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/token_classification.py#L393"}}),bi=new $({props:{name:"gather_pre_entities",anchor:"transformers.TokenClassificationPipeline.gather_pre_entities",parameters:[{name:"sentence",val:": str"},{name:"input_ids",val:": ndarray"},{name:"scores",val:": ndarray"},{name:"offset_mapping",val:": typing.Union[typing.List[typing.Tuple[int, int]], NoneType]"},{name:"special_tokens_mask",val:": ndarray"},{name:"aggregation_strategy",val:": AggregationStrategy"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/token_classification.py#L282"}}),vi=new $({props:{name:"group_entities",anchor:"transformers.TokenClassificationPipeline.group_entities",parameters:[{name:"entities",val:": typing.List[dict]"}],parametersDescription:[{anchor:"transformers.TokenClassificationPipeline.group_entities.entities",description:"<strong>entities</strong> (<code>dict</code>) &#x2014; The entities predicted by the pipeline.",name:"entities"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/token_classification.py#L455"}}),wi=new $({props:{name:"group_sub_entities",anchor:"transformers.TokenClassificationPipeline.group_sub_entities",parameters:[{name:"entities",val:": typing.List[dict]"}],parametersDescription:[{anchor:"transformers.TokenClassificationPipeline.group_sub_entities.entities",description:"<strong>entities</strong> (<code>dict</code>) &#x2014; The entities predicted by the pipeline.",name:"entities"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/token_classification.py#L420"}}),xi=new q({}),ki=new $({props:{name:"class transformers.TranslationPipeline",anchor:"transformers.TranslationPipeline",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TranslationPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.TranslationPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.TranslationPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.TranslationPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.TranslationPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.TranslationPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.TranslationPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.TranslationPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.TranslationPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.TranslationPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/text2text_generation.py#L282"}}),la=new D({props:{anchor:"transformers.TranslationPipeline.example",$$slots:{default:[WI]},$$scope:{ctx:j}}}),Ti=new $({props:{name:"__call__",anchor:"transformers.TranslationPipeline.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TranslationPipeline.__call__.args",description:`<strong>args</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
Texts to be translated.`,name:"args"},{anchor:"transformers.TranslationPipeline.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to include the tensors of predictions (as token indices) in the outputs.`,name:"return_tensors"},{anchor:"transformers.TranslationPipeline.__call__.return_text",description:`<strong>return_text</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to include the decoded texts in the outputs.`,name:"return_text"},{anchor:"transformers.TranslationPipeline.__call__.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to clean up the potential extra spaces in the text output.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.TranslationPipeline.__call__.src_lang",description:`<strong>src_lang</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The language of the input. Might be required for multilingual models. Will not have any effect for
single pair translation models`,name:"src_lang"},{anchor:"transformers.TranslationPipeline.__call__.tgt_lang",description:`<strong>tgt_lang</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The language of the desired output. Might be required for multilingual models. Will not have any effect
for single pair translation models
generate_kwargs &#x2014;
Additional keyword arguments to pass along to the generate method of the model (see the generate method
corresponding to your framework <a href="./model#generative-models">here</a>).`,name:"tgt_lang"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/text2text_generation.py#L336",returnDescription:`
<p>Each result comes as a dictionary with the following keys:</p>
<ul>
<li><strong>translation_text</strong> (<code>str</code>, present when <code>return_text=True</code>) \u2014 The translation.</li>
<li><strong>translation_token_ids</strong> (<code>torch.Tensor</code> or <code>tf.Tensor</code>, present when <code>return_tensors=True</code>) \u2014 The
token ids of the translation.</li>
</ul>
`,returnType:`
<p>A list or a list of list of <code>dict</code></p>
`}}),$i=new q({}),ji=new $({props:{name:"class transformers.ZeroShotClassificationPipeline",anchor:"transformers.ZeroShotClassificationPipeline",parameters:[{name:"args_parser",val:" = <transformers.pipelines.zero_shot_classification.ZeroShotClassificationArgumentHandler object at 0x7fe13c535820>"},{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ZeroShotClassificationPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.ZeroShotClassificationPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.ZeroShotClassificationPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.ZeroShotClassificationPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.ZeroShotClassificationPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.ZeroShotClassificationPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.ZeroShotClassificationPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.ZeroShotClassificationPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.ZeroShotClassificationPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.ZeroShotClassificationPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/zero_shot_classification.py#L46"}}),da=new D({props:{anchor:"transformers.ZeroShotClassificationPipeline.example",$$slots:{default:[BI]},$$scope:{ctx:j}}}),Ai=new $({props:{name:"__call__",anchor:"transformers.ZeroShotClassificationPipeline.__call__",parameters:[{name:"sequences",val:": typing.Union[str, typing.List[str]]"},{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ZeroShotClassificationPipeline.__call__.sequences",description:`<strong>sequences</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The sequence(s) to classify, will be truncated if the model input is too large.`,name:"sequences"},{anchor:"transformers.ZeroShotClassificationPipeline.__call__.candidate_labels",description:`<strong>candidate_labels</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The set of possible class labels to classify each sequence into. Can be a single label, a string of
comma-separated labels, or a list of labels.`,name:"candidate_labels"},{anchor:"transformers.ZeroShotClassificationPipeline.__call__.hypothesis_template",description:`<strong>hypothesis_template</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;This example is {}.&quot;</code>) &#x2014;
The template used to turn each label into an NLI-style hypothesis. This template must include a {} or
similar syntax for the candidate label to be inserted into the template. For example, the default
template is <code>&quot;This example is {}.&quot;</code> With the candidate label <code>&quot;sports&quot;</code>, this would be fed into the
model like <code>&quot;&lt;cls&gt; sequence to classify &lt;sep&gt; This example is sports . &lt;sep&gt;&quot;</code>. The default template
works well in many cases, but it may be worthwhile to experiment with different templates depending on
the task setting.`,name:"hypothesis_template"},{anchor:"transformers.ZeroShotClassificationPipeline.__call__.multi_label",description:`<strong>multi_label</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not multiple candidate labels can be true. If <code>False</code>, the scores are normalized such that
the sum of the label likelihoods for each sequence is 1. If <code>True</code>, the labels are considered
independent and probabilities are normalized for each candidate by doing a softmax of the entailment
score vs. the contradiction score.`,name:"multi_label"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/zero_shot_classification.py#L162",returnDescription:`
<p>Each result comes as a dictionary with the following keys:</p>
<ul>
<li><strong>sequence</strong> (<code>str</code>) \u2014 The sequence for which this is the output.</li>
<li><strong>labels</strong> (<code>List[str]</code>) \u2014 The labels sorted by order of likelihood.</li>
<li><strong>scores</strong> (<code>List[float]</code>) \u2014 The probabilities for each of the labels.</li>
</ul>
`,returnType:`
<p>A <code>dict</code> or a list of <code>dict</code></p>
`}}),Ci=new q({}),zi=new q({}),Ii=new $({props:{name:"class transformers.DocumentQuestionAnsweringPipeline",anchor:"transformers.DocumentQuestionAnsweringPipeline",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DocumentQuestionAnsweringPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.DocumentQuestionAnsweringPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.DocumentQuestionAnsweringPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.DocumentQuestionAnsweringPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.DocumentQuestionAnsweringPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.DocumentQuestionAnsweringPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.DocumentQuestionAnsweringPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.DocumentQuestionAnsweringPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.DocumentQuestionAnsweringPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.DocumentQuestionAnsweringPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/document_question_answering.py#L102"}}),ua=new D({props:{anchor:"transformers.DocumentQuestionAnsweringPipeline.example",$$slots:{default:[ZI]},$$scope:{ctx:j}}}),Li=new $({props:{name:"__call__",anchor:"transformers.DocumentQuestionAnsweringPipeline.__call__",parameters:[{name:"image",val:": typing.Union[ForwardRef('Image.Image'), str]"},{name:"question",val:": typing.Optional[str] = None"},{name:"word_boxes",val:": typing.Tuple[str, typing.List[float]] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DocumentQuestionAnsweringPipeline.__call__.image",description:`<strong>image</strong> (<code>str</code> or <code>PIL.Image</code>) &#x2014;
The pipeline handles three types of images:</p>
<ul>
<li>A string containing a http link pointing to an image</li>
<li>A string containing a local path to an image</li>
<li>An image loaded in PIL directly</li>
</ul>
<p>The pipeline accepts either a single image or a batch of images. If given a single image, it can be
broadcasted to multiple questions.`,name:"image"},{anchor:"transformers.DocumentQuestionAnsweringPipeline.__call__.question",description:`<strong>question</strong> (<code>str</code>) &#x2014;
A question to ask of the document.`,name:"question"},{anchor:"transformers.DocumentQuestionAnsweringPipeline.__call__.word_boxes",description:`<strong>word_boxes</strong> (<code>List[str, Tuple[float, float, float, float]]</code>, <em>optional</em>) &#x2014;
A list of words and bounding boxes (normalized 0-&gt;1000). If you provide this optional input, then the
pipeline will use these words and boxes instead of running OCR on the image to derive them for models
that need them (e.g. LayoutLM). This allows you to reuse OCR&#x2019;d results across many invocations of the
pipeline without having to re-run it each time.`,name:"word_boxes"},{anchor:"transformers.DocumentQuestionAnsweringPipeline.__call__.top_k",description:`<strong>top_k</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of answers to return (will be chosen by order of likelihood). Note that we return less than
top_k answers if there are not enough options available within the context.`,name:"top_k"},{anchor:"transformers.DocumentQuestionAnsweringPipeline.__call__.doc_stride",description:`<strong>doc_stride</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
If the words in the document are too long to fit with the question for the model, it will be split in
several chunks with some overlap. This argument controls the size of that overlap.`,name:"doc_stride"},{anchor:"transformers.DocumentQuestionAnsweringPipeline.__call__.max_answer_len",description:`<strong>max_answer_len</strong> (<code>int</code>, <em>optional</em>, defaults to 15) &#x2014;
The maximum length of predicted answers (e.g., only answers with a shorter length are considered).`,name:"max_answer_len"},{anchor:"transformers.DocumentQuestionAnsweringPipeline.__call__.max_seq_len",description:`<strong>max_seq_len</strong> (<code>int</code>, <em>optional</em>, defaults to 384) &#x2014;
The maximum length of the total sentence (context + question) in tokens of each chunk passed to the
model. The context will be split in several chunks (using <code>doc_stride</code> as overlap) if needed.`,name:"max_seq_len"},{anchor:"transformers.DocumentQuestionAnsweringPipeline.__call__.max_question_len",description:`<strong>max_question_len</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
The maximum length of the question after tokenization. It will be truncated if needed.`,name:"max_question_len"},{anchor:"transformers.DocumentQuestionAnsweringPipeline.__call__.handle_impossible_answer",description:`<strong>handle_impossible_answer</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not we accept impossible as an answer.`,name:"handle_impossible_answer"},{anchor:"transformers.DocumentQuestionAnsweringPipeline.__call__.lang",description:`<strong>lang</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Language to use while running OCR. Defaults to english.`,name:"lang"},{anchor:"transformers.DocumentQuestionAnsweringPipeline.__call__.tesseract_config",description:`<strong>tesseract_config</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Additional flags to pass to tesseract while running OCR.`,name:"tesseract_config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/document_question_answering.py#L186",returnDescription:`
<p>Each result comes as a dictionary with the following keys:</p>
<ul>
<li><strong>score</strong> (<code>float</code>) \u2014 The probability associated to the answer.</li>
<li><strong>start</strong> (<code>int</code>) \u2014 The start word index of the answer (in the OCR\u2019d version of the input or provided
<code>word_boxes</code>).</li>
<li><strong>end</strong> (<code>int</code>) \u2014 The end word index of the answer (in the OCR\u2019d version of the input or provided
<code>word_boxes</code>).</li>
<li><strong>answer</strong> (<code>str</code>) \u2014 The answer to the question.</li>
<li><strong>words</strong> (<code>list[int]</code>) \u2014 The index of each word/box pair that is in the answer</li>
</ul>
`,returnType:`
<p>A <code>dict</code> or a list of <code>dict</code></p>
`}}),Ni=new q({}),Ui=new $({props:{name:"class transformers.FeatureExtractionPipeline",anchor:"transformers.FeatureExtractionPipeline",parameters:[{name:"model",val:": typing.Union[ForwardRef('PreTrainedModel'), ForwardRef('TFPreTrainedModel')]"},{name:"tokenizer",val:": typing.Optional[transformers.tokenization_utils.PreTrainedTokenizer] = None"},{name:"feature_extractor",val:": typing.Optional[ForwardRef('SequenceFeatureExtractor')] = None"},{name:"modelcard",val:": typing.Optional[transformers.modelcard.ModelCard] = None"},{name:"framework",val:": typing.Optional[str] = None"},{name:"task",val:": str = ''"},{name:"args_parser",val:": ArgumentHandler = None"},{name:"device",val:": typing.Union[int, str, ForwardRef('torch.device')] = -1"},{name:"binary_output",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FeatureExtractionPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.FeatureExtractionPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.FeatureExtractionPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.FeatureExtractionPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.FeatureExtractionPipeline.return_tensor",description:`<strong>return_tensor</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If <code>True</code>, returns a tensor according to the specified framework, otherwise returns a list.`,name:"return_tensor"},{anchor:"transformers.FeatureExtractionPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.FeatureExtractionPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.FeatureExtractionPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id.`,name:"device"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/feature_extraction.py#L7"}}),_a=new D({props:{anchor:"transformers.FeatureExtractionPipeline.example",$$slots:{default:[YI]},$$scope:{ctx:j}}}),Qi=new $({props:{name:"__call__",anchor:"transformers.FeatureExtractionPipeline.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FeatureExtractionPipeline.__call__.args",description:"<strong>args</strong> (<code>str</code> or <code>List[str]</code>) &#x2014; One or several texts (or one list of texts) to get the features of.",name:"args"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/feature_extraction.py#L95",returnDescription:`
<p>The features computed by the model.</p>
`,returnType:`
<p>A nested list of <code>float</code></p>
`}}),Hi=new q({}),Vi=new $({props:{name:"class transformers.ImageToTextPipeline",anchor:"transformers.ImageToTextPipeline",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ImageToTextPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.ImageToTextPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.ImageToTextPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.ImageToTextPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.ImageToTextPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.ImageToTextPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.ImageToTextPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.ImageToTextPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.ImageToTextPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.ImageToTextPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/image_to_text.py#L29"}}),wa=new D({props:{anchor:"transformers.ImageToTextPipeline.example",$$slots:{default:[KI]},$$scope:{ctx:j}}}),Yi=new $({props:{name:"__call__",anchor:"transformers.ImageToTextPipeline.__call__",parameters:[{name:"images",val:": typing.Union[str, typing.List[str], ForwardRef('Image.Image'), typing.List[ForwardRef('Image.Image')]]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ImageToTextPipeline.__call__.images",description:`<strong>images</strong> (<code>str</code>, <code>List[str]</code>, <code>PIL.Image</code> or <code>List[PIL.Image]</code>) &#x2014;
The pipeline handles three types of images:</p>
<ul>
<li>A string containing a HTTP(s) link pointing to an image</li>
<li>A string containing a local path to an image</li>
<li>An image loaded in PIL directly</li>
</ul>
<p>The pipeline accepts either a single image or a batch of images.`,name:"images"},{anchor:"transformers.ImageToTextPipeline.__call__.max_new_tokens",description:`<strong>max_new_tokens</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The amount of maximum tokens to generate. By default it will use <code>generate</code> default.`,name:"max_new_tokens"},{anchor:"transformers.ImageToTextPipeline.__call__.generate_kwargs",description:`<strong>generate_kwargs</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
Pass it to send all of these arguments directly to <code>generate</code> allowing full control of this function.`,name:"generate_kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/image_to_text.py#L74",returnDescription:`
<p>Each result comes as a dictionary with the following key:</p>
<ul>
<li><strong>generated_text</strong> (<code>str</code>) \u2014 The generated text.</li>
</ul>
`,returnType:`
<p>A list or a list of list of <code>dict</code></p>
`}}),Ki=new q({}),Xi=new $({props:{name:"class transformers.VisualQuestionAnsweringPipeline",anchor:"transformers.VisualQuestionAnsweringPipeline",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.VisualQuestionAnsweringPipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.VisualQuestionAnsweringPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.VisualQuestionAnsweringPipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.VisualQuestionAnsweringPipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.VisualQuestionAnsweringPipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.VisualQuestionAnsweringPipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.VisualQuestionAnsweringPipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.VisualQuestionAnsweringPipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.VisualQuestionAnsweringPipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.VisualQuestionAnsweringPipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/visual_question_answering.py#L19"}}),ya=new D({props:{anchor:"transformers.VisualQuestionAnsweringPipeline.example",$$slots:{default:[XI]},$$scope:{ctx:j}}}),sl=new $({props:{name:"__call__",anchor:"transformers.VisualQuestionAnsweringPipeline.__call__",parameters:[{name:"image",val:": typing.Union[ForwardRef('Image.Image'), str]"},{name:"question",val:": str = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.VisualQuestionAnsweringPipeline.__call__.image",description:`<strong>image</strong> (<code>str</code>, <code>List[str]</code>, <code>PIL.Image</code> or <code>List[PIL.Image]</code>) &#x2014;
The pipeline handles three types of images:</p>
<ul>
<li>A string containing a http link pointing to an image</li>
<li>A string containing a local path to an image</li>
<li>An image loaded in PIL directly</li>
</ul>
<p>The pipeline accepts either a single image or a batch of images. If given a single image, it can be
broadcasted to multiple questions.`,name:"image"},{anchor:"transformers.VisualQuestionAnsweringPipeline.__call__.question",description:`<strong>question</strong> (<code>str</code>, <code>List[str]</code>) &#x2014;
The question(s) asked. If given a single question, it can be broadcasted to multiple images.`,name:"question"},{anchor:"transformers.VisualQuestionAnsweringPipeline.__call__.top_k",description:`<strong>top_k</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
The number of top labels that will be returned by the pipeline. If the provided number is higher than
the number of labels available in the model configuration, it will default to the number of labels.`,name:"top_k"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/visual_question_answering.py#L68",returnDescription:`
<ul>
<li><strong>label</strong> (<code>str</code>) \u2014 The label identified by the model.</li>
<li><strong>score</strong> (<code>int</code>) \u2014 The score attributed by the model for that label.</li>
</ul>
`,returnType:`
<p>A dictionary or a list of dictionaries containing the result. The dictionaries contain the following keys</p>
`}}),nl=new q({}),al=new $({props:{name:"class transformers.Pipeline",anchor:"transformers.Pipeline",parameters:[{name:"model",val:": typing.Union[ForwardRef('PreTrainedModel'), ForwardRef('TFPreTrainedModel')]"},{name:"tokenizer",val:": typing.Optional[transformers.tokenization_utils.PreTrainedTokenizer] = None"},{name:"feature_extractor",val:": typing.Optional[ForwardRef('SequenceFeatureExtractor')] = None"},{name:"modelcard",val:": typing.Optional[transformers.modelcard.ModelCard] = None"},{name:"framework",val:": typing.Optional[str] = None"},{name:"task",val:": str = ''"},{name:"args_parser",val:": ArgumentHandler = None"},{name:"device",val:": typing.Union[int, str, ForwardRef('torch.device')] = -1"},{name:"binary_output",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Pipeline.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a>) &#x2014;
The model that will be used by the pipeline to make predictions. This needs to be a model inheriting from
<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> for PyTorch and <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</a> for TensorFlow.`,name:"model"},{anchor:"transformers.Pipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer that will be used by the pipeline to encode data for the model. This object inherits from
<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.Pipeline.modelcard",description:`<strong>modelcard</strong> (<code>str</code> or <code>ModelCard</code>, <em>optional</em>) &#x2014;
Model card attributed to the model for this pipeline.`,name:"modelcard"},{anchor:"transformers.Pipeline.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The framework to use, either <code>&quot;pt&quot;</code> for PyTorch or <code>&quot;tf&quot;</code> for TensorFlow. The specified framework must be
installed.</p>
<p>If no framework is specified, will default to the one currently installed. If no framework is specified and
both frameworks are installed, will default to the framework of the <code>model</code>, or to PyTorch if no model is
provided.`,name:"framework"},{anchor:"transformers.Pipeline.task",description:`<strong>task</strong> (<code>str</code>, defaults to <code>&quot;&quot;</code>) &#x2014;
A task-identifier for the pipeline.`,name:"task"},{anchor:"transformers.Pipeline.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the number of
workers to be used.`,name:"num_workers"},{anchor:"transformers.Pipeline.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
When the pipeline will use <em>DataLoader</em> (when passing a dataset, on GPU for a Pytorch model), the size of
the batch to use, for inference this is not always beneficial, please read <a href="https://huggingface.co/transformers/main_classes/pipelines.html#pipeline-batching" rel="nofollow">Batching with
pipelines</a> .`,name:"batch_size"},{anchor:"transformers.Pipeline.args_parser",description:`<strong>args_parser</strong> (<a href="/docs/transformers/v4.25.1/en/internal/pipelines_utils#transformers.pipelines.ArgumentHandler">ArgumentHandler</a>, <em>optional</em>) &#x2014;
Reference to the object in charge of parsing supplied pipeline parameters.`,name:"args_parser"},{anchor:"transformers.Pipeline.device",description:`<strong>device</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run the model on
the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"},{anchor:"transformers.Pipeline.binary_output",description:`<strong>binary_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating if the output the pipeline should happen in a binary format (i.e., pickle) or as raw text.`,name:"binary_output"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/base.py#L722"}}),rl=new $({props:{name:"check_model_type",anchor:"transformers.Pipeline.check_model_type",parameters:[{name:"supported_models",val:": typing.Union[typing.List[str], dict]"}],parametersDescription:[{anchor:"transformers.Pipeline.check_model_type.supported_models",description:`<strong>supported_models</strong> (<code>List[str]</code> or <code>dict</code>) &#x2014;
The list of models supported by the pipeline, or a dictionary with model class values.`,name:"supported_models"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/base.py#L907"}}),ol=new $({props:{name:"device_placement",anchor:"transformers.Pipeline.device_placement",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/base.py#L847",returnDescription:`
<p>Context manager</p>
`}}),$a=new D({props:{anchor:"transformers.Pipeline.device_placement.example",$$slots:{default:[JI]},$$scope:{ctx:j}}}),il=new $({props:{name:"ensure_tensor_on_device",anchor:"transformers.Pipeline.ensure_tensor_on_device",parameters:[{name:"**inputs",val:""}],parametersDescription:[{anchor:"transformers.Pipeline.ensure_tensor_on_device.inputs",description:`<strong>inputs</strong> (keyword arguments that should be <code>torch.Tensor</code>, the rest is ignored) &#x2014;
The tensors to place on <code>self.device</code>.`,name:"inputs"},{anchor:"transformers.Pipeline.ensure_tensor_on_device.Recursive",description:"<strong>Recursive</strong> on lists <strong>only</strong>. &#x2014;",name:"Recursive"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/base.py#L873",returnDescription:`
<p>The same as <code>inputs</code> but on the proper device.</p>
`,returnType:`
<p><code>Dict[str, torch.Tensor]</code></p>
`}}),ll=new $({props:{name:"postprocess",anchor:"transformers.Pipeline.postprocess",parameters:[{name:"model_outputs",val:": ModelOutput"},{name:"**postprocess_parameters",val:": typing.Dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/base.py#L964"}}),cl=new $({props:{name:"predict",anchor:"transformers.Pipeline.predict",parameters:[{name:"X",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/base.py#L841"}}),ml=new $({props:{name:"preprocess",anchor:"transformers.Pipeline.preprocess",parameters:[{name:"input_",val:": typing.Any"},{name:"**preprocess_parameters",val:": typing.Dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/base.py#L943"}}),hl=new $({props:{name:"save_pretrained",anchor:"transformers.Pipeline.save_pretrained",parameters:[{name:"save_directory",val:": str"}],parametersDescription:[{anchor:"transformers.Pipeline.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code>) &#x2014;
A path to the directory where to saved. It will be created if it doesn&#x2019;t exist.`,name:"save_directory"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/base.py#L790"}}),fl=new $({props:{name:"transform",anchor:"transformers.Pipeline.transform",parameters:[{name:"X",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/pipelines/base.py#L835"}}),{c(){u=n("meta"),T=p(),y=n("h1"),f=n("a"),P=n("span"),_(l.$$.fragment),g=p(),He=n("span"),Ev=o("Pipelines"),wg=p(),Ps=n("p"),qv=o(`The pipelines are a great and easy way to use models for inference. These pipelines are objects that abstract most of
the complex code from the library, offering a simple API dedicated to several tasks, including Named Entity
Recognition, Masked Language Modeling, Sentiment Analysis, Feature Extraction and Question Answering. See the
`),jl=n("a"),Av=o("task summary"),Dv=o(" for examples of use."),xg=p(),El=n("p"),Cv=o("There are two categories of pipeline abstractions to be aware about:"),kg=p(),Ts=n("ul"),Na=n("li"),zv=o("The "),ql=n("a"),Iv=o("pipeline()"),Sv=o(" which is the most powerful object encapsulating all other pipelines."),Mv=p(),Ie=n("li"),Fv=o("Task-specific pipelines are available for "),Al=n("a"),Lv=o("audio"),Ov=o(", "),Dl=n("a"),Nv=o("computer vision"),Uv=o(", "),Cl=n("a"),Gv=o("natural language processing"),Rv=o(", and "),zl=n("a"),Qv=o("multimodal"),Hv=o(" tasks."),yg=p(),dt=n("h2"),$s=n("a"),cd=n("span"),_(Ua.$$.fragment),Vv=p(),dd=n("span"),Wv=o("The pipeline abstraction"),Pg=p(),js=n("p"),Bv=o("The "),md=n("em"),Zv=o("pipeline"),Yv=o(` abstraction is a wrapper around all the other available pipelines. It is instantiated as any other
pipeline but can provide additional quality of life.`),Tg=p(),Il=n("p"),Kv=o("Simple call on one item:"),$g=p(),_(Ga.$$.fragment),jg=p(),Es=n("p"),Xv=o("If you want to use a specific model from the "),Ra=n("a"),Jv=o("hub"),ew=o(` you can ignore the task if the model on
the hub already defines it:`),Eg=p(),_(Qa.$$.fragment),qg=p(),qs=n("p"),tw=o("To call a pipeline on many items, you can either call with a "),hd=n("em"),sw=o("list"),nw=o("."),Ag=p(),_(Ha.$$.fragment),Dg=p(),As=n("p"),aw=o("To iterate of full datasets it is recommended to use a "),fd=n("code"),rw=o("dataset"),ow=o(` directly. This means you don\u2019t need to allocate
the whole dataset at once, nor do you need to do batching yourself. This should work just as fast as custom loops on
GPU. If it doesn\u2019t don\u2019t hesitate to create an issue.`),Cg=p(),_(Va.$$.fragment),zg=p(),Sl=n("p"),iw=o("For ease of use, a generator is also possible:"),Ig=p(),_(Wa.$$.fragment),Sg=p(),ge=n("div"),_(Ba.$$.fragment),lw=p(),Za=n("p"),pw=o("Utility factory method to build a "),Ml=n("a"),cw=o("Pipeline"),dw=o("."),mw=p(),ud=n("p"),hw=o("Pipelines are made of:"),fw=p(),mt=n("ul"),Ya=n("li"),uw=o("A "),Fl=n("a"),gw=o("tokenizer"),_w=o(" in charge of mapping raw textual input to token."),bw=p(),Ka=n("li"),vw=o("A "),Ll=n("a"),ww=o("model"),xw=o(" to make predictions from the inputs."),kw=p(),gd=n("li"),yw=o("Some (optional) post processing for enhancing model\u2019s output."),Pw=p(),_(Ds.$$.fragment),Mg=p(),ht=n("h2"),Cs=n("a"),_d=n("span"),_(Xa.$$.fragment),Tw=p(),bd=n("span"),$w=o("Pipeline batching"),Fg=p(),Je=n("p"),jw=o(`All pipelines can use batching. This will work
whenever the pipeline uses its streaming ability (so when passing lists or `),vd=n("code"),Ew=o("Dataset"),qw=o(" or "),wd=n("code"),Aw=o("generator"),Dw=o(")."),Lg=p(),_(Ja.$$.fragment),Og=p(),_(zs.$$.fragment),Ng=p(),_(er.$$.fragment),Ug=p(),_(tr.$$.fragment),Gg=p(),Ol=n("p"),Cw=o("Example where it\u2019s most a slowdown:"),Rg=p(),_(sr.$$.fragment),Qg=p(),Is=n("p"),zw=o("This is a occasional very long sentence compared to the other. In that case, the "),xd=n("strong"),Iw=o("whole"),Sw=o(` batch will need to be 400
tokens long, so the whole batch will be [64, 400] instead of [64, 4], leading to the high slowdown. Even worse, on
bigger batches, the program simply crashes.`),Hg=p(),_(nr.$$.fragment),Vg=p(),Nl=n("p"),Mw=o(`There are no good (general) solutions for this problem, and your mileage may vary depending on your use cases. Rule of
thumb:`),Wg=p(),Ul=n("p"),Fw=o("For users, a rule of thumb is:"),Bg=p(),_e=n("ul"),kd=n("li"),yd=n("p"),Pd=n("strong"),Lw=o(`Measure performance on your load, with your hardware. Measure, measure, and keep measuring. Real numbers are the
only way to go.`),Ow=p(),Td=n("li"),$d=n("p"),Nw=o("If you are latency constrained (live product doing inference), don\u2019t batch"),Uw=p(),jd=n("li"),Ed=n("p"),Gw=o("If you are using CPU, don\u2019t batch."),Rw=p(),ar=n("li"),qd=n("p"),Qw=o("If you are using throughput (you want to run your model on a bunch of static data), on GPU, then:"),Hw=p(),ft=n("ul"),Ad=n("li"),Vw=o(`If you have no clue about the size of the sequence_length (\u201Cnatural\u201D data), by default don\u2019t batch, measure and
try tentatively to add it, add OOM checks to recover when it will fail (and it will at some point if you don\u2019t
control the sequence_length.)`),Ww=p(),Dd=n("li"),Bw=o(`If your sequence_length is super regular, then batching is more likely to be VERY interesting, measure and push
it until you get OOMs.`),Zw=p(),Cd=n("li"),Yw=o("The larger the GPU the more likely batching is going to be more interesting"),Kw=p(),zd=n("li"),Id=n("p"),Xw=o("As soon as you enable batching, make sure you can handle OOMs nicely."),Zg=p(),ut=n("h2"),Ss=n("a"),Sd=n("span"),_(rr.$$.fragment),Jw=p(),Md=n("span"),ex=o("Pipeline chunk batching"),Yg=p(),Ve=n("p"),Fd=n("code"),tx=o("zero-shot-classification"),sx=o(" and "),Ld=n("code"),nx=o("question-answering"),ax=o(` are slightly specific in the sense, that a single input might yield
multiple forward pass of a model. Under normal circumstances, this would yield issues with `),Od=n("code"),rx=o("batch_size"),ox=o(" argument."),Kg=p(),et=n("p"),ix=o("In order to circumvent this issue, both of these pipelines are a bit specific, they are "),Nd=n("code"),lx=o("ChunkPipeline"),px=o(` instead of
regular `),Ud=n("code"),cx=o("Pipeline"),dx=o(". In short:"),Xg=p(),_(or.$$.fragment),Jg=p(),Gl=n("p"),mx=o("Now becomes:"),e_=p(),_(ir.$$.fragment),t_=p(),Rl=n("p"),hx=o(`This should be very transparent to your code because the pipelines are used in
the same way.`),s_=p(),Ms=n("p"),fx=o(`This is a simplified view, since the pipeline can handle automatically the batch to ! Meaning you don\u2019t have to care
about how many forward passes you inputs are actually going to trigger, you can optimize the `),Gd=n("code"),ux=o("batch_size"),gx=o(`
independently of the inputs. The caveats from the previous section still apply.`),n_=p(),gt=n("h2"),Fs=n("a"),Rd=n("span"),_(lr.$$.fragment),_x=p(),Qd=n("span"),bx=o("Pipeline custom code"),a_=p(),Ql=n("p"),vx=o("If you want to override a specific pipeline."),r_=p(),Ls=n("p"),wx=o(`Don\u2019t hesitate to create an issue for your task at hand, the goal of the pipeline is to be easy to use and support most
cases, so `),Hd=n("code"),xx=o("transformers"),kx=o(" could maybe support your use case."),o_=p(),Hl=n("p"),yx=o("If you want to try simply you can:"),i_=p(),Vl=n("ul"),Vd=n("li"),Px=o("Subclass your pipeline of choice"),l_=p(),_(pr.$$.fragment),p_=p(),Wl=n("p"),Tx=o("That should enable you to do all the custom code you want."),c_=p(),_t=n("h2"),Os=n("a"),Wd=n("span"),_(cr.$$.fragment),$x=p(),Bd=n("span"),jx=o("Implementing a pipeline"),d_=p(),Bl=n("p"),Zl=n("a"),Ex=o("Implementing a new pipeline"),m_=p(),bt=n("h2"),Ns=n("a"),Zd=n("span"),_(dr.$$.fragment),qx=p(),Yd=n("span"),Ax=o("Audio"),h_=p(),Yl=n("p"),Dx=o("Pipelines available for audio tasks include the following."),f_=p(),vt=n("h3"),Us=n("a"),Kd=n("span"),_(mr.$$.fragment),Cx=p(),Xd=n("span"),zx=o("AudioClassificationPipeline"),u_=p(),Q=n("div"),_(hr.$$.fragment),Ix=p(),fr=n("p"),Sx=o("Audio classification pipeline using any "),Jd=n("code"),Mx=o("AutoModelForAudioClassification"),Fx=o(`. This pipeline predicts the class of a
raw waveform or an audio file. In case of an audio file, ffmpeg should be installed to support multiple audio
formats.`),Lx=p(),_(Gs.$$.fragment),Ox=p(),Kl=n("p"),Nx=o("Learn more about the basics of using a pipeline in the "),Xl=n("a"),Ux=o("pipeline tutorial"),Gx=p(),wt=n("p"),Rx=o("This pipeline can currently be loaded from "),Jl=n("a"),Qx=o("pipeline()"),Hx=o(` using the following task identifier:
`),em=n("code"),Vx=o('"audio-classification"'),Wx=o("."),Bx=p(),ur=n("p"),Zx=o(`See the list of available models on
`),gr=n("a"),Yx=o("huggingface.co/models"),Kx=o("."),Xx=p(),Rs=n("div"),_(_r.$$.fragment),Jx=p(),br=n("p"),e1=o("Classify the sequence(s) given as inputs. See the "),ep=n("a"),t1=o("AutomaticSpeechRecognitionPipeline"),s1=o(` documentation for more
information.`),g_=p(),xt=n("h3"),Qs=n("a"),tm=n("span"),_(vr.$$.fragment),n1=p(),sm=n("span"),a1=o("AutomaticSpeechRecognitionPipeline"),__=p(),ie=n("div"),_(wr.$$.fragment),r1=p(),nm=n("p"),o1=o("Pipeline that aims at extracting spoken text contained within some audio."),i1=p(),am=n("p"),l1=o(`The input can be either a raw waveform or a audio file. In case of the audio file, ffmpeg should be installed for
to support multiple audio formats`),p1=p(),_(Hs.$$.fragment),c1=p(),tp=n("p"),d1=o("Learn more about the basics of using a pipeline in the "),sp=n("a"),m1=o("pipeline tutorial"),h1=p(),Vs=n("div"),_(xr.$$.fragment),f1=p(),kr=n("p"),u1=o("Transcribe the audio sequence(s) given as inputs to text. See the "),np=n("a"),g1=o("AutomaticSpeechRecognitionPipeline"),_1=o(`
documentation for more information.`),b_=p(),kt=n("h2"),Ws=n("a"),rm=n("span"),_(yr.$$.fragment),b1=p(),om=n("span"),v1=o("Computer vision"),v_=p(),ap=n("p"),w1=o("Pipelines available for computer vision tasks include the following."),w_=p(),yt=n("h3"),Bs=n("a"),im=n("span"),_(Pr.$$.fragment),x1=p(),lm=n("span"),k1=o("DepthEstimationPipeline"),x_=p(),H=n("div"),_(Tr.$$.fragment),y1=p(),$r=n("p"),P1=o("Depth estimation pipeline using any "),pm=n("code"),T1=o("AutoModelForDepthEstimation"),$1=o(". This pipeline predicts the depth of an image."),j1=p(),_(Zs.$$.fragment),E1=p(),rp=n("p"),q1=o("Learn more about the basics of using a pipeline in the "),op=n("a"),A1=o("pipeline tutorial"),D1=p(),Pt=n("p"),C1=o("This depth estimation pipeline can currently be loaded from "),ip=n("a"),z1=o("pipeline()"),I1=o(` using the following task identifier:
`),cm=n("code"),S1=o('"depth-estimation"'),M1=o("."),F1=p(),jr=n("p"),L1=o("See the list of available models on "),Er=n("a"),O1=o("huggingface.co/models"),N1=o("."),U1=p(),Ys=n("div"),_(qr.$$.fragment),G1=p(),dm=n("p"),R1=o("Assign labels to the image(s) passed as inputs."),k_=p(),Tt=n("h3"),Ks=n("a"),mm=n("span"),_(Ar.$$.fragment),Q1=p(),hm=n("span"),H1=o("ImageClassificationPipeline"),y_=p(),V=n("div"),_(Dr.$$.fragment),V1=p(),Cr=n("p"),W1=o("Image classification pipeline using any "),fm=n("code"),B1=o("AutoModelForImageClassification"),Z1=o(`. This pipeline predicts the class of an
image.`),Y1=p(),_(Xs.$$.fragment),K1=p(),lp=n("p"),X1=o("Learn more about the basics of using a pipeline in the "),pp=n("a"),J1=o("pipeline tutorial"),ek=p(),$t=n("p"),tk=o("This image classification pipeline can currently be loaded from "),cp=n("a"),sk=o("pipeline()"),nk=o(` using the following task identifier:
`),um=n("code"),ak=o('"image-classification"'),rk=o("."),ok=p(),zr=n("p"),ik=o(`See the list of available models on
`),Ir=n("a"),lk=o("huggingface.co/models"),pk=o("."),ck=p(),Js=n("div"),_(Sr.$$.fragment),dk=p(),gm=n("p"),mk=o("Assign labels to the image(s) passed as inputs."),P_=p(),jt=n("h3"),en=n("a"),_m=n("span"),_(Mr.$$.fragment),hk=p(),bm=n("span"),fk=o("ImageSegmentationPipeline"),T_=p(),le=n("div"),_(Fr.$$.fragment),uk=p(),Lr=n("p"),gk=o("Image segmentation pipeline using any "),vm=n("code"),_k=o("AutoModelForXXXSegmentation"),bk=o(`. This pipeline predicts masks of objects and
their classes.`),vk=p(),_(tn.$$.fragment),wk=p(),Et=n("p"),xk=o("This image segmentation pipeline can currently be loaded from "),dp=n("a"),kk=o("pipeline()"),yk=o(` using the following task identifier:
`),wm=n("code"),Pk=o('"image-segmentation"'),Tk=o("."),$k=p(),Or=n("p"),jk=o(`See the list of available models on
`),Nr=n("a"),Ek=o("huggingface.co/models"),qk=o("."),Ak=p(),sn=n("div"),_(Ur.$$.fragment),Dk=p(),xm=n("p"),Ck=o("Perform segmentation (detect masks & classes) in the image(s) passed as inputs."),$_=p(),qt=n("h3"),nn=n("a"),km=n("span"),_(Gr.$$.fragment),zk=p(),ym=n("span"),Ik=o("ObjectDetectionPipeline"),j_=p(),W=n("div"),_(Rr.$$.fragment),Sk=p(),Qr=n("p"),Mk=o("Object detection pipeline using any "),Pm=n("code"),Fk=o("AutoModelForObjectDetection"),Lk=o(`. This pipeline predicts bounding boxes of objects
and their classes.`),Ok=p(),_(an.$$.fragment),Nk=p(),mp=n("p"),Uk=o("Learn more about the basics of using a pipeline in the "),hp=n("a"),Gk=o("pipeline tutorial"),Rk=p(),At=n("p"),Qk=o("This object detection pipeline can currently be loaded from "),fp=n("a"),Hk=o("pipeline()"),Vk=o(` using the following task identifier:
`),Tm=n("code"),Wk=o('"object-detection"'),Bk=o("."),Zk=p(),Hr=n("p"),Yk=o("See the list of available models on "),Vr=n("a"),Kk=o("huggingface.co/models"),Xk=o("."),Jk=p(),rn=n("div"),_(Wr.$$.fragment),ey=p(),$m=n("p"),ty=o("Detect objects (bounding boxes & classes) in the image(s) passed as inputs."),E_=p(),Dt=n("h3"),on=n("a"),jm=n("span"),_(Br.$$.fragment),sy=p(),Em=n("span"),ny=o("ZeroShotImageClassificationPipeline"),q_=p(),B=n("div"),_(Zr.$$.fragment),ay=p(),Ct=n("p"),ry=o("Zero shot image classification pipeline using "),qm=n("code"),oy=o("CLIPModel"),iy=o(`. This pipeline predicts the class of an image when you
provide an image and a set of `),Am=n("code"),ly=o("candidate_labels"),py=o("."),cy=p(),_(ln.$$.fragment),dy=p(),up=n("p"),my=o("Learn more about the basics of using a pipeline in the "),gp=n("a"),hy=o("pipeline tutorial"),fy=p(),zt=n("p"),uy=o("This image classification pipeline can currently be loaded from "),_p=n("a"),gy=o("pipeline()"),_y=o(` using the following task identifier:
`),Dm=n("code"),by=o('"zero-shot-image-classification"'),vy=o("."),wy=p(),Yr=n("p"),xy=o(`See the list of available models on
`),Kr=n("a"),ky=o("huggingface.co/models"),yy=o("."),Py=p(),pn=n("div"),_(Xr.$$.fragment),Ty=p(),Cm=n("p"),$y=o("Assign labels to the image(s) passed as inputs."),A_=p(),It=n("h3"),cn=n("a"),zm=n("span"),_(Jr.$$.fragment),jy=p(),Im=n("span"),Ey=o("ZeroShotObjectDetectionPipeline"),D_=p(),Z=n("div"),_(eo.$$.fragment),qy=p(),St=n("p"),Ay=o("Zero shot object detection pipeline using "),Sm=n("code"),Dy=o("OwlViTForObjectDetection"),Cy=o(`. This pipeline predicts bounding boxes of
objects when you provide an image and a set of `),Mm=n("code"),zy=o("candidate_labels"),Iy=o("."),Sy=p(),_(dn.$$.fragment),My=p(),bp=n("p"),Fy=o("Learn more about the basics of using a pipeline in the "),vp=n("a"),Ly=o("pipeline tutorial"),Oy=p(),Mt=n("p"),Ny=o("This object detection pipeline can currently be loaded from "),wp=n("a"),Uy=o("pipeline()"),Gy=o(` using the following task identifier:
`),Fm=n("code"),Ry=o('"zero-shot-object-detection"'),Qy=o("."),Hy=p(),to=n("p"),Vy=o(`See the list of available models on
`),so=n("a"),Wy=o("huggingface.co/models"),By=o("."),Zy=p(),mn=n("div"),_(no.$$.fragment),Yy=p(),Lm=n("p"),Ky=o("Detect objects (bounding boxes & classes) in the image(s) passed as inputs."),C_=p(),Ft=n("h2"),hn=n("a"),Om=n("span"),_(ao.$$.fragment),Xy=p(),Nm=n("span"),Jy=o("Natural Language Processing"),z_=p(),xp=n("p"),eP=o("Pipelines available for natural language processing tasks include the following."),I_=p(),Lt=n("h3"),fn=n("a"),Um=n("span"),_(ro.$$.fragment),tP=p(),Gm=n("span"),sP=o("ConversationalPipeline"),S_=p(),Y=n("div"),_(oo.$$.fragment),nP=p(),We=n("p"),aP=o(`Utility class containing a conversation and its history. This class is meant to be used as an input to the
`),kp=n("a"),rP=o("ConversationalPipeline"),oP=o(`. The conversation contains a number of utility function to manage the addition of new
user input and generated model responses. A conversation needs to contain an unprocessed user input before being
passed to the `),yp=n("a"),iP=o("ConversationalPipeline"),lP=o(`. This user input is either created when the class is instantiated, or by
calling `),Rm=n("code"),pP=o('conversational_pipeline.append_response("input")'),cP=o(" after a conversation turn."),dP=p(),_(un.$$.fragment),mP=p(),gn=n("div"),_(io.$$.fragment),hP=p(),lo=n("p"),fP=o("Add a user input to the conversation for the next round. This populates the internal "),Qm=n("code"),uP=o("new_user_input"),gP=o(" field."),_P=p(),_n=n("div"),_(po.$$.fragment),bP=p(),Hm=n("p"),vP=o("Append a response to the list of generated responses."),wP=p(),tt=n("div"),_(co.$$.fragment),xP=p(),Vm=n("p"),kP=o("Iterates over all blobs of the conversation."),yP=p(),Se=n("p"),PP=o("Returns: Iterator of (is_user, text_chunk) in chronological order of the conversation. "),Wm=n("code"),TP=o("is_user"),$P=o(" is a "),Bm=n("code"),jP=o("bool"),EP=o(`,
`),Zm=n("code"),qP=o("text_chunks"),AP=o(" is a "),Ym=n("code"),DP=o("str"),CP=o("."),zP=p(),bn=n("div"),_(mo.$$.fragment),IP=p(),Be=n("p"),SP=o("Mark the conversation as processed (moves the content of "),Km=n("code"),MP=o("new_user_input"),FP=o(" to "),Xm=n("code"),LP=o("past_user_inputs"),OP=o(`) and empties
the `),Jm=n("code"),NP=o("new_user_input"),UP=o(" field."),M_=p(),K=n("div"),_(ho.$$.fragment),GP=p(),eh=n("p"),RP=o("Multi-turn conversational pipeline."),QP=p(),_(vn.$$.fragment),HP=p(),Pp=n("p"),VP=o("Learn more about the basics of using a pipeline in the "),Tp=n("a"),WP=o("pipeline tutorial"),BP=p(),Ot=n("p"),ZP=o("This conversational pipeline can currently be loaded from "),$p=n("a"),YP=o("pipeline()"),KP=o(` using the following task identifier:
`),th=n("code"),XP=o('"conversational"'),JP=o("."),e0=p(),Me=n("p"),t0=o(`The models that this pipeline can use are models that have been fine-tuned on a multi-turn conversational task,
currently: `),sh=n("em"),s0=o("\u2018microsoft/DialoGPT-small\u2019"),n0=o(", "),nh=n("em"),a0=o("\u2018microsoft/DialoGPT-medium\u2019"),r0=o(", "),ah=n("em"),o0=o("\u2018microsoft/DialoGPT-large\u2019"),i0=o(`. See the
up-to-date list of available models on
`),fo=n("a"),l0=o("huggingface.co/models"),p0=o("."),c0=p(),wn=n("div"),_(uo.$$.fragment),d0=p(),rh=n("p"),m0=o("Generate responses for the conversation(s) given as inputs."),F_=p(),Nt=n("h3"),xn=n("a"),oh=n("span"),_(go.$$.fragment),h0=p(),ih=n("span"),f0=o("FillMaskPipeline"),L_=p(),O=n("div"),_(_o.$$.fragment),u0=p(),Ut=n("p"),g0=o("Masked language modeling prediction pipeline using any "),lh=n("code"),_0=o("ModelWithLMHead"),b0=o(". See the "),jp=n("a"),v0=o(`masked language modeling
examples`),w0=o(" for more information."),x0=p(),_(kn.$$.fragment),k0=p(),Ep=n("p"),y0=o("Learn more about the basics of using a pipeline in the "),qp=n("a"),P0=o("pipeline tutorial"),T0=p(),Gt=n("p"),$0=o("This mask filling pipeline can currently be loaded from "),Ap=n("a"),j0=o("pipeline()"),E0=o(` using the following task identifier:
`),ph=n("code"),q0=o('"fill-mask"'),A0=o("."),D0=p(),bo=n("p"),C0=o(`The models that this pipeline can use are models that have been trained with a masked language modeling objective,
which includes the bi-directional models in the library. See the up-to-date list of available models on
`),vo=n("a"),z0=o("huggingface.co/models"),I0=o("."),S0=p(),_(yn.$$.fragment),M0=p(),Pn=n("div"),_(wo.$$.fragment),F0=p(),ch=n("p"),L0=o("Fill the masked token in the text(s) given as inputs."),O_=p(),Rt=n("h3"),Tn=n("a"),dh=n("span"),_(xo.$$.fragment),O0=p(),mh=n("span"),N0=o("NerPipeline"),N_=p(),S=n("div"),_(ko.$$.fragment),U0=p(),Qt=n("p"),G0=o("Named Entity Recognition pipeline using any "),hh=n("code"),R0=o("ModelForTokenClassification"),Q0=o(". See the "),Dp=n("a"),H0=o(`named entity recognition
examples`),V0=o(" for more information."),W0=p(),_($n.$$.fragment),B0=p(),Cp=n("p"),Z0=o("Learn more about the basics of using a pipeline in the "),zp=n("a"),Y0=o("pipeline tutorial"),K0=p(),Ht=n("p"),X0=o("This token recognition pipeline can currently be loaded from "),Ip=n("a"),J0=o("pipeline()"),eT=o(` using the following task identifier:
`),fh=n("code"),tT=o('"ner"'),sT=o(" (for predicting the classes of tokens in a sequence: person, organisation, location or miscellaneous)."),nT=p(),yo=n("p"),aT=o(`The models that this pipeline can use are models that have been fine-tuned on a token classification task. See the
up-to-date list of available models on
`),Po=n("a"),rT=o("huggingface.co/models"),oT=o("."),iT=p(),st=n("div"),_(To.$$.fragment),lT=p(),uh=n("p"),pT=o("Override tokens from a given word that disagree to force agreement on word boundaries."),cT=p(),gh=n("p"),dT=o(`Example: micro|soft| com|pany| B-ENT I-NAME I-ENT I-ENT will be rewritten with first strategy as microsoft|
company| B-ENT I-ENT`),mT=p(),jn=n("div"),_($o.$$.fragment),hT=p(),_h=n("p"),fT=o("Fuse various numpy arrays into dicts with all the information needed for aggregation"),uT=p(),En=n("div"),_(jo.$$.fragment),gT=p(),bh=n("p"),_T=o("Find and group together the adjacent tokens with the same entity predicted."),bT=p(),qn=n("div"),_(Eo.$$.fragment),vT=p(),vh=n("p"),wT=o("Group together the adjacent tokens with the same entity predicted."),U_=p(),An=n("p"),xT=o("See "),Sp=n("a"),kT=o("TokenClassificationPipeline"),yT=o(" for all details."),G_=p(),Vt=n("h3"),Dn=n("a"),wh=n("span"),_(qo.$$.fragment),PT=p(),xh=n("span"),TT=o("QuestionAnsweringPipeline"),R_=p(),M=n("div"),_(Ao.$$.fragment),$T=p(),Wt=n("p"),jT=o("Question Answering pipeline using any "),kh=n("code"),ET=o("ModelForQuestionAnswering"),qT=o(". See the "),Mp=n("a"),AT=o(`question answering
examples`),DT=o(" for more information."),CT=p(),_(Cn.$$.fragment),zT=p(),Fp=n("p"),IT=o("Learn more about the basics of using a pipeline in the "),Lp=n("a"),ST=o("pipeline tutorial"),MT=p(),Bt=n("p"),FT=o("This question answering pipeline can currently be loaded from "),Op=n("a"),LT=o("pipeline()"),OT=o(` using the following task identifier:
`),yh=n("code"),NT=o('"question-answering"'),UT=o("."),GT=p(),Do=n("p"),RT=o(`The models that this pipeline can use are models that have been fine-tuned on a question answering task. See the
up-to-date list of available models on
`),Co=n("a"),QT=o("huggingface.co/models"),HT=o("."),VT=p(),zn=n("div"),_(zo.$$.fragment),WT=p(),Ph=n("p"),BT=o("Answer the question(s) given as inputs by using the context(s)."),ZT=p(),nt=n("div"),_(Io.$$.fragment),YT=p(),Zt=n("p"),KT=o("QuestionAnsweringPipeline leverages the "),Th=n("code"),XT=o("SquadExample"),JT=o(` internally. This helper method encapsulate all the
logic for converting question(s) and context(s) to `),$h=n("code"),e$=o("SquadExample"),t$=o("."),s$=p(),jh=n("p"),n$=o("We currently support extractive question answering."),a$=p(),In=n("div"),_(So.$$.fragment),r$=p(),Eh=n("p"),o$=o("When decoding from token probabilities, this method maps token indexes to actual word in the initial context."),Q_=p(),Yt=n("h3"),Sn=n("a"),qh=n("span"),_(Mo.$$.fragment),i$=p(),Ah=n("span"),l$=o("SummarizationPipeline"),H_=p(),pe=n("div"),_(Fo.$$.fragment),p$=p(),Dh=n("p"),c$=o("Summarize news articles and other documents."),d$=p(),Kt=n("p"),m$=o("This summarizing pipeline can currently be loaded from "),Np=n("a"),h$=o("pipeline()"),f$=o(` using the following task identifier:
`),Ch=n("code"),u$=o('"summarization"'),g$=o("."),_$=p(),G=n("p"),b$=o(`The models that this pipeline can use are models that have been fine-tuned on a summarization task, which is
currently, \u2019`),zh=n("em"),v$=o("bart-large-cnn"),w$=o("\u2019, \u2019"),Ih=n("em"),x$=o("t5-small"),k$=o("\u2019, \u2019"),Sh=n("em"),y$=o("t5-base"),P$=o("\u2019, \u2019"),Mh=n("em"),T$=o("t5-large"),$$=o("\u2019, \u2019"),Fh=n("em"),j$=o("t5-3b"),E$=o("\u2019, \u2019"),Lh=n("em"),q$=o("t5-11b"),A$=o(`\u2019. See the up-to-date
list of available models on `),Lo=n("a"),D$=o("huggingface.co/models"),C$=o(`. For a list
of available parameters, see the `),Oo=n("a"),z$=o(`following
documentation`),I$=p(),_(Mn.$$.fragment),S$=p(),Fn=n("div"),_(No.$$.fragment),M$=p(),Oh=n("p"),F$=o("Summarize the text(s) given as inputs."),V_=p(),Xt=n("h3"),Ln=n("a"),Nh=n("span"),_(Uo.$$.fragment),L$=p(),Uh=n("span"),O$=o("TableQuestionAnsweringPipeline"),W_=p(),X=n("div"),_(Go.$$.fragment),N$=p(),Ro=n("p"),U$=o("Table Question Answering pipeline using a "),Gh=n("code"),G$=o("ModelForTableQuestionAnswering"),R$=o(`. This pipeline is only available in
PyTorch.`),Q$=p(),_(On.$$.fragment),H$=p(),Up=n("p"),V$=o("Learn more about the basics of using a pipeline in the "),Gp=n("a"),W$=o("pipeline tutorial"),B$=p(),Jt=n("p"),Z$=o("This tabular question answering pipeline can currently be loaded from "),Rp=n("a"),Y$=o("pipeline()"),K$=o(` using the following task
identifier: `),Rh=n("code"),X$=o('"table-question-answering"'),J$=o("."),e4=p(),Qo=n("p"),t4=o(`The models that this pipeline can use are models that have been fine-tuned on a tabular question answering task.
See the up-to-date list of available models on
`),Ho=n("a"),s4=o("huggingface.co/models"),n4=o("."),a4=p(),ae=n("div"),_(Vo.$$.fragment),r4=p(),Qh=n("p"),o4=o("Answers queries according to a table. The pipeline accepts several types of inputs which are detailed below:"),i4=p(),ce=n("ul"),Hh=n("li"),Vh=n("code"),l4=o("pipeline(table, query)"),p4=p(),Wh=n("li"),Bh=n("code"),c4=o("pipeline(table, [query])"),d4=p(),Zh=n("li"),Yh=n("code"),m4=o("pipeline(table=table, query=query)"),h4=p(),Kh=n("li"),Xh=n("code"),f4=o("pipeline(table=table, query=[query])"),u4=p(),Jh=n("li"),ef=n("code"),g4=o('pipeline({"table": table, "query": query})'),_4=p(),tf=n("li"),sf=n("code"),b4=o('pipeline({"table": table, "query": [query]})'),v4=p(),nf=n("li"),af=n("code"),w4=o('pipeline([{"table": table, "query": query}, {"table": table, "query": query}])'),x4=p(),Wo=n("p"),k4=o("The "),rf=n("code"),y4=o("table"),P4=o(" argument should be a dict or a DataFrame built from that dict, containing the whole table:"),T4=p(),_(Nn.$$.fragment),$4=p(),of=n("p"),j4=o("This dictionary can be passed in as such, or can be converted to a pandas DataFrame:"),E4=p(),_(Un.$$.fragment),B_=p(),es=n("h3"),Gn=n("a"),lf=n("span"),_(Bo.$$.fragment),q4=p(),pf=n("span"),A4=o("TextClassificationPipeline"),Z_=p(),N=n("div"),_(Zo.$$.fragment),D4=p(),ts=n("p"),C4=o("Text classification pipeline using any "),cf=n("code"),z4=o("ModelForSequenceClassification"),I4=o(". See the "),Qp=n("a"),S4=o(`sequence classification
examples`),M4=o(" for more information."),F4=p(),_(Rn.$$.fragment),L4=p(),Hp=n("p"),O4=o("Learn more about the basics of using a pipeline in the "),Vp=n("a"),N4=o("pipeline tutorial"),U4=p(),ss=n("p"),G4=o("This text classification pipeline can currently be loaded from "),Wp=n("a"),R4=o("pipeline()"),Q4=o(` using the following task identifier:
`),df=n("code"),H4=o('"sentiment-analysis"'),V4=o(" (for classifying sequences according to positive or negative sentiments)."),W4=p(),Yo=n("p"),B4=o("If multiple classification labels are available ("),mf=n("code"),Z4=o("model.config.num_labels >= 2"),Y4=o(`), the pipeline will run a softmax
over the results. If there is a single label, the pipeline will run a sigmoid over the result.`),K4=p(),Ko=n("p"),X4=o(`The models that this pipeline can use are models that have been fine-tuned on a sequence classification task. See
the up-to-date list of available models on
`),Xo=n("a"),J4=o("huggingface.co/models"),e7=o("."),t7=p(),Qn=n("div"),_(Jo.$$.fragment),s7=p(),hf=n("p"),n7=o("Classify the text(s) given as inputs."),Y_=p(),ns=n("h3"),Hn=n("a"),ff=n("span"),_(ei.$$.fragment),a7=p(),uf=n("span"),r7=o("TextGenerationPipeline"),K_=p(),J=n("div"),_(ti.$$.fragment),o7=p(),si=n("p"),i7=o("Language generation pipeline using any "),gf=n("code"),l7=o("ModelWithLMHead"),p7=o(`. This pipeline predicts the words that will follow a
specified text prompt.`),c7=p(),_(Vn.$$.fragment),d7=p(),Bp=n("p"),m7=o("Learn more about the basics of using a pipeline in the "),Zp=n("a"),h7=o("pipeline tutorial"),f7=p(),as=n("p"),u7=o("This language generation pipeline can currently be loaded from "),Yp=n("a"),g7=o("pipeline()"),_7=o(` using the following task identifier:
`),_f=n("code"),b7=o('"text-generation"'),v7=o("."),w7=p(),ni=n("p"),x7=o(`The models that this pipeline can use are models that have been trained with an autoregressive language modeling
objective, which includes the uni-directional models in the library (e.g. gpt2). See the list of available models
on `),ai=n("a"),k7=o("huggingface.co/models"),y7=o("."),P7=p(),Wn=n("div"),_(ri.$$.fragment),T7=p(),bf=n("p"),$7=o("Complete the prompt(s) given as inputs."),X_=p(),rs=n("h3"),Bn=n("a"),vf=n("span"),_(oi.$$.fragment),j7=p(),wf=n("span"),E7=o("Text2TextGenerationPipeline"),J_=p(),F=n("div"),_(ii.$$.fragment),q7=p(),xf=n("p"),A7=o("Pipeline for text to text generation using seq2seq models."),D7=p(),_(Zn.$$.fragment),C7=p(),Kp=n("p"),z7=o("Learn more about the basics of using a pipeline in the "),Xp=n("a"),I7=o("pipeline tutorial"),S7=p(),os=n("p"),M7=o("This Text2TextGenerationPipeline pipeline can currently be loaded from "),Jp=n("a"),F7=o("pipeline()"),L7=o(` using the following task
identifier: `),kf=n("code"),O7=o('"text2text-generation"'),N7=o("."),U7=p(),Yn=n("p"),G7=o(`The models that this pipeline can use are models that have been fine-tuned on a translation task. See the
up-to-date list of available models on
`),li=n("a"),R7=o("huggingface.co/models"),Q7=o(`. For a list of available
parameters, see the `),pi=n("a"),H7=o(`following
documentation`),V7=p(),_(Kn.$$.fragment),W7=p(),Xn=n("div"),_(ci.$$.fragment),B7=p(),yf=n("p"),Z7=o("Generate the output text(s) using text(s) given as inputs."),Y7=p(),Jn=n("div"),_(di.$$.fragment),K7=p(),Pf=n("p"),X7=o("Checks whether there might be something wrong with given input with regard to the model."),eb=p(),is=n("h3"),ea=n("a"),Tf=n("span"),_(mi.$$.fragment),J7=p(),$f=n("span"),ej=o("TokenClassificationPipeline"),tb=p(),I=n("div"),_(hi.$$.fragment),tj=p(),ls=n("p"),sj=o("Named Entity Recognition pipeline using any "),jf=n("code"),nj=o("ModelForTokenClassification"),aj=o(". See the "),ec=n("a"),rj=o(`named entity recognition
examples`),oj=o(" for more information."),ij=p(),_(ta.$$.fragment),lj=p(),tc=n("p"),pj=o("Learn more about the basics of using a pipeline in the "),sc=n("a"),cj=o("pipeline tutorial"),dj=p(),ps=n("p"),mj=o("This token recognition pipeline can currently be loaded from "),nc=n("a"),hj=o("pipeline()"),fj=o(` using the following task identifier:
`),Ef=n("code"),uj=o('"ner"'),gj=o(" (for predicting the classes of tokens in a sequence: person, organisation, location or miscellaneous)."),_j=p(),fi=n("p"),bj=o(`The models that this pipeline can use are models that have been fine-tuned on a token classification task. See the
up-to-date list of available models on
`),ui=n("a"),vj=o("huggingface.co/models"),wj=o("."),xj=p(),sa=n("div"),_(gi.$$.fragment),kj=p(),qf=n("p"),yj=o("Classify each token of the text(s) given as inputs."),Pj=p(),at=n("div"),_(_i.$$.fragment),Tj=p(),Af=n("p"),$j=o("Override tokens from a given word that disagree to force agreement on word boundaries."),jj=p(),Df=n("p"),Ej=o(`Example: micro|soft| com|pany| B-ENT I-NAME I-ENT I-ENT will be rewritten with first strategy as microsoft|
company| B-ENT I-ENT`),qj=p(),na=n("div"),_(bi.$$.fragment),Aj=p(),Cf=n("p"),Dj=o("Fuse various numpy arrays into dicts with all the information needed for aggregation"),Cj=p(),aa=n("div"),_(vi.$$.fragment),zj=p(),zf=n("p"),Ij=o("Find and group together the adjacent tokens with the same entity predicted."),Sj=p(),ra=n("div"),_(wi.$$.fragment),Mj=p(),If=n("p"),Fj=o("Group together the adjacent tokens with the same entity predicted."),sb=p(),cs=n("h3"),oa=n("a"),Sf=n("span"),_(xi.$$.fragment),Lj=p(),Mf=n("span"),Oj=o("TranslationPipeline"),nb=p(),de=n("div"),_(ki.$$.fragment),Nj=p(),Ff=n("p"),Uj=o("Translates from one language to another."),Gj=p(),ds=n("p"),Rj=o("This translation pipeline can currently be loaded from "),ac=n("a"),Qj=o("pipeline()"),Hj=o(` using the following task identifier:
`),Lf=n("code"),Vj=o('"translation_xx_to_yy"'),Wj=o("."),Bj=p(),ia=n("p"),Zj=o(`The models that this pipeline can use are models that have been fine-tuned on a translation task. See the
up-to-date list of available models on `),yi=n("a"),Yj=o("huggingface.co/models"),Kj=o(`.
For a list of available parameters, see the `),Pi=n("a"),Xj=o(`following
documentation`),Jj=p(),_(la.$$.fragment),e5=p(),pa=n("div"),_(Ti.$$.fragment),t5=p(),Of=n("p"),s5=o("Translate the text(s) given as inputs."),ab=p(),ms=n("h3"),ca=n("a"),Nf=n("span"),_($i.$$.fragment),n5=p(),Uf=n("span"),a5=o("ZeroShotClassificationPipeline"),rb=p(),U=n("div"),_(ji.$$.fragment),r5=p(),Ze=n("p"),o5=o("NLI-based zero-shot classification pipeline using a "),Gf=n("code"),i5=o("ModelForSequenceClassification"),l5=o(` trained on NLI (natural
language inference) tasks. Equivalent of `),Rf=n("code"),p5=o("text-classification"),c5=o(` pipelines, but these models don\u2019t require a
hardcoded number of potential classes, they can be chosen at runtime. It usually means it\u2019s slower but it is
`),Qf=n("strong"),d5=o("much"),m5=o(" more flexible."),h5=p(),Ye=n("p"),f5=o(`Any combination of sequences and labels can be passed and each combination will be posed as a premise/hypothesis
pair and passed to the pretrained model. Then, the logit for `),Hf=n("em"),u5=o("entailment"),g5=o(` is taken as the logit for the candidate
label being valid. Any NLI model can be used, but the id of the `),Vf=n("em"),_5=o("entailment"),b5=o(` label must be included in the model
config\u2019s :attr:`),Wf=n("em"),v5=o("~transformers.PretrainedConfig.label2id"),w5=o("."),x5=p(),_(da.$$.fragment),k5=p(),rc=n("p"),y5=o("Learn more about the basics of using a pipeline in the "),oc=n("a"),P5=o("pipeline tutorial"),T5=p(),hs=n("p"),$5=o("This NLI pipeline can currently be loaded from "),ic=n("a"),j5=o("pipeline()"),E5=o(` using the following task identifier:
`),Bf=n("code"),q5=o('"zero-shot-classification"'),A5=o("."),D5=p(),Ei=n("p"),C5=o(`The models that this pipeline can use are models that have been fine-tuned on an NLI task. See the up-to-date list
of available models on `),qi=n("a"),z5=o("huggingface.co/models"),I5=o("."),S5=p(),ma=n("div"),_(Ai.$$.fragment),M5=p(),Di=n("p"),F5=o("Classify the sequence(s) given as inputs. See the "),lc=n("a"),L5=o("ZeroShotClassificationPipeline"),O5=o(` documentation for more
information.`),ob=p(),fs=n("h2"),ha=n("a"),Zf=n("span"),_(Ci.$$.fragment),N5=p(),Yf=n("span"),U5=o("Multimodal"),ib=p(),pc=n("p"),G5=o("Pipelines available for multimodal tasks include the following."),lb=p(),us=n("h3"),fa=n("a"),Kf=n("span"),_(zi.$$.fragment),R5=p(),Xf=n("span"),Q5=o("DocumentQuestionAnsweringPipeline"),pb=p(),ee=n("div"),_(Ii.$$.fragment),H5=p(),Si=n("p"),V5=o("Document Question Answering pipeline using any "),Jf=n("code"),W5=o("AutoModelForDocumentQuestionAnswering"),B5=o(`. The inputs/outputs are
similar to the (extractive) question answering pipeline; however, the pipeline takes an image (and optional OCR\u2019d
words/boxes) as input instead of text context.`),Z5=p(),_(ua.$$.fragment),Y5=p(),cc=n("p"),K5=o("Learn more about the basics of using a pipeline in the "),dc=n("a"),X5=o("pipeline tutorial"),J5=p(),gs=n("p"),eE=o("This document question answering pipeline can currently be loaded from "),mc=n("a"),tE=o("pipeline()"),sE=o(` using the following task
identifier: `),eu=n("code"),nE=o('"document-question-answering"'),aE=o("."),rE=p(),Mi=n("p"),oE=o(`The models that this pipeline can use are models that have been fine-tuned on a document question answering task.
See the up-to-date list of available models on
`),Fi=n("a"),iE=o("huggingface.co/models"),lE=o("."),pE=p(),Ne=n("div"),_(Li.$$.fragment),cE=p(),Oi=n("p"),dE=o(`Answer the question(s) given as inputs by using the document(s). A document is defined as an image and an
optional list of (word, box) tuples which represent the text in the document. If the `),tu=n("code"),mE=o("word_boxes"),hE=o(` are not
provided, it will use the Tesseract OCR engine (if available) to extract the words and boxes automatically for
LayoutLM-like models which require them as input. For Donut, no OCR is run.`),fE=p(),su=n("p"),uE=o("You can invoke the pipeline several ways:"),gE=p(),Ke=n("ul"),nu=n("li"),au=n("code"),_E=o("pipeline(image=image, question=question)"),bE=p(),ru=n("li"),ou=n("code"),vE=o("pipeline(image=image, question=question, word_boxes=word_boxes)"),wE=p(),iu=n("li"),lu=n("code"),xE=o('pipeline([{"image": image, "question": question}])'),kE=p(),pu=n("li"),cu=n("code"),yE=o('pipeline([{"image": image, "question": question, "word_boxes": word_boxes}])'),cb=p(),_s=n("h3"),ga=n("a"),du=n("span"),_(Ni.$$.fragment),PE=p(),mu=n("span"),TE=o("FeatureExtractionPipeline"),db=p(),te=n("div"),_(Ui.$$.fragment),$E=p(),hu=n("p"),jE=o(`Feature extraction pipeline using no model head. This pipeline extracts the hidden states from the base
transformer, which can be used as features in downstream tasks.`),EE=p(),_(_a.$$.fragment),qE=p(),hc=n("p"),AE=o("Learn more about the basics of using a pipeline in the "),fc=n("a"),DE=o("pipeline tutorial"),CE=p(),bs=n("p"),zE=o("This feature extraction pipeline can currently be loaded from "),uc=n("a"),IE=o("pipeline()"),SE=o(` using the task identifier:
`),fu=n("code"),ME=o('"feature-extraction"'),FE=o("."),LE=p(),Gi=n("p"),OE=o(`All models may be used for this pipeline. See a list of all models, including community-contributed models on
`),Ri=n("a"),NE=o("huggingface.co/models"),UE=o("."),GE=p(),ba=n("div"),_(Qi.$$.fragment),RE=p(),uu=n("p"),QE=o("Extract the features of the input(s)."),mb=p(),vs=n("h3"),va=n("a"),gu=n("span"),_(Hi.$$.fragment),HE=p(),_u=n("span"),VE=o("ImageToTextPipeline"),hb=p(),se=n("div"),_(Vi.$$.fragment),WE=p(),Wi=n("p"),BE=o("Image To Text pipeline using a "),bu=n("code"),ZE=o("AutoModelForVision2Seq"),YE=o(". This pipeline predicts a caption for a given image."),KE=p(),_(wa.$$.fragment),XE=p(),gc=n("p"),JE=o("Learn more about the basics of using a pipeline in the "),_c=n("a"),eq=o("pipeline tutorial"),tq=p(),vu=n("p"),sq=o(`This image to text pipeline can currently be loaded from pipeline() using the following task identifier:
\u201Cimage-to-text\u201D.`),nq=p(),Bi=n("p"),aq=o(`See the list of available models on
`),Zi=n("a"),rq=o("huggingface.co/models"),oq=o("."),iq=p(),xa=n("div"),_(Yi.$$.fragment),lq=p(),wu=n("p"),pq=o("Assign labels to the image(s) passed as inputs."),fb=p(),ws=n("h3"),ka=n("a"),xu=n("span"),_(Ki.$$.fragment),cq=p(),ku=n("span"),dq=o("VisualQuestionAnsweringPipeline"),ub=p(),ne=n("div"),_(Xi.$$.fragment),mq=p(),Ji=n("p"),hq=o("Visual Question Answering pipeline using a "),yu=n("code"),fq=o("AutoModelForVisualQuestionAnswering"),uq=o(`. This pipeline is currently only
available in PyTorch.`),gq=p(),_(ya.$$.fragment),_q=p(),bc=n("p"),bq=o("Learn more about the basics of using a pipeline in the "),vc=n("a"),vq=o("pipeline tutorial"),wq=p(),xs=n("p"),xq=o("This visual question answering pipeline can currently be loaded from "),wc=n("a"),kq=o("pipeline()"),yq=o(` using the following task
identifiers: `),Pu=n("code"),Pq=o('"visual-question-answering", "vqa"'),Tq=o("."),$q=p(),el=n("p"),jq=o(`The models that this pipeline can use are models that have been fine-tuned on a visual question answering task. See
the up-to-date list of available models on
`),tl=n("a"),Eq=o("huggingface.co/models"),qq=o("."),Aq=p(),rt=n("div"),_(sl.$$.fragment),Dq=p(),Tu=n("p"),Cq=o(`Answers open-ended questions about images. The pipeline accepts several types of inputs which are detailed
below:`),zq=p(),Xe=n("ul"),$u=n("li"),ju=n("code"),Iq=o("pipeline(image=image, question=question)"),Sq=p(),Eu=n("li"),qu=n("code"),Mq=o('pipeline({"image": image, "question": question})'),Fq=p(),Au=n("li"),Du=n("code"),Lq=o('pipeline([{"image": image, "question": question}])'),Oq=p(),Cu=n("li"),zu=n("code"),Nq=o('pipeline([{"image": image, "question": question}, {"image": image, "question": question}])'),gb=p(),ks=n("h2"),Pa=n("a"),Iu=n("span"),_(nl.$$.fragment),Uq=p(),xc=n("span"),Gq=o("Parent class: "),Su=n("code"),Rq=o("Pipeline"),_b=p(),A=n("div"),_(al.$$.fragment),Qq=p(),Mu=n("p"),Hq=o(`The Pipeline class is the class from which all pipelines inherit. Refer to this class for methods shared across
different pipelines.`),Vq=p(),Fu=n("p"),Wq=o(`Base class implementing pipelined operations. Pipeline workflow is defined as a sequence of the following
operations:`),Bq=p(),Lu=n("p"),Zq=o("Input -> Tokenization -> Model Inference -> Post-Processing (task dependent) -> Output"),Yq=p(),Ou=n("p"),Kq=o("Pipeline supports running on CPU or GPU through the device argument (see below)."),Xq=p(),Fe=n("p"),Jq=o("Some pipeline, like for instance "),kc=n("a"),e3=o("FeatureExtractionPipeline"),t3=o(" ("),Nu=n("code"),s3=o("'feature-extraction'"),n3=o(`) output large tensor object
as nested-lists. In order to avoid dumping such large structure as textual data we provide the `),Uu=n("code"),a3=o("binary_output"),r3=o(`
constructor argument. If set to `),Gu=n("code"),o3=o("True"),i3=o(", the output will be stored in the pickle format."),l3=p(),Ta=n("div"),_(rl.$$.fragment),p3=p(),Ru=n("p"),c3=o("Check if the model class is in supported by the pipeline."),d3=p(),ot=n("div"),_(ol.$$.fragment),m3=p(),Qu=n("p"),h3=o("Context Manager allowing tensor allocation on the user-specified device in framework agnostic way."),f3=p(),_($a.$$.fragment),u3=p(),ja=n("div"),_(il.$$.fragment),g3=p(),Hu=n("p"),_3=o("Ensure PyTorch tensors are on the specified device."),b3=p(),Ea=n("div"),_(ll.$$.fragment),v3=p(),pl=n("p"),w3=o("Postprocess will receive the raw outputs of the "),Vu=n("code"),x3=o("_forward"),k3=o(` method, generally tensors, and reformat them into
something more friendly. Generally it will output a list or a dict or results (containing just strings and
numbers).`),y3=p(),qa=n("div"),_(cl.$$.fragment),P3=p(),dl=n("p"),T3=o("Scikit / Keras interface to transformers\u2019 pipelines. This method will forward to "),Wu=n("strong"),$3=o("call"),j3=o("()."),E3=p(),Aa=n("div"),_(ml.$$.fragment),q3=p(),ys=n("p"),A3=o("Preprocess will take the "),Bu=n("code"),D3=o("input_"),C3=o(` of a specific pipeline and return a dictionnary of everything necessary for
`),Zu=n("code"),z3=o("_forward"),I3=o(" to run properly. It should contain at least one tensor, but might have arbitrary other items."),S3=p(),Da=n("div"),_(hl.$$.fragment),M3=p(),Yu=n("p"),F3=o("Save the pipeline\u2019s model and tokenizer."),L3=p(),Ca=n("div"),_(fl.$$.fragment),O3=p(),ul=n("p"),N3=o("Scikit / Keras interface to transformers\u2019 pipelines. This method will forward to "),Ku=n("strong"),U3=o("call"),G3=o("()."),this.h()},l(t){const m=wI('[data-svelte="svelte-1phssyn"]',document.head);u=a(m,"META",{name:!0,content:!0}),m.forEach(s),T=c(t),y=a(t,"H1",{class:!0});var gl=r(y);f=a(gl,"A",{id:!0,class:!0,href:!0});var Xu=r(f);P=a(Xu,"SPAN",{});var Ju=r(P);b(l.$$.fragment,Ju),Ju.forEach(s),Xu.forEach(s),g=c(gl),He=a(gl,"SPAN",{});var eg=r(He);Ev=i(eg,"Pipelines"),eg.forEach(s),gl.forEach(s),wg=c(t),Ps=a(t,"P",{});var _l=r(Ps);qv=i(_l,`The pipelines are a great and easy way to use models for inference. These pipelines are objects that abstract most of
the complex code from the library, offering a simple API dedicated to several tasks, including Named Entity
Recognition, Masked Language Modeling, Sentiment Analysis, Feature Extraction and Question Answering. See the
`),jl=a(_l,"A",{href:!0});var tg=r(jl);Av=i(tg,"task summary"),tg.forEach(s),Dv=i(_l," for examples of use."),_l.forEach(s),xg=c(t),El=a(t,"P",{});var sg=r(El);Cv=i(sg,"There are two categories of pipeline abstractions to be aware about:"),sg.forEach(s),kg=c(t),Ts=a(t,"UL",{});var bl=r(Ts);Na=a(bl,"LI",{});var vl=r(Na);zv=i(vl,"The "),ql=a(vl,"A",{href:!0});var ng=r(ql);Iv=i(ng,"pipeline()"),ng.forEach(s),Sv=i(vl," which is the most powerful object encapsulating all other pipelines."),vl.forEach(s),Mv=c(bl),Ie=a(bl,"LI",{});var Le=r(Ie);Fv=i(Le,"Task-specific pipelines are available for "),Al=a(Le,"A",{href:!0});var ag=r(Al);Lv=i(ag,"audio"),ag.forEach(s),Ov=i(Le,", "),Dl=a(Le,"A",{href:!0});var rg=r(Dl);Nv=i(rg,"computer vision"),rg.forEach(s),Uv=i(Le,", "),Cl=a(Le,"A",{href:!0});var og=r(Cl);Gv=i(og,"natural language processing"),og.forEach(s),Rv=i(Le,", and "),zl=a(Le,"A",{href:!0});var ig=r(zl);Qv=i(ig,"multimodal"),ig.forEach(s),Hv=i(Le," tasks."),Le.forEach(s),bl.forEach(s),yg=c(t),dt=a(t,"H2",{class:!0});var wl=r(dt);$s=a(wl,"A",{id:!0,class:!0,href:!0});var lg=r($s);cd=a(lg,"SPAN",{});var pg=r(cd);b(Ua.$$.fragment,pg),pg.forEach(s),lg.forEach(s),Vv=c(wl),dd=a(wl,"SPAN",{});var cg=r(dd);Wv=i(cg,"The pipeline abstraction"),cg.forEach(s),wl.forEach(s),Pg=c(t),js=a(t,"P",{});var xl=r(js);Bv=i(xl,"The "),md=a(xl,"EM",{});var dg=r(md);Zv=i(dg,"pipeline"),dg.forEach(s),Yv=i(xl,` abstraction is a wrapper around all the other available pipelines. It is instantiated as any other
pipeline but can provide additional quality of life.`),xl.forEach(s),Tg=c(t),Il=a(t,"P",{});var mg=r(Il);Kv=i(mg,"Simple call on one item:"),mg.forEach(s),$g=c(t),b(Ga.$$.fragment,t),jg=c(t),Es=a(t,"P",{});var kl=r(Es);Xv=i(kl,"If you want to use a specific model from the "),Ra=a(kl,"A",{href:!0,rel:!0});var hg=r(Ra);Jv=i(hg,"hub"),hg.forEach(s),ew=i(kl,` you can ignore the task if the model on
the hub already defines it:`),kl.forEach(s),Eg=c(t),b(Qa.$$.fragment,t),qg=c(t),qs=a(t,"P",{});var yl=r(qs);tw=i(yl,"To call a pipeline on many items, you can either call with a "),hd=a(yl,"EM",{});var fg=r(hd);sw=i(fg,"list"),fg.forEach(s),nw=i(yl,"."),yl.forEach(s),Ag=c(t),b(Ha.$$.fragment,t),Dg=c(t),As=a(t,"P",{});var Pl=r(As);aw=i(Pl,"To iterate of full datasets it is recommended to use a "),fd=a(Pl,"CODE",{});var ug=r(fd);rw=i(ug,"dataset"),ug.forEach(s),ow=i(Pl,` directly. This means you don\u2019t need to allocate
the whole dataset at once, nor do you need to do batching yourself. This should work just as fast as custom loops on
GPU. If it doesn\u2019t don\u2019t hesitate to create an issue.`),Pl.forEach(s),Cg=c(t),b(Va.$$.fragment,t),zg=c(t),Sl=a(t,"P",{});var gg=r(Sl);iw=i(gg,"For ease of use, a generator is also possible:"),gg.forEach(s),Ig=c(t),b(Wa.$$.fragment,t),Sg=c(t),ge=a(t,"DIV",{class:!0});var Oe=r(ge);b(Ba.$$.fragment,Oe),lw=c(Oe),Za=a(Oe,"P",{});var Tl=r(Za);pw=i(Tl,"Utility factory method to build a "),Ml=a(Tl,"A",{href:!0});var _g=r(Ml);cw=i(_g,"Pipeline"),_g.forEach(s),dw=i(Tl,"."),Tl.forEach(s),mw=c(Oe),ud=a(Oe,"P",{});var d6=r(ud);hw=i(d6,"Pipelines are made of:"),d6.forEach(s),fw=c(Oe),mt=a(Oe,"UL",{});var yc=r(mt);Ya=a(yc,"LI",{});var vb=r(Ya);uw=i(vb,"A "),Fl=a(vb,"A",{href:!0});var m6=r(Fl);gw=i(m6,"tokenizer"),m6.forEach(s),_w=i(vb," in charge of mapping raw textual input to token."),vb.forEach(s),bw=c(yc),Ka=a(yc,"LI",{});var wb=r(Ka);vw=i(wb,"A "),Ll=a(wb,"A",{href:!0});var h6=r(Ll);ww=i(h6,"model"),h6.forEach(s),xw=i(wb," to make predictions from the inputs."),wb.forEach(s),kw=c(yc),gd=a(yc,"LI",{});var f6=r(gd);yw=i(f6,"Some (optional) post processing for enhancing model\u2019s output."),f6.forEach(s),yc.forEach(s),Pw=c(Oe),b(Ds.$$.fragment,Oe),Oe.forEach(s),Mg=c(t),ht=a(t,"H2",{class:!0});var xb=r(ht);Cs=a(xb,"A",{id:!0,class:!0,href:!0});var u6=r(Cs);_d=a(u6,"SPAN",{});var g6=r(_d);b(Xa.$$.fragment,g6),g6.forEach(s),u6.forEach(s),Tw=c(xb),bd=a(xb,"SPAN",{});var _6=r(bd);$w=i(_6,"Pipeline batching"),_6.forEach(s),xb.forEach(s),Fg=c(t),Je=a(t,"P",{});var Pc=r(Je);jw=i(Pc,`All pipelines can use batching. This will work
whenever the pipeline uses its streaming ability (so when passing lists or `),vd=a(Pc,"CODE",{});var b6=r(vd);Ew=i(b6,"Dataset"),b6.forEach(s),qw=i(Pc," or "),wd=a(Pc,"CODE",{});var v6=r(wd);Aw=i(v6,"generator"),v6.forEach(s),Dw=i(Pc,")."),Pc.forEach(s),Lg=c(t),b(Ja.$$.fragment,t),Og=c(t),b(zs.$$.fragment,t),Ng=c(t),b(er.$$.fragment,t),Ug=c(t),b(tr.$$.fragment,t),Gg=c(t),Ol=a(t,"P",{});var w6=r(Ol);Cw=i(w6,"Example where it\u2019s most a slowdown:"),w6.forEach(s),Rg=c(t),b(sr.$$.fragment,t),Qg=c(t),Is=a(t,"P",{});var kb=r(Is);zw=i(kb,"This is a occasional very long sentence compared to the other. In that case, the "),xd=a(kb,"STRONG",{});var x6=r(xd);Iw=i(x6,"whole"),x6.forEach(s),Sw=i(kb,` batch will need to be 400
tokens long, so the whole batch will be [64, 400] instead of [64, 4], leading to the high slowdown. Even worse, on
bigger batches, the program simply crashes.`),kb.forEach(s),Hg=c(t),b(nr.$$.fragment,t),Vg=c(t),Nl=a(t,"P",{});var k6=r(Nl);Mw=i(k6,`There are no good (general) solutions for this problem, and your mileage may vary depending on your use cases. Rule of
thumb:`),k6.forEach(s),Wg=c(t),Ul=a(t,"P",{});var y6=r(Ul);Fw=i(y6,"For users, a rule of thumb is:"),y6.forEach(s),Bg=c(t),_e=a(t,"UL",{});var it=r(_e);kd=a(it,"LI",{});var P6=r(kd);yd=a(P6,"P",{});var T6=r(yd);Pd=a(T6,"STRONG",{});var $6=r(Pd);Lw=i($6,`Measure performance on your load, with your hardware. Measure, measure, and keep measuring. Real numbers are the
only way to go.`),$6.forEach(s),T6.forEach(s),P6.forEach(s),Ow=c(it),Td=a(it,"LI",{});var j6=r(Td);$d=a(j6,"P",{});var E6=r($d);Nw=i(E6,"If you are latency constrained (live product doing inference), don\u2019t batch"),E6.forEach(s),j6.forEach(s),Uw=c(it),jd=a(it,"LI",{});var q6=r(jd);Ed=a(q6,"P",{});var A6=r(Ed);Gw=i(A6,"If you are using CPU, don\u2019t batch."),A6.forEach(s),q6.forEach(s),Rw=c(it),ar=a(it,"LI",{});var yb=r(ar);qd=a(yb,"P",{});var D6=r(qd);Qw=i(D6,"If you are using throughput (you want to run your model on a bunch of static data), on GPU, then:"),D6.forEach(s),Hw=c(yb),ft=a(yb,"UL",{});var Tc=r(ft);Ad=a(Tc,"LI",{});var C6=r(Ad);Vw=i(C6,`If you have no clue about the size of the sequence_length (\u201Cnatural\u201D data), by default don\u2019t batch, measure and
try tentatively to add it, add OOM checks to recover when it will fail (and it will at some point if you don\u2019t
control the sequence_length.)`),C6.forEach(s),Ww=c(Tc),Dd=a(Tc,"LI",{});var z6=r(Dd);Bw=i(z6,`If your sequence_length is super regular, then batching is more likely to be VERY interesting, measure and push
it until you get OOMs.`),z6.forEach(s),Zw=c(Tc),Cd=a(Tc,"LI",{});var I6=r(Cd);Yw=i(I6,"The larger the GPU the more likely batching is going to be more interesting"),I6.forEach(s),Tc.forEach(s),yb.forEach(s),Kw=c(it),zd=a(it,"LI",{});var S6=r(zd);Id=a(S6,"P",{});var M6=r(Id);Xw=i(M6,"As soon as you enable batching, make sure you can handle OOMs nicely."),M6.forEach(s),S6.forEach(s),it.forEach(s),Zg=c(t),ut=a(t,"H2",{class:!0});var Pb=r(ut);Ss=a(Pb,"A",{id:!0,class:!0,href:!0});var F6=r(Ss);Sd=a(F6,"SPAN",{});var L6=r(Sd);b(rr.$$.fragment,L6),L6.forEach(s),F6.forEach(s),Jw=c(Pb),Md=a(Pb,"SPAN",{});var O6=r(Md);ex=i(O6,"Pipeline chunk batching"),O6.forEach(s),Pb.forEach(s),Yg=c(t),Ve=a(t,"P",{});var $l=r(Ve);Fd=a($l,"CODE",{});var N6=r(Fd);tx=i(N6,"zero-shot-classification"),N6.forEach(s),sx=i($l," and "),Ld=a($l,"CODE",{});var U6=r(Ld);nx=i(U6,"question-answering"),U6.forEach(s),ax=i($l,` are slightly specific in the sense, that a single input might yield
multiple forward pass of a model. Under normal circumstances, this would yield issues with `),Od=a($l,"CODE",{});var G6=r(Od);rx=i(G6,"batch_size"),G6.forEach(s),ox=i($l," argument."),$l.forEach(s),Kg=c(t),et=a(t,"P",{});var $c=r(et);ix=i($c,"In order to circumvent this issue, both of these pipelines are a bit specific, they are "),Nd=a($c,"CODE",{});var R6=r(Nd);lx=i(R6,"ChunkPipeline"),R6.forEach(s),px=i($c,` instead of
regular `),Ud=a($c,"CODE",{});var Q6=r(Ud);cx=i(Q6,"Pipeline"),Q6.forEach(s),dx=i($c,". In short:"),$c.forEach(s),Xg=c(t),b(or.$$.fragment,t),Jg=c(t),Gl=a(t,"P",{});var H6=r(Gl);mx=i(H6,"Now becomes:"),H6.forEach(s),e_=c(t),b(ir.$$.fragment,t),t_=c(t),Rl=a(t,"P",{});var V6=r(Rl);hx=i(V6,`This should be very transparent to your code because the pipelines are used in
the same way.`),V6.forEach(s),s_=c(t),Ms=a(t,"P",{});var Tb=r(Ms);fx=i(Tb,`This is a simplified view, since the pipeline can handle automatically the batch to ! Meaning you don\u2019t have to care
about how many forward passes you inputs are actually going to trigger, you can optimize the `),Gd=a(Tb,"CODE",{});var W6=r(Gd);ux=i(W6,"batch_size"),W6.forEach(s),gx=i(Tb,`
independently of the inputs. The caveats from the previous section still apply.`),Tb.forEach(s),n_=c(t),gt=a(t,"H2",{class:!0});var $b=r(gt);Fs=a($b,"A",{id:!0,class:!0,href:!0});var B6=r(Fs);Rd=a(B6,"SPAN",{});var Z6=r(Rd);b(lr.$$.fragment,Z6),Z6.forEach(s),B6.forEach(s),_x=c($b),Qd=a($b,"SPAN",{});var Y6=r(Qd);bx=i(Y6,"Pipeline custom code"),Y6.forEach(s),$b.forEach(s),a_=c(t),Ql=a(t,"P",{});var K6=r(Ql);vx=i(K6,"If you want to override a specific pipeline."),K6.forEach(s),r_=c(t),Ls=a(t,"P",{});var jb=r(Ls);wx=i(jb,`Don\u2019t hesitate to create an issue for your task at hand, the goal of the pipeline is to be easy to use and support most
cases, so `),Hd=a(jb,"CODE",{});var X6=r(Hd);xx=i(X6,"transformers"),X6.forEach(s),kx=i(jb," could maybe support your use case."),jb.forEach(s),o_=c(t),Hl=a(t,"P",{});var J6=r(Hl);yx=i(J6,"If you want to try simply you can:"),J6.forEach(s),i_=c(t),Vl=a(t,"UL",{});var eA=r(Vl);Vd=a(eA,"LI",{});var tA=r(Vd);Px=i(tA,"Subclass your pipeline of choice"),tA.forEach(s),eA.forEach(s),l_=c(t),b(pr.$$.fragment,t),p_=c(t),Wl=a(t,"P",{});var sA=r(Wl);Tx=i(sA,"That should enable you to do all the custom code you want."),sA.forEach(s),c_=c(t),_t=a(t,"H2",{class:!0});var Eb=r(_t);Os=a(Eb,"A",{id:!0,class:!0,href:!0});var nA=r(Os);Wd=a(nA,"SPAN",{});var aA=r(Wd);b(cr.$$.fragment,aA),aA.forEach(s),nA.forEach(s),$x=c(Eb),Bd=a(Eb,"SPAN",{});var rA=r(Bd);jx=i(rA,"Implementing a pipeline"),rA.forEach(s),Eb.forEach(s),d_=c(t),Bl=a(t,"P",{});var oA=r(Bl);Zl=a(oA,"A",{href:!0});var iA=r(Zl);Ex=i(iA,"Implementing a new pipeline"),iA.forEach(s),oA.forEach(s),m_=c(t),bt=a(t,"H2",{class:!0});var qb=r(bt);Ns=a(qb,"A",{id:!0,class:!0,href:!0});var lA=r(Ns);Zd=a(lA,"SPAN",{});var pA=r(Zd);b(dr.$$.fragment,pA),pA.forEach(s),lA.forEach(s),qx=c(qb),Yd=a(qb,"SPAN",{});var cA=r(Yd);Ax=i(cA,"Audio"),cA.forEach(s),qb.forEach(s),h_=c(t),Yl=a(t,"P",{});var dA=r(Yl);Dx=i(dA,"Pipelines available for audio tasks include the following."),dA.forEach(s),f_=c(t),vt=a(t,"H3",{class:!0});var Ab=r(vt);Us=a(Ab,"A",{id:!0,class:!0,href:!0});var mA=r(Us);Kd=a(mA,"SPAN",{});var hA=r(Kd);b(mr.$$.fragment,hA),hA.forEach(s),mA.forEach(s),Cx=c(Ab),Xd=a(Ab,"SPAN",{});var fA=r(Xd);zx=i(fA,"AudioClassificationPipeline"),fA.forEach(s),Ab.forEach(s),u_=c(t),Q=a(t,"DIV",{class:!0});var be=r(Q);b(hr.$$.fragment,be),Ix=c(be),fr=a(be,"P",{});var Db=r(fr);Sx=i(Db,"Audio classification pipeline using any "),Jd=a(Db,"CODE",{});var uA=r(Jd);Mx=i(uA,"AutoModelForAudioClassification"),uA.forEach(s),Fx=i(Db,`. This pipeline predicts the class of a
raw waveform or an audio file. In case of an audio file, ffmpeg should be installed to support multiple audio
formats.`),Db.forEach(s),Lx=c(be),b(Gs.$$.fragment,be),Ox=c(be),Kl=a(be,"P",{});var R3=r(Kl);Nx=i(R3,"Learn more about the basics of using a pipeline in the "),Xl=a(R3,"A",{href:!0});var gA=r(Xl);Ux=i(gA,"pipeline tutorial"),gA.forEach(s),R3.forEach(s),Gx=c(be),wt=a(be,"P",{});var jc=r(wt);Rx=i(jc,"This pipeline can currently be loaded from "),Jl=a(jc,"A",{href:!0});var _A=r(Jl);Qx=i(_A,"pipeline()"),_A.forEach(s),Hx=i(jc,` using the following task identifier:
`),em=a(jc,"CODE",{});var bA=r(em);Vx=i(bA,'"audio-classification"'),bA.forEach(s),Wx=i(jc,"."),jc.forEach(s),Bx=c(be),ur=a(be,"P",{});var Cb=r(ur);Zx=i(Cb,`See the list of available models on
`),gr=a(Cb,"A",{href:!0,rel:!0});var vA=r(gr);Yx=i(vA,"huggingface.co/models"),vA.forEach(s),Kx=i(Cb,"."),Cb.forEach(s),Xx=c(be),Rs=a(be,"DIV",{class:!0});var zb=r(Rs);b(_r.$$.fragment,zb),Jx=c(zb),br=a(zb,"P",{});var Ib=r(br);e1=i(Ib,"Classify the sequence(s) given as inputs. See the "),ep=a(Ib,"A",{href:!0});var wA=r(ep);t1=i(wA,"AutomaticSpeechRecognitionPipeline"),wA.forEach(s),s1=i(Ib,` documentation for more
information.`),Ib.forEach(s),zb.forEach(s),be.forEach(s),g_=c(t),xt=a(t,"H3",{class:!0});var Sb=r(xt);Qs=a(Sb,"A",{id:!0,class:!0,href:!0});var xA=r(Qs);tm=a(xA,"SPAN",{});var kA=r(tm);b(vr.$$.fragment,kA),kA.forEach(s),xA.forEach(s),n1=c(Sb),sm=a(Sb,"SPAN",{});var yA=r(sm);a1=i(yA,"AutomaticSpeechRecognitionPipeline"),yA.forEach(s),Sb.forEach(s),__=c(t),ie=a(t,"DIV",{class:!0});var Ue=r(ie);b(wr.$$.fragment,Ue),r1=c(Ue),nm=a(Ue,"P",{});var PA=r(nm);o1=i(PA,"Pipeline that aims at extracting spoken text contained within some audio."),PA.forEach(s),i1=c(Ue),am=a(Ue,"P",{});var TA=r(am);l1=i(TA,`The input can be either a raw waveform or a audio file. In case of the audio file, ffmpeg should be installed for
to support multiple audio formats`),TA.forEach(s),p1=c(Ue),b(Hs.$$.fragment,Ue),c1=c(Ue),tp=a(Ue,"P",{});var Q3=r(tp);d1=i(Q3,"Learn more about the basics of using a pipeline in the "),sp=a(Q3,"A",{href:!0});var $A=r(sp);m1=i($A,"pipeline tutorial"),$A.forEach(s),Q3.forEach(s),h1=c(Ue),Vs=a(Ue,"DIV",{class:!0});var Mb=r(Vs);b(xr.$$.fragment,Mb),f1=c(Mb),kr=a(Mb,"P",{});var Fb=r(kr);u1=i(Fb,"Transcribe the audio sequence(s) given as inputs to text. See the "),np=a(Fb,"A",{href:!0});var jA=r(np);g1=i(jA,"AutomaticSpeechRecognitionPipeline"),jA.forEach(s),_1=i(Fb,`
documentation for more information.`),Fb.forEach(s),Mb.forEach(s),Ue.forEach(s),b_=c(t),kt=a(t,"H2",{class:!0});var Lb=r(kt);Ws=a(Lb,"A",{id:!0,class:!0,href:!0});var EA=r(Ws);rm=a(EA,"SPAN",{});var qA=r(rm);b(yr.$$.fragment,qA),qA.forEach(s),EA.forEach(s),b1=c(Lb),om=a(Lb,"SPAN",{});var AA=r(om);v1=i(AA,"Computer vision"),AA.forEach(s),Lb.forEach(s),v_=c(t),ap=a(t,"P",{});var DA=r(ap);w1=i(DA,"Pipelines available for computer vision tasks include the following."),DA.forEach(s),w_=c(t),yt=a(t,"H3",{class:!0});var Ob=r(yt);Bs=a(Ob,"A",{id:!0,class:!0,href:!0});var CA=r(Bs);im=a(CA,"SPAN",{});var zA=r(im);b(Pr.$$.fragment,zA),zA.forEach(s),CA.forEach(s),x1=c(Ob),lm=a(Ob,"SPAN",{});var IA=r(lm);k1=i(IA,"DepthEstimationPipeline"),IA.forEach(s),Ob.forEach(s),x_=c(t),H=a(t,"DIV",{class:!0});var ve=r(H);b(Tr.$$.fragment,ve),y1=c(ve),$r=a(ve,"P",{});var Nb=r($r);P1=i(Nb,"Depth estimation pipeline using any "),pm=a(Nb,"CODE",{});var SA=r(pm);T1=i(SA,"AutoModelForDepthEstimation"),SA.forEach(s),$1=i(Nb,". This pipeline predicts the depth of an image."),Nb.forEach(s),j1=c(ve),b(Zs.$$.fragment,ve),E1=c(ve),rp=a(ve,"P",{});var H3=r(rp);q1=i(H3,"Learn more about the basics of using a pipeline in the "),op=a(H3,"A",{href:!0});var MA=r(op);A1=i(MA,"pipeline tutorial"),MA.forEach(s),H3.forEach(s),D1=c(ve),Pt=a(ve,"P",{});var Ec=r(Pt);C1=i(Ec,"This depth estimation pipeline can currently be loaded from "),ip=a(Ec,"A",{href:!0});var FA=r(ip);z1=i(FA,"pipeline()"),FA.forEach(s),I1=i(Ec,` using the following task identifier:
`),cm=a(Ec,"CODE",{});var LA=r(cm);S1=i(LA,'"depth-estimation"'),LA.forEach(s),M1=i(Ec,"."),Ec.forEach(s),F1=c(ve),jr=a(ve,"P",{});var Ub=r(jr);L1=i(Ub,"See the list of available models on "),Er=a(Ub,"A",{href:!0,rel:!0});var OA=r(Er);O1=i(OA,"huggingface.co/models"),OA.forEach(s),N1=i(Ub,"."),Ub.forEach(s),U1=c(ve),Ys=a(ve,"DIV",{class:!0});var Gb=r(Ys);b(qr.$$.fragment,Gb),G1=c(Gb),dm=a(Gb,"P",{});var NA=r(dm);R1=i(NA,"Assign labels to the image(s) passed as inputs."),NA.forEach(s),Gb.forEach(s),ve.forEach(s),k_=c(t),Tt=a(t,"H3",{class:!0});var Rb=r(Tt);Ks=a(Rb,"A",{id:!0,class:!0,href:!0});var UA=r(Ks);mm=a(UA,"SPAN",{});var GA=r(mm);b(Ar.$$.fragment,GA),GA.forEach(s),UA.forEach(s),Q1=c(Rb),hm=a(Rb,"SPAN",{});var RA=r(hm);H1=i(RA,"ImageClassificationPipeline"),RA.forEach(s),Rb.forEach(s),y_=c(t),V=a(t,"DIV",{class:!0});var we=r(V);b(Dr.$$.fragment,we),V1=c(we),Cr=a(we,"P",{});var Qb=r(Cr);W1=i(Qb,"Image classification pipeline using any "),fm=a(Qb,"CODE",{});var QA=r(fm);B1=i(QA,"AutoModelForImageClassification"),QA.forEach(s),Z1=i(Qb,`. This pipeline predicts the class of an
image.`),Qb.forEach(s),Y1=c(we),b(Xs.$$.fragment,we),K1=c(we),lp=a(we,"P",{});var V3=r(lp);X1=i(V3,"Learn more about the basics of using a pipeline in the "),pp=a(V3,"A",{href:!0});var HA=r(pp);J1=i(HA,"pipeline tutorial"),HA.forEach(s),V3.forEach(s),ek=c(we),$t=a(we,"P",{});var qc=r($t);tk=i(qc,"This image classification pipeline can currently be loaded from "),cp=a(qc,"A",{href:!0});var VA=r(cp);sk=i(VA,"pipeline()"),VA.forEach(s),nk=i(qc,` using the following task identifier:
`),um=a(qc,"CODE",{});var WA=r(um);ak=i(WA,'"image-classification"'),WA.forEach(s),rk=i(qc,"."),qc.forEach(s),ok=c(we),zr=a(we,"P",{});var Hb=r(zr);ik=i(Hb,`See the list of available models on
`),Ir=a(Hb,"A",{href:!0,rel:!0});var BA=r(Ir);lk=i(BA,"huggingface.co/models"),BA.forEach(s),pk=i(Hb,"."),Hb.forEach(s),ck=c(we),Js=a(we,"DIV",{class:!0});var Vb=r(Js);b(Sr.$$.fragment,Vb),dk=c(Vb),gm=a(Vb,"P",{});var ZA=r(gm);mk=i(ZA,"Assign labels to the image(s) passed as inputs."),ZA.forEach(s),Vb.forEach(s),we.forEach(s),P_=c(t),jt=a(t,"H3",{class:!0});var Wb=r(jt);en=a(Wb,"A",{id:!0,class:!0,href:!0});var YA=r(en);_m=a(YA,"SPAN",{});var KA=r(_m);b(Mr.$$.fragment,KA),KA.forEach(s),YA.forEach(s),hk=c(Wb),bm=a(Wb,"SPAN",{});var XA=r(bm);fk=i(XA,"ImageSegmentationPipeline"),XA.forEach(s),Wb.forEach(s),T_=c(t),le=a(t,"DIV",{class:!0});var Ge=r(le);b(Fr.$$.fragment,Ge),uk=c(Ge),Lr=a(Ge,"P",{});var Bb=r(Lr);gk=i(Bb,"Image segmentation pipeline using any "),vm=a(Bb,"CODE",{});var JA=r(vm);_k=i(JA,"AutoModelForXXXSegmentation"),JA.forEach(s),bk=i(Bb,`. This pipeline predicts masks of objects and
their classes.`),Bb.forEach(s),vk=c(Ge),b(tn.$$.fragment,Ge),wk=c(Ge),Et=a(Ge,"P",{});var Ac=r(Et);xk=i(Ac,"This image segmentation pipeline can currently be loaded from "),dp=a(Ac,"A",{href:!0});var e8=r(dp);kk=i(e8,"pipeline()"),e8.forEach(s),yk=i(Ac,` using the following task identifier:
`),wm=a(Ac,"CODE",{});var t8=r(wm);Pk=i(t8,'"image-segmentation"'),t8.forEach(s),Tk=i(Ac,"."),Ac.forEach(s),$k=c(Ge),Or=a(Ge,"P",{});var Zb=r(Or);jk=i(Zb,`See the list of available models on
`),Nr=a(Zb,"A",{href:!0,rel:!0});var s8=r(Nr);Ek=i(s8,"huggingface.co/models"),s8.forEach(s),qk=i(Zb,"."),Zb.forEach(s),Ak=c(Ge),sn=a(Ge,"DIV",{class:!0});var Yb=r(sn);b(Ur.$$.fragment,Yb),Dk=c(Yb),xm=a(Yb,"P",{});var n8=r(xm);Ck=i(n8,"Perform segmentation (detect masks & classes) in the image(s) passed as inputs."),n8.forEach(s),Yb.forEach(s),Ge.forEach(s),$_=c(t),qt=a(t,"H3",{class:!0});var Kb=r(qt);nn=a(Kb,"A",{id:!0,class:!0,href:!0});var a8=r(nn);km=a(a8,"SPAN",{});var r8=r(km);b(Gr.$$.fragment,r8),r8.forEach(s),a8.forEach(s),zk=c(Kb),ym=a(Kb,"SPAN",{});var o8=r(ym);Ik=i(o8,"ObjectDetectionPipeline"),o8.forEach(s),Kb.forEach(s),j_=c(t),W=a(t,"DIV",{class:!0});var xe=r(W);b(Rr.$$.fragment,xe),Sk=c(xe),Qr=a(xe,"P",{});var Xb=r(Qr);Mk=i(Xb,"Object detection pipeline using any "),Pm=a(Xb,"CODE",{});var i8=r(Pm);Fk=i(i8,"AutoModelForObjectDetection"),i8.forEach(s),Lk=i(Xb,`. This pipeline predicts bounding boxes of objects
and their classes.`),Xb.forEach(s),Ok=c(xe),b(an.$$.fragment,xe),Nk=c(xe),mp=a(xe,"P",{});var W3=r(mp);Uk=i(W3,"Learn more about the basics of using a pipeline in the "),hp=a(W3,"A",{href:!0});var l8=r(hp);Gk=i(l8,"pipeline tutorial"),l8.forEach(s),W3.forEach(s),Rk=c(xe),At=a(xe,"P",{});var Dc=r(At);Qk=i(Dc,"This object detection pipeline can currently be loaded from "),fp=a(Dc,"A",{href:!0});var p8=r(fp);Hk=i(p8,"pipeline()"),p8.forEach(s),Vk=i(Dc,` using the following task identifier:
`),Tm=a(Dc,"CODE",{});var c8=r(Tm);Wk=i(c8,'"object-detection"'),c8.forEach(s),Bk=i(Dc,"."),Dc.forEach(s),Zk=c(xe),Hr=a(xe,"P",{});var Jb=r(Hr);Yk=i(Jb,"See the list of available models on "),Vr=a(Jb,"A",{href:!0,rel:!0});var d8=r(Vr);Kk=i(d8,"huggingface.co/models"),d8.forEach(s),Xk=i(Jb,"."),Jb.forEach(s),Jk=c(xe),rn=a(xe,"DIV",{class:!0});var e2=r(rn);b(Wr.$$.fragment,e2),ey=c(e2),$m=a(e2,"P",{});var m8=r($m);ty=i(m8,"Detect objects (bounding boxes & classes) in the image(s) passed as inputs."),m8.forEach(s),e2.forEach(s),xe.forEach(s),E_=c(t),Dt=a(t,"H3",{class:!0});var t2=r(Dt);on=a(t2,"A",{id:!0,class:!0,href:!0});var h8=r(on);jm=a(h8,"SPAN",{});var f8=r(jm);b(Br.$$.fragment,f8),f8.forEach(s),h8.forEach(s),sy=c(t2),Em=a(t2,"SPAN",{});var u8=r(Em);ny=i(u8,"ZeroShotImageClassificationPipeline"),u8.forEach(s),t2.forEach(s),q_=c(t),B=a(t,"DIV",{class:!0});var ke=r(B);b(Zr.$$.fragment,ke),ay=c(ke),Ct=a(ke,"P",{});var Cc=r(Ct);ry=i(Cc,"Zero shot image classification pipeline using "),qm=a(Cc,"CODE",{});var g8=r(qm);oy=i(g8,"CLIPModel"),g8.forEach(s),iy=i(Cc,`. This pipeline predicts the class of an image when you
provide an image and a set of `),Am=a(Cc,"CODE",{});var _8=r(Am);ly=i(_8,"candidate_labels"),_8.forEach(s),py=i(Cc,"."),Cc.forEach(s),cy=c(ke),b(ln.$$.fragment,ke),dy=c(ke),up=a(ke,"P",{});var B3=r(up);my=i(B3,"Learn more about the basics of using a pipeline in the "),gp=a(B3,"A",{href:!0});var b8=r(gp);hy=i(b8,"pipeline tutorial"),b8.forEach(s),B3.forEach(s),fy=c(ke),zt=a(ke,"P",{});var zc=r(zt);uy=i(zc,"This image classification pipeline can currently be loaded from "),_p=a(zc,"A",{href:!0});var v8=r(_p);gy=i(v8,"pipeline()"),v8.forEach(s),_y=i(zc,` using the following task identifier:
`),Dm=a(zc,"CODE",{});var w8=r(Dm);by=i(w8,'"zero-shot-image-classification"'),w8.forEach(s),vy=i(zc,"."),zc.forEach(s),wy=c(ke),Yr=a(ke,"P",{});var s2=r(Yr);xy=i(s2,`See the list of available models on
`),Kr=a(s2,"A",{href:!0,rel:!0});var x8=r(Kr);ky=i(x8,"huggingface.co/models"),x8.forEach(s),yy=i(s2,"."),s2.forEach(s),Py=c(ke),pn=a(ke,"DIV",{class:!0});var n2=r(pn);b(Xr.$$.fragment,n2),Ty=c(n2),Cm=a(n2,"P",{});var k8=r(Cm);$y=i(k8,"Assign labels to the image(s) passed as inputs."),k8.forEach(s),n2.forEach(s),ke.forEach(s),A_=c(t),It=a(t,"H3",{class:!0});var a2=r(It);cn=a(a2,"A",{id:!0,class:!0,href:!0});var y8=r(cn);zm=a(y8,"SPAN",{});var P8=r(zm);b(Jr.$$.fragment,P8),P8.forEach(s),y8.forEach(s),jy=c(a2),Im=a(a2,"SPAN",{});var T8=r(Im);Ey=i(T8,"ZeroShotObjectDetectionPipeline"),T8.forEach(s),a2.forEach(s),D_=c(t),Z=a(t,"DIV",{class:!0});var ye=r(Z);b(eo.$$.fragment,ye),qy=c(ye),St=a(ye,"P",{});var Ic=r(St);Ay=i(Ic,"Zero shot object detection pipeline using "),Sm=a(Ic,"CODE",{});var $8=r(Sm);Dy=i($8,"OwlViTForObjectDetection"),$8.forEach(s),Cy=i(Ic,`. This pipeline predicts bounding boxes of
objects when you provide an image and a set of `),Mm=a(Ic,"CODE",{});var j8=r(Mm);zy=i(j8,"candidate_labels"),j8.forEach(s),Iy=i(Ic,"."),Ic.forEach(s),Sy=c(ye),b(dn.$$.fragment,ye),My=c(ye),bp=a(ye,"P",{});var Z3=r(bp);Fy=i(Z3,"Learn more about the basics of using a pipeline in the "),vp=a(Z3,"A",{href:!0});var E8=r(vp);Ly=i(E8,"pipeline tutorial"),E8.forEach(s),Z3.forEach(s),Oy=c(ye),Mt=a(ye,"P",{});var Sc=r(Mt);Ny=i(Sc,"This object detection pipeline can currently be loaded from "),wp=a(Sc,"A",{href:!0});var q8=r(wp);Uy=i(q8,"pipeline()"),q8.forEach(s),Gy=i(Sc,` using the following task identifier:
`),Fm=a(Sc,"CODE",{});var A8=r(Fm);Ry=i(A8,'"zero-shot-object-detection"'),A8.forEach(s),Qy=i(Sc,"."),Sc.forEach(s),Hy=c(ye),to=a(ye,"P",{});var r2=r(to);Vy=i(r2,`See the list of available models on
`),so=a(r2,"A",{href:!0,rel:!0});var D8=r(so);Wy=i(D8,"huggingface.co/models"),D8.forEach(s),By=i(r2,"."),r2.forEach(s),Zy=c(ye),mn=a(ye,"DIV",{class:!0});var o2=r(mn);b(no.$$.fragment,o2),Yy=c(o2),Lm=a(o2,"P",{});var C8=r(Lm);Ky=i(C8,"Detect objects (bounding boxes & classes) in the image(s) passed as inputs."),C8.forEach(s),o2.forEach(s),ye.forEach(s),C_=c(t),Ft=a(t,"H2",{class:!0});var i2=r(Ft);hn=a(i2,"A",{id:!0,class:!0,href:!0});var z8=r(hn);Om=a(z8,"SPAN",{});var I8=r(Om);b(ao.$$.fragment,I8),I8.forEach(s),z8.forEach(s),Xy=c(i2),Nm=a(i2,"SPAN",{});var S8=r(Nm);Jy=i(S8,"Natural Language Processing"),S8.forEach(s),i2.forEach(s),z_=c(t),xp=a(t,"P",{});var M8=r(xp);eP=i(M8,"Pipelines available for natural language processing tasks include the following."),M8.forEach(s),I_=c(t),Lt=a(t,"H3",{class:!0});var l2=r(Lt);fn=a(l2,"A",{id:!0,class:!0,href:!0});var F8=r(fn);Um=a(F8,"SPAN",{});var L8=r(Um);b(ro.$$.fragment,L8),L8.forEach(s),F8.forEach(s),tP=c(l2),Gm=a(l2,"SPAN",{});var O8=r(Gm);sP=i(O8,"ConversationalPipeline"),O8.forEach(s),l2.forEach(s),S_=c(t),Y=a(t,"DIV",{class:!0});var Pe=r(Y);b(oo.$$.fragment,Pe),nP=c(Pe),We=a(Pe,"P",{});var za=r(We);aP=i(za,`Utility class containing a conversation and its history. This class is meant to be used as an input to the
`),kp=a(za,"A",{href:!0});var N8=r(kp);rP=i(N8,"ConversationalPipeline"),N8.forEach(s),oP=i(za,`. The conversation contains a number of utility function to manage the addition of new
user input and generated model responses. A conversation needs to contain an unprocessed user input before being
passed to the `),yp=a(za,"A",{href:!0});var U8=r(yp);iP=i(U8,"ConversationalPipeline"),U8.forEach(s),lP=i(za,`. This user input is either created when the class is instantiated, or by
calling `),Rm=a(za,"CODE",{});var G8=r(Rm);pP=i(G8,'conversational_pipeline.append_response("input")'),G8.forEach(s),cP=i(za," after a conversation turn."),za.forEach(s),dP=c(Pe),b(un.$$.fragment,Pe),mP=c(Pe),gn=a(Pe,"DIV",{class:!0});var p2=r(gn);b(io.$$.fragment,p2),hP=c(p2),lo=a(p2,"P",{});var c2=r(lo);fP=i(c2,"Add a user input to the conversation for the next round. This populates the internal "),Qm=a(c2,"CODE",{});var R8=r(Qm);uP=i(R8,"new_user_input"),R8.forEach(s),gP=i(c2," field."),c2.forEach(s),p2.forEach(s),_P=c(Pe),_n=a(Pe,"DIV",{class:!0});var d2=r(_n);b(po.$$.fragment,d2),bP=c(d2),Hm=a(d2,"P",{});var Q8=r(Hm);vP=i(Q8,"Append a response to the list of generated responses."),Q8.forEach(s),d2.forEach(s),wP=c(Pe),tt=a(Pe,"DIV",{class:!0});var Mc=r(tt);b(co.$$.fragment,Mc),xP=c(Mc),Vm=a(Mc,"P",{});var H8=r(Vm);kP=i(H8,"Iterates over all blobs of the conversation."),H8.forEach(s),yP=c(Mc),Se=a(Mc,"P",{});var lt=r(Se);PP=i(lt,"Returns: Iterator of (is_user, text_chunk) in chronological order of the conversation. "),Wm=a(lt,"CODE",{});var V8=r(Wm);TP=i(V8,"is_user"),V8.forEach(s),$P=i(lt," is a "),Bm=a(lt,"CODE",{});var W8=r(Bm);jP=i(W8,"bool"),W8.forEach(s),EP=i(lt,`,
`),Zm=a(lt,"CODE",{});var B8=r(Zm);qP=i(B8,"text_chunks"),B8.forEach(s),AP=i(lt," is a "),Ym=a(lt,"CODE",{});var Z8=r(Ym);DP=i(Z8,"str"),Z8.forEach(s),CP=i(lt,"."),lt.forEach(s),Mc.forEach(s),zP=c(Pe),bn=a(Pe,"DIV",{class:!0});var m2=r(bn);b(mo.$$.fragment,m2),IP=c(m2),Be=a(m2,"P",{});var Ia=r(Be);SP=i(Ia,"Mark the conversation as processed (moves the content of "),Km=a(Ia,"CODE",{});var Y8=r(Km);MP=i(Y8,"new_user_input"),Y8.forEach(s),FP=i(Ia," to "),Xm=a(Ia,"CODE",{});var K8=r(Xm);LP=i(K8,"past_user_inputs"),K8.forEach(s),OP=i(Ia,`) and empties
the `),Jm=a(Ia,"CODE",{});var X8=r(Jm);NP=i(X8,"new_user_input"),X8.forEach(s),UP=i(Ia," field."),Ia.forEach(s),m2.forEach(s),Pe.forEach(s),M_=c(t),K=a(t,"DIV",{class:!0});var Te=r(K);b(ho.$$.fragment,Te),GP=c(Te),eh=a(Te,"P",{});var J8=r(eh);RP=i(J8,"Multi-turn conversational pipeline."),J8.forEach(s),QP=c(Te),b(vn.$$.fragment,Te),HP=c(Te),Pp=a(Te,"P",{});var Y3=r(Pp);VP=i(Y3,"Learn more about the basics of using a pipeline in the "),Tp=a(Y3,"A",{href:!0});var e9=r(Tp);WP=i(e9,"pipeline tutorial"),e9.forEach(s),Y3.forEach(s),BP=c(Te),Ot=a(Te,"P",{});var Fc=r(Ot);ZP=i(Fc,"This conversational pipeline can currently be loaded from "),$p=a(Fc,"A",{href:!0});var t9=r($p);YP=i(t9,"pipeline()"),t9.forEach(s),KP=i(Fc,` using the following task identifier:
`),th=a(Fc,"CODE",{});var s9=r(th);XP=i(s9,'"conversational"'),s9.forEach(s),JP=i(Fc,"."),Fc.forEach(s),e0=c(Te),Me=a(Te,"P",{});var pt=r(Me);t0=i(pt,`The models that this pipeline can use are models that have been fine-tuned on a multi-turn conversational task,
currently: `),sh=a(pt,"EM",{});var n9=r(sh);s0=i(n9,"\u2018microsoft/DialoGPT-small\u2019"),n9.forEach(s),n0=i(pt,", "),nh=a(pt,"EM",{});var a9=r(nh);a0=i(a9,"\u2018microsoft/DialoGPT-medium\u2019"),a9.forEach(s),r0=i(pt,", "),ah=a(pt,"EM",{});var r9=r(ah);o0=i(r9,"\u2018microsoft/DialoGPT-large\u2019"),r9.forEach(s),i0=i(pt,`. See the
up-to-date list of available models on
`),fo=a(pt,"A",{href:!0,rel:!0});var o9=r(fo);l0=i(o9,"huggingface.co/models"),o9.forEach(s),p0=i(pt,"."),pt.forEach(s),c0=c(Te),wn=a(Te,"DIV",{class:!0});var h2=r(wn);b(uo.$$.fragment,h2),d0=c(h2),rh=a(h2,"P",{});var i9=r(rh);m0=i(i9,"Generate responses for the conversation(s) given as inputs."),i9.forEach(s),h2.forEach(s),Te.forEach(s),F_=c(t),Nt=a(t,"H3",{class:!0});var f2=r(Nt);xn=a(f2,"A",{id:!0,class:!0,href:!0});var l9=r(xn);oh=a(l9,"SPAN",{});var p9=r(oh);b(go.$$.fragment,p9),p9.forEach(s),l9.forEach(s),h0=c(f2),ih=a(f2,"SPAN",{});var c9=r(ih);f0=i(c9,"FillMaskPipeline"),c9.forEach(s),f2.forEach(s),L_=c(t),O=a(t,"DIV",{class:!0});var he=r(O);b(_o.$$.fragment,he),u0=c(he),Ut=a(he,"P",{});var Lc=r(Ut);g0=i(Lc,"Masked language modeling prediction pipeline using any "),lh=a(Lc,"CODE",{});var d9=r(lh);_0=i(d9,"ModelWithLMHead"),d9.forEach(s),b0=i(Lc,". See the "),jp=a(Lc,"A",{href:!0});var m9=r(jp);v0=i(m9,`masked language modeling
examples`),m9.forEach(s),w0=i(Lc," for more information."),Lc.forEach(s),x0=c(he),b(kn.$$.fragment,he),k0=c(he),Ep=a(he,"P",{});var K3=r(Ep);y0=i(K3,"Learn more about the basics of using a pipeline in the "),qp=a(K3,"A",{href:!0});var h9=r(qp);P0=i(h9,"pipeline tutorial"),h9.forEach(s),K3.forEach(s),T0=c(he),Gt=a(he,"P",{});var Oc=r(Gt);$0=i(Oc,"This mask filling pipeline can currently be loaded from "),Ap=a(Oc,"A",{href:!0});var f9=r(Ap);j0=i(f9,"pipeline()"),f9.forEach(s),E0=i(Oc,` using the following task identifier:
`),ph=a(Oc,"CODE",{});var u9=r(ph);q0=i(u9,'"fill-mask"'),u9.forEach(s),A0=i(Oc,"."),Oc.forEach(s),D0=c(he),bo=a(he,"P",{});var u2=r(bo);C0=i(u2,`The models that this pipeline can use are models that have been trained with a masked language modeling objective,
which includes the bi-directional models in the library. See the up-to-date list of available models on
`),vo=a(u2,"A",{href:!0,rel:!0});var g9=r(vo);z0=i(g9,"huggingface.co/models"),g9.forEach(s),I0=i(u2,"."),u2.forEach(s),S0=c(he),b(yn.$$.fragment,he),M0=c(he),Pn=a(he,"DIV",{class:!0});var g2=r(Pn);b(wo.$$.fragment,g2),F0=c(g2),ch=a(g2,"P",{});var _9=r(ch);L0=i(_9,"Fill the masked token in the text(s) given as inputs."),_9.forEach(s),g2.forEach(s),he.forEach(s),O_=c(t),Rt=a(t,"H3",{class:!0});var _2=r(Rt);Tn=a(_2,"A",{id:!0,class:!0,href:!0});var b9=r(Tn);dh=a(b9,"SPAN",{});var v9=r(dh);b(xo.$$.fragment,v9),v9.forEach(s),b9.forEach(s),O0=c(_2),mh=a(_2,"SPAN",{});var w9=r(mh);N0=i(w9,"NerPipeline"),w9.forEach(s),_2.forEach(s),N_=c(t),S=a(t,"DIV",{class:!0});var R=r(S);b(ko.$$.fragment,R),U0=c(R),Qt=a(R,"P",{});var Nc=r(Qt);G0=i(Nc,"Named Entity Recognition pipeline using any "),hh=a(Nc,"CODE",{});var x9=r(hh);R0=i(x9,"ModelForTokenClassification"),x9.forEach(s),Q0=i(Nc,". See the "),Dp=a(Nc,"A",{href:!0});var k9=r(Dp);H0=i(k9,`named entity recognition
examples`),k9.forEach(s),V0=i(Nc," for more information."),Nc.forEach(s),W0=c(R),b($n.$$.fragment,R),B0=c(R),Cp=a(R,"P",{});var X3=r(Cp);Z0=i(X3,"Learn more about the basics of using a pipeline in the "),zp=a(X3,"A",{href:!0});var y9=r(zp);Y0=i(y9,"pipeline tutorial"),y9.forEach(s),X3.forEach(s),K0=c(R),Ht=a(R,"P",{});var Uc=r(Ht);X0=i(Uc,"This token recognition pipeline can currently be loaded from "),Ip=a(Uc,"A",{href:!0});var P9=r(Ip);J0=i(P9,"pipeline()"),P9.forEach(s),eT=i(Uc,` using the following task identifier:
`),fh=a(Uc,"CODE",{});var T9=r(fh);tT=i(T9,'"ner"'),T9.forEach(s),sT=i(Uc," (for predicting the classes of tokens in a sequence: person, organisation, location or miscellaneous)."),Uc.forEach(s),nT=c(R),yo=a(R,"P",{});var b2=r(yo);aT=i(b2,`The models that this pipeline can use are models that have been fine-tuned on a token classification task. See the
up-to-date list of available models on
`),Po=a(b2,"A",{href:!0,rel:!0});var $9=r(Po);rT=i($9,"huggingface.co/models"),$9.forEach(s),oT=i(b2,"."),b2.forEach(s),iT=c(R),st=a(R,"DIV",{class:!0});var Gc=r(st);b(To.$$.fragment,Gc),lT=c(Gc),uh=a(Gc,"P",{});var j9=r(uh);pT=i(j9,"Override tokens from a given word that disagree to force agreement on word boundaries."),j9.forEach(s),cT=c(Gc),gh=a(Gc,"P",{});var E9=r(gh);dT=i(E9,`Example: micro|soft| com|pany| B-ENT I-NAME I-ENT I-ENT will be rewritten with first strategy as microsoft|
company| B-ENT I-ENT`),E9.forEach(s),Gc.forEach(s),mT=c(R),jn=a(R,"DIV",{class:!0});var v2=r(jn);b($o.$$.fragment,v2),hT=c(v2),_h=a(v2,"P",{});var q9=r(_h);fT=i(q9,"Fuse various numpy arrays into dicts with all the information needed for aggregation"),q9.forEach(s),v2.forEach(s),uT=c(R),En=a(R,"DIV",{class:!0});var w2=r(En);b(jo.$$.fragment,w2),gT=c(w2),bh=a(w2,"P",{});var A9=r(bh);_T=i(A9,"Find and group together the adjacent tokens with the same entity predicted."),A9.forEach(s),w2.forEach(s),bT=c(R),qn=a(R,"DIV",{class:!0});var x2=r(qn);b(Eo.$$.fragment,x2),vT=c(x2),vh=a(x2,"P",{});var D9=r(vh);wT=i(D9,"Group together the adjacent tokens with the same entity predicted."),D9.forEach(s),x2.forEach(s),R.forEach(s),U_=c(t),An=a(t,"P",{});var k2=r(An);xT=i(k2,"See "),Sp=a(k2,"A",{href:!0});var C9=r(Sp);kT=i(C9,"TokenClassificationPipeline"),C9.forEach(s),yT=i(k2," for all details."),k2.forEach(s),G_=c(t),Vt=a(t,"H3",{class:!0});var y2=r(Vt);Dn=a(y2,"A",{id:!0,class:!0,href:!0});var z9=r(Dn);wh=a(z9,"SPAN",{});var I9=r(wh);b(qo.$$.fragment,I9),I9.forEach(s),z9.forEach(s),PT=c(y2),xh=a(y2,"SPAN",{});var S9=r(xh);TT=i(S9,"QuestionAnsweringPipeline"),S9.forEach(s),y2.forEach(s),R_=c(t),M=a(t,"DIV",{class:!0});var re=r(M);b(Ao.$$.fragment,re),$T=c(re),Wt=a(re,"P",{});var Rc=r(Wt);jT=i(Rc,"Question Answering pipeline using any "),kh=a(Rc,"CODE",{});var M9=r(kh);ET=i(M9,"ModelForQuestionAnswering"),M9.forEach(s),qT=i(Rc,". See the "),Mp=a(Rc,"A",{href:!0});var F9=r(Mp);AT=i(F9,`question answering
examples`),F9.forEach(s),DT=i(Rc," for more information."),Rc.forEach(s),CT=c(re),b(Cn.$$.fragment,re),zT=c(re),Fp=a(re,"P",{});var J3=r(Fp);IT=i(J3,"Learn more about the basics of using a pipeline in the "),Lp=a(J3,"A",{href:!0});var L9=r(Lp);ST=i(L9,"pipeline tutorial"),L9.forEach(s),J3.forEach(s),MT=c(re),Bt=a(re,"P",{});var Qc=r(Bt);FT=i(Qc,"This question answering pipeline can currently be loaded from "),Op=a(Qc,"A",{href:!0});var O9=r(Op);LT=i(O9,"pipeline()"),O9.forEach(s),OT=i(Qc,` using the following task identifier:
`),yh=a(Qc,"CODE",{});var N9=r(yh);NT=i(N9,'"question-answering"'),N9.forEach(s),UT=i(Qc,"."),Qc.forEach(s),GT=c(re),Do=a(re,"P",{});var P2=r(Do);RT=i(P2,`The models that this pipeline can use are models that have been fine-tuned on a question answering task. See the
up-to-date list of available models on
`),Co=a(P2,"A",{href:!0,rel:!0});var U9=r(Co);QT=i(U9,"huggingface.co/models"),U9.forEach(s),HT=i(P2,"."),P2.forEach(s),VT=c(re),zn=a(re,"DIV",{class:!0});var T2=r(zn);b(zo.$$.fragment,T2),WT=c(T2),Ph=a(T2,"P",{});var G9=r(Ph);BT=i(G9,"Answer the question(s) given as inputs by using the context(s)."),G9.forEach(s),T2.forEach(s),ZT=c(re),nt=a(re,"DIV",{class:!0});var Hc=r(nt);b(Io.$$.fragment,Hc),YT=c(Hc),Zt=a(Hc,"P",{});var Vc=r(Zt);KT=i(Vc,"QuestionAnsweringPipeline leverages the "),Th=a(Vc,"CODE",{});var R9=r(Th);XT=i(R9,"SquadExample"),R9.forEach(s),JT=i(Vc,` internally. This helper method encapsulate all the
logic for converting question(s) and context(s) to `),$h=a(Vc,"CODE",{});var Q9=r($h);e$=i(Q9,"SquadExample"),Q9.forEach(s),t$=i(Vc,"."),Vc.forEach(s),s$=c(Hc),jh=a(Hc,"P",{});var H9=r(jh);n$=i(H9,"We currently support extractive question answering."),H9.forEach(s),Hc.forEach(s),a$=c(re),In=a(re,"DIV",{class:!0});var $2=r(In);b(So.$$.fragment,$2),r$=c($2),Eh=a($2,"P",{});var V9=r(Eh);o$=i(V9,"When decoding from token probabilities, this method maps token indexes to actual word in the initial context."),V9.forEach(s),$2.forEach(s),re.forEach(s),Q_=c(t),Yt=a(t,"H3",{class:!0});var j2=r(Yt);Sn=a(j2,"A",{id:!0,class:!0,href:!0});var W9=r(Sn);qh=a(W9,"SPAN",{});var B9=r(qh);b(Mo.$$.fragment,B9),B9.forEach(s),W9.forEach(s),i$=c(j2),Ah=a(j2,"SPAN",{});var Z9=r(Ah);l$=i(Z9,"SummarizationPipeline"),Z9.forEach(s),j2.forEach(s),H_=c(t),pe=a(t,"DIV",{class:!0});var Re=r(pe);b(Fo.$$.fragment,Re),p$=c(Re),Dh=a(Re,"P",{});var Y9=r(Dh);c$=i(Y9,"Summarize news articles and other documents."),Y9.forEach(s),d$=c(Re),Kt=a(Re,"P",{});var Wc=r(Kt);m$=i(Wc,"This summarizing pipeline can currently be loaded from "),Np=a(Wc,"A",{href:!0});var K9=r(Np);h$=i(K9,"pipeline()"),K9.forEach(s),f$=i(Wc,` using the following task identifier:
`),Ch=a(Wc,"CODE",{});var X9=r(Ch);u$=i(X9,'"summarization"'),X9.forEach(s),g$=i(Wc,"."),Wc.forEach(s),_$=c(Re),G=a(Re,"P",{});var me=r(G);b$=i(me,`The models that this pipeline can use are models that have been fine-tuned on a summarization task, which is
currently, \u2019`),zh=a(me,"EM",{});var J9=r(zh);v$=i(J9,"bart-large-cnn"),J9.forEach(s),w$=i(me,"\u2019, \u2019"),Ih=a(me,"EM",{});var eD=r(Ih);x$=i(eD,"t5-small"),eD.forEach(s),k$=i(me,"\u2019, \u2019"),Sh=a(me,"EM",{});var tD=r(Sh);y$=i(tD,"t5-base"),tD.forEach(s),P$=i(me,"\u2019, \u2019"),Mh=a(me,"EM",{});var sD=r(Mh);T$=i(sD,"t5-large"),sD.forEach(s),$$=i(me,"\u2019, \u2019"),Fh=a(me,"EM",{});var nD=r(Fh);j$=i(nD,"t5-3b"),nD.forEach(s),E$=i(me,"\u2019, \u2019"),Lh=a(me,"EM",{});var aD=r(Lh);q$=i(aD,"t5-11b"),aD.forEach(s),A$=i(me,`\u2019. See the up-to-date
list of available models on `),Lo=a(me,"A",{href:!0,rel:!0});var rD=r(Lo);D$=i(rD,"huggingface.co/models"),rD.forEach(s),C$=i(me,`. For a list
of available parameters, see the `),Oo=a(me,"A",{href:!0,rel:!0});var oD=r(Oo);z$=i(oD,`following
documentation`),oD.forEach(s),me.forEach(s),I$=c(Re),b(Mn.$$.fragment,Re),S$=c(Re),Fn=a(Re,"DIV",{class:!0});var E2=r(Fn);b(No.$$.fragment,E2),M$=c(E2),Oh=a(E2,"P",{});var iD=r(Oh);F$=i(iD,"Summarize the text(s) given as inputs."),iD.forEach(s),E2.forEach(s),Re.forEach(s),V_=c(t),Xt=a(t,"H3",{class:!0});var q2=r(Xt);Ln=a(q2,"A",{id:!0,class:!0,href:!0});var lD=r(Ln);Nh=a(lD,"SPAN",{});var pD=r(Nh);b(Uo.$$.fragment,pD),pD.forEach(s),lD.forEach(s),L$=c(q2),Uh=a(q2,"SPAN",{});var cD=r(Uh);O$=i(cD,"TableQuestionAnsweringPipeline"),cD.forEach(s),q2.forEach(s),W_=c(t),X=a(t,"DIV",{class:!0});var $e=r(X);b(Go.$$.fragment,$e),N$=c($e),Ro=a($e,"P",{});var A2=r(Ro);U$=i(A2,"Table Question Answering pipeline using a "),Gh=a(A2,"CODE",{});var dD=r(Gh);G$=i(dD,"ModelForTableQuestionAnswering"),dD.forEach(s),R$=i(A2,`. This pipeline is only available in
PyTorch.`),A2.forEach(s),Q$=c($e),b(On.$$.fragment,$e),H$=c($e),Up=a($e,"P",{});var e6=r(Up);V$=i(e6,"Learn more about the basics of using a pipeline in the "),Gp=a(e6,"A",{href:!0});var mD=r(Gp);W$=i(mD,"pipeline tutorial"),mD.forEach(s),e6.forEach(s),B$=c($e),Jt=a($e,"P",{});var Bc=r(Jt);Z$=i(Bc,"This tabular question answering pipeline can currently be loaded from "),Rp=a(Bc,"A",{href:!0});var hD=r(Rp);Y$=i(hD,"pipeline()"),hD.forEach(s),K$=i(Bc,` using the following task
identifier: `),Rh=a(Bc,"CODE",{});var fD=r(Rh);X$=i(fD,'"table-question-answering"'),fD.forEach(s),J$=i(Bc,"."),Bc.forEach(s),e4=c($e),Qo=a($e,"P",{});var D2=r(Qo);t4=i(D2,`The models that this pipeline can use are models that have been fine-tuned on a tabular question answering task.
See the up-to-date list of available models on
`),Ho=a(D2,"A",{href:!0,rel:!0});var uD=r(Ho);s4=i(uD,"huggingface.co/models"),uD.forEach(s),n4=i(D2,"."),D2.forEach(s),a4=c($e),ae=a($e,"DIV",{class:!0});var je=r(ae);b(Vo.$$.fragment,je),r4=c(je),Qh=a(je,"P",{});var gD=r(Qh);o4=i(gD,"Answers queries according to a table. The pipeline accepts several types of inputs which are detailed below:"),gD.forEach(s),i4=c(je),ce=a(je,"UL",{});var Ee=r(ce);Hh=a(Ee,"LI",{});var _D=r(Hh);Vh=a(_D,"CODE",{});var bD=r(Vh);l4=i(bD,"pipeline(table, query)"),bD.forEach(s),_D.forEach(s),p4=c(Ee),Wh=a(Ee,"LI",{});var vD=r(Wh);Bh=a(vD,"CODE",{});var wD=r(Bh);c4=i(wD,"pipeline(table, [query])"),wD.forEach(s),vD.forEach(s),d4=c(Ee),Zh=a(Ee,"LI",{});var xD=r(Zh);Yh=a(xD,"CODE",{});var kD=r(Yh);m4=i(kD,"pipeline(table=table, query=query)"),kD.forEach(s),xD.forEach(s),h4=c(Ee),Kh=a(Ee,"LI",{});var yD=r(Kh);Xh=a(yD,"CODE",{});var PD=r(Xh);f4=i(PD,"pipeline(table=table, query=[query])"),PD.forEach(s),yD.forEach(s),u4=c(Ee),Jh=a(Ee,"LI",{});var TD=r(Jh);ef=a(TD,"CODE",{});var $D=r(ef);g4=i($D,'pipeline({"table": table, "query": query})'),$D.forEach(s),TD.forEach(s),_4=c(Ee),tf=a(Ee,"LI",{});var jD=r(tf);sf=a(jD,"CODE",{});var ED=r(sf);b4=i(ED,'pipeline({"table": table, "query": [query]})'),ED.forEach(s),jD.forEach(s),v4=c(Ee),nf=a(Ee,"LI",{});var qD=r(nf);af=a(qD,"CODE",{});var AD=r(af);w4=i(AD,'pipeline([{"table": table, "query": query}, {"table": table, "query": query}])'),AD.forEach(s),qD.forEach(s),Ee.forEach(s),x4=c(je),Wo=a(je,"P",{});var C2=r(Wo);k4=i(C2,"The "),rf=a(C2,"CODE",{});var DD=r(rf);y4=i(DD,"table"),DD.forEach(s),P4=i(C2," argument should be a dict or a DataFrame built from that dict, containing the whole table:"),C2.forEach(s),T4=c(je),b(Nn.$$.fragment,je),$4=c(je),of=a(je,"P",{});var CD=r(of);j4=i(CD,"This dictionary can be passed in as such, or can be converted to a pandas DataFrame:"),CD.forEach(s),E4=c(je),b(Un.$$.fragment,je),je.forEach(s),$e.forEach(s),B_=c(t),es=a(t,"H3",{class:!0});var z2=r(es);Gn=a(z2,"A",{id:!0,class:!0,href:!0});var zD=r(Gn);lf=a(zD,"SPAN",{});var ID=r(lf);b(Bo.$$.fragment,ID),ID.forEach(s),zD.forEach(s),q4=c(z2),pf=a(z2,"SPAN",{});var SD=r(pf);A4=i(SD,"TextClassificationPipeline"),SD.forEach(s),z2.forEach(s),Z_=c(t),N=a(t,"DIV",{class:!0});var fe=r(N);b(Zo.$$.fragment,fe),D4=c(fe),ts=a(fe,"P",{});var Zc=r(ts);C4=i(Zc,"Text classification pipeline using any "),cf=a(Zc,"CODE",{});var MD=r(cf);z4=i(MD,"ModelForSequenceClassification"),MD.forEach(s),I4=i(Zc,". See the "),Qp=a(Zc,"A",{href:!0});var FD=r(Qp);S4=i(FD,`sequence classification
examples`),FD.forEach(s),M4=i(Zc," for more information."),Zc.forEach(s),F4=c(fe),b(Rn.$$.fragment,fe),L4=c(fe),Hp=a(fe,"P",{});var t6=r(Hp);O4=i(t6,"Learn more about the basics of using a pipeline in the "),Vp=a(t6,"A",{href:!0});var LD=r(Vp);N4=i(LD,"pipeline tutorial"),LD.forEach(s),t6.forEach(s),U4=c(fe),ss=a(fe,"P",{});var Yc=r(ss);G4=i(Yc,"This text classification pipeline can currently be loaded from "),Wp=a(Yc,"A",{href:!0});var OD=r(Wp);R4=i(OD,"pipeline()"),OD.forEach(s),Q4=i(Yc,` using the following task identifier:
`),df=a(Yc,"CODE",{});var ND=r(df);H4=i(ND,'"sentiment-analysis"'),ND.forEach(s),V4=i(Yc," (for classifying sequences according to positive or negative sentiments)."),Yc.forEach(s),W4=c(fe),Yo=a(fe,"P",{});var I2=r(Yo);B4=i(I2,"If multiple classification labels are available ("),mf=a(I2,"CODE",{});var UD=r(mf);Z4=i(UD,"model.config.num_labels >= 2"),UD.forEach(s),Y4=i(I2,`), the pipeline will run a softmax
over the results. If there is a single label, the pipeline will run a sigmoid over the result.`),I2.forEach(s),K4=c(fe),Ko=a(fe,"P",{});var S2=r(Ko);X4=i(S2,`The models that this pipeline can use are models that have been fine-tuned on a sequence classification task. See
the up-to-date list of available models on
`),Xo=a(S2,"A",{href:!0,rel:!0});var GD=r(Xo);J4=i(GD,"huggingface.co/models"),GD.forEach(s),e7=i(S2,"."),S2.forEach(s),t7=c(fe),Qn=a(fe,"DIV",{class:!0});var M2=r(Qn);b(Jo.$$.fragment,M2),s7=c(M2),hf=a(M2,"P",{});var RD=r(hf);n7=i(RD,"Classify the text(s) given as inputs."),RD.forEach(s),M2.forEach(s),fe.forEach(s),Y_=c(t),ns=a(t,"H3",{class:!0});var F2=r(ns);Hn=a(F2,"A",{id:!0,class:!0,href:!0});var QD=r(Hn);ff=a(QD,"SPAN",{});var HD=r(ff);b(ei.$$.fragment,HD),HD.forEach(s),QD.forEach(s),a7=c(F2),uf=a(F2,"SPAN",{});var VD=r(uf);r7=i(VD,"TextGenerationPipeline"),VD.forEach(s),F2.forEach(s),K_=c(t),J=a(t,"DIV",{class:!0});var qe=r(J);b(ti.$$.fragment,qe),o7=c(qe),si=a(qe,"P",{});var L2=r(si);i7=i(L2,"Language generation pipeline using any "),gf=a(L2,"CODE",{});var WD=r(gf);l7=i(WD,"ModelWithLMHead"),WD.forEach(s),p7=i(L2,`. This pipeline predicts the words that will follow a
specified text prompt.`),L2.forEach(s),c7=c(qe),b(Vn.$$.fragment,qe),d7=c(qe),Bp=a(qe,"P",{});var s6=r(Bp);m7=i(s6,"Learn more about the basics of using a pipeline in the "),Zp=a(s6,"A",{href:!0});var BD=r(Zp);h7=i(BD,"pipeline tutorial"),BD.forEach(s),s6.forEach(s),f7=c(qe),as=a(qe,"P",{});var Kc=r(as);u7=i(Kc,"This language generation pipeline can currently be loaded from "),Yp=a(Kc,"A",{href:!0});var ZD=r(Yp);g7=i(ZD,"pipeline()"),ZD.forEach(s),_7=i(Kc,` using the following task identifier:
`),_f=a(Kc,"CODE",{});var YD=r(_f);b7=i(YD,'"text-generation"'),YD.forEach(s),v7=i(Kc,"."),Kc.forEach(s),w7=c(qe),ni=a(qe,"P",{});var O2=r(ni);x7=i(O2,`The models that this pipeline can use are models that have been trained with an autoregressive language modeling
objective, which includes the uni-directional models in the library (e.g. gpt2). See the list of available models
on `),ai=a(O2,"A",{href:!0,rel:!0});var KD=r(ai);k7=i(KD,"huggingface.co/models"),KD.forEach(s),y7=i(O2,"."),O2.forEach(s),P7=c(qe),Wn=a(qe,"DIV",{class:!0});var N2=r(Wn);b(ri.$$.fragment,N2),T7=c(N2),bf=a(N2,"P",{});var XD=r(bf);$7=i(XD,"Complete the prompt(s) given as inputs."),XD.forEach(s),N2.forEach(s),qe.forEach(s),X_=c(t),rs=a(t,"H3",{class:!0});var U2=r(rs);Bn=a(U2,"A",{id:!0,class:!0,href:!0});var JD=r(Bn);vf=a(JD,"SPAN",{});var eC=r(vf);b(oi.$$.fragment,eC),eC.forEach(s),JD.forEach(s),j7=c(U2),wf=a(U2,"SPAN",{});var tC=r(wf);E7=i(tC,"Text2TextGenerationPipeline"),tC.forEach(s),U2.forEach(s),J_=c(t),F=a(t,"DIV",{class:!0});var oe=r(F);b(ii.$$.fragment,oe),q7=c(oe),xf=a(oe,"P",{});var sC=r(xf);A7=i(sC,"Pipeline for text to text generation using seq2seq models."),sC.forEach(s),D7=c(oe),b(Zn.$$.fragment,oe),C7=c(oe),Kp=a(oe,"P",{});var n6=r(Kp);z7=i(n6,"Learn more about the basics of using a pipeline in the "),Xp=a(n6,"A",{href:!0});var nC=r(Xp);I7=i(nC,"pipeline tutorial"),nC.forEach(s),n6.forEach(s),S7=c(oe),os=a(oe,"P",{});var Xc=r(os);M7=i(Xc,"This Text2TextGenerationPipeline pipeline can currently be loaded from "),Jp=a(Xc,"A",{href:!0});var aC=r(Jp);F7=i(aC,"pipeline()"),aC.forEach(s),L7=i(Xc,` using the following task
identifier: `),kf=a(Xc,"CODE",{});var rC=r(kf);O7=i(rC,'"text2text-generation"'),rC.forEach(s),N7=i(Xc,"."),Xc.forEach(s),U7=c(oe),Yn=a(oe,"P",{});var bg=r(Yn);G7=i(bg,`The models that this pipeline can use are models that have been fine-tuned on a translation task. See the
up-to-date list of available models on
`),li=a(bg,"A",{href:!0,rel:!0});var oC=r(li);R7=i(oC,"huggingface.co/models"),oC.forEach(s),Q7=i(bg,`. For a list of available
parameters, see the `),pi=a(bg,"A",{href:!0,rel:!0});var iC=r(pi);H7=i(iC,`following
documentation`),iC.forEach(s),bg.forEach(s),V7=c(oe),b(Kn.$$.fragment,oe),W7=c(oe),Xn=a(oe,"DIV",{class:!0});var G2=r(Xn);b(ci.$$.fragment,G2),B7=c(G2),yf=a(G2,"P",{});var lC=r(yf);Z7=i(lC,"Generate the output text(s) using text(s) given as inputs."),lC.forEach(s),G2.forEach(s),Y7=c(oe),Jn=a(oe,"DIV",{class:!0});var R2=r(Jn);b(di.$$.fragment,R2),K7=c(R2),Pf=a(R2,"P",{});var pC=r(Pf);X7=i(pC,"Checks whether there might be something wrong with given input with regard to the model."),pC.forEach(s),R2.forEach(s),oe.forEach(s),eb=c(t),is=a(t,"H3",{class:!0});var Q2=r(is);ea=a(Q2,"A",{id:!0,class:!0,href:!0});var cC=r(ea);Tf=a(cC,"SPAN",{});var dC=r(Tf);b(mi.$$.fragment,dC),dC.forEach(s),cC.forEach(s),J7=c(Q2),$f=a(Q2,"SPAN",{});var mC=r($f);ej=i(mC,"TokenClassificationPipeline"),mC.forEach(s),Q2.forEach(s),tb=c(t),I=a(t,"DIV",{class:!0});var L=r(I);b(hi.$$.fragment,L),tj=c(L),ls=a(L,"P",{});var Jc=r(ls);sj=i(Jc,"Named Entity Recognition pipeline using any "),jf=a(Jc,"CODE",{});var hC=r(jf);nj=i(hC,"ModelForTokenClassification"),hC.forEach(s),aj=i(Jc,". See the "),ec=a(Jc,"A",{href:!0});var fC=r(ec);rj=i(fC,`named entity recognition
examples`),fC.forEach(s),oj=i(Jc," for more information."),Jc.forEach(s),ij=c(L),b(ta.$$.fragment,L),lj=c(L),tc=a(L,"P",{});var a6=r(tc);pj=i(a6,"Learn more about the basics of using a pipeline in the "),sc=a(a6,"A",{href:!0});var uC=r(sc);cj=i(uC,"pipeline tutorial"),uC.forEach(s),a6.forEach(s),dj=c(L),ps=a(L,"P",{});var ed=r(ps);mj=i(ed,"This token recognition pipeline can currently be loaded from "),nc=a(ed,"A",{href:!0});var gC=r(nc);hj=i(gC,"pipeline()"),gC.forEach(s),fj=i(ed,` using the following task identifier:
`),Ef=a(ed,"CODE",{});var _C=r(Ef);uj=i(_C,'"ner"'),_C.forEach(s),gj=i(ed," (for predicting the classes of tokens in a sequence: person, organisation, location or miscellaneous)."),ed.forEach(s),_j=c(L),fi=a(L,"P",{});var H2=r(fi);bj=i(H2,`The models that this pipeline can use are models that have been fine-tuned on a token classification task. See the
up-to-date list of available models on
`),ui=a(H2,"A",{href:!0,rel:!0});var bC=r(ui);vj=i(bC,"huggingface.co/models"),bC.forEach(s),wj=i(H2,"."),H2.forEach(s),xj=c(L),sa=a(L,"DIV",{class:!0});var V2=r(sa);b(gi.$$.fragment,V2),kj=c(V2),qf=a(V2,"P",{});var vC=r(qf);yj=i(vC,"Classify each token of the text(s) given as inputs."),vC.forEach(s),V2.forEach(s),Pj=c(L),at=a(L,"DIV",{class:!0});var td=r(at);b(_i.$$.fragment,td),Tj=c(td),Af=a(td,"P",{});var wC=r(Af);$j=i(wC,"Override tokens from a given word that disagree to force agreement on word boundaries."),wC.forEach(s),jj=c(td),Df=a(td,"P",{});var xC=r(Df);Ej=i(xC,`Example: micro|soft| com|pany| B-ENT I-NAME I-ENT I-ENT will be rewritten with first strategy as microsoft|
company| B-ENT I-ENT`),xC.forEach(s),td.forEach(s),qj=c(L),na=a(L,"DIV",{class:!0});var W2=r(na);b(bi.$$.fragment,W2),Aj=c(W2),Cf=a(W2,"P",{});var kC=r(Cf);Dj=i(kC,"Fuse various numpy arrays into dicts with all the information needed for aggregation"),kC.forEach(s),W2.forEach(s),Cj=c(L),aa=a(L,"DIV",{class:!0});var B2=r(aa);b(vi.$$.fragment,B2),zj=c(B2),zf=a(B2,"P",{});var yC=r(zf);Ij=i(yC,"Find and group together the adjacent tokens with the same entity predicted."),yC.forEach(s),B2.forEach(s),Sj=c(L),ra=a(L,"DIV",{class:!0});var Z2=r(ra);b(wi.$$.fragment,Z2),Mj=c(Z2),If=a(Z2,"P",{});var PC=r(If);Fj=i(PC,"Group together the adjacent tokens with the same entity predicted."),PC.forEach(s),Z2.forEach(s),L.forEach(s),sb=c(t),cs=a(t,"H3",{class:!0});var Y2=r(cs);oa=a(Y2,"A",{id:!0,class:!0,href:!0});var TC=r(oa);Sf=a(TC,"SPAN",{});var $C=r(Sf);b(xi.$$.fragment,$C),$C.forEach(s),TC.forEach(s),Lj=c(Y2),Mf=a(Y2,"SPAN",{});var jC=r(Mf);Oj=i(jC,"TranslationPipeline"),jC.forEach(s),Y2.forEach(s),nb=c(t),de=a(t,"DIV",{class:!0});var Qe=r(de);b(ki.$$.fragment,Qe),Nj=c(Qe),Ff=a(Qe,"P",{});var EC=r(Ff);Uj=i(EC,"Translates from one language to another."),EC.forEach(s),Gj=c(Qe),ds=a(Qe,"P",{});var sd=r(ds);Rj=i(sd,"This translation pipeline can currently be loaded from "),ac=a(sd,"A",{href:!0});var qC=r(ac);Qj=i(qC,"pipeline()"),qC.forEach(s),Hj=i(sd,` using the following task identifier:
`),Lf=a(sd,"CODE",{});var AC=r(Lf);Vj=i(AC,'"translation_xx_to_yy"'),AC.forEach(s),Wj=i(sd,"."),sd.forEach(s),Bj=c(Qe),ia=a(Qe,"P",{});var vg=r(ia);Zj=i(vg,`The models that this pipeline can use are models that have been fine-tuned on a translation task. See the
up-to-date list of available models on `),yi=a(vg,"A",{href:!0,rel:!0});var DC=r(yi);Yj=i(DC,"huggingface.co/models"),DC.forEach(s),Kj=i(vg,`.
For a list of available parameters, see the `),Pi=a(vg,"A",{href:!0,rel:!0});var CC=r(Pi);Xj=i(CC,`following
documentation`),CC.forEach(s),vg.forEach(s),Jj=c(Qe),b(la.$$.fragment,Qe),e5=c(Qe),pa=a(Qe,"DIV",{class:!0});var K2=r(pa);b(Ti.$$.fragment,K2),t5=c(K2),Of=a(K2,"P",{});var zC=r(Of);s5=i(zC,"Translate the text(s) given as inputs."),zC.forEach(s),K2.forEach(s),Qe.forEach(s),ab=c(t),ms=a(t,"H3",{class:!0});var X2=r(ms);ca=a(X2,"A",{id:!0,class:!0,href:!0});var IC=r(ca);Nf=a(IC,"SPAN",{});var SC=r(Nf);b($i.$$.fragment,SC),SC.forEach(s),IC.forEach(s),n5=c(X2),Uf=a(X2,"SPAN",{});var MC=r(Uf);a5=i(MC,"ZeroShotClassificationPipeline"),MC.forEach(s),X2.forEach(s),rb=c(t),U=a(t,"DIV",{class:!0});var ue=r(U);b(ji.$$.fragment,ue),r5=c(ue),Ze=a(ue,"P",{});var Sa=r(Ze);o5=i(Sa,"NLI-based zero-shot classification pipeline using a "),Gf=a(Sa,"CODE",{});var FC=r(Gf);i5=i(FC,"ModelForSequenceClassification"),FC.forEach(s),l5=i(Sa,` trained on NLI (natural
language inference) tasks. Equivalent of `),Rf=a(Sa,"CODE",{});var LC=r(Rf);p5=i(LC,"text-classification"),LC.forEach(s),c5=i(Sa,` pipelines, but these models don\u2019t require a
hardcoded number of potential classes, they can be chosen at runtime. It usually means it\u2019s slower but it is
`),Qf=a(Sa,"STRONG",{});var OC=r(Qf);d5=i(OC,"much"),OC.forEach(s),m5=i(Sa," more flexible."),Sa.forEach(s),h5=c(ue),Ye=a(ue,"P",{});var Ma=r(Ye);f5=i(Ma,`Any combination of sequences and labels can be passed and each combination will be posed as a premise/hypothesis
pair and passed to the pretrained model. Then, the logit for `),Hf=a(Ma,"EM",{});var NC=r(Hf);u5=i(NC,"entailment"),NC.forEach(s),g5=i(Ma,` is taken as the logit for the candidate
label being valid. Any NLI model can be used, but the id of the `),Vf=a(Ma,"EM",{});var UC=r(Vf);_5=i(UC,"entailment"),UC.forEach(s),b5=i(Ma,` label must be included in the model
config\u2019s :attr:`),Wf=a(Ma,"EM",{});var GC=r(Wf);v5=i(GC,"~transformers.PretrainedConfig.label2id"),GC.forEach(s),w5=i(Ma,"."),Ma.forEach(s),x5=c(ue),b(da.$$.fragment,ue),k5=c(ue),rc=a(ue,"P",{});var r6=r(rc);y5=i(r6,"Learn more about the basics of using a pipeline in the "),oc=a(r6,"A",{href:!0});var RC=r(oc);P5=i(RC,"pipeline tutorial"),RC.forEach(s),r6.forEach(s),T5=c(ue),hs=a(ue,"P",{});var nd=r(hs);$5=i(nd,"This NLI pipeline can currently be loaded from "),ic=a(nd,"A",{href:!0});var QC=r(ic);j5=i(QC,"pipeline()"),QC.forEach(s),E5=i(nd,` using the following task identifier:
`),Bf=a(nd,"CODE",{});var HC=r(Bf);q5=i(HC,'"zero-shot-classification"'),HC.forEach(s),A5=i(nd,"."),nd.forEach(s),D5=c(ue),Ei=a(ue,"P",{});var J2=r(Ei);C5=i(J2,`The models that this pipeline can use are models that have been fine-tuned on an NLI task. See the up-to-date list
of available models on `),qi=a(J2,"A",{href:!0,rel:!0});var VC=r(qi);z5=i(VC,"huggingface.co/models"),VC.forEach(s),I5=i(J2,"."),J2.forEach(s),S5=c(ue),ma=a(ue,"DIV",{class:!0});var ev=r(ma);b(Ai.$$.fragment,ev),M5=c(ev),Di=a(ev,"P",{});var tv=r(Di);F5=i(tv,"Classify the sequence(s) given as inputs. See the "),lc=a(tv,"A",{href:!0});var WC=r(lc);L5=i(WC,"ZeroShotClassificationPipeline"),WC.forEach(s),O5=i(tv,` documentation for more
information.`),tv.forEach(s),ev.forEach(s),ue.forEach(s),ob=c(t),fs=a(t,"H2",{class:!0});var sv=r(fs);ha=a(sv,"A",{id:!0,class:!0,href:!0});var BC=r(ha);Zf=a(BC,"SPAN",{});var ZC=r(Zf);b(Ci.$$.fragment,ZC),ZC.forEach(s),BC.forEach(s),N5=c(sv),Yf=a(sv,"SPAN",{});var YC=r(Yf);U5=i(YC,"Multimodal"),YC.forEach(s),sv.forEach(s),ib=c(t),pc=a(t,"P",{});var KC=r(pc);G5=i(KC,"Pipelines available for multimodal tasks include the following."),KC.forEach(s),lb=c(t),us=a(t,"H3",{class:!0});var nv=r(us);fa=a(nv,"A",{id:!0,class:!0,href:!0});var XC=r(fa);Kf=a(XC,"SPAN",{});var JC=r(Kf);b(zi.$$.fragment,JC),JC.forEach(s),XC.forEach(s),R5=c(nv),Xf=a(nv,"SPAN",{});var ez=r(Xf);Q5=i(ez,"DocumentQuestionAnsweringPipeline"),ez.forEach(s),nv.forEach(s),pb=c(t),ee=a(t,"DIV",{class:!0});var Ae=r(ee);b(Ii.$$.fragment,Ae),H5=c(Ae),Si=a(Ae,"P",{});var av=r(Si);V5=i(av,"Document Question Answering pipeline using any "),Jf=a(av,"CODE",{});var tz=r(Jf);W5=i(tz,"AutoModelForDocumentQuestionAnswering"),tz.forEach(s),B5=i(av,`. The inputs/outputs are
similar to the (extractive) question answering pipeline; however, the pipeline takes an image (and optional OCR\u2019d
words/boxes) as input instead of text context.`),av.forEach(s),Z5=c(Ae),b(ua.$$.fragment,Ae),Y5=c(Ae),cc=a(Ae,"P",{});var o6=r(cc);K5=i(o6,"Learn more about the basics of using a pipeline in the "),dc=a(o6,"A",{href:!0});var sz=r(dc);X5=i(sz,"pipeline tutorial"),sz.forEach(s),o6.forEach(s),J5=c(Ae),gs=a(Ae,"P",{});var ad=r(gs);eE=i(ad,"This document question answering pipeline can currently be loaded from "),mc=a(ad,"A",{href:!0});var nz=r(mc);tE=i(nz,"pipeline()"),nz.forEach(s),sE=i(ad,` using the following task
identifier: `),eu=a(ad,"CODE",{});var az=r(eu);nE=i(az,'"document-question-answering"'),az.forEach(s),aE=i(ad,"."),ad.forEach(s),rE=c(Ae),Mi=a(Ae,"P",{});var rv=r(Mi);oE=i(rv,`The models that this pipeline can use are models that have been fine-tuned on a document question answering task.
See the up-to-date list of available models on
`),Fi=a(rv,"A",{href:!0,rel:!0});var rz=r(Fi);iE=i(rz,"huggingface.co/models"),rz.forEach(s),lE=i(rv,"."),rv.forEach(s),pE=c(Ae),Ne=a(Ae,"DIV",{class:!0});var Fa=r(Ne);b(Li.$$.fragment,Fa),cE=c(Fa),Oi=a(Fa,"P",{});var ov=r(Oi);dE=i(ov,`Answer the question(s) given as inputs by using the document(s). A document is defined as an image and an
optional list of (word, box) tuples which represent the text in the document. If the `),tu=a(ov,"CODE",{});var oz=r(tu);mE=i(oz,"word_boxes"),oz.forEach(s),hE=i(ov,` are not
provided, it will use the Tesseract OCR engine (if available) to extract the words and boxes automatically for
LayoutLM-like models which require them as input. For Donut, no OCR is run.`),ov.forEach(s),fE=c(Fa),su=a(Fa,"P",{});var iz=r(su);uE=i(iz,"You can invoke the pipeline several ways:"),iz.forEach(s),gE=c(Fa),Ke=a(Fa,"UL",{});var La=r(Ke);nu=a(La,"LI",{});var lz=r(nu);au=a(lz,"CODE",{});var pz=r(au);_E=i(pz,"pipeline(image=image, question=question)"),pz.forEach(s),lz.forEach(s),bE=c(La),ru=a(La,"LI",{});var cz=r(ru);ou=a(cz,"CODE",{});var dz=r(ou);vE=i(dz,"pipeline(image=image, question=question, word_boxes=word_boxes)"),dz.forEach(s),cz.forEach(s),wE=c(La),iu=a(La,"LI",{});var mz=r(iu);lu=a(mz,"CODE",{});var hz=r(lu);xE=i(hz,'pipeline([{"image": image, "question": question}])'),hz.forEach(s),mz.forEach(s),kE=c(La),pu=a(La,"LI",{});var fz=r(pu);cu=a(fz,"CODE",{});var uz=r(cu);yE=i(uz,'pipeline([{"image": image, "question": question, "word_boxes": word_boxes}])'),uz.forEach(s),fz.forEach(s),La.forEach(s),Fa.forEach(s),Ae.forEach(s),cb=c(t),_s=a(t,"H3",{class:!0});var iv=r(_s);ga=a(iv,"A",{id:!0,class:!0,href:!0});var gz=r(ga);du=a(gz,"SPAN",{});var _z=r(du);b(Ni.$$.fragment,_z),_z.forEach(s),gz.forEach(s),PE=c(iv),mu=a(iv,"SPAN",{});var bz=r(mu);TE=i(bz,"FeatureExtractionPipeline"),bz.forEach(s),iv.forEach(s),db=c(t),te=a(t,"DIV",{class:!0});var De=r(te);b(Ui.$$.fragment,De),$E=c(De),hu=a(De,"P",{});var vz=r(hu);jE=i(vz,`Feature extraction pipeline using no model head. This pipeline extracts the hidden states from the base
transformer, which can be used as features in downstream tasks.`),vz.forEach(s),EE=c(De),b(_a.$$.fragment,De),qE=c(De),hc=a(De,"P",{});var i6=r(hc);AE=i(i6,"Learn more about the basics of using a pipeline in the "),fc=a(i6,"A",{href:!0});var wz=r(fc);DE=i(wz,"pipeline tutorial"),wz.forEach(s),i6.forEach(s),CE=c(De),bs=a(De,"P",{});var rd=r(bs);zE=i(rd,"This feature extraction pipeline can currently be loaded from "),uc=a(rd,"A",{href:!0});var xz=r(uc);IE=i(xz,"pipeline()"),xz.forEach(s),SE=i(rd,` using the task identifier:
`),fu=a(rd,"CODE",{});var kz=r(fu);ME=i(kz,'"feature-extraction"'),kz.forEach(s),FE=i(rd,"."),rd.forEach(s),LE=c(De),Gi=a(De,"P",{});var lv=r(Gi);OE=i(lv,`All models may be used for this pipeline. See a list of all models, including community-contributed models on
`),Ri=a(lv,"A",{href:!0,rel:!0});var yz=r(Ri);NE=i(yz,"huggingface.co/models"),yz.forEach(s),UE=i(lv,"."),lv.forEach(s),GE=c(De),ba=a(De,"DIV",{class:!0});var pv=r(ba);b(Qi.$$.fragment,pv),RE=c(pv),uu=a(pv,"P",{});var Pz=r(uu);QE=i(Pz,"Extract the features of the input(s)."),Pz.forEach(s),pv.forEach(s),De.forEach(s),mb=c(t),vs=a(t,"H3",{class:!0});var cv=r(vs);va=a(cv,"A",{id:!0,class:!0,href:!0});var Tz=r(va);gu=a(Tz,"SPAN",{});var $z=r(gu);b(Hi.$$.fragment,$z),$z.forEach(s),Tz.forEach(s),HE=c(cv),_u=a(cv,"SPAN",{});var jz=r(_u);VE=i(jz,"ImageToTextPipeline"),jz.forEach(s),cv.forEach(s),hb=c(t),se=a(t,"DIV",{class:!0});var Ce=r(se);b(Vi.$$.fragment,Ce),WE=c(Ce),Wi=a(Ce,"P",{});var dv=r(Wi);BE=i(dv,"Image To Text pipeline using a "),bu=a(dv,"CODE",{});var Ez=r(bu);ZE=i(Ez,"AutoModelForVision2Seq"),Ez.forEach(s),YE=i(dv,". This pipeline predicts a caption for a given image."),dv.forEach(s),KE=c(Ce),b(wa.$$.fragment,Ce),XE=c(Ce),gc=a(Ce,"P",{});var l6=r(gc);JE=i(l6,"Learn more about the basics of using a pipeline in the "),_c=a(l6,"A",{href:!0});var qz=r(_c);eq=i(qz,"pipeline tutorial"),qz.forEach(s),l6.forEach(s),tq=c(Ce),vu=a(Ce,"P",{});var Az=r(vu);sq=i(Az,`This image to text pipeline can currently be loaded from pipeline() using the following task identifier:
\u201Cimage-to-text\u201D.`),Az.forEach(s),nq=c(Ce),Bi=a(Ce,"P",{});var mv=r(Bi);aq=i(mv,`See the list of available models on
`),Zi=a(mv,"A",{href:!0,rel:!0});var Dz=r(Zi);rq=i(Dz,"huggingface.co/models"),Dz.forEach(s),oq=i(mv,"."),mv.forEach(s),iq=c(Ce),xa=a(Ce,"DIV",{class:!0});var hv=r(xa);b(Yi.$$.fragment,hv),lq=c(hv),wu=a(hv,"P",{});var Cz=r(wu);pq=i(Cz,"Assign labels to the image(s) passed as inputs."),Cz.forEach(s),hv.forEach(s),Ce.forEach(s),fb=c(t),ws=a(t,"H3",{class:!0});var fv=r(ws);ka=a(fv,"A",{id:!0,class:!0,href:!0});var zz=r(ka);xu=a(zz,"SPAN",{});var Iz=r(xu);b(Ki.$$.fragment,Iz),Iz.forEach(s),zz.forEach(s),cq=c(fv),ku=a(fv,"SPAN",{});var Sz=r(ku);dq=i(Sz,"VisualQuestionAnsweringPipeline"),Sz.forEach(s),fv.forEach(s),ub=c(t),ne=a(t,"DIV",{class:!0});var ze=r(ne);b(Xi.$$.fragment,ze),mq=c(ze),Ji=a(ze,"P",{});var uv=r(Ji);hq=i(uv,"Visual Question Answering pipeline using a "),yu=a(uv,"CODE",{});var Mz=r(yu);fq=i(Mz,"AutoModelForVisualQuestionAnswering"),Mz.forEach(s),uq=i(uv,`. This pipeline is currently only
available in PyTorch.`),uv.forEach(s),gq=c(ze),b(ya.$$.fragment,ze),_q=c(ze),bc=a(ze,"P",{});var p6=r(bc);bq=i(p6,"Learn more about the basics of using a pipeline in the "),vc=a(p6,"A",{href:!0});var Fz=r(vc);vq=i(Fz,"pipeline tutorial"),Fz.forEach(s),p6.forEach(s),wq=c(ze),xs=a(ze,"P",{});var od=r(xs);xq=i(od,"This visual question answering pipeline can currently be loaded from "),wc=a(od,"A",{href:!0});var Lz=r(wc);kq=i(Lz,"pipeline()"),Lz.forEach(s),yq=i(od,` using the following task
identifiers: `),Pu=a(od,"CODE",{});var Oz=r(Pu);Pq=i(Oz,'"visual-question-answering", "vqa"'),Oz.forEach(s),Tq=i(od,"."),od.forEach(s),$q=c(ze),el=a(ze,"P",{});var gv=r(el);jq=i(gv,`The models that this pipeline can use are models that have been fine-tuned on a visual question answering task. See
the up-to-date list of available models on
`),tl=a(gv,"A",{href:!0,rel:!0});var Nz=r(tl);Eq=i(Nz,"huggingface.co/models"),Nz.forEach(s),qq=i(gv,"."),gv.forEach(s),Aq=c(ze),rt=a(ze,"DIV",{class:!0});var id=r(rt);b(sl.$$.fragment,id),Dq=c(id),Tu=a(id,"P",{});var Uz=r(Tu);Cq=i(Uz,`Answers open-ended questions about images. The pipeline accepts several types of inputs which are detailed
below:`),Uz.forEach(s),zq=c(id),Xe=a(id,"UL",{});var Oa=r(Xe);$u=a(Oa,"LI",{});var Gz=r($u);ju=a(Gz,"CODE",{});var Rz=r(ju);Iq=i(Rz,"pipeline(image=image, question=question)"),Rz.forEach(s),Gz.forEach(s),Sq=c(Oa),Eu=a(Oa,"LI",{});var Qz=r(Eu);qu=a(Qz,"CODE",{});var Hz=r(qu);Mq=i(Hz,'pipeline({"image": image, "question": question})'),Hz.forEach(s),Qz.forEach(s),Fq=c(Oa),Au=a(Oa,"LI",{});var Vz=r(Au);Du=a(Vz,"CODE",{});var Wz=r(Du);Lq=i(Wz,'pipeline([{"image": image, "question": question}])'),Wz.forEach(s),Vz.forEach(s),Oq=c(Oa),Cu=a(Oa,"LI",{});var Bz=r(Cu);zu=a(Bz,"CODE",{});var Zz=r(zu);Nq=i(Zz,'pipeline([{"image": image, "question": question}, {"image": image, "question": question}])'),Zz.forEach(s),Bz.forEach(s),Oa.forEach(s),id.forEach(s),ze.forEach(s),gb=c(t),ks=a(t,"H2",{class:!0});var _v=r(ks);Pa=a(_v,"A",{id:!0,class:!0,href:!0});var Yz=r(Pa);Iu=a(Yz,"SPAN",{});var Kz=r(Iu);b(nl.$$.fragment,Kz),Kz.forEach(s),Yz.forEach(s),Uq=c(_v),xc=a(_v,"SPAN",{});var c6=r(xc);Gq=i(c6,"Parent class: "),Su=a(c6,"CODE",{});var Xz=r(Su);Rq=i(Xz,"Pipeline"),Xz.forEach(s),c6.forEach(s),_v.forEach(s),_b=c(t),A=a(t,"DIV",{class:!0});var z=r(A);b(al.$$.fragment,z),Qq=c(z),Mu=a(z,"P",{});var Jz=r(Mu);Hq=i(Jz,`The Pipeline class is the class from which all pipelines inherit. Refer to this class for methods shared across
different pipelines.`),Jz.forEach(s),Vq=c(z),Fu=a(z,"P",{});var eI=r(Fu);Wq=i(eI,`Base class implementing pipelined operations. Pipeline workflow is defined as a sequence of the following
operations:`),eI.forEach(s),Bq=c(z),Lu=a(z,"P",{});var tI=r(Lu);Zq=i(tI,"Input -> Tokenization -> Model Inference -> Post-Processing (task dependent) -> Output"),tI.forEach(s),Yq=c(z),Ou=a(z,"P",{});var sI=r(Ou);Kq=i(sI,"Pipeline supports running on CPU or GPU through the device argument (see below)."),sI.forEach(s),Xq=c(z),Fe=a(z,"P",{});var ct=r(Fe);Jq=i(ct,"Some pipeline, like for instance "),kc=a(ct,"A",{href:!0});var nI=r(kc);e3=i(nI,"FeatureExtractionPipeline"),nI.forEach(s),t3=i(ct," ("),Nu=a(ct,"CODE",{});var aI=r(Nu);s3=i(aI,"'feature-extraction'"),aI.forEach(s),n3=i(ct,`) output large tensor object
as nested-lists. In order to avoid dumping such large structure as textual data we provide the `),Uu=a(ct,"CODE",{});var rI=r(Uu);a3=i(rI,"binary_output"),rI.forEach(s),r3=i(ct,`
constructor argument. If set to `),Gu=a(ct,"CODE",{});var oI=r(Gu);o3=i(oI,"True"),oI.forEach(s),i3=i(ct,", the output will be stored in the pickle format."),ct.forEach(s),l3=c(z),Ta=a(z,"DIV",{class:!0});var bv=r(Ta);b(rl.$$.fragment,bv),p3=c(bv),Ru=a(bv,"P",{});var iI=r(Ru);c3=i(iI,"Check if the model class is in supported by the pipeline."),iI.forEach(s),bv.forEach(s),d3=c(z),ot=a(z,"DIV",{class:!0});var ld=r(ot);b(ol.$$.fragment,ld),m3=c(ld),Qu=a(ld,"P",{});var lI=r(Qu);h3=i(lI,"Context Manager allowing tensor allocation on the user-specified device in framework agnostic way."),lI.forEach(s),f3=c(ld),b($a.$$.fragment,ld),ld.forEach(s),u3=c(z),ja=a(z,"DIV",{class:!0});var vv=r(ja);b(il.$$.fragment,vv),g3=c(vv),Hu=a(vv,"P",{});var pI=r(Hu);_3=i(pI,"Ensure PyTorch tensors are on the specified device."),pI.forEach(s),vv.forEach(s),b3=c(z),Ea=a(z,"DIV",{class:!0});var wv=r(Ea);b(ll.$$.fragment,wv),v3=c(wv),pl=a(wv,"P",{});var xv=r(pl);w3=i(xv,"Postprocess will receive the raw outputs of the "),Vu=a(xv,"CODE",{});var cI=r(Vu);x3=i(cI,"_forward"),cI.forEach(s),k3=i(xv,` method, generally tensors, and reformat them into
something more friendly. Generally it will output a list or a dict or results (containing just strings and
numbers).`),xv.forEach(s),wv.forEach(s),y3=c(z),qa=a(z,"DIV",{class:!0});var kv=r(qa);b(cl.$$.fragment,kv),P3=c(kv),dl=a(kv,"P",{});var yv=r(dl);T3=i(yv,"Scikit / Keras interface to transformers\u2019 pipelines. This method will forward to "),Wu=a(yv,"STRONG",{});var dI=r(Wu);$3=i(dI,"call"),dI.forEach(s),j3=i(yv,"()."),yv.forEach(s),kv.forEach(s),E3=c(z),Aa=a(z,"DIV",{class:!0});var Pv=r(Aa);b(ml.$$.fragment,Pv),q3=c(Pv),ys=a(Pv,"P",{});var pd=r(ys);A3=i(pd,"Preprocess will take the "),Bu=a(pd,"CODE",{});var mI=r(Bu);D3=i(mI,"input_"),mI.forEach(s),C3=i(pd,` of a specific pipeline and return a dictionnary of everything necessary for
`),Zu=a(pd,"CODE",{});var hI=r(Zu);z3=i(hI,"_forward"),hI.forEach(s),I3=i(pd," to run properly. It should contain at least one tensor, but might have arbitrary other items."),pd.forEach(s),Pv.forEach(s),S3=c(z),Da=a(z,"DIV",{class:!0});var Tv=r(Da);b(hl.$$.fragment,Tv),M3=c(Tv),Yu=a(Tv,"P",{});var fI=r(Yu);F3=i(fI,"Save the pipeline\u2019s model and tokenizer."),fI.forEach(s),Tv.forEach(s),L3=c(z),Ca=a(z,"DIV",{class:!0});var $v=r(Ca);b(fl.$$.fragment,$v),O3=c($v),ul=a($v,"P",{});var jv=r(ul);N3=i(jv,"Scikit / Keras interface to transformers\u2019 pipelines. This method will forward to "),Ku=a(jv,"STRONG",{});var uI=r(Ku);U3=i(uI,"call"),uI.forEach(s),G3=i(jv,"()."),jv.forEach(s),$v.forEach(s),z.forEach(s),this.h()},h(){d(u,"name","hf:doc:metadata"),d(u,"content",JSON.stringify(tS)),d(f,"id","pipelines"),d(f,"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"),d(f,"href","#pipelines"),d(y,"class","relative group"),d(jl,"href","../task_summary"),d(ql,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(Al,"href","#audio"),d(Dl,"href","#computer-vision"),d(Cl,"href","#natural-language-processing"),d(zl,"href","#multimodal"),d($s,"id","transformers.pipeline"),d($s,"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"),d($s,"href","#transformers.pipeline"),d(dt,"class","relative group"),d(Ra,"href","https://huggingface.co"),d(Ra,"rel","nofollow"),d(Ml,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.Pipeline"),d(Fl,"href","tokenizer"),d(Ll,"href","model"),d(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Cs,"id","pipeline-batching"),d(Cs,"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"),d(Cs,"href","#pipeline-batching"),d(ht,"class","relative group"),d(Ss,"id","pipeline-chunk-batching"),d(Ss,"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"),d(Ss,"href","#pipeline-chunk-batching"),d(ut,"class","relative group"),d(Fs,"id","pipeline-custom-code"),d(Fs,"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"),d(Fs,"href","#pipeline-custom-code"),d(gt,"class","relative group"),d(Os,"id","implementing-a-pipeline"),d(Os,"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"),d(Os,"href","#implementing-a-pipeline"),d(_t,"class","relative group"),d(Zl,"href","../add_new_pipeline"),d(Ns,"id","audio"),d(Ns,"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"),d(Ns,"href","#audio"),d(bt,"class","relative group"),d(Us,"id","transformers.AudioClassificationPipeline"),d(Us,"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"),d(Us,"href","#transformers.AudioClassificationPipeline"),d(vt,"class","relative group"),d(Xl,"href","../pipeline_tutorial"),d(Jl,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(gr,"href","https://huggingface.co/models?filter=audio-classification"),d(gr,"rel","nofollow"),d(ep,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.AutomaticSpeechRecognitionPipeline"),d(Rs,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Qs,"id","transformers.AutomaticSpeechRecognitionPipeline"),d(Qs,"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"),d(Qs,"href","#transformers.AutomaticSpeechRecognitionPipeline"),d(xt,"class","relative group"),d(sp,"href","../pipeline_tutorial"),d(np,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.AutomaticSpeechRecognitionPipeline"),d(Vs,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ws,"id","computer-vision"),d(Ws,"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"),d(Ws,"href","#computer-vision"),d(kt,"class","relative group"),d(Bs,"id","transformers.DepthEstimationPipeline"),d(Bs,"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"),d(Bs,"href","#transformers.DepthEstimationPipeline"),d(yt,"class","relative group"),d(op,"href","../pipeline_tutorial"),d(ip,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(Er,"href","https://huggingface.co/models?filter=depth-estimation"),d(Er,"rel","nofollow"),d(Ys,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ks,"id","transformers.ImageClassificationPipeline"),d(Ks,"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"),d(Ks,"href","#transformers.ImageClassificationPipeline"),d(Tt,"class","relative group"),d(pp,"href","../pipeline_tutorial"),d(cp,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(Ir,"href","https://huggingface.co/models?filter=image-classification"),d(Ir,"rel","nofollow"),d(Js,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(en,"id","transformers.ImageSegmentationPipeline"),d(en,"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"),d(en,"href","#transformers.ImageSegmentationPipeline"),d(jt,"class","relative group"),d(dp,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(Nr,"href","https://huggingface.co/models?filter=image-segmentation"),d(Nr,"rel","nofollow"),d(sn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(nn,"id","transformers.ObjectDetectionPipeline"),d(nn,"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"),d(nn,"href","#transformers.ObjectDetectionPipeline"),d(qt,"class","relative group"),d(hp,"href","../pipeline_tutorial"),d(fp,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(Vr,"href","https://huggingface.co/models?filter=object-detection"),d(Vr,"rel","nofollow"),d(rn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(on,"id","transformers.ZeroShotImageClassificationPipeline"),d(on,"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"),d(on,"href","#transformers.ZeroShotImageClassificationPipeline"),d(Dt,"class","relative group"),d(gp,"href","../pipeline_tutorial"),d(_p,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(Kr,"href","https://huggingface.co/models?filter=zero-shot-image-classification"),d(Kr,"rel","nofollow"),d(pn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(cn,"id","transformers.ZeroShotObjectDetectionPipeline"),d(cn,"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"),d(cn,"href","#transformers.ZeroShotObjectDetectionPipeline"),d(It,"class","relative group"),d(vp,"href","../pipeline_tutorial"),d(wp,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(so,"href","https://huggingface.co/models?filter=zero-shot-object-detection"),d(so,"rel","nofollow"),d(mn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(hn,"id","natural-language-processing"),d(hn,"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"),d(hn,"href","#natural-language-processing"),d(Ft,"class","relative group"),d(fn,"id","transformers.Conversation"),d(fn,"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"),d(fn,"href","#transformers.Conversation"),d(Lt,"class","relative group"),d(kp,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.ConversationalPipeline"),d(yp,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.ConversationalPipeline"),d(gn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(_n,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(bn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Tp,"href","../pipeline_tutorial"),d($p,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(fo,"href","https://huggingface.co/models?filter=conversational"),d(fo,"rel","nofollow"),d(wn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(xn,"id","transformers.FillMaskPipeline"),d(xn,"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"),d(xn,"href","#transformers.FillMaskPipeline"),d(Nt,"class","relative group"),d(jp,"href","../task_summary#masked-language-modeling"),d(qp,"href","../pipeline_tutorial"),d(Ap,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(vo,"href","https://huggingface.co/models?filter=fill-mask"),d(vo,"rel","nofollow"),d(Pn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Tn,"id","transformers.TokenClassificationPipeline"),d(Tn,"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"),d(Tn,"href","#transformers.TokenClassificationPipeline"),d(Rt,"class","relative group"),d(Dp,"href","../task_summary#named-entity-recognition"),d(zp,"href","../pipeline_tutorial"),d(Ip,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(Po,"href","https://huggingface.co/models?filter=token-classification"),d(Po,"rel","nofollow"),d(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(jn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(En,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(qn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Sp,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.TokenClassificationPipeline"),d(Dn,"id","transformers.QuestionAnsweringPipeline"),d(Dn,"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"),d(Dn,"href","#transformers.QuestionAnsweringPipeline"),d(Vt,"class","relative group"),d(Mp,"href","../task_summary#question-answering"),d(Lp,"href","../pipeline_tutorial"),d(Op,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(Co,"href","https://huggingface.co/models?filter=question-answering"),d(Co,"rel","nofollow"),d(zn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(In,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Sn,"id","transformers.SummarizationPipeline"),d(Sn,"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"),d(Sn,"href","#transformers.SummarizationPipeline"),d(Yt,"class","relative group"),d(Np,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(Lo,"href","https://huggingface.co/models?filter=summarization"),d(Lo,"rel","nofollow"),d(Oo,"href","https://huggingface.co/docs/transformers/en/main_classes/text_generation#transformers.generation.GenerationMixin.generate"),d(Oo,"rel","nofollow"),d(Fn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ln,"id","transformers.TableQuestionAnsweringPipeline"),d(Ln,"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"),d(Ln,"href","#transformers.TableQuestionAnsweringPipeline"),d(Xt,"class","relative group"),d(Gp,"href","../pipeline_tutorial"),d(Rp,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(Ho,"href","https://huggingface.co/models?filter=table-question-answering"),d(Ho,"rel","nofollow"),d(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Gn,"id","transformers.TextClassificationPipeline"),d(Gn,"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"),d(Gn,"href","#transformers.TextClassificationPipeline"),d(es,"class","relative group"),d(Qp,"href","../task_summary#sequence-classification"),d(Vp,"href","../pipeline_tutorial"),d(Wp,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(Xo,"href","https://huggingface.co/models?filter=text-classification"),d(Xo,"rel","nofollow"),d(Qn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Hn,"id","transformers.TextGenerationPipeline"),d(Hn,"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"),d(Hn,"href","#transformers.TextGenerationPipeline"),d(ns,"class","relative group"),d(Zp,"href","../pipeline_tutorial"),d(Yp,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(ai,"href","https://huggingface.co/models?filter=text-generation"),d(ai,"rel","nofollow"),d(Wn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Bn,"id","transformers.Text2TextGenerationPipeline"),d(Bn,"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"),d(Bn,"href","#transformers.Text2TextGenerationPipeline"),d(rs,"class","relative group"),d(Xp,"href","../pipeline_tutorial"),d(Jp,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(li,"href","https://huggingface.co/models?filter=text2text-generation"),d(li,"rel","nofollow"),d(pi,"href","https://huggingface.co/docs/transformers/en/main_classes/text_generation#transformers.generation.GenerationMixin.generate"),d(pi,"rel","nofollow"),d(Xn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Jn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ea,"id","transformers.TokenClassificationPipeline"),d(ea,"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"),d(ea,"href","#transformers.TokenClassificationPipeline"),d(is,"class","relative group"),d(ec,"href","../task_summary#named-entity-recognition"),d(sc,"href","../pipeline_tutorial"),d(nc,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(ui,"href","https://huggingface.co/models?filter=token-classification"),d(ui,"rel","nofollow"),d(sa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(na,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(aa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ra,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(oa,"id","transformers.TranslationPipeline"),d(oa,"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"),d(oa,"href","#transformers.TranslationPipeline"),d(cs,"class","relative group"),d(ac,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(yi,"href","https://huggingface.co/models?filter=translation"),d(yi,"rel","nofollow"),d(Pi,"href","https://huggingface.co/docs/transformers/en/main_classes/text_generation#transformers.generation.GenerationMixin.generate"),d(Pi,"rel","nofollow"),d(pa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ca,"id","transformers.ZeroShotClassificationPipeline"),d(ca,"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"),d(ca,"href","#transformers.ZeroShotClassificationPipeline"),d(ms,"class","relative group"),d(oc,"href","../pipeline_tutorial"),d(ic,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(qi,"href","https://huggingface.co/models?search=nli"),d(qi,"rel","nofollow"),d(lc,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.ZeroShotClassificationPipeline"),d(ma,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ha,"id","multimodal"),d(ha,"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"),d(ha,"href","#multimodal"),d(fs,"class","relative group"),d(fa,"id","transformers.DocumentQuestionAnsweringPipeline"),d(fa,"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"),d(fa,"href","#transformers.DocumentQuestionAnsweringPipeline"),d(us,"class","relative group"),d(dc,"href","../pipeline_tutorial"),d(mc,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(Fi,"href","https://huggingface.co/models?filter=document-question-answering"),d(Fi,"rel","nofollow"),d(Ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ga,"id","transformers.FeatureExtractionPipeline"),d(ga,"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"),d(ga,"href","#transformers.FeatureExtractionPipeline"),d(_s,"class","relative group"),d(fc,"href","../pipeline_tutorial"),d(uc,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(Ri,"href","https://huggingface.co/models"),d(Ri,"rel","nofollow"),d(ba,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(va,"id","transformers.ImageToTextPipeline"),d(va,"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"),d(va,"href","#transformers.ImageToTextPipeline"),d(vs,"class","relative group"),d(_c,"href","../pipeline_tutorial"),d(Zi,"href","https://huggingface.co/models?pipeline_tag=image-to-text"),d(Zi,"rel","nofollow"),d(xa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ka,"id","transformers.VisualQuestionAnsweringPipeline"),d(ka,"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"),d(ka,"href","#transformers.VisualQuestionAnsweringPipeline"),d(ws,"class","relative group"),d(vc,"href","../pipeline_tutorial"),d(wc,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.pipeline"),d(tl,"href","https://huggingface.co/models?filter=visual-question-answering"),d(tl,"rel","nofollow"),d(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Pa,"id","transformers.Pipeline"),d(Pa,"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"),d(Pa,"href","#transformers.Pipeline"),d(ks,"class","relative group"),d(kc,"href","/docs/transformers/v4.25.1/en/main_classes/pipelines#transformers.FeatureExtractionPipeline"),d(Ta,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ja,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ea,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(qa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Aa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Da,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ca,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,m){e(document.head,u),h(t,T,m),h(t,y,m),e(y,f),e(f,P),v(l,P,null),e(y,g),e(y,He),e(He,Ev),h(t,wg,m),h(t,Ps,m),e(Ps,qv),e(Ps,jl),e(jl,Av),e(Ps,Dv),h(t,xg,m),h(t,El,m),e(El,Cv),h(t,kg,m),h(t,Ts,m),e(Ts,Na),e(Na,zv),e(Na,ql),e(ql,Iv),e(Na,Sv),e(Ts,Mv),e(Ts,Ie),e(Ie,Fv),e(Ie,Al),e(Al,Lv),e(Ie,Ov),e(Ie,Dl),e(Dl,Nv),e(Ie,Uv),e(Ie,Cl),e(Cl,Gv),e(Ie,Rv),e(Ie,zl),e(zl,Qv),e(Ie,Hv),h(t,yg,m),h(t,dt,m),e(dt,$s),e($s,cd),v(Ua,cd,null),e(dt,Vv),e(dt,dd),e(dd,Wv),h(t,Pg,m),h(t,js,m),e(js,Bv),e(js,md),e(md,Zv),e(js,Yv),h(t,Tg,m),h(t,Il,m),e(Il,Kv),h(t,$g,m),v(Ga,t,m),h(t,jg,m),h(t,Es,m),e(Es,Xv),e(Es,Ra),e(Ra,Jv),e(Es,ew),h(t,Eg,m),v(Qa,t,m),h(t,qg,m),h(t,qs,m),e(qs,tw),e(qs,hd),e(hd,sw),e(qs,nw),h(t,Ag,m),v(Ha,t,m),h(t,Dg,m),h(t,As,m),e(As,aw),e(As,fd),e(fd,rw),e(As,ow),h(t,Cg,m),v(Va,t,m),h(t,zg,m),h(t,Sl,m),e(Sl,iw),h(t,Ig,m),v(Wa,t,m),h(t,Sg,m),h(t,ge,m),v(Ba,ge,null),e(ge,lw),e(ge,Za),e(Za,pw),e(Za,Ml),e(Ml,cw),e(Za,dw),e(ge,mw),e(ge,ud),e(ud,hw),e(ge,fw),e(ge,mt),e(mt,Ya),e(Ya,uw),e(Ya,Fl),e(Fl,gw),e(Ya,_w),e(mt,bw),e(mt,Ka),e(Ka,vw),e(Ka,Ll),e(Ll,ww),e(Ka,xw),e(mt,kw),e(mt,gd),e(gd,yw),e(ge,Pw),v(Ds,ge,null),h(t,Mg,m),h(t,ht,m),e(ht,Cs),e(Cs,_d),v(Xa,_d,null),e(ht,Tw),e(ht,bd),e(bd,$w),h(t,Fg,m),h(t,Je,m),e(Je,jw),e(Je,vd),e(vd,Ew),e(Je,qw),e(Je,wd),e(wd,Aw),e(Je,Dw),h(t,Lg,m),v(Ja,t,m),h(t,Og,m),v(zs,t,m),h(t,Ng,m),v(er,t,m),h(t,Ug,m),v(tr,t,m),h(t,Gg,m),h(t,Ol,m),e(Ol,Cw),h(t,Rg,m),v(sr,t,m),h(t,Qg,m),h(t,Is,m),e(Is,zw),e(Is,xd),e(xd,Iw),e(Is,Sw),h(t,Hg,m),v(nr,t,m),h(t,Vg,m),h(t,Nl,m),e(Nl,Mw),h(t,Wg,m),h(t,Ul,m),e(Ul,Fw),h(t,Bg,m),h(t,_e,m),e(_e,kd),e(kd,yd),e(yd,Pd),e(Pd,Lw),e(_e,Ow),e(_e,Td),e(Td,$d),e($d,Nw),e(_e,Uw),e(_e,jd),e(jd,Ed),e(Ed,Gw),e(_e,Rw),e(_e,ar),e(ar,qd),e(qd,Qw),e(ar,Hw),e(ar,ft),e(ft,Ad),e(Ad,Vw),e(ft,Ww),e(ft,Dd),e(Dd,Bw),e(ft,Zw),e(ft,Cd),e(Cd,Yw),e(_e,Kw),e(_e,zd),e(zd,Id),e(Id,Xw),h(t,Zg,m),h(t,ut,m),e(ut,Ss),e(Ss,Sd),v(rr,Sd,null),e(ut,Jw),e(ut,Md),e(Md,ex),h(t,Yg,m),h(t,Ve,m),e(Ve,Fd),e(Fd,tx),e(Ve,sx),e(Ve,Ld),e(Ld,nx),e(Ve,ax),e(Ve,Od),e(Od,rx),e(Ve,ox),h(t,Kg,m),h(t,et,m),e(et,ix),e(et,Nd),e(Nd,lx),e(et,px),e(et,Ud),e(Ud,cx),e(et,dx),h(t,Xg,m),v(or,t,m),h(t,Jg,m),h(t,Gl,m),e(Gl,mx),h(t,e_,m),v(ir,t,m),h(t,t_,m),h(t,Rl,m),e(Rl,hx),h(t,s_,m),h(t,Ms,m),e(Ms,fx),e(Ms,Gd),e(Gd,ux),e(Ms,gx),h(t,n_,m),h(t,gt,m),e(gt,Fs),e(Fs,Rd),v(lr,Rd,null),e(gt,_x),e(gt,Qd),e(Qd,bx),h(t,a_,m),h(t,Ql,m),e(Ql,vx),h(t,r_,m),h(t,Ls,m),e(Ls,wx),e(Ls,Hd),e(Hd,xx),e(Ls,kx),h(t,o_,m),h(t,Hl,m),e(Hl,yx),h(t,i_,m),h(t,Vl,m),e(Vl,Vd),e(Vd,Px),h(t,l_,m),v(pr,t,m),h(t,p_,m),h(t,Wl,m),e(Wl,Tx),h(t,c_,m),h(t,_t,m),e(_t,Os),e(Os,Wd),v(cr,Wd,null),e(_t,$x),e(_t,Bd),e(Bd,jx),h(t,d_,m),h(t,Bl,m),e(Bl,Zl),e(Zl,Ex),h(t,m_,m),h(t,bt,m),e(bt,Ns),e(Ns,Zd),v(dr,Zd,null),e(bt,qx),e(bt,Yd),e(Yd,Ax),h(t,h_,m),h(t,Yl,m),e(Yl,Dx),h(t,f_,m),h(t,vt,m),e(vt,Us),e(Us,Kd),v(mr,Kd,null),e(vt,Cx),e(vt,Xd),e(Xd,zx),h(t,u_,m),h(t,Q,m),v(hr,Q,null),e(Q,Ix),e(Q,fr),e(fr,Sx),e(fr,Jd),e(Jd,Mx),e(fr,Fx),e(Q,Lx),v(Gs,Q,null),e(Q,Ox),e(Q,Kl),e(Kl,Nx),e(Kl,Xl),e(Xl,Ux),e(Q,Gx),e(Q,wt),e(wt,Rx),e(wt,Jl),e(Jl,Qx),e(wt,Hx),e(wt,em),e(em,Vx),e(wt,Wx),e(Q,Bx),e(Q,ur),e(ur,Zx),e(ur,gr),e(gr,Yx),e(ur,Kx),e(Q,Xx),e(Q,Rs),v(_r,Rs,null),e(Rs,Jx),e(Rs,br),e(br,e1),e(br,ep),e(ep,t1),e(br,s1),h(t,g_,m),h(t,xt,m),e(xt,Qs),e(Qs,tm),v(vr,tm,null),e(xt,n1),e(xt,sm),e(sm,a1),h(t,__,m),h(t,ie,m),v(wr,ie,null),e(ie,r1),e(ie,nm),e(nm,o1),e(ie,i1),e(ie,am),e(am,l1),e(ie,p1),v(Hs,ie,null),e(ie,c1),e(ie,tp),e(tp,d1),e(tp,sp),e(sp,m1),e(ie,h1),e(ie,Vs),v(xr,Vs,null),e(Vs,f1),e(Vs,kr),e(kr,u1),e(kr,np),e(np,g1),e(kr,_1),h(t,b_,m),h(t,kt,m),e(kt,Ws),e(Ws,rm),v(yr,rm,null),e(kt,b1),e(kt,om),e(om,v1),h(t,v_,m),h(t,ap,m),e(ap,w1),h(t,w_,m),h(t,yt,m),e(yt,Bs),e(Bs,im),v(Pr,im,null),e(yt,x1),e(yt,lm),e(lm,k1),h(t,x_,m),h(t,H,m),v(Tr,H,null),e(H,y1),e(H,$r),e($r,P1),e($r,pm),e(pm,T1),e($r,$1),e(H,j1),v(Zs,H,null),e(H,E1),e(H,rp),e(rp,q1),e(rp,op),e(op,A1),e(H,D1),e(H,Pt),e(Pt,C1),e(Pt,ip),e(ip,z1),e(Pt,I1),e(Pt,cm),e(cm,S1),e(Pt,M1),e(H,F1),e(H,jr),e(jr,L1),e(jr,Er),e(Er,O1),e(jr,N1),e(H,U1),e(H,Ys),v(qr,Ys,null),e(Ys,G1),e(Ys,dm),e(dm,R1),h(t,k_,m),h(t,Tt,m),e(Tt,Ks),e(Ks,mm),v(Ar,mm,null),e(Tt,Q1),e(Tt,hm),e(hm,H1),h(t,y_,m),h(t,V,m),v(Dr,V,null),e(V,V1),e(V,Cr),e(Cr,W1),e(Cr,fm),e(fm,B1),e(Cr,Z1),e(V,Y1),v(Xs,V,null),e(V,K1),e(V,lp),e(lp,X1),e(lp,pp),e(pp,J1),e(V,ek),e(V,$t),e($t,tk),e($t,cp),e(cp,sk),e($t,nk),e($t,um),e(um,ak),e($t,rk),e(V,ok),e(V,zr),e(zr,ik),e(zr,Ir),e(Ir,lk),e(zr,pk),e(V,ck),e(V,Js),v(Sr,Js,null),e(Js,dk),e(Js,gm),e(gm,mk),h(t,P_,m),h(t,jt,m),e(jt,en),e(en,_m),v(Mr,_m,null),e(jt,hk),e(jt,bm),e(bm,fk),h(t,T_,m),h(t,le,m),v(Fr,le,null),e(le,uk),e(le,Lr),e(Lr,gk),e(Lr,vm),e(vm,_k),e(Lr,bk),e(le,vk),v(tn,le,null),e(le,wk),e(le,Et),e(Et,xk),e(Et,dp),e(dp,kk),e(Et,yk),e(Et,wm),e(wm,Pk),e(Et,Tk),e(le,$k),e(le,Or),e(Or,jk),e(Or,Nr),e(Nr,Ek),e(Or,qk),e(le,Ak),e(le,sn),v(Ur,sn,null),e(sn,Dk),e(sn,xm),e(xm,Ck),h(t,$_,m),h(t,qt,m),e(qt,nn),e(nn,km),v(Gr,km,null),e(qt,zk),e(qt,ym),e(ym,Ik),h(t,j_,m),h(t,W,m),v(Rr,W,null),e(W,Sk),e(W,Qr),e(Qr,Mk),e(Qr,Pm),e(Pm,Fk),e(Qr,Lk),e(W,Ok),v(an,W,null),e(W,Nk),e(W,mp),e(mp,Uk),e(mp,hp),e(hp,Gk),e(W,Rk),e(W,At),e(At,Qk),e(At,fp),e(fp,Hk),e(At,Vk),e(At,Tm),e(Tm,Wk),e(At,Bk),e(W,Zk),e(W,Hr),e(Hr,Yk),e(Hr,Vr),e(Vr,Kk),e(Hr,Xk),e(W,Jk),e(W,rn),v(Wr,rn,null),e(rn,ey),e(rn,$m),e($m,ty),h(t,E_,m),h(t,Dt,m),e(Dt,on),e(on,jm),v(Br,jm,null),e(Dt,sy),e(Dt,Em),e(Em,ny),h(t,q_,m),h(t,B,m),v(Zr,B,null),e(B,ay),e(B,Ct),e(Ct,ry),e(Ct,qm),e(qm,oy),e(Ct,iy),e(Ct,Am),e(Am,ly),e(Ct,py),e(B,cy),v(ln,B,null),e(B,dy),e(B,up),e(up,my),e(up,gp),e(gp,hy),e(B,fy),e(B,zt),e(zt,uy),e(zt,_p),e(_p,gy),e(zt,_y),e(zt,Dm),e(Dm,by),e(zt,vy),e(B,wy),e(B,Yr),e(Yr,xy),e(Yr,Kr),e(Kr,ky),e(Yr,yy),e(B,Py),e(B,pn),v(Xr,pn,null),e(pn,Ty),e(pn,Cm),e(Cm,$y),h(t,A_,m),h(t,It,m),e(It,cn),e(cn,zm),v(Jr,zm,null),e(It,jy),e(It,Im),e(Im,Ey),h(t,D_,m),h(t,Z,m),v(eo,Z,null),e(Z,qy),e(Z,St),e(St,Ay),e(St,Sm),e(Sm,Dy),e(St,Cy),e(St,Mm),e(Mm,zy),e(St,Iy),e(Z,Sy),v(dn,Z,null),e(Z,My),e(Z,bp),e(bp,Fy),e(bp,vp),e(vp,Ly),e(Z,Oy),e(Z,Mt),e(Mt,Ny),e(Mt,wp),e(wp,Uy),e(Mt,Gy),e(Mt,Fm),e(Fm,Ry),e(Mt,Qy),e(Z,Hy),e(Z,to),e(to,Vy),e(to,so),e(so,Wy),e(to,By),e(Z,Zy),e(Z,mn),v(no,mn,null),e(mn,Yy),e(mn,Lm),e(Lm,Ky),h(t,C_,m),h(t,Ft,m),e(Ft,hn),e(hn,Om),v(ao,Om,null),e(Ft,Xy),e(Ft,Nm),e(Nm,Jy),h(t,z_,m),h(t,xp,m),e(xp,eP),h(t,I_,m),h(t,Lt,m),e(Lt,fn),e(fn,Um),v(ro,Um,null),e(Lt,tP),e(Lt,Gm),e(Gm,sP),h(t,S_,m),h(t,Y,m),v(oo,Y,null),e(Y,nP),e(Y,We),e(We,aP),e(We,kp),e(kp,rP),e(We,oP),e(We,yp),e(yp,iP),e(We,lP),e(We,Rm),e(Rm,pP),e(We,cP),e(Y,dP),v(un,Y,null),e(Y,mP),e(Y,gn),v(io,gn,null),e(gn,hP),e(gn,lo),e(lo,fP),e(lo,Qm),e(Qm,uP),e(lo,gP),e(Y,_P),e(Y,_n),v(po,_n,null),e(_n,bP),e(_n,Hm),e(Hm,vP),e(Y,wP),e(Y,tt),v(co,tt,null),e(tt,xP),e(tt,Vm),e(Vm,kP),e(tt,yP),e(tt,Se),e(Se,PP),e(Se,Wm),e(Wm,TP),e(Se,$P),e(Se,Bm),e(Bm,jP),e(Se,EP),e(Se,Zm),e(Zm,qP),e(Se,AP),e(Se,Ym),e(Ym,DP),e(Se,CP),e(Y,zP),e(Y,bn),v(mo,bn,null),e(bn,IP),e(bn,Be),e(Be,SP),e(Be,Km),e(Km,MP),e(Be,FP),e(Be,Xm),e(Xm,LP),e(Be,OP),e(Be,Jm),e(Jm,NP),e(Be,UP),h(t,M_,m),h(t,K,m),v(ho,K,null),e(K,GP),e(K,eh),e(eh,RP),e(K,QP),v(vn,K,null),e(K,HP),e(K,Pp),e(Pp,VP),e(Pp,Tp),e(Tp,WP),e(K,BP),e(K,Ot),e(Ot,ZP),e(Ot,$p),e($p,YP),e(Ot,KP),e(Ot,th),e(th,XP),e(Ot,JP),e(K,e0),e(K,Me),e(Me,t0),e(Me,sh),e(sh,s0),e(Me,n0),e(Me,nh),e(nh,a0),e(Me,r0),e(Me,ah),e(ah,o0),e(Me,i0),e(Me,fo),e(fo,l0),e(Me,p0),e(K,c0),e(K,wn),v(uo,wn,null),e(wn,d0),e(wn,rh),e(rh,m0),h(t,F_,m),h(t,Nt,m),e(Nt,xn),e(xn,oh),v(go,oh,null),e(Nt,h0),e(Nt,ih),e(ih,f0),h(t,L_,m),h(t,O,m),v(_o,O,null),e(O,u0),e(O,Ut),e(Ut,g0),e(Ut,lh),e(lh,_0),e(Ut,b0),e(Ut,jp),e(jp,v0),e(Ut,w0),e(O,x0),v(kn,O,null),e(O,k0),e(O,Ep),e(Ep,y0),e(Ep,qp),e(qp,P0),e(O,T0),e(O,Gt),e(Gt,$0),e(Gt,Ap),e(Ap,j0),e(Gt,E0),e(Gt,ph),e(ph,q0),e(Gt,A0),e(O,D0),e(O,bo),e(bo,C0),e(bo,vo),e(vo,z0),e(bo,I0),e(O,S0),v(yn,O,null),e(O,M0),e(O,Pn),v(wo,Pn,null),e(Pn,F0),e(Pn,ch),e(ch,L0),h(t,O_,m),h(t,Rt,m),e(Rt,Tn),e(Tn,dh),v(xo,dh,null),e(Rt,O0),e(Rt,mh),e(mh,N0),h(t,N_,m),h(t,S,m),v(ko,S,null),e(S,U0),e(S,Qt),e(Qt,G0),e(Qt,hh),e(hh,R0),e(Qt,Q0),e(Qt,Dp),e(Dp,H0),e(Qt,V0),e(S,W0),v($n,S,null),e(S,B0),e(S,Cp),e(Cp,Z0),e(Cp,zp),e(zp,Y0),e(S,K0),e(S,Ht),e(Ht,X0),e(Ht,Ip),e(Ip,J0),e(Ht,eT),e(Ht,fh),e(fh,tT),e(Ht,sT),e(S,nT),e(S,yo),e(yo,aT),e(yo,Po),e(Po,rT),e(yo,oT),e(S,iT),e(S,st),v(To,st,null),e(st,lT),e(st,uh),e(uh,pT),e(st,cT),e(st,gh),e(gh,dT),e(S,mT),e(S,jn),v($o,jn,null),e(jn,hT),e(jn,_h),e(_h,fT),e(S,uT),e(S,En),v(jo,En,null),e(En,gT),e(En,bh),e(bh,_T),e(S,bT),e(S,qn),v(Eo,qn,null),e(qn,vT),e(qn,vh),e(vh,wT),h(t,U_,m),h(t,An,m),e(An,xT),e(An,Sp),e(Sp,kT),e(An,yT),h(t,G_,m),h(t,Vt,m),e(Vt,Dn),e(Dn,wh),v(qo,wh,null),e(Vt,PT),e(Vt,xh),e(xh,TT),h(t,R_,m),h(t,M,m),v(Ao,M,null),e(M,$T),e(M,Wt),e(Wt,jT),e(Wt,kh),e(kh,ET),e(Wt,qT),e(Wt,Mp),e(Mp,AT),e(Wt,DT),e(M,CT),v(Cn,M,null),e(M,zT),e(M,Fp),e(Fp,IT),e(Fp,Lp),e(Lp,ST),e(M,MT),e(M,Bt),e(Bt,FT),e(Bt,Op),e(Op,LT),e(Bt,OT),e(Bt,yh),e(yh,NT),e(Bt,UT),e(M,GT),e(M,Do),e(Do,RT),e(Do,Co),e(Co,QT),e(Do,HT),e(M,VT),e(M,zn),v(zo,zn,null),e(zn,WT),e(zn,Ph),e(Ph,BT),e(M,ZT),e(M,nt),v(Io,nt,null),e(nt,YT),e(nt,Zt),e(Zt,KT),e(Zt,Th),e(Th,XT),e(Zt,JT),e(Zt,$h),e($h,e$),e(Zt,t$),e(nt,s$),e(nt,jh),e(jh,n$),e(M,a$),e(M,In),v(So,In,null),e(In,r$),e(In,Eh),e(Eh,o$),h(t,Q_,m),h(t,Yt,m),e(Yt,Sn),e(Sn,qh),v(Mo,qh,null),e(Yt,i$),e(Yt,Ah),e(Ah,l$),h(t,H_,m),h(t,pe,m),v(Fo,pe,null),e(pe,p$),e(pe,Dh),e(Dh,c$),e(pe,d$),e(pe,Kt),e(Kt,m$),e(Kt,Np),e(Np,h$),e(Kt,f$),e(Kt,Ch),e(Ch,u$),e(Kt,g$),e(pe,_$),e(pe,G),e(G,b$),e(G,zh),e(zh,v$),e(G,w$),e(G,Ih),e(Ih,x$),e(G,k$),e(G,Sh),e(Sh,y$),e(G,P$),e(G,Mh),e(Mh,T$),e(G,$$),e(G,Fh),e(Fh,j$),e(G,E$),e(G,Lh),e(Lh,q$),e(G,A$),e(G,Lo),e(Lo,D$),e(G,C$),e(G,Oo),e(Oo,z$),e(pe,I$),v(Mn,pe,null),e(pe,S$),e(pe,Fn),v(No,Fn,null),e(Fn,M$),e(Fn,Oh),e(Oh,F$),h(t,V_,m),h(t,Xt,m),e(Xt,Ln),e(Ln,Nh),v(Uo,Nh,null),e(Xt,L$),e(Xt,Uh),e(Uh,O$),h(t,W_,m),h(t,X,m),v(Go,X,null),e(X,N$),e(X,Ro),e(Ro,U$),e(Ro,Gh),e(Gh,G$),e(Ro,R$),e(X,Q$),v(On,X,null),e(X,H$),e(X,Up),e(Up,V$),e(Up,Gp),e(Gp,W$),e(X,B$),e(X,Jt),e(Jt,Z$),e(Jt,Rp),e(Rp,Y$),e(Jt,K$),e(Jt,Rh),e(Rh,X$),e(Jt,J$),e(X,e4),e(X,Qo),e(Qo,t4),e(Qo,Ho),e(Ho,s4),e(Qo,n4),e(X,a4),e(X,ae),v(Vo,ae,null),e(ae,r4),e(ae,Qh),e(Qh,o4),e(ae,i4),e(ae,ce),e(ce,Hh),e(Hh,Vh),e(Vh,l4),e(ce,p4),e(ce,Wh),e(Wh,Bh),e(Bh,c4),e(ce,d4),e(ce,Zh),e(Zh,Yh),e(Yh,m4),e(ce,h4),e(ce,Kh),e(Kh,Xh),e(Xh,f4),e(ce,u4),e(ce,Jh),e(Jh,ef),e(ef,g4),e(ce,_4),e(ce,tf),e(tf,sf),e(sf,b4),e(ce,v4),e(ce,nf),e(nf,af),e(af,w4),e(ae,x4),e(ae,Wo),e(Wo,k4),e(Wo,rf),e(rf,y4),e(Wo,P4),e(ae,T4),v(Nn,ae,null),e(ae,$4),e(ae,of),e(of,j4),e(ae,E4),v(Un,ae,null),h(t,B_,m),h(t,es,m),e(es,Gn),e(Gn,lf),v(Bo,lf,null),e(es,q4),e(es,pf),e(pf,A4),h(t,Z_,m),h(t,N,m),v(Zo,N,null),e(N,D4),e(N,ts),e(ts,C4),e(ts,cf),e(cf,z4),e(ts,I4),e(ts,Qp),e(Qp,S4),e(ts,M4),e(N,F4),v(Rn,N,null),e(N,L4),e(N,Hp),e(Hp,O4),e(Hp,Vp),e(Vp,N4),e(N,U4),e(N,ss),e(ss,G4),e(ss,Wp),e(Wp,R4),e(ss,Q4),e(ss,df),e(df,H4),e(ss,V4),e(N,W4),e(N,Yo),e(Yo,B4),e(Yo,mf),e(mf,Z4),e(Yo,Y4),e(N,K4),e(N,Ko),e(Ko,X4),e(Ko,Xo),e(Xo,J4),e(Ko,e7),e(N,t7),e(N,Qn),v(Jo,Qn,null),e(Qn,s7),e(Qn,hf),e(hf,n7),h(t,Y_,m),h(t,ns,m),e(ns,Hn),e(Hn,ff),v(ei,ff,null),e(ns,a7),e(ns,uf),e(uf,r7),h(t,K_,m),h(t,J,m),v(ti,J,null),e(J,o7),e(J,si),e(si,i7),e(si,gf),e(gf,l7),e(si,p7),e(J,c7),v(Vn,J,null),e(J,d7),e(J,Bp),e(Bp,m7),e(Bp,Zp),e(Zp,h7),e(J,f7),e(J,as),e(as,u7),e(as,Yp),e(Yp,g7),e(as,_7),e(as,_f),e(_f,b7),e(as,v7),e(J,w7),e(J,ni),e(ni,x7),e(ni,ai),e(ai,k7),e(ni,y7),e(J,P7),e(J,Wn),v(ri,Wn,null),e(Wn,T7),e(Wn,bf),e(bf,$7),h(t,X_,m),h(t,rs,m),e(rs,Bn),e(Bn,vf),v(oi,vf,null),e(rs,j7),e(rs,wf),e(wf,E7),h(t,J_,m),h(t,F,m),v(ii,F,null),e(F,q7),e(F,xf),e(xf,A7),e(F,D7),v(Zn,F,null),e(F,C7),e(F,Kp),e(Kp,z7),e(Kp,Xp),e(Xp,I7),e(F,S7),e(F,os),e(os,M7),e(os,Jp),e(Jp,F7),e(os,L7),e(os,kf),e(kf,O7),e(os,N7),e(F,U7),e(F,Yn),e(Yn,G7),e(Yn,li),e(li,R7),e(Yn,Q7),e(Yn,pi),e(pi,H7),e(F,V7),v(Kn,F,null),e(F,W7),e(F,Xn),v(ci,Xn,null),e(Xn,B7),e(Xn,yf),e(yf,Z7),e(F,Y7),e(F,Jn),v(di,Jn,null),e(Jn,K7),e(Jn,Pf),e(Pf,X7),h(t,eb,m),h(t,is,m),e(is,ea),e(ea,Tf),v(mi,Tf,null),e(is,J7),e(is,$f),e($f,ej),h(t,tb,m),h(t,I,m),v(hi,I,null),e(I,tj),e(I,ls),e(ls,sj),e(ls,jf),e(jf,nj),e(ls,aj),e(ls,ec),e(ec,rj),e(ls,oj),e(I,ij),v(ta,I,null),e(I,lj),e(I,tc),e(tc,pj),e(tc,sc),e(sc,cj),e(I,dj),e(I,ps),e(ps,mj),e(ps,nc),e(nc,hj),e(ps,fj),e(ps,Ef),e(Ef,uj),e(ps,gj),e(I,_j),e(I,fi),e(fi,bj),e(fi,ui),e(ui,vj),e(fi,wj),e(I,xj),e(I,sa),v(gi,sa,null),e(sa,kj),e(sa,qf),e(qf,yj),e(I,Pj),e(I,at),v(_i,at,null),e(at,Tj),e(at,Af),e(Af,$j),e(at,jj),e(at,Df),e(Df,Ej),e(I,qj),e(I,na),v(bi,na,null),e(na,Aj),e(na,Cf),e(Cf,Dj),e(I,Cj),e(I,aa),v(vi,aa,null),e(aa,zj),e(aa,zf),e(zf,Ij),e(I,Sj),e(I,ra),v(wi,ra,null),e(ra,Mj),e(ra,If),e(If,Fj),h(t,sb,m),h(t,cs,m),e(cs,oa),e(oa,Sf),v(xi,Sf,null),e(cs,Lj),e(cs,Mf),e(Mf,Oj),h(t,nb,m),h(t,de,m),v(ki,de,null),e(de,Nj),e(de,Ff),e(Ff,Uj),e(de,Gj),e(de,ds),e(ds,Rj),e(ds,ac),e(ac,Qj),e(ds,Hj),e(ds,Lf),e(Lf,Vj),e(ds,Wj),e(de,Bj),e(de,ia),e(ia,Zj),e(ia,yi),e(yi,Yj),e(ia,Kj),e(ia,Pi),e(Pi,Xj),e(de,Jj),v(la,de,null),e(de,e5),e(de,pa),v(Ti,pa,null),e(pa,t5),e(pa,Of),e(Of,s5),h(t,ab,m),h(t,ms,m),e(ms,ca),e(ca,Nf),v($i,Nf,null),e(ms,n5),e(ms,Uf),e(Uf,a5),h(t,rb,m),h(t,U,m),v(ji,U,null),e(U,r5),e(U,Ze),e(Ze,o5),e(Ze,Gf),e(Gf,i5),e(Ze,l5),e(Ze,Rf),e(Rf,p5),e(Ze,c5),e(Ze,Qf),e(Qf,d5),e(Ze,m5),e(U,h5),e(U,Ye),e(Ye,f5),e(Ye,Hf),e(Hf,u5),e(Ye,g5),e(Ye,Vf),e(Vf,_5),e(Ye,b5),e(Ye,Wf),e(Wf,v5),e(Ye,w5),e(U,x5),v(da,U,null),e(U,k5),e(U,rc),e(rc,y5),e(rc,oc),e(oc,P5),e(U,T5),e(U,hs),e(hs,$5),e(hs,ic),e(ic,j5),e(hs,E5),e(hs,Bf),e(Bf,q5),e(hs,A5),e(U,D5),e(U,Ei),e(Ei,C5),e(Ei,qi),e(qi,z5),e(Ei,I5),e(U,S5),e(U,ma),v(Ai,ma,null),e(ma,M5),e(ma,Di),e(Di,F5),e(Di,lc),e(lc,L5),e(Di,O5),h(t,ob,m),h(t,fs,m),e(fs,ha),e(ha,Zf),v(Ci,Zf,null),e(fs,N5),e(fs,Yf),e(Yf,U5),h(t,ib,m),h(t,pc,m),e(pc,G5),h(t,lb,m),h(t,us,m),e(us,fa),e(fa,Kf),v(zi,Kf,null),e(us,R5),e(us,Xf),e(Xf,Q5),h(t,pb,m),h(t,ee,m),v(Ii,ee,null),e(ee,H5),e(ee,Si),e(Si,V5),e(Si,Jf),e(Jf,W5),e(Si,B5),e(ee,Z5),v(ua,ee,null),e(ee,Y5),e(ee,cc),e(cc,K5),e(cc,dc),e(dc,X5),e(ee,J5),e(ee,gs),e(gs,eE),e(gs,mc),e(mc,tE),e(gs,sE),e(gs,eu),e(eu,nE),e(gs,aE),e(ee,rE),e(ee,Mi),e(Mi,oE),e(Mi,Fi),e(Fi,iE),e(Mi,lE),e(ee,pE),e(ee,Ne),v(Li,Ne,null),e(Ne,cE),e(Ne,Oi),e(Oi,dE),e(Oi,tu),e(tu,mE),e(Oi,hE),e(Ne,fE),e(Ne,su),e(su,uE),e(Ne,gE),e(Ne,Ke),e(Ke,nu),e(nu,au),e(au,_E),e(Ke,bE),e(Ke,ru),e(ru,ou),e(ou,vE),e(Ke,wE),e(Ke,iu),e(iu,lu),e(lu,xE),e(Ke,kE),e(Ke,pu),e(pu,cu),e(cu,yE),h(t,cb,m),h(t,_s,m),e(_s,ga),e(ga,du),v(Ni,du,null),e(_s,PE),e(_s,mu),e(mu,TE),h(t,db,m),h(t,te,m),v(Ui,te,null),e(te,$E),e(te,hu),e(hu,jE),e(te,EE),v(_a,te,null),e(te,qE),e(te,hc),e(hc,AE),e(hc,fc),e(fc,DE),e(te,CE),e(te,bs),e(bs,zE),e(bs,uc),e(uc,IE),e(bs,SE),e(bs,fu),e(fu,ME),e(bs,FE),e(te,LE),e(te,Gi),e(Gi,OE),e(Gi,Ri),e(Ri,NE),e(Gi,UE),e(te,GE),e(te,ba),v(Qi,ba,null),e(ba,RE),e(ba,uu),e(uu,QE),h(t,mb,m),h(t,vs,m),e(vs,va),e(va,gu),v(Hi,gu,null),e(vs,HE),e(vs,_u),e(_u,VE),h(t,hb,m),h(t,se,m),v(Vi,se,null),e(se,WE),e(se,Wi),e(Wi,BE),e(Wi,bu),e(bu,ZE),e(Wi,YE),e(se,KE),v(wa,se,null),e(se,XE),e(se,gc),e(gc,JE),e(gc,_c),e(_c,eq),e(se,tq),e(se,vu),e(vu,sq),e(se,nq),e(se,Bi),e(Bi,aq),e(Bi,Zi),e(Zi,rq),e(Bi,oq),e(se,iq),e(se,xa),v(Yi,xa,null),e(xa,lq),e(xa,wu),e(wu,pq),h(t,fb,m),h(t,ws,m),e(ws,ka),e(ka,xu),v(Ki,xu,null),e(ws,cq),e(ws,ku),e(ku,dq),h(t,ub,m),h(t,ne,m),v(Xi,ne,null),e(ne,mq),e(ne,Ji),e(Ji,hq),e(Ji,yu),e(yu,fq),e(Ji,uq),e(ne,gq),v(ya,ne,null),e(ne,_q),e(ne,bc),e(bc,bq),e(bc,vc),e(vc,vq),e(ne,wq),e(ne,xs),e(xs,xq),e(xs,wc),e(wc,kq),e(xs,yq),e(xs,Pu),e(Pu,Pq),e(xs,Tq),e(ne,$q),e(ne,el),e(el,jq),e(el,tl),e(tl,Eq),e(el,qq),e(ne,Aq),e(ne,rt),v(sl,rt,null),e(rt,Dq),e(rt,Tu),e(Tu,Cq),e(rt,zq),e(rt,Xe),e(Xe,$u),e($u,ju),e(ju,Iq),e(Xe,Sq),e(Xe,Eu),e(Eu,qu),e(qu,Mq),e(Xe,Fq),e(Xe,Au),e(Au,Du),e(Du,Lq),e(Xe,Oq),e(Xe,Cu),e(Cu,zu),e(zu,Nq),h(t,gb,m),h(t,ks,m),e(ks,Pa),e(Pa,Iu),v(nl,Iu,null),e(ks,Uq),e(ks,xc),e(xc,Gq),e(xc,Su),e(Su,Rq),h(t,_b,m),h(t,A,m),v(al,A,null),e(A,Qq),e(A,Mu),e(Mu,Hq),e(A,Vq),e(A,Fu),e(Fu,Wq),e(A,Bq),e(A,Lu),e(Lu,Zq),e(A,Yq),e(A,Ou),e(Ou,Kq),e(A,Xq),e(A,Fe),e(Fe,Jq),e(Fe,kc),e(kc,e3),e(Fe,t3),e(Fe,Nu),e(Nu,s3),e(Fe,n3),e(Fe,Uu),e(Uu,a3),e(Fe,r3),e(Fe,Gu),e(Gu,o3),e(Fe,i3),e(A,l3),e(A,Ta),v(rl,Ta,null),e(Ta,p3),e(Ta,Ru),e(Ru,c3),e(A,d3),e(A,ot),v(ol,ot,null),e(ot,m3),e(ot,Qu),e(Qu,h3),e(ot,f3),v($a,ot,null),e(A,u3),e(A,ja),v(il,ja,null),e(ja,g3),e(ja,Hu),e(Hu,_3),e(A,b3),e(A,Ea),v(ll,Ea,null),e(Ea,v3),e(Ea,pl),e(pl,w3),e(pl,Vu),e(Vu,x3),e(pl,k3),e(A,y3),e(A,qa),v(cl,qa,null),e(qa,P3),e(qa,dl),e(dl,T3),e(dl,Wu),e(Wu,$3),e(dl,j3),e(A,E3),e(A,Aa),v(ml,Aa,null),e(Aa,q3),e(Aa,ys),e(ys,A3),e(ys,Bu),e(Bu,D3),e(ys,C3),e(ys,Zu),e(Zu,z3),e(ys,I3),e(A,S3),e(A,Da),v(hl,Da,null),e(Da,M3),e(Da,Yu),e(Yu,F3),e(A,L3),e(A,Ca),v(fl,Ca,null),e(Ca,O3),e(Ca,ul),e(ul,N3),e(ul,Ku),e(Ku,U3),e(ul,G3),bb=!0},p(t,[m]){const gl={};m&2&&(gl.$$scope={dirty:m,ctx:t}),Ds.$set(gl);const Xu={};m&2&&(Xu.$$scope={dirty:m,ctx:t}),zs.$set(Xu);const Ju={};m&2&&(Ju.$$scope={dirty:m,ctx:t}),Gs.$set(Ju);const eg={};m&2&&(eg.$$scope={dirty:m,ctx:t}),Hs.$set(eg);const _l={};m&2&&(_l.$$scope={dirty:m,ctx:t}),Zs.$set(_l);const tg={};m&2&&(tg.$$scope={dirty:m,ctx:t}),Xs.$set(tg);const sg={};m&2&&(sg.$$scope={dirty:m,ctx:t}),tn.$set(sg);const bl={};m&2&&(bl.$$scope={dirty:m,ctx:t}),an.$set(bl);const vl={};m&2&&(vl.$$scope={dirty:m,ctx:t}),ln.$set(vl);const ng={};m&2&&(ng.$$scope={dirty:m,ctx:t}),dn.$set(ng);const Le={};m&2&&(Le.$$scope={dirty:m,ctx:t}),un.$set(Le);const ag={};m&2&&(ag.$$scope={dirty:m,ctx:t}),vn.$set(ag);const rg={};m&2&&(rg.$$scope={dirty:m,ctx:t}),kn.$set(rg);const og={};m&2&&(og.$$scope={dirty:m,ctx:t}),yn.$set(og);const ig={};m&2&&(ig.$$scope={dirty:m,ctx:t}),$n.$set(ig);const wl={};m&2&&(wl.$$scope={dirty:m,ctx:t}),Cn.$set(wl);const lg={};m&2&&(lg.$$scope={dirty:m,ctx:t}),Mn.$set(lg);const pg={};m&2&&(pg.$$scope={dirty:m,ctx:t}),On.$set(pg);const cg={};m&2&&(cg.$$scope={dirty:m,ctx:t}),Nn.$set(cg);const xl={};m&2&&(xl.$$scope={dirty:m,ctx:t}),Un.$set(xl);const dg={};m&2&&(dg.$$scope={dirty:m,ctx:t}),Rn.$set(dg);const mg={};m&2&&(mg.$$scope={dirty:m,ctx:t}),Vn.$set(mg);const kl={};m&2&&(kl.$$scope={dirty:m,ctx:t}),Zn.$set(kl);const hg={};m&2&&(hg.$$scope={dirty:m,ctx:t}),Kn.$set(hg);const yl={};m&2&&(yl.$$scope={dirty:m,ctx:t}),ta.$set(yl);const fg={};m&2&&(fg.$$scope={dirty:m,ctx:t}),la.$set(fg);const Pl={};m&2&&(Pl.$$scope={dirty:m,ctx:t}),da.$set(Pl);const ug={};m&2&&(ug.$$scope={dirty:m,ctx:t}),ua.$set(ug);const gg={};m&2&&(gg.$$scope={dirty:m,ctx:t}),_a.$set(gg);const Oe={};m&2&&(Oe.$$scope={dirty:m,ctx:t}),wa.$set(Oe);const Tl={};m&2&&(Tl.$$scope={dirty:m,ctx:t}),ya.$set(Tl);const _g={};m&2&&(_g.$$scope={dirty:m,ctx:t}),$a.$set(_g)},i(t){bb||(w(l.$$.fragment,t),w(Ua.$$.fragment,t),w(Ga.$$.fragment,t),w(Qa.$$.fragment,t),w(Ha.$$.fragment,t),w(Va.$$.fragment,t),w(Wa.$$.fragment,t),w(Ba.$$.fragment,t),w(Ds.$$.fragment,t),w(Xa.$$.fragment,t),w(Ja.$$.fragment,t),w(zs.$$.fragment,t),w(er.$$.fragment,t),w(tr.$$.fragment,t),w(sr.$$.fragment,t),w(nr.$$.fragment,t),w(rr.$$.fragment,t),w(or.$$.fragment,t),w(ir.$$.fragment,t),w(lr.$$.fragment,t),w(pr.$$.fragment,t),w(cr.$$.fragment,t),w(dr.$$.fragment,t),w(mr.$$.fragment,t),w(hr.$$.fragment,t),w(Gs.$$.fragment,t),w(_r.$$.fragment,t),w(vr.$$.fragment,t),w(wr.$$.fragment,t),w(Hs.$$.fragment,t),w(xr.$$.fragment,t),w(yr.$$.fragment,t),w(Pr.$$.fragment,t),w(Tr.$$.fragment,t),w(Zs.$$.fragment,t),w(qr.$$.fragment,t),w(Ar.$$.fragment,t),w(Dr.$$.fragment,t),w(Xs.$$.fragment,t),w(Sr.$$.fragment,t),w(Mr.$$.fragment,t),w(Fr.$$.fragment,t),w(tn.$$.fragment,t),w(Ur.$$.fragment,t),w(Gr.$$.fragment,t),w(Rr.$$.fragment,t),w(an.$$.fragment,t),w(Wr.$$.fragment,t),w(Br.$$.fragment,t),w(Zr.$$.fragment,t),w(ln.$$.fragment,t),w(Xr.$$.fragment,t),w(Jr.$$.fragment,t),w(eo.$$.fragment,t),w(dn.$$.fragment,t),w(no.$$.fragment,t),w(ao.$$.fragment,t),w(ro.$$.fragment,t),w(oo.$$.fragment,t),w(un.$$.fragment,t),w(io.$$.fragment,t),w(po.$$.fragment,t),w(co.$$.fragment,t),w(mo.$$.fragment,t),w(ho.$$.fragment,t),w(vn.$$.fragment,t),w(uo.$$.fragment,t),w(go.$$.fragment,t),w(_o.$$.fragment,t),w(kn.$$.fragment,t),w(yn.$$.fragment,t),w(wo.$$.fragment,t),w(xo.$$.fragment,t),w(ko.$$.fragment,t),w($n.$$.fragment,t),w(To.$$.fragment,t),w($o.$$.fragment,t),w(jo.$$.fragment,t),w(Eo.$$.fragment,t),w(qo.$$.fragment,t),w(Ao.$$.fragment,t),w(Cn.$$.fragment,t),w(zo.$$.fragment,t),w(Io.$$.fragment,t),w(So.$$.fragment,t),w(Mo.$$.fragment,t),w(Fo.$$.fragment,t),w(Mn.$$.fragment,t),w(No.$$.fragment,t),w(Uo.$$.fragment,t),w(Go.$$.fragment,t),w(On.$$.fragment,t),w(Vo.$$.fragment,t),w(Nn.$$.fragment,t),w(Un.$$.fragment,t),w(Bo.$$.fragment,t),w(Zo.$$.fragment,t),w(Rn.$$.fragment,t),w(Jo.$$.fragment,t),w(ei.$$.fragment,t),w(ti.$$.fragment,t),w(Vn.$$.fragment,t),w(ri.$$.fragment,t),w(oi.$$.fragment,t),w(ii.$$.fragment,t),w(Zn.$$.fragment,t),w(Kn.$$.fragment,t),w(ci.$$.fragment,t),w(di.$$.fragment,t),w(mi.$$.fragment,t),w(hi.$$.fragment,t),w(ta.$$.fragment,t),w(gi.$$.fragment,t),w(_i.$$.fragment,t),w(bi.$$.fragment,t),w(vi.$$.fragment,t),w(wi.$$.fragment,t),w(xi.$$.fragment,t),w(ki.$$.fragment,t),w(la.$$.fragment,t),w(Ti.$$.fragment,t),w($i.$$.fragment,t),w(ji.$$.fragment,t),w(da.$$.fragment,t),w(Ai.$$.fragment,t),w(Ci.$$.fragment,t),w(zi.$$.fragment,t),w(Ii.$$.fragment,t),w(ua.$$.fragment,t),w(Li.$$.fragment,t),w(Ni.$$.fragment,t),w(Ui.$$.fragment,t),w(_a.$$.fragment,t),w(Qi.$$.fragment,t),w(Hi.$$.fragment,t),w(Vi.$$.fragment,t),w(wa.$$.fragment,t),w(Yi.$$.fragment,t),w(Ki.$$.fragment,t),w(Xi.$$.fragment,t),w(ya.$$.fragment,t),w(sl.$$.fragment,t),w(nl.$$.fragment,t),w(al.$$.fragment,t),w(rl.$$.fragment,t),w(ol.$$.fragment,t),w($a.$$.fragment,t),w(il.$$.fragment,t),w(ll.$$.fragment,t),w(cl.$$.fragment,t),w(ml.$$.fragment,t),w(hl.$$.fragment,t),w(fl.$$.fragment,t),bb=!0)},o(t){x(l.$$.fragment,t),x(Ua.$$.fragment,t),x(Ga.$$.fragment,t),x(Qa.$$.fragment,t),x(Ha.$$.fragment,t),x(Va.$$.fragment,t),x(Wa.$$.fragment,t),x(Ba.$$.fragment,t),x(Ds.$$.fragment,t),x(Xa.$$.fragment,t),x(Ja.$$.fragment,t),x(zs.$$.fragment,t),x(er.$$.fragment,t),x(tr.$$.fragment,t),x(sr.$$.fragment,t),x(nr.$$.fragment,t),x(rr.$$.fragment,t),x(or.$$.fragment,t),x(ir.$$.fragment,t),x(lr.$$.fragment,t),x(pr.$$.fragment,t),x(cr.$$.fragment,t),x(dr.$$.fragment,t),x(mr.$$.fragment,t),x(hr.$$.fragment,t),x(Gs.$$.fragment,t),x(_r.$$.fragment,t),x(vr.$$.fragment,t),x(wr.$$.fragment,t),x(Hs.$$.fragment,t),x(xr.$$.fragment,t),x(yr.$$.fragment,t),x(Pr.$$.fragment,t),x(Tr.$$.fragment,t),x(Zs.$$.fragment,t),x(qr.$$.fragment,t),x(Ar.$$.fragment,t),x(Dr.$$.fragment,t),x(Xs.$$.fragment,t),x(Sr.$$.fragment,t),x(Mr.$$.fragment,t),x(Fr.$$.fragment,t),x(tn.$$.fragment,t),x(Ur.$$.fragment,t),x(Gr.$$.fragment,t),x(Rr.$$.fragment,t),x(an.$$.fragment,t),x(Wr.$$.fragment,t),x(Br.$$.fragment,t),x(Zr.$$.fragment,t),x(ln.$$.fragment,t),x(Xr.$$.fragment,t),x(Jr.$$.fragment,t),x(eo.$$.fragment,t),x(dn.$$.fragment,t),x(no.$$.fragment,t),x(ao.$$.fragment,t),x(ro.$$.fragment,t),x(oo.$$.fragment,t),x(un.$$.fragment,t),x(io.$$.fragment,t),x(po.$$.fragment,t),x(co.$$.fragment,t),x(mo.$$.fragment,t),x(ho.$$.fragment,t),x(vn.$$.fragment,t),x(uo.$$.fragment,t),x(go.$$.fragment,t),x(_o.$$.fragment,t),x(kn.$$.fragment,t),x(yn.$$.fragment,t),x(wo.$$.fragment,t),x(xo.$$.fragment,t),x(ko.$$.fragment,t),x($n.$$.fragment,t),x(To.$$.fragment,t),x($o.$$.fragment,t),x(jo.$$.fragment,t),x(Eo.$$.fragment,t),x(qo.$$.fragment,t),x(Ao.$$.fragment,t),x(Cn.$$.fragment,t),x(zo.$$.fragment,t),x(Io.$$.fragment,t),x(So.$$.fragment,t),x(Mo.$$.fragment,t),x(Fo.$$.fragment,t),x(Mn.$$.fragment,t),x(No.$$.fragment,t),x(Uo.$$.fragment,t),x(Go.$$.fragment,t),x(On.$$.fragment,t),x(Vo.$$.fragment,t),x(Nn.$$.fragment,t),x(Un.$$.fragment,t),x(Bo.$$.fragment,t),x(Zo.$$.fragment,t),x(Rn.$$.fragment,t),x(Jo.$$.fragment,t),x(ei.$$.fragment,t),x(ti.$$.fragment,t),x(Vn.$$.fragment,t),x(ri.$$.fragment,t),x(oi.$$.fragment,t),x(ii.$$.fragment,t),x(Zn.$$.fragment,t),x(Kn.$$.fragment,t),x(ci.$$.fragment,t),x(di.$$.fragment,t),x(mi.$$.fragment,t),x(hi.$$.fragment,t),x(ta.$$.fragment,t),x(gi.$$.fragment,t),x(_i.$$.fragment,t),x(bi.$$.fragment,t),x(vi.$$.fragment,t),x(wi.$$.fragment,t),x(xi.$$.fragment,t),x(ki.$$.fragment,t),x(la.$$.fragment,t),x(Ti.$$.fragment,t),x($i.$$.fragment,t),x(ji.$$.fragment,t),x(da.$$.fragment,t),x(Ai.$$.fragment,t),x(Ci.$$.fragment,t),x(zi.$$.fragment,t),x(Ii.$$.fragment,t),x(ua.$$.fragment,t),x(Li.$$.fragment,t),x(Ni.$$.fragment,t),x(Ui.$$.fragment,t),x(_a.$$.fragment,t),x(Qi.$$.fragment,t),x(Hi.$$.fragment,t),x(Vi.$$.fragment,t),x(wa.$$.fragment,t),x(Yi.$$.fragment,t),x(Ki.$$.fragment,t),x(Xi.$$.fragment,t),x(ya.$$.fragment,t),x(sl.$$.fragment,t),x(nl.$$.fragment,t),x(al.$$.fragment,t),x(rl.$$.fragment,t),x(ol.$$.fragment,t),x($a.$$.fragment,t),x(il.$$.fragment,t),x(ll.$$.fragment,t),x(cl.$$.fragment,t),x(ml.$$.fragment,t),x(hl.$$.fragment,t),x(fl.$$.fragment,t),bb=!1},d(t){s(u),t&&s(T),t&&s(y),k(l),t&&s(wg),t&&s(Ps),t&&s(xg),t&&s(El),t&&s(kg),t&&s(Ts),t&&s(yg),t&&s(dt),k(Ua),t&&s(Pg),t&&s(js),t&&s(Tg),t&&s(Il),t&&s($g),k(Ga,t),t&&s(jg),t&&s(Es),t&&s(Eg),k(Qa,t),t&&s(qg),t&&s(qs),t&&s(Ag),k(Ha,t),t&&s(Dg),t&&s(As),t&&s(Cg),k(Va,t),t&&s(zg),t&&s(Sl),t&&s(Ig),k(Wa,t),t&&s(Sg),t&&s(ge),k(Ba),k(Ds),t&&s(Mg),t&&s(ht),k(Xa),t&&s(Fg),t&&s(Je),t&&s(Lg),k(Ja,t),t&&s(Og),k(zs,t),t&&s(Ng),k(er,t),t&&s(Ug),k(tr,t),t&&s(Gg),t&&s(Ol),t&&s(Rg),k(sr,t),t&&s(Qg),t&&s(Is),t&&s(Hg),k(nr,t),t&&s(Vg),t&&s(Nl),t&&s(Wg),t&&s(Ul),t&&s(Bg),t&&s(_e),t&&s(Zg),t&&s(ut),k(rr),t&&s(Yg),t&&s(Ve),t&&s(Kg),t&&s(et),t&&s(Xg),k(or,t),t&&s(Jg),t&&s(Gl),t&&s(e_),k(ir,t),t&&s(t_),t&&s(Rl),t&&s(s_),t&&s(Ms),t&&s(n_),t&&s(gt),k(lr),t&&s(a_),t&&s(Ql),t&&s(r_),t&&s(Ls),t&&s(o_),t&&s(Hl),t&&s(i_),t&&s(Vl),t&&s(l_),k(pr,t),t&&s(p_),t&&s(Wl),t&&s(c_),t&&s(_t),k(cr),t&&s(d_),t&&s(Bl),t&&s(m_),t&&s(bt),k(dr),t&&s(h_),t&&s(Yl),t&&s(f_),t&&s(vt),k(mr),t&&s(u_),t&&s(Q),k(hr),k(Gs),k(_r),t&&s(g_),t&&s(xt),k(vr),t&&s(__),t&&s(ie),k(wr),k(Hs),k(xr),t&&s(b_),t&&s(kt),k(yr),t&&s(v_),t&&s(ap),t&&s(w_),t&&s(yt),k(Pr),t&&s(x_),t&&s(H),k(Tr),k(Zs),k(qr),t&&s(k_),t&&s(Tt),k(Ar),t&&s(y_),t&&s(V),k(Dr),k(Xs),k(Sr),t&&s(P_),t&&s(jt),k(Mr),t&&s(T_),t&&s(le),k(Fr),k(tn),k(Ur),t&&s($_),t&&s(qt),k(Gr),t&&s(j_),t&&s(W),k(Rr),k(an),k(Wr),t&&s(E_),t&&s(Dt),k(Br),t&&s(q_),t&&s(B),k(Zr),k(ln),k(Xr),t&&s(A_),t&&s(It),k(Jr),t&&s(D_),t&&s(Z),k(eo),k(dn),k(no),t&&s(C_),t&&s(Ft),k(ao),t&&s(z_),t&&s(xp),t&&s(I_),t&&s(Lt),k(ro),t&&s(S_),t&&s(Y),k(oo),k(un),k(io),k(po),k(co),k(mo),t&&s(M_),t&&s(K),k(ho),k(vn),k(uo),t&&s(F_),t&&s(Nt),k(go),t&&s(L_),t&&s(O),k(_o),k(kn),k(yn),k(wo),t&&s(O_),t&&s(Rt),k(xo),t&&s(N_),t&&s(S),k(ko),k($n),k(To),k($o),k(jo),k(Eo),t&&s(U_),t&&s(An),t&&s(G_),t&&s(Vt),k(qo),t&&s(R_),t&&s(M),k(Ao),k(Cn),k(zo),k(Io),k(So),t&&s(Q_),t&&s(Yt),k(Mo),t&&s(H_),t&&s(pe),k(Fo),k(Mn),k(No),t&&s(V_),t&&s(Xt),k(Uo),t&&s(W_),t&&s(X),k(Go),k(On),k(Vo),k(Nn),k(Un),t&&s(B_),t&&s(es),k(Bo),t&&s(Z_),t&&s(N),k(Zo),k(Rn),k(Jo),t&&s(Y_),t&&s(ns),k(ei),t&&s(K_),t&&s(J),k(ti),k(Vn),k(ri),t&&s(X_),t&&s(rs),k(oi),t&&s(J_),t&&s(F),k(ii),k(Zn),k(Kn),k(ci),k(di),t&&s(eb),t&&s(is),k(mi),t&&s(tb),t&&s(I),k(hi),k(ta),k(gi),k(_i),k(bi),k(vi),k(wi),t&&s(sb),t&&s(cs),k(xi),t&&s(nb),t&&s(de),k(ki),k(la),k(Ti),t&&s(ab),t&&s(ms),k($i),t&&s(rb),t&&s(U),k(ji),k(da),k(Ai),t&&s(ob),t&&s(fs),k(Ci),t&&s(ib),t&&s(pc),t&&s(lb),t&&s(us),k(zi),t&&s(pb),t&&s(ee),k(Ii),k(ua),k(Li),t&&s(cb),t&&s(_s),k(Ni),t&&s(db),t&&s(te),k(Ui),k(_a),k(Qi),t&&s(mb),t&&s(vs),k(Hi),t&&s(hb),t&&s(se),k(Vi),k(wa),k(Yi),t&&s(fb),t&&s(ws),k(Ki),t&&s(ub),t&&s(ne),k(Xi),k(ya),k(sl),t&&s(gb),t&&s(ks),k(nl),t&&s(_b),t&&s(A),k(al),k(rl),k(ol),k($a),k(il),k(ll),k(cl),k(ml),k(hl),k(fl)}}}const tS={local:"pipelines",sections:[{local:"transformers.pipeline",title:"The pipeline abstraction"},{local:"pipeline-batching",title:"Pipeline batching"},{local:"pipeline-chunk-batching",title:"Pipeline chunk batching"},{local:"pipeline-custom-code",title:"Pipeline custom code"},{local:"implementing-a-pipeline",title:"Implementing a pipeline"},{local:"audio",sections:[{local:"transformers.AudioClassificationPipeline",title:"AudioClassificationPipeline"},{local:"transformers.AutomaticSpeechRecognitionPipeline",title:"AutomaticSpeechRecognitionPipeline"}],title:"Audio"},{local:"computer-vision",sections:[{local:"transformers.DepthEstimationPipeline",title:"DepthEstimationPipeline"},{local:"transformers.ImageClassificationPipeline",title:"ImageClassificationPipeline"},{local:"transformers.ImageSegmentationPipeline",title:"ImageSegmentationPipeline"},{local:"transformers.ObjectDetectionPipeline",title:"ObjectDetectionPipeline"},{local:"transformers.ZeroShotImageClassificationPipeline",title:"ZeroShotImageClassificationPipeline"},{local:"transformers.ZeroShotObjectDetectionPipeline",title:"ZeroShotObjectDetectionPipeline"}],title:"Computer vision"},{local:"natural-language-processing",sections:[{local:"transformers.Conversation",title:"ConversationalPipeline"},{local:"transformers.FillMaskPipeline",title:"FillMaskPipeline"},{local:"transformers.TokenClassificationPipeline",title:"NerPipeline"},{local:"transformers.QuestionAnsweringPipeline",title:"QuestionAnsweringPipeline"},{local:"transformers.SummarizationPipeline",title:"SummarizationPipeline"},{local:"transformers.TableQuestionAnsweringPipeline",title:"TableQuestionAnsweringPipeline"},{local:"transformers.TextClassificationPipeline",title:"TextClassificationPipeline"},{local:"transformers.TextGenerationPipeline",title:"TextGenerationPipeline"},{local:"transformers.Text2TextGenerationPipeline",title:"Text2TextGenerationPipeline"},{local:"transformers.TokenClassificationPipeline",title:"TokenClassificationPipeline"},{local:"transformers.TranslationPipeline",title:"TranslationPipeline"},{local:"transformers.ZeroShotClassificationPipeline",title:"ZeroShotClassificationPipeline"}],title:"Natural Language Processing"},{local:"multimodal",sections:[{local:"transformers.DocumentQuestionAnsweringPipeline",title:"DocumentQuestionAnsweringPipeline"},{local:"transformers.FeatureExtractionPipeline",title:"FeatureExtractionPipeline"},{local:"transformers.ImageToTextPipeline",title:"ImageToTextPipeline"},{local:"transformers.VisualQuestionAnsweringPipeline",title:"VisualQuestionAnsweringPipeline"}],title:"Multimodal"},{local:"transformers.Pipeline",title:"Parent class: `Pipeline`"}],title:"Pipelines"};function sS(j){return xI(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class pS extends _I{constructor(u){super();bI(this,u,sS,eS,vI,{})}}export{pS as default,tS as metadata};
