import{s as cn,o as dn,n as L}from"../chunks/scheduler.9bc65507.js";import{S as mn,i as pn,g as l,s as n,r as u,A as fn,h as c,f as i,c as s,j as k,u as h,x as f,k as C,y as o,a as m,v as g,d as _,t as v,w as b}from"../chunks/index.707bf1b6.js";import{T as It}from"../chunks/Tip.c2ecdbf4.js";import{D as $}from"../chunks/Docstring.17db21ae.js";import{C as qt}from"../chunks/CodeBlock.54a9f38d.js";import{E as Xt}from"../chunks/ExampleCodeBlock.4f515aa9.js";import{P as ln}from"../chunks/PipelineTag.44585822.js";import{H as A}from"../chunks/Heading.342b1fa6.js";function un(T){let t,y="Example:",d,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=l("p"),t.textContent=y,d=n(),u(p.$$.fragment)},l(a){t=c(a,"P",{"data-svelte-h":!0}),f(t)!=="svelte-11lpom8"&&(t.textContent=y),d=s(a),h(p.$$.fragment,a)},m(a,M){m(a,t,M),m(a,d,M),g(p,a,M),w=!0},p:L,i(a){w||(_(p.$$.fragment,a),w=!0)},o(a){v(p.$$.fragment,a),w=!1},d(a){a&&(i(t),i(d)),b(p,a)}}}function hn(T){let t,y=`This class method is simply calling <a href="/docs/transformers/main/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.save_pretrained">save_pretrained()</a> and
<a href="/docs/transformers/main/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=l("p"),t.innerHTML=y},l(d){t=c(d,"P",{"data-svelte-h":!0}),f(t)!=="svelte-1qvfzw2"&&(t.innerHTML=y)},m(d,p){m(d,t,p)},p:L,d(d){d&&i(t)}}}function gn(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=l("p"),t.innerHTML=y},l(d){t=c(d,"P",{"data-svelte-h":!0}),f(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(d,p){m(d,t,p)},p:L,d(d){d&&i(t)}}}function _n(T){let t,y="Example:",d,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=l("p"),t.textContent=y,d=n(),u(p.$$.fragment)},l(a){t=c(a,"P",{"data-svelte-h":!0}),f(t)!=="svelte-11lpom8"&&(t.textContent=y),d=s(a),h(p.$$.fragment,a)},m(a,M){m(a,t,M),m(a,d,M),g(p,a,M),w=!0},p:L,i(a){w||(_(p.$$.fragment,a),w=!0)},o(a){v(p.$$.fragment,a),w=!1},d(a){a&&(i(t),i(d)),b(p,a)}}}function vn(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=l("p"),t.innerHTML=y},l(d){t=c(d,"P",{"data-svelte-h":!0}),f(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(d,p){m(d,t,p)},p:L,d(d){d&&i(t)}}}function bn(T){let t,y="Example:",d,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=l("p"),t.textContent=y,d=n(),u(p.$$.fragment)},l(a){t=c(a,"P",{"data-svelte-h":!0}),f(t)!=="svelte-11lpom8"&&(t.textContent=y),d=s(a),h(p.$$.fragment,a)},m(a,M){m(a,t,M),m(a,d,M),g(p,a,M),w=!0},p:L,i(a){w||(_(p.$$.fragment,a),w=!0)},o(a){v(p.$$.fragment,a),w=!1},d(a){a&&(i(t),i(d)),b(p,a)}}}function yn(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=l("p"),t.innerHTML=y},l(d){t=c(d,"P",{"data-svelte-h":!0}),f(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(d,p){m(d,t,p)},p:L,d(d){d&&i(t)}}}function wn(T){let t,y="Example:",d,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=l("p"),t.textContent=y,d=n(),u(p.$$.fragment)},l(a){t=c(a,"P",{"data-svelte-h":!0}),f(t)!=="svelte-11lpom8"&&(t.textContent=y),d=s(a),h(p.$$.fragment,a)},m(a,M){m(a,t,M),m(a,d,M),g(p,a,M),w=!0},p:L,i(a){w||(_(p.$$.fragment,a),w=!0)},o(a){v(p.$$.fragment,a),w=!1},d(a){a&&(i(t),i(d)),b(p,a)}}}function Mn(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=l("p"),t.innerHTML=y},l(d){t=c(d,"P",{"data-svelte-h":!0}),f(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(d,p){m(d,t,p)},p:L,d(d){d&&i(t)}}}function Tn(T){let t,y="Example:",d,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=l("p"),t.textContent=y,d=n(),u(p.$$.fragment)},l(a){t=c(a,"P",{"data-svelte-h":!0}),f(t)!=="svelte-11lpom8"&&(t.textContent=y),d=s(a),h(p.$$.fragment,a)},m(a,M){m(a,t,M),m(a,d,M),g(p,a,M),w=!0},p:L,i(a){w||(_(p.$$.fragment,a),w=!0)},o(a){v(p.$$.fragment,a),w=!1},d(a){a&&(i(t),i(d)),b(p,a)}}}function Wn(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=l("p"),t.innerHTML=y},l(d){t=c(d,"P",{"data-svelte-h":!0}),f(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(d,p){m(d,t,p)},p:L,d(d){d&&i(t)}}}function Vn(T){let t,y="Example:",d,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=l("p"),t.textContent=y,d=n(),u(p.$$.fragment)},l(a){t=c(a,"P",{"data-svelte-h":!0}),f(t)!=="svelte-11lpom8"&&(t.textContent=y),d=s(a),h(p.$$.fragment,a)},m(a,M){m(a,t,M),m(a,d,M),g(p,a,M),w=!0},p:L,i(a){w||(_(p.$$.fragment,a),w=!0)},o(a){v(p.$$.fragment,a),w=!1},d(a){a&&(i(t),i(d)),b(p,a)}}}function kn(T){let t,y,d,p,w,a,M,St,_e,ya='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.',Yt,ve,wa="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.",Lt,be,Ma="The official results of the model can be found in Section 3.2.1 of the paper.",Et,ye,Ta="The abstract from the paper is the following:",Ht,we,Wa="<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>",Pt,Me,Va='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>.',At,Te,Qt,We,ka=`<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>`,Dt,Ve,Ot,ke,Kt,Ce,Ca='<li><a href="/docs/transformers/main/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>',eo,$e,to,Be,$a='<li><a href="/docs/transformers/main/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>',oo,je,ao,U,Je,bo,st,Ba=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/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.`,yo,rt,ja=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,wo,O,no,xe,so,W,Fe,Mo,it,Ja=`Constructs a Wav2Vec2-BERT processor which wraps a Wav2Vec2-BERT feature extractor and a Wav2Vec2 CTC tokenizer into a single
processor.`,To,lt,xa=`<a href="/docs/transformers/main/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor">Wav2Vec2Processor</a> offers all the functionalities of <a href="/docs/transformers/main/en/model_doc/seamless_m4t#transformers.SeamlessM4TFeatureExtractor">SeamlessM4TFeatureExtractor</a> and <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.
See the docstring of <a href="/docs/transformers/main/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__"><strong>call</strong>()</a> and <a href="/docs/transformers/main/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.decode">decode()</a> for more information.`,Wo,K,Ue,Vo,ct,Fa=`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/main/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/main/en/model_doc/fastspeech2_conformer#transformers.FastSpeech2ConformerTokenizer.__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.`,ko,ee,Ze,Co,dt,Ua=`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/main/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/main/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.`,$o,mt,ze,Bo,Q,Ge,jo,pt,Za=`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/main/en/model_doc/mctct#transformers.MCTCTProcessor.from_pretrained">from_pretrained()</a> method.`,Jo,te,xo,oe,Ie,Fo,ft,za=`This method forwards all its arguments to PreTrainedTokenizer’s <a href="/docs/transformers/main/en/model_doc/fastspeech2_conformer#transformers.FastSpeech2ConformerTokenizer.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,Uo,ae,Xe,Zo,ut,Ga=`This method forwards all its arguments to PreTrainedTokenizer’s <a href="/docs/transformers/main/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.decode">decode()</a>. Please refer
to the docstring of this method for more information.`,ro,qe,io,x,Re,zo,ht,Ia=`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.`,Go,gt,Xa=`This model inherits from <a href="/docs/transformers/main/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.).`,Io,_t,qa=`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.`,Xo,G,Ne,qo,vt,Ra='The <a href="/docs/transformers/main/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertModel">Wav2Vec2BertModel</a> forward method, overrides the <code>__call__</code> special method.',Ro,ne,No,se,lo,Se,co,F,Ye,So,bt,Na=`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.`,Yo,yt,Sa=`This model inherits from <a href="/docs/transformers/main/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.).`,Lo,wt,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.`,Eo,I,Le,Ho,Mt,La='The <a href="/docs/transformers/main/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertForCTC">Wav2Vec2BertForCTC</a> forward method, overrides the <code>__call__</code> special method.',Po,re,Ao,ie,mo,Ee,po,B,He,Qo,Tt,Ea=`Wav2Vec2Bert Model with a sequence classification head on top (a linear layer over the pooled output) for
tasks like SUPERB Keyword Spotting.`,Do,Wt,Ha=`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.`,Oo,Vt,Pa=`This model inherits from <a href="/docs/transformers/main/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.).`,Ko,kt,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.`,ea,X,Pe,ta,Ct,Qa='The <a href="/docs/transformers/main/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertForSequenceClassification">Wav2Vec2BertForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',oa,le,aa,ce,fo,Ae,uo,j,Qe,na,$t,Da="Wav2Vec2Bert Model with a frame classification head on top for tasks like Speaker Diarization.",sa,Bt,Oa=`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.`,ra,jt,Ka=`This model inherits from <a href="/docs/transformers/main/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.).`,ia,Jt,en=`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.`,la,q,De,ca,xt,tn='The <a href="/docs/transformers/main/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertForAudioFrameClassification">Wav2Vec2BertForAudioFrameClassification</a> forward method, overrides the <code>__call__</code> special method.',da,de,ma,me,ho,Oe,go,J,Ke,pa,Ft,on="Wav2Vec2Bert Model with an XVector feature extraction head on top for tasks like Speaker Verification.",fa,Ut,an=`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.`,ua,Zt,nn=`This model inherits from <a href="/docs/transformers/main/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.).`,ha,zt,sn=`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.`,ga,R,et,_a,Gt,rn='The <a href="/docs/transformers/main/en/model_doc/wav2vec2-bert#transformers.Wav2Vec2BertForXVector">Wav2Vec2BertForXVector</a> forward method, overrides the <code>__call__</code> special method.',va,pe,ba,fe,_o,Rt,vo;return w=new A({props:{title:"Wav2Vec2-BERT",local:"wav2vec2-bert",headingTag:"h1"}}),M=new A({props:{title:"Overview",local:"overview",headingTag:"h2"}}),Te=new A({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),Ve=new A({props:{title:"Resources",local:"resources",headingTag:"h2"}}),ke=new ln({props:{pipeline:"automatic-speech-recognition"}}),$e=new ln({props:{pipeline:"audio-classification"}}),je=new A({props:{title:"Wav2Vec2BertConfig",local:"transformers.Wav2Vec2BertConfig",headingTag:"h2"}}),Je=new $({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/main/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/main/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/main/en/model_doc/seamless_m4t#transformers.SeamlessM4TFeatureExtractor">SeamlessM4TFeatureExtractor</a> or <a href="/docs/transformers/main/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/main/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/main/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/main/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/main/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/main/src/transformers/models/wav2vec2_bert/configuration_wav2vec2_bert.py#L29"}}),O=new Xt({props:{anchor:"transformers.Wav2Vec2BertConfig.example",$$slots:{default:[un]},$$scope:{ctx:T}}}),xe=new A({props:{title:"Wav2Vec2BertProcessor",local:"transformers.Wav2Vec2BertProcessor",headingTag:"h2"}}),Fe=new $({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/main/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/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
An instance of <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/wav2vec2_bert/processing_wav2vec2_bert.py#L25"}}),Ue=new $({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/main/src/transformers/models/wav2vec2_bert/processing_wav2vec2_bert.py#L65",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),Ze=new $({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/main/src/transformers/models/wav2vec2_bert/processing_wav2vec2_bert.py#L111"}}),ze=new $({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/main/src/transformers/models/wav2vec2_bert/processing_wav2vec2_bert.py#L46"}}),Ge=new $({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/main/en/main_classes/model#transformers.utils.PushToHubMixin.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/processing_utils.py#L167"}}),te=new It({props:{$$slots:{default:[hn]},$$scope:{ctx:T}}}),Ie=new $({props:{name:"batch_decode",anchor:"transformers.Wav2Vec2BertProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/wav2vec2_bert/processing_wav2vec2_bert.py#L133"}}),Xe=new $({props:{name:"decode",anchor:"transformers.Wav2Vec2BertProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/wav2vec2_bert/processing_wav2vec2_bert.py#L140"}}),qe=new A({props:{title:"Wav2Vec2BertModel",local:"transformers.Wav2Vec2BertModel",headingTag:"h2"}}),Re=new $({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/main/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/main/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/main/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py#L1047"}}),Ne=new $({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/main/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/main/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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py#L1119",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/model_doc/wav2vec2#transformers.modeling_outputs.Wav2Vec2BaseModelOutput"
>transformers.modeling_outputs.Wav2Vec2BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ne=new It({props:{$$slots:{default:[gn]},$$scope:{ctx:T}}}),se=new Xt({props:{anchor:"transformers.Wav2Vec2BertModel.forward.example",$$slots:{default:[_n]},$$scope:{ctx:T}}}),Se=new A({props:{title:"Wav2Vec2BertForCTC",local:"transformers.Wav2Vec2BertForCTC",headingTag:"h2"}}),Ye=new $({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/main/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/main/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/main/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py#L1175"}}),Le=new $({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/main/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/main/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/main/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/main/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py#L1204",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutput"
>transformers.modeling_outputs.CausalLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),re=new It({props:{$$slots:{default:[vn]},$$scope:{ctx:T}}}),ie=new Xt({props:{anchor:"transformers.Wav2Vec2BertForCTC.forward.example",$$slots:{default:[bn]},$$scope:{ctx:T}}}),Ee=new A({props:{title:"Wav2Vec2BertForSequenceClassification",local:"transformers.Wav2Vec2BertForSequenceClassification",headingTag:"h2"}}),He=new $({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/main/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/main/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/main/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py#L1286"}}),Pe=new $({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/main/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/main/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/main/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/main/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py#L1320",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/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/main/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:[yn]},$$scope:{ctx:T}}}),ce=new Xt({props:{anchor:"transformers.Wav2Vec2BertForSequenceClassification.forward.example",$$slots:{default:[wn]},$$scope:{ctx:T}}}),Ae=new A({props:{title:"Wav2Vec2BertForAudioFrameClassification",local:"transformers.Wav2Vec2BertForAudioFrameClassification",headingTag:"h2"}}),Qe=new $({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/main/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/main/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/main/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py#L1390"}}),De=new $({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/main/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/main/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/main/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/main/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py#L1423",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),de=new It({props:{$$slots:{default:[Mn]},$$scope:{ctx:T}}}),me=new Xt({props:{anchor:"transformers.Wav2Vec2BertForAudioFrameClassification.forward.example",$$slots:{default:[Tn]},$$scope:{ctx:T}}}),Oe=new A({props:{title:"Wav2Vec2BertForXVector",local:"transformers.Wav2Vec2BertForXVector",headingTag:"h2"}}),Ke=new $({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/main/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/main/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/main/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py#L1541"}}),et=new $({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/main/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/main/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/main/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/main/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py#L1593",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_outputs.XVectorOutput"
>transformers.modeling_outputs.XVectorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),pe=new It({props:{$$slots:{default:[Wn]},$$scope:{ctx:T}}}),fe=new Xt({props:{anchor:"transformers.Wav2Vec2BertForXVector.forward.example",$$slots:{default:[Vn]},$$scope:{ctx:T}}}),{c(){t=l("meta"),y=n(),d=l("p"),p=n(),u(w.$$.fragment),a=n(),u(M.$$.fragment),St=n(),_e=l("p"),_e.innerHTML=ya,Yt=n(),ve=l("p"),ve.textContent=wa,Lt=n(),be=l("p"),be.textContent=Ma,Et=n(),ye=l("p"),ye.textContent=Ta,Ht=n(),we=l("p"),we.innerHTML=Wa,Pt=n(),Me=l("p"),Me.innerHTML=Va,At=n(),u(Te.$$.fragment),Qt=n(),We=l("ul"),We.innerHTML=ka,Dt=n(),u(Ve.$$.fragment),Ot=n(),u(ke.$$.fragment),Kt=n(),Ce=l("ul"),Ce.innerHTML=Ca,eo=n(),u($e.$$.fragment),to=n(),Be=l("ul"),Be.innerHTML=$a,oo=n(),u(je.$$.fragment),ao=n(),U=l("div"),u(Je.$$.fragment),bo=n(),st=l("p"),st.innerHTML=Ba,yo=n(),rt=l("p"),rt.innerHTML=ja,wo=n(),u(O.$$.fragment),no=n(),u(xe.$$.fragment),so=n(),W=l("div"),u(Fe.$$.fragment),Mo=n(),it=l("p"),it.textContent=Ja,To=n(),lt=l("p"),lt.innerHTML=xa,Wo=n(),K=l("div"),u(Ue.$$.fragment),Vo=n(),ct=l("p"),ct.innerHTML=Fa,ko=n(),ee=l("div"),u(Ze.$$.fragment),Co=n(),dt=l("p"),dt.innerHTML=Ua,$o=n(),mt=l("div"),u(ze.$$.fragment),Bo=n(),Q=l("div"),u(Ge.$$.fragment),jo=n(),pt=l("p"),pt.innerHTML=Za,Jo=n(),u(te.$$.fragment),xo=n(),oe=l("div"),u(Ie.$$.fragment),Fo=n(),ft=l("p"),ft.innerHTML=za,Uo=n(),ae=l("div"),u(Xe.$$.fragment),Zo=n(),ut=l("p"),ut.innerHTML=Ga,ro=n(),u(qe.$$.fragment),io=n(),x=l("div"),u(Re.$$.fragment),zo=n(),ht=l("p"),ht.innerHTML=Ia,Go=n(),gt=l("p"),gt.innerHTML=Xa,Io=n(),_t=l("p"),_t.innerHTML=qa,Xo=n(),G=l("div"),u(Ne.$$.fragment),qo=n(),vt=l("p"),vt.innerHTML=Ra,Ro=n(),u(ne.$$.fragment),No=n(),u(se.$$.fragment),lo=n(),u(Se.$$.fragment),co=n(),F=l("div"),u(Ye.$$.fragment),So=n(),bt=l("p"),bt.innerHTML=Na,Yo=n(),yt=l("p"),yt.innerHTML=Sa,Lo=n(),wt=l("p"),wt.innerHTML=Ya,Eo=n(),I=l("div"),u(Le.$$.fragment),Ho=n(),Mt=l("p"),Mt.innerHTML=La,Po=n(),u(re.$$.fragment),Ao=n(),u(ie.$$.fragment),mo=n(),u(Ee.$$.fragment),po=n(),B=l("div"),u(He.$$.fragment),Qo=n(),Tt=l("p"),Tt.textContent=Ea,Do=n(),Wt=l("p"),Wt.innerHTML=Ha,Oo=n(),Vt=l("p"),Vt.innerHTML=Pa,Ko=n(),kt=l("p"),kt.innerHTML=Aa,ea=n(),X=l("div"),u(Pe.$$.fragment),ta=n(),Ct=l("p"),Ct.innerHTML=Qa,oa=n(),u(le.$$.fragment),aa=n(),u(ce.$$.fragment),fo=n(),u(Ae.$$.fragment),uo=n(),j=l("div"),u(Qe.$$.fragment),na=n(),$t=l("p"),$t.textContent=Da,sa=n(),Bt=l("p"),Bt.innerHTML=Oa,ra=n(),jt=l("p"),jt.innerHTML=Ka,ia=n(),Jt=l("p"),Jt.innerHTML=en,la=n(),q=l("div"),u(De.$$.fragment),ca=n(),xt=l("p"),xt.innerHTML=tn,da=n(),u(de.$$.fragment),ma=n(),u(me.$$.fragment),ho=n(),u(Oe.$$.fragment),go=n(),J=l("div"),u(Ke.$$.fragment),pa=n(),Ft=l("p"),Ft.textContent=on,fa=n(),Ut=l("p"),Ut.innerHTML=an,ua=n(),Zt=l("p"),Zt.innerHTML=nn,ha=n(),zt=l("p"),zt.innerHTML=sn,ga=n(),R=l("div"),u(et.$$.fragment),_a=n(),Gt=l("p"),Gt.innerHTML=rn,va=n(),u(pe.$$.fragment),ba=n(),u(fe.$$.fragment),_o=n(),Rt=l("p"),this.h()},l(e){const r=fn("svelte-u9bgzb",document.head);t=c(r,"META",{name:!0,content:!0}),r.forEach(i),y=s(e),d=c(e,"P",{}),k(d).forEach(i),p=s(e),h(w.$$.fragment,e),a=s(e),h(M.$$.fragment,e),St=s(e),_e=c(e,"P",{"data-svelte-h":!0}),f(_e)!=="svelte-zyaorv"&&(_e.innerHTML=ya),Yt=s(e),ve=c(e,"P",{"data-svelte-h":!0}),f(ve)!=="svelte-klyyhl"&&(ve.textContent=wa),Lt=s(e),be=c(e,"P",{"data-svelte-h":!0}),f(be)!=="svelte-1rgpbum"&&(be.textContent=Ma),Et=s(e),ye=c(e,"P",{"data-svelte-h":!0}),f(ye)!=="svelte-vfdo9a"&&(ye.textContent=Ta),Ht=s(e),we=c(e,"P",{"data-svelte-h":!0}),f(we)!=="svelte-1vw0n52"&&(we.innerHTML=Wa),Pt=s(e),Me=c(e,"P",{"data-svelte-h":!0}),f(Me)!=="svelte-mez4is"&&(Me.innerHTML=Va),At=s(e),h(Te.$$.fragment,e),Qt=s(e),We=c(e,"UL",{"data-svelte-h":!0}),f(We)!=="svelte-13pou99"&&(We.innerHTML=ka),Dt=s(e),h(Ve.$$.fragment,e),Ot=s(e),h(ke.$$.fragment,e),Kt=s(e),Ce=c(e,"UL",{"data-svelte-h":!0}),f(Ce)!=="svelte-1xbspij"&&(Ce.innerHTML=Ca),eo=s(e),h($e.$$.fragment,e),to=s(e),Be=c(e,"UL",{"data-svelte-h":!0}),f(Be)!=="svelte-v62u3d"&&(Be.innerHTML=$a),oo=s(e),h(je.$$.fragment,e),ao=s(e),U=c(e,"DIV",{class:!0});var E=k(U);h(Je.$$.fragment,E),bo=s(E),st=c(E,"P",{"data-svelte-h":!0}),f(st)!=="svelte-14mjb33"&&(st.innerHTML=Ba),yo=s(E),rt=c(E,"P",{"data-svelte-h":!0}),f(rt)!=="svelte-o55m63"&&(rt.innerHTML=ja),wo=s(E),h(O.$$.fragment,E),E.forEach(i),no=s(e),h(xe.$$.fragment,e),so=s(e),W=c(e,"DIV",{class:!0});var V=k(W);h(Fe.$$.fragment,V),Mo=s(V),it=c(V,"P",{"data-svelte-h":!0}),f(it)!=="svelte-1q4hwoc"&&(it.textContent=Ja),To=s(V),lt=c(V,"P",{"data-svelte-h":!0}),f(lt)!=="svelte-1uqr6jj"&&(lt.innerHTML=xa),Wo=s(V),K=c(V,"DIV",{class:!0});var tt=k(K);h(Ue.$$.fragment,tt),Vo=s(tt),ct=c(tt,"P",{"data-svelte-h":!0}),f(ct)!=="svelte-1yrtqpk"&&(ct.innerHTML=Fa),tt.forEach(i),ko=s(V),ee=c(V,"DIV",{class:!0});var ot=k(ee);h(Ze.$$.fragment,ot),Co=s(ot),dt=c(ot,"P",{"data-svelte-h":!0}),f(dt)!=="svelte-2ngqzs"&&(dt.innerHTML=Ua),ot.forEach(i),$o=s(V),mt=c(V,"DIV",{class:!0});var Nt=k(mt);h(ze.$$.fragment,Nt),Nt.forEach(i),Bo=s(V),Q=c(V,"DIV",{class:!0});var D=k(Q);h(Ge.$$.fragment,D),jo=s(D),pt=c(D,"P",{"data-svelte-h":!0}),f(pt)!=="svelte-pd1tp5"&&(pt.innerHTML=Za),Jo=s(D),h(te.$$.fragment,D),D.forEach(i),xo=s(V),oe=c(V,"DIV",{class:!0});var at=k(oe);h(Ie.$$.fragment,at),Fo=s(at),ft=c(at,"P",{"data-svelte-h":!0}),f(ft)!=="svelte-taj591"&&(ft.innerHTML=za),at.forEach(i),Uo=s(V),ae=c(V,"DIV",{class:!0});var nt=k(ae);h(Xe.$$.fragment,nt),Zo=s(nt),ut=c(nt,"P",{"data-svelte-h":!0}),f(ut)!=="svelte-lpo0rc"&&(ut.innerHTML=Ga),nt.forEach(i),V.forEach(i),ro=s(e),h(qe.$$.fragment,e),io=s(e),x=c(e,"DIV",{class:!0});var Z=k(x);h(Re.$$.fragment,Z),zo=s(Z),ht=c(Z,"P",{"data-svelte-h":!0}),f(ht)!=="svelte-1ex4b09"&&(ht.innerHTML=Ia),Go=s(Z),gt=c(Z,"P",{"data-svelte-h":!0}),f(gt)!=="svelte-1c8p9n2"&&(gt.innerHTML=Xa),Io=s(Z),_t=c(Z,"P",{"data-svelte-h":!0}),f(_t)!=="svelte-1uzc5pd"&&(_t.innerHTML=qa),Xo=s(Z),G=c(Z,"DIV",{class:!0});var H=k(G);h(Ne.$$.fragment,H),qo=s(H),vt=c(H,"P",{"data-svelte-h":!0}),f(vt)!=="svelte-1ho8ugn"&&(vt.innerHTML=Ra),Ro=s(H),h(ne.$$.fragment,H),No=s(H),h(se.$$.fragment,H),H.forEach(i),Z.forEach(i),lo=s(e),h(Se.$$.fragment,e),co=s(e),F=c(e,"DIV",{class:!0});var z=k(F);h(Ye.$$.fragment,z),So=s(z),bt=c(z,"P",{"data-svelte-h":!0}),f(bt)!=="svelte-in2qpi"&&(bt.innerHTML=Na),Yo=s(z),yt=c(z,"P",{"data-svelte-h":!0}),f(yt)!=="svelte-1c8p9n2"&&(yt.innerHTML=Sa),Lo=s(z),wt=c(z,"P",{"data-svelte-h":!0}),f(wt)!=="svelte-1uzc5pd"&&(wt.innerHTML=Ya),Eo=s(z),I=c(z,"DIV",{class:!0});var P=k(I);h(Le.$$.fragment,P),Ho=s(P),Mt=c(P,"P",{"data-svelte-h":!0}),f(Mt)!=="svelte-13trme3"&&(Mt.innerHTML=La),Po=s(P),h(re.$$.fragment,P),Ao=s(P),h(ie.$$.fragment,P),P.forEach(i),z.forEach(i),mo=s(e),h(Ee.$$.fragment,e),po=s(e),B=c(e,"DIV",{class:!0});var N=k(B);h(He.$$.fragment,N),Qo=s(N),Tt=c(N,"P",{"data-svelte-h":!0}),f(Tt)!=="svelte-1s90cnz"&&(Tt.textContent=Ea),Do=s(N),Wt=c(N,"P",{"data-svelte-h":!0}),f(Wt)!=="svelte-1pxfert"&&(Wt.innerHTML=Ha),Oo=s(N),Vt=c(N,"P",{"data-svelte-h":!0}),f(Vt)!=="svelte-1c8p9n2"&&(Vt.innerHTML=Pa),Ko=s(N),kt=c(N,"P",{"data-svelte-h":!0}),f(kt)!=="svelte-1uzc5pd"&&(kt.innerHTML=Aa),ea=s(N),X=c(N,"DIV",{class:!0});var ue=k(X);h(Pe.$$.fragment,ue),ta=s(ue),Ct=c(ue,"P",{"data-svelte-h":!0}),f(Ct)!=="svelte-nu3wfv"&&(Ct.innerHTML=Qa),oa=s(ue),h(le.$$.fragment,ue),aa=s(ue),h(ce.$$.fragment,ue),ue.forEach(i),N.forEach(i),fo=s(e),h(Ae.$$.fragment,e),uo=s(e),j=c(e,"DIV",{class:!0});var S=k(j);h(Qe.$$.fragment,S),na=s(S),$t=c(S,"P",{"data-svelte-h":!0}),f($t)!=="svelte-13ubh7v"&&($t.textContent=Da),sa=s(S),Bt=c(S,"P",{"data-svelte-h":!0}),f(Bt)!=="svelte-1pxfert"&&(Bt.innerHTML=Oa),ra=s(S),jt=c(S,"P",{"data-svelte-h":!0}),f(jt)!=="svelte-1c8p9n2"&&(jt.innerHTML=Ka),ia=s(S),Jt=c(S,"P",{"data-svelte-h":!0}),f(Jt)!=="svelte-1uzc5pd"&&(Jt.innerHTML=en),la=s(S),q=c(S,"DIV",{class:!0});var he=k(q);h(De.$$.fragment,he),ca=s(he),xt=c(he,"P",{"data-svelte-h":!0}),f(xt)!=="svelte-1mkwzub"&&(xt.innerHTML=tn),da=s(he),h(de.$$.fragment,he),ma=s(he),h(me.$$.fragment,he),he.forEach(i),S.forEach(i),ho=s(e),h(Oe.$$.fragment,e),go=s(e),J=c(e,"DIV",{class:!0});var Y=k(J);h(Ke.$$.fragment,Y),pa=s(Y),Ft=c(Y,"P",{"data-svelte-h":!0}),f(Ft)!=="svelte-coi2qb"&&(Ft.textContent=on),fa=s(Y),Ut=c(Y,"P",{"data-svelte-h":!0}),f(Ut)!=="svelte-1pxfert"&&(Ut.innerHTML=an),ua=s(Y),Zt=c(Y,"P",{"data-svelte-h":!0}),f(Zt)!=="svelte-1c8p9n2"&&(Zt.innerHTML=nn),ha=s(Y),zt=c(Y,"P",{"data-svelte-h":!0}),f(zt)!=="svelte-1uzc5pd"&&(zt.innerHTML=sn),ga=s(Y),R=c(Y,"DIV",{class:!0});var ge=k(R);h(et.$$.fragment,ge),_a=s(ge),Gt=c(ge,"P",{"data-svelte-h":!0}),f(Gt)!=="svelte-k88ny5"&&(Gt.innerHTML=rn),va=s(ge),h(pe.$$.fragment,ge),ba=s(ge),h(fe.$$.fragment,ge),ge.forEach(i),Y.forEach(i),_o=s(e),Rt=c(e,"P",{}),k(Rt).forEach(i),this.h()},h(){C(t,"name","hf:doc:metadata"),C(t,"content",Cn),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(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(ee,"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(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(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(ae,"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(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(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(B,"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(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(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(J,"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,r){o(document.head,t),m(e,y,r),m(e,d,r),m(e,p,r),g(w,e,r),m(e,a,r),g(M,e,r),m(e,St,r),m(e,_e,r),m(e,Yt,r),m(e,ve,r),m(e,Lt,r),m(e,be,r),m(e,Et,r),m(e,ye,r),m(e,Ht,r),m(e,we,r),m(e,Pt,r),m(e,Me,r),m(e,At,r),g(Te,e,r),m(e,Qt,r),m(e,We,r),m(e,Dt,r),g(Ve,e,r),m(e,Ot,r),g(ke,e,r),m(e,Kt,r),m(e,Ce,r),m(e,eo,r),g($e,e,r),m(e,to,r),m(e,Be,r),m(e,oo,r),g(je,e,r),m(e,ao,r),m(e,U,r),g(Je,U,null),o(U,bo),o(U,st),o(U,yo),o(U,rt),o(U,wo),g(O,U,null),m(e,no,r),g(xe,e,r),m(e,so,r),m(e,W,r),g(Fe,W,null),o(W,Mo),o(W,it),o(W,To),o(W,lt),o(W,Wo),o(W,K),g(Ue,K,null),o(K,Vo),o(K,ct),o(W,ko),o(W,ee),g(Ze,ee,null),o(ee,Co),o(ee,dt),o(W,$o),o(W,mt),g(ze,mt,null),o(W,Bo),o(W,Q),g(Ge,Q,null),o(Q,jo),o(Q,pt),o(Q,Jo),g(te,Q,null),o(W,xo),o(W,oe),g(Ie,oe,null),o(oe,Fo),o(oe,ft),o(W,Uo),o(W,ae),g(Xe,ae,null),o(ae,Zo),o(ae,ut),m(e,ro,r),g(qe,e,r),m(e,io,r),m(e,x,r),g(Re,x,null),o(x,zo),o(x,ht),o(x,Go),o(x,gt),o(x,Io),o(x,_t),o(x,Xo),o(x,G),g(Ne,G,null),o(G,qo),o(G,vt),o(G,Ro),g(ne,G,null),o(G,No),g(se,G,null),m(e,lo,r),g(Se,e,r),m(e,co,r),m(e,F,r),g(Ye,F,null),o(F,So),o(F,bt),o(F,Yo),o(F,yt),o(F,Lo),o(F,wt),o(F,Eo),o(F,I),g(Le,I,null),o(I,Ho),o(I,Mt),o(I,Po),g(re,I,null),o(I,Ao),g(ie,I,null),m(e,mo,r),g(Ee,e,r),m(e,po,r),m(e,B,r),g(He,B,null),o(B,Qo),o(B,Tt),o(B,Do),o(B,Wt),o(B,Oo),o(B,Vt),o(B,Ko),o(B,kt),o(B,ea),o(B,X),g(Pe,X,null),o(X,ta),o(X,Ct),o(X,oa),g(le,X,null),o(X,aa),g(ce,X,null),m(e,fo,r),g(Ae,e,r),m(e,uo,r),m(e,j,r),g(Qe,j,null),o(j,na),o(j,$t),o(j,sa),o(j,Bt),o(j,ra),o(j,jt),o(j,ia),o(j,Jt),o(j,la),o(j,q),g(De,q,null),o(q,ca),o(q,xt),o(q,da),g(de,q,null),o(q,ma),g(me,q,null),m(e,ho,r),g(Oe,e,r),m(e,go,r),m(e,J,r),g(Ke,J,null),o(J,pa),o(J,Ft),o(J,fa),o(J,Ut),o(J,ua),o(J,Zt),o(J,ha),o(J,zt),o(J,ga),o(J,R),g(et,R,null),o(R,_a),o(R,Gt),o(R,va),g(pe,R,null),o(R,ba),g(fe,R,null),m(e,_o,r),m(e,Rt,r),vo=!0},p(e,[r]){const E={};r&2&&(E.$$scope={dirty:r,ctx:e}),O.$set(E);const V={};r&2&&(V.$$scope={dirty:r,ctx:e}),te.$set(V);const tt={};r&2&&(tt.$$scope={dirty:r,ctx:e}),ne.$set(tt);const ot={};r&2&&(ot.$$scope={dirty:r,ctx:e}),se.$set(ot);const Nt={};r&2&&(Nt.$$scope={dirty:r,ctx:e}),re.$set(Nt);const D={};r&2&&(D.$$scope={dirty:r,ctx:e}),ie.$set(D);const at={};r&2&&(at.$$scope={dirty:r,ctx:e}),le.$set(at);const nt={};r&2&&(nt.$$scope={dirty:r,ctx:e}),ce.$set(nt);const Z={};r&2&&(Z.$$scope={dirty:r,ctx:e}),de.$set(Z);const H={};r&2&&(H.$$scope={dirty:r,ctx:e}),me.$set(H);const z={};r&2&&(z.$$scope={dirty:r,ctx:e}),pe.$set(z);const P={};r&2&&(P.$$scope={dirty:r,ctx:e}),fe.$set(P)},i(e){vo||(_(w.$$.fragment,e),_(M.$$.fragment,e),_(Te.$$.fragment,e),_(Ve.$$.fragment,e),_(ke.$$.fragment,e),_($e.$$.fragment,e),_(je.$$.fragment,e),_(Je.$$.fragment,e),_(O.$$.fragment,e),_(xe.$$.fragment,e),_(Fe.$$.fragment,e),_(Ue.$$.fragment,e),_(Ze.$$.fragment,e),_(ze.$$.fragment,e),_(Ge.$$.fragment,e),_(te.$$.fragment,e),_(Ie.$$.fragment,e),_(Xe.$$.fragment,e),_(qe.$$.fragment,e),_(Re.$$.fragment,e),_(Ne.$$.fragment,e),_(ne.$$.fragment,e),_(se.$$.fragment,e),_(Se.$$.fragment,e),_(Ye.$$.fragment,e),_(Le.$$.fragment,e),_(re.$$.fragment,e),_(ie.$$.fragment,e),_(Ee.$$.fragment,e),_(He.$$.fragment,e),_(Pe.$$.fragment,e),_(le.$$.fragment,e),_(ce.$$.fragment,e),_(Ae.$$.fragment,e),_(Qe.$$.fragment,e),_(De.$$.fragment,e),_(de.$$.fragment,e),_(me.$$.fragment,e),_(Oe.$$.fragment,e),_(Ke.$$.fragment,e),_(et.$$.fragment,e),_(pe.$$.fragment,e),_(fe.$$.fragment,e),vo=!0)},o(e){v(w.$$.fragment,e),v(M.$$.fragment,e),v(Te.$$.fragment,e),v(Ve.$$.fragment,e),v(ke.$$.fragment,e),v($e.$$.fragment,e),v(je.$$.fragment,e),v(Je.$$.fragment,e),v(O.$$.fragment,e),v(xe.$$.fragment,e),v(Fe.$$.fragment,e),v(Ue.$$.fragment,e),v(Ze.$$.fragment,e),v(ze.$$.fragment,e),v(Ge.$$.fragment,e),v(te.$$.fragment,e),v(Ie.$$.fragment,e),v(Xe.$$.fragment,e),v(qe.$$.fragment,e),v(Re.$$.fragment,e),v(Ne.$$.fragment,e),v(ne.$$.fragment,e),v(se.$$.fragment,e),v(Se.$$.fragment,e),v(Ye.$$.fragment,e),v(Le.$$.fragment,e),v(re.$$.fragment,e),v(ie.$$.fragment,e),v(Ee.$$.fragment,e),v(He.$$.fragment,e),v(Pe.$$.fragment,e),v(le.$$.fragment,e),v(ce.$$.fragment,e),v(Ae.$$.fragment,e),v(Qe.$$.fragment,e),v(De.$$.fragment,e),v(de.$$.fragment,e),v(me.$$.fragment,e),v(Oe.$$.fragment,e),v(Ke.$$.fragment,e),v(et.$$.fragment,e),v(pe.$$.fragment,e),v(fe.$$.fragment,e),vo=!1},d(e){e&&(i(y),i(d),i(p),i(a),i(St),i(_e),i(Yt),i(ve),i(Lt),i(be),i(Et),i(ye),i(Ht),i(we),i(Pt),i(Me),i(At),i(Qt),i(We),i(Dt),i(Ot),i(Kt),i(Ce),i(eo),i(to),i(Be),i(oo),i(ao),i(U),i(no),i(so),i(W),i(ro),i(io),i(x),i(lo),i(co),i(F),i(mo),i(po),i(B),i(fo),i(uo),i(j),i(ho),i(go),i(J),i(_o),i(Rt)),i(t),b(w,e),b(M,e),b(Te,e),b(Ve,e),b(ke,e),b($e,e),b(je,e),b(Je),b(O),b(xe,e),b(Fe),b(Ue),b(Ze),b(ze),b(Ge),b(te),b(Ie),b(Xe),b(qe,e),b(Re),b(Ne),b(ne),b(se),b(Se,e),b(Ye),b(Le),b(re),b(ie),b(Ee,e),b(He),b(Pe),b(le),b(ce),b(Ae,e),b(Qe),b(De),b(de),b(me),b(Oe,e),b(Ke),b(et),b(pe),b(fe)}}}const Cn='{"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},{"title":"Wav2Vec2BertProcessor","local":"transformers.Wav2Vec2BertProcessor","sections":[],"depth":2},{"title":"Wav2Vec2BertModel","local":"transformers.Wav2Vec2BertModel","sections":[],"depth":2},{"title":"Wav2Vec2BertForCTC","local":"transformers.Wav2Vec2BertForCTC","sections":[],"depth":2},{"title":"Wav2Vec2BertForSequenceClassification","local":"transformers.Wav2Vec2BertForSequenceClassification","sections":[],"depth":2},{"title":"Wav2Vec2BertForAudioFrameClassification","local":"transformers.Wav2Vec2BertForAudioFrameClassification","sections":[],"depth":2},{"title":"Wav2Vec2BertForXVector","local":"transformers.Wav2Vec2BertForXVector","sections":[],"depth":2}],"depth":1}';function $n(T){return dn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Gn extends mn{constructor(t){super(),pn(this,t,$n,kn,cn,{})}}export{Gn as component};
