import{S as ry,i as iy,s as ly,e as r,k as m,w,t as a,M as dy,c as i,d as t,m as u,a as l,x as T,h as n,b as f,G as e,g as b,y as k,q as y,o as $,B as V,v as cy,L}from"../../chunks/vendor-hf-doc-builder.js";import{T as ie}from"../../chunks/Tip-hf-doc-builder.js";import{D as j}from"../../chunks/Docstring-hf-doc-builder.js";import{C as N}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as K}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as I}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function py(x){let d,g,c,h,v;return h=new N({props:{code:`from transformers import Data2VecTextConfig, Data2VecTextModel

# Initializing a Data2VecText facebook/data2vec-text-base style configuration
configuration = Data2VecTextConfig()

# Initializing a model (with random weights) from the facebook/data2vec-text-base style configuration
model = Data2VecTextModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Data2VecTextConfig, Data2VecTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Data2VecText facebook/data2vec-text-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Data2VecTextConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the facebook/data2vec-text-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecTextModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){d=r("p"),g=a("Examples:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Examples:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function hy(x){let d,g,c,h,v;return h=new N({props:{code:`from transformers import Data2VecAudioConfig, Data2VecAudioModel

# Initializing a Data2VecAudio facebook/data2vec-audio-base-960h style configuration
configuration = Data2VecAudioConfig()

# Initializing a model (with random weights) from the facebook/data2vec-audio-base-960h style configuration
model = Data2VecAudioModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Data2VecAudioConfig, Data2VecAudioModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Data2VecAudio facebook/data2vec-audio-base-960h style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Data2VecAudioConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the facebook/data2vec-audio-base-960h style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecAudioModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){d=r("p"),g=a("Example:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Example:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function my(x){let d,g,c,h,v;return h=new N({props:{code:`from transformers import Data2VecVisionConfig, Data2VecVisionModel

# Initializing a Data2VecVision data2vec_vision-base-patch16-224-in22k style configuration
configuration = Data2VecVisionConfig()

# Initializing a model (with random weights) from the data2vec_vision-base-patch16-224-in22k style configuration
model = Data2VecVisionModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Data2VecVisionConfig, Data2VecVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Data2VecVision data2vec_vision-base-patch16-224-in22k style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Data2VecVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the data2vec_vision-base-patch16-224-in22k style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecVisionModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){d=r("p"),g=a("Example:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Example:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function uy(x){let d,g,c,h,v;return{c(){d=r("p"),g=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),h=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(p,"CODE",{});var F=l(c);h=n(F,"Module"),F.forEach(t),v=n(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(s,p){b(s,d,p),e(d,g),e(d,c),e(c,h),e(d,v)},d(s){s&&t(d)}}}function fy(x){let d,g,c,h,v;return h=new N({props:{code:`from transformers import Wav2Vec2Processor, Data2VecAudioModel
import torch
from datasets import load_dataset

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

processor = Wav2Vec2Processor.from_pretrained("facebook/data2vec-audio-base-960h")
model = Data2VecAudioModel.from_pretrained("facebook/data2vec-audio-base-960h")

# audio file is decoded on the fly
inputs = processor(dataset[0]["audio"]["array"], sampling_rate=sampling_rate, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2Processor, Data2VecAudioModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_demo&quot;</span>, <span class="hljs-string">&quot;clean&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.sort(<span class="hljs-string">&quot;id&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>sampling_rate = dataset.features[<span class="hljs-string">&quot;audio&quot;</span>].sampling_rate

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = Wav2Vec2Processor.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-audio-base-960h&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecAudioModel.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-audio-base-960h&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># audio file is decoded on the fly</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>], sampling_rate=sampling_rate, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">292</span>, <span class="hljs-number">768</span>]`}}),{c(){d=r("p"),g=a("Example:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Example:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function gy(x){let d,g,c,h,v;return{c(){d=r("p"),g=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),h=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(p,"CODE",{});var F=l(c);h=n(F,"Module"),F.forEach(t),v=n(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(s,p){b(s,d,p),e(d,g),e(d,c),e(c,h),e(d,v)},d(s){s&&t(d)}}}function _y(x){let d,g,c,h,v;return h=new N({props:{code:`from transformers import Wav2Vec2FeatureExtractor, Data2VecAudioForAudioFrameClassification
from datasets import load_dataset
import torch

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained("hf-internal-testing/tiny-random-data2vec-audio-frame")
model = Data2VecAudioForAudioFrameClassification.from_pretrained("hf-internal-testing/tiny-random-data2vec-audio-frame")

# audio file is decoded on the fly
inputs = feature_extractor(dataset[0]["audio"]["array"], return_tensors="pt", sampling_rate=sampling_rate)
with torch.no_grad():
    logits = model(**inputs).logits

probabilities = torch.sigmoid(logits[0])
# labels is a one-hot array of shape (num_frames, num_speakers)
labels = (probabilities > 0.5).long()
labels[0].tolist()`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2FeatureExtractor, Data2VecAudioForAudioFrameClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_demo&quot;</span>, <span class="hljs-string">&quot;clean&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.sort(<span class="hljs-string">&quot;id&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>sampling_rate = dataset.features[<span class="hljs-string">&quot;audio&quot;</span>].sampling_rate

<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained(<span class="hljs-string">&quot;hf-internal-testing/tiny-random-data2vec-audio-frame&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecAudioForAudioFrameClassification.from_pretrained(<span class="hljs-string">&quot;hf-internal-testing/tiny-random-data2vec-audio-frame&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># audio file is decoded on the fly</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = feature_extractor(dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, sampling_rate=sampling_rate)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>probabilities = torch.sigmoid(logits[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># labels is a one-hot array of shape (num_frames, num_speakers)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = (probabilities &gt; <span class="hljs-number">0.5</span>).long()
<span class="hljs-meta">&gt;&gt;&gt; </span>labels[<span class="hljs-number">0</span>].tolist()
[<span class="hljs-number">1</span>, <span class="hljs-number">1</span>]`}}),{c(){d=r("p"),g=a("Example:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Example:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function vy(x){let d,g,c,h,v;return{c(){d=r("p"),g=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),h=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(p,"CODE",{});var F=l(c);h=n(F,"Module"),F.forEach(t),v=n(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(s,p){b(s,d,p),e(d,g),e(d,c),e(c,h),e(d,v)},d(s){s&&t(d)}}}function by(x){let d,g,c,h,v;return h=new N({props:{code:`from transformers import Wav2Vec2Processor, Data2VecAudioForCTC
from datasets import load_dataset
import torch

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

processor = Wav2Vec2Processor.from_pretrained("facebook/data2vec-audio-base-960h")
model = Data2VecAudioForCTC.from_pretrained("facebook/data2vec-audio-base-960h")

# audio file is decoded on the fly
inputs = processor(dataset[0]["audio"]["array"], sampling_rate=sampling_rate, return_tensors="pt")
with torch.no_grad():
    logits = model(**inputs).logits
predicted_ids = torch.argmax(logits, dim=-1)

# transcribe speech
transcription = processor.batch_decode(predicted_ids)
transcription[0]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2Processor, Data2VecAudioForCTC
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_demo&quot;</span>, <span class="hljs-string">&quot;clean&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.sort(<span class="hljs-string">&quot;id&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>sampling_rate = dataset.features[<span class="hljs-string">&quot;audio&quot;</span>].sampling_rate

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = Wav2Vec2Processor.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-audio-base-960h&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecAudioForCTC.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-audio-base-960h&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># audio file is decoded on the fly</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>], sampling_rate=sampling_rate, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_ids = torch.argmax(logits, dim=-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># transcribe speech</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>transcription = processor.batch_decode(predicted_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>transcription[<span class="hljs-number">0</span>]
<span class="hljs-string">&#x27;MISTER QUILTER IS THE APOSTLE OF THE MIDDLE CLASSES AND WE ARE GLAD TO WELCOME HIS GOSPEL&#x27;</span>`}}),{c(){d=r("p"),g=a("Example:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Example:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function wy(x){let d,g;return d=new N({props:{code:`inputs["labels"] = processor(text=dataset[0]["text"], return_tensors="pt").input_ids

# compute loss
loss = model(**inputs).loss
round(loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>inputs[<span class="hljs-string">&quot;labels&quot;</span>] = processor(text=dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;text&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute loss</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">66.95</span>`}}),{c(){w(d.$$.fragment)},l(c){T(d.$$.fragment,c)},m(c,h){k(d,c,h),g=!0},p:L,i(c){g||(y(d.$$.fragment,c),g=!0)},o(c){$(d.$$.fragment,c),g=!1},d(c){V(d,c)}}}function Ty(x){let d,g,c,h,v;return{c(){d=r("p"),g=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),h=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(p,"CODE",{});var F=l(c);h=n(F,"Module"),F.forEach(t),v=n(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(s,p){b(s,d,p),e(d,g),e(d,c),e(c,h),e(d,v)},d(s){s&&t(d)}}}function ky(x){let d,g,c,h,v;return h=new N({props:{code:`from transformers import Wav2Vec2FeatureExtractor, Data2VecAudioForSequenceClassification
from datasets import load_dataset
import torch

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained("hf-internal-testing/tiny-random-data2vec-seq-class")
model = Data2VecAudioForSequenceClassification.from_pretrained("hf-internal-testing/tiny-random-data2vec-seq-class")

# audio file is decoded on the fly
inputs = feature_extractor(dataset[0]["audio"]["array"], sampling_rate=sampling_rate, return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_ids = torch.argmax(logits, dim=-1).item()
predicted_label = model.config.id2label[predicted_class_ids]
predicted_label`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2FeatureExtractor, Data2VecAudioForSequenceClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_demo&quot;</span>, <span class="hljs-string">&quot;clean&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.sort(<span class="hljs-string">&quot;id&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>sampling_rate = dataset.features[<span class="hljs-string">&quot;audio&quot;</span>].sampling_rate

<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained(<span class="hljs-string">&quot;hf-internal-testing/tiny-random-data2vec-seq-class&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecAudioForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;hf-internal-testing/tiny-random-data2vec-seq-class&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># audio file is decoded on the fly</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = feature_extractor(dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>], sampling_rate=sampling_rate, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_ids = torch.argmax(logits, dim=-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = model.config.id2label[predicted_class_ids]
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label
<span class="hljs-string">&#x27;LABEL_1&#x27;</span>`}}),{c(){d=r("p"),g=a("Example:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Example:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function yy(x){let d,g;return d=new N({props:{code:`# compute loss - target_label is e.g. "down"
target_label = model.config.id2label[0]
inputs["labels"] = torch.tensor([model.config.label2id[target_label]])
loss = model(**inputs).loss
round(loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute loss - target_label is e.g. &quot;down&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_label = model.config.id2label[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs[<span class="hljs-string">&quot;labels&quot;</span>] = torch.tensor([model.config.label2id[target_label]])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">0.69</span>`}}),{c(){w(d.$$.fragment)},l(c){T(d.$$.fragment,c)},m(c,h){k(d,c,h),g=!0},p:L,i(c){g||(y(d.$$.fragment,c),g=!0)},o(c){$(d.$$.fragment,c),g=!1},d(c){V(d,c)}}}function $y(x){let d,g,c,h,v;return{c(){d=r("p"),g=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),h=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(p,"CODE",{});var F=l(c);h=n(F,"Module"),F.forEach(t),v=n(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(s,p){b(s,d,p),e(d,g),e(d,c),e(c,h),e(d,v)},d(s){s&&t(d)}}}function Vy(x){let d,g,c,h,v;return h=new N({props:{code:`from transformers import Wav2Vec2FeatureExtractor, Data2VecAudioForXVector
from datasets import load_dataset
import torch

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained("hf-internal-testing/tiny-random-data2vec-xvector")
model = Data2VecAudioForXVector.from_pretrained("hf-internal-testing/tiny-random-data2vec-xvector")

# audio file is decoded on the fly
inputs = feature_extractor(
    [d["array"] for d in dataset[:2]["audio"]], sampling_rate=sampling_rate, return_tensors="pt", padding=True
)
with torch.no_grad():
    embeddings = model(**inputs).embeddings

embeddings = torch.nn.functional.normalize(embeddings, dim=-1).cpu()

# the resulting embeddings can be used for cosine similarity-based retrieval
cosine_sim = torch.nn.CosineSimilarity(dim=-1)
similarity = cosine_sim(embeddings[0], embeddings[1])
threshold = 0.7  # the optimal threshold is dataset-dependent
if similarity < threshold:
    print("Speakers are not the same!")
round(similarity.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2FeatureExtractor, Data2VecAudioForXVector
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_demo&quot;</span>, <span class="hljs-string">&quot;clean&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.sort(<span class="hljs-string">&quot;id&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>sampling_rate = dataset.features[<span class="hljs-string">&quot;audio&quot;</span>].sampling_rate

<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained(<span class="hljs-string">&quot;hf-internal-testing/tiny-random-data2vec-xvector&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecAudioForXVector.from_pretrained(<span class="hljs-string">&quot;hf-internal-testing/tiny-random-data2vec-xvector&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># audio file is decoded on the fly</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = feature_extractor(
<span class="hljs-meta">... </span>    [d[<span class="hljs-string">&quot;array&quot;</span>] <span class="hljs-keyword">for</span> d <span class="hljs-keyword">in</span> dataset[:<span class="hljs-number">2</span>][<span class="hljs-string">&quot;audio&quot;</span>]], sampling_rate=sampling_rate, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    embeddings = model(**inputs).embeddings

<span class="hljs-meta">&gt;&gt;&gt; </span>embeddings = torch.nn.functional.normalize(embeddings, dim=-<span class="hljs-number">1</span>).cpu()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the resulting embeddings can be used for cosine similarity-based retrieval</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>cosine_sim = torch.nn.CosineSimilarity(dim=-<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>similarity = cosine_sim(embeddings[<span class="hljs-number">0</span>], embeddings[<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>threshold = <span class="hljs-number">0.7</span>  <span class="hljs-comment"># the optimal threshold is dataset-dependent</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">if</span> similarity &lt; threshold:
<span class="hljs-meta">... </span>    <span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Speakers are not the same!&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(similarity.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">1.0</span>`}}),{c(){d=r("p"),g=a("Example:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Example:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function xy(x){let d,g,c,h,v;return{c(){d=r("p"),g=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),h=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(p,"CODE",{});var F=l(c);h=n(F,"Module"),F.forEach(t),v=n(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(s,p){b(s,d,p),e(d,g),e(d,c),e(c,h),e(d,v)},d(s){s&&t(d)}}}function Dy(x){let d,g,c,h,v;return h=new N({props:{code:`from transformers import RobertaTokenizer, Data2VecTextModel
import torch

tokenizer = RobertaTokenizer.from_pretrained("facebook/data2vec-text-base")
model = Data2VecTextModel.from_pretrained("facebook/data2vec-text-base")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> RobertaTokenizer, Data2VecTextModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = RobertaTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecTextModel.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){d=r("p"),g=a("Example:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Example:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function Fy(x){let d,g,c,h,v;return{c(){d=r("p"),g=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),h=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(p,"CODE",{});var F=l(c);h=n(F,"Module"),F.forEach(t),v=n(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(s,p){b(s,d,p),e(d,g),e(d,c),e(c,h),e(d,v)},d(s){s&&t(d)}}}function Cy(x){let d,g,c,h,v;return h=new N({props:{code:`from transformers import AutoTokenizer, Data2VecTextForCausalLM, Data2VecTextConfig
import torch

tokenizer = AutoTokenizer.from_pretrained("facebook/data2vec-text-base")
config = Data2VecTextConfig.from_pretrained("facebook/data2vec-text-base")
config.is_decoder = True
model = Data2VecTextForCausalLM.from_pretrained("facebook/data2vec-text-base", config=config)

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

prediction_logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, Data2VecTextForCausalLM, Data2VecTextConfig
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config = Data2VecTextConfig.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config.is_decoder = <span class="hljs-literal">True</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecTextForCausalLM.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>, config=config)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>prediction_logits = outputs.logits`}}),{c(){d=r("p"),g=a("Example:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Example:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function Ay(x){let d,g,c,h,v;return{c(){d=r("p"),g=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),h=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(p,"CODE",{});var F=l(c);h=n(F,"Module"),F.forEach(t),v=n(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(s,p){b(s,d,p),e(d,g),e(d,c),e(c,h),e(d,v)},d(s){s&&t(d)}}}function My(x){let d,g,c,h,v;return h=new N({props:{code:`from transformers import RobertaTokenizer, Data2VecTextForMaskedLM
import torch

tokenizer = RobertaTokenizer.from_pretrained("facebook/data2vec-text-base")
model = Data2VecTextForMaskedLM.from_pretrained("facebook/data2vec-text-base")

inputs = tokenizer("The capital of France is <mask>.", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

# retrieve index of <mask>
mask_token_index = (inputs.input_ids == tokenizer.mask_token_id)[0].nonzero(as_tuple=True)[0]

predicted_token_id = logits[0, mask_token_index].argmax(axis=-1)
tokenizer.decode(predicted_token_id)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> RobertaTokenizer, Data2VecTextForMaskedLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = RobertaTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecTextForMaskedLM.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is &lt;mask&gt;.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve index of &lt;mask&gt;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_token_index = (inputs.input_ids == tokenizer.mask_token_id)[<span class="hljs-number">0</span>].nonzero(as_tuple=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_id = logits[<span class="hljs-number">0</span>, mask_token_index].argmax(axis=-<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(predicted_token_id)
`}}),{c(){d=r("p"),g=a("Example:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Example:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function jy(x){let d,g;return d=new N({props:{code:`labels = tokenizer("The capital of France is Paris.", return_tensors="pt")["input_ids"]
# mask labels of non-<mask> tokens
labels = torch.where(inputs.input_ids == tokenizer.mask_token_id, labels, -100)

outputs = model(**inputs, labels=labels)
round(outputs.loss.item(), 2)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(<span class="hljs-string">&quot;The capital of France is Paris.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># mask labels of non-&lt;mask&gt; tokens</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.where(inputs.input_ids == tokenizer.mask_token_id, labels, -<span class="hljs-number">100</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(outputs.loss.item(), <span class="hljs-number">2</span>)
`}}),{c(){w(d.$$.fragment)},l(c){T(d.$$.fragment,c)},m(c,h){k(d,c,h),g=!0},p:L,i(c){g||(y(d.$$.fragment,c),g=!0)},o(c){$(d.$$.fragment,c),g=!1},d(c){V(d,c)}}}function Ey(x){let d,g,c,h,v;return{c(){d=r("p"),g=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),h=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(p,"CODE",{});var F=l(c);h=n(F,"Module"),F.forEach(t),v=n(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(s,p){b(s,d,p),e(d,g),e(d,c),e(c,h),e(d,v)},d(s){s&&t(d)}}}function qy(x){let d,g,c,h,v;return h=new N({props:{code:`import torch
from transformers import RobertaTokenizer, Data2VecTextForSequenceClassification

tokenizer = RobertaTokenizer.from_pretrained("facebook/data2vec-text-base")
model = Data2VecTextForSequenceClassification.from_pretrained("facebook/data2vec-text-base")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_id = logits.argmax().item()
model.config.id2label[predicted_class_id]
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> RobertaTokenizer, Data2VecTextForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = RobertaTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecTextForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.id2label[predicted_class_id]
`}}),{c(){d=r("p"),g=a("Example of single-label classification:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Example of single-label classification:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function Py(x){let d,g;return d=new N({props:{code:`# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = Data2VecTextForSequenceClassification.from_pretrained("facebook/data2vec-text-base", num_labels=num_labels)

labels = torch.tensor([1])
loss = model(**inputs, labels=labels).loss
round(loss.item(), 2)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecTextForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
`}}),{c(){w(d.$$.fragment)},l(c){T(d.$$.fragment,c)},m(c,h){k(d,c,h),g=!0},p:L,i(c){g||(y(d.$$.fragment,c),g=!0)},o(c){$(d.$$.fragment,c),g=!1},d(c){V(d,c)}}}function zy(x){let d,g,c,h,v;return h=new N({props:{code:`import torch
from transformers import RobertaTokenizer, Data2VecTextForSequenceClassification

tokenizer = RobertaTokenizer.from_pretrained("facebook/data2vec-text-base")
model = Data2VecTextForSequenceClassification.from_pretrained("facebook/data2vec-text-base", problem_type="multi_label_classification")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_id = logits.argmax().item()
model.config.id2label[predicted_class_id]
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> RobertaTokenizer, Data2VecTextForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = RobertaTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecTextForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.id2label[predicted_class_id]
`}}),{c(){d=r("p"),g=a("Example of multi-label classification:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Example of multi-label classification:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function Sy(x){let d,g;return d=new N({props:{code:`# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = Data2VecTextForSequenceClassification.from_pretrained(
    "facebook/data2vec-text-base", num_labels=num_labels, problem_type="multi_label_classification"
)

labels = torch.nn.functional.one_hot(torch.tensor([predicted_class_id]), num_classes=num_labels).to(
    torch.float
)
loss = model(**inputs, labels=labels).loss
loss.backward()`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecTextForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>, num_labels=num_labels, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.nn.functional.one_hot(torch.tensor([predicted_class_id]), num_classes=num_labels).to(
<span class="hljs-meta">... </span>    torch.<span class="hljs-built_in">float</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span>loss.backward()`}}),{c(){w(d.$$.fragment)},l(c){T(d.$$.fragment,c)},m(c,h){k(d,c,h),g=!0},p:L,i(c){g||(y(d.$$.fragment,c),g=!0)},o(c){$(d.$$.fragment,c),g=!1},d(c){V(d,c)}}}function Oy(x){let d,g,c,h,v;return{c(){d=r("p"),g=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),h=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(p,"CODE",{});var F=l(c);h=n(F,"Module"),F.forEach(t),v=n(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(s,p){b(s,d,p),e(d,g),e(d,c),e(c,h),e(d,v)},d(s){s&&t(d)}}}function Iy(x){let d,g,c,h,v;return h=new N({props:{code:`from transformers import RobertaTokenizer, Data2VecTextForMultipleChoice
import torch

tokenizer = RobertaTokenizer.from_pretrained("facebook/data2vec-text-base")
model = Data2VecTextForMultipleChoice.from_pretrained("facebook/data2vec-text-base")

prompt = "In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced."
choice0 = "It is eaten with a fork and a knife."
choice1 = "It is eaten while held in the hand."
labels = torch.tensor(0).unsqueeze(0)  # choice0 is correct (according to Wikipedia ;)), batch size 1

encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors="pt", padding=True)
outputs = model(**{k: v.unsqueeze(0) for k, v in encoding.items()}, labels=labels)  # batch size is 1

# the linear classifier still needs to be trained
loss = outputs.loss
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> RobertaTokenizer, Data2VecTextForMultipleChoice
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = RobertaTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecTextForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice0 = <span class="hljs-string">&quot;It is eaten with a fork and a knife.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice1 = <span class="hljs-string">&quot;It is eaten while held in the hand.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor(<span class="hljs-number">0</span>).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># choice0 is correct (according to Wikipedia ;)), batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**{k: v.unsqueeze(<span class="hljs-number">0</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> encoding.items()}, labels=labels)  <span class="hljs-comment"># batch size is 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the linear classifier still needs to be trained</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=r("p"),g=a("Example:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Example:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function Ly(x){let d,g,c,h,v;return{c(){d=r("p"),g=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),h=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(p,"CODE",{});var F=l(c);h=n(F,"Module"),F.forEach(t),v=n(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(s,p){b(s,d,p),e(d,g),e(d,c),e(c,h),e(d,v)},d(s){s&&t(d)}}}function Ny(x){let d,g,c,h,v;return h=new N({props:{code:`from transformers import RobertaTokenizer, Data2VecTextForTokenClassification
import torch

tokenizer = RobertaTokenizer.from_pretrained("facebook/data2vec-text-base")
model = Data2VecTextForTokenClassification.from_pretrained("facebook/data2vec-text-base")

inputs = tokenizer(
    "HuggingFace is a company based in Paris and New York", add_special_tokens=False, return_tensors="pt"
)

with torch.no_grad():
    logits = model(**inputs).logits

predicted_token_class_ids = logits.argmax(-1)

# Note that tokens are classified rather then input words which means that
# there might be more predicted token classes than words.
# Multiple token classes might account for the same word
predicted_tokens_classes = [model.config.id2label[t.item()] for t in predicted_token_class_ids[0]]
predicted_tokens_classes
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> RobertaTokenizer, Data2VecTextForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = RobertaTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecTextForTokenClassification.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;HuggingFace is a company based in Paris and New York&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_class_ids = logits.argmax(-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Note that tokens are classified rather then input words which means that</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># there might be more predicted token classes than words.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Multiple token classes might account for the same word</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes = [model.config.id2label[t.item()] <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> predicted_token_class_ids[<span class="hljs-number">0</span>]]
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes
`}}),{c(){d=r("p"),g=a("Example:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Example:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function Wy(x){let d,g;return d=new N({props:{code:`labels = predicted_token_class_ids
loss = model(**inputs, labels=labels).loss
round(loss.item(), 2)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
`}}),{c(){w(d.$$.fragment)},l(c){T(d.$$.fragment,c)},m(c,h){k(d,c,h),g=!0},p:L,i(c){g||(y(d.$$.fragment,c),g=!0)},o(c){$(d.$$.fragment,c),g=!1},d(c){V(d,c)}}}function By(x){let d,g,c,h,v;return{c(){d=r("p"),g=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),h=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(p,"CODE",{});var F=l(c);h=n(F,"Module"),F.forEach(t),v=n(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(s,p){b(s,d,p),e(d,g),e(d,c),e(c,h),e(d,v)},d(s){s&&t(d)}}}function Hy(x){let d,g,c,h,v;return h=new N({props:{code:`from transformers import RobertaTokenizer, Data2VecTextForQuestionAnswering
import torch

tokenizer = RobertaTokenizer.from_pretrained("facebook/data2vec-text-base")
model = Data2VecTextForQuestionAnswering.from_pretrained("facebook/data2vec-text-base")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"

inputs = tokenizer(question, text, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)

answer_start_index = outputs.start_logits.argmax()
answer_end_index = outputs.end_logits.argmax()

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]
tokenizer.decode(predict_answer_tokens, skip_special_tokens=True)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> RobertaTokenizer, Data2VecTextForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = RobertaTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecTextForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-text-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>answer_start_index = outputs.start_logits.argmax()
<span class="hljs-meta">&gt;&gt;&gt; </span>answer_end_index = outputs.end_logits.argmax()

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(predict_answer_tokens, skip_special_tokens=<span class="hljs-literal">True</span>)
`}}),{c(){d=r("p"),g=a("Example:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Example:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function Ry(x){let d,g;return d=new N({props:{code:`# target is "nice puppet"
target_start_index = torch.tensor([14])
target_end_index = torch.tensor([15])

outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
loss = outputs.loss
round(loss.item(), 2)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># target is &quot;nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_start_index = torch.tensor([<span class="hljs-number">14</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = torch.tensor([<span class="hljs-number">15</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
`}}),{c(){w(d.$$.fragment)},l(c){T(d.$$.fragment,c)},m(c,h){k(d,c,h),g=!0},p:L,i(c){g||(y(d.$$.fragment,c),g=!0)},o(c){$(d.$$.fragment,c),g=!1},d(c){V(d,c)}}}function Gy(x){let d,g,c,h,v;return{c(){d=r("p"),g=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),h=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(p,"CODE",{});var F=l(c);h=n(F,"Module"),F.forEach(t),v=n(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(s,p){b(s,d,p),e(d,g),e(d,c),e(c,h),e(d,v)},d(s){s&&t(d)}}}function Qy(x){let d,g,c,h,v;return h=new N({props:{code:`from transformers import BeitImageProcessor, Data2VecVisionModel
import torch
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

feature_extractor = BeitImageProcessor.from_pretrained("facebook/data2vec-vision-base")
model = Data2VecVisionModel.from_pretrained("facebook/data2vec-vision-base")

inputs = feature_extractor(image, return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BeitImageProcessor, Data2VecVisionModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = BeitImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-vision-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecVisionModel.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-vision-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = feature_extractor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">197</span>, <span class="hljs-number">768</span>]`}}),{c(){d=r("p"),g=a("Example:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Example:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function Uy(x){let d,g,c,h,v;return{c(){d=r("p"),g=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),h=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(p,"CODE",{});var F=l(c);h=n(F,"Module"),F.forEach(t),v=n(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(s,p){b(s,d,p),e(d,g),e(d,c),e(c,h),e(d,v)},d(s){s&&t(d)}}}function Xy(x){let d,g,c,h,v;return h=new N({props:{code:`from transformers import BeitImageProcessor, Data2VecVisionForImageClassification
import torch
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

feature_extractor = BeitImageProcessor.from_pretrained("facebook/data2vec-vision-base-ft1k")
model = Data2VecVisionForImageClassification.from_pretrained("facebook/data2vec-vision-base-ft1k")

inputs = feature_extractor(image, return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

# model predicts one of the 1000 ImageNet classes
predicted_label = logits.argmax(-1).item()
print(model.config.id2label[predicted_label])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BeitImageProcessor, Data2VecVisionForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = BeitImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-vision-base-ft1k&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecVisionForImageClassification.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-vision-base-ft1k&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = feature_extractor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
remote control, remote`}}),{c(){d=r("p"),g=a("Example:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Example:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function Jy(x){let d,g,c,h,v;return{c(){d=r("p"),g=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),h=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(p,"CODE",{});var F=l(c);h=n(F,"Module"),F.forEach(t),v=n(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(s,p){b(s,d,p),e(d,g),e(d,c),e(c,h),e(d,v)},d(s){s&&t(d)}}}function Ky(x){let d,g,c,h,v;return h=new N({props:{code:`from transformers import AutoImageProcessor, Data2VecVisionForSemanticSegmentation
from PIL import Image
import requests

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

image_processor = AutoImageProcessor.from_pretrained("facebook/data2vec-vision-base")
model = Data2VecVisionForSemanticSegmentation.from_pretrained("facebook/data2vec-vision-base")

inputs = image_processor(images=image, return_tensors="pt")
outputs = model(**inputs)
# logits are of shape (batch_size, num_labels, height, width)
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, Data2VecVisionForSemanticSegmentation
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-vision-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Data2VecVisionForSemanticSegmentation.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-vision-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># logits are of shape (batch_size, num_labels, height, width)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=r("p"),g=a("Examples:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Examples:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function Yy(x){let d,g,c,h,v,s,p,F,Ne,Me,B,le,de,C,We,X,Be,je,H,He,ce,ee,Re,Ee,R,Ge,qe,G,pe,Qe,Y,E,z,Pe,Q,Ue,ze,P,we,Xe,S,he,te,ge,Je,oe,Ke,me,U,_e,ae,Ye,ve,q,Ze,O,et,tt;return{c(){d=r("p"),g=a("TensorFlow models and layers in "),c=r("code"),h=a("transformers"),v=a(" accept two formats as input:"),s=m(),p=r("ul"),F=r("li"),Ne=a("having all inputs as keyword arguments (like PyTorch models), or"),Me=m(),B=r("li"),le=a("having all inputs as a list, tuple or dict in the first positional argument."),de=m(),C=r("p"),We=a(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),X=r("code"),Be=a("model.fit()"),je=a(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),H=r("code"),He=a("model.fit()"),ce=a(` supports! If, however, you want to use the second
format outside of Keras methods like `),ee=r("code"),Re=a("fit()"),Ee=a(" and "),R=r("code"),Ge=a("predict()"),qe=a(`, such as when creating your own layers or models with
the Keras `),G=r("code"),pe=a("Functional"),Qe=a(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),Y=m(),E=r("ul"),z=r("li"),Pe=a("a single Tensor with "),Q=r("code"),Ue=a("pixel_values"),ze=a(" only and nothing else: "),P=r("code"),we=a("model(pixel_values)"),Xe=m(),S=r("li"),he=a(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),te=r("code"),ge=a("model([pixel_values, attention_mask])"),Je=a(" or "),oe=r("code"),Ke=a("model([pixel_values, attention_mask, token_type_ids])"),me=m(),U=r("li"),_e=a(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ae=r("code"),Ye=a('model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),ve=m(),q=r("p"),Ze=a(`Note that when creating models and layers with
`),O=r("a"),et=a("subclassing"),tt=a(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(D){d=i(D,"P",{});var A=l(d);g=n(A,"TensorFlow models and layers in "),c=i(A,"CODE",{});var Tt=l(c);h=n(Tt,"transformers"),Tt.forEach(t),v=n(A," accept two formats as input:"),A.forEach(t),s=u(D),p=i(D,"UL",{});var Z=l(p);F=i(Z,"LI",{});var kt=l(F);Ne=n(kt,"having all inputs as keyword arguments (like PyTorch models), or"),kt.forEach(t),Me=u(Z),B=i(Z,"LI",{});var yt=l(B);le=n(yt,"having all inputs as a list, tuple or dict in the first positional argument."),yt.forEach(t),Z.forEach(t),de=u(D),C=i(D,"P",{});var M=l(C);We=n(M,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),X=i(M,"CODE",{});var J=l(X);Be=n(J,"model.fit()"),J.forEach(t),je=n(M,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),H=i(M,"CODE",{});var $t=l(H);He=n($t,"model.fit()"),$t.forEach(t),ce=n(M,` supports! If, however, you want to use the second
format outside of Keras methods like `),ee=i(M,"CODE",{});var Se=l(ee);Re=n(Se,"fit()"),Se.forEach(t),Ee=n(M," and "),R=i(M,"CODE",{});var Vt=l(R);Ge=n(Vt,"predict()"),Vt.forEach(t),qe=n(M,`, such as when creating your own layers or models with
the Keras `),G=i(M,"CODE",{});var xt=l(G);pe=n(xt,"Functional"),xt.forEach(t),Qe=n(M,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),M.forEach(t),Y=u(D),E=i(D,"UL",{});var W=l(E);z=i(W,"LI",{});var ne=l(z);Pe=n(ne,"a single Tensor with "),Q=i(ne,"CODE",{});var Dt=l(Q);Ue=n(Dt,"pixel_values"),Dt.forEach(t),ze=n(ne," only and nothing else: "),P=i(ne,"CODE",{});var Oe=l(P);we=n(Oe,"model(pixel_values)"),Oe.forEach(t),ne.forEach(t),Xe=u(W),S=i(W,"LI",{});var se=l(S);he=n(se,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),te=i(se,"CODE",{});var Ft=l(te);ge=n(Ft,"model([pixel_values, attention_mask])"),Ft.forEach(t),Je=n(se," or "),oe=i(se,"CODE",{});var Ie=l(oe);Ke=n(Ie,"model([pixel_values, attention_mask, token_type_ids])"),Ie.forEach(t),se.forEach(t),me=u(W),U=i(W,"LI",{});var ot=l(U);_e=n(ot,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ae=i(ot,"CODE",{});var Ct=l(ae);Ye=n(Ct,'model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),Ct.forEach(t),ot.forEach(t),W.forEach(t),ve=u(D),q=i(D,"P",{});var ue=l(q);Ze=n(ue,`Note that when creating models and layers with
`),O=i(ue,"A",{href:!0,rel:!0});var fe=l(O);et=n(fe,"subclassing"),fe.forEach(t),tt=n(ue,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),ue.forEach(t),this.h()},h(){f(O,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),f(O,"rel","nofollow")},m(D,A){b(D,d,A),e(d,g),e(d,c),e(c,h),e(d,v),b(D,s,A),b(D,p,A),e(p,F),e(F,Ne),e(p,Me),e(p,B),e(B,le),b(D,de,A),b(D,C,A),e(C,We),e(C,X),e(X,Be),e(C,je),e(C,H),e(H,He),e(C,ce),e(C,ee),e(ee,Re),e(C,Ee),e(C,R),e(R,Ge),e(C,qe),e(C,G),e(G,pe),e(C,Qe),b(D,Y,A),b(D,E,A),e(E,z),e(z,Pe),e(z,Q),e(Q,Ue),e(z,ze),e(z,P),e(P,we),e(E,Xe),e(E,S),e(S,he),e(S,te),e(te,ge),e(S,Je),e(S,oe),e(oe,Ke),e(E,me),e(E,U),e(U,_e),e(U,ae),e(ae,Ye),b(D,ve,A),b(D,q,A),e(q,Ze),e(q,O),e(O,et),e(q,tt)},d(D){D&&t(d),D&&t(s),D&&t(p),D&&t(de),D&&t(C),D&&t(Y),D&&t(E),D&&t(ve),D&&t(q)}}}function Zy(x){let d,g,c,h,v;return{c(){d=r("p"),g=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),h=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(p,"CODE",{});var F=l(c);h=n(F,"Module"),F.forEach(t),v=n(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(s,p){b(s,d,p),e(d,g),e(d,c),e(c,h),e(d,v)},d(s){s&&t(d)}}}function e$(x){let d,g,c,h,v;return h=new N({props:{code:`from transformers import BeitImageProcessor, TFData2VecVisionModel
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

feature_extractor = BeitImageProcessor.from_pretrained("facebook/data2vec-vision-base")
model = TFData2VecVisionModel.from_pretrained("facebook/data2vec-vision-base")

inputs = feature_extractor(image, return_tensors="tf")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BeitImageProcessor, TFData2VecVisionModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = BeitImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-vision-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFData2VecVisionModel.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-vision-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = feature_extractor(image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">197</span>, <span class="hljs-number">768</span>]`}}),{c(){d=r("p"),g=a("Example:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Example:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function t$(x){let d,g,c,h,v,s,p,F,Ne,Me,B,le,de,C,We,X,Be,je,H,He,ce,ee,Re,Ee,R,Ge,qe,G,pe,Qe,Y,E,z,Pe,Q,Ue,ze,P,we,Xe,S,he,te,ge,Je,oe,Ke,me,U,_e,ae,Ye,ve,q,Ze,O,et,tt;return{c(){d=r("p"),g=a("TensorFlow models and layers in "),c=r("code"),h=a("transformers"),v=a(" accept two formats as input:"),s=m(),p=r("ul"),F=r("li"),Ne=a("having all inputs as keyword arguments (like PyTorch models), or"),Me=m(),B=r("li"),le=a("having all inputs as a list, tuple or dict in the first positional argument."),de=m(),C=r("p"),We=a(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),X=r("code"),Be=a("model.fit()"),je=a(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),H=r("code"),He=a("model.fit()"),ce=a(` supports! If, however, you want to use the second
format outside of Keras methods like `),ee=r("code"),Re=a("fit()"),Ee=a(" and "),R=r("code"),Ge=a("predict()"),qe=a(`, such as when creating your own layers or models with
the Keras `),G=r("code"),pe=a("Functional"),Qe=a(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),Y=m(),E=r("ul"),z=r("li"),Pe=a("a single Tensor with "),Q=r("code"),Ue=a("pixel_values"),ze=a(" only and nothing else: "),P=r("code"),we=a("model(pixel_values)"),Xe=m(),S=r("li"),he=a(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),te=r("code"),ge=a("model([pixel_values, attention_mask])"),Je=a(" or "),oe=r("code"),Ke=a("model([pixel_values, attention_mask, token_type_ids])"),me=m(),U=r("li"),_e=a(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ae=r("code"),Ye=a('model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),ve=m(),q=r("p"),Ze=a(`Note that when creating models and layers with
`),O=r("a"),et=a("subclassing"),tt=a(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(D){d=i(D,"P",{});var A=l(d);g=n(A,"TensorFlow models and layers in "),c=i(A,"CODE",{});var Tt=l(c);h=n(Tt,"transformers"),Tt.forEach(t),v=n(A," accept two formats as input:"),A.forEach(t),s=u(D),p=i(D,"UL",{});var Z=l(p);F=i(Z,"LI",{});var kt=l(F);Ne=n(kt,"having all inputs as keyword arguments (like PyTorch models), or"),kt.forEach(t),Me=u(Z),B=i(Z,"LI",{});var yt=l(B);le=n(yt,"having all inputs as a list, tuple or dict in the first positional argument."),yt.forEach(t),Z.forEach(t),de=u(D),C=i(D,"P",{});var M=l(C);We=n(M,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),X=i(M,"CODE",{});var J=l(X);Be=n(J,"model.fit()"),J.forEach(t),je=n(M,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),H=i(M,"CODE",{});var $t=l(H);He=n($t,"model.fit()"),$t.forEach(t),ce=n(M,` supports! If, however, you want to use the second
format outside of Keras methods like `),ee=i(M,"CODE",{});var Se=l(ee);Re=n(Se,"fit()"),Se.forEach(t),Ee=n(M," and "),R=i(M,"CODE",{});var Vt=l(R);Ge=n(Vt,"predict()"),Vt.forEach(t),qe=n(M,`, such as when creating your own layers or models with
the Keras `),G=i(M,"CODE",{});var xt=l(G);pe=n(xt,"Functional"),xt.forEach(t),Qe=n(M,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),M.forEach(t),Y=u(D),E=i(D,"UL",{});var W=l(E);z=i(W,"LI",{});var ne=l(z);Pe=n(ne,"a single Tensor with "),Q=i(ne,"CODE",{});var Dt=l(Q);Ue=n(Dt,"pixel_values"),Dt.forEach(t),ze=n(ne," only and nothing else: "),P=i(ne,"CODE",{});var Oe=l(P);we=n(Oe,"model(pixel_values)"),Oe.forEach(t),ne.forEach(t),Xe=u(W),S=i(W,"LI",{});var se=l(S);he=n(se,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),te=i(se,"CODE",{});var Ft=l(te);ge=n(Ft,"model([pixel_values, attention_mask])"),Ft.forEach(t),Je=n(se," or "),oe=i(se,"CODE",{});var Ie=l(oe);Ke=n(Ie,"model([pixel_values, attention_mask, token_type_ids])"),Ie.forEach(t),se.forEach(t),me=u(W),U=i(W,"LI",{});var ot=l(U);_e=n(ot,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ae=i(ot,"CODE",{});var Ct=l(ae);Ye=n(Ct,'model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),Ct.forEach(t),ot.forEach(t),W.forEach(t),ve=u(D),q=i(D,"P",{});var ue=l(q);Ze=n(ue,`Note that when creating models and layers with
`),O=i(ue,"A",{href:!0,rel:!0});var fe=l(O);et=n(fe,"subclassing"),fe.forEach(t),tt=n(ue,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),ue.forEach(t),this.h()},h(){f(O,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),f(O,"rel","nofollow")},m(D,A){b(D,d,A),e(d,g),e(d,c),e(c,h),e(d,v),b(D,s,A),b(D,p,A),e(p,F),e(F,Ne),e(p,Me),e(p,B),e(B,le),b(D,de,A),b(D,C,A),e(C,We),e(C,X),e(X,Be),e(C,je),e(C,H),e(H,He),e(C,ce),e(C,ee),e(ee,Re),e(C,Ee),e(C,R),e(R,Ge),e(C,qe),e(C,G),e(G,pe),e(C,Qe),b(D,Y,A),b(D,E,A),e(E,z),e(z,Pe),e(z,Q),e(Q,Ue),e(z,ze),e(z,P),e(P,we),e(E,Xe),e(E,S),e(S,he),e(S,te),e(te,ge),e(S,Je),e(S,oe),e(oe,Ke),e(E,me),e(E,U),e(U,_e),e(U,ae),e(ae,Ye),b(D,ve,A),b(D,q,A),e(q,Ze),e(q,O),e(O,et),e(q,tt)},d(D){D&&t(d),D&&t(s),D&&t(p),D&&t(de),D&&t(C),D&&t(Y),D&&t(E),D&&t(ve),D&&t(q)}}}function o$(x){let d,g,c,h,v;return{c(){d=r("p"),g=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),h=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(p,"CODE",{});var F=l(c);h=n(F,"Module"),F.forEach(t),v=n(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(s,p){b(s,d,p),e(d,g),e(d,c),e(c,h),e(d,v)},d(s){s&&t(d)}}}function a$(x){let d,g,c,h,v;return h=new N({props:{code:`from transformers import BeitImageProcessor, TFData2VecVisionForImageClassification
import tensorflow as tf
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

feature_extractor = BeitImageProcessor.from_pretrained("facebook/data2vec-vision-base-ft1k")
model = TFData2VecVisionForImageClassification.from_pretrained("facebook/data2vec-vision-base-ft1k")

inputs = feature_extractor(image, return_tensors="tf")
logits = model(**inputs).logits

# model predicts one of the 1000 ImageNet classes
predicted_label = int(tf.math.argmax(logits, axis=-1))
print(model.config.id2label[predicted_label])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BeitImageProcessor, TFData2VecVisionForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = BeitImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-vision-base-ft1k&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFData2VecVisionForImageClassification.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-vision-base-ft1k&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = feature_extractor(image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
remote control, remote`}}),{c(){d=r("p"),g=a("Example:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Example:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function n$(x){let d,g,c,h,v,s,p,F,Ne,Me,B,le,de,C,We,X,Be,je,H,He,ce,ee,Re,Ee,R,Ge,qe,G,pe,Qe,Y,E,z,Pe,Q,Ue,ze,P,we,Xe,S,he,te,ge,Je,oe,Ke,me,U,_e,ae,Ye,ve,q,Ze,O,et,tt;return{c(){d=r("p"),g=a("TensorFlow models and layers in "),c=r("code"),h=a("transformers"),v=a(" accept two formats as input:"),s=m(),p=r("ul"),F=r("li"),Ne=a("having all inputs as keyword arguments (like PyTorch models), or"),Me=m(),B=r("li"),le=a("having all inputs as a list, tuple or dict in the first positional argument."),de=m(),C=r("p"),We=a(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),X=r("code"),Be=a("model.fit()"),je=a(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),H=r("code"),He=a("model.fit()"),ce=a(` supports! If, however, you want to use the second
format outside of Keras methods like `),ee=r("code"),Re=a("fit()"),Ee=a(" and "),R=r("code"),Ge=a("predict()"),qe=a(`, such as when creating your own layers or models with
the Keras `),G=r("code"),pe=a("Functional"),Qe=a(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),Y=m(),E=r("ul"),z=r("li"),Pe=a("a single Tensor with "),Q=r("code"),Ue=a("pixel_values"),ze=a(" only and nothing else: "),P=r("code"),we=a("model(pixel_values)"),Xe=m(),S=r("li"),he=a(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),te=r("code"),ge=a("model([pixel_values, attention_mask])"),Je=a(" or "),oe=r("code"),Ke=a("model([pixel_values, attention_mask, token_type_ids])"),me=m(),U=r("li"),_e=a(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ae=r("code"),Ye=a('model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),ve=m(),q=r("p"),Ze=a(`Note that when creating models and layers with
`),O=r("a"),et=a("subclassing"),tt=a(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(D){d=i(D,"P",{});var A=l(d);g=n(A,"TensorFlow models and layers in "),c=i(A,"CODE",{});var Tt=l(c);h=n(Tt,"transformers"),Tt.forEach(t),v=n(A," accept two formats as input:"),A.forEach(t),s=u(D),p=i(D,"UL",{});var Z=l(p);F=i(Z,"LI",{});var kt=l(F);Ne=n(kt,"having all inputs as keyword arguments (like PyTorch models), or"),kt.forEach(t),Me=u(Z),B=i(Z,"LI",{});var yt=l(B);le=n(yt,"having all inputs as a list, tuple or dict in the first positional argument."),yt.forEach(t),Z.forEach(t),de=u(D),C=i(D,"P",{});var M=l(C);We=n(M,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),X=i(M,"CODE",{});var J=l(X);Be=n(J,"model.fit()"),J.forEach(t),je=n(M,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),H=i(M,"CODE",{});var $t=l(H);He=n($t,"model.fit()"),$t.forEach(t),ce=n(M,` supports! If, however, you want to use the second
format outside of Keras methods like `),ee=i(M,"CODE",{});var Se=l(ee);Re=n(Se,"fit()"),Se.forEach(t),Ee=n(M," and "),R=i(M,"CODE",{});var Vt=l(R);Ge=n(Vt,"predict()"),Vt.forEach(t),qe=n(M,`, such as when creating your own layers or models with
the Keras `),G=i(M,"CODE",{});var xt=l(G);pe=n(xt,"Functional"),xt.forEach(t),Qe=n(M,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),M.forEach(t),Y=u(D),E=i(D,"UL",{});var W=l(E);z=i(W,"LI",{});var ne=l(z);Pe=n(ne,"a single Tensor with "),Q=i(ne,"CODE",{});var Dt=l(Q);Ue=n(Dt,"pixel_values"),Dt.forEach(t),ze=n(ne," only and nothing else: "),P=i(ne,"CODE",{});var Oe=l(P);we=n(Oe,"model(pixel_values)"),Oe.forEach(t),ne.forEach(t),Xe=u(W),S=i(W,"LI",{});var se=l(S);he=n(se,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),te=i(se,"CODE",{});var Ft=l(te);ge=n(Ft,"model([pixel_values, attention_mask])"),Ft.forEach(t),Je=n(se," or "),oe=i(se,"CODE",{});var Ie=l(oe);Ke=n(Ie,"model([pixel_values, attention_mask, token_type_ids])"),Ie.forEach(t),se.forEach(t),me=u(W),U=i(W,"LI",{});var ot=l(U);_e=n(ot,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ae=i(ot,"CODE",{});var Ct=l(ae);Ye=n(Ct,'model({"pixel_values": pixel_values, "token_type_ids": token_type_ids})'),Ct.forEach(t),ot.forEach(t),W.forEach(t),ve=u(D),q=i(D,"P",{});var ue=l(q);Ze=n(ue,`Note that when creating models and layers with
`),O=i(ue,"A",{href:!0,rel:!0});var fe=l(O);et=n(fe,"subclassing"),fe.forEach(t),tt=n(ue,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),ue.forEach(t),this.h()},h(){f(O,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),f(O,"rel","nofollow")},m(D,A){b(D,d,A),e(d,g),e(d,c),e(c,h),e(d,v),b(D,s,A),b(D,p,A),e(p,F),e(F,Ne),e(p,Me),e(p,B),e(B,le),b(D,de,A),b(D,C,A),e(C,We),e(C,X),e(X,Be),e(C,je),e(C,H),e(H,He),e(C,ce),e(C,ee),e(ee,Re),e(C,Ee),e(C,R),e(R,Ge),e(C,qe),e(C,G),e(G,pe),e(C,Qe),b(D,Y,A),b(D,E,A),e(E,z),e(z,Pe),e(z,Q),e(Q,Ue),e(z,ze),e(z,P),e(P,we),e(E,Xe),e(E,S),e(S,he),e(S,te),e(te,ge),e(S,Je),e(S,oe),e(oe,Ke),e(E,me),e(E,U),e(U,_e),e(U,ae),e(ae,Ye),b(D,ve,A),b(D,q,A),e(q,Ze),e(q,O),e(O,et),e(q,tt)},d(D){D&&t(d),D&&t(s),D&&t(p),D&&t(de),D&&t(C),D&&t(Y),D&&t(E),D&&t(ve),D&&t(q)}}}function s$(x){let d,g,c,h,v;return{c(){d=r("p"),g=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),h=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(p,"CODE",{});var F=l(c);h=n(F,"Module"),F.forEach(t),v=n(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(s,p){b(s,d,p),e(d,g),e(d,c),e(c,h),e(d,v)},d(s){s&&t(d)}}}function r$(x){let d,g,c,h,v;return h=new N({props:{code:`from transformers import AutoImageProcessor, TFData2VecVisionForSemanticSegmentation
from PIL import Image
import requests

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

image_processor = AutoImageProcessor.from_pretrained("facebook/data2vec-vision-base")
model = TFData2VecVisionForSemanticSegmentation.from_pretrained("facebook/data2vec-vision-base")

inputs = image_processor(images=image, return_tensors="pt")
outputs = model(**inputs)
# logits are of shape (batch_size, num_labels, height, width)
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFData2VecVisionForSemanticSegmentation
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-vision-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFData2VecVisionForSemanticSegmentation.from_pretrained(<span class="hljs-string">&quot;facebook/data2vec-vision-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># logits are of shape (batch_size, num_labels, height, width)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=r("p"),g=a("Examples:"),c=m(),w(h.$$.fragment)},l(s){d=i(s,"P",{});var p=l(d);g=n(p,"Examples:"),p.forEach(t),c=u(s),T(h.$$.fragment,s)},m(s,p){b(s,d,p),e(d,g),b(s,c,p),k(h,s,p),v=!0},p:L,i(s){v||(y(h.$$.fragment,s),v=!0)},o(s){$(h.$$.fragment,s),v=!1},d(s){s&&t(d),s&&t(c),V(h,s)}}}function i$(x){let d,g,c,h,v,s,p,F,Ne,Me,B,le,de,C,We,X,Be,je,H,He,ce,ee,Re,Ee,R,Ge,qe,G,pe,Qe,Y,E,z,Pe,Q,Ue,ze,P,we,Xe,S,he,te,ge,Je,oe,Ke,me,U,_e,ae,Ye,ve,q,Ze,O,et,tt,D,A,Tt,Z,kt,yt,M,J,$t,Se,Vt,xt,W,ne,Dt,Oe,se,Ft,Ie,ot,Ct,ue,fe,Xh,Wn,Jh,Kh,Bn,Yh,Zh,Yc,uo,da,Bl,Hn,em,Hl,tm,Zc,ft,Rn,om,Kt,am,Ci,nm,sm,Ai,rm,im,Gn,lm,dm,cm,fo,pm,Mi,hm,mm,ji,um,fm,gm,ca,ep,go,pa,Rl,Qn,_m,Gl,vm,tp,gt,Un,bm,_o,wm,Ei,Tm,km,Xn,ym,$m,Vm,vo,xm,qi,Dm,Fm,Pi,Cm,Am,Mm,ha,op,bo,ma,Ql,Jn,jm,Ul,Em,ap,Yt,Kn,qm,wo,Pm,zi,zm,Sm,Yn,Om,Im,Lm,ua,np,To,fa,Xl,Zn,Nm,Jl,Wm,sp,at,es,Bm,ts,Hm,os,Rm,Gm,Qm,as,Um,Si,Xm,Jm,Km,ns,Ym,ss,Zm,eu,tu,At,rs,ou,ko,au,Oi,nu,su,Kl,ru,iu,lu,ga,du,_a,rp,yo,va,Yl,is,cu,Zl,pu,ip,Te,ls,hu,ed,mu,uu,ds,fu,cs,gu,_u,vu,ps,bu,Ii,wu,Tu,ku,hs,yu,ms,$u,Vu,xu,Mt,us,Du,$o,Fu,Li,Cu,Au,td,Mu,ju,Eu,ba,qu,wa,lp,Vo,Ta,od,fs,Pu,ad,zu,dp,nt,gs,Su,xo,Ou,nd,Iu,Lu,_s,Nu,Wu,Bu,vs,Hu,Ni,Ru,Gu,Qu,bs,Uu,ws,Xu,Ju,Ku,lt,Ts,Yu,Do,Zu,Wi,ef,tf,sd,of,af,nf,ka,sf,ya,rf,$a,cp,Fo,Va,rd,ks,lf,id,df,pp,ke,ys,cf,ld,pf,hf,$s,mf,Vs,uf,ff,gf,xs,_f,Bi,vf,bf,wf,Ds,Tf,Fs,kf,yf,$f,dt,Cs,Vf,Co,xf,Hi,Df,Ff,dd,Cf,Af,Mf,xa,jf,Da,Ef,Fa,hp,Ao,Ca,cd,As,qf,pd,Pf,mp,ye,Ms,zf,hd,Sf,Of,js,If,Es,Lf,Nf,Wf,qs,Bf,Ri,Hf,Rf,Gf,Ps,Qf,zs,Uf,Xf,Jf,jt,Ss,Kf,Mo,Yf,Gi,Zf,eg,md,tg,og,ag,Aa,ng,Ma,up,jo,ja,ud,Os,sg,fd,rg,fp,re,Is,ig,Ls,lg,Ns,dg,cg,pg,Ws,hg,Qi,mg,ug,fg,Bs,gg,Hs,_g,vg,bg,Rs,wg,gd,Tg,kg,yg,$e,$g,_d,Vg,xg,vd,Dg,Fg,bd,Cg,Ag,wd,Mg,jg,Td,Eg,qg,kd,Pg,zg,Sg,Ea,Og,yd,Ig,Lg,Gs,Ng,Wg,Et,Qs,Bg,Eo,Hg,Ui,Rg,Gg,$d,Qg,Ug,Xg,qa,Jg,Pa,gp,qo,za,Vd,Us,Kg,xd,Yg,_p,st,Xs,Zg,Po,e_,Dd,t_,o_,Js,a_,n_,s_,Ks,r_,Xi,i_,l_,d_,Ys,c_,Zs,p_,h_,m_,qt,er,u_,zo,f_,Ji,g_,__,Fd,v_,b_,w_,Sa,T_,Oa,vp,So,Ia,Cd,tr,k_,Ad,y_,bp,rt,or,$_,Oo,V_,Md,x_,D_,ar,F_,C_,A_,nr,M_,Ki,j_,E_,q_,sr,P_,rr,z_,S_,O_,ct,ir,I_,Io,L_,Yi,N_,W_,jd,B_,H_,R_,La,G_,Na,Q_,Wa,wp,Lo,Ba,Ed,lr,U_,qd,X_,Tp,Ve,dr,J_,Pd,K_,Y_,cr,Z_,pr,e2,t2,o2,hr,a2,Zi,n2,s2,r2,mr,i2,ur,l2,d2,c2,be,fr,p2,No,h2,el,m2,u2,zd,f2,g2,_2,Ha,v2,Ra,b2,Ga,w2,Qa,T2,Ua,kp,Wo,Xa,Sd,gr,k2,Od,y2,yp,xe,_r,$2,Id,V2,x2,vr,D2,br,F2,C2,A2,wr,M2,tl,j2,E2,q2,Tr,P2,kr,z2,S2,O2,Pt,yr,I2,Bo,L2,ol,N2,W2,Ld,B2,H2,R2,Ja,G2,Ka,$p,Ho,Ya,Nd,$r,Q2,Wd,U2,Vp,De,Vr,X2,Bd,J2,K2,xr,Y2,Dr,Z2,ev,tv,Fr,ov,al,av,nv,sv,Cr,rv,Ar,iv,lv,dv,pt,Mr,cv,Ro,pv,nl,hv,mv,Hd,uv,fv,gv,Za,_v,en,vv,tn,xp,Go,on,Rd,jr,bv,Gd,wv,Dp,Fe,Er,Tv,Qo,kv,Qd,yv,$v,Ud,Vv,xv,Dv,qr,Fv,Pr,Cv,Av,Mv,zr,jv,sl,Ev,qv,Pv,Sr,zv,Or,Sv,Ov,Iv,ht,Ir,Lv,Uo,Nv,rl,Wv,Bv,Xd,Hv,Rv,Gv,an,Qv,nn,Uv,sn,Fp,Xo,rn,Jd,Lr,Xv,Kd,Jv,Cp,Zt,Nr,Kv,Wr,Yv,Br,Zv,eb,tb,zt,Hr,ob,Jo,ab,il,nb,sb,Yd,rb,ib,lb,ln,db,dn,Ap,Ko,cn,Zd,Rr,cb,ec,pb,Mp,_t,Gr,hb,tc,mb,ub,Qr,fb,Ur,gb,_b,vb,St,Xr,bb,Yo,wb,ll,Tb,kb,oc,yb,$b,Vb,pn,xb,hn,jp,Zo,mn,ac,Jr,Db,nc,Fb,Ep,vt,Kr,Cb,sc,Ab,Mb,Yr,jb,Zr,Eb,qb,Pb,Ot,ei,zb,ea,Sb,dl,Ob,Ib,rc,Lb,Nb,Wb,un,Bb,fn,qp,ta,gn,ic,ti,Hb,lc,Rb,Pp,it,oi,Gb,ai,Qb,cl,Ub,Xb,Jb,ni,Kb,si,Yb,Zb,ew,_n,tw,It,ri,ow,oa,aw,pl,nw,sw,dc,rw,iw,lw,vn,dw,bn,zp,aa,wn,cc,ii,cw,pc,pw,Sp,Ce,li,hw,hc,mw,uw,di,fw,hl,gw,_w,vw,ci,bw,pi,ww,Tw,kw,Tn,yw,Lt,hi,$w,na,Vw,ml,xw,Dw,mc,Fw,Cw,Aw,kn,Mw,yn,Op,sa,$n,uc,mi,jw,fc,Ew,Ip,Ae,ui,qw,gc,Pw,zw,fi,Sw,ul,Ow,Iw,Lw,gi,Nw,_i,Ww,Bw,Hw,Vn,Rw,Nt,vi,Gw,ra,Qw,fl,Uw,Xw,_c,Jw,Kw,Yw,xn,Zw,Dn,Lp;return s=new K({}),C=new K({}),Hn=new K({}),Rn=new j({props:{name:"class transformers.Data2VecTextConfig",anchor:"transformers.Data2VecTextConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"use_cache",val:" = True"},{name:"classifier_dropout",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Data2VecTextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the DATA2VEC model. Defines the number of different tokens that can be represented by
the <code>inputs_ids</code> passed when calling <code>Data2VecModel</code>.`,name:"vocab_size"},{anchor:"transformers.Data2VecTextConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.Data2VecTextConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.Data2VecTextConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.Data2VecTextConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.Data2VecTextConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.Data2VecTextConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.Data2VecTextConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.Data2VecTextConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.Data2VecTextConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <code>Data2VecModel</code>.`,name:"type_vocab_size"},{anchor:"transformers.Data2VecTextConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.Data2VecTextConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.Data2VecTextConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.Data2VecTextConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.Data2VecTextConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The dropout ratio for the classification head.`,name:"classifier_dropout"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/configuration_data2vec_text.py#L31"}}),ca=new I({props:{anchor:"transformers.Data2VecTextConfig.example",$$slots:{default:[py]},$$scope:{ctx:x}}}),Qn=new K({}),Un=new j({props:{name:"class transformers.Data2VecAudioConfig",anchor:"transformers.Data2VecAudioConfig",parameters:[{name:"vocab_size",val:" = 32"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout",val:" = 0.1"},{name:"activation_dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.1"},{name:"feat_proj_dropout",val:" = 0.0"},{name:"final_dropout",val:" = 0.1"},{name:"layerdrop",val:" = 0.1"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"feat_extract_activation",val:" = 'gelu'"},{name:"conv_dim",val:" = (512, 512, 512, 512, 512, 512, 512)"},{name:"conv_stride",val:" = (5, 2, 2, 2, 2, 2, 2)"},{name:"conv_kernel",val:" = (10, 3, 3, 3, 3, 2, 2)"},{name:"conv_bias",val:" = False"},{name:"num_conv_pos_embedding_groups",val:" = 16"},{name:"conv_pos_kernel_size",val:" = 19"},{name:"num_conv_pos_embeddings",val:" = 5"},{name:"mask_time_prob",val:" = 0.05"},{name:"mask_time_length",val:" = 10"},{name:"mask_time_min_masks",val:" = 2"},{name:"mask_feature_prob",val:" = 0.0"},{name:"mask_feature_length",val:" = 10"},{name:"mask_feature_min_masks",val:" = 0"},{name:"ctc_loss_reduction",val:" = 'sum'"},{name:"ctc_zero_infinity",val:" = False"},{name:"use_weighted_layer_sum",val:" = False"},{name:"classifier_proj_size",val:" = 256"},{name:"tdnn_dim",val:" = (512, 512, 512, 512, 1500)"},{name:"tdnn_kernel",val:" = (5, 3, 3, 1, 1)"},{name:"tdnn_dilation",val:" = (1, 2, 3, 1, 1)"},{name:"xvector_output_dim",val:" = 512"},{name:"pad_token_id",val:" = 0"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"add_adapter",val:" = False"},{name:"adapter_kernel_size",val:" = 3"},{name:"adapter_stride",val:" = 2"},{name:"num_adapter_layers",val:" = 3"},{name:"output_hidden_size",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Data2VecAudioConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Vocabulary size of the Data2VecAudio model. Defines the number of different tokens that can be represented
by the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioModel">Data2VecAudioModel</a> or <code>TFData2VecAudioModel</code>. Vocabulary size
of the model. Defines the different tokens that can be represented by the <em>inputs_ids</em> passed to the
forward method of <a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioModel">Data2VecAudioModel</a>.`,name:"vocab_size"},{anchor:"transformers.Data2VecAudioConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.Data2VecAudioConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.Data2VecAudioConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.Data2VecAudioConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.Data2VecAudioConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.Data2VecAudioConfig.hidden_dropout",description:`<strong>hidden_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout"},{anchor:"transformers.Data2VecAudioConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.Data2VecAudioConfig.final_dropout",description:`<strong>final_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for the final projection layer of <a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioForCTC">Data2VecAudioForCTC</a>.`,name:"final_dropout"},{anchor:"transformers.Data2VecAudioConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.Data2VecAudioConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.Data2VecAudioConfig.feat_proj_dropout",description:`<strong>feat_proj_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for output of the feature encoder.`,name:"feat_proj_dropout"},{anchor:"transformers.Data2VecAudioConfig.feat_extract_activation",description:"<strong>feat_extract_activation</strong> (<code>str, </code>optional<code>, defaults to </code>&#x201C;gelu&#x201D;<code>) -- The non-linear activation function (function or string) in the 1D convolutional layers of the feature extractor. If string, </code>&#x201C;gelu&#x201D;<code>, </code>&#x201C;relu&#x201D;<code>, </code>&#x201C;selu&#x201D;<code>and</code>&#x201C;gelu_new&#x201D;` are supported.",name:"feat_extract_activation"},{anchor:"transformers.Data2VecAudioConfig.conv_dim",description:`<strong>conv_dim</strong> (<code>Tuple[int]</code> or <code>List[int]</code>, <em>optional</em>, defaults to <code>(512, 512, 512, 512, 512, 512, 512)</code>) &#x2014;
A tuple of integers defining the number of input and output channels of each 1D convolutional layer in the
feature encoder. The length of <em>conv_dim</em> defines the number of 1D convolutional layers.`,name:"conv_dim"},{anchor:"transformers.Data2VecAudioConfig.conv_stride",description:`<strong>conv_stride</strong> (<code>Tuple[int]</code> or <code>List[int]</code>, <em>optional</em>, defaults to <code>(5, 2, 2, 2, 2, 2, 2)</code>) &#x2014;
A tuple of integers defining the stride of each 1D convolutional layer in the feature encoder. The length
of <em>conv_stride</em> defines the number of convolutional layers and has to match the length of <em>conv_dim</em>.`,name:"conv_stride"},{anchor:"transformers.Data2VecAudioConfig.conv_kernel",description:`<strong>conv_kernel</strong> (<code>Tuple[int]</code> or <code>List[int]</code>, <em>optional</em>, defaults to <code>(10, 3, 3, 3, 3, 3, 3)</code>) &#x2014;
A tuple of integers defining the kernel size of each 1D convolutional layer in the feature encoder. The
length of <em>conv_kernel</em> defines the number of convolutional layers and has to match the length of
<em>conv_dim</em>.`,name:"conv_kernel"},{anchor:"transformers.Data2VecAudioConfig.conv_bias",description:`<strong>conv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the 1D convolutional layers have a bias.`,name:"conv_bias"},{anchor:"transformers.Data2VecAudioConfig.num_conv_pos_embeddings",description:`<strong>num_conv_pos_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
Number of convolutional positional embeddings. Defines the kernel size of 1D convolutional positional
embeddings layer.`,name:"num_conv_pos_embeddings"},{anchor:"transformers.Data2VecAudioConfig.num_conv_pos_embedding_groups",description:`<strong>num_conv_pos_embedding_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of groups of 1D convolutional positional embeddings layer.`,name:"num_conv_pos_embedding_groups"},{anchor:"transformers.Data2VecAudioConfig.mask_time_prob",description:`<strong>mask_time_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.05) &#x2014;
Percentage (between 0 and 1) of all feature vectors along the time axis which will be masked. The masking
procecure generates &#x201D;mask_time_prob<em>len(time_axis)/mask_time_length&#x201D; independent masks over the axis. If
reasoning from the propability of each feature vector to be chosen as the start of the vector span to be
masked, </em>mask_time_prob<em> should be \`prob_vector_start</em>mask_time_length\`. Note that overlap may decrease the`,name:"mask_time_prob"},{anchor:"transformers.Data2VecAudioConfig.mask_time_length",description:`<strong>mask_time_length</strong> (<code>int</code>, <em>optional</em>, defaults to 10) &#x2014;
Length of vector span along the time axis.`,name:"mask_time_length"},{anchor:"transformers.Data2VecAudioConfig.mask_time_min_masks",description:`<strong>mask_time_min_masks</strong> (<code>int</code>, <em>optional</em>, defaults to 2), &#x2014;
The minimum number of masks of length <code>mask_feature_length</code> generated along the time axis, each time step,
irrespectively of <code>mask_feature_prob</code>. Only relevant if &#x201D;mask_time_prob*len(time_axis)/mask_time_length &lt;
mask_time_min_masks&#x201D;`,name:"mask_time_min_masks"},{anchor:"transformers.Data2VecAudioConfig.mask_feature_prob",description:`<strong>mask_feature_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Percentage (between 0 and 1) of all feature vectors along the feature axis which will be masked. The
masking procecure generates &#x201D;mask_feature_prob<em>len(feature_axis)/mask_time_length&#x201D; independent masks over
the axis. If reasoning from the propability of each feature vector to be chosen as the start of the vector
span to be masked, </em>mask_feature_prob<em> should be \`prob_vector_start</em>mask_feature_length<code>. Note that overlap may decrease the actual percentage of masked vectors. This is only relevant if </code>apply_spec_augment is
True\`.`,name:"mask_feature_prob"},{anchor:"transformers.Data2VecAudioConfig.mask_feature_length",description:`<strong>mask_feature_length</strong> (<code>int</code>, <em>optional</em>, defaults to 10) &#x2014;
Length of vector span along the feature axis.`,name:"mask_feature_length"},{anchor:"transformers.Data2VecAudioConfig.mask_feature_min_masks",description:`<strong>mask_feature_min_masks</strong> (<code>int</code>, <em>optional</em>, defaults to 0), &#x2014;
The minimum number of masks of length <code>mask_feature_length</code> generated along the feature axis, each time
step, irrespectively of <code>mask_feature_prob</code>. Only relevant if
&#x201D;mask_feature_prob*len(feature_axis)/mask_feature_length &lt; mask_feature_min_masks&#x201D;`,name:"mask_feature_min_masks"},{anchor:"transformers.Data2VecAudioConfig.ctc_loss_reduction",description:`<strong>ctc_loss_reduction</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;sum&quot;</code>) &#x2014;
Specifies the reduction to apply to the output of <code>torch.nn.CTCLoss</code>. Only relevant when training an
instance of <a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioForCTC">Data2VecAudioForCTC</a>.`,name:"ctc_loss_reduction"},{anchor:"transformers.Data2VecAudioConfig.ctc_zero_infinity",description:`<strong>ctc_zero_infinity</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to zero infinite losses and the associated gradients of <code>torch.nn.CTCLoss</code>. Infinite losses mainly
occur when the inputs are too short to be aligned to the targets. Only relevant when training an instance
of <a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioForCTC">Data2VecAudioForCTC</a>.`,name:"ctc_zero_infinity"},{anchor:"transformers.Data2VecAudioConfig.use_weighted_layer_sum",description:`<strong>use_weighted_layer_sum</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a weighted average of layer outputs with learned weights. Only relevant when using an
instance of <a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioForSequenceClassification">Data2VecAudioForSequenceClassification</a>.`,name:"use_weighted_layer_sum"},{anchor:"transformers.Data2VecAudioConfig.classifier_proj_size",description:`<strong>classifier_proj_size</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Dimensionality of the projection before token mean-pooling for classification.`,name:"classifier_proj_size"},{anchor:"transformers.Data2VecAudioConfig.tdnn_dim",description:`<strong>tdnn_dim</strong> (<code>Tuple[int]</code> or <code>List[int]</code>, <em>optional</em>, defaults to <code>(512, 512, 512, 512, 1500)</code>) &#x2014;
A tuple of integers defining the number of output channels of each 1D convolutional layer in the <em>TDNN</em>
module of the <em>XVector</em> model. The length of <em>tdnn_dim</em> defines the number of <em>TDNN</em> layers.`,name:"tdnn_dim"},{anchor:"transformers.Data2VecAudioConfig.tdnn_kernel",description:`<strong>tdnn_kernel</strong> (<code>Tuple[int]</code> or <code>List[int]</code>, <em>optional</em>, defaults to <code>(5, 3, 3, 1, 1)</code>) &#x2014;
A tuple of integers defining the kernel size of each 1D convolutional layer in the <em>TDNN</em> module of the
<em>XVector</em> model. The length of <em>tdnn_kernel</em> has to match the length of <em>tdnn_dim</em>.`,name:"tdnn_kernel"},{anchor:"transformers.Data2VecAudioConfig.tdnn_dilation",description:`<strong>tdnn_dilation</strong> (<code>Tuple[int]</code> or <code>List[int]</code>, <em>optional</em>, defaults to <code>(1, 2, 3, 1, 1)</code>) &#x2014;
A tuple of integers defining the dilation factor of each 1D convolutional layer in <em>TDNN</em> module of the
<em>XVector</em> model. The length of <em>tdnn_dilation</em> has to match the length of <em>tdnn_dim</em>.`,name:"tdnn_dilation"},{anchor:"transformers.Data2VecAudioConfig.xvector_output_dim",description:`<strong>xvector_output_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of the <em>XVector</em> embedding vectors.`,name:"xvector_output_dim"},{anchor:"transformers.Data2VecAudioConfig.add_adapter",description:`<strong>add_adapter</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether a convolutional network should be stacked on top of the Data2VecAudio Encoder. Can be very useful
for warm-starting Data2VecAudio for SpeechEncoderDecoder models.`,name:"add_adapter"},{anchor:"transformers.Data2VecAudioConfig.adapter_kernel_size",description:`<strong>adapter_kernel_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Kernel size of the convolutional layers in the adapter network. Only relevant if <code>add_adapter is True</code>.`,name:"adapter_kernel_size"},{anchor:"transformers.Data2VecAudioConfig.adapter_stride",description:`<strong>adapter_stride</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
Stride of the convolutional layers in the adapter network. Only relevant if <code>add_adapter is True</code>.`,name:"adapter_stride"},{anchor:"transformers.Data2VecAudioConfig.num_adapter_layers",description:`<strong>num_adapter_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Number of convolutional layers that should be used in the adapter network. Only relevant if <code>add_adapter is True</code>.`,name:"num_adapter_layers"},{anchor:"transformers.Data2VecAudioConfig.output_hidden_size",description:`<strong>output_hidden_size</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Dimensionality of the encoder output layer. If not defined, this defaults to <em>hidden-size</em>. Only relevant
if <code>add_adapter is True</code>.`,name:"output_hidden_size"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/configuration_data2vec_audio.py#L31"}}),ha=new I({props:{anchor:"transformers.Data2VecAudioConfig.example",$$slots:{default:[hy]},$$scope:{ctx:x}}}),Jn=new K({}),Kn=new j({props:{name:"class transformers.Data2VecVisionConfig",anchor:"transformers.Data2VecVisionConfig",parameters:[{name:"vocab_size",val:" = 8192"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.0"},{name:"attention_probs_dropout_prob",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"is_encoder_decoder",val:" = False"},{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 16"},{name:"num_channels",val:" = 3"},{name:"use_mask_token",val:" = False"},{name:"use_absolute_position_embeddings",val:" = False"},{name:"use_relative_position_bias",val:" = False"},{name:"use_shared_relative_position_bias",val:" = False"},{name:"layer_scale_init_value",val:" = 0.1"},{name:"drop_path_rate",val:" = 0.1"},{name:"use_mean_pooling",val:" = True"},{name:"out_indices",val:" = [3, 5, 7, 11]"},{name:"pool_scales",val:" = [1, 2, 3, 6]"},{name:"use_auxiliary_head",val:" = True"},{name:"auxiliary_loss_weight",val:" = 0.4"},{name:"auxiliary_channels",val:" = 256"},{name:"auxiliary_num_convs",val:" = 1"},{name:"auxiliary_concat_input",val:" = False"},{name:"semantic_loss_ignore_index",val:" = 255"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Data2VecVisionConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 8092) &#x2014;
Vocabulary size of the Data2VecVision model. Defines the number of different image tokens that can be used
during pre-training.`,name:"vocab_size"},{anchor:"transformers.Data2VecVisionConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.Data2VecVisionConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.Data2VecVisionConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.Data2VecVisionConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.Data2VecVisionConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.Data2VecVisionConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.Data2VecVisionConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.Data2VecVisionConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.Data2VecVisionConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.Data2VecVisionConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.Data2VecVisionConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.Data2VecVisionConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.Data2VecVisionConfig.use_mask_token",description:`<strong>use_mask_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a mask token for masked image modeling.`,name:"use_mask_token"},{anchor:"transformers.Data2VecVisionConfig.use_absolute_position_embeddings",description:`<strong>use_absolute_position_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use BERT-style absolute position embeddings.`,name:"use_absolute_position_embeddings"},{anchor:"transformers.Data2VecVisionConfig.use_relative_position_bias",description:`<strong>use_relative_position_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use T5-style relative position embeddings in the self-attention layers.`,name:"use_relative_position_bias"},{anchor:"transformers.Data2VecVisionConfig.use_shared_relative_position_bias",description:`<strong>use_shared_relative_position_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use the same relative position embeddings across all self-attention layers of the Transformer.`,name:"use_shared_relative_position_bias"},{anchor:"transformers.Data2VecVisionConfig.layer_scale_init_value",description:`<strong>layer_scale_init_value</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Scale to use in the self-attention layers. 0.1 for base, 1e-5 for large. Set 0 to disable layer scale.`,name:"layer_scale_init_value"},{anchor:"transformers.Data2VecVisionConfig.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Stochastic depth rate per sample (when applied in the main path of residual layers).`,name:"drop_path_rate"},{anchor:"transformers.Data2VecVisionConfig.use_mean_pooling",description:`<strong>use_mean_pooling</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to mean pool the final hidden states of the patches instead of using the final hidden state of the
CLS token, before applying the classification head.`,name:"use_mean_pooling"},{anchor:"transformers.Data2VecVisionConfig.out_indices",description:`<strong>out_indices</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[3, 5, 7, 11]</code>) &#x2014;
Indices of the feature maps to use for semantic segmentation.`,name:"out_indices"},{anchor:"transformers.Data2VecVisionConfig.pool_scales",description:`<strong>pool_scales</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to <code>[1, 2, 3, 6]</code>) &#x2014;
Pooling scales used in Pooling Pyramid Module applied on the last feature map.`,name:"pool_scales"},{anchor:"transformers.Data2VecVisionConfig.use_auxiliary_head",description:`<strong>use_auxiliary_head</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use an auxiliary head during training.`,name:"use_auxiliary_head"},{anchor:"transformers.Data2VecVisionConfig.auxiliary_loss_weight",description:`<strong>auxiliary_loss_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 0.4) &#x2014;
Weight of the cross-entropy loss of the auxiliary head.`,name:"auxiliary_loss_weight"},{anchor:"transformers.Data2VecVisionConfig.auxiliary_channels",description:`<strong>auxiliary_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Number of channels to use in the auxiliary head.`,name:"auxiliary_channels"},{anchor:"transformers.Data2VecVisionConfig.auxiliary_num_convs",description:`<strong>auxiliary_num_convs</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Number of convolutional layers to use in the auxiliary head.`,name:"auxiliary_num_convs"},{anchor:"transformers.Data2VecVisionConfig.auxiliary_concat_input",description:`<strong>auxiliary_concat_input</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to concatenate the output of the auxiliary head with the input before the classification layer.`,name:"auxiliary_concat_input"},{anchor:"transformers.Data2VecVisionConfig.semantic_loss_ignore_index",description:`<strong>semantic_loss_ignore_index</strong> (<code>int</code>, <em>optional</em>, defaults to 255) &#x2014;
The index that is ignored by the loss function of the semantic segmentation model.`,name:"semantic_loss_ignore_index"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/configuration_data2vec_vision.py#L35"}}),ua=new I({props:{anchor:"transformers.Data2VecVisionConfig.example",$$slots:{default:[my]},$$scope:{ctx:x}}}),Zn=new K({}),es=new j({props:{name:"class transformers.Data2VecAudioModel",anchor:"transformers.Data2VecAudioModel",parameters:[{name:"config",val:": Data2VecAudioConfig"}],parametersDescription:[{anchor:"transformers.Data2VecAudioModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioConfig">Data2VecAudioConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_audio.py#L840"}}),rs=new j({props:{name:"forward",anchor:"transformers.Data2VecAudioModel.forward",parameters:[{name:"input_values",val:": typing.Optional[torch.Tensor]"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"mask_time_indices",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Data2VecAudioModel.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <em>.flac</em> or <em>.wav</em> audio file
into an array of type <em>List[float]</em> or a <em>numpy.ndarray</em>, <em>e.g.</em> via the soundfile library (<em>pip install
soundfile</em>). To prepare the array into <em>input_values</em>, the <a href="/docs/transformers/v4.25.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor">Wav2Vec2Processor</a> should be used for padding
and conversion into a tensor of type <em>torch.FloatTensor</em>. See <a href="/docs/transformers/v4.25.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Data2VecAudioModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</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><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/data2vec-audio-base-960h" rel="nofollow">data2vec-audio-base</a>, <code>attention_mask</code> should
<strong>not</strong> be passed to avoid degraded performance when doing batched inference. For such models
<code>input_values</code> should simply be padded with 0 and passed without <code>attention_mask</code>. Be aware that these
models also yield slightly different results depending on whether <code>input_values</code> is padded or not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Data2VecAudioModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Data2VecAudioModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.Data2VecAudioModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_audio.py#L911",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/model_doc/wav2vec2#transformers.modeling_outputs.Wav2Vec2BaseModelOutput"
>transformers.modeling_outputs.Wav2Vec2BaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioConfig"
>Data2VecAudioConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>extract_features</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, conv_dim[-1])</code>) \u2014 Sequence of extracted feature vectors of the last convolutional layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/model_doc/wav2vec2#transformers.modeling_outputs.Wav2Vec2BaseModelOutput"
>transformers.modeling_outputs.Wav2Vec2BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ga=new ie({props:{$$slots:{default:[uy]},$$scope:{ctx:x}}}),_a=new I({props:{anchor:"transformers.Data2VecAudioModel.forward.example",$$slots:{default:[fy]},$$scope:{ctx:x}}}),is=new K({}),ls=new j({props:{name:"class transformers.Data2VecAudioForAudioFrameClassification",anchor:"transformers.Data2VecAudioForAudioFrameClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Data2VecAudioForAudioFrameClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioConfig">Data2VecAudioConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_audio.py#L1233"}}),us=new j({props:{name:"forward",anchor:"transformers.Data2VecAudioForAudioFrameClassification.forward",parameters:[{name:"input_values",val:": typing.Optional[torch.Tensor]"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Data2VecAudioForAudioFrameClassification.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <em>.flac</em> or <em>.wav</em> audio file
into an array of type <em>List[float]</em> or a <em>numpy.ndarray</em>, <em>e.g.</em> via the soundfile library (<em>pip install
soundfile</em>). To prepare the array into <em>input_values</em>, the <a href="/docs/transformers/v4.25.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor">Wav2Vec2Processor</a> should be used for padding
and conversion into a tensor of type <em>torch.FloatTensor</em>. See <a href="/docs/transformers/v4.25.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Data2VecAudioForAudioFrameClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</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><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/data2vec-audio-base-960h" rel="nofollow">data2vec-audio-base</a>, <code>attention_mask</code> should
<strong>not</strong> be passed to avoid degraded performance when doing batched inference. For such models
<code>input_values</code> should simply be padded with 0 and passed without <code>attention_mask</code>. Be aware that these
models also yield slightly different results depending on whether <code>input_values</code> is padded or not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Data2VecAudioForAudioFrameClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Data2VecAudioForAudioFrameClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.Data2VecAudioForAudioFrameClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecAudioForAudioFrameClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_audio.py#L1278",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioConfig"
>Data2VecAudioConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ba=new ie({props:{$$slots:{default:[gy]},$$scope:{ctx:x}}}),wa=new I({props:{anchor:"transformers.Data2VecAudioForAudioFrameClassification.forward.example",$$slots:{default:[_y]},$$scope:{ctx:x}}}),fs=new K({}),gs=new j({props:{name:"class transformers.Data2VecAudioForCTC",anchor:"transformers.Data2VecAudioForCTC",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Data2VecAudioForCTC.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioConfig">Data2VecAudioConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_audio.py#L978"}}),Ts=new j({props:{name:"forward",anchor:"transformers.Data2VecAudioForCTC.forward",parameters:[{name:"input_values",val:": typing.Optional[torch.Tensor]"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"transformers.Data2VecAudioForCTC.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <em>.flac</em> or <em>.wav</em> audio file
into an array of type <em>List[float]</em> or a <em>numpy.ndarray</em>, <em>e.g.</em> via the soundfile library (<em>pip install
soundfile</em>). To prepare the array into <em>input_values</em>, the <a href="/docs/transformers/v4.25.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor">Wav2Vec2Processor</a> should be used for padding
and conversion into a tensor of type <em>torch.FloatTensor</em>. See <a href="/docs/transformers/v4.25.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Data2VecAudioForCTC.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</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><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/data2vec-audio-base-960h" rel="nofollow">data2vec-audio-base</a>, <code>attention_mask</code> should
<strong>not</strong> be passed to avoid degraded performance when doing batched inference. For such models
<code>input_values</code> should simply be padded with 0 and passed without <code>attention_mask</code>. Be aware that these
models also yield slightly different results depending on whether <code>input_values</code> is padded or not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Data2VecAudioForCTC.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Data2VecAudioForCTC.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.Data2VecAudioForCTC.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecAudioForCTC.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_length)</code>, <em>optional</em>) &#x2014;
Labels for connectionist temporal classification. Note that <code>target_length</code> has to be smaller or equal to
the sequence length of the output logits. Indices are selected in <code>[-100, 0, ..., config.vocab_size - 1]</code>.
All labels set to <code>-100</code> are ignored (masked), the loss is only computed for labels in <code>[0, ..., config.vocab_size - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_audio.py#L1019",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.CausalLMOutput"
>transformers.modeling_outputs.CausalLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioConfig"
>Data2VecAudioConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.CausalLMOutput"
>transformers.modeling_outputs.CausalLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ka=new ie({props:{$$slots:{default:[vy]},$$scope:{ctx:x}}}),ya=new I({props:{anchor:"transformers.Data2VecAudioForCTC.forward.example",$$slots:{default:[by]},$$scope:{ctx:x}}}),$a=new I({props:{anchor:"transformers.Data2VecAudioForCTC.forward.example-2",$$slots:{default:[wy]},$$scope:{ctx:x}}}),ks=new K({}),ys=new j({props:{name:"class transformers.Data2VecAudioForSequenceClassification",anchor:"transformers.Data2VecAudioForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Data2VecAudioForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioConfig">Data2VecAudioConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_audio.py#L1109"}}),Cs=new j({props:{name:"forward",anchor:"transformers.Data2VecAudioForSequenceClassification.forward",parameters:[{name:"input_values",val:": typing.Optional[torch.Tensor]"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"transformers.Data2VecAudioForSequenceClassification.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <em>.flac</em> or <em>.wav</em> audio file
into an array of type <em>List[float]</em> or a <em>numpy.ndarray</em>, <em>e.g.</em> via the soundfile library (<em>pip install
soundfile</em>). To prepare the array into <em>input_values</em>, the <a href="/docs/transformers/v4.25.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor">Wav2Vec2Processor</a> should be used for padding
and conversion into a tensor of type <em>torch.FloatTensor</em>. See <a href="/docs/transformers/v4.25.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Data2VecAudioForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</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><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/data2vec-audio-base-960h" rel="nofollow">data2vec-audio-base</a>, <code>attention_mask</code> should
<strong>not</strong> be passed to avoid degraded performance when doing batched inference. For such models
<code>input_values</code> should simply be padded with 0 and passed without <code>attention_mask</code>. Be aware that these
models also yield slightly different results depending on whether <code>input_values</code> is padded or not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Data2VecAudioForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Data2VecAudioForSequenceClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.Data2VecAudioForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecAudioForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_audio.py#L1154",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioConfig"
>Data2VecAudioConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),xa=new ie({props:{$$slots:{default:[Ty]},$$scope:{ctx:x}}}),Da=new I({props:{anchor:"transformers.Data2VecAudioForSequenceClassification.forward.example",$$slots:{default:[ky]},$$scope:{ctx:x}}}),Fa=new I({props:{anchor:"transformers.Data2VecAudioForSequenceClassification.forward.example-2",$$slots:{default:[yy]},$$scope:{ctx:x}}}),As=new K({}),Ms=new j({props:{name:"class transformers.Data2VecAudioForXVector",anchor:"transformers.Data2VecAudioForXVector",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Data2VecAudioForXVector.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioConfig">Data2VecAudioConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_audio.py#L1399"}}),Ss=new j({props:{name:"forward",anchor:"transformers.Data2VecAudioForXVector.forward",parameters:[{name:"input_values",val:": typing.Optional[torch.Tensor]"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"transformers.Data2VecAudioForXVector.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <em>.flac</em> or <em>.wav</em> audio file
into an array of type <em>List[float]</em> or a <em>numpy.ndarray</em>, <em>e.g.</em> via the soundfile library (<em>pip install
soundfile</em>). To prepare the array into <em>input_values</em>, the <a href="/docs/transformers/v4.25.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor">Wav2Vec2Processor</a> should be used for padding
and conversion into a tensor of type <em>torch.FloatTensor</em>. See <a href="/docs/transformers/v4.25.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Data2VecAudioForXVector.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</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><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/data2vec-audio-base-960h" rel="nofollow">data2vec-audio-base</a>, <code>attention_mask</code> should
<strong>not</strong> be passed to avoid degraded performance when doing batched inference. For such models
<code>input_values</code> should simply be padded with 0 and passed without <code>attention_mask</code>. Be aware that these
models also yield slightly different results depending on whether <code>input_values</code> is padded or not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Data2VecAudioForXVector.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Data2VecAudioForXVector.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.Data2VecAudioForXVector.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecAudioForXVector.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_audio.py#L1461",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.XVectorOutput"
>transformers.modeling_outputs.XVectorOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioConfig"
>Data2VecAudioConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.xvector_output_dim)</code>) \u2014 Classification hidden states before AMSoftmax.</p>
</li>
<li>
<p><strong>embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.xvector_output_dim)</code>) \u2014 Utterance embeddings used for vector similarity-based retrieval.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.XVectorOutput"
>transformers.modeling_outputs.XVectorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Aa=new ie({props:{$$slots:{default:[$y]},$$scope:{ctx:x}}}),Ma=new I({props:{anchor:"transformers.Data2VecAudioForXVector.forward.example",$$slots:{default:[Vy]},$$scope:{ctx:x}}}),Os=new K({}),Is=new j({props:{name:"class transformers.Data2VecTextModel",anchor:"transformers.Data2VecTextModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.Data2VecTextModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextConfig">Data2VecTextConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_text.py#L701"}}),Qs=new j({props:{name:"forward",anchor:"transformers.Data2VecTextModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Data2VecTextModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/roberta#transformers.RobertaTokenizer">RobertaTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Data2VecTextModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.Data2VecTextModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.Data2VecTextModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.Data2VecTextModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.Data2VecTextModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.Data2VecTextModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Data2VecTextModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.Data2VecTextModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecTextModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.Data2VecTextModel.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.Data2VecTextModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.Data2VecTextModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_text.py#L745",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextConfig"
>Data2VecTextConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),qa=new ie({props:{$$slots:{default:[xy]},$$scope:{ctx:x}}}),Pa=new I({props:{anchor:"transformers.Data2VecTextModel.forward.example",$$slots:{default:[Dy]},$$scope:{ctx:x}}}),Us=new K({}),Xs=new j({props:{name:"class transformers.Data2VecTextForCausalLM",anchor:"transformers.Data2VecTextForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Data2VecTextForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextConfig">Data2VecTextConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_text.py#L886"}}),er=new j({props:{name:"forward",anchor:"transformers.Data2VecTextForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Data2VecTextForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/roberta#transformers.RobertaTokenizer">RobertaTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Data2VecTextForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.Data2VecTextForCausalLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.Data2VecTextForCausalLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.Data2VecTextForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.Data2VecTextForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.Data2VecTextForCausalLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Data2VecTextForCausalLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.Data2VecTextForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecTextForCausalLM.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.Data2VecTextForCausalLM.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.Data2VecTextForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the left-to-right language modeling loss (next word prediction). Indices should be in
<code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are
ignored (masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.Data2VecTextForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.Data2VecTextForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_text.py#L912",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextConfig"
>Data2VecTextConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Sa=new ie({props:{$$slots:{default:[Fy]},$$scope:{ctx:x}}}),Oa=new I({props:{anchor:"transformers.Data2VecTextForCausalLM.forward.example",$$slots:{default:[Cy]},$$scope:{ctx:x}}}),tr=new K({}),or=new j({props:{name:"class transformers.Data2VecTextForMaskedLM",anchor:"transformers.Data2VecTextForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Data2VecTextForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextConfig">Data2VecTextConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_text.py#L1038"}}),ir=new j({props:{name:"forward",anchor:"transformers.Data2VecTextForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Data2VecTextForMaskedLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/roberta#transformers.RobertaTokenizer">RobertaTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Data2VecTextForMaskedLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.Data2VecTextForMaskedLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.Data2VecTextForMaskedLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.Data2VecTextForMaskedLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.Data2VecTextForMaskedLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.Data2VecTextForMaskedLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Data2VecTextForMaskedLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.Data2VecTextForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecTextForMaskedLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.Data2VecTextForMaskedLM.forward.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, any]</code>, optional, defaults to <em>{}</em>) &#x2014;
Used to hide legacy arguments that have been deprecated.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_text.py#L1067",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextConfig"
>Data2VecTextConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),La=new ie({props:{$$slots:{default:[Ay]},$$scope:{ctx:x}}}),Na=new I({props:{anchor:"transformers.Data2VecTextForMaskedLM.forward.example",$$slots:{default:[My]},$$scope:{ctx:x}}}),Wa=new I({props:{anchor:"transformers.Data2VecTextForMaskedLM.forward.example-2",$$slots:{default:[jy]},$$scope:{ctx:x}}}),lr=new K({}),dr=new j({props:{name:"class transformers.Data2VecTextForSequenceClassification",anchor:"transformers.Data2VecTextForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Data2VecTextForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextConfig">Data2VecTextConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_text.py#L1172"}}),fr=new j({props:{name:"forward",anchor:"transformers.Data2VecTextForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Data2VecTextForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/roberta#transformers.RobertaTokenizer">RobertaTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Data2VecTextForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.Data2VecTextForSequenceClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.Data2VecTextForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.Data2VecTextForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.Data2VecTextForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.Data2VecTextForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Data2VecTextForSequenceClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.Data2VecTextForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecTextForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_text.py#L1186",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextConfig"
>Data2VecTextConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ha=new ie({props:{$$slots:{default:[Ey]},$$scope:{ctx:x}}}),Ra=new I({props:{anchor:"transformers.Data2VecTextForSequenceClassification.forward.example",$$slots:{default:[qy]},$$scope:{ctx:x}}}),Ga=new I({props:{anchor:"transformers.Data2VecTextForSequenceClassification.forward.example-2",$$slots:{default:[Py]},$$scope:{ctx:x}}}),Qa=new I({props:{anchor:"transformers.Data2VecTextForSequenceClassification.forward.example-3",$$slots:{default:[zy]},$$scope:{ctx:x}}}),Ua=new I({props:{anchor:"transformers.Data2VecTextForSequenceClassification.forward.example-4",$$slots:{default:[Sy]},$$scope:{ctx:x}}}),gr=new K({}),_r=new j({props:{name:"class transformers.Data2VecTextForMultipleChoice",anchor:"transformers.Data2VecTextForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Data2VecTextForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextConfig">Data2VecTextConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_text.py#L1270"}}),yr=new j({props:{name:"forward",anchor:"transformers.Data2VecTextForMultipleChoice.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Data2VecTextForMultipleChoice.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/roberta#transformers.RobertaTokenizer">RobertaTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Data2VecTextForMultipleChoice.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.Data2VecTextForMultipleChoice.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.Data2VecTextForMultipleChoice.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.Data2VecTextForMultipleChoice.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.Data2VecTextForMultipleChoice.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.Data2VecTextForMultipleChoice.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Data2VecTextForMultipleChoice.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.Data2VecTextForMultipleChoice.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecTextForMultipleChoice.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices-1]</code> where <code>num_choices</code> is the size of the second dimension of the input tensors. (See
<code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_text.py#L1283",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextConfig"
>Data2VecTextConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <em>(1,)</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ja=new ie({props:{$$slots:{default:[Oy]},$$scope:{ctx:x}}}),Ka=new I({props:{anchor:"transformers.Data2VecTextForMultipleChoice.forward.example",$$slots:{default:[Iy]},$$scope:{ctx:x}}}),$r=new K({}),Vr=new j({props:{name:"class transformers.Data2VecTextForTokenClassification",anchor:"transformers.Data2VecTextForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Data2VecTextForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextConfig">Data2VecTextConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_text.py#L1365"}}),Mr=new j({props:{name:"forward",anchor:"transformers.Data2VecTextForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Data2VecTextForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/roberta#transformers.RobertaTokenizer">RobertaTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Data2VecTextForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.Data2VecTextForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.Data2VecTextForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.Data2VecTextForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.Data2VecTextForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.Data2VecTextForTokenClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Data2VecTextForTokenClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.Data2VecTextForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecTextForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_text.py#L1383",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextConfig"
>Data2VecTextConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Za=new ie({props:{$$slots:{default:[Ly]},$$scope:{ctx:x}}}),en=new I({props:{anchor:"transformers.Data2VecTextForTokenClassification.forward.example",$$slots:{default:[Ny]},$$scope:{ctx:x}}}),tn=new I({props:{anchor:"transformers.Data2VecTextForTokenClassification.forward.example-2",$$slots:{default:[Wy]},$$scope:{ctx:x}}}),jr=new K({}),Er=new j({props:{name:"class transformers.Data2VecTextForQuestionAnswering",anchor:"transformers.Data2VecTextForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Data2VecTextForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextConfig">Data2VecTextConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_text.py#L1473"}}),Ir=new j({props:{name:"forward",anchor:"transformers.Data2VecTextForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Data2VecTextForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/roberta#transformers.RobertaTokenizer">RobertaTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Data2VecTextForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.Data2VecTextForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.Data2VecTextForQuestionAnswering.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.Data2VecTextForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.Data2VecTextForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.Data2VecTextForQuestionAnswering.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Data2VecTextForQuestionAnswering.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.Data2VecTextForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecTextForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.Data2VecTextForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_text.py#L1487",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextConfig"
>Data2VecTextConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),an=new ie({props:{$$slots:{default:[By]},$$scope:{ctx:x}}}),nn=new I({props:{anchor:"transformers.Data2VecTextForQuestionAnswering.forward.example",$$slots:{default:[Hy]},$$scope:{ctx:x}}}),sn=new I({props:{anchor:"transformers.Data2VecTextForQuestionAnswering.forward.example-2",$$slots:{default:[Ry]},$$scope:{ctx:x}}}),Lr=new K({}),Nr=new j({props:{name:"class transformers.Data2VecVisionModel",anchor:"transformers.Data2VecVisionModel",parameters:[{name:"config",val:": Data2VecVisionConfig"},{name:"add_pooling_layer",val:": bool = False"}],parametersDescription:[{anchor:"transformers.Data2VecVisionModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecVisionConfig">Data2VecVisionConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_vision.py#L634"}}),Hr=new j({props:{name:"forward",anchor:"transformers.Data2VecVisionModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.BoolTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Data2VecVisionModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/beit#transformers.BeitImageProcessor">BeitImageProcessor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/beit#transformers.BeitImageProcessor.__call__">BeitImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.Data2VecVisionModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.Data2VecVisionModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Data2VecVisionModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.Data2VecVisionModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_vision.py#L661",returnDescription:`
<p>A <code>transformers.models.data2vec.modeling_data2vec_vision.Data2VecVisionModelOutputWithPooling</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecVisionConfig"
>Data2VecVisionConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Average of the last layer hidden states of the patch tokens (excluding the <em>[CLS]</em> token) if
<em>config.use_mean_pooling</em> is set to True. If set to False, then the final hidden state of the <em>[CLS]</em> token
will be returned.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.data2vec.modeling_data2vec_vision.Data2VecVisionModelOutputWithPooling</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ln=new ie({props:{$$slots:{default:[Gy]},$$scope:{ctx:x}}}),dn=new I({props:{anchor:"transformers.Data2VecVisionModel.forward.example",$$slots:{default:[Qy]},$$scope:{ctx:x}}}),Rr=new K({}),Gr=new j({props:{name:"class transformers.Data2VecVisionForImageClassification",anchor:"transformers.Data2VecVisionForImageClassification",parameters:[{name:"config",val:": Data2VecVisionConfig"}],parametersDescription:[{anchor:"transformers.Data2VecVisionForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecVisionConfig">Data2VecVisionConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_vision.py#L748"}}),Xr=new j({props:{name:"forward",anchor:"transformers.Data2VecVisionForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Data2VecVisionForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/beit#transformers.BeitImageProcessor">BeitImageProcessor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/beit#transformers.BeitImageProcessor.__call__">BeitImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.Data2VecVisionForImageClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.Data2VecVisionForImageClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Data2VecVisionForImageClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.Data2VecVisionForImageClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecVisionForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_vision.py#L761",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecVisionConfig"
>Data2VecVisionConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states
(also called feature maps) of the model at the output of each stage.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),pn=new ie({props:{$$slots:{default:[Uy]},$$scope:{ctx:x}}}),hn=new I({props:{anchor:"transformers.Data2VecVisionForImageClassification.forward.example",$$slots:{default:[Xy]},$$scope:{ctx:x}}}),Jr=new K({}),Kr=new j({props:{name:"class transformers.Data2VecVisionForSemanticSegmentation",anchor:"transformers.Data2VecVisionForSemanticSegmentation",parameters:[{name:"config",val:": Data2VecVisionConfig"}],parametersDescription:[{anchor:"transformers.Data2VecVisionForSemanticSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecVisionConfig">Data2VecVisionConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_vision.py#L1084"}}),ei=new j({props:{name:"forward",anchor:"transformers.Data2VecVisionForSemanticSegmentation.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Data2VecVisionForSemanticSegmentation.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/beit#transformers.BeitImageProcessor">BeitImageProcessor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/beit#transformers.BeitImageProcessor.__call__">BeitImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.Data2VecVisionForSemanticSegmentation.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.Data2VecVisionForSemanticSegmentation.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Data2VecVisionForSemanticSegmentation.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.Data2VecVisionForSemanticSegmentation.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Data2VecVisionForSemanticSegmentation.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Ground truth semantic segmentation maps for computing the loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code>, a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_data2vec_vision.py#L1128",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecVisionConfig"
>Data2VecVisionConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels, logits_height, logits_width)</code>) \u2014 Classification scores for each pixel.</p>
<Tip warning={true}>
<p>The logits returned do not necessarily have the same size as the <code>pixel_values</code> passed as inputs. This is
to avoid doing two interpolations and lose some quality when a user needs to resize the logits to the
original image size as post-processing. You should always check your logits shape and resize as needed.</p>
</Tip>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, patch_size, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.SemanticSegmenterOutput"
>transformers.modeling_outputs.SemanticSegmenterOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),un=new ie({props:{$$slots:{default:[Jy]},$$scope:{ctx:x}}}),fn=new I({props:{anchor:"transformers.Data2VecVisionForSemanticSegmentation.forward.example",$$slots:{default:[Ky]},$$scope:{ctx:x}}}),ti=new K({}),oi=new j({props:{name:"class transformers.TFData2VecVisionModel",anchor:"transformers.TFData2VecVisionModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFData2VecVisionModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecVisionConfig">Data2VecVisionConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_tf_data2vec_vision.py#L882"}}),_n=new ie({props:{$$slots:{default:[Yy]},$$scope:{ctx:x}}}),ri=new j({props:{name:"call",anchor:"transformers.TFData2VecVisionModel.call",parameters:[{name:"pixel_values",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"bool_masked_pos",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFData2VecVisionModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/beit#transformers.BeitImageProcessor">BeitImageProcessor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/beit#transformers.BeitImageProcessor.__call__">BeitImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFData2VecVisionModel.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFData2VecVisionModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFData2VecVisionModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFData2VecVisionModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used
in eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFData2VecVisionModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_tf_data2vec_vision.py#L894",returnDescription:`
<p>A <code>transformers.models.data2vec.modeling_tf_data2vec_vision.TFData2VecVisionModelOutputWithPooling</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecVisionConfig"
>Data2VecVisionConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Average of the last layer hidden states of the patch tokens (excluding the <em>[CLS]</em> token) if
<em>config.use_mean_pooling</em> is set to True. If set to False, then the final hidden state of the <em>[CLS]</em> token
will be returned.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.data2vec.modeling_tf_data2vec_vision.TFData2VecVisionModelOutputWithPooling</code> or <code>tuple(tf.Tensor)</code></p>
`}}),vn=new ie({props:{$$slots:{default:[Zy]},$$scope:{ctx:x}}}),bn=new I({props:{anchor:"transformers.TFData2VecVisionModel.call.example",$$slots:{default:[e$]},$$scope:{ctx:x}}}),ii=new K({}),li=new j({props:{name:"class transformers.TFData2VecVisionForImageClassification",anchor:"transformers.TFData2VecVisionForImageClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFData2VecVisionForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecVisionConfig">Data2VecVisionConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_tf_data2vec_vision.py#L946"}}),Tn=new ie({props:{$$slots:{default:[t$]},$$scope:{ctx:x}}}),hi=new j({props:{name:"call",anchor:"transformers.TFData2VecVisionForImageClassification.call",parameters:[{name:"pixel_values",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFData2VecVisionForImageClassification.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/beit#transformers.BeitImageProcessor">BeitImageProcessor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/beit#transformers.BeitImageProcessor.__call__">BeitImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFData2VecVisionForImageClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFData2VecVisionForImageClassification.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFData2VecVisionForImageClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFData2VecVisionForImageClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used
in eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFData2VecVisionForImageClassification.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFData2VecVisionForImageClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> or <code>np.ndarray</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_tf_data2vec_vision.py#L960",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecVisionConfig"
>Data2VecVisionConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, )</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),kn=new ie({props:{$$slots:{default:[o$]},$$scope:{ctx:x}}}),yn=new I({props:{anchor:"transformers.TFData2VecVisionForImageClassification.call.example",$$slots:{default:[a$]},$$scope:{ctx:x}}}),mi=new K({}),ui=new j({props:{name:"class transformers.TFData2VecVisionForSemanticSegmentation",anchor:"transformers.TFData2VecVisionForSemanticSegmentation",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFData2VecVisionForSemanticSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecVisionConfig">Data2VecVisionConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_tf_data2vec_vision.py#L1325"}}),Vn=new ie({props:{$$slots:{default:[n$]},$$scope:{ctx:x}}}),vi=new j({props:{name:"call",anchor:"transformers.TFData2VecVisionForSemanticSegmentation.call",parameters:[{name:"pixel_values",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"head_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.TFData2VecVisionForSemanticSegmentation.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/beit#transformers.BeitImageProcessor">BeitImageProcessor</a>. See
<a href="/docs/transformers/v4.25.1/en/model_doc/beit#transformers.BeitImageProcessor.__call__">BeitImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFData2VecVisionForSemanticSegmentation.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFData2VecVisionForSemanticSegmentation.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFData2VecVisionForSemanticSegmentation.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFData2VecVisionForSemanticSegmentation.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used
in eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFData2VecVisionForSemanticSegmentation.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFData2VecVisionForSemanticSegmentation.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Ground truth semantic segmentation maps for computing the loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code>, a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/data2vec/modeling_tf_data2vec_vision.py#L1378",returnDescription:`
<p>A <code>transformers.modeling_tf_outputs.TFSemanticSegmenterOutput</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecVisionConfig"
>Data2VecVisionConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels, logits_height, logits_width)</code>) \u2014 Classification scores for each pixel.</p>
<Tip warning={true}>
<p>The logits returned do not necessarily have the same size as the <code>pixel_values</code> passed as inputs. This is
to avoid doing two interpolations and lose some quality when a user needs to resize the logits to the
original image size as post-processing. You should always check your logits shape and resize as needed.</p>
</Tip>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings, if the model has an embedding layer, + one for
the output of each layer) of shape <code>(batch_size, patch_size, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_tf_outputs.TFSemanticSegmenterOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),xn=new ie({props:{$$slots:{default:[s$]},$$scope:{ctx:x}}}),Dn=new I({props:{anchor:"transformers.TFData2VecVisionForSemanticSegmentation.call.example",$$slots:{default:[r$]},$$scope:{ctx:x}}}),{c(){d=r("meta"),g=m(),c=r("h1"),h=r("a"),v=r("span"),w(s.$$.fragment),p=m(),F=r("span"),Ne=a("Data2Vec"),Me=m(),B=r("h2"),le=r("a"),de=r("span"),w(C.$$.fragment),We=m(),X=r("span"),Be=a("Overview"),je=m(),H=r("p"),He=a("The Data2Vec model was proposed in "),ce=r("a"),ee=a("data2vec: A General Framework for Self-supervised Learning in Speech, Vision and Language"),Re=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and Michael Auli.
Data2Vec proposes a unified framework for self-supervised learning across different data modalities - text, audio and images.
Importantly, predicted targets for pre-training are contextualized latent representations of the inputs, rather than modality-specific, context-independent targets.`),Ee=m(),R=r("p"),Ge=a("The abstract from the paper is the following:"),qe=m(),G=r("p"),pe=r("em"),Qe=a(`While the general idea of self-supervised learning is identical across modalities, the actual algorithms and
objectives differ widely because they were developed with a single modality in mind. To get us closer to general
self-supervised learning, we present data2vec, a framework that uses the same learning method for either speech,
NLP or computer vision. The core idea is to predict latent representations of the full input data based on a
masked view of the input in a selfdistillation setup using a standard Transformer architecture.
Instead of predicting modality-specific targets such as words, visual tokens or units of human speech which
are local in nature, data2vec predicts contextualized latent representations that contain information from
the entire input. Experiments on the major benchmarks of speech recognition, image classification, and
natural language understanding demonstrate a new state of the art or competitive performance to predominant approaches.
Models and code are available at `),Y=r("a"),E=a("www.github.com/pytorch/fairseq/tree/master/examples/data2vec"),z=a("."),Pe=m(),Q=r("p"),Ue=a("Tips:"),ze=m(),P=r("ul"),we=r("li"),Xe=a("Data2VecAudio, Data2VecText, and Data2VecVision have all been trained using the same self-supervised learning method."),S=m(),he=r("li"),te=a("For Data2VecAudio, preprocessing is identical to "),ge=r("a"),Je=a("Wav2Vec2Model"),oe=a(", including feature extraction"),Ke=m(),me=r("li"),U=a("For Data2VecText, preprocessing is identical to "),_e=r("a"),ae=a("RobertaModel"),Ye=a(", including tokenization."),ve=m(),q=r("li"),Ze=a("For Data2VecVision, preprocessing is identical to "),O=r("a"),et=a("BeitModel"),tt=a(", including feature extraction."),D=m(),A=r("li"),Tt=a(`To know how a pre-trained Data2Vec vision model can be fine-tuned on the task of image classification, you can check out
`),Z=r("a"),kt=a("this notebook"),yt=a("."),M=m(),J=r("p"),$t=a("This model was contributed by "),Se=r("a"),Vt=a("edugp"),xt=a(" and "),W=r("a"),ne=a("patrickvonplaten"),Dt=a(`.
`),Oe=r("a"),se=a("sayakpaul"),Ft=a(" and "),Ie=r("a"),ot=a("Rocketknight1"),Ct=a(" contributed Data2Vec for vision in TensorFlow."),ue=m(),fe=r("p"),Xh=a("The original code (for NLP and Speech) can be found "),Wn=r("a"),Jh=a("here"),Kh=a(`.
The original code for vision can be found `),Bn=r("a"),Yh=a("here"),Zh=a("."),Yc=m(),uo=r("h2"),da=r("a"),Bl=r("span"),w(Hn.$$.fragment),em=m(),Hl=r("span"),tm=a("Data2VecTextConfig"),Zc=m(),ft=r("div"),w(Rn.$$.fragment),om=m(),Kt=r("p"),am=a("This is the configuration class to store the configuration of a "),Ci=r("a"),nm=a("Data2VecTextModel"),sm=a(" and "),Ai=r("a"),rm=a("Data2VecTextModel"),im=a(`. It
is used to instantiate a Data2VecText model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the Data2VecText
`),Gn=r("a"),lm=a("facebook/data2vec-text-base"),dm=a(" architecture."),cm=m(),fo=r("p"),pm=a("Configuration objects inherit from "),Mi=r("a"),hm=a("PretrainedConfig"),mm=a(` and can be used to control the model outputs. Read the
documentation from `),ji=r("a"),um=a("PretrainedConfig"),fm=a(" for more information."),gm=m(),w(ca.$$.fragment),ep=m(),go=r("h2"),pa=r("a"),Rl=r("span"),w(Qn.$$.fragment),_m=m(),Gl=r("span"),vm=a("Data2VecAudioConfig"),tp=m(),gt=r("div"),w(Un.$$.fragment),bm=m(),_o=r("p"),wm=a("This is the configuration class to store the configuration of a "),Ei=r("a"),Tm=a("Data2VecAudioModel"),km=a(`. It is used to instantiate
an Data2VecAudio model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the Data2VecAudio
`),Xn=r("a"),ym=a("facebook/data2vec-audio-base-960h"),$m=a(" architecture."),Vm=m(),vo=r("p"),xm=a("Configuration objects inherit from "),qi=r("a"),Dm=a("PretrainedConfig"),Fm=a(` and can be used to control the model outputs. Read the
documentation from `),Pi=r("a"),Cm=a("PretrainedConfig"),Am=a(" for more information."),Mm=m(),w(ha.$$.fragment),op=m(),bo=r("h2"),ma=r("a"),Ql=r("span"),w(Jn.$$.fragment),jm=m(),Ul=r("span"),Em=a("Data2VecVisionConfig"),ap=m(),Yt=r("div"),w(Kn.$$.fragment),qm=m(),wo=r("p"),Pm=a("This is the configuration class to store the configuration of a "),zi=r("a"),zm=a("Data2VecVisionModel"),Sm=a(`. It is used to instantiate
an Data2VecVision model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the Data2VecVision
`),Yn=r("a"),Om=a("facebook/data2vec-vision-base"),Im=a(" architecture."),Lm=m(),w(ua.$$.fragment),np=m(),To=r("h2"),fa=r("a"),Xl=r("span"),w(Zn.$$.fragment),Nm=m(),Jl=r("span"),Wm=a("Data2VecAudioModel"),sp=m(),at=r("div"),w(es.$$.fragment),Bm=m(),ts=r("p"),Hm=a(`The bare Data2VecAudio Model transformer outputting raw hidden-states without any specific head on top.
Data2VecAudio was proposed in `),os=r("a"),Rm=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),Gm=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),Qm=m(),as=r("p"),Um=a("This model inherits from "),Si=r("a"),Xm=a("PreTrainedModel"),Jm=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Km=m(),ns=r("p"),Ym=a("This model is a PyTorch "),ss=r("a"),Zm=a("torch.nn.Module"),eu=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),tu=m(),At=r("div"),w(rs.$$.fragment),ou=m(),ko=r("p"),au=a("The "),Oi=r("a"),nu=a("Data2VecAudioModel"),su=a(" forward method, overrides the "),Kl=r("code"),ru=a("__call__"),iu=a(" special method."),lu=m(),w(ga.$$.fragment),du=m(),w(_a.$$.fragment),rp=m(),yo=r("h2"),va=r("a"),Yl=r("span"),w(is.$$.fragment),cu=m(),Zl=r("span"),pu=a("Data2VecAudioForAudioFrameClassification"),ip=m(),Te=r("div"),w(ls.$$.fragment),hu=m(),ed=r("p"),mu=a("Data2VecAudio Model with a frame classification head on top for tasks like Speaker Diarization."),uu=m(),ds=r("p"),fu=a("Data2VecAudio was proposed in "),cs=r("a"),gu=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),_u=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),vu=m(),ps=r("p"),bu=a("This model inherits from "),Ii=r("a"),wu=a("PreTrainedModel"),Tu=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),ku=m(),hs=r("p"),yu=a("This model is a PyTorch "),ms=r("a"),$u=a("torch.nn.Module"),Vu=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),xu=m(),Mt=r("div"),w(us.$$.fragment),Du=m(),$o=r("p"),Fu=a("The "),Li=r("a"),Cu=a("Data2VecAudioForAudioFrameClassification"),Au=a(" forward method, overrides the "),td=r("code"),Mu=a("__call__"),ju=a(" special method."),Eu=m(),w(ba.$$.fragment),qu=m(),w(wa.$$.fragment),lp=m(),Vo=r("h2"),Ta=r("a"),od=r("span"),w(fs.$$.fragment),Pu=m(),ad=r("span"),zu=a("Data2VecAudioForCTC"),dp=m(),nt=r("div"),w(gs.$$.fragment),Su=m(),xo=r("p"),Ou=a("Data2VecAudio Model with a "),nd=r("code"),Iu=a("language modeling"),Lu=a(` head on top for Connectionist Temporal Classification (CTC).
Data2VecAudio was proposed in `),_s=r("a"),Nu=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),Wu=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),Bu=m(),vs=r("p"),Hu=a("This model inherits from "),Ni=r("a"),Ru=a("PreTrainedModel"),Gu=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Qu=m(),bs=r("p"),Uu=a("This model is a PyTorch "),ws=r("a"),Xu=a("torch.nn.Module"),Ju=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ku=m(),lt=r("div"),w(Ts.$$.fragment),Yu=m(),Do=r("p"),Zu=a("The "),Wi=r("a"),ef=a("Data2VecAudioForCTC"),tf=a(" forward method, overrides the "),sd=r("code"),of=a("__call__"),af=a(" special method."),nf=m(),w(ka.$$.fragment),sf=m(),w(ya.$$.fragment),rf=m(),w($a.$$.fragment),cp=m(),Fo=r("h2"),Va=r("a"),rd=r("span"),w(ks.$$.fragment),lf=m(),id=r("span"),df=a("Data2VecAudioForSequenceClassification"),pp=m(),ke=r("div"),w(ys.$$.fragment),cf=m(),ld=r("p"),pf=a(`Data2VecAudio Model with a sequence classification head on top (a linear layer over the pooled output) for tasks
like SUPERB Keyword Spotting.`),hf=m(),$s=r("p"),mf=a("Data2VecAudio was proposed in "),Vs=r("a"),uf=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),ff=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),gf=m(),xs=r("p"),_f=a("This model inherits from "),Bi=r("a"),vf=a("PreTrainedModel"),bf=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),wf=m(),Ds=r("p"),Tf=a("This model is a PyTorch "),Fs=r("a"),kf=a("torch.nn.Module"),yf=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),$f=m(),dt=r("div"),w(Cs.$$.fragment),Vf=m(),Co=r("p"),xf=a("The "),Hi=r("a"),Df=a("Data2VecAudioForSequenceClassification"),Ff=a(" forward method, overrides the "),dd=r("code"),Cf=a("__call__"),Af=a(" special method."),Mf=m(),w(xa.$$.fragment),jf=m(),w(Da.$$.fragment),Ef=m(),w(Fa.$$.fragment),hp=m(),Ao=r("h2"),Ca=r("a"),cd=r("span"),w(As.$$.fragment),qf=m(),pd=r("span"),Pf=a("Data2VecAudioForXVector"),mp=m(),ye=r("div"),w(Ms.$$.fragment),zf=m(),hd=r("p"),Sf=a("Data2VecAudio Model with an XVector feature extraction head on top for tasks like Speaker Verification."),Of=m(),js=r("p"),If=a("Data2VecAudio was proposed in "),Es=r("a"),Lf=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),Nf=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),Wf=m(),qs=r("p"),Bf=a("This model inherits from "),Ri=r("a"),Hf=a("PreTrainedModel"),Rf=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Gf=m(),Ps=r("p"),Qf=a("This model is a PyTorch "),zs=r("a"),Uf=a("torch.nn.Module"),Xf=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Jf=m(),jt=r("div"),w(Ss.$$.fragment),Kf=m(),Mo=r("p"),Yf=a("The "),Gi=r("a"),Zf=a("Data2VecAudioForXVector"),eg=a(" forward method, overrides the "),md=r("code"),tg=a("__call__"),og=a(" special method."),ag=m(),w(Aa.$$.fragment),ng=m(),w(Ma.$$.fragment),up=m(),jo=r("h2"),ja=r("a"),ud=r("span"),w(Os.$$.fragment),sg=m(),fd=r("span"),rg=a("Data2VecTextModel"),fp=m(),re=r("div"),w(Is.$$.fragment),ig=m(),Ls=r("p"),lg=a(`The bare Data2VecText Model for text transformer outputting raw hidden-states without any specific head on top.
Data2VecText was proposed in `),Ns=r("a"),dg=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),cg=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),pg=m(),Ws=r("p"),hg=a("This model inherits from "),Qi=r("a"),mg=a("PreTrainedModel"),ug=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),fg=m(),Bs=r("p"),gg=a("This model is also a PyTorch "),Hs=r("a"),_g=a("torch.nn.Module"),vg=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),bg=m(),Rs=r("p"),wg=a(`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),gd=r("em"),Tg=a(`Attention is
all you need`),kg=a(`_ by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz
Kaiser and Illia Polosukhin.`),yg=m(),$e=r("p"),$g=a("To behave as an decoder the model needs to be initialized with the "),_d=r("code"),Vg=a("is_decoder"),xg=a(` argument of the configuration set
to `),vd=r("code"),Dg=a("True"),Fg=a(". To be used in a Seq2Seq model, the model needs to initialized with both "),bd=r("code"),Cg=a("is_decoder"),Ag=a(` argument and
`),wd=r("code"),Mg=a("add_cross_attention"),jg=a(" set to "),Td=r("code"),Eg=a("True"),qg=a("; an "),kd=r("code"),Pg=a("encoder_hidden_states"),zg=a(" is then expected as an input to the forward pass."),Sg=m(),Ea=r("p"),Og=a(".. _"),yd=r("em"),Ig=a("Attention is all you need"),Lg=a(": "),Gs=r("a"),Ng=a("https://arxiv.org/abs/1706.03762"),Wg=m(),Et=r("div"),w(Qs.$$.fragment),Bg=m(),Eo=r("p"),Hg=a("The "),Ui=r("a"),Rg=a("Data2VecTextModel"),Gg=a(" forward method, overrides the "),$d=r("code"),Qg=a("__call__"),Ug=a(" special method."),Xg=m(),w(qa.$$.fragment),Jg=m(),w(Pa.$$.fragment),gp=m(),qo=r("h2"),za=r("a"),Vd=r("span"),w(Us.$$.fragment),Kg=m(),xd=r("span"),Yg=a("Data2VecTextForCausalLM"),_p=m(),st=r("div"),w(Xs.$$.fragment),Zg=m(),Po=r("p"),e_=a("Data2VecText Model with a "),Dd=r("code"),t_=a("language modeling"),o_=a(` head on top for CLM fine-tuning.
Data2VecText was proposed in `),Js=r("a"),a_=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),n_=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),s_=m(),Ks=r("p"),r_=a("This model inherits from "),Xi=r("a"),i_=a("PreTrainedModel"),l_=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),d_=m(),Ys=r("p"),c_=a("This model is also a PyTorch "),Zs=r("a"),p_=a("torch.nn.Module"),h_=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),m_=m(),qt=r("div"),w(er.$$.fragment),u_=m(),zo=r("p"),f_=a("The "),Ji=r("a"),g_=a("Data2VecTextForCausalLM"),__=a(" forward method, overrides the "),Fd=r("code"),v_=a("__call__"),b_=a(" special method."),w_=m(),w(Sa.$$.fragment),T_=m(),w(Oa.$$.fragment),vp=m(),So=r("h2"),Ia=r("a"),Cd=r("span"),w(tr.$$.fragment),k_=m(),Ad=r("span"),y_=a("Data2VecTextForMaskedLM"),bp=m(),rt=r("div"),w(or.$$.fragment),$_=m(),Oo=r("p"),V_=a("data2vec Model with a "),Md=r("code"),x_=a("language modeling"),D_=a(` head on top.
Data2VecText was proposed in `),ar=r("a"),F_=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),C_=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),A_=m(),nr=r("p"),M_=a("This model inherits from "),Ki=r("a"),j_=a("PreTrainedModel"),E_=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),q_=m(),sr=r("p"),P_=a("This model is also a PyTorch "),rr=r("a"),z_=a("torch.nn.Module"),S_=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),O_=m(),ct=r("div"),w(ir.$$.fragment),I_=m(),Io=r("p"),L_=a("The "),Yi=r("a"),N_=a("Data2VecTextForMaskedLM"),W_=a(" forward method, overrides the "),jd=r("code"),B_=a("__call__"),H_=a(" special method."),R_=m(),w(La.$$.fragment),G_=m(),w(Na.$$.fragment),Q_=m(),w(Wa.$$.fragment),wp=m(),Lo=r("h2"),Ba=r("a"),Ed=r("span"),w(lr.$$.fragment),U_=m(),qd=r("span"),X_=a("Data2VecTextForSequenceClassification"),Tp=m(),Ve=r("div"),w(dr.$$.fragment),J_=m(),Pd=r("p"),K_=a(`Data2VecText Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),Y_=m(),cr=r("p"),Z_=a("Data2VecText was proposed in "),pr=r("a"),e2=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),t2=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),o2=m(),hr=r("p"),a2=a("This model inherits from "),Zi=r("a"),n2=a("PreTrainedModel"),s2=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),r2=m(),mr=r("p"),i2=a("This model is also a PyTorch "),ur=r("a"),l2=a("torch.nn.Module"),d2=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),c2=m(),be=r("div"),w(fr.$$.fragment),p2=m(),No=r("p"),h2=a("The "),el=r("a"),m2=a("Data2VecTextForSequenceClassification"),u2=a(" forward method, overrides the "),zd=r("code"),f2=a("__call__"),g2=a(" special method."),_2=m(),w(Ha.$$.fragment),v2=m(),w(Ra.$$.fragment),b2=m(),w(Ga.$$.fragment),w2=m(),w(Qa.$$.fragment),T2=m(),w(Ua.$$.fragment),kp=m(),Wo=r("h2"),Xa=r("a"),Sd=r("span"),w(gr.$$.fragment),k2=m(),Od=r("span"),y2=a("Data2VecTextForMultipleChoice"),yp=m(),xe=r("div"),w(_r.$$.fragment),$2=m(),Id=r("p"),V2=a(`Data2VecText Model with a multiple choice classification head on top (a linear layer on top of the pooled output
and a softmax) e.g. for RocStories/SWAG tasks.`),x2=m(),vr=r("p"),D2=a("Data2VecText was proposed in "),br=r("a"),F2=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),C2=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),A2=m(),wr=r("p"),M2=a("This model inherits from "),tl=r("a"),j2=a("PreTrainedModel"),E2=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),q2=m(),Tr=r("p"),P2=a("This model is also a PyTorch "),kr=r("a"),z2=a("torch.nn.Module"),S2=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),O2=m(),Pt=r("div"),w(yr.$$.fragment),I2=m(),Bo=r("p"),L2=a("The "),ol=r("a"),N2=a("Data2VecTextForMultipleChoice"),W2=a(" forward method, overrides the "),Ld=r("code"),B2=a("__call__"),H2=a(" special method."),R2=m(),w(Ja.$$.fragment),G2=m(),w(Ka.$$.fragment),$p=m(),Ho=r("h2"),Ya=r("a"),Nd=r("span"),w($r.$$.fragment),Q2=m(),Wd=r("span"),U2=a("Data2VecTextForTokenClassification"),Vp=m(),De=r("div"),w(Vr.$$.fragment),X2=m(),Bd=r("p"),J2=a(`Data2VecText Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g.
for Named-Entity-Recognition (NER) tasks.`),K2=m(),xr=r("p"),Y2=a("Data2VecText was proposed in "),Dr=r("a"),Z2=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),ev=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),tv=m(),Fr=r("p"),ov=a("This model inherits from "),al=r("a"),av=a("PreTrainedModel"),nv=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),sv=m(),Cr=r("p"),rv=a("This model is also a PyTorch "),Ar=r("a"),iv=a("torch.nn.Module"),lv=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),dv=m(),pt=r("div"),w(Mr.$$.fragment),cv=m(),Ro=r("p"),pv=a("The "),nl=r("a"),hv=a("Data2VecTextForTokenClassification"),mv=a(" forward method, overrides the "),Hd=r("code"),uv=a("__call__"),fv=a(" special method."),gv=m(),w(Za.$$.fragment),_v=m(),w(en.$$.fragment),vv=m(),w(tn.$$.fragment),xp=m(),Go=r("h2"),on=r("a"),Rd=r("span"),w(jr.$$.fragment),bv=m(),Gd=r("span"),wv=a("Data2VecTextForQuestionAnswering"),Dp=m(),Fe=r("div"),w(Er.$$.fragment),Tv=m(),Qo=r("p"),kv=a(`Data2VecText Model with a span classification head on top for extractive question-answering tasks like SQuAD (a
linear layers on top of the hidden-states output to compute `),Qd=r("code"),yv=a("span start logits"),$v=a(" and "),Ud=r("code"),Vv=a("span end logits"),xv=a(")."),Dv=m(),qr=r("p"),Fv=a("Data2VecText was proposed in "),Pr=r("a"),Cv=a(`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),Av=a(` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),Mv=m(),zr=r("p"),jv=a("This model inherits from "),sl=r("a"),Ev=a("PreTrainedModel"),qv=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Pv=m(),Sr=r("p"),zv=a("This model is also a PyTorch "),Or=r("a"),Sv=a("torch.nn.Module"),Ov=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Iv=m(),ht=r("div"),w(Ir.$$.fragment),Lv=m(),Uo=r("p"),Nv=a("The "),rl=r("a"),Wv=a("Data2VecTextForQuestionAnswering"),Bv=a(" forward method, overrides the "),Xd=r("code"),Hv=a("__call__"),Rv=a(" special method."),Gv=m(),w(an.$$.fragment),Qv=m(),w(nn.$$.fragment),Uv=m(),w(sn.$$.fragment),Fp=m(),Xo=r("h2"),rn=r("a"),Jd=r("span"),w(Lr.$$.fragment),Xv=m(),Kd=r("span"),Jv=a("Data2VecVisionModel"),Cp=m(),Zt=r("div"),w(Nr.$$.fragment),Kv=m(),Wr=r("p"),Yv=a(`The bare Data2VecVision Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Br=r("a"),Zv=a("torch.nn.Module"),eb=a(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),tb=m(),zt=r("div"),w(Hr.$$.fragment),ob=m(),Jo=r("p"),ab=a("The "),il=r("a"),nb=a("Data2VecVisionModel"),sb=a(" forward method, overrides the "),Yd=r("code"),rb=a("__call__"),ib=a(" special method."),lb=m(),w(ln.$$.fragment),db=m(),w(dn.$$.fragment),Ap=m(),Ko=r("h2"),cn=r("a"),Zd=r("span"),w(Rr.$$.fragment),cb=m(),ec=r("span"),pb=a("Data2VecVisionForImageClassification"),Mp=m(),_t=r("div"),w(Gr.$$.fragment),hb=m(),tc=r("p"),mb=a(`Data2VecVision Model transformer with an image classification head on top (a linear layer on top of the average of
the final hidden states of the patch tokens) e.g. for ImageNet.`),ub=m(),Qr=r("p"),fb=a("This model is a PyTorch "),Ur=r("a"),gb=a("torch.nn.Module"),_b=a(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),vb=m(),St=r("div"),w(Xr.$$.fragment),bb=m(),Yo=r("p"),wb=a("The "),ll=r("a"),Tb=a("Data2VecVisionForImageClassification"),kb=a(" forward method, overrides the "),oc=r("code"),yb=a("__call__"),$b=a(" special method."),Vb=m(),w(pn.$$.fragment),xb=m(),w(hn.$$.fragment),jp=m(),Zo=r("h2"),mn=r("a"),ac=r("span"),w(Jr.$$.fragment),Db=m(),nc=r("span"),Fb=a("Data2VecVisionForSemanticSegmentation"),Ep=m(),vt=r("div"),w(Kr.$$.fragment),Cb=m(),sc=r("p"),Ab=a("Data2VecVision Model transformer with a semantic segmentation head on top e.g. for ADE20k, CityScapes."),Mb=m(),Yr=r("p"),jb=a("This model is a PyTorch "),Zr=r("a"),Eb=a("torch.nn.Module"),qb=a(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Pb=m(),Ot=r("div"),w(ei.$$.fragment),zb=m(),ea=r("p"),Sb=a("The "),dl=r("a"),Ob=a("Data2VecVisionForSemanticSegmentation"),Ib=a(" forward method, overrides the "),rc=r("code"),Lb=a("__call__"),Nb=a(" special method."),Wb=m(),w(un.$$.fragment),Bb=m(),w(fn.$$.fragment),qp=m(),ta=r("h2"),gn=r("a"),ic=r("span"),w(ti.$$.fragment),Hb=m(),lc=r("span"),Rb=a("TFData2VecVisionModel"),Pp=m(),it=r("div"),w(oi.$$.fragment),Gb=m(),ai=r("p"),Qb=a(`The bare Data2VecVision Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),cl=r("a"),Ub=a("TFPreTrainedModel"),Xb=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.).`),Jb=m(),ni=r("p"),Kb=a("This model is also a "),si=r("a"),Yb=a("tf.keras.Model"),Zb=a(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),ew=m(),w(_n.$$.fragment),tw=m(),It=r("div"),w(ri.$$.fragment),ow=m(),oa=r("p"),aw=a("The "),pl=r("a"),nw=a("TFData2VecVisionModel"),sw=a(" forward method, overrides the "),dc=r("code"),rw=a("__call__"),iw=a(" special method."),lw=m(),w(vn.$$.fragment),dw=m(),w(bn.$$.fragment),zp=m(),aa=r("h2"),wn=r("a"),cc=r("span"),w(ii.$$.fragment),cw=m(),pc=r("span"),pw=a("TFData2VecVisionForImageClassification"),Sp=m(),Ce=r("div"),w(li.$$.fragment),hw=m(),hc=r("p"),mw=a(`Data2VecVision Model transformer with an image classification head on top (a linear layer on top of the average of
the final hidden states of the patch tokens) e.g. for ImageNet.`),uw=m(),di=r("p"),fw=a("This model inherits from "),hl=r("a"),gw=a("TFPreTrainedModel"),_w=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.).`),vw=m(),ci=r("p"),bw=a("This model is also a "),pi=r("a"),ww=a("tf.keras.Model"),Tw=a(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),kw=m(),w(Tn.$$.fragment),yw=m(),Lt=r("div"),w(hi.$$.fragment),$w=m(),na=r("p"),Vw=a("The "),ml=r("a"),xw=a("TFData2VecVisionForImageClassification"),Dw=a(" forward method, overrides the "),mc=r("code"),Fw=a("__call__"),Cw=a(" special method."),Aw=m(),w(kn.$$.fragment),Mw=m(),w(yn.$$.fragment),Op=m(),sa=r("h2"),$n=r("a"),uc=r("span"),w(mi.$$.fragment),jw=m(),fc=r("span"),Ew=a("TFData2VecVisionForSemanticSegmentation"),Ip=m(),Ae=r("div"),w(ui.$$.fragment),qw=m(),gc=r("p"),Pw=a("Data2VecVision Model transformer with a semantic segmentation head on top e.g. for ADE20k, CityScapes."),zw=m(),fi=r("p"),Sw=a("This model inherits from "),ul=r("a"),Ow=a("TFPreTrainedModel"),Iw=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.).`),Lw=m(),gi=r("p"),Nw=a("This model is also a "),_i=r("a"),Ww=a("tf.keras.Model"),Bw=a(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Hw=m(),w(Vn.$$.fragment),Rw=m(),Nt=r("div"),w(vi.$$.fragment),Gw=m(),ra=r("p"),Qw=a("The "),fl=r("a"),Uw=a("TFData2VecVisionForSemanticSegmentation"),Xw=a(" forward method, overrides the "),_c=r("code"),Jw=a("__call__"),Kw=a(" special method."),Yw=m(),w(xn.$$.fragment),Zw=m(),w(Dn.$$.fragment),this.h()},l(o){const _=dy('[data-svelte="svelte-1phssyn"]',document.head);d=i(_,"META",{name:!0,content:!0}),_.forEach(t),g=u(o),c=i(o,"H1",{class:!0});var bi=l(c);h=i(bi,"A",{id:!0,class:!0,href:!0});var vc=l(h);v=i(vc,"SPAN",{});var bc=l(v);T(s.$$.fragment,bc),bc.forEach(t),vc.forEach(t),p=u(bi),F=i(bi,"SPAN",{});var wc=l(F);Ne=n(wc,"Data2Vec"),wc.forEach(t),bi.forEach(t),Me=u(o),B=i(o,"H2",{class:!0});var wi=l(B);le=i(wi,"A",{id:!0,class:!0,href:!0});var Tc=l(le);de=i(Tc,"SPAN",{});var kc=l(de);T(C.$$.fragment,kc),kc.forEach(t),Tc.forEach(t),We=u(wi),X=i(wi,"SPAN",{});var yc=l(X);Be=n(yc,"Overview"),yc.forEach(t),wi.forEach(t),je=u(o),H=i(o,"P",{});var Ti=l(H);He=n(Ti,"The Data2Vec model was proposed in "),ce=i(Ti,"A",{href:!0,rel:!0});var $c=l(ce);ee=n($c,"data2vec: A General Framework for Self-supervised Learning in Speech, Vision and Language"),$c.forEach(t),Re=n(Ti,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and Michael Auli.
Data2Vec proposes a unified framework for self-supervised learning across different data modalities - text, audio and images.
Importantly, predicted targets for pre-training are contextualized latent representations of the inputs, rather than modality-specific, context-independent targets.`),Ti.forEach(t),Ee=u(o),R=i(o,"P",{});var Vc=l(R);Ge=n(Vc,"The abstract from the paper is the following:"),Vc.forEach(t),qe=u(o),G=i(o,"P",{});var xc=l(G);pe=i(xc,"EM",{});var ki=l(pe);Qe=n(ki,`While the general idea of self-supervised learning is identical across modalities, the actual algorithms and
objectives differ widely because they were developed with a single modality in mind. To get us closer to general
self-supervised learning, we present data2vec, a framework that uses the same learning method for either speech,
NLP or computer vision. The core idea is to predict latent representations of the full input data based on a
masked view of the input in a selfdistillation setup using a standard Transformer architecture.
Instead of predicting modality-specific targets such as words, visual tokens or units of human speech which
are local in nature, data2vec predicts contextualized latent representations that contain information from
the entire input. Experiments on the major benchmarks of speech recognition, image classification, and
natural language understanding demonstrate a new state of the art or competitive performance to predominant approaches.
Models and code are available at `),Y=i(ki,"A",{href:!0,rel:!0});var Dc=l(Y);E=n(Dc,"www.github.com/pytorch/fairseq/tree/master/examples/data2vec"),Dc.forEach(t),z=n(ki,"."),ki.forEach(t),xc.forEach(t),Pe=u(o),Q=i(o,"P",{});var Fc=l(Q);Ue=n(Fc,"Tips:"),Fc.forEach(t),ze=u(o),P=i(o,"UL",{});var bt=l(P);we=i(bt,"LI",{});var Cc=l(we);Xe=n(Cc,"Data2VecAudio, Data2VecText, and Data2VecVision have all been trained using the same self-supervised learning method."),Cc.forEach(t),S=u(bt),he=i(bt,"LI",{});var yi=l(he);te=n(yi,"For Data2VecAudio, preprocessing is identical to "),ge=i(yi,"A",{href:!0});var Ac=l(ge);Je=n(Ac,"Wav2Vec2Model"),Ac.forEach(t),oe=n(yi,", including feature extraction"),yi.forEach(t),Ke=u(bt),me=i(bt,"LI",{});var $i=l(me);U=n($i,"For Data2VecText, preprocessing is identical to "),_e=i($i,"A",{href:!0});var Mc=l(_e);ae=n(Mc,"RobertaModel"),Mc.forEach(t),Ye=n($i,", including tokenization."),$i.forEach(t),ve=u(bt),q=i(bt,"LI",{});var Vi=l(q);Ze=n(Vi,"For Data2VecVision, preprocessing is identical to "),O=i(Vi,"A",{href:!0});var jc=l(O);et=n(jc,"BeitModel"),jc.forEach(t),tt=n(Vi,", including feature extraction."),Vi.forEach(t),D=u(bt),A=i(bt,"LI",{});var xi=l(A);Tt=n(xi,`To know how a pre-trained Data2Vec vision model can be fine-tuned on the task of image classification, you can check out
`),Z=i(xi,"A",{href:!0,rel:!0});var Ec=l(Z);kt=n(Ec,"this notebook"),Ec.forEach(t),yt=n(xi,"."),xi.forEach(t),bt.forEach(t),M=u(o),J=i(o,"P",{});var wt=l(J);$t=n(wt,"This model was contributed by "),Se=i(wt,"A",{href:!0,rel:!0});var qc=l(Se);Vt=n(qc,"edugp"),qc.forEach(t),xt=n(wt," and "),W=i(wt,"A",{href:!0,rel:!0});var Pc=l(W);ne=n(Pc,"patrickvonplaten"),Pc.forEach(t),Dt=n(wt,`.
`),Oe=i(wt,"A",{href:!0,rel:!0});var zc=l(Oe);se=n(zc,"sayakpaul"),zc.forEach(t),Ft=n(wt," and "),Ie=i(wt,"A",{href:!0,rel:!0});var Sc=l(Ie);ot=n(Sc,"Rocketknight1"),Sc.forEach(t),Ct=n(wt," contributed Data2Vec for vision in TensorFlow."),wt.forEach(t),ue=u(o),fe=i(o,"P",{});var ia=l(fe);Xh=n(ia,"The original code (for NLP and Speech) can be found "),Wn=i(ia,"A",{href:!0,rel:!0});var Oc=l(Wn);Jh=n(Oc,"here"),Oc.forEach(t),Kh=n(ia,`.
The original code for vision can be found `),Bn=i(ia,"A",{href:!0,rel:!0});var Ic=l(Bn);Yh=n(Ic,"here"),Ic.forEach(t),Zh=n(ia,"."),ia.forEach(t),Yc=u(o),uo=i(o,"H2",{class:!0});var Di=l(uo);da=i(Di,"A",{id:!0,class:!0,href:!0});var Lc=l(da);Bl=i(Lc,"SPAN",{});var Nc=l(Bl);T(Hn.$$.fragment,Nc),Nc.forEach(t),Lc.forEach(t),em=u(Di),Hl=i(Di,"SPAN",{});var Wc=l(Hl);tm=n(Wc,"Data2VecTextConfig"),Wc.forEach(t),Di.forEach(t),Zc=u(o),ft=i(o,"DIV",{class:!0});var eo=l(ft);T(Rn.$$.fragment,eo),om=u(eo),Kt=i(eo,"P",{});var to=l(Kt);am=n(to,"This is the configuration class to store the configuration of a "),Ci=i(to,"A",{href:!0});var Bc=l(Ci);nm=n(Bc,"Data2VecTextModel"),Bc.forEach(t),sm=n(to," and "),Ai=i(to,"A",{href:!0});var Hc=l(Ai);rm=n(Hc,"Data2VecTextModel"),Hc.forEach(t),im=n(to,`. It
is used to instantiate a Data2VecText model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the Data2VecText
`),Gn=i(to,"A",{href:!0,rel:!0});var Rc=l(Gn);lm=n(Rc,"facebook/data2vec-text-base"),Rc.forEach(t),dm=n(to," architecture."),to.forEach(t),cm=u(eo),fo=i(eo,"P",{});var la=l(fo);pm=n(la,"Configuration objects inherit from "),Mi=i(la,"A",{href:!0});var Gc=l(Mi);hm=n(Gc,"PretrainedConfig"),Gc.forEach(t),mm=n(la,` and can be used to control the model outputs. Read the
documentation from `),ji=i(la,"A",{href:!0});var Qc=l(ji);um=n(Qc,"PretrainedConfig"),Qc.forEach(t),fm=n(la," for more information."),la.forEach(t),gm=u(eo),T(ca.$$.fragment,eo),eo.forEach(t),ep=u(o),go=i(o,"H2",{class:!0});var Fi=l(go);pa=i(Fi,"A",{id:!0,class:!0,href:!0});var Uc=l(pa);Rl=i(Uc,"SPAN",{});var Xc=l(Rl);T(Qn.$$.fragment,Xc),Xc.forEach(t),Uc.forEach(t),_m=u(Fi),Gl=i(Fi,"SPAN",{});var Jc=l(Gl);vm=n(Jc,"Data2VecAudioConfig"),Jc.forEach(t),Fi.forEach(t),tp=u(o),gt=i(o,"DIV",{class:!0});var oo=l(gt);T(Un.$$.fragment,oo),bm=u(oo),_o=i(oo,"P",{});var gl=l(_o);wm=n(gl,"This is the configuration class to store the configuration of a "),Ei=i(gl,"A",{href:!0});var e1=l(Ei);Tm=n(e1,"Data2VecAudioModel"),e1.forEach(t),km=n(gl,`. It is used to instantiate
an Data2VecAudio model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the Data2VecAudio
`),Xn=i(gl,"A",{href:!0,rel:!0});var t1=l(Xn);ym=n(t1,"facebook/data2vec-audio-base-960h"),t1.forEach(t),$m=n(gl," architecture."),gl.forEach(t),Vm=u(oo),vo=i(oo,"P",{});var _l=l(vo);xm=n(_l,"Configuration objects inherit from "),qi=i(_l,"A",{href:!0});var o1=l(qi);Dm=n(o1,"PretrainedConfig"),o1.forEach(t),Fm=n(_l,` and can be used to control the model outputs. Read the
documentation from `),Pi=i(_l,"A",{href:!0});var a1=l(Pi);Cm=n(a1,"PretrainedConfig"),a1.forEach(t),Am=n(_l," for more information."),_l.forEach(t),Mm=u(oo),T(ha.$$.fragment,oo),oo.forEach(t),op=u(o),bo=i(o,"H2",{class:!0});var Np=l(bo);ma=i(Np,"A",{id:!0,class:!0,href:!0});var n1=l(ma);Ql=i(n1,"SPAN",{});var s1=l(Ql);T(Jn.$$.fragment,s1),s1.forEach(t),n1.forEach(t),jm=u(Np),Ul=i(Np,"SPAN",{});var r1=l(Ul);Em=n(r1,"Data2VecVisionConfig"),r1.forEach(t),Np.forEach(t),ap=u(o),Yt=i(o,"DIV",{class:!0});var vl=l(Yt);T(Kn.$$.fragment,vl),qm=u(vl),wo=i(vl,"P",{});var bl=l(wo);Pm=n(bl,"This is the configuration class to store the configuration of a "),zi=i(bl,"A",{href:!0});var i1=l(zi);zm=n(i1,"Data2VecVisionModel"),i1.forEach(t),Sm=n(bl,`. It is used to instantiate
an Data2VecVision model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the Data2VecVision
`),Yn=i(bl,"A",{href:!0,rel:!0});var l1=l(Yn);Om=n(l1,"facebook/data2vec-vision-base"),l1.forEach(t),Im=n(bl," architecture."),bl.forEach(t),Lm=u(vl),T(ua.$$.fragment,vl),vl.forEach(t),np=u(o),To=i(o,"H2",{class:!0});var Wp=l(To);fa=i(Wp,"A",{id:!0,class:!0,href:!0});var d1=l(fa);Xl=i(d1,"SPAN",{});var c1=l(Xl);T(Zn.$$.fragment,c1),c1.forEach(t),d1.forEach(t),Nm=u(Wp),Jl=i(Wp,"SPAN",{});var p1=l(Jl);Wm=n(p1,"Data2VecAudioModel"),p1.forEach(t),Wp.forEach(t),sp=u(o),at=i(o,"DIV",{class:!0});var ao=l(at);T(es.$$.fragment,ao),Bm=u(ao),ts=i(ao,"P",{});var Bp=l(ts);Hm=n(Bp,`The bare Data2VecAudio Model transformer outputting raw hidden-states without any specific head on top.
Data2VecAudio was proposed in `),os=i(Bp,"A",{href:!0,rel:!0});var h1=l(os);Rm=n(h1,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),h1.forEach(t),Gm=n(Bp,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),Bp.forEach(t),Qm=u(ao),as=i(ao,"P",{});var Hp=l(as);Um=n(Hp,"This model inherits from "),Si=i(Hp,"A",{href:!0});var m1=l(Si);Xm=n(m1,"PreTrainedModel"),m1.forEach(t),Jm=n(Hp,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Hp.forEach(t),Km=u(ao),ns=i(ao,"P",{});var Rp=l(ns);Ym=n(Rp,"This model is a PyTorch "),ss=i(Rp,"A",{href:!0,rel:!0});var u1=l(ss);Zm=n(u1,"torch.nn.Module"),u1.forEach(t),eu=n(Rp,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Rp.forEach(t),tu=u(ao),At=i(ao,"DIV",{class:!0});var Fn=l(At);T(rs.$$.fragment,Fn),ou=u(Fn),ko=i(Fn,"P",{});var wl=l(ko);au=n(wl,"The "),Oi=i(wl,"A",{href:!0});var f1=l(Oi);nu=n(f1,"Data2VecAudioModel"),f1.forEach(t),su=n(wl," forward method, overrides the "),Kl=i(wl,"CODE",{});var g1=l(Kl);ru=n(g1,"__call__"),g1.forEach(t),iu=n(wl," special method."),wl.forEach(t),lu=u(Fn),T(ga.$$.fragment,Fn),du=u(Fn),T(_a.$$.fragment,Fn),Fn.forEach(t),ao.forEach(t),rp=u(o),yo=i(o,"H2",{class:!0});var Gp=l(yo);va=i(Gp,"A",{id:!0,class:!0,href:!0});var _1=l(va);Yl=i(_1,"SPAN",{});var v1=l(Yl);T(is.$$.fragment,v1),v1.forEach(t),_1.forEach(t),cu=u(Gp),Zl=i(Gp,"SPAN",{});var b1=l(Zl);pu=n(b1,"Data2VecAudioForAudioFrameClassification"),b1.forEach(t),Gp.forEach(t),ip=u(o),Te=i(o,"DIV",{class:!0});var Wt=l(Te);T(ls.$$.fragment,Wt),hu=u(Wt),ed=i(Wt,"P",{});var w1=l(ed);mu=n(w1,"Data2VecAudio Model with a frame classification head on top for tasks like Speaker Diarization."),w1.forEach(t),uu=u(Wt),ds=i(Wt,"P",{});var Qp=l(ds);fu=n(Qp,"Data2VecAudio was proposed in "),cs=i(Qp,"A",{href:!0,rel:!0});var T1=l(cs);gu=n(T1,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),T1.forEach(t),_u=n(Qp,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),Qp.forEach(t),vu=u(Wt),ps=i(Wt,"P",{});var Up=l(ps);bu=n(Up,"This model inherits from "),Ii=i(Up,"A",{href:!0});var k1=l(Ii);wu=n(k1,"PreTrainedModel"),k1.forEach(t),Tu=n(Up,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Up.forEach(t),ku=u(Wt),hs=i(Wt,"P",{});var Xp=l(hs);yu=n(Xp,"This model is a PyTorch "),ms=i(Xp,"A",{href:!0,rel:!0});var y1=l(ms);$u=n(y1,"torch.nn.Module"),y1.forEach(t),Vu=n(Xp,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Xp.forEach(t),xu=u(Wt),Mt=i(Wt,"DIV",{class:!0});var Cn=l(Mt);T(us.$$.fragment,Cn),Du=u(Cn),$o=i(Cn,"P",{});var Tl=l($o);Fu=n(Tl,"The "),Li=i(Tl,"A",{href:!0});var $1=l(Li);Cu=n($1,"Data2VecAudioForAudioFrameClassification"),$1.forEach(t),Au=n(Tl," forward method, overrides the "),td=i(Tl,"CODE",{});var V1=l(td);Mu=n(V1,"__call__"),V1.forEach(t),ju=n(Tl," special method."),Tl.forEach(t),Eu=u(Cn),T(ba.$$.fragment,Cn),qu=u(Cn),T(wa.$$.fragment,Cn),Cn.forEach(t),Wt.forEach(t),lp=u(o),Vo=i(o,"H2",{class:!0});var Jp=l(Vo);Ta=i(Jp,"A",{id:!0,class:!0,href:!0});var x1=l(Ta);od=i(x1,"SPAN",{});var D1=l(od);T(fs.$$.fragment,D1),D1.forEach(t),x1.forEach(t),Pu=u(Jp),ad=i(Jp,"SPAN",{});var F1=l(ad);zu=n(F1,"Data2VecAudioForCTC"),F1.forEach(t),Jp.forEach(t),dp=u(o),nt=i(o,"DIV",{class:!0});var no=l(nt);T(gs.$$.fragment,no),Su=u(no),xo=i(no,"P",{});var kl=l(xo);Ou=n(kl,"Data2VecAudio Model with a "),nd=i(kl,"CODE",{});var C1=l(nd);Iu=n(C1,"language modeling"),C1.forEach(t),Lu=n(kl,` head on top for Connectionist Temporal Classification (CTC).
Data2VecAudio was proposed in `),_s=i(kl,"A",{href:!0,rel:!0});var A1=l(_s);Nu=n(A1,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),A1.forEach(t),Wu=n(kl,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),kl.forEach(t),Bu=u(no),vs=i(no,"P",{});var Kp=l(vs);Hu=n(Kp,"This model inherits from "),Ni=i(Kp,"A",{href:!0});var M1=l(Ni);Ru=n(M1,"PreTrainedModel"),M1.forEach(t),Gu=n(Kp,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Kp.forEach(t),Qu=u(no),bs=i(no,"P",{});var Yp=l(bs);Uu=n(Yp,"This model is a PyTorch "),ws=i(Yp,"A",{href:!0,rel:!0});var j1=l(ws);Xu=n(j1,"torch.nn.Module"),j1.forEach(t),Ju=n(Yp,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Yp.forEach(t),Ku=u(no),lt=i(no,"DIV",{class:!0});var so=l(lt);T(Ts.$$.fragment,so),Yu=u(so),Do=i(so,"P",{});var yl=l(Do);Zu=n(yl,"The "),Wi=i(yl,"A",{href:!0});var E1=l(Wi);ef=n(E1,"Data2VecAudioForCTC"),E1.forEach(t),tf=n(yl," forward method, overrides the "),sd=i(yl,"CODE",{});var q1=l(sd);of=n(q1,"__call__"),q1.forEach(t),af=n(yl," special method."),yl.forEach(t),nf=u(so),T(ka.$$.fragment,so),sf=u(so),T(ya.$$.fragment,so),rf=u(so),T($a.$$.fragment,so),so.forEach(t),no.forEach(t),cp=u(o),Fo=i(o,"H2",{class:!0});var Zp=l(Fo);Va=i(Zp,"A",{id:!0,class:!0,href:!0});var P1=l(Va);rd=i(P1,"SPAN",{});var z1=l(rd);T(ks.$$.fragment,z1),z1.forEach(t),P1.forEach(t),lf=u(Zp),id=i(Zp,"SPAN",{});var S1=l(id);df=n(S1,"Data2VecAudioForSequenceClassification"),S1.forEach(t),Zp.forEach(t),pp=u(o),ke=i(o,"DIV",{class:!0});var Bt=l(ke);T(ys.$$.fragment,Bt),cf=u(Bt),ld=i(Bt,"P",{});var O1=l(ld);pf=n(O1,`Data2VecAudio Model with a sequence classification head on top (a linear layer over the pooled output) for tasks
like SUPERB Keyword Spotting.`),O1.forEach(t),hf=u(Bt),$s=i(Bt,"P",{});var eh=l($s);mf=n(eh,"Data2VecAudio was proposed in "),Vs=i(eh,"A",{href:!0,rel:!0});var I1=l(Vs);uf=n(I1,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),I1.forEach(t),ff=n(eh,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),eh.forEach(t),gf=u(Bt),xs=i(Bt,"P",{});var th=l(xs);_f=n(th,"This model inherits from "),Bi=i(th,"A",{href:!0});var L1=l(Bi);vf=n(L1,"PreTrainedModel"),L1.forEach(t),bf=n(th,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),th.forEach(t),wf=u(Bt),Ds=i(Bt,"P",{});var oh=l(Ds);Tf=n(oh,"This model is a PyTorch "),Fs=i(oh,"A",{href:!0,rel:!0});var N1=l(Fs);kf=n(N1,"torch.nn.Module"),N1.forEach(t),yf=n(oh,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),oh.forEach(t),$f=u(Bt),dt=i(Bt,"DIV",{class:!0});var ro=l(dt);T(Cs.$$.fragment,ro),Vf=u(ro),Co=i(ro,"P",{});var $l=l(Co);xf=n($l,"The "),Hi=i($l,"A",{href:!0});var W1=l(Hi);Df=n(W1,"Data2VecAudioForSequenceClassification"),W1.forEach(t),Ff=n($l," forward method, overrides the "),dd=i($l,"CODE",{});var B1=l(dd);Cf=n(B1,"__call__"),B1.forEach(t),Af=n($l," special method."),$l.forEach(t),Mf=u(ro),T(xa.$$.fragment,ro),jf=u(ro),T(Da.$$.fragment,ro),Ef=u(ro),T(Fa.$$.fragment,ro),ro.forEach(t),Bt.forEach(t),hp=u(o),Ao=i(o,"H2",{class:!0});var ah=l(Ao);Ca=i(ah,"A",{id:!0,class:!0,href:!0});var H1=l(Ca);cd=i(H1,"SPAN",{});var R1=l(cd);T(As.$$.fragment,R1),R1.forEach(t),H1.forEach(t),qf=u(ah),pd=i(ah,"SPAN",{});var G1=l(pd);Pf=n(G1,"Data2VecAudioForXVector"),G1.forEach(t),ah.forEach(t),mp=u(o),ye=i(o,"DIV",{class:!0});var Ht=l(ye);T(Ms.$$.fragment,Ht),zf=u(Ht),hd=i(Ht,"P",{});var Q1=l(hd);Sf=n(Q1,"Data2VecAudio Model with an XVector feature extraction head on top for tasks like Speaker Verification."),Q1.forEach(t),Of=u(Ht),js=i(Ht,"P",{});var nh=l(js);If=n(nh,"Data2VecAudio was proposed in "),Es=i(nh,"A",{href:!0,rel:!0});var U1=l(Es);Lf=n(U1,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),U1.forEach(t),Nf=n(nh,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),nh.forEach(t),Wf=u(Ht),qs=i(Ht,"P",{});var sh=l(qs);Bf=n(sh,"This model inherits from "),Ri=i(sh,"A",{href:!0});var X1=l(Ri);Hf=n(X1,"PreTrainedModel"),X1.forEach(t),Rf=n(sh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),sh.forEach(t),Gf=u(Ht),Ps=i(Ht,"P",{});var rh=l(Ps);Qf=n(rh,"This model is a PyTorch "),zs=i(rh,"A",{href:!0,rel:!0});var J1=l(zs);Uf=n(J1,"torch.nn.Module"),J1.forEach(t),Xf=n(rh,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),rh.forEach(t),Jf=u(Ht),jt=i(Ht,"DIV",{class:!0});var An=l(jt);T(Ss.$$.fragment,An),Kf=u(An),Mo=i(An,"P",{});var Vl=l(Mo);Yf=n(Vl,"The "),Gi=i(Vl,"A",{href:!0});var K1=l(Gi);Zf=n(K1,"Data2VecAudioForXVector"),K1.forEach(t),eg=n(Vl," forward method, overrides the "),md=i(Vl,"CODE",{});var Y1=l(md);tg=n(Y1,"__call__"),Y1.forEach(t),og=n(Vl," special method."),Vl.forEach(t),ag=u(An),T(Aa.$$.fragment,An),ng=u(An),T(Ma.$$.fragment,An),An.forEach(t),Ht.forEach(t),up=u(o),jo=i(o,"H2",{class:!0});var ih=l(jo);ja=i(ih,"A",{id:!0,class:!0,href:!0});var Z1=l(ja);ud=i(Z1,"SPAN",{});var eT=l(ud);T(Os.$$.fragment,eT),eT.forEach(t),Z1.forEach(t),sg=u(ih),fd=i(ih,"SPAN",{});var tT=l(fd);rg=n(tT,"Data2VecTextModel"),tT.forEach(t),ih.forEach(t),fp=u(o),re=i(o,"DIV",{class:!0});var Le=l(re);T(Is.$$.fragment,Le),ig=u(Le),Ls=i(Le,"P",{});var lh=l(Ls);lg=n(lh,`The bare Data2VecText Model for text transformer outputting raw hidden-states without any specific head on top.
Data2VecText was proposed in `),Ns=i(lh,"A",{href:!0,rel:!0});var oT=l(Ns);dg=n(oT,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),oT.forEach(t),cg=n(lh,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),lh.forEach(t),pg=u(Le),Ws=i(Le,"P",{});var dh=l(Ws);hg=n(dh,"This model inherits from "),Qi=i(dh,"A",{href:!0});var aT=l(Qi);mg=n(aT,"PreTrainedModel"),aT.forEach(t),ug=n(dh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),dh.forEach(t),fg=u(Le),Bs=i(Le,"P",{});var ch=l(Bs);gg=n(ch,"This model is also a PyTorch "),Hs=i(ch,"A",{href:!0,rel:!0});var nT=l(Hs);_g=n(nT,"torch.nn.Module"),nT.forEach(t),vg=n(ch,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ch.forEach(t),bg=u(Le),Rs=i(Le,"P",{});var ph=l(Rs);wg=n(ph,`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),gd=i(ph,"EM",{});var sT=l(gd);Tg=n(sT,`Attention is
all you need`),sT.forEach(t),kg=n(ph,`_ by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz
Kaiser and Illia Polosukhin.`),ph.forEach(t),yg=u(Le),$e=i(Le,"P",{});var mt=l($e);$g=n(mt,"To behave as an decoder the model needs to be initialized with the "),_d=i(mt,"CODE",{});var rT=l(_d);Vg=n(rT,"is_decoder"),rT.forEach(t),xg=n(mt,` argument of the configuration set
to `),vd=i(mt,"CODE",{});var iT=l(vd);Dg=n(iT,"True"),iT.forEach(t),Fg=n(mt,". To be used in a Seq2Seq model, the model needs to initialized with both "),bd=i(mt,"CODE",{});var lT=l(bd);Cg=n(lT,"is_decoder"),lT.forEach(t),Ag=n(mt,` argument and
`),wd=i(mt,"CODE",{});var dT=l(wd);Mg=n(dT,"add_cross_attention"),dT.forEach(t),jg=n(mt," set to "),Td=i(mt,"CODE",{});var cT=l(Td);Eg=n(cT,"True"),cT.forEach(t),qg=n(mt,"; an "),kd=i(mt,"CODE",{});var pT=l(kd);Pg=n(pT,"encoder_hidden_states"),pT.forEach(t),zg=n(mt," is then expected as an input to the forward pass."),mt.forEach(t),Sg=u(Le),Ea=i(Le,"P",{});var Kc=l(Ea);Og=n(Kc,".. _"),yd=i(Kc,"EM",{});var hT=l(yd);Ig=n(hT,"Attention is all you need"),hT.forEach(t),Lg=n(Kc,": "),Gs=i(Kc,"A",{href:!0,rel:!0});var mT=l(Gs);Ng=n(mT,"https://arxiv.org/abs/1706.03762"),mT.forEach(t),Kc.forEach(t),Wg=u(Le),Et=i(Le,"DIV",{class:!0});var Mn=l(Et);T(Qs.$$.fragment,Mn),Bg=u(Mn),Eo=i(Mn,"P",{});var xl=l(Eo);Hg=n(xl,"The "),Ui=i(xl,"A",{href:!0});var uT=l(Ui);Rg=n(uT,"Data2VecTextModel"),uT.forEach(t),Gg=n(xl," forward method, overrides the "),$d=i(xl,"CODE",{});var fT=l($d);Qg=n(fT,"__call__"),fT.forEach(t),Ug=n(xl," special method."),xl.forEach(t),Xg=u(Mn),T(qa.$$.fragment,Mn),Jg=u(Mn),T(Pa.$$.fragment,Mn),Mn.forEach(t),Le.forEach(t),gp=u(o),qo=i(o,"H2",{class:!0});var hh=l(qo);za=i(hh,"A",{id:!0,class:!0,href:!0});var gT=l(za);Vd=i(gT,"SPAN",{});var _T=l(Vd);T(Us.$$.fragment,_T),_T.forEach(t),gT.forEach(t),Kg=u(hh),xd=i(hh,"SPAN",{});var vT=l(xd);Yg=n(vT,"Data2VecTextForCausalLM"),vT.forEach(t),hh.forEach(t),_p=u(o),st=i(o,"DIV",{class:!0});var io=l(st);T(Xs.$$.fragment,io),Zg=u(io),Po=i(io,"P",{});var Dl=l(Po);e_=n(Dl,"Data2VecText Model with a "),Dd=i(Dl,"CODE",{});var bT=l(Dd);t_=n(bT,"language modeling"),bT.forEach(t),o_=n(Dl,` head on top for CLM fine-tuning.
Data2VecText was proposed in `),Js=i(Dl,"A",{href:!0,rel:!0});var wT=l(Js);a_=n(wT,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),wT.forEach(t),n_=n(Dl,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),Dl.forEach(t),s_=u(io),Ks=i(io,"P",{});var mh=l(Ks);r_=n(mh,"This model inherits from "),Xi=i(mh,"A",{href:!0});var TT=l(Xi);i_=n(TT,"PreTrainedModel"),TT.forEach(t),l_=n(mh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),mh.forEach(t),d_=u(io),Ys=i(io,"P",{});var uh=l(Ys);c_=n(uh,"This model is also a PyTorch "),Zs=i(uh,"A",{href:!0,rel:!0});var kT=l(Zs);p_=n(kT,"torch.nn.Module"),kT.forEach(t),h_=n(uh,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),uh.forEach(t),m_=u(io),qt=i(io,"DIV",{class:!0});var jn=l(qt);T(er.$$.fragment,jn),u_=u(jn),zo=i(jn,"P",{});var Fl=l(zo);f_=n(Fl,"The "),Ji=i(Fl,"A",{href:!0});var yT=l(Ji);g_=n(yT,"Data2VecTextForCausalLM"),yT.forEach(t),__=n(Fl," forward method, overrides the "),Fd=i(Fl,"CODE",{});var $T=l(Fd);v_=n($T,"__call__"),$T.forEach(t),b_=n(Fl," special method."),Fl.forEach(t),w_=u(jn),T(Sa.$$.fragment,jn),T_=u(jn),T(Oa.$$.fragment,jn),jn.forEach(t),io.forEach(t),vp=u(o),So=i(o,"H2",{class:!0});var fh=l(So);Ia=i(fh,"A",{id:!0,class:!0,href:!0});var VT=l(Ia);Cd=i(VT,"SPAN",{});var xT=l(Cd);T(tr.$$.fragment,xT),xT.forEach(t),VT.forEach(t),k_=u(fh),Ad=i(fh,"SPAN",{});var DT=l(Ad);y_=n(DT,"Data2VecTextForMaskedLM"),DT.forEach(t),fh.forEach(t),bp=u(o),rt=i(o,"DIV",{class:!0});var lo=l(rt);T(or.$$.fragment,lo),$_=u(lo),Oo=i(lo,"P",{});var Cl=l(Oo);V_=n(Cl,"data2vec Model with a "),Md=i(Cl,"CODE",{});var FT=l(Md);x_=n(FT,"language modeling"),FT.forEach(t),D_=n(Cl,` head on top.
Data2VecText was proposed in `),ar=i(Cl,"A",{href:!0,rel:!0});var CT=l(ar);F_=n(CT,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),CT.forEach(t),C_=n(Cl,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),Cl.forEach(t),A_=u(lo),nr=i(lo,"P",{});var gh=l(nr);M_=n(gh,"This model inherits from "),Ki=i(gh,"A",{href:!0});var AT=l(Ki);j_=n(AT,"PreTrainedModel"),AT.forEach(t),E_=n(gh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),gh.forEach(t),q_=u(lo),sr=i(lo,"P",{});var _h=l(sr);P_=n(_h,"This model is also a PyTorch "),rr=i(_h,"A",{href:!0,rel:!0});var MT=l(rr);z_=n(MT,"torch.nn.Module"),MT.forEach(t),S_=n(_h,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),_h.forEach(t),O_=u(lo),ct=i(lo,"DIV",{class:!0});var co=l(ct);T(ir.$$.fragment,co),I_=u(co),Io=i(co,"P",{});var Al=l(Io);L_=n(Al,"The "),Yi=i(Al,"A",{href:!0});var jT=l(Yi);N_=n(jT,"Data2VecTextForMaskedLM"),jT.forEach(t),W_=n(Al," forward method, overrides the "),jd=i(Al,"CODE",{});var ET=l(jd);B_=n(ET,"__call__"),ET.forEach(t),H_=n(Al," special method."),Al.forEach(t),R_=u(co),T(La.$$.fragment,co),G_=u(co),T(Na.$$.fragment,co),Q_=u(co),T(Wa.$$.fragment,co),co.forEach(t),lo.forEach(t),wp=u(o),Lo=i(o,"H2",{class:!0});var vh=l(Lo);Ba=i(vh,"A",{id:!0,class:!0,href:!0});var qT=l(Ba);Ed=i(qT,"SPAN",{});var PT=l(Ed);T(lr.$$.fragment,PT),PT.forEach(t),qT.forEach(t),U_=u(vh),qd=i(vh,"SPAN",{});var zT=l(qd);X_=n(zT,"Data2VecTextForSequenceClassification"),zT.forEach(t),vh.forEach(t),Tp=u(o),Ve=i(o,"DIV",{class:!0});var Rt=l(Ve);T(dr.$$.fragment,Rt),J_=u(Rt),Pd=i(Rt,"P",{});var ST=l(Pd);K_=n(ST,`Data2VecText Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),ST.forEach(t),Y_=u(Rt),cr=i(Rt,"P",{});var bh=l(cr);Z_=n(bh,"Data2VecText was proposed in "),pr=i(bh,"A",{href:!0,rel:!0});var OT=l(pr);e2=n(OT,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),OT.forEach(t),t2=n(bh,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),bh.forEach(t),o2=u(Rt),hr=i(Rt,"P",{});var wh=l(hr);a2=n(wh,"This model inherits from "),Zi=i(wh,"A",{href:!0});var IT=l(Zi);n2=n(IT,"PreTrainedModel"),IT.forEach(t),s2=n(wh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),wh.forEach(t),r2=u(Rt),mr=i(Rt,"P",{});var Th=l(mr);i2=n(Th,"This model is also a PyTorch "),ur=i(Th,"A",{href:!0,rel:!0});var LT=l(ur);l2=n(LT,"torch.nn.Module"),LT.forEach(t),d2=n(Th,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Th.forEach(t),c2=u(Rt),be=i(Rt,"DIV",{class:!0});var ut=l(be);T(fr.$$.fragment,ut),p2=u(ut),No=i(ut,"P",{});var Ml=l(No);h2=n(Ml,"The "),el=i(Ml,"A",{href:!0});var NT=l(el);m2=n(NT,"Data2VecTextForSequenceClassification"),NT.forEach(t),u2=n(Ml," forward method, overrides the "),zd=i(Ml,"CODE",{});var WT=l(zd);f2=n(WT,"__call__"),WT.forEach(t),g2=n(Ml," special method."),Ml.forEach(t),_2=u(ut),T(Ha.$$.fragment,ut),v2=u(ut),T(Ra.$$.fragment,ut),b2=u(ut),T(Ga.$$.fragment,ut),w2=u(ut),T(Qa.$$.fragment,ut),T2=u(ut),T(Ua.$$.fragment,ut),ut.forEach(t),Rt.forEach(t),kp=u(o),Wo=i(o,"H2",{class:!0});var kh=l(Wo);Xa=i(kh,"A",{id:!0,class:!0,href:!0});var BT=l(Xa);Sd=i(BT,"SPAN",{});var HT=l(Sd);T(gr.$$.fragment,HT),HT.forEach(t),BT.forEach(t),k2=u(kh),Od=i(kh,"SPAN",{});var RT=l(Od);y2=n(RT,"Data2VecTextForMultipleChoice"),RT.forEach(t),kh.forEach(t),yp=u(o),xe=i(o,"DIV",{class:!0});var Gt=l(xe);T(_r.$$.fragment,Gt),$2=u(Gt),Id=i(Gt,"P",{});var GT=l(Id);V2=n(GT,`Data2VecText Model with a multiple choice classification head on top (a linear layer on top of the pooled output
and a softmax) e.g. for RocStories/SWAG tasks.`),GT.forEach(t),x2=u(Gt),vr=i(Gt,"P",{});var yh=l(vr);D2=n(yh,"Data2VecText was proposed in "),br=i(yh,"A",{href:!0,rel:!0});var QT=l(br);F2=n(QT,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),QT.forEach(t),C2=n(yh,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),yh.forEach(t),A2=u(Gt),wr=i(Gt,"P",{});var $h=l(wr);M2=n($h,"This model inherits from "),tl=i($h,"A",{href:!0});var UT=l(tl);j2=n(UT,"PreTrainedModel"),UT.forEach(t),E2=n($h,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),$h.forEach(t),q2=u(Gt),Tr=i(Gt,"P",{});var Vh=l(Tr);P2=n(Vh,"This model is also a PyTorch "),kr=i(Vh,"A",{href:!0,rel:!0});var XT=l(kr);z2=n(XT,"torch.nn.Module"),XT.forEach(t),S2=n(Vh,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Vh.forEach(t),O2=u(Gt),Pt=i(Gt,"DIV",{class:!0});var En=l(Pt);T(yr.$$.fragment,En),I2=u(En),Bo=i(En,"P",{});var jl=l(Bo);L2=n(jl,"The "),ol=i(jl,"A",{href:!0});var JT=l(ol);N2=n(JT,"Data2VecTextForMultipleChoice"),JT.forEach(t),W2=n(jl," forward method, overrides the "),Ld=i(jl,"CODE",{});var KT=l(Ld);B2=n(KT,"__call__"),KT.forEach(t),H2=n(jl," special method."),jl.forEach(t),R2=u(En),T(Ja.$$.fragment,En),G2=u(En),T(Ka.$$.fragment,En),En.forEach(t),Gt.forEach(t),$p=u(o),Ho=i(o,"H2",{class:!0});var xh=l(Ho);Ya=i(xh,"A",{id:!0,class:!0,href:!0});var YT=l(Ya);Nd=i(YT,"SPAN",{});var ZT=l(Nd);T($r.$$.fragment,ZT),ZT.forEach(t),YT.forEach(t),Q2=u(xh),Wd=i(xh,"SPAN",{});var ek=l(Wd);U2=n(ek,"Data2VecTextForTokenClassification"),ek.forEach(t),xh.forEach(t),Vp=u(o),De=i(o,"DIV",{class:!0});var Qt=l(De);T(Vr.$$.fragment,Qt),X2=u(Qt),Bd=i(Qt,"P",{});var tk=l(Bd);J2=n(tk,`Data2VecText Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g.
for Named-Entity-Recognition (NER) tasks.`),tk.forEach(t),K2=u(Qt),xr=i(Qt,"P",{});var Dh=l(xr);Y2=n(Dh,"Data2VecText was proposed in "),Dr=i(Dh,"A",{href:!0,rel:!0});var ok=l(Dr);Z2=n(ok,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),ok.forEach(t),ev=n(Dh,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),Dh.forEach(t),tv=u(Qt),Fr=i(Qt,"P",{});var Fh=l(Fr);ov=n(Fh,"This model inherits from "),al=i(Fh,"A",{href:!0});var ak=l(al);av=n(ak,"PreTrainedModel"),ak.forEach(t),nv=n(Fh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Fh.forEach(t),sv=u(Qt),Cr=i(Qt,"P",{});var Ch=l(Cr);rv=n(Ch,"This model is also a PyTorch "),Ar=i(Ch,"A",{href:!0,rel:!0});var nk=l(Ar);iv=n(nk,"torch.nn.Module"),nk.forEach(t),lv=n(Ch,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ch.forEach(t),dv=u(Qt),pt=i(Qt,"DIV",{class:!0});var po=l(pt);T(Mr.$$.fragment,po),cv=u(po),Ro=i(po,"P",{});var El=l(Ro);pv=n(El,"The "),nl=i(El,"A",{href:!0});var sk=l(nl);hv=n(sk,"Data2VecTextForTokenClassification"),sk.forEach(t),mv=n(El," forward method, overrides the "),Hd=i(El,"CODE",{});var rk=l(Hd);uv=n(rk,"__call__"),rk.forEach(t),fv=n(El," special method."),El.forEach(t),gv=u(po),T(Za.$$.fragment,po),_v=u(po),T(en.$$.fragment,po),vv=u(po),T(tn.$$.fragment,po),po.forEach(t),Qt.forEach(t),xp=u(o),Go=i(o,"H2",{class:!0});var Ah=l(Go);on=i(Ah,"A",{id:!0,class:!0,href:!0});var ik=l(on);Rd=i(ik,"SPAN",{});var lk=l(Rd);T(jr.$$.fragment,lk),lk.forEach(t),ik.forEach(t),bv=u(Ah),Gd=i(Ah,"SPAN",{});var dk=l(Gd);wv=n(dk,"Data2VecTextForQuestionAnswering"),dk.forEach(t),Ah.forEach(t),Dp=u(o),Fe=i(o,"DIV",{class:!0});var Ut=l(Fe);T(Er.$$.fragment,Ut),Tv=u(Ut),Qo=i(Ut,"P",{});var ql=l(Qo);kv=n(ql,`Data2VecText Model with a span classification head on top for extractive question-answering tasks like SQuAD (a
linear layers on top of the hidden-states output to compute `),Qd=i(ql,"CODE",{});var ck=l(Qd);yv=n(ck,"span start logits"),ck.forEach(t),$v=n(ql," and "),Ud=i(ql,"CODE",{});var pk=l(Ud);Vv=n(pk,"span end logits"),pk.forEach(t),xv=n(ql,")."),ql.forEach(t),Dv=u(Ut),qr=i(Ut,"P",{});var Mh=l(qr);Fv=n(Mh,"Data2VecText was proposed in "),Pr=i(Mh,"A",{href:!0,rel:!0});var hk=l(Pr);Cv=n(hk,`data2vec: A General Framework for Self-supervised Learning in Speech, Vision and
Language`),hk.forEach(t),Av=n(Mh,` by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and
Michael Auli.`),Mh.forEach(t),Mv=u(Ut),zr=i(Ut,"P",{});var jh=l(zr);jv=n(jh,"This model inherits from "),sl=i(jh,"A",{href:!0});var mk=l(sl);Ev=n(mk,"PreTrainedModel"),mk.forEach(t),qv=n(jh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),jh.forEach(t),Pv=u(Ut),Sr=i(Ut,"P",{});var Eh=l(Sr);zv=n(Eh,"This model is also a PyTorch "),Or=i(Eh,"A",{href:!0,rel:!0});var uk=l(Or);Sv=n(uk,"torch.nn.Module"),uk.forEach(t),Ov=n(Eh,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Eh.forEach(t),Iv=u(Ut),ht=i(Ut,"DIV",{class:!0});var ho=l(ht);T(Ir.$$.fragment,ho),Lv=u(ho),Uo=i(ho,"P",{});var Pl=l(Uo);Nv=n(Pl,"The "),rl=i(Pl,"A",{href:!0});var fk=l(rl);Wv=n(fk,"Data2VecTextForQuestionAnswering"),fk.forEach(t),Bv=n(Pl," forward method, overrides the "),Xd=i(Pl,"CODE",{});var gk=l(Xd);Hv=n(gk,"__call__"),gk.forEach(t),Rv=n(Pl," special method."),Pl.forEach(t),Gv=u(ho),T(an.$$.fragment,ho),Qv=u(ho),T(nn.$$.fragment,ho),Uv=u(ho),T(sn.$$.fragment,ho),ho.forEach(t),Ut.forEach(t),Fp=u(o),Xo=i(o,"H2",{class:!0});var qh=l(Xo);rn=i(qh,"A",{id:!0,class:!0,href:!0});var _k=l(rn);Jd=i(_k,"SPAN",{});var vk=l(Jd);T(Lr.$$.fragment,vk),vk.forEach(t),_k.forEach(t),Xv=u(qh),Kd=i(qh,"SPAN",{});var bk=l(Kd);Jv=n(bk,"Data2VecVisionModel"),bk.forEach(t),qh.forEach(t),Cp=u(o),Zt=i(o,"DIV",{class:!0});var zl=l(Zt);T(Nr.$$.fragment,zl),Kv=u(zl),Wr=i(zl,"P",{});var Ph=l(Wr);Yv=n(Ph,`The bare Data2VecVision Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Br=i(Ph,"A",{href:!0,rel:!0});var wk=l(Br);Zv=n(wk,"torch.nn.Module"),wk.forEach(t),eb=n(Ph,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ph.forEach(t),tb=u(zl),zt=i(zl,"DIV",{class:!0});var qn=l(zt);T(Hr.$$.fragment,qn),ob=u(qn),Jo=i(qn,"P",{});var Sl=l(Jo);ab=n(Sl,"The "),il=i(Sl,"A",{href:!0});var Tk=l(il);nb=n(Tk,"Data2VecVisionModel"),Tk.forEach(t),sb=n(Sl," forward method, overrides the "),Yd=i(Sl,"CODE",{});var kk=l(Yd);rb=n(kk,"__call__"),kk.forEach(t),ib=n(Sl," special method."),Sl.forEach(t),lb=u(qn),T(ln.$$.fragment,qn),db=u(qn),T(dn.$$.fragment,qn),qn.forEach(t),zl.forEach(t),Ap=u(o),Ko=i(o,"H2",{class:!0});var zh=l(Ko);cn=i(zh,"A",{id:!0,class:!0,href:!0});var yk=l(cn);Zd=i(yk,"SPAN",{});var $k=l(Zd);T(Rr.$$.fragment,$k),$k.forEach(t),yk.forEach(t),cb=u(zh),ec=i(zh,"SPAN",{});var Vk=l(ec);pb=n(Vk,"Data2VecVisionForImageClassification"),Vk.forEach(t),zh.forEach(t),Mp=u(o),_t=i(o,"DIV",{class:!0});var Pn=l(_t);T(Gr.$$.fragment,Pn),hb=u(Pn),tc=i(Pn,"P",{});var xk=l(tc);mb=n(xk,`Data2VecVision Model transformer with an image classification head on top (a linear layer on top of the average of
the final hidden states of the patch tokens) e.g. for ImageNet.`),xk.forEach(t),ub=u(Pn),Qr=i(Pn,"P",{});var Sh=l(Qr);fb=n(Sh,"This model is a PyTorch "),Ur=i(Sh,"A",{href:!0,rel:!0});var Dk=l(Ur);gb=n(Dk,"torch.nn.Module"),Dk.forEach(t),_b=n(Sh,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Sh.forEach(t),vb=u(Pn),St=i(Pn,"DIV",{class:!0});var zn=l(St);T(Xr.$$.fragment,zn),bb=u(zn),Yo=i(zn,"P",{});var Ol=l(Yo);wb=n(Ol,"The "),ll=i(Ol,"A",{href:!0});var Fk=l(ll);Tb=n(Fk,"Data2VecVisionForImageClassification"),Fk.forEach(t),kb=n(Ol," forward method, overrides the "),oc=i(Ol,"CODE",{});var Ck=l(oc);yb=n(Ck,"__call__"),Ck.forEach(t),$b=n(Ol," special method."),Ol.forEach(t),Vb=u(zn),T(pn.$$.fragment,zn),xb=u(zn),T(hn.$$.fragment,zn),zn.forEach(t),Pn.forEach(t),jp=u(o),Zo=i(o,"H2",{class:!0});var Oh=l(Zo);mn=i(Oh,"A",{id:!0,class:!0,href:!0});var Ak=l(mn);ac=i(Ak,"SPAN",{});var Mk=l(ac);T(Jr.$$.fragment,Mk),Mk.forEach(t),Ak.forEach(t),Db=u(Oh),nc=i(Oh,"SPAN",{});var jk=l(nc);Fb=n(jk,"Data2VecVisionForSemanticSegmentation"),jk.forEach(t),Oh.forEach(t),Ep=u(o),vt=i(o,"DIV",{class:!0});var Sn=l(vt);T(Kr.$$.fragment,Sn),Cb=u(Sn),sc=i(Sn,"P",{});var Ek=l(sc);Ab=n(Ek,"Data2VecVision Model transformer with a semantic segmentation head on top e.g. for ADE20k, CityScapes."),Ek.forEach(t),Mb=u(Sn),Yr=i(Sn,"P",{});var Ih=l(Yr);jb=n(Ih,"This model is a PyTorch "),Zr=i(Ih,"A",{href:!0,rel:!0});var qk=l(Zr);Eb=n(qk,"torch.nn.Module"),qk.forEach(t),qb=n(Ih,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ih.forEach(t),Pb=u(Sn),Ot=i(Sn,"DIV",{class:!0});var On=l(Ot);T(ei.$$.fragment,On),zb=u(On),ea=i(On,"P",{});var Il=l(ea);Sb=n(Il,"The "),dl=i(Il,"A",{href:!0});var Pk=l(dl);Ob=n(Pk,"Data2VecVisionForSemanticSegmentation"),Pk.forEach(t),Ib=n(Il," forward method, overrides the "),rc=i(Il,"CODE",{});var zk=l(rc);Lb=n(zk,"__call__"),zk.forEach(t),Nb=n(Il," special method."),Il.forEach(t),Wb=u(On),T(un.$$.fragment,On),Bb=u(On),T(fn.$$.fragment,On),On.forEach(t),Sn.forEach(t),qp=u(o),ta=i(o,"H2",{class:!0});var Lh=l(ta);gn=i(Lh,"A",{id:!0,class:!0,href:!0});var Sk=l(gn);ic=i(Sk,"SPAN",{});var Ok=l(ic);T(ti.$$.fragment,Ok),Ok.forEach(t),Sk.forEach(t),Hb=u(Lh),lc=i(Lh,"SPAN",{});var Ik=l(lc);Rb=n(Ik,"TFData2VecVisionModel"),Ik.forEach(t),Lh.forEach(t),Pp=u(o),it=i(o,"DIV",{class:!0});var mo=l(it);T(oi.$$.fragment,mo),Gb=u(mo),ai=i(mo,"P",{});var Nh=l(ai);Qb=n(Nh,`The bare Data2VecVision Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),cl=i(Nh,"A",{href:!0});var Lk=l(cl);Ub=n(Lk,"TFPreTrainedModel"),Lk.forEach(t),Xb=n(Nh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.).`),Nh.forEach(t),Jb=u(mo),ni=i(mo,"P",{});var Wh=l(ni);Kb=n(Wh,"This model is also a "),si=i(Wh,"A",{href:!0,rel:!0});var Nk=l(si);Yb=n(Nk,"tf.keras.Model"),Nk.forEach(t),Zb=n(Wh,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Wh.forEach(t),ew=u(mo),T(_n.$$.fragment,mo),tw=u(mo),It=i(mo,"DIV",{class:!0});var In=l(It);T(ri.$$.fragment,In),ow=u(In),oa=i(In,"P",{});var Ll=l(oa);aw=n(Ll,"The "),pl=i(Ll,"A",{href:!0});var Wk=l(pl);nw=n(Wk,"TFData2VecVisionModel"),Wk.forEach(t),sw=n(Ll," forward method, overrides the "),dc=i(Ll,"CODE",{});var Bk=l(dc);rw=n(Bk,"__call__"),Bk.forEach(t),iw=n(Ll," special method."),Ll.forEach(t),lw=u(In),T(vn.$$.fragment,In),dw=u(In),T(bn.$$.fragment,In),In.forEach(t),mo.forEach(t),zp=u(o),aa=i(o,"H2",{class:!0});var Bh=l(aa);wn=i(Bh,"A",{id:!0,class:!0,href:!0});var Hk=l(wn);cc=i(Hk,"SPAN",{});var Rk=l(cc);T(ii.$$.fragment,Rk),Rk.forEach(t),Hk.forEach(t),cw=u(Bh),pc=i(Bh,"SPAN",{});var Gk=l(pc);pw=n(Gk,"TFData2VecVisionForImageClassification"),Gk.forEach(t),Bh.forEach(t),Sp=u(o),Ce=i(o,"DIV",{class:!0});var Xt=l(Ce);T(li.$$.fragment,Xt),hw=u(Xt),hc=i(Xt,"P",{});var Qk=l(hc);mw=n(Qk,`Data2VecVision Model transformer with an image classification head on top (a linear layer on top of the average of
the final hidden states of the patch tokens) e.g. for ImageNet.`),Qk.forEach(t),uw=u(Xt),di=i(Xt,"P",{});var Hh=l(di);fw=n(Hh,"This model inherits from "),hl=i(Hh,"A",{href:!0});var Uk=l(hl);gw=n(Uk,"TFPreTrainedModel"),Uk.forEach(t),_w=n(Hh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.).`),Hh.forEach(t),vw=u(Xt),ci=i(Xt,"P",{});var Rh=l(ci);bw=n(Rh,"This model is also a "),pi=i(Rh,"A",{href:!0,rel:!0});var Xk=l(pi);ww=n(Xk,"tf.keras.Model"),Xk.forEach(t),Tw=n(Rh,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Rh.forEach(t),kw=u(Xt),T(Tn.$$.fragment,Xt),yw=u(Xt),Lt=i(Xt,"DIV",{class:!0});var Ln=l(Lt);T(hi.$$.fragment,Ln),$w=u(Ln),na=i(Ln,"P",{});var Nl=l(na);Vw=n(Nl,"The "),ml=i(Nl,"A",{href:!0});var Jk=l(ml);xw=n(Jk,"TFData2VecVisionForImageClassification"),Jk.forEach(t),Dw=n(Nl," forward method, overrides the "),mc=i(Nl,"CODE",{});var Kk=l(mc);Fw=n(Kk,"__call__"),Kk.forEach(t),Cw=n(Nl," special method."),Nl.forEach(t),Aw=u(Ln),T(kn.$$.fragment,Ln),Mw=u(Ln),T(yn.$$.fragment,Ln),Ln.forEach(t),Xt.forEach(t),Op=u(o),sa=i(o,"H2",{class:!0});var Gh=l(sa);$n=i(Gh,"A",{id:!0,class:!0,href:!0});var Yk=l($n);uc=i(Yk,"SPAN",{});var Zk=l(uc);T(mi.$$.fragment,Zk),Zk.forEach(t),Yk.forEach(t),jw=u(Gh),fc=i(Gh,"SPAN",{});var ey=l(fc);Ew=n(ey,"TFData2VecVisionForSemanticSegmentation"),ey.forEach(t),Gh.forEach(t),Ip=u(o),Ae=i(o,"DIV",{class:!0});var Jt=l(Ae);T(ui.$$.fragment,Jt),qw=u(Jt),gc=i(Jt,"P",{});var ty=l(gc);Pw=n(ty,"Data2VecVision Model transformer with a semantic segmentation head on top e.g. for ADE20k, CityScapes."),ty.forEach(t),zw=u(Jt),fi=i(Jt,"P",{});var Qh=l(fi);Sw=n(Qh,"This model inherits from "),ul=i(Qh,"A",{href:!0});var oy=l(ul);Ow=n(oy,"TFPreTrainedModel"),oy.forEach(t),Iw=n(Qh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.).`),Qh.forEach(t),Lw=u(Jt),gi=i(Jt,"P",{});var Uh=l(gi);Nw=n(Uh,"This model is also a "),_i=i(Uh,"A",{href:!0,rel:!0});var ay=l(_i);Ww=n(ay,"tf.keras.Model"),ay.forEach(t),Bw=n(Uh,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Uh.forEach(t),Hw=u(Jt),T(Vn.$$.fragment,Jt),Rw=u(Jt),Nt=i(Jt,"DIV",{class:!0});var Nn=l(Nt);T(vi.$$.fragment,Nn),Gw=u(Nn),ra=i(Nn,"P",{});var Wl=l(ra);Qw=n(Wl,"The "),fl=i(Wl,"A",{href:!0});var ny=l(fl);Uw=n(ny,"TFData2VecVisionForSemanticSegmentation"),ny.forEach(t),Xw=n(Wl," forward method, overrides the "),_c=i(Wl,"CODE",{});var sy=l(_c);Jw=n(sy,"__call__"),sy.forEach(t),Kw=n(Wl," special method."),Wl.forEach(t),Yw=u(Nn),T(xn.$$.fragment,Nn),Zw=u(Nn),T(Dn.$$.fragment,Nn),Nn.forEach(t),Jt.forEach(t),this.h()},h(){f(d,"name","hf:doc:metadata"),f(d,"content",JSON.stringify(l$)),f(h,"id","data2vec"),f(h,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(h,"href","#data2vec"),f(c,"class","relative group"),f(le,"id","overview"),f(le,"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"),f(le,"href","#overview"),f(B,"class","relative group"),f(ce,"href","https://arxiv.org/pdf/2202.03555"),f(ce,"rel","nofollow"),f(Y,"href","http://www.github.com/pytorch/fairseq/tree/master/examples/data2vec"),f(Y,"rel","nofollow"),f(ge,"href","/docs/transformers/v4.25.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Model"),f(_e,"href","/docs/transformers/v4.25.1/en/model_doc/roberta#transformers.RobertaModel"),f(O,"href","/docs/transformers/v4.25.1/en/model_doc/beit#transformers.BeitModel"),f(Z,"href","https://colab.research.google.com/github/sayakpaul/TF-2.0-Hacks/blob/master/data2vec_vision_image_classification.ipynb"),f(Z,"rel","nofollow"),f(Se,"href","https://huggingface.co/edugp"),f(Se,"rel","nofollow"),f(W,"href","https://huggingface.co/patrickvonplaten"),f(W,"rel","nofollow"),f(Oe,"href","https://github.com/sayakpaul"),f(Oe,"rel","nofollow"),f(Ie,"href","https://github.com/Rocketknight1"),f(Ie,"rel","nofollow"),f(Wn,"href","https://github.com/pytorch/fairseq/tree/main/examples/data2vec"),f(Wn,"rel","nofollow"),f(Bn,"href","https://github.com/facebookresearch/data2vec_vision/tree/main/beit"),f(Bn,"rel","nofollow"),f(da,"id","transformers.Data2VecTextConfig"),f(da,"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"),f(da,"href","#transformers.Data2VecTextConfig"),f(uo,"class","relative group"),f(Ci,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextModel"),f(Ai,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextModel"),f(Gn,"href","https://huggingface.co/facebook/data2vec-text-base"),f(Gn,"rel","nofollow"),f(Mi,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),f(ji,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),f(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(pa,"id","transformers.Data2VecAudioConfig"),f(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"),f(pa,"href","#transformers.Data2VecAudioConfig"),f(go,"class","relative group"),f(Ei,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioModel"),f(Xn,"href","https://huggingface.co/facebook/data2vec-audio-base-960h"),f(Xn,"rel","nofollow"),f(qi,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),f(Pi,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),f(gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ma,"id","transformers.Data2VecVisionConfig"),f(ma,"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"),f(ma,"href","#transformers.Data2VecVisionConfig"),f(bo,"class","relative group"),f(zi,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecVisionModel"),f(Yn,"href","https://huggingface.co/facebook/data2vec-vision-base"),f(Yn,"rel","nofollow"),f(Yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(fa,"id","transformers.Data2VecAudioModel"),f(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"),f(fa,"href","#transformers.Data2VecAudioModel"),f(To,"class","relative group"),f(os,"href","https://arxiv.org/pdf/2202.03555"),f(os,"rel","nofollow"),f(Si,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),f(ss,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(ss,"rel","nofollow"),f(Oi,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioModel"),f(At,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(va,"id","transformers.Data2VecAudioForAudioFrameClassification"),f(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"),f(va,"href","#transformers.Data2VecAudioForAudioFrameClassification"),f(yo,"class","relative group"),f(cs,"href","https://arxiv.org/pdf/2202.03555"),f(cs,"rel","nofollow"),f(Ii,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),f(ms,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(ms,"rel","nofollow"),f(Li,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioForAudioFrameClassification"),f(Mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ta,"id","transformers.Data2VecAudioForCTC"),f(Ta,"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"),f(Ta,"href","#transformers.Data2VecAudioForCTC"),f(Vo,"class","relative group"),f(_s,"href","https://arxiv.org/pdf/2202.03555"),f(_s,"rel","nofollow"),f(Ni,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),f(ws,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(ws,"rel","nofollow"),f(Wi,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioForCTC"),f(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Va,"id","transformers.Data2VecAudioForSequenceClassification"),f(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"),f(Va,"href","#transformers.Data2VecAudioForSequenceClassification"),f(Fo,"class","relative group"),f(Vs,"href","https://arxiv.org/pdf/2202.03555"),f(Vs,"rel","nofollow"),f(Bi,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),f(Fs,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Fs,"rel","nofollow"),f(Hi,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioForSequenceClassification"),f(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ca,"id","transformers.Data2VecAudioForXVector"),f(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"),f(Ca,"href","#transformers.Data2VecAudioForXVector"),f(Ao,"class","relative group"),f(Es,"href","https://arxiv.org/pdf/2202.03555"),f(Es,"rel","nofollow"),f(Ri,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),f(zs,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(zs,"rel","nofollow"),f(Gi,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecAudioForXVector"),f(jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ja,"id","transformers.Data2VecTextModel"),f(ja,"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"),f(ja,"href","#transformers.Data2VecTextModel"),f(jo,"class","relative group"),f(Ns,"href","https://arxiv.org/pdf/2202.03555"),f(Ns,"rel","nofollow"),f(Qi,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),f(Hs,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Hs,"rel","nofollow"),f(Gs,"href","https://arxiv.org/abs/1706.03762"),f(Gs,"rel","nofollow"),f(Ui,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextModel"),f(Et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(za,"id","transformers.Data2VecTextForCausalLM"),f(za,"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"),f(za,"href","#transformers.Data2VecTextForCausalLM"),f(qo,"class","relative group"),f(Js,"href","https://arxiv.org/pdf/2202.03555"),f(Js,"rel","nofollow"),f(Xi,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),f(Zs,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Zs,"rel","nofollow"),f(Ji,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextForCausalLM"),f(qt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ia,"id","transformers.Data2VecTextForMaskedLM"),f(Ia,"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"),f(Ia,"href","#transformers.Data2VecTextForMaskedLM"),f(So,"class","relative group"),f(ar,"href","https://arxiv.org/pdf/2202.03555"),f(ar,"rel","nofollow"),f(Ki,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),f(rr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(rr,"rel","nofollow"),f(Yi,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextForMaskedLM"),f(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ba,"id","transformers.Data2VecTextForSequenceClassification"),f(Ba,"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"),f(Ba,"href","#transformers.Data2VecTextForSequenceClassification"),f(Lo,"class","relative group"),f(pr,"href","https://arxiv.org/pdf/2202.03555"),f(pr,"rel","nofollow"),f(Zi,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),f(ur,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(ur,"rel","nofollow"),f(el,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextForSequenceClassification"),f(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Xa,"id","transformers.Data2VecTextForMultipleChoice"),f(Xa,"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"),f(Xa,"href","#transformers.Data2VecTextForMultipleChoice"),f(Wo,"class","relative group"),f(br,"href","https://arxiv.org/pdf/2202.03555"),f(br,"rel","nofollow"),f(tl,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),f(kr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(kr,"rel","nofollow"),f(ol,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextForMultipleChoice"),f(Pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ya,"id","transformers.Data2VecTextForTokenClassification"),f(Ya,"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"),f(Ya,"href","#transformers.Data2VecTextForTokenClassification"),f(Ho,"class","relative group"),f(Dr,"href","https://arxiv.org/pdf/2202.03555"),f(Dr,"rel","nofollow"),f(al,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),f(Ar,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Ar,"rel","nofollow"),f(nl,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextForTokenClassification"),f(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(on,"id","transformers.Data2VecTextForQuestionAnswering"),f(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"),f(on,"href","#transformers.Data2VecTextForQuestionAnswering"),f(Go,"class","relative group"),f(Pr,"href","https://arxiv.org/pdf/2202.03555"),f(Pr,"rel","nofollow"),f(sl,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel"),f(Or,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Or,"rel","nofollow"),f(rl,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecTextForQuestionAnswering"),f(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(rn,"id","transformers.Data2VecVisionModel"),f(rn,"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"),f(rn,"href","#transformers.Data2VecVisionModel"),f(Xo,"class","relative group"),f(Br,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Br,"rel","nofollow"),f(il,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecVisionModel"),f(zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(cn,"id","transformers.Data2VecVisionForImageClassification"),f(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"),f(cn,"href","#transformers.Data2VecVisionForImageClassification"),f(Ko,"class","relative group"),f(Ur,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Ur,"rel","nofollow"),f(ll,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecVisionForImageClassification"),f(St,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(_t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(mn,"id","transformers.Data2VecVisionForSemanticSegmentation"),f(mn,"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"),f(mn,"href","#transformers.Data2VecVisionForSemanticSegmentation"),f(Zo,"class","relative group"),f(Zr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Zr,"rel","nofollow"),f(dl,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.Data2VecVisionForSemanticSegmentation"),f(Ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(gn,"id","transformers.TFData2VecVisionModel"),f(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"),f(gn,"href","#transformers.TFData2VecVisionModel"),f(ta,"class","relative group"),f(cl,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel"),f(si,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(si,"rel","nofollow"),f(pl,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.TFData2VecVisionModel"),f(It,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(wn,"id","transformers.TFData2VecVisionForImageClassification"),f(wn,"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"),f(wn,"href","#transformers.TFData2VecVisionForImageClassification"),f(aa,"class","relative group"),f(hl,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel"),f(pi,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(pi,"rel","nofollow"),f(ml,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.TFData2VecVisionForImageClassification"),f(Lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f($n,"id","transformers.TFData2VecVisionForSemanticSegmentation"),f($n,"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"),f($n,"href","#transformers.TFData2VecVisionForSemanticSegmentation"),f(sa,"class","relative group"),f(ul,"href","/docs/transformers/v4.25.1/en/main_classes/model#transformers.TFPreTrainedModel"),f(_i,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(_i,"rel","nofollow"),f(fl,"href","/docs/transformers/v4.25.1/en/model_doc/data2vec#transformers.TFData2VecVisionForSemanticSegmentation"),f(Nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,_){e(document.head,d),b(o,g,_),b(o,c,_),e(c,h),e(h,v),k(s,v,null),e(c,p),e(c,F),e(F,Ne),b(o,Me,_),b(o,B,_),e(B,le),e(le,de),k(C,de,null),e(B,We),e(B,X),e(X,Be),b(o,je,_),b(o,H,_),e(H,He),e(H,ce),e(ce,ee),e(H,Re),b(o,Ee,_),b(o,R,_),e(R,Ge),b(o,qe,_),b(o,G,_),e(G,pe),e(pe,Qe),e(pe,Y),e(Y,E),e(pe,z),b(o,Pe,_),b(o,Q,_),e(Q,Ue),b(o,ze,_),b(o,P,_),e(P,we),e(we,Xe),e(P,S),e(P,he),e(he,te),e(he,ge),e(ge,Je),e(he,oe),e(P,Ke),e(P,me),e(me,U),e(me,_e),e(_e,ae),e(me,Ye),e(P,ve),e(P,q),e(q,Ze),e(q,O),e(O,et),e(q,tt),e(P,D),e(P,A),e(A,Tt),e(A,Z),e(Z,kt),e(A,yt),b(o,M,_),b(o,J,_),e(J,$t),e(J,Se),e(Se,Vt),e(J,xt),e(J,W),e(W,ne),e(J,Dt),e(J,Oe),e(Oe,se),e(J,Ft),e(J,Ie),e(Ie,ot),e(J,Ct),b(o,ue,_),b(o,fe,_),e(fe,Xh),e(fe,Wn),e(Wn,Jh),e(fe,Kh),e(fe,Bn),e(Bn,Yh),e(fe,Zh),b(o,Yc,_),b(o,uo,_),e(uo,da),e(da,Bl),k(Hn,Bl,null),e(uo,em),e(uo,Hl),e(Hl,tm),b(o,Zc,_),b(o,ft,_),k(Rn,ft,null),e(ft,om),e(ft,Kt),e(Kt,am),e(Kt,Ci),e(Ci,nm),e(Kt,sm),e(Kt,Ai),e(Ai,rm),e(Kt,im),e(Kt,Gn),e(Gn,lm),e(Kt,dm),e(ft,cm),e(ft,fo),e(fo,pm),e(fo,Mi),e(Mi,hm),e(fo,mm),e(fo,ji),e(ji,um),e(fo,fm),e(ft,gm),k(ca,ft,null),b(o,ep,_),b(o,go,_),e(go,pa),e(pa,Rl),k(Qn,Rl,null),e(go,_m),e(go,Gl),e(Gl,vm),b(o,tp,_),b(o,gt,_),k(Un,gt,null),e(gt,bm),e(gt,_o),e(_o,wm),e(_o,Ei),e(Ei,Tm),e(_o,km),e(_o,Xn),e(Xn,ym),e(_o,$m),e(gt,Vm),e(gt,vo),e(vo,xm),e(vo,qi),e(qi,Dm),e(vo,Fm),e(vo,Pi),e(Pi,Cm),e(vo,Am),e(gt,Mm),k(ha,gt,null),b(o,op,_),b(o,bo,_),e(bo,ma),e(ma,Ql),k(Jn,Ql,null),e(bo,jm),e(bo,Ul),e(Ul,Em),b(o,ap,_),b(o,Yt,_),k(Kn,Yt,null),e(Yt,qm),e(Yt,wo),e(wo,Pm),e(wo,zi),e(zi,zm),e(wo,Sm),e(wo,Yn),e(Yn,Om),e(wo,Im),e(Yt,Lm),k(ua,Yt,null),b(o,np,_),b(o,To,_),e(To,fa),e(fa,Xl),k(Zn,Xl,null),e(To,Nm),e(To,Jl),e(Jl,Wm),b(o,sp,_),b(o,at,_),k(es,at,null),e(at,Bm),e(at,ts),e(ts,Hm),e(ts,os),e(os,Rm),e(ts,Gm),e(at,Qm),e(at,as),e(as,Um),e(as,Si),e(Si,Xm),e(as,Jm),e(at,Km),e(at,ns),e(ns,Ym),e(ns,ss),e(ss,Zm),e(ns,eu),e(at,tu),e(at,At),k(rs,At,null),e(At,ou),e(At,ko),e(ko,au),e(ko,Oi),e(Oi,nu),e(ko,su),e(ko,Kl),e(Kl,ru),e(ko,iu),e(At,lu),k(ga,At,null),e(At,du),k(_a,At,null),b(o,rp,_),b(o,yo,_),e(yo,va),e(va,Yl),k(is,Yl,null),e(yo,cu),e(yo,Zl),e(Zl,pu),b(o,ip,_),b(o,Te,_),k(ls,Te,null),e(Te,hu),e(Te,ed),e(ed,mu),e(Te,uu),e(Te,ds),e(ds,fu),e(ds,cs),e(cs,gu),e(ds,_u),e(Te,vu),e(Te,ps),e(ps,bu),e(ps,Ii),e(Ii,wu),e(ps,Tu),e(Te,ku),e(Te,hs),e(hs,yu),e(hs,ms),e(ms,$u),e(hs,Vu),e(Te,xu),e(Te,Mt),k(us,Mt,null),e(Mt,Du),e(Mt,$o),e($o,Fu),e($o,Li),e(Li,Cu),e($o,Au),e($o,td),e(td,Mu),e($o,ju),e(Mt,Eu),k(ba,Mt,null),e(Mt,qu),k(wa,Mt,null),b(o,lp,_),b(o,Vo,_),e(Vo,Ta),e(Ta,od),k(fs,od,null),e(Vo,Pu),e(Vo,ad),e(ad,zu),b(o,dp,_),b(o,nt,_),k(gs,nt,null),e(nt,Su),e(nt,xo),e(xo,Ou),e(xo,nd),e(nd,Iu),e(xo,Lu),e(xo,_s),e(_s,Nu),e(xo,Wu),e(nt,Bu),e(nt,vs),e(vs,Hu),e(vs,Ni),e(Ni,Ru),e(vs,Gu),e(nt,Qu),e(nt,bs),e(bs,Uu),e(bs,ws),e(ws,Xu),e(bs,Ju),e(nt,Ku),e(nt,lt),k(Ts,lt,null),e(lt,Yu),e(lt,Do),e(Do,Zu),e(Do,Wi),e(Wi,ef),e(Do,tf),e(Do,sd),e(sd,of),e(Do,af),e(lt,nf),k(ka,lt,null),e(lt,sf),k(ya,lt,null),e(lt,rf),k($a,lt,null),b(o,cp,_),b(o,Fo,_),e(Fo,Va),e(Va,rd),k(ks,rd,null),e(Fo,lf),e(Fo,id),e(id,df),b(o,pp,_),b(o,ke,_),k(ys,ke,null),e(ke,cf),e(ke,ld),e(ld,pf),e(ke,hf),e(ke,$s),e($s,mf),e($s,Vs),e(Vs,uf),e($s,ff),e(ke,gf),e(ke,xs),e(xs,_f),e(xs,Bi),e(Bi,vf),e(xs,bf),e(ke,wf),e(ke,Ds),e(Ds,Tf),e(Ds,Fs),e(Fs,kf),e(Ds,yf),e(ke,$f),e(ke,dt),k(Cs,dt,null),e(dt,Vf),e(dt,Co),e(Co,xf),e(Co,Hi),e(Hi,Df),e(Co,Ff),e(Co,dd),e(dd,Cf),e(Co,Af),e(dt,Mf),k(xa,dt,null),e(dt,jf),k(Da,dt,null),e(dt,Ef),k(Fa,dt,null),b(o,hp,_),b(o,Ao,_),e(Ao,Ca),e(Ca,cd),k(As,cd,null),e(Ao,qf),e(Ao,pd),e(pd,Pf),b(o,mp,_),b(o,ye,_),k(Ms,ye,null),e(ye,zf),e(ye,hd),e(hd,Sf),e(ye,Of),e(ye,js),e(js,If),e(js,Es),e(Es,Lf),e(js,Nf),e(ye,Wf),e(ye,qs),e(qs,Bf),e(qs,Ri),e(Ri,Hf),e(qs,Rf),e(ye,Gf),e(ye,Ps),e(Ps,Qf),e(Ps,zs),e(zs,Uf),e(Ps,Xf),e(ye,Jf),e(ye,jt),k(Ss,jt,null),e(jt,Kf),e(jt,Mo),e(Mo,Yf),e(Mo,Gi),e(Gi,Zf),e(Mo,eg),e(Mo,md),e(md,tg),e(Mo,og),e(jt,ag),k(Aa,jt,null),e(jt,ng),k(Ma,jt,null),b(o,up,_),b(o,jo,_),e(jo,ja),e(ja,ud),k(Os,ud,null),e(jo,sg),e(jo,fd),e(fd,rg),b(o,fp,_),b(o,re,_),k(Is,re,null),e(re,ig),e(re,Ls),e(Ls,lg),e(Ls,Ns),e(Ns,dg),e(Ls,cg),e(re,pg),e(re,Ws),e(Ws,hg),e(Ws,Qi),e(Qi,mg),e(Ws,ug),e(re,fg),e(re,Bs),e(Bs,gg),e(Bs,Hs),e(Hs,_g),e(Bs,vg),e(re,bg),e(re,Rs),e(Rs,wg),e(Rs,gd),e(gd,Tg),e(Rs,kg),e(re,yg),e(re,$e),e($e,$g),e($e,_d),e(_d,Vg),e($e,xg),e($e,vd),e(vd,Dg),e($e,Fg),e($e,bd),e(bd,Cg),e($e,Ag),e($e,wd),e(wd,Mg),e($e,jg),e($e,Td),e(Td,Eg),e($e,qg),e($e,kd),e(kd,Pg),e($e,zg),e(re,Sg),e(re,Ea),e(Ea,Og),e(Ea,yd),e(yd,Ig),e(Ea,Lg),e(Ea,Gs),e(Gs,Ng),e(re,Wg),e(re,Et),k(Qs,Et,null),e(Et,Bg),e(Et,Eo),e(Eo,Hg),e(Eo,Ui),e(Ui,Rg),e(Eo,Gg),e(Eo,$d),e($d,Qg),e(Eo,Ug),e(Et,Xg),k(qa,Et,null),e(Et,Jg),k(Pa,Et,null),b(o,gp,_),b(o,qo,_),e(qo,za),e(za,Vd),k(Us,Vd,null),e(qo,Kg),e(qo,xd),e(xd,Yg),b(o,_p,_),b(o,st,_),k(Xs,st,null),e(st,Zg),e(st,Po),e(Po,e_),e(Po,Dd),e(Dd,t_),e(Po,o_),e(Po,Js),e(Js,a_),e(Po,n_),e(st,s_),e(st,Ks),e(Ks,r_),e(Ks,Xi),e(Xi,i_),e(Ks,l_),e(st,d_),e(st,Ys),e(Ys,c_),e(Ys,Zs),e(Zs,p_),e(Ys,h_),e(st,m_),e(st,qt),k(er,qt,null),e(qt,u_),e(qt,zo),e(zo,f_),e(zo,Ji),e(Ji,g_),e(zo,__),e(zo,Fd),e(Fd,v_),e(zo,b_),e(qt,w_),k(Sa,qt,null),e(qt,T_),k(Oa,qt,null),b(o,vp,_),b(o,So,_),e(So,Ia),e(Ia,Cd),k(tr,Cd,null),e(So,k_),e(So,Ad),e(Ad,y_),b(o,bp,_),b(o,rt,_),k(or,rt,null),e(rt,$_),e(rt,Oo),e(Oo,V_),e(Oo,Md),e(Md,x_),e(Oo,D_),e(Oo,ar),e(ar,F_),e(Oo,C_),e(rt,A_),e(rt,nr),e(nr,M_),e(nr,Ki),e(Ki,j_),e(nr,E_),e(rt,q_),e(rt,sr),e(sr,P_),e(sr,rr),e(rr,z_),e(sr,S_),e(rt,O_),e(rt,ct),k(ir,ct,null),e(ct,I_),e(ct,Io),e(Io,L_),e(Io,Yi),e(Yi,N_),e(Io,W_),e(Io,jd),e(jd,B_),e(Io,H_),e(ct,R_),k(La,ct,null),e(ct,G_),k(Na,ct,null),e(ct,Q_),k(Wa,ct,null),b(o,wp,_),b(o,Lo,_),e(Lo,Ba),e(Ba,Ed),k(lr,Ed,null),e(Lo,U_),e(Lo,qd),e(qd,X_),b(o,Tp,_),b(o,Ve,_),k(dr,Ve,null),e(Ve,J_),e(Ve,Pd),e(Pd,K_),e(Ve,Y_),e(Ve,cr),e(cr,Z_),e(cr,pr),e(pr,e2),e(cr,t2),e(Ve,o2),e(Ve,hr),e(hr,a2),e(hr,Zi),e(Zi,n2),e(hr,s2),e(Ve,r2),e(Ve,mr),e(mr,i2),e(mr,ur),e(ur,l2),e(mr,d2),e(Ve,c2),e(Ve,be),k(fr,be,null),e(be,p2),e(be,No),e(No,h2),e(No,el),e(el,m2),e(No,u2),e(No,zd),e(zd,f2),e(No,g2),e(be,_2),k(Ha,be,null),e(be,v2),k(Ra,be,null),e(be,b2),k(Ga,be,null),e(be,w2),k(Qa,be,null),e(be,T2),k(Ua,be,null),b(o,kp,_),b(o,Wo,_),e(Wo,Xa),e(Xa,Sd),k(gr,Sd,null),e(Wo,k2),e(Wo,Od),e(Od,y2),b(o,yp,_),b(o,xe,_),k(_r,xe,null),e(xe,$2),e(xe,Id),e(Id,V2),e(xe,x2),e(xe,vr),e(vr,D2),e(vr,br),e(br,F2),e(vr,C2),e(xe,A2),e(xe,wr),e(wr,M2),e(wr,tl),e(tl,j2),e(wr,E2),e(xe,q2),e(xe,Tr),e(Tr,P2),e(Tr,kr),e(kr,z2),e(Tr,S2),e(xe,O2),e(xe,Pt),k(yr,Pt,null),e(Pt,I2),e(Pt,Bo),e(Bo,L2),e(Bo,ol),e(ol,N2),e(Bo,W2),e(Bo,Ld),e(Ld,B2),e(Bo,H2),e(Pt,R2),k(Ja,Pt,null),e(Pt,G2),k(Ka,Pt,null),b(o,$p,_),b(o,Ho,_),e(Ho,Ya),e(Ya,Nd),k($r,Nd,null),e(Ho,Q2),e(Ho,Wd),e(Wd,U2),b(o,Vp,_),b(o,De,_),k(Vr,De,null),e(De,X2),e(De,Bd),e(Bd,J2),e(De,K2),e(De,xr),e(xr,Y2),e(xr,Dr),e(Dr,Z2),e(xr,ev),e(De,tv),e(De,Fr),e(Fr,ov),e(Fr,al),e(al,av),e(Fr,nv),e(De,sv),e(De,Cr),e(Cr,rv),e(Cr,Ar),e(Ar,iv),e(Cr,lv),e(De,dv),e(De,pt),k(Mr,pt,null),e(pt,cv),e(pt,Ro),e(Ro,pv),e(Ro,nl),e(nl,hv),e(Ro,mv),e(Ro,Hd),e(Hd,uv),e(Ro,fv),e(pt,gv),k(Za,pt,null),e(pt,_v),k(en,pt,null),e(pt,vv),k(tn,pt,null),b(o,xp,_),b(o,Go,_),e(Go,on),e(on,Rd),k(jr,Rd,null),e(Go,bv),e(Go,Gd),e(Gd,wv),b(o,Dp,_),b(o,Fe,_),k(Er,Fe,null),e(Fe,Tv),e(Fe,Qo),e(Qo,kv),e(Qo,Qd),e(Qd,yv),e(Qo,$v),e(Qo,Ud),e(Ud,Vv),e(Qo,xv),e(Fe,Dv),e(Fe,qr),e(qr,Fv),e(qr,Pr),e(Pr,Cv),e(qr,Av),e(Fe,Mv),e(Fe,zr),e(zr,jv),e(zr,sl),e(sl,Ev),e(zr,qv),e(Fe,Pv),e(Fe,Sr),e(Sr,zv),e(Sr,Or),e(Or,Sv),e(Sr,Ov),e(Fe,Iv),e(Fe,ht),k(Ir,ht,null),e(ht,Lv),e(ht,Uo),e(Uo,Nv),e(Uo,rl),e(rl,Wv),e(Uo,Bv),e(Uo,Xd),e(Xd,Hv),e(Uo,Rv),e(ht,Gv),k(an,ht,null),e(ht,Qv),k(nn,ht,null),e(ht,Uv),k(sn,ht,null),b(o,Fp,_),b(o,Xo,_),e(Xo,rn),e(rn,Jd),k(Lr,Jd,null),e(Xo,Xv),e(Xo,Kd),e(Kd,Jv),b(o,Cp,_),b(o,Zt,_),k(Nr,Zt,null),e(Zt,Kv),e(Zt,Wr),e(Wr,Yv),e(Wr,Br),e(Br,Zv),e(Wr,eb),e(Zt,tb),e(Zt,zt),k(Hr,zt,null),e(zt,ob),e(zt,Jo),e(Jo,ab),e(Jo,il),e(il,nb),e(Jo,sb),e(Jo,Yd),e(Yd,rb),e(Jo,ib),e(zt,lb),k(ln,zt,null),e(zt,db),k(dn,zt,null),b(o,Ap,_),b(o,Ko,_),e(Ko,cn),e(cn,Zd),k(Rr,Zd,null),e(Ko,cb),e(Ko,ec),e(ec,pb),b(o,Mp,_),b(o,_t,_),k(Gr,_t,null),e(_t,hb),e(_t,tc),e(tc,mb),e(_t,ub),e(_t,Qr),e(Qr,fb),e(Qr,Ur),e(Ur,gb),e(Qr,_b),e(_t,vb),e(_t,St),k(Xr,St,null),e(St,bb),e(St,Yo),e(Yo,wb),e(Yo,ll),e(ll,Tb),e(Yo,kb),e(Yo,oc),e(oc,yb),e(Yo,$b),e(St,Vb),k(pn,St,null),e(St,xb),k(hn,St,null),b(o,jp,_),b(o,Zo,_),e(Zo,mn),e(mn,ac),k(Jr,ac,null),e(Zo,Db),e(Zo,nc),e(nc,Fb),b(o,Ep,_),b(o,vt,_),k(Kr,vt,null),e(vt,Cb),e(vt,sc),e(sc,Ab),e(vt,Mb),e(vt,Yr),e(Yr,jb),e(Yr,Zr),e(Zr,Eb),e(Yr,qb),e(vt,Pb),e(vt,Ot),k(ei,Ot,null),e(Ot,zb),e(Ot,ea),e(ea,Sb),e(ea,dl),e(dl,Ob),e(ea,Ib),e(ea,rc),e(rc,Lb),e(ea,Nb),e(Ot,Wb),k(un,Ot,null),e(Ot,Bb),k(fn,Ot,null),b(o,qp,_),b(o,ta,_),e(ta,gn),e(gn,ic),k(ti,ic,null),e(ta,Hb),e(ta,lc),e(lc,Rb),b(o,Pp,_),b(o,it,_),k(oi,it,null),e(it,Gb),e(it,ai),e(ai,Qb),e(ai,cl),e(cl,Ub),e(ai,Xb),e(it,Jb),e(it,ni),e(ni,Kb),e(ni,si),e(si,Yb),e(ni,Zb),e(it,ew),k(_n,it,null),e(it,tw),e(it,It),k(ri,It,null),e(It,ow),e(It,oa),e(oa,aw),e(oa,pl),e(pl,nw),e(oa,sw),e(oa,dc),e(dc,rw),e(oa,iw),e(It,lw),k(vn,It,null),e(It,dw),k(bn,It,null),b(o,zp,_),b(o,aa,_),e(aa,wn),e(wn,cc),k(ii,cc,null),e(aa,cw),e(aa,pc),e(pc,pw),b(o,Sp,_),b(o,Ce,_),k(li,Ce,null),e(Ce,hw),e(Ce,hc),e(hc,mw),e(Ce,uw),e(Ce,di),e(di,fw),e(di,hl),e(hl,gw),e(di,_w),e(Ce,vw),e(Ce,ci),e(ci,bw),e(ci,pi),e(pi,ww),e(ci,Tw),e(Ce,kw),k(Tn,Ce,null),e(Ce,yw),e(Ce,Lt),k(hi,Lt,null),e(Lt,$w),e(Lt,na),e(na,Vw),e(na,ml),e(ml,xw),e(na,Dw),e(na,mc),e(mc,Fw),e(na,Cw),e(Lt,Aw),k(kn,Lt,null),e(Lt,Mw),k(yn,Lt,null),b(o,Op,_),b(o,sa,_),e(sa,$n),e($n,uc),k(mi,uc,null),e(sa,jw),e(sa,fc),e(fc,Ew),b(o,Ip,_),b(o,Ae,_),k(ui,Ae,null),e(Ae,qw),e(Ae,gc),e(gc,Pw),e(Ae,zw),e(Ae,fi),e(fi,Sw),e(fi,ul),e(ul,Ow),e(fi,Iw),e(Ae,Lw),e(Ae,gi),e(gi,Nw),e(gi,_i),e(_i,Ww),e(gi,Bw),e(Ae,Hw),k(Vn,Ae,null),e(Ae,Rw),e(Ae,Nt),k(vi,Nt,null),e(Nt,Gw),e(Nt,ra),e(ra,Qw),e(ra,fl),e(fl,Uw),e(ra,Xw),e(ra,_c),e(_c,Jw),e(ra,Kw),e(Nt,Yw),k(xn,Nt,null),e(Nt,Zw),k(Dn,Nt,null),Lp=!0},p(o,[_]){const bi={};_&2&&(bi.$$scope={dirty:_,ctx:o}),ca.$set(bi);const vc={};_&2&&(vc.$$scope={dirty:_,ctx:o}),ha.$set(vc);const bc={};_&2&&(bc.$$scope={dirty:_,ctx:o}),ua.$set(bc);const wc={};_&2&&(wc.$$scope={dirty:_,ctx:o}),ga.$set(wc);const wi={};_&2&&(wi.$$scope={dirty:_,ctx:o}),_a.$set(wi);const Tc={};_&2&&(Tc.$$scope={dirty:_,ctx:o}),ba.$set(Tc);const kc={};_&2&&(kc.$$scope={dirty:_,ctx:o}),wa.$set(kc);const yc={};_&2&&(yc.$$scope={dirty:_,ctx:o}),ka.$set(yc);const Ti={};_&2&&(Ti.$$scope={dirty:_,ctx:o}),ya.$set(Ti);const $c={};_&2&&($c.$$scope={dirty:_,ctx:o}),$a.$set($c);const Vc={};_&2&&(Vc.$$scope={dirty:_,ctx:o}),xa.$set(Vc);const xc={};_&2&&(xc.$$scope={dirty:_,ctx:o}),Da.$set(xc);const ki={};_&2&&(ki.$$scope={dirty:_,ctx:o}),Fa.$set(ki);const Dc={};_&2&&(Dc.$$scope={dirty:_,ctx:o}),Aa.$set(Dc);const Fc={};_&2&&(Fc.$$scope={dirty:_,ctx:o}),Ma.$set(Fc);const bt={};_&2&&(bt.$$scope={dirty:_,ctx:o}),qa.$set(bt);const Cc={};_&2&&(Cc.$$scope={dirty:_,ctx:o}),Pa.$set(Cc);const yi={};_&2&&(yi.$$scope={dirty:_,ctx:o}),Sa.$set(yi);const Ac={};_&2&&(Ac.$$scope={dirty:_,ctx:o}),Oa.$set(Ac);const $i={};_&2&&($i.$$scope={dirty:_,ctx:o}),La.$set($i);const Mc={};_&2&&(Mc.$$scope={dirty:_,ctx:o}),Na.$set(Mc);const Vi={};_&2&&(Vi.$$scope={dirty:_,ctx:o}),Wa.$set(Vi);const jc={};_&2&&(jc.$$scope={dirty:_,ctx:o}),Ha.$set(jc);const xi={};_&2&&(xi.$$scope={dirty:_,ctx:o}),Ra.$set(xi);const Ec={};_&2&&(Ec.$$scope={dirty:_,ctx:o}),Ga.$set(Ec);const wt={};_&2&&(wt.$$scope={dirty:_,ctx:o}),Qa.$set(wt);const qc={};_&2&&(qc.$$scope={dirty:_,ctx:o}),Ua.$set(qc);const Pc={};_&2&&(Pc.$$scope={dirty:_,ctx:o}),Ja.$set(Pc);const zc={};_&2&&(zc.$$scope={dirty:_,ctx:o}),Ka.$set(zc);const Sc={};_&2&&(Sc.$$scope={dirty:_,ctx:o}),Za.$set(Sc);const ia={};_&2&&(ia.$$scope={dirty:_,ctx:o}),en.$set(ia);const Oc={};_&2&&(Oc.$$scope={dirty:_,ctx:o}),tn.$set(Oc);const Ic={};_&2&&(Ic.$$scope={dirty:_,ctx:o}),an.$set(Ic);const Di={};_&2&&(Di.$$scope={dirty:_,ctx:o}),nn.$set(Di);const Lc={};_&2&&(Lc.$$scope={dirty:_,ctx:o}),sn.$set(Lc);const Nc={};_&2&&(Nc.$$scope={dirty:_,ctx:o}),ln.$set(Nc);const Wc={};_&2&&(Wc.$$scope={dirty:_,ctx:o}),dn.$set(Wc);const eo={};_&2&&(eo.$$scope={dirty:_,ctx:o}),pn.$set(eo);const to={};_&2&&(to.$$scope={dirty:_,ctx:o}),hn.$set(to);const Bc={};_&2&&(Bc.$$scope={dirty:_,ctx:o}),un.$set(Bc);const Hc={};_&2&&(Hc.$$scope={dirty:_,ctx:o}),fn.$set(Hc);const Rc={};_&2&&(Rc.$$scope={dirty:_,ctx:o}),_n.$set(Rc);const la={};_&2&&(la.$$scope={dirty:_,ctx:o}),vn.$set(la);const Gc={};_&2&&(Gc.$$scope={dirty:_,ctx:o}),bn.$set(Gc);const Qc={};_&2&&(Qc.$$scope={dirty:_,ctx:o}),Tn.$set(Qc);const Fi={};_&2&&(Fi.$$scope={dirty:_,ctx:o}),kn.$set(Fi);const Uc={};_&2&&(Uc.$$scope={dirty:_,ctx:o}),yn.$set(Uc);const Xc={};_&2&&(Xc.$$scope={dirty:_,ctx:o}),Vn.$set(Xc);const Jc={};_&2&&(Jc.$$scope={dirty:_,ctx:o}),xn.$set(Jc);const oo={};_&2&&(oo.$$scope={dirty:_,ctx:o}),Dn.$set(oo)},i(o){Lp||(y(s.$$.fragment,o),y(C.$$.fragment,o),y(Hn.$$.fragment,o),y(Rn.$$.fragment,o),y(ca.$$.fragment,o),y(Qn.$$.fragment,o),y(Un.$$.fragment,o),y(ha.$$.fragment,o),y(Jn.$$.fragment,o),y(Kn.$$.fragment,o),y(ua.$$.fragment,o),y(Zn.$$.fragment,o),y(es.$$.fragment,o),y(rs.$$.fragment,o),y(ga.$$.fragment,o),y(_a.$$.fragment,o),y(is.$$.fragment,o),y(ls.$$.fragment,o),y(us.$$.fragment,o),y(ba.$$.fragment,o),y(wa.$$.fragment,o),y(fs.$$.fragment,o),y(gs.$$.fragment,o),y(Ts.$$.fragment,o),y(ka.$$.fragment,o),y(ya.$$.fragment,o),y($a.$$.fragment,o),y(ks.$$.fragment,o),y(ys.$$.fragment,o),y(Cs.$$.fragment,o),y(xa.$$.fragment,o),y(Da.$$.fragment,o),y(Fa.$$.fragment,o),y(As.$$.fragment,o),y(Ms.$$.fragment,o),y(Ss.$$.fragment,o),y(Aa.$$.fragment,o),y(Ma.$$.fragment,o),y(Os.$$.fragment,o),y(Is.$$.fragment,o),y(Qs.$$.fragment,o),y(qa.$$.fragment,o),y(Pa.$$.fragment,o),y(Us.$$.fragment,o),y(Xs.$$.fragment,o),y(er.$$.fragment,o),y(Sa.$$.fragment,o),y(Oa.$$.fragment,o),y(tr.$$.fragment,o),y(or.$$.fragment,o),y(ir.$$.fragment,o),y(La.$$.fragment,o),y(Na.$$.fragment,o),y(Wa.$$.fragment,o),y(lr.$$.fragment,o),y(dr.$$.fragment,o),y(fr.$$.fragment,o),y(Ha.$$.fragment,o),y(Ra.$$.fragment,o),y(Ga.$$.fragment,o),y(Qa.$$.fragment,o),y(Ua.$$.fragment,o),y(gr.$$.fragment,o),y(_r.$$.fragment,o),y(yr.$$.fragment,o),y(Ja.$$.fragment,o),y(Ka.$$.fragment,o),y($r.$$.fragment,o),y(Vr.$$.fragment,o),y(Mr.$$.fragment,o),y(Za.$$.fragment,o),y(en.$$.fragment,o),y(tn.$$.fragment,o),y(jr.$$.fragment,o),y(Er.$$.fragment,o),y(Ir.$$.fragment,o),y(an.$$.fragment,o),y(nn.$$.fragment,o),y(sn.$$.fragment,o),y(Lr.$$.fragment,o),y(Nr.$$.fragment,o),y(Hr.$$.fragment,o),y(ln.$$.fragment,o),y(dn.$$.fragment,o),y(Rr.$$.fragment,o),y(Gr.$$.fragment,o),y(Xr.$$.fragment,o),y(pn.$$.fragment,o),y(hn.$$.fragment,o),y(Jr.$$.fragment,o),y(Kr.$$.fragment,o),y(ei.$$.fragment,o),y(un.$$.fragment,o),y(fn.$$.fragment,o),y(ti.$$.fragment,o),y(oi.$$.fragment,o),y(_n.$$.fragment,o),y(ri.$$.fragment,o),y(vn.$$.fragment,o),y(bn.$$.fragment,o),y(ii.$$.fragment,o),y(li.$$.fragment,o),y(Tn.$$.fragment,o),y(hi.$$.fragment,o),y(kn.$$.fragment,o),y(yn.$$.fragment,o),y(mi.$$.fragment,o),y(ui.$$.fragment,o),y(Vn.$$.fragment,o),y(vi.$$.fragment,o),y(xn.$$.fragment,o),y(Dn.$$.fragment,o),Lp=!0)},o(o){$(s.$$.fragment,o),$(C.$$.fragment,o),$(Hn.$$.fragment,o),$(Rn.$$.fragment,o),$(ca.$$.fragment,o),$(Qn.$$.fragment,o),$(Un.$$.fragment,o),$(ha.$$.fragment,o),$(Jn.$$.fragment,o),$(Kn.$$.fragment,o),$(ua.$$.fragment,o),$(Zn.$$.fragment,o),$(es.$$.fragment,o),$(rs.$$.fragment,o),$(ga.$$.fragment,o),$(_a.$$.fragment,o),$(is.$$.fragment,o),$(ls.$$.fragment,o),$(us.$$.fragment,o),$(ba.$$.fragment,o),$(wa.$$.fragment,o),$(fs.$$.fragment,o),$(gs.$$.fragment,o),$(Ts.$$.fragment,o),$(ka.$$.fragment,o),$(ya.$$.fragment,o),$($a.$$.fragment,o),$(ks.$$.fragment,o),$(ys.$$.fragment,o),$(Cs.$$.fragment,o),$(xa.$$.fragment,o),$(Da.$$.fragment,o),$(Fa.$$.fragment,o),$(As.$$.fragment,o),$(Ms.$$.fragment,o),$(Ss.$$.fragment,o),$(Aa.$$.fragment,o),$(Ma.$$.fragment,o),$(Os.$$.fragment,o),$(Is.$$.fragment,o),$(Qs.$$.fragment,o),$(qa.$$.fragment,o),$(Pa.$$.fragment,o),$(Us.$$.fragment,o),$(Xs.$$.fragment,o),$(er.$$.fragment,o),$(Sa.$$.fragment,o),$(Oa.$$.fragment,o),$(tr.$$.fragment,o),$(or.$$.fragment,o),$(ir.$$.fragment,o),$(La.$$.fragment,o),$(Na.$$.fragment,o),$(Wa.$$.fragment,o),$(lr.$$.fragment,o),$(dr.$$.fragment,o),$(fr.$$.fragment,o),$(Ha.$$.fragment,o),$(Ra.$$.fragment,o),$(Ga.$$.fragment,o),$(Qa.$$.fragment,o),$(Ua.$$.fragment,o),$(gr.$$.fragment,o),$(_r.$$.fragment,o),$(yr.$$.fragment,o),$(Ja.$$.fragment,o),$(Ka.$$.fragment,o),$($r.$$.fragment,o),$(Vr.$$.fragment,o),$(Mr.$$.fragment,o),$(Za.$$.fragment,o),$(en.$$.fragment,o),$(tn.$$.fragment,o),$(jr.$$.fragment,o),$(Er.$$.fragment,o),$(Ir.$$.fragment,o),$(an.$$.fragment,o),$(nn.$$.fragment,o),$(sn.$$.fragment,o),$(Lr.$$.fragment,o),$(Nr.$$.fragment,o),$(Hr.$$.fragment,o),$(ln.$$.fragment,o),$(dn.$$.fragment,o),$(Rr.$$.fragment,o),$(Gr.$$.fragment,o),$(Xr.$$.fragment,o),$(pn.$$.fragment,o),$(hn.$$.fragment,o),$(Jr.$$.fragment,o),$(Kr.$$.fragment,o),$(ei.$$.fragment,o),$(un.$$.fragment,o),$(fn.$$.fragment,o),$(ti.$$.fragment,o),$(oi.$$.fragment,o),$(_n.$$.fragment,o),$(ri.$$.fragment,o),$(vn.$$.fragment,o),$(bn.$$.fragment,o),$(ii.$$.fragment,o),$(li.$$.fragment,o),$(Tn.$$.fragment,o),$(hi.$$.fragment,o),$(kn.$$.fragment,o),$(yn.$$.fragment,o),$(mi.$$.fragment,o),$(ui.$$.fragment,o),$(Vn.$$.fragment,o),$(vi.$$.fragment,o),$(xn.$$.fragment,o),$(Dn.$$.fragment,o),Lp=!1},d(o){t(d),o&&t(g),o&&t(c),V(s),o&&t(Me),o&&t(B),V(C),o&&t(je),o&&t(H),o&&t(Ee),o&&t(R),o&&t(qe),o&&t(G),o&&t(Pe),o&&t(Q),o&&t(ze),o&&t(P),o&&t(M),o&&t(J),o&&t(ue),o&&t(fe),o&&t(Yc),o&&t(uo),V(Hn),o&&t(Zc),o&&t(ft),V(Rn),V(ca),o&&t(ep),o&&t(go),V(Qn),o&&t(tp),o&&t(gt),V(Un),V(ha),o&&t(op),o&&t(bo),V(Jn),o&&t(ap),o&&t(Yt),V(Kn),V(ua),o&&t(np),o&&t(To),V(Zn),o&&t(sp),o&&t(at),V(es),V(rs),V(ga),V(_a),o&&t(rp),o&&t(yo),V(is),o&&t(ip),o&&t(Te),V(ls),V(us),V(ba),V(wa),o&&t(lp),o&&t(Vo),V(fs),o&&t(dp),o&&t(nt),V(gs),V(Ts),V(ka),V(ya),V($a),o&&t(cp),o&&t(Fo),V(ks),o&&t(pp),o&&t(ke),V(ys),V(Cs),V(xa),V(Da),V(Fa),o&&t(hp),o&&t(Ao),V(As),o&&t(mp),o&&t(ye),V(Ms),V(Ss),V(Aa),V(Ma),o&&t(up),o&&t(jo),V(Os),o&&t(fp),o&&t(re),V(Is),V(Qs),V(qa),V(Pa),o&&t(gp),o&&t(qo),V(Us),o&&t(_p),o&&t(st),V(Xs),V(er),V(Sa),V(Oa),o&&t(vp),o&&t(So),V(tr),o&&t(bp),o&&t(rt),V(or),V(ir),V(La),V(Na),V(Wa),o&&t(wp),o&&t(Lo),V(lr),o&&t(Tp),o&&t(Ve),V(dr),V(fr),V(Ha),V(Ra),V(Ga),V(Qa),V(Ua),o&&t(kp),o&&t(Wo),V(gr),o&&t(yp),o&&t(xe),V(_r),V(yr),V(Ja),V(Ka),o&&t($p),o&&t(Ho),V($r),o&&t(Vp),o&&t(De),V(Vr),V(Mr),V(Za),V(en),V(tn),o&&t(xp),o&&t(Go),V(jr),o&&t(Dp),o&&t(Fe),V(Er),V(Ir),V(an),V(nn),V(sn),o&&t(Fp),o&&t(Xo),V(Lr),o&&t(Cp),o&&t(Zt),V(Nr),V(Hr),V(ln),V(dn),o&&t(Ap),o&&t(Ko),V(Rr),o&&t(Mp),o&&t(_t),V(Gr),V(Xr),V(pn),V(hn),o&&t(jp),o&&t(Zo),V(Jr),o&&t(Ep),o&&t(vt),V(Kr),V(ei),V(un),V(fn),o&&t(qp),o&&t(ta),V(ti),o&&t(Pp),o&&t(it),V(oi),V(_n),V(ri),V(vn),V(bn),o&&t(zp),o&&t(aa),V(ii),o&&t(Sp),o&&t(Ce),V(li),V(Tn),V(hi),V(kn),V(yn),o&&t(Op),o&&t(sa),V(mi),o&&t(Ip),o&&t(Ae),V(ui),V(Vn),V(vi),V(xn),V(Dn)}}}const l$={local:"data2vec",sections:[{local:"overview",title:"Overview"},{local:"transformers.Data2VecTextConfig",title:"Data2VecTextConfig"},{local:"transformers.Data2VecAudioConfig",title:"Data2VecAudioConfig"},{local:"transformers.Data2VecVisionConfig",title:"Data2VecVisionConfig"},{local:"transformers.Data2VecAudioModel",title:"Data2VecAudioModel"},{local:"transformers.Data2VecAudioForAudioFrameClassification",title:"Data2VecAudioForAudioFrameClassification"},{local:"transformers.Data2VecAudioForCTC",title:"Data2VecAudioForCTC"},{local:"transformers.Data2VecAudioForSequenceClassification",title:"Data2VecAudioForSequenceClassification"},{local:"transformers.Data2VecAudioForXVector",title:"Data2VecAudioForXVector"},{local:"transformers.Data2VecTextModel",title:"Data2VecTextModel"},{local:"transformers.Data2VecTextForCausalLM",title:"Data2VecTextForCausalLM"},{local:"transformers.Data2VecTextForMaskedLM",title:"Data2VecTextForMaskedLM"},{local:"transformers.Data2VecTextForSequenceClassification",title:"Data2VecTextForSequenceClassification"},{local:"transformers.Data2VecTextForMultipleChoice",title:"Data2VecTextForMultipleChoice"},{local:"transformers.Data2VecTextForTokenClassification",title:"Data2VecTextForTokenClassification"},{local:"transformers.Data2VecTextForQuestionAnswering",title:"Data2VecTextForQuestionAnswering"},{local:"transformers.Data2VecVisionModel",title:"Data2VecVisionModel"},{local:"transformers.Data2VecVisionForImageClassification",title:"Data2VecVisionForImageClassification"},{local:"transformers.Data2VecVisionForSemanticSegmentation",title:"Data2VecVisionForSemanticSegmentation"},{local:"transformers.TFData2VecVisionModel",title:"TFData2VecVisionModel"},{local:"transformers.TFData2VecVisionForImageClassification",title:"TFData2VecVisionForImageClassification"},{local:"transformers.TFData2VecVisionForSemanticSegmentation",title:"TFData2VecVisionForSemanticSegmentation"}],title:"Data2Vec"};function d$(x){return cy(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class g$ extends ry{constructor(d){super();iy(this,d,d$,i$,ly,{})}}export{g$ as default,l$ as metadata};
