import{s as _n,o as vn,n as L}from"../chunks/scheduler.25b97de1.js";import{S as bn,i as yn,g as i,s,r as u,A as wn,h as c,f as a,c as r,j as V,u as h,x as f,k as C,y as o,a as d,v as g,d as _,t as v,w as b}from"../chunks/index.d9030fc9.js";import{T as It}from"../chunks/Tip.baa67368.js";import{D as B}from"../chunks/Docstring.e257edda.js";import{C as qt}from"../chunks/CodeBlock.e6cd0d95.js";import{E as Xt}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{P as gn}from"../chunks/PipelineTag.5f100392.js";import{H as St,E as Mn}from"../chunks/EditOnGithub.91d95064.js";function Tn(T){let t,y="Example:",m,p,w;return p=new qt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFdhdjJWZWMyQmVydENvbmZpZyUyQyUyMFdhdjJWZWMyQmVydE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMFdhdjJWZWMyQmVydCUyMGZhY2Vib29rJTJGd2F2MnZlYzItYmVydC1yZWwtcG9zLWxhcmdlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMFdhdjJWZWMyQmVydENvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBmYWNlYm9vayUyRndhdjJ2ZWMyLWJlcnQtcmVsLXBvcy1sYXJnZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwV2F2MlZlYzJCZXJ0TW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2BertConfig, Wav2Vec2BertModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Wav2Vec2Bert facebook/wav2vec2-bert-rel-pos-large style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Wav2Vec2BertConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the facebook/wav2vec2-bert-rel-pos-large style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2BertModel(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`,wrap:!1}}),{c(){t=i("p"),t.textContent=y,m=s(),u(p.$$.fragment)},l(n){t=c(n,"P",{"data-svelte-h":!0}),f(t)!=="svelte-11lpom8"&&(t.textContent=y),m=r(n),h(p.$$.fragment,n)},m(n,M){d(n,t,M),d(n,m,M),g(p,n,M),w=!0},p:L,i(n){w||(_(p.$$.fragment,n),w=!0)},o(n){v(p.$$.fragment,n),w=!1},d(n){n&&(a(t),a(m)),b(p,n)}}}function Wn(T){let t,y=`This class method is simply calling <a href="/docs/transformers/pr_31208/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.save_pretrained">save_pretrained()</a> and
<a href="/docs/transformers/pr_31208/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.save_pretrained">save_pretrained()</a>. Please refer to the docstrings of the
methods above for more information.`;return{c(){t=i("p"),t.innerHTML=y},l(m){t=c(m,"P",{"data-svelte-h":!0}),f(t)!=="svelte-5wo81q"&&(t.innerHTML=y)},m(m,p){d(m,t,p)},p:L,d(m){m&&a(t)}}}function kn(T){let t,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=i("p"),t.innerHTML=y},l(m){t=c(m,"P",{"data-svelte-h":!0}),f(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(m,p){d(m,t,p)},p:L,d(m){m&&a(t)}}}function Vn(T){let t,y="Example:",m,p,w;return p=new qt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBXYXYyVmVjMkJlcnRNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJoZi1pbnRlcm5hbC10ZXN0aW5nJTJGbGlicmlzcGVlY2hfYXNyX2RlbW8lMjIlMkMlMjAlMjJjbGVhbiUyMiUyQyUyMHNwbGl0JTNEJTIydmFsaWRhdGlvbiUyMiklMEFkYXRhc2V0JTIwJTNEJTIwZGF0YXNldC5zb3J0KCUyMmlkJTIyKSUwQXNhbXBsaW5nX3JhdGUlMjAlM0QlMjBkYXRhc2V0LmZlYXR1cmVzJTVCJTIyYXVkaW8lMjIlNUQuc2FtcGxpbmdfcmF0ZSUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmhmLWF1ZGlvJTJGd2F2MnZlYzItYmVydC1DVjE2LWVuJTIyKSUwQW1vZGVsJTIwJTNEJTIwV2F2MlZlYzJCZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmhmLWF1ZGlvJTJGd2F2MnZlYzItYmVydC1DVjE2LWVuJTIyKSUwQSUwQSUyMyUyMGF1ZGlvJTIwZmlsZSUyMGlzJTIwZGVjb2RlZCUyMG9uJTIwdGhlJTIwZmx5JTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGRhdGFzZXQlNUIwJTVEJTVCJTIyYXVkaW8lMjIlNUQlNUIlMjJhcnJheSUyMiU1RCUyQyUyMHNhbXBsaW5nX3JhdGUlM0RzYW1wbGluZ19yYXRlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, Wav2Vec2BertModel
<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 = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;hf-audio/wav2vec2-bert-CV16-en&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2BertModel.from_pretrained(<span class="hljs-string">&quot;hf-audio/wav2vec2-bert-CV16-en&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">146</span>, <span class="hljs-number">1024</span>]`,wrap:!1}}),{c(){t=i("p"),t.textContent=y,m=s(),u(p.$$.fragment)},l(n){t=c(n,"P",{"data-svelte-h":!0}),f(t)!=="svelte-11lpom8"&&(t.textContent=y),m=r(n),h(p.$$.fragment,n)},m(n,M){d(n,t,M),d(n,m,M),g(p,n,M),w=!0},p:L,i(n){w||(_(p.$$.fragment,n),w=!0)},o(n){v(p.$$.fragment,n),w=!1},d(n){n&&(a(t),a(m)),b(p,n)}}}function Cn(T){let t,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=i("p"),t.innerHTML=y},l(m){t=c(m,"P",{"data-svelte-h":!0}),f(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(m,p){d(m,t,p)},p:L,d(m){m&&a(t)}}}function Bn(T){let t,y="Example:",m,p,w;return p=new qt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBXYXYyVmVjMkJlcnRGb3JDVEMlMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaGYtaW50ZXJuYWwtdGVzdGluZyUyRmxpYnJpc3BlZWNoX2Fzcl9kZW1vJTIyJTJDJTIwJTIyY2xlYW4lMjIlMkMlMjBzcGxpdCUzRCUyMnZhbGlkYXRpb24lMjIpJTBBZGF0YXNldCUyMCUzRCUyMGRhdGFzZXQuc29ydCglMjJpZCUyMiklMEFzYW1wbGluZ19yYXRlJTIwJTNEJTIwZGF0YXNldC5mZWF0dXJlcyU1QiUyMmF1ZGlvJTIyJTVELnNhbXBsaW5nX3JhdGUlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJoZi1hdWRpbyUyRndhdjJ2ZWMyLWJlcnQtQ1YxNi1lbiUyMiklMEFtb2RlbCUyMCUzRCUyMFdhdjJWZWMyQmVydEZvckNUQy5mcm9tX3ByZXRyYWluZWQoJTIyaGYtYXVkaW8lMkZ3YXYydmVjMi1iZXJ0LUNWMTYtZW4lMjIpJTBBJTBBJTIzJTIwYXVkaW8lMjBmaWxlJTIwaXMlMjBkZWNvZGVkJTIwb24lMjB0aGUlMjBmbHklMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoZGF0YXNldCU1QjAlNUQlNUIlMjJhdWRpbyUyMiU1RCU1QiUyMmFycmF5JTIyJTVEJTJDJTIwc2FtcGxpbmdfcmF0ZSUzRHNhbXBsaW5nX3JhdGUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBcHJlZGljdGVkX2lkcyUyMCUzRCUyMHRvcmNoLmFyZ21heChsb2dpdHMlMkMlMjBkaW0lM0QtMSklMEElMEElMjMlMjB0cmFuc2NyaWJlJTIwc3BlZWNoJTBBdHJhbnNjcmlwdGlvbiUyMCUzRCUyMHByb2Nlc3Nvci5iYXRjaF9kZWNvZGUocHJlZGljdGVkX2lkcyklMEF0cmFuc2NyaXB0aW9uJTVCMCU1RCUwQSUwQWlucHV0cyU1QiUyMmxhYmVscyUyMiU1RCUyMCUzRCUyMHByb2Nlc3Nvcih0ZXh0JTNEZGF0YXNldCU1QjAlNUQlNUIlMjJ0ZXh0JTIyJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikuaW5wdXRfaWRzJTBBJTBBJTIzJTIwY29tcHV0ZSUyMGxvc3MlMEFsb3NzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvc3MlMEFyb3VuZChsb3NzLml0ZW0oKSUyQyUyMDIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, Wav2Vec2BertForCTC
<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 = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;hf-audio/wav2vec2-bert-CV16-en&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2BertForCTC.from_pretrained(<span class="hljs-string">&quot;hf-audio/wav2vec2-bert-CV16-en&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;mr quilter is the apostle of the middle classes and we are glad to welcome his gospel&#x27;</span>

<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">17.04</span>`,wrap:!1}}),{c(){t=i("p"),t.textContent=y,m=s(),u(p.$$.fragment)},l(n){t=c(n,"P",{"data-svelte-h":!0}),f(t)!=="svelte-11lpom8"&&(t.textContent=y),m=r(n),h(p.$$.fragment,n)},m(n,M){d(n,t,M),d(n,m,M),g(p,n,M),w=!0},p:L,i(n){w||(_(p.$$.fragment,n),w=!0)},o(n){v(p.$$.fragment,n),w=!1},d(n){n&&(a(t),a(m)),b(p,n)}}}function jn(T){let t,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=i("p"),t.innerHTML=y},l(m){t=c(m,"P",{"data-svelte-h":!0}),f(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(m,p){d(m,t,p)},p:L,d(m){m&&a(t)}}}function xn(T){let t,y="Example:",m,p,w;return p=new qt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yJTJDJTIwV2F2MlZlYzJCZXJ0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbiUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJoZi1pbnRlcm5hbC10ZXN0aW5nJTJGbGlicmlzcGVlY2hfYXNyX2RlbW8lMjIlMkMlMjAlMjJjbGVhbiUyMiUyQyUyMHNwbGl0JTNEJTIydmFsaWRhdGlvbiUyMiklMEFkYXRhc2V0JTIwJTNEJTIwZGF0YXNldC5zb3J0KCUyMmlkJTIyKSUwQXNhbXBsaW5nX3JhdGUlMjAlM0QlMjBkYXRhc2V0LmZlYXR1cmVzJTVCJTIyYXVkaW8lMjIlNUQuc2FtcGxpbmdfcmF0ZSUwQSUwQWZlYXR1cmVfZXh0cmFjdG9yJTIwJTNEJTIwQXV0b0ZlYXR1cmVFeHRyYWN0b3IuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGdzJ2LWJlcnQtMi4wJTIyKSUwQW1vZGVsJTIwJTNEJTIwV2F2MlZlYzJCZXJ0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3MnYtYmVydC0yLjAlMjIpJTBBJTBBJTIzJTIwYXVkaW8lMjBmaWxlJTIwaXMlMjBkZWNvZGVkJTIwb24lMjB0aGUlMjBmbHklMEFpbnB1dHMlMjAlM0QlMjBmZWF0dXJlX2V4dHJhY3RvcihkYXRhc2V0JTVCMCU1RCU1QiUyMmF1ZGlvJTIyJTVEJTVCJTIyYXJyYXklMjIlNUQlMkMlMjBzYW1wbGluZ19yYXRlJTNEc2FtcGxpbmdfcmF0ZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWRzJTIwJTNEJTIwdG9yY2guYXJnbWF4KGxvZ2l0cyUyQyUyMGRpbSUzRC0xKS5pdGVtKCklMEFwcmVkaWN0ZWRfbGFiZWwlMjAlM0QlMjBtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfY2xhc3NfaWRzJTVEJTBBJTBBJTIzJTIwY29tcHV0ZSUyMGxvc3MlMjAtJTIwdGFyZ2V0X2xhYmVsJTIwaXMlMjBlLmcuJTIwJTIyZG93biUyMiUwQXRhcmdldF9sYWJlbCUyMCUzRCUyMG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QjAlNUQlMEFpbnB1dHMlNUIlMjJsYWJlbHMlMjIlNUQlMjAlM0QlMjB0b3JjaC50ZW5zb3IoJTVCbW9kZWwuY29uZmlnLmxhYmVsMmlkJTVCdGFyZ2V0X2xhYmVsJTVEJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, Wav2Vec2BertForSequenceClassification
<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 = AutoFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;facebook/w2v-bert-2.0&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2BertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/w2v-bert-2.0&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><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`,wrap:!1}}),{c(){t=i("p"),t.textContent=y,m=s(),u(p.$$.fragment)},l(n){t=c(n,"P",{"data-svelte-h":!0}),f(t)!=="svelte-11lpom8"&&(t.textContent=y),m=r(n),h(p.$$.fragment,n)},m(n,M){d(n,t,M),d(n,m,M),g(p,n,M),w=!0},p:L,i(n){w||(_(p.$$.fragment,n),w=!0)},o(n){v(p.$$.fragment,n),w=!1},d(n){n&&(a(t),a(m)),b(p,n)}}}function $n(T){let t,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=i("p"),t.innerHTML=y},l(m){t=c(m,"P",{"data-svelte-h":!0}),f(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(m,p){d(m,t,p)},p:L,d(m){m&&a(t)}}}function Jn(T){let t,y="Example:",m,p,w;return p=new qt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yJTJDJTIwV2F2MlZlYzJCZXJ0Rm9yQXVkaW9GcmFtZUNsYXNzaWZpY2F0aW9uJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBaW1wb3J0JTIwdG9yY2glMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmhmLWludGVybmFsLXRlc3RpbmclMkZsaWJyaXNwZWVjaF9hc3JfZGVtbyUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWRhdGFzZXQlMjAlM0QlMjBkYXRhc2V0LnNvcnQoJTIyaWQlMjIpJTBBc2FtcGxpbmdfcmF0ZSUyMCUzRCUyMGRhdGFzZXQuZmVhdHVyZXMlNUIlMjJhdWRpbyUyMiU1RC5zYW1wbGluZ19yYXRlJTBBJTBBZmVhdHVyZV9leHRyYWN0b3IlMjAlM0QlMjBBdXRvRmVhdHVyZUV4dHJhY3Rvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3MnYtYmVydC0yLjAlMjIpJTBBbW9kZWwlMjAlM0QlMjBXYXYyVmVjMkJlcnRGb3JBdWRpb0ZyYW1lQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGdzJ2LWJlcnQtMi4wJTIyKSUwQSUwQSUyMyUyMGF1ZGlvJTIwZmlsZSUyMGlzJTIwZGVjb2RlZCUyMG9uJTIwdGhlJTIwZmx5JTBBaW5wdXRzJTIwJTNEJTIwZmVhdHVyZV9leHRyYWN0b3IoZGF0YXNldCU1QjAlNUQlNUIlMjJhdWRpbyUyMiU1RCU1QiUyMmFycmF5JTIyJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUyQyUyMHNhbXBsaW5nX3JhdGUlM0RzYW1wbGluZ19yYXRlKSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJvYmFiaWxpdGllcyUyMCUzRCUyMHRvcmNoLnNpZ21vaWQobG9naXRzJTVCMCU1RCklMEElMjMlMjBsYWJlbHMlMjBpcyUyMGElMjBvbmUtaG90JTIwYXJyYXklMjBvZiUyMHNoYXBlJTIwKG51bV9mcmFtZXMlMkMlMjBudW1fc3BlYWtlcnMpJTBBbGFiZWxzJTIwJTNEJTIwKHByb2JhYmlsaXRpZXMlMjAlM0UlMjAwLjUpLmxvbmcoKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, Wav2Vec2BertForAudioFrameClassification
<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 = AutoFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;facebook/w2v-bert-2.0&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2BertForAudioFrameClassification.from_pretrained(<span class="hljs-string">&quot;facebook/w2v-bert-2.0&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()`,wrap:!1}}),{c(){t=i("p"),t.textContent=y,m=s(),u(p.$$.fragment)},l(n){t=c(n,"P",{"data-svelte-h":!0}),f(t)!=="svelte-11lpom8"&&(t.textContent=y),m=r(n),h(p.$$.fragment,n)},m(n,M){d(n,t,M),d(n,m,M),g(p,n,M),w=!0},p:L,i(n){w||(_(p.$$.fragment,n),w=!0)},o(n){v(p.$$.fragment,n),w=!1},d(n){n&&(a(t),a(m)),b(p,n)}}}function Fn(T){let t,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=i("p"),t.innerHTML=y},l(m){t=c(m,"P",{"data-svelte-h":!0}),f(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(m,p){d(m,t,p)},p:L,d(m){m&&a(t)}}}function Un(T){let t,y="Example:",m,p,w;return p=new qt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yJTJDJTIwV2F2MlZlYzJCZXJ0Rm9yWFZlY3RvciUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJoZi1pbnRlcm5hbC10ZXN0aW5nJTJGbGlicmlzcGVlY2hfYXNyX2RlbW8lMjIlMkMlMjAlMjJjbGVhbiUyMiUyQyUyMHNwbGl0JTNEJTIydmFsaWRhdGlvbiUyMiklMEFkYXRhc2V0JTIwJTNEJTIwZGF0YXNldC5zb3J0KCUyMmlkJTIyKSUwQXNhbXBsaW5nX3JhdGUlMjAlM0QlMjBkYXRhc2V0LmZlYXR1cmVzJTVCJTIyYXVkaW8lMjIlNUQuc2FtcGxpbmdfcmF0ZSUwQSUwQWZlYXR1cmVfZXh0cmFjdG9yJTIwJTNEJTIwQXV0b0ZlYXR1cmVFeHRyYWN0b3IuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGdzJ2LWJlcnQtMi4wJTIyKSUwQW1vZGVsJTIwJTNEJTIwV2F2MlZlYzJCZXJ0Rm9yWFZlY3Rvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3MnYtYmVydC0yLjAlMjIpJTBBJTBBJTIzJTIwYXVkaW8lMjBmaWxlJTIwaXMlMjBkZWNvZGVkJTIwb24lMjB0aGUlMjBmbHklMEFpbnB1dHMlMjAlM0QlMjBmZWF0dXJlX2V4dHJhY3RvciglMEElMjAlMjAlMjAlMjAlNUJkJTVCJTIyYXJyYXklMjIlNUQlMjBmb3IlMjBkJTIwaW4lMjBkYXRhc2V0JTVCJTNBMiU1RCU1QiUyMmF1ZGlvJTIyJTVEJTVEJTJDJTIwc2FtcGxpbmdfcmF0ZSUzRHNhbXBsaW5nX3JhdGUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTIwcGFkZGluZyUzRFRydWUlMEEpJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGVtYmVkZGluZ3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykuZW1iZWRkaW5ncyUwQSUwQWVtYmVkZGluZ3MlMjAlM0QlMjB0b3JjaC5ubi5mdW5jdGlvbmFsLm5vcm1hbGl6ZShlbWJlZGRpbmdzJTJDJTIwZGltJTNELTEpLmNwdSgpJTBBJTBBJTIzJTIwdGhlJTIwcmVzdWx0aW5nJTIwZW1iZWRkaW5ncyUyMGNhbiUyMGJlJTIwdXNlZCUyMGZvciUyMGNvc2luZSUyMHNpbWlsYXJpdHktYmFzZWQlMjByZXRyaWV2YWwlMEFjb3NpbmVfc2ltJTIwJTNEJTIwdG9yY2gubm4uQ29zaW5lU2ltaWxhcml0eShkaW0lM0QtMSklMEFzaW1pbGFyaXR5JTIwJTNEJTIwY29zaW5lX3NpbShlbWJlZGRpbmdzJTVCMCU1RCUyQyUyMGVtYmVkZGluZ3MlNUIxJTVEKSUwQXRocmVzaG9sZCUyMCUzRCUyMDAuNyUyMCUyMCUyMyUyMHRoZSUyMG9wdGltYWwlMjB0aHJlc2hvbGQlMjBpcyUyMGRhdGFzZXQtZGVwZW5kZW50JTBBaWYlMjBzaW1pbGFyaXR5JTIwJTNDJTIwdGhyZXNob2xkJTNBJTBBJTIwJTIwJTIwJTIwcHJpbnQoJTIyU3BlYWtlcnMlMjBhcmUlMjBub3QlMjB0aGUlMjBzYW1lISUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, Wav2Vec2BertForXVector
<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 = AutoFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;facebook/w2v-bert-2.0&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2BertForXVector.from_pretrained(<span class="hljs-string">&quot;facebook/w2v-bert-2.0&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>)`,wrap:!1}}),{c(){t=i("p"),t.textContent=y,m=s(),u(p.$$.fragment)},l(n){t=c(n,"P",{"data-svelte-h":!0}),f(t)!=="svelte-11lpom8"&&(t.textContent=y),m=r(n),h(p.$$.fragment,n)},m(n,M){d(n,t,M),d(n,m,M),g(p,n,M),w=!0},p:L,i(n){w||(_(p.$$.fragment,n),w=!0)},o(n){v(p.$$.fragment,n),w=!1},d(n){n&&(a(t),a(m)),b(p,n)}}}function Zn(T){let t,y,m,p,w,n,M,Yt,ge,Ma='The Wav2Vec2-BERT model was proposed in <a href="https://ai.meta.com/research/publications/seamless-multilingual-expressive-and-streaming-speech-translation/" rel="nofollow">Seamless: Multilingual Expressive and Streaming Speech Translation</a> by the Seamless Communication team from Meta AI.',Lt,_e,Ta="This model was pre-trained on 4.5M hours of unlabeled audio data covering more than 143 languages. It requires finetuning to be used for downstream tasks such as Automatic Speech Recognition (ASR), or Audio Classification.",Et,ve,Wa="The official results of the model can be found in Section 3.2.1 of the paper.",Pt,be,ka="The abstract from the paper is the following:",Ht,ye,Va="<em>Recent advancements in automatic speech translation have dramatically expanded language coverage, improved multimodal capabilities, and enabled a wide range of tasks and functionalities. That said, large-scale automatic speech translation systems today lack key features that help machine-mediated communication feel seamless when compared to human-to-human dialogue. In this work, we introduce a family of models that enable end-to-end expressive and multilingual translations in a streaming fashion. First, we contribute an improved version of the massively multilingual and multimodal SeamlessM4T model—SeamlessM4T v2. This newer model, incorporating an updated UnitY2 framework, was trained on more low-resource language data. The expanded version of SeamlessAlign adds 114,800 hours of automatically aligned data for a total of 76 languages. SeamlessM4T v2 provides the foundation on which our two newest models, SeamlessExpressive and SeamlessStreaming, are initiated. SeamlessExpressive enables translation that preserves vocal styles and prosody. Compared to previous efforts in expressive speech research, our work addresses certain underexplored aspects of prosody, such as speech rate and pauses, while also preserving the style of one’s voice. As for SeamlessStreaming, our model leverages the Efficient Monotonic Multihead Attention (EMMA) mechanism to generate low-latency target translations without waiting for complete source utterances. As the first of its kind, SeamlessStreaming enables simultaneous speech-to-speech/text translation for multiple source and target languages. To understand the performance of these models, we combined novel and modified versions of existing automatic metrics to evaluate prosody, latency, and robustness. For human evaluations, we adapted existing protocols tailored for measuring the most relevant attributes in the preservation of meaning, naturalness, and expressivity. To ensure that our models can be used safely and responsibly, we implemented the first known red-teaming effort for multimodal machine translation, a system for the detection and mitigation of added toxicity, a systematic evaluation of gender bias, and an inaudible localized watermarking mechanism designed to dampen the impact of deepfakes. Consequently, we bring major components from SeamlessExpressive and SeamlessStreaming together to form Seamless, the first publicly available system that unlocks expressive cross-lingual communication in real-time. In sum, Seamless gives us a pivotal look at the technical foundation needed to turn the Universal Speech Translator from a science fiction concept into a real-world technology. Finally, contributions in this work—including models, code, and a watermark detector—are publicly released and accessible at the link below.</em>",At,we,Ca='This model was contributed by <a href="https://huggingface.co/ylacombe" rel="nofollow">ylacombe</a>. The original code can be found <a href="https://github.com/facebookresearch/seamless_communication" rel="nofollow">here</a>.',Qt,Me,Dt,Te,Ba=`<li>Wav2Vec2-BERT follows the same architecture as Wav2Vec2-Conformer, but employs a causal depthwise convolutional layer and uses as input a mel-spectrogram representation of the audio instead of the raw waveform.</li> <li>Wav2Vec2-BERT can use either no relative position embeddings, Shaw-like position embeddings, Transformer-XL-like position embeddings, or
rotary position embeddings by setting the correct <code>config.position_embeddings_type</code>.</li> <li>Wav2Vec2-BERT also introduces a Conformer-based adapter network instead of a simple convolutional network.</li>`,Ot,We,Kt,ke,eo,Ve,ja='<li><a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertForCTC">Wav2Vec2BertForCTC</a> is supported by this <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/speech-recognition" rel="nofollow">example script</a>.</li> <li>You can also adapt these notebooks on <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/speech_recognition.ipynb" rel="nofollow">how to finetune a speech recognition model in English</a>, and <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multi_lingual_speech_recognition.ipynb" rel="nofollow">how to finetune a speech recognition model in any language</a>.</li>',to,Ce,oo,Be,xa='<li><a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertForSequenceClassification">Wav2Vec2BertForSequenceClassification</a> can be used by adapting this <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/audio-classification" rel="nofollow">example script</a>.</li> <li>See also: <a href="../tasks/audio_classification">Audio classification task guide</a></li>',ao,je,no,U,xe,wo,st,$a=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertModel">Wav2Vec2BertModel</a>. It is used to
instantiate an Wav2Vec2Bert 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 Wav2Vec2Bert
<a href="https://huggingface.co/facebook/wav2vec2-bert-rel-pos-large" rel="nofollow">facebook/wav2vec2-bert-rel-pos-large</a>
architecture.`,Mo,rt,Ja=`Configuration objects inherit from <a href="/docs/transformers/pr_31208/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_31208/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,To,D,so,$e,Fa="## Wav2Vec2BertProcessor[[transformers.Wav2Vec2BertProcessor]]",ro,W,Je,Wo,lt,Ua=`Constructs a Wav2Vec2-BERT processor which wraps a Wav2Vec2-BERT feature extractor and a Wav2Vec2 CTC tokenizer into a single
processor.`,ko,it,Za=`<a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor">Wav2Vec2Processor</a> offers all the functionalities of <a href="/docs/transformers/pr_31208/en/model_doc/seamless_m4t#transformers.SeamlessM4TFeatureExtractor">SeamlessM4TFeatureExtractor</a> and <a href="/docs/transformers/pr_31208/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.
See the docstring of <a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__"><strong>call</strong>()</a> and <a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.decode">decode()</a> for more information.`,Vo,O,Fe,Co,ct,za=`Main method to prepare for the model one or several sequences(s) and audio(s). This method forwards the <code>audio</code>
and <code>kwargs</code> arguments to SeamlessM4TFeatureExtractor’s <a href="/docs/transformers/pr_31208/en/model_doc/seamless_m4t#transformers.SeamlessM4TFeatureExtractor.__call__"><strong>call</strong>()</a> if <code>audio</code> is not
<code>None</code> to pre-process the audio. To prepare the target sequences(s), this method forwards the <code>text</code> and <code>kwargs</code> arguments to
PreTrainedTokenizer’s <a href="/docs/transformers/pr_31208/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"><strong>call</strong>()</a> if <code>text</code> is not <code>None</code>. Please refer to the doctsring of the above two methods for more information.`,Bo,K,Ue,jo,dt,Ga=`If <code>input_features</code> is not <code>None</code>, this method forwards the <code>input_features</code> and <code>kwargs</code> arguments to SeamlessM4TFeatureExtractor’s <a href="/docs/transformers/pr_31208/en/main_classes/feature_extractor#transformers.SequenceFeatureExtractor.pad">pad()</a> to pad the input features.
If <code>labels</code> is not <code>None</code>, this method forwards the <code>labels</code> and <code>kwargs</code> arguments to PreTrainedTokenizer’s <a href="/docs/transformers/pr_31208/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.pad">pad()</a> to pad the label(s).
Please refer to the doctsring of the above two methods for more information.`,xo,mt,Ze,$o,A,ze,Jo,pt,Ia=`Saves the attributes of this processor (feature extractor, tokenizer…) in the specified directory so that it
can be reloaded using the <a href="/docs/transformers/pr_31208/en/main_classes/processors#transformers.ProcessorMixin.from_pretrained">from_pretrained()</a> method.`,Fo,ee,Uo,te,Ge,Zo,ft,Xa=`This method forwards all its arguments to PreTrainedTokenizer’s <a href="/docs/transformers/pr_31208/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,zo,oe,Ie,Go,ut,qa=`This method forwards all its arguments to PreTrainedTokenizer’s <a href="/docs/transformers/pr_31208/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode">decode()</a>. Please refer
to the docstring of this method for more information.`,lo,Xe,Ra="## Wav2Vec2BertModel[[transformers.Wav2Vec2BertModel]]",io,J,qe,Io,ht,Na=`The bare Wav2Vec2Bert Model transformer outputting raw hidden-states without any specific head on top.
Wav2Vec2Bert was proposed in <a href="https://arxiv.org/abs/2006.11477" rel="nofollow">wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations</a> by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`,Xo,gt,Sa=`This model inherits from <a href="/docs/transformers/pr_31208/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`,qo,_t,Ya=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#nn.Module" rel="nofollow">nn.Module</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.`,Ro,G,Re,No,vt,La='The <a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertModel">Wav2Vec2BertModel</a> forward method, overrides the <code>__call__</code> special method.',So,ae,Yo,ne,co,Ne,Ea="## Wav2Vec2BertForCTC[[transformers.Wav2Vec2BertForCTC]]",mo,F,Se,Lo,bt,Pa=`Wav2Vec2Bert Model with a <code>language modeling</code> head on top for Connectionist Temporal Classification (CTC).
Wav2Vec2Bert was proposed in <a href="https://arxiv.org/abs/2006.11477" rel="nofollow">wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations</a> by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`,Eo,yt,Ha=`This model inherits from <a href="/docs/transformers/pr_31208/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`,Po,wt,Aa=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#nn.Module" rel="nofollow">nn.Module</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.`,Ho,I,Ye,Ao,Mt,Qa='The <a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertForCTC">Wav2Vec2BertForCTC</a> forward method, overrides the <code>__call__</code> special method.',Qo,se,Do,re,po,Le,Da="## Wav2Vec2BertForSequenceClassification[[transformers.Wav2Vec2BertForSequenceClassification]]",fo,j,Ee,Oo,Tt,Oa=`Wav2Vec2Bert Model with a sequence classification head on top (a linear layer over the pooled output) for
tasks like SUPERB Keyword Spotting.`,Ko,Wt,Ka=`Wav2Vec2Bert was proposed in <a href="https://arxiv.org/abs/2006.11477" rel="nofollow">wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations</a> by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`,ea,kt,en=`This model inherits from <a href="/docs/transformers/pr_31208/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`,ta,Vt,tn=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#nn.Module" rel="nofollow">nn.Module</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.`,oa,X,Pe,aa,Ct,on='The <a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertForSequenceClassification">Wav2Vec2BertForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',na,le,sa,ie,uo,He,an="## Wav2Vec2BertForAudioFrameClassification[[transformers.Wav2Vec2BertForAudioFrameClassification]]",ho,x,Ae,ra,Bt,nn="Wav2Vec2Bert Model with a frame classification head on top for tasks like Speaker Diarization.",la,jt,sn=`Wav2Vec2Bert was proposed in <a href="https://arxiv.org/abs/2006.11477" rel="nofollow">wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations</a> by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`,ia,xt,rn=`This model inherits from <a href="/docs/transformers/pr_31208/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`,ca,$t,ln=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#nn.Module" rel="nofollow">nn.Module</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.`,da,q,Qe,ma,Jt,cn='The <a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertForAudioFrameClassification">Wav2Vec2BertForAudioFrameClassification</a> forward method, overrides the <code>__call__</code> special method.',pa,ce,fa,de,go,De,dn="## Wav2Vec2BertForXVector[[transformers.Wav2Vec2BertForXVector]]",_o,$,Oe,ua,Ft,mn="Wav2Vec2Bert Model with an XVector feature extraction head on top for tasks like Speaker Verification.",ha,Ut,pn=`Wav2Vec2Bert was proposed in <a href="https://arxiv.org/abs/2006.11477" rel="nofollow">wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations</a> by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`,ga,Zt,fn=`This model inherits from <a href="/docs/transformers/pr_31208/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`,_a,zt,un=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#nn.Module" rel="nofollow">nn.Module</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.`,va,R,Ke,ba,Gt,hn='The <a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertForXVector">Wav2Vec2BertForXVector</a> forward method, overrides the <code>__call__</code> special method.',ya,me,wa,pe,vo,et,bo,Rt,yo;return w=new St({props:{title:"Wav2Vec2-BERT",local:"wav2vec2-bert",headingTag:"h1"}}),M=new St({props:{title:"Overview",local:"overview",headingTag:"h2"}}),Me=new St({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),We=new St({props:{title:"Resources",local:"resources",headingTag:"h2"}}),ke=new gn({props:{pipeline:"automatic-speech-recognition"}}),Ce=new gn({props:{pipeline:"audio-classification"}}),je=new St({props:{title:"Wav2Vec2BertConfig",local:"transformers.Wav2Vec2BertConfig",headingTag:"h2"}}),xe=new B({props:{name:"class transformers.Wav2Vec2BertConfig",anchor:"transformers.Wav2Vec2BertConfig",parameters:[{name:"vocab_size",val:" = None"},{name:"hidden_size",val:" = 1024"},{name:"num_hidden_layers",val:" = 24"},{name:"num_attention_heads",val:" = 16"},{name:"intermediate_size",val:" = 4096"},{name:"feature_projection_input_dim",val:" = 160"},{name:"hidden_act",val:" = 'swish'"},{name:"hidden_dropout",val:" = 0.0"},{name:"activation_dropout",val:" = 0.0"},{name:"attention_dropout",val:" = 0.0"},{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:"apply_spec_augment",val:" = True"},{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:" = 768"},{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:" = 1"},{name:"adapter_act",val:" = 'relu'"},{name:"use_intermediate_ffn_before_adapter",val:" = False"},{name:"output_hidden_size",val:" = None"},{name:"position_embeddings_type",val:" = 'relative_key'"},{name:"rotary_embedding_base",val:" = 10000"},{name:"max_source_positions",val:" = 5000"},{name:"left_max_position_embeddings",val:" = 64"},{name:"right_max_position_embeddings",val:" = 8"},{name:"conv_depthwise_kernel_size",val:" = 31"},{name:"conformer_conv_dropout",val:" = 0.1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2BertConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Vocabulary size of the Wav2Vec2Bert model. Defines the number of different tokens that can be
represented by the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertModel">Wav2Vec2BertModel</a>. 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/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertModel">Wav2Vec2BertModel</a>.`,name:"vocab_size"},{anchor:"transformers.Wav2Vec2BertConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.Wav2Vec2BertConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 24) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.Wav2Vec2BertConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.Wav2Vec2BertConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.Wav2Vec2BertConfig.feature_projection_input_dim",description:`<strong>feature_projection_input_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 160) &#x2014;
Input dimension of this model, i.e the dimension after processing input audios with <a href="/docs/transformers/pr_31208/en/model_doc/seamless_m4t#transformers.SeamlessM4TFeatureExtractor">SeamlessM4TFeatureExtractor</a> or <a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertProcessor">Wav2Vec2BertProcessor</a>.`,name:"feature_projection_input_dim"},{anchor:"transformers.Wav2Vec2BertConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;swish&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>, <code>&quot;swish&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.Wav2Vec2BertConfig.hidden_dropout",description:`<strong>hidden_dropout</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"},{anchor:"transformers.Wav2Vec2BertConfig.activation_dropout",description:`<strong>activation_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for activations inside the fully connected layer.`,name:"activation_dropout"},{anchor:"transformers.Wav2Vec2BertConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.Wav2Vec2BertConfig.feat_proj_dropout",description:`<strong>feat_proj_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for the feature projection.`,name:"feat_proj_dropout"},{anchor:"transformers.Wav2Vec2BertConfig.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/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertForCTC">Wav2Vec2BertForCTC</a>.`,name:"final_dropout"},{anchor:"transformers.Wav2Vec2BertConfig.layerdrop",description:`<strong>layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The LayerDrop probability. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>) for more
details.`,name:"layerdrop"},{anchor:"transformers.Wav2Vec2BertConfig.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.Wav2Vec2BertConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-05) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.Wav2Vec2BertConfig.apply_spec_augment",description:`<strong>apply_spec_augment</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to apply <em>SpecAugment</em> data augmentation to the outputs of the feature encoder. For reference see
<a href="https://arxiv.org/abs/1904.08779" rel="nofollow">SpecAugment: A Simple Data Augmentation Method for Automatic Speech
Recognition</a>.`,name:"apply_spec_augment"},{anchor:"transformers.Wav2Vec2BertConfig.mask_time_prob",description:"<strong>mask_time_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.05) &#x2014;\nPercentage (between 0 and 1) of all feature vectors along the time axis which will be masked. The masking\nprocecure generates <code>mask_time_prob*len(time_axis)/mask_time_length ``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, *mask_time_prob* should be </code>prob_vector_start*mask_time_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_time_prob"},{anchor:"transformers.Wav2Vec2BertConfig.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.Wav2Vec2BertConfig.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 <code>mask_time_prob*len(time_axis)/mask_time_length &lt; mask_time_min_masks</code>.`,name:"mask_time_min_masks"},{anchor:"transformers.Wav2Vec2BertConfig.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 <code>mask_feature_prob*len(feature_axis)/mask_time_length</code> 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 <code>prob_vector_start*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</code>.`,name:"mask_feature_prob"},{anchor:"transformers.Wav2Vec2BertConfig.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.Wav2Vec2BertConfig.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
<code>mask_feature_prob*len(feature_axis)/mask_feature_length &lt; mask_feature_min_masks</code>.`,name:"mask_feature_min_masks"},{anchor:"transformers.Wav2Vec2BertConfig.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/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertForCTC">Wav2Vec2BertForCTC</a>.`,name:"ctc_loss_reduction"},{anchor:"transformers.Wav2Vec2BertConfig.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/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertForCTC">Wav2Vec2BertForCTC</a>.`,name:"ctc_zero_infinity"},{anchor:"transformers.Wav2Vec2BertConfig.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/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertForSequenceClassification">Wav2Vec2BertForSequenceClassification</a>.`,name:"use_weighted_layer_sum"},{anchor:"transformers.Wav2Vec2BertConfig.classifier_proj_size",description:`<strong>classifier_proj_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the projection before token mean-pooling for classification.`,name:"classifier_proj_size"},{anchor:"transformers.Wav2Vec2BertConfig.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.Wav2Vec2BertConfig.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.Wav2Vec2BertConfig.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.Wav2Vec2BertConfig.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.Wav2Vec2BertConfig.pad_token_id",description:"<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014; The id of the <em>beginning-of-stream</em> token.",name:"pad_token_id"},{anchor:"transformers.Wav2Vec2BertConfig.bos_token_id",description:"<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014; The id of the <em>padding</em> token.",name:"bos_token_id"},{anchor:"transformers.Wav2Vec2BertConfig.eos_token_id",description:"<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014; The id of the <em>end-of-stream</em> token.",name:"eos_token_id"},{anchor:"transformers.Wav2Vec2BertConfig.add_adapter",description:`<strong>add_adapter</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether a convolutional attention network should be stacked on top of the Wav2Vec2Bert Encoder. Can be very
useful for warm-starting Wav2Vec2Bert for SpeechEncoderDecoder models.`,name:"add_adapter"},{anchor:"transformers.Wav2Vec2BertConfig.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.Wav2Vec2BertConfig.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.Wav2Vec2BertConfig.num_adapter_layers",description:`<strong>num_adapter_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#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.Wav2Vec2BertConfig.adapter_act",description:`<strong>adapter_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;relu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the adapter layers. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code>, <code>&quot;swish&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"adapter_act"},{anchor:"transformers.Wav2Vec2BertConfig.use_intermediate_ffn_before_adapter",description:`<strong>use_intermediate_ffn_before_adapter</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether an intermediate feed-forward block should be stacked on top of the Wav2Vec2Bert Encoder and before the adapter network.
Only relevant if <code>add_adapter is True</code>.`,name:"use_intermediate_ffn_before_adapter"},{anchor:"transformers.Wav2Vec2BertConfig.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"},{anchor:"transformers.Wav2Vec2BertConfig.position_embeddings_type",description:`<strong>position_embeddings_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;relative_key&quot;</code>) &#x2014;
Can be specified to :<ul>
<li><code>rotary</code>, for rotary position embeddings.</li>
<li><code>relative</code>, for relative position embeddings.</li>
<li><code>relative_key</code>, for relative position embeddings as defined by Shaw in <a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention
with Relative Position Representations (Shaw et al.)</a>.
If left to <code>None</code>, no relative position embeddings is applied.</li>
</ul>`,name:"position_embeddings_type"},{anchor:"transformers.Wav2Vec2BertConfig.rotary_embedding_base",description:`<strong>rotary_embedding_base</strong> (<code>int</code>, <em>optional</em>, defaults to 10000) &#x2014;
If <code>&quot;rotary&quot;</code> position embeddings are used, defines the size of the embedding base.`,name:"rotary_embedding_base"},{anchor:"transformers.Wav2Vec2BertConfig.max_source_positions",description:`<strong>max_source_positions</strong> (<code>int</code>, <em>optional</em>, defaults to 5000) &#x2014;
if <code>&quot;relative&quot;</code> position embeddings are used, defines the maximum source input positions.`,name:"max_source_positions"},{anchor:"transformers.Wav2Vec2BertConfig.left_max_position_embeddings",description:`<strong>left_max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
If <code>&quot;relative_key&quot;</code> (aka Shaw) position embeddings are used, defines the left clipping value for relative positions.`,name:"left_max_position_embeddings"},{anchor:"transformers.Wav2Vec2BertConfig.right_max_position_embeddings",description:`<strong>right_max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
If <code>&quot;relative_key&quot;</code> (aka Shaw) position embeddings are used, defines the right clipping value for relative positions.`,name:"right_max_position_embeddings"},{anchor:"transformers.Wav2Vec2BertConfig.conv_depthwise_kernel_size",description:`<strong>conv_depthwise_kernel_size</strong> (<code>int</code>, <em>optional</em>, defaults to 31) &#x2014;
Kernel size of convolutional depthwise 1D layer in Conformer blocks.`,name:"conv_depthwise_kernel_size"},{anchor:"transformers.Wav2Vec2BertConfig.conformer_conv_dropout",description:`<strong>conformer_conv_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all convolutional layers in Conformer blocks.`,name:"conformer_conv_dropout"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/wav2vec2_bert/configuration_wav2vec2_bert.py#L24"}}),D=new Xt({props:{anchor:"transformers.Wav2Vec2BertConfig.example",$$slots:{default:[Tn]},$$scope:{ctx:T}}}),Je=new B({props:{name:"class transformers.Wav2Vec2BertProcessor",anchor:"transformers.Wav2Vec2BertProcessor",parameters:[{name:"feature_extractor",val:""},{name:"tokenizer",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2BertProcessor.feature_extractor",description:`<strong>feature_extractor</strong> (<code>SeamlessM4TFeatureExtractor</code>) &#x2014;
An instance of <a href="/docs/transformers/pr_31208/en/model_doc/seamless_m4t#transformers.SeamlessM4TFeatureExtractor">SeamlessM4TFeatureExtractor</a>. The feature extractor is a required input.`,name:"feature_extractor"},{anchor:"transformers.Wav2Vec2BertProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/pr_31208/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
An instance of <a href="/docs/transformers/pr_31208/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/wav2vec2_bert/processing_wav2vec2_bert.py#L26"}}),Fe=new B({props:{name:"__call__",anchor:"transformers.Wav2Vec2BertProcessor.__call__",parameters:[{name:"audio",val:" = None"},{name:"text",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2BertProcessor.__call__.text",description:`<strong>text</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text"},{anchor:"transformers.Wav2Vec2BertProcessor.__call__.audio",description:`<strong>audio</strong> (<code>np.ndarray</code>, <code>torch.Tensor</code>, <code>List[np.ndarray]</code>, <code>List[torch.Tensor]</code>) &#x2014;
The audio or batch of audios to be prepared. Each audio can be NumPy array or PyTorch tensor. In case
of a NumPy array/PyTorch tensor, each audio should be of shape (C, T), where C is a number of channels,
and T the sample length of the audio.`,name:"audio"},{anchor:"transformers.Wav2Vec2BertProcessor.__call__.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014;
Remaining dictionary of keyword arguments that will be passed to the feature extractor and/or the
tokenizer.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/wav2vec2_bert/processing_wav2vec2_bert.py#L66",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31208/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a> with the following fields:</p>
<ul>
<li><strong>input_features</strong> — Audio input features to be fed to a model. Returned when <code>audio</code> is not <code>None</code>.</li>
<li><strong>attention_mask</strong> — List of indices specifying which timestamps should be attended to by the model when <code>audio</code> is not <code>None</code>.
When only <code>text</code> is specified, returns the token attention mask.</li>
<li><strong>labels</strong> — List of token ids to be fed to a model. Returned when both <code>text</code> and <code>audio</code> are not <code>None</code>.</li>
<li><strong>input_ids</strong> — List of token ids to be fed to a model. Returned when <code>text</code> is not <code>None</code> and <code>audio</code> is <code>None</code>.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_31208/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),Ue=new B({props:{name:"pad",anchor:"transformers.Wav2Vec2BertProcessor.pad",parameters:[{name:"input_features",val:" = None"},{name:"labels",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/wav2vec2_bert/processing_wav2vec2_bert.py#L112"}}),Ze=new B({props:{name:"from_pretrained",anchor:"transformers.Wav2Vec2BertProcessor.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/wav2vec2_bert/processing_wav2vec2_bert.py#L47"}}),ze=new B({props:{name:"save_pretrained",anchor:"transformers.Wav2Vec2BertProcessor.save_pretrained",parameters:[{name:"save_directory",val:""},{name:"push_to_hub",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2BertProcessor.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory where the feature extractor JSON file and the tokenizer files will be saved (directory will
be created if it does not exist).`,name:"save_directory"},{anchor:"transformers.Wav2Vec2BertProcessor.save_pretrained.push_to_hub",description:`<strong>push_to_hub</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to push your model to the Hugging Face model hub after saving it. You can specify the
repository you want to push to with <code>repo_id</code> (will default to the name of <code>save_directory</code> in your
namespace).`,name:"push_to_hub"},{anchor:"transformers.Wav2Vec2BertProcessor.save_pretrained.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional key word arguments passed along to the <a href="/docs/transformers/pr_31208/en/main_classes/model#transformers.utils.PushToHubMixin.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/processing_utils.py#L428"}}),ee=new It({props:{$$slots:{default:[Wn]},$$scope:{ctx:T}}}),Ge=new B({props:{name:"batch_decode",anchor:"transformers.Wav2Vec2BertProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/wav2vec2_bert/processing_wav2vec2_bert.py#L134"}}),Ie=new B({props:{name:"decode",anchor:"transformers.Wav2Vec2BertProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/wav2vec2_bert/processing_wav2vec2_bert.py#L141"}}),qe=new B({props:{name:"class transformers.Wav2Vec2BertModel",anchor:"transformers.Wav2Vec2BertModel",parameters:[{name:"config",val:": Wav2Vec2BertConfig"}],parametersDescription:[{anchor:"transformers.Wav2Vec2BertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertConfig">Wav2Vec2BertConfig</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/pr_31208/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/vr_31208/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py#L1041"}}),Re=new B({props:{name:"forward",anchor:"transformers.Wav2Vec2BertModel.forward",parameters:[{name:"input_features",val:": Optional"},{name:"attention_mask",val:": Optional = None"},{name:"mask_time_indices",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.Wav2Vec2BertModel.forward.input_features",description:`<strong>input_features</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 <code>.flac</code> or <code>.wav</code> audio file
into an array of type <code>List[float]</code> or a <code>numpy.ndarray</code>, <em>e.g.</em> via the soundfile library (<code>pip install soundfile</code>). To prepare the array into <code>input_features</code>, the <a href="/docs/transformers/pr_31208/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertProcessor.__call__">Wav2Vec2BertProcessor.<strong>call</strong>()</a> for details.`,name:"input_features"},{anchor:"transformers.Wav2Vec2BertModel.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>`,name:"attention_mask"},{anchor:"transformers.Wav2Vec2BertModel.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.Wav2Vec2BertModel.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.Wav2Vec2BertModel.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/pr_31208/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31208/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py#L1113",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31208/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/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertConfig"
>Wav2Vec2BertConfig</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>) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_31208/en/model_doc/wav2vec2#transformers.modeling_outputs.Wav2Vec2BaseModelOutput"
>transformers.modeling_outputs.Wav2Vec2BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ae=new It({props:{$$slots:{default:[kn]},$$scope:{ctx:T}}}),ne=new Xt({props:{anchor:"transformers.Wav2Vec2BertModel.forward.example",$$slots:{default:[Vn]},$$scope:{ctx:T}}}),Se=new B({props:{name:"class transformers.Wav2Vec2BertForCTC",anchor:"transformers.Wav2Vec2BertForCTC",parameters:[{name:"config",val:""},{name:"target_lang",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.Wav2Vec2BertForCTC.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertConfig">Wav2Vec2BertConfig</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/pr_31208/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/vr_31208/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py#L1169"}}),Ye=new B({props:{name:"forward",anchor:"transformers.Wav2Vec2BertForCTC.forward",parameters:[{name:"input_features",val:": Optional"},{name:"attention_mask",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"labels",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.Wav2Vec2BertForCTC.forward.input_features",description:`<strong>input_features</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 <code>.flac</code> or <code>.wav</code> audio file
into an array of type <code>List[float]</code> or a <code>numpy.ndarray</code>, <em>e.g.</em> via the soundfile library (<code>pip install soundfile</code>). To prepare the array into <code>input_features</code>, the <a href="/docs/transformers/pr_31208/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertProcessor.__call__">Wav2Vec2BertProcessor.<strong>call</strong>()</a> for details.`,name:"input_features"},{anchor:"transformers.Wav2Vec2BertForCTC.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>`,name:"attention_mask"},{anchor:"transformers.Wav2Vec2BertForCTC.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.Wav2Vec2BertForCTC.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.Wav2Vec2BertForCTC.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/pr_31208/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Wav2Vec2BertForCTC.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/vr_31208/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py#L1198",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31208/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/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertConfig"
>Wav2Vec2BertConfig</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) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_31208/en/main_classes/output#transformers.modeling_outputs.CausalLMOutput"
>transformers.modeling_outputs.CausalLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),se=new It({props:{$$slots:{default:[Cn]},$$scope:{ctx:T}}}),re=new Xt({props:{anchor:"transformers.Wav2Vec2BertForCTC.forward.example",$$slots:{default:[Bn]},$$scope:{ctx:T}}}),Ee=new B({props:{name:"class transformers.Wav2Vec2BertForSequenceClassification",anchor:"transformers.Wav2Vec2BertForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2BertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertConfig">Wav2Vec2BertConfig</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/pr_31208/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/vr_31208/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py#L1279"}}),Pe=new B({props:{name:"forward",anchor:"transformers.Wav2Vec2BertForSequenceClassification.forward",parameters:[{name:"input_features",val:": Optional"},{name:"attention_mask",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"labels",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.Wav2Vec2BertForSequenceClassification.forward.input_features",description:`<strong>input_features</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 <code>.flac</code> or <code>.wav</code> audio file
into an array of type <code>List[float]</code> or a <code>numpy.ndarray</code>, <em>e.g.</em> via the soundfile library (<code>pip install soundfile</code>). To prepare the array into <code>input_features</code>, the <a href="/docs/transformers/pr_31208/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertProcessor.__call__">Wav2Vec2BertProcessor.<strong>call</strong>()</a> for details.`,name:"input_features"},{anchor:"transformers.Wav2Vec2BertForSequenceClassification.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>`,name:"attention_mask"},{anchor:"transformers.Wav2Vec2BertForSequenceClassification.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.Wav2Vec2BertForSequenceClassification.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.Wav2Vec2BertForSequenceClassification.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/pr_31208/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Wav2Vec2BertForSequenceClassification.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/vr_31208/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py#L1313",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31208/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/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertConfig"
>Wav2Vec2BertConfig</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) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_31208/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),le=new It({props:{$$slots:{default:[jn]},$$scope:{ctx:T}}}),ie=new Xt({props:{anchor:"transformers.Wav2Vec2BertForSequenceClassification.forward.example",$$slots:{default:[xn]},$$scope:{ctx:T}}}),Ae=new B({props:{name:"class transformers.Wav2Vec2BertForAudioFrameClassification",anchor:"transformers.Wav2Vec2BertForAudioFrameClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2BertForAudioFrameClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertConfig">Wav2Vec2BertConfig</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/pr_31208/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/vr_31208/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py#L1383"}}),Qe=new B({props:{name:"forward",anchor:"transformers.Wav2Vec2BertForAudioFrameClassification.forward",parameters:[{name:"input_features",val:": Optional"},{name:"attention_mask",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.Wav2Vec2BertForAudioFrameClassification.forward.input_features",description:`<strong>input_features</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 <code>.flac</code> or <code>.wav</code> audio file
into an array of type <code>List[float]</code> or a <code>numpy.ndarray</code>, <em>e.g.</em> via the soundfile library (<code>pip install soundfile</code>). To prepare the array into <code>input_features</code>, the <a href="/docs/transformers/pr_31208/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertProcessor.__call__">Wav2Vec2BertProcessor.<strong>call</strong>()</a> for details.`,name:"input_features"},{anchor:"transformers.Wav2Vec2BertForAudioFrameClassification.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>`,name:"attention_mask"},{anchor:"transformers.Wav2Vec2BertForAudioFrameClassification.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.Wav2Vec2BertForAudioFrameClassification.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.Wav2Vec2BertForAudioFrameClassification.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/pr_31208/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Wav2Vec2BertForAudioFrameClassification.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/vr_31208/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py#L1416",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31208/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/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertConfig"
>Wav2Vec2BertConfig</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)  — Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_31208/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ce=new It({props:{$$slots:{default:[$n]},$$scope:{ctx:T}}}),de=new Xt({props:{anchor:"transformers.Wav2Vec2BertForAudioFrameClassification.forward.example",$$slots:{default:[Jn]},$$scope:{ctx:T}}}),Oe=new B({props:{name:"class transformers.Wav2Vec2BertForXVector",anchor:"transformers.Wav2Vec2BertForXVector",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2BertForXVector.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertConfig">Wav2Vec2BertConfig</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/pr_31208/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/vr_31208/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py#L1534"}}),Ke=new B({props:{name:"forward",anchor:"transformers.Wav2Vec2BertForXVector.forward",parameters:[{name:"input_features",val:": Optional"},{name:"attention_mask",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"labels",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.Wav2Vec2BertForXVector.forward.input_features",description:`<strong>input_features</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 <code>.flac</code> or <code>.wav</code> audio file
into an array of type <code>List[float]</code> or a <code>numpy.ndarray</code>, <em>e.g.</em> via the soundfile library (<code>pip install soundfile</code>). To prepare the array into <code>input_features</code>, the <a href="/docs/transformers/pr_31208/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertProcessor.__call__">Wav2Vec2BertProcessor.<strong>call</strong>()</a> for details.`,name:"input_features"},{anchor:"transformers.Wav2Vec2BertForXVector.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>`,name:"attention_mask"},{anchor:"transformers.Wav2Vec2BertForXVector.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.Wav2Vec2BertForXVector.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.Wav2Vec2BertForXVector.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/pr_31208/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Wav2Vec2BertForXVector.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/vr_31208/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py#L1586",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31208/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/pr_31208/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertConfig"
>Wav2Vec2BertConfig</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) — Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.xvector_output_dim)</code>) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_31208/en/main_classes/output#transformers.modeling_outputs.XVectorOutput"
>transformers.modeling_outputs.XVectorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),me=new It({props:{$$slots:{default:[Fn]},$$scope:{ctx:T}}}),pe=new Xt({props:{anchor:"transformers.Wav2Vec2BertForXVector.forward.example",$$slots:{default:[Un]},$$scope:{ctx:T}}}),et=new Mn({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/wav2vec2-bert.md"}}),{c(){t=i("meta"),y=s(),m=i("p"),p=s(),u(w.$$.fragment),n=s(),u(M.$$.fragment),Yt=s(),ge=i("p"),ge.innerHTML=Ma,Lt=s(),_e=i("p"),_e.textContent=Ta,Et=s(),ve=i("p"),ve.textContent=Wa,Pt=s(),be=i("p"),be.textContent=ka,Ht=s(),ye=i("p"),ye.innerHTML=Va,At=s(),we=i("p"),we.innerHTML=Ca,Qt=s(),u(Me.$$.fragment),Dt=s(),Te=i("ul"),Te.innerHTML=Ba,Ot=s(),u(We.$$.fragment),Kt=s(),u(ke.$$.fragment),eo=s(),Ve=i("ul"),Ve.innerHTML=ja,to=s(),u(Ce.$$.fragment),oo=s(),Be=i("ul"),Be.innerHTML=xa,ao=s(),u(je.$$.fragment),no=s(),U=i("div"),u(xe.$$.fragment),wo=s(),st=i("p"),st.innerHTML=$a,Mo=s(),rt=i("p"),rt.innerHTML=Ja,To=s(),u(D.$$.fragment),so=s(),$e=i("p"),$e.textContent=Fa,ro=s(),W=i("div"),u(Je.$$.fragment),Wo=s(),lt=i("p"),lt.textContent=Ua,ko=s(),it=i("p"),it.innerHTML=Za,Vo=s(),O=i("div"),u(Fe.$$.fragment),Co=s(),ct=i("p"),ct.innerHTML=za,Bo=s(),K=i("div"),u(Ue.$$.fragment),jo=s(),dt=i("p"),dt.innerHTML=Ga,xo=s(),mt=i("div"),u(Ze.$$.fragment),$o=s(),A=i("div"),u(ze.$$.fragment),Jo=s(),pt=i("p"),pt.innerHTML=Ia,Fo=s(),u(ee.$$.fragment),Uo=s(),te=i("div"),u(Ge.$$.fragment),Zo=s(),ft=i("p"),ft.innerHTML=Xa,zo=s(),oe=i("div"),u(Ie.$$.fragment),Go=s(),ut=i("p"),ut.innerHTML=qa,lo=s(),Xe=i("p"),Xe.textContent=Ra,io=s(),J=i("div"),u(qe.$$.fragment),Io=s(),ht=i("p"),ht.innerHTML=Na,Xo=s(),gt=i("p"),gt.innerHTML=Sa,qo=s(),_t=i("p"),_t.innerHTML=Ya,Ro=s(),G=i("div"),u(Re.$$.fragment),No=s(),vt=i("p"),vt.innerHTML=La,So=s(),u(ae.$$.fragment),Yo=s(),u(ne.$$.fragment),co=s(),Ne=i("p"),Ne.textContent=Ea,mo=s(),F=i("div"),u(Se.$$.fragment),Lo=s(),bt=i("p"),bt.innerHTML=Pa,Eo=s(),yt=i("p"),yt.innerHTML=Ha,Po=s(),wt=i("p"),wt.innerHTML=Aa,Ho=s(),I=i("div"),u(Ye.$$.fragment),Ao=s(),Mt=i("p"),Mt.innerHTML=Qa,Qo=s(),u(se.$$.fragment),Do=s(),u(re.$$.fragment),po=s(),Le=i("p"),Le.textContent=Da,fo=s(),j=i("div"),u(Ee.$$.fragment),Oo=s(),Tt=i("p"),Tt.textContent=Oa,Ko=s(),Wt=i("p"),Wt.innerHTML=Ka,ea=s(),kt=i("p"),kt.innerHTML=en,ta=s(),Vt=i("p"),Vt.innerHTML=tn,oa=s(),X=i("div"),u(Pe.$$.fragment),aa=s(),Ct=i("p"),Ct.innerHTML=on,na=s(),u(le.$$.fragment),sa=s(),u(ie.$$.fragment),uo=s(),He=i("p"),He.textContent=an,ho=s(),x=i("div"),u(Ae.$$.fragment),ra=s(),Bt=i("p"),Bt.textContent=nn,la=s(),jt=i("p"),jt.innerHTML=sn,ia=s(),xt=i("p"),xt.innerHTML=rn,ca=s(),$t=i("p"),$t.innerHTML=ln,da=s(),q=i("div"),u(Qe.$$.fragment),ma=s(),Jt=i("p"),Jt.innerHTML=cn,pa=s(),u(ce.$$.fragment),fa=s(),u(de.$$.fragment),go=s(),De=i("p"),De.textContent=dn,_o=s(),$=i("div"),u(Oe.$$.fragment),ua=s(),Ft=i("p"),Ft.textContent=mn,ha=s(),Ut=i("p"),Ut.innerHTML=pn,ga=s(),Zt=i("p"),Zt.innerHTML=fn,_a=s(),zt=i("p"),zt.innerHTML=un,va=s(),R=i("div"),u(Ke.$$.fragment),ba=s(),Gt=i("p"),Gt.innerHTML=hn,ya=s(),u(me.$$.fragment),wa=s(),u(pe.$$.fragment),vo=s(),u(et.$$.fragment),bo=s(),Rt=i("p"),this.h()},l(e){const l=wn("svelte-u9bgzb",document.head);t=c(l,"META",{name:!0,content:!0}),l.forEach(a),y=r(e),m=c(e,"P",{}),V(m).forEach(a),p=r(e),h(w.$$.fragment,e),n=r(e),h(M.$$.fragment,e),Yt=r(e),ge=c(e,"P",{"data-svelte-h":!0}),f(ge)!=="svelte-zyaorv"&&(ge.innerHTML=Ma),Lt=r(e),_e=c(e,"P",{"data-svelte-h":!0}),f(_e)!=="svelte-klyyhl"&&(_e.textContent=Ta),Et=r(e),ve=c(e,"P",{"data-svelte-h":!0}),f(ve)!=="svelte-1rgpbum"&&(ve.textContent=Wa),Pt=r(e),be=c(e,"P",{"data-svelte-h":!0}),f(be)!=="svelte-vfdo9a"&&(be.textContent=ka),Ht=r(e),ye=c(e,"P",{"data-svelte-h":!0}),f(ye)!=="svelte-1vw0n52"&&(ye.innerHTML=Va),At=r(e),we=c(e,"P",{"data-svelte-h":!0}),f(we)!=="svelte-mez4is"&&(we.innerHTML=Ca),Qt=r(e),h(Me.$$.fragment,e),Dt=r(e),Te=c(e,"UL",{"data-svelte-h":!0}),f(Te)!=="svelte-13pou99"&&(Te.innerHTML=Ba),Ot=r(e),h(We.$$.fragment,e),Kt=r(e),h(ke.$$.fragment,e),eo=r(e),Ve=c(e,"UL",{"data-svelte-h":!0}),f(Ve)!=="svelte-ui6jh"&&(Ve.innerHTML=ja),to=r(e),h(Ce.$$.fragment,e),oo=r(e),Be=c(e,"UL",{"data-svelte-h":!0}),f(Be)!=="svelte-1csq76n"&&(Be.innerHTML=xa),ao=r(e),h(je.$$.fragment,e),no=r(e),U=c(e,"DIV",{class:!0});var E=V(U);h(xe.$$.fragment,E),wo=r(E),st=c(E,"P",{"data-svelte-h":!0}),f(st)!=="svelte-1khhsjr"&&(st.innerHTML=$a),Mo=r(E),rt=c(E,"P",{"data-svelte-h":!0}),f(rt)!=="svelte-ux0v9v"&&(rt.innerHTML=Ja),To=r(E),h(D.$$.fragment,E),E.forEach(a),so=r(e),$e=c(e,"P",{"data-svelte-h":!0}),f($e)!=="svelte-gufhdw"&&($e.textContent=Fa),ro=r(e),W=c(e,"DIV",{class:!0});var k=V(W);h(Je.$$.fragment,k),Wo=r(k),lt=c(k,"P",{"data-svelte-h":!0}),f(lt)!=="svelte-1q4hwoc"&&(lt.textContent=Ua),ko=r(k),it=c(k,"P",{"data-svelte-h":!0}),f(it)!=="svelte-9zof4n"&&(it.innerHTML=Za),Vo=r(k),O=c(k,"DIV",{class:!0});var tt=V(O);h(Fe.$$.fragment,tt),Co=r(tt),ct=c(tt,"P",{"data-svelte-h":!0}),f(ct)!=="svelte-u9827c"&&(ct.innerHTML=za),tt.forEach(a),Bo=r(k),K=c(k,"DIV",{class:!0});var ot=V(K);h(Ue.$$.fragment,ot),jo=r(ot),dt=c(ot,"P",{"data-svelte-h":!0}),f(dt)!=="svelte-1ebhfqw"&&(dt.innerHTML=Ga),ot.forEach(a),xo=r(k),mt=c(k,"DIV",{class:!0});var Nt=V(mt);h(Ze.$$.fragment,Nt),Nt.forEach(a),$o=r(k),A=c(k,"DIV",{class:!0});var Q=V(A);h(ze.$$.fragment,Q),Jo=r(Q),pt=c(Q,"P",{"data-svelte-h":!0}),f(pt)!=="svelte-62cbef"&&(pt.innerHTML=Ia),Fo=r(Q),h(ee.$$.fragment,Q),Q.forEach(a),Uo=r(k),te=c(k,"DIV",{class:!0});var at=V(te);h(Ge.$$.fragment,at),Zo=r(at),ft=c(at,"P",{"data-svelte-h":!0}),f(ft)!=="svelte-h9tn89"&&(ft.innerHTML=Xa),at.forEach(a),zo=r(k),oe=c(k,"DIV",{class:!0});var nt=V(oe);h(Ie.$$.fragment,nt),Go=r(nt),ut=c(nt,"P",{"data-svelte-h":!0}),f(ut)!=="svelte-sxojbn"&&(ut.innerHTML=qa),nt.forEach(a),k.forEach(a),lo=r(e),Xe=c(e,"P",{"data-svelte-h":!0}),f(Xe)!=="svelte-14khwtc"&&(Xe.textContent=Ra),io=r(e),J=c(e,"DIV",{class:!0});var Z=V(J);h(qe.$$.fragment,Z),Io=r(Z),ht=c(Z,"P",{"data-svelte-h":!0}),f(ht)!=="svelte-1ex4b09"&&(ht.innerHTML=Na),Xo=r(Z),gt=c(Z,"P",{"data-svelte-h":!0}),f(gt)!=="svelte-1cmuj5y"&&(gt.innerHTML=Sa),qo=r(Z),_t=c(Z,"P",{"data-svelte-h":!0}),f(_t)!=="svelte-1kxmdw3"&&(_t.innerHTML=Ya),Ro=r(Z),G=c(Z,"DIV",{class:!0});var P=V(G);h(Re.$$.fragment,P),No=r(P),vt=c(P,"P",{"data-svelte-h":!0}),f(vt)!=="svelte-90ok9b"&&(vt.innerHTML=La),So=r(P),h(ae.$$.fragment,P),Yo=r(P),h(ne.$$.fragment,P),P.forEach(a),Z.forEach(a),co=r(e),Ne=c(e,"P",{"data-svelte-h":!0}),f(Ne)!=="svelte-1joanu0"&&(Ne.textContent=Ea),mo=r(e),F=c(e,"DIV",{class:!0});var z=V(F);h(Se.$$.fragment,z),Lo=r(z),bt=c(z,"P",{"data-svelte-h":!0}),f(bt)!=="svelte-in2qpi"&&(bt.innerHTML=Pa),Eo=r(z),yt=c(z,"P",{"data-svelte-h":!0}),f(yt)!=="svelte-1cmuj5y"&&(yt.innerHTML=Ha),Po=r(z),wt=c(z,"P",{"data-svelte-h":!0}),f(wt)!=="svelte-1kxmdw3"&&(wt.innerHTML=Aa),Ho=r(z),I=c(z,"DIV",{class:!0});var H=V(I);h(Ye.$$.fragment,H),Ao=r(H),Mt=c(H,"P",{"data-svelte-h":!0}),f(Mt)!=="svelte-lg6p9n"&&(Mt.innerHTML=Qa),Qo=r(H),h(se.$$.fragment,H),Do=r(H),h(re.$$.fragment,H),H.forEach(a),z.forEach(a),po=r(e),Le=c(e,"P",{"data-svelte-h":!0}),f(Le)!=="svelte-1450w8s"&&(Le.textContent=Da),fo=r(e),j=c(e,"DIV",{class:!0});var N=V(j);h(Ee.$$.fragment,N),Oo=r(N),Tt=c(N,"P",{"data-svelte-h":!0}),f(Tt)!=="svelte-1s90cnz"&&(Tt.textContent=Oa),Ko=r(N),Wt=c(N,"P",{"data-svelte-h":!0}),f(Wt)!=="svelte-1pxfert"&&(Wt.innerHTML=Ka),ea=r(N),kt=c(N,"P",{"data-svelte-h":!0}),f(kt)!=="svelte-1cmuj5y"&&(kt.innerHTML=en),ta=r(N),Vt=c(N,"P",{"data-svelte-h":!0}),f(Vt)!=="svelte-1kxmdw3"&&(Vt.innerHTML=tn),oa=r(N),X=c(N,"DIV",{class:!0});var fe=V(X);h(Pe.$$.fragment,fe),aa=r(fe),Ct=c(fe,"P",{"data-svelte-h":!0}),f(Ct)!=="svelte-ju8x6z"&&(Ct.innerHTML=on),na=r(fe),h(le.$$.fragment,fe),sa=r(fe),h(ie.$$.fragment,fe),fe.forEach(a),N.forEach(a),uo=r(e),He=c(e,"P",{"data-svelte-h":!0}),f(He)!=="svelte-1o4y3jw"&&(He.textContent=an),ho=r(e),x=c(e,"DIV",{class:!0});var S=V(x);h(Ae.$$.fragment,S),ra=r(S),Bt=c(S,"P",{"data-svelte-h":!0}),f(Bt)!=="svelte-13ubh7v"&&(Bt.textContent=nn),la=r(S),jt=c(S,"P",{"data-svelte-h":!0}),f(jt)!=="svelte-1pxfert"&&(jt.innerHTML=sn),ia=r(S),xt=c(S,"P",{"data-svelte-h":!0}),f(xt)!=="svelte-1cmuj5y"&&(xt.innerHTML=rn),ca=r(S),$t=c(S,"P",{"data-svelte-h":!0}),f($t)!=="svelte-1kxmdw3"&&($t.innerHTML=ln),da=r(S),q=c(S,"DIV",{class:!0});var ue=V(q);h(Qe.$$.fragment,ue),ma=r(ue),Jt=c(ue,"P",{"data-svelte-h":!0}),f(Jt)!=="svelte-1ex1s6b"&&(Jt.innerHTML=cn),pa=r(ue),h(ce.$$.fragment,ue),fa=r(ue),h(de.$$.fragment,ue),ue.forEach(a),S.forEach(a),go=r(e),De=c(e,"P",{"data-svelte-h":!0}),f(De)!=="svelte-10pl4ga"&&(De.textContent=dn),_o=r(e),$=c(e,"DIV",{class:!0});var Y=V($);h(Oe.$$.fragment,Y),ua=r(Y),Ft=c(Y,"P",{"data-svelte-h":!0}),f(Ft)!=="svelte-coi2qb"&&(Ft.textContent=mn),ha=r(Y),Ut=c(Y,"P",{"data-svelte-h":!0}),f(Ut)!=="svelte-1pxfert"&&(Ut.innerHTML=pn),ga=r(Y),Zt=c(Y,"P",{"data-svelte-h":!0}),f(Zt)!=="svelte-1cmuj5y"&&(Zt.innerHTML=fn),_a=r(Y),zt=c(Y,"P",{"data-svelte-h":!0}),f(zt)!=="svelte-1kxmdw3"&&(zt.innerHTML=un),va=r(Y),R=c(Y,"DIV",{class:!0});var he=V(R);h(Ke.$$.fragment,he),ba=r(he),Gt=c(he,"P",{"data-svelte-h":!0}),f(Gt)!=="svelte-nlkbo9"&&(Gt.innerHTML=hn),ya=r(he),h(me.$$.fragment,he),wa=r(he),h(pe.$$.fragment,he),he.forEach(a),Y.forEach(a),vo=r(e),h(et.$$.fragment,e),bo=r(e),Rt=c(e,"P",{}),V(Rt).forEach(a),this.h()},h(){C(t,"name","hf:doc:metadata"),C(t,"content",zn),C(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,l){o(document.head,t),d(e,y,l),d(e,m,l),d(e,p,l),g(w,e,l),d(e,n,l),g(M,e,l),d(e,Yt,l),d(e,ge,l),d(e,Lt,l),d(e,_e,l),d(e,Et,l),d(e,ve,l),d(e,Pt,l),d(e,be,l),d(e,Ht,l),d(e,ye,l),d(e,At,l),d(e,we,l),d(e,Qt,l),g(Me,e,l),d(e,Dt,l),d(e,Te,l),d(e,Ot,l),g(We,e,l),d(e,Kt,l),g(ke,e,l),d(e,eo,l),d(e,Ve,l),d(e,to,l),g(Ce,e,l),d(e,oo,l),d(e,Be,l),d(e,ao,l),g(je,e,l),d(e,no,l),d(e,U,l),g(xe,U,null),o(U,wo),o(U,st),o(U,Mo),o(U,rt),o(U,To),g(D,U,null),d(e,so,l),d(e,$e,l),d(e,ro,l),d(e,W,l),g(Je,W,null),o(W,Wo),o(W,lt),o(W,ko),o(W,it),o(W,Vo),o(W,O),g(Fe,O,null),o(O,Co),o(O,ct),o(W,Bo),o(W,K),g(Ue,K,null),o(K,jo),o(K,dt),o(W,xo),o(W,mt),g(Ze,mt,null),o(W,$o),o(W,A),g(ze,A,null),o(A,Jo),o(A,pt),o(A,Fo),g(ee,A,null),o(W,Uo),o(W,te),g(Ge,te,null),o(te,Zo),o(te,ft),o(W,zo),o(W,oe),g(Ie,oe,null),o(oe,Go),o(oe,ut),d(e,lo,l),d(e,Xe,l),d(e,io,l),d(e,J,l),g(qe,J,null),o(J,Io),o(J,ht),o(J,Xo),o(J,gt),o(J,qo),o(J,_t),o(J,Ro),o(J,G),g(Re,G,null),o(G,No),o(G,vt),o(G,So),g(ae,G,null),o(G,Yo),g(ne,G,null),d(e,co,l),d(e,Ne,l),d(e,mo,l),d(e,F,l),g(Se,F,null),o(F,Lo),o(F,bt),o(F,Eo),o(F,yt),o(F,Po),o(F,wt),o(F,Ho),o(F,I),g(Ye,I,null),o(I,Ao),o(I,Mt),o(I,Qo),g(se,I,null),o(I,Do),g(re,I,null),d(e,po,l),d(e,Le,l),d(e,fo,l),d(e,j,l),g(Ee,j,null),o(j,Oo),o(j,Tt),o(j,Ko),o(j,Wt),o(j,ea),o(j,kt),o(j,ta),o(j,Vt),o(j,oa),o(j,X),g(Pe,X,null),o(X,aa),o(X,Ct),o(X,na),g(le,X,null),o(X,sa),g(ie,X,null),d(e,uo,l),d(e,He,l),d(e,ho,l),d(e,x,l),g(Ae,x,null),o(x,ra),o(x,Bt),o(x,la),o(x,jt),o(x,ia),o(x,xt),o(x,ca),o(x,$t),o(x,da),o(x,q),g(Qe,q,null),o(q,ma),o(q,Jt),o(q,pa),g(ce,q,null),o(q,fa),g(de,q,null),d(e,go,l),d(e,De,l),d(e,_o,l),d(e,$,l),g(Oe,$,null),o($,ua),o($,Ft),o($,ha),o($,Ut),o($,ga),o($,Zt),o($,_a),o($,zt),o($,va),o($,R),g(Ke,R,null),o(R,ba),o(R,Gt),o(R,ya),g(me,R,null),o(R,wa),g(pe,R,null),d(e,vo,l),g(et,e,l),d(e,bo,l),d(e,Rt,l),yo=!0},p(e,[l]){const E={};l&2&&(E.$$scope={dirty:l,ctx:e}),D.$set(E);const k={};l&2&&(k.$$scope={dirty:l,ctx:e}),ee.$set(k);const tt={};l&2&&(tt.$$scope={dirty:l,ctx:e}),ae.$set(tt);const ot={};l&2&&(ot.$$scope={dirty:l,ctx:e}),ne.$set(ot);const Nt={};l&2&&(Nt.$$scope={dirty:l,ctx:e}),se.$set(Nt);const Q={};l&2&&(Q.$$scope={dirty:l,ctx:e}),re.$set(Q);const at={};l&2&&(at.$$scope={dirty:l,ctx:e}),le.$set(at);const nt={};l&2&&(nt.$$scope={dirty:l,ctx:e}),ie.$set(nt);const Z={};l&2&&(Z.$$scope={dirty:l,ctx:e}),ce.$set(Z);const P={};l&2&&(P.$$scope={dirty:l,ctx:e}),de.$set(P);const z={};l&2&&(z.$$scope={dirty:l,ctx:e}),me.$set(z);const H={};l&2&&(H.$$scope={dirty:l,ctx:e}),pe.$set(H)},i(e){yo||(_(w.$$.fragment,e),_(M.$$.fragment,e),_(Me.$$.fragment,e),_(We.$$.fragment,e),_(ke.$$.fragment,e),_(Ce.$$.fragment,e),_(je.$$.fragment,e),_(xe.$$.fragment,e),_(D.$$.fragment,e),_(Je.$$.fragment,e),_(Fe.$$.fragment,e),_(Ue.$$.fragment,e),_(Ze.$$.fragment,e),_(ze.$$.fragment,e),_(ee.$$.fragment,e),_(Ge.$$.fragment,e),_(Ie.$$.fragment,e),_(qe.$$.fragment,e),_(Re.$$.fragment,e),_(ae.$$.fragment,e),_(ne.$$.fragment,e),_(Se.$$.fragment,e),_(Ye.$$.fragment,e),_(se.$$.fragment,e),_(re.$$.fragment,e),_(Ee.$$.fragment,e),_(Pe.$$.fragment,e),_(le.$$.fragment,e),_(ie.$$.fragment,e),_(Ae.$$.fragment,e),_(Qe.$$.fragment,e),_(ce.$$.fragment,e),_(de.$$.fragment,e),_(Oe.$$.fragment,e),_(Ke.$$.fragment,e),_(me.$$.fragment,e),_(pe.$$.fragment,e),_(et.$$.fragment,e),yo=!0)},o(e){v(w.$$.fragment,e),v(M.$$.fragment,e),v(Me.$$.fragment,e),v(We.$$.fragment,e),v(ke.$$.fragment,e),v(Ce.$$.fragment,e),v(je.$$.fragment,e),v(xe.$$.fragment,e),v(D.$$.fragment,e),v(Je.$$.fragment,e),v(Fe.$$.fragment,e),v(Ue.$$.fragment,e),v(Ze.$$.fragment,e),v(ze.$$.fragment,e),v(ee.$$.fragment,e),v(Ge.$$.fragment,e),v(Ie.$$.fragment,e),v(qe.$$.fragment,e),v(Re.$$.fragment,e),v(ae.$$.fragment,e),v(ne.$$.fragment,e),v(Se.$$.fragment,e),v(Ye.$$.fragment,e),v(se.$$.fragment,e),v(re.$$.fragment,e),v(Ee.$$.fragment,e),v(Pe.$$.fragment,e),v(le.$$.fragment,e),v(ie.$$.fragment,e),v(Ae.$$.fragment,e),v(Qe.$$.fragment,e),v(ce.$$.fragment,e),v(de.$$.fragment,e),v(Oe.$$.fragment,e),v(Ke.$$.fragment,e),v(me.$$.fragment,e),v(pe.$$.fragment,e),v(et.$$.fragment,e),yo=!1},d(e){e&&(a(y),a(m),a(p),a(n),a(Yt),a(ge),a(Lt),a(_e),a(Et),a(ve),a(Pt),a(be),a(Ht),a(ye),a(At),a(we),a(Qt),a(Dt),a(Te),a(Ot),a(Kt),a(eo),a(Ve),a(to),a(oo),a(Be),a(ao),a(no),a(U),a(so),a($e),a(ro),a(W),a(lo),a(Xe),a(io),a(J),a(co),a(Ne),a(mo),a(F),a(po),a(Le),a(fo),a(j),a(uo),a(He),a(ho),a(x),a(go),a(De),a(_o),a($),a(vo),a(bo),a(Rt)),a(t),b(w,e),b(M,e),b(Me,e),b(We,e),b(ke,e),b(Ce,e),b(je,e),b(xe),b(D),b(Je),b(Fe),b(Ue),b(Ze),b(ze),b(ee),b(Ge),b(Ie),b(qe),b(Re),b(ae),b(ne),b(Se),b(Ye),b(se),b(re),b(Ee),b(Pe),b(le),b(ie),b(Ae),b(Qe),b(ce),b(de),b(Oe),b(Ke),b(me),b(pe),b(et,e)}}}const zn='{"title":"Wav2Vec2-BERT","local":"wav2vec2-bert","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"Wav2Vec2BertConfig","local":"transformers.Wav2Vec2BertConfig","sections":[],"depth":2}],"depth":1}';function Gn(T){return vn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class En extends bn{constructor(t){super(),yn(this,t,Gn,Zn,_n,{})}}export{En as component};
