import{S as td,i as rd,s as nd,e as r,k as m,w as y,t as s,M as ad,c as n,d as t,m as p,a,x as w,h as l,b as c,G as e,g as v,y as M,q as C,o as T,B as W,v as sd,L as pt}from"../../chunks/vendor-hf-doc-builder.js";import{T as St}from"../../chunks/Tip-hf-doc-builder.js";import{D as x}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ft}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as P}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as mt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function ld(V){let d,b,g,h,_;return h=new ft({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFdhdjJWZWMyQ29uZm9ybWVyQ29uZmlnJTJDJTIwV2F2MlZlYzJDb25mb3JtZXJNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBXYXYyVmVjMkNvbmZvcm1lciUyMGZhY2Vib29rJTJGd2F2MnZlYzItY29uZm9ybWVyLXJlbC1wb3MtbGFyZ2UlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwV2F2MlZlYzJDb25mb3JtZXJDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwZmFjZWJvb2slMkZ3YXYydmVjMi1jb25mb3JtZXItcmVsLXBvcy1sYXJnZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwV2F2MlZlYzJDb25mb3JtZXJNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2ConformerConfig, Wav2Vec2ConformerModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the facebook/wav2vec2-conformer-rel-pos-large style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2ConformerModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){d=r("p"),b=s("Example:"),g=m(),y(h.$$.fragment)},l(i){d=n(i,"P",{});var f=a(d);b=l(f,"Example:"),f.forEach(t),g=p(i),w(h.$$.fragment,i)},m(i,f){v(i,d,f),e(d,b),v(i,g,f),M(h,i,f),_=!0},p:pt,i(i){_||(C(h.$$.fragment,i),_=!0)},o(i){T(h.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(g),W(h,i)}}}function id(V){let d,b,g,h,_;return{c(){d=r("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r("code"),h=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){d=n(i,"P",{});var f=a(d);b=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(f,"CODE",{});var k=a(g);h=l(k,"Module"),k.forEach(t),_=l(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(i,f){v(i,d,f),e(d,b),e(d,g),e(g,h),e(d,_)},d(i){i&&t(d)}}}function cd(V){let d,b,g,h,_;return h=new ft({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBXYXYyVmVjMkNvbmZvcm1lck1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmhmLWludGVybmFsLXRlc3RpbmclMkZsaWJyaXNwZWVjaF9hc3JfZGVtbyUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWRhdGFzZXQlMjAlM0QlMjBkYXRhc2V0LnNvcnQoJTIyaWQlMjIpJTBBc2FtcGxpbmdfcmF0ZSUyMCUzRCUyMGRhdGFzZXQuZmVhdHVyZXMlNUIlMjJhdWRpbyUyMiU1RC5zYW1wbGluZ19yYXRlJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3YXYydmVjMi1jb25mb3JtZXItcm9wZS1sYXJnZS05NjBoLWZ0JTIyKSUwQW1vZGVsJTIwJTNEJTIwV2F2MlZlYzJDb25mb3JtZXJNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3YXYydmVjMi1jb25mb3JtZXItcm9wZS1sYXJnZS05NjBoLWZ0JTIyKSUwQSUwQSUyMyUyMGF1ZGlvJTIwZmlsZSUyMGlzJTIwZGVjb2RlZCUyMG9uJTIwdGhlJTIwZmx5JTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGRhdGFzZXQlNUIwJTVEJTVCJTIyYXVkaW8lMjIlNUQlNUIlMjJhcnJheSUyMiU1RCUyQyUyMHNhbXBsaW5nX3JhdGUlM0RzYW1wbGluZ19yYXRlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, Wav2Vec2ConformerModel
<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;facebook/wav2vec2-conformer-rope-large-960h-ft&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2ConformerModel.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-conformer-rope-large-960h-ft&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">292</span>, <span class="hljs-number">1024</span>]`}}),{c(){d=r("p"),b=s("Example:"),g=m(),y(h.$$.fragment)},l(i){d=n(i,"P",{});var f=a(d);b=l(f,"Example:"),f.forEach(t),g=p(i),w(h.$$.fragment,i)},m(i,f){v(i,d,f),e(d,b),v(i,g,f),M(h,i,f),_=!0},p:pt,i(i){_||(C(h.$$.fragment,i),_=!0)},o(i){T(h.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(g),W(h,i)}}}function dd(V){let d,b,g,h,_;return{c(){d=r("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r("code"),h=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){d=n(i,"P",{});var f=a(d);b=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(f,"CODE",{});var k=a(g);h=l(k,"Module"),k.forEach(t),_=l(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(i,f){v(i,d,f),e(d,b),e(d,g),e(g,h),e(d,_)},d(i){i&&t(d)}}}function md(V){let d,b,g,h,_;return h=new ft({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBXYXYyVmVjMkNvbmZvcm1lckZvckNUQyUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJoZi1pbnRlcm5hbC10ZXN0aW5nJTJGbGlicmlzcGVlY2hfYXNyX2RlbW8lMjIlMkMlMjAlMjJjbGVhbiUyMiUyQyUyMHNwbGl0JTNEJTIydmFsaWRhdGlvbiUyMiklMEFkYXRhc2V0JTIwJTNEJTIwZGF0YXNldC5zb3J0KCUyMmlkJTIyKSUwQXNhbXBsaW5nX3JhdGUlMjAlM0QlMjBkYXRhc2V0LmZlYXR1cmVzJTVCJTIyYXVkaW8lMjIlNUQuc2FtcGxpbmdfcmF0ZSUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGd2F2MnZlYzItY29uZm9ybWVyLXJvcGUtbGFyZ2UtOTYwaC1mdCUyMiklMEFtb2RlbCUyMCUzRCUyMFdhdjJWZWMyQ29uZm9ybWVyRm9yQ1RDLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRndhdjJ2ZWMyLWNvbmZvcm1lci1yb3BlLWxhcmdlLTk2MGgtZnQlMjIpJTBBJTBBJTIzJTIwYXVkaW8lMjBmaWxlJTIwaXMlMjBkZWNvZGVkJTIwb24lMjB0aGUlMjBmbHklMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoZGF0YXNldCU1QjAlNUQlNUIlMjJhdWRpbyUyMiU1RCU1QiUyMmFycmF5JTIyJTVEJTJDJTIwc2FtcGxpbmdfcmF0ZSUzRHNhbXBsaW5nX3JhdGUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBcHJlZGljdGVkX2lkcyUyMCUzRCUyMHRvcmNoLmFyZ21heChsb2dpdHMlMkMlMjBkaW0lM0QtMSklMEElMEElMjMlMjB0cmFuc2NyaWJlJTIwc3BlZWNoJTBBdHJhbnNjcmlwdGlvbiUyMCUzRCUyMHByb2Nlc3Nvci5iYXRjaF9kZWNvZGUocHJlZGljdGVkX2lkcyklMEF0cmFuc2NyaXB0aW9uJTVCMCU1RCUwQSUwQWlucHV0cyU1QiUyMmxhYmVscyUyMiU1RCUyMCUzRCUyMHByb2Nlc3Nvcih0ZXh0JTNEZGF0YXNldCU1QjAlNUQlNUIlMjJ0ZXh0JTIyJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikuaW5wdXRfaWRzJTBBJTBBJTIzJTIwY29tcHV0ZSUyMGxvc3MlMEFsb3NzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvc3MlMEFyb3VuZChsb3NzLml0ZW0oKSUyQyUyMDIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, Wav2Vec2ConformerForCTC
<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;facebook/wav2vec2-conformer-rope-large-960h-ft&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2ConformerForCTC.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-conformer-rope-large-960h-ft&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># transcribe speech</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>transcription = processor.batch_decode(predicted_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>transcription[<span class="hljs-number">0</span>]
<span class="hljs-string">&#x27;MISTER QUILTER IS THE APOSTLE OF THE MIDDLE CLASSES AND WE ARE GLAD TO WELCOME HIS GOSPEL&#x27;</span>

<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">64.21</span>`}}),{c(){d=r("p"),b=s("Example:"),g=m(),y(h.$$.fragment)},l(i){d=n(i,"P",{});var f=a(d);b=l(f,"Example:"),f.forEach(t),g=p(i),w(h.$$.fragment,i)},m(i,f){v(i,d,f),e(d,b),v(i,g,f),M(h,i,f),_=!0},p:pt,i(i){_||(C(h.$$.fragment,i),_=!0)},o(i){T(h.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(g),W(h,i)}}}function pd(V){let d,b,g,h,_;return{c(){d=r("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r("code"),h=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){d=n(i,"P",{});var f=a(d);b=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(f,"CODE",{});var k=a(g);h=l(k,"Module"),k.forEach(t),_=l(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(i,f){v(i,d,f),e(d,b),e(d,g),e(g,h),e(d,_)},d(i){i&&t(d)}}}function fd(V){let d,b,g,h,_;return h=new ft({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yJTJDJTIwV2F2MlZlYzJDb25mb3JtZXJGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBaW1wb3J0JTIwdG9yY2glMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmhmLWludGVybmFsLXRlc3RpbmclMkZsaWJyaXNwZWVjaF9hc3JfZGVtbyUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWRhdGFzZXQlMjAlM0QlMjBkYXRhc2V0LnNvcnQoJTIyaWQlMjIpJTBBc2FtcGxpbmdfcmF0ZSUyMCUzRCUyMGRhdGFzZXQuZmVhdHVyZXMlNUIlMjJhdWRpbyUyMiU1RC5zYW1wbGluZ19yYXRlJTBBJTBBZmVhdHVyZV9leHRyYWN0b3IlMjAlM0QlMjBBdXRvRmVhdHVyZUV4dHJhY3Rvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3YXYydmVjMi1jb25mb3JtZXItcm9wZS1sYXJnZS05NjBoLWZ0JTIyKSUwQW1vZGVsJTIwJTNEJTIwV2F2MlZlYzJDb25mb3JtZXJGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRndhdjJ2ZWMyLWNvbmZvcm1lci1yb3BlLWxhcmdlLTk2MGgtZnQlMjIpJTBBJTBBJTIzJTIwYXVkaW8lMjBmaWxlJTIwaXMlMjBkZWNvZGVkJTIwb24lMjB0aGUlMjBmbHklMEFpbnB1dHMlMjAlM0QlMjBmZWF0dXJlX2V4dHJhY3RvcihkYXRhc2V0JTVCMCU1RCU1QiUyMmF1ZGlvJTIyJTVEJTVCJTIyYXJyYXklMjIlNUQlMkMlMjBzYW1wbGluZ19yYXRlJTNEc2FtcGxpbmdfcmF0ZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWRzJTIwJTNEJTIwdG9yY2guYXJnbWF4KGxvZ2l0cyUyQyUyMGRpbSUzRC0xKS5pdGVtKCklMEFwcmVkaWN0ZWRfbGFiZWwlMjAlM0QlMjBtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfY2xhc3NfaWRzJTVEJTBBJTBBJTIzJTIwY29tcHV0ZSUyMGxvc3MlMjAtJTIwdGFyZ2V0X2xhYmVsJTIwaXMlMjBlLmcuJTIwJTIyZG93biUyMiUwQXRhcmdldF9sYWJlbCUyMCUzRCUyMG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QjAlNUQlMEFpbnB1dHMlNUIlMjJsYWJlbHMlMjIlNUQlMjAlM0QlMjB0b3JjaC50ZW5zb3IoJTVCbW9kZWwuY29uZmlnLmxhYmVsMmlkJTVCdGFyZ2V0X2xhYmVsJTVEJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, Wav2Vec2ConformerForSequenceClassification
<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/wav2vec2-conformer-rope-large-960h-ft&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2ConformerForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-conformer-rope-large-960h-ft&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`}}),{c(){d=r("p"),b=s("Example:"),g=m(),y(h.$$.fragment)},l(i){d=n(i,"P",{});var f=a(d);b=l(f,"Example:"),f.forEach(t),g=p(i),w(h.$$.fragment,i)},m(i,f){v(i,d,f),e(d,b),v(i,g,f),M(h,i,f),_=!0},p:pt,i(i){_||(C(h.$$.fragment,i),_=!0)},o(i){T(h.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(g),W(h,i)}}}function hd(V){let d,b,g,h,_;return{c(){d=r("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r("code"),h=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){d=n(i,"P",{});var f=a(d);b=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(f,"CODE",{});var k=a(g);h=l(k,"Module"),k.forEach(t),_=l(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(i,f){v(i,d,f),e(d,b),e(d,g),e(g,h),e(d,_)},d(i){i&&t(d)}}}function ud(V){let d,b,g,h,_;return h=new ft({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yJTJDJTIwV2F2MlZlYzJDb25mb3JtZXJGb3JBdWRpb0ZyYW1lQ2xhc3NpZmljYXRpb24lMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaGYtaW50ZXJuYWwtdGVzdGluZyUyRmxpYnJpc3BlZWNoX2Fzcl9kZW1vJTIyJTJDJTIwJTIyY2xlYW4lMjIlMkMlMjBzcGxpdCUzRCUyMnZhbGlkYXRpb24lMjIpJTBBZGF0YXNldCUyMCUzRCUyMGRhdGFzZXQuc29ydCglMjJpZCUyMiklMEFzYW1wbGluZ19yYXRlJTIwJTNEJTIwZGF0YXNldC5mZWF0dXJlcyU1QiUyMmF1ZGlvJTIyJTVELnNhbXBsaW5nX3JhdGUlMEElMEFmZWF0dXJlX2V4dHJhY3RvciUyMCUzRCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRndhdjJ2ZWMyLWNvbmZvcm1lci1yb3BlLWxhcmdlLTk2MGgtZnQlMjIpJTBBbW9kZWwlMjAlM0QlMjBXYXYyVmVjMkNvbmZvcm1lckZvckF1ZGlvRnJhbWVDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3YXYydmVjMi1jb25mb3JtZXItcm9wZS1sYXJnZS05NjBoLWZ0JTIyKSUwQSUwQSUyMyUyMGF1ZGlvJTIwZmlsZSUyMGlzJTIwZGVjb2RlZCUyMG9uJTIwdGhlJTIwZmx5JTBBaW5wdXRzJTIwJTNEJTIwZmVhdHVyZV9leHRyYWN0b3IoZGF0YXNldCU1QjAlNUQlNUIlMjJhdWRpbyUyMiU1RCU1QiUyMmFycmF5JTIyJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUyQyUyMHNhbXBsaW5nX3JhdGUlM0RzYW1wbGluZ19yYXRlKSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJvYmFiaWxpdGllcyUyMCUzRCUyMHRvcmNoLnNpZ21vaWQobG9naXRzJTVCMCU1RCklMEElMjMlMjBsYWJlbHMlMjBpcyUyMGElMjBvbmUtaG90JTIwYXJyYXklMjBvZiUyMHNoYXBlJTIwKG51bV9mcmFtZXMlMkMlMjBudW1fc3BlYWtlcnMpJTBBbGFiZWxzJTIwJTNEJTIwKHByb2JhYmlsaXRpZXMlMjAlM0UlMjAwLjUpLmxvbmcoKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, Wav2Vec2ConformerForAudioFrameClassification
<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/wav2vec2-conformer-rope-large-960h-ft&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2ConformerForAudioFrameClassification.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-conformer-rope-large-960h-ft&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()`}}),{c(){d=r("p"),b=s("Example:"),g=m(),y(h.$$.fragment)},l(i){d=n(i,"P",{});var f=a(d);b=l(f,"Example:"),f.forEach(t),g=p(i),w(h.$$.fragment,i)},m(i,f){v(i,d,f),e(d,b),v(i,g,f),M(h,i,f),_=!0},p:pt,i(i){_||(C(h.$$.fragment,i),_=!0)},o(i){T(h.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(g),W(h,i)}}}function gd(V){let d,b,g,h,_;return{c(){d=r("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r("code"),h=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){d=n(i,"P",{});var f=a(d);b=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(f,"CODE",{});var k=a(g);h=l(k,"Module"),k.forEach(t),_=l(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(i,f){v(i,d,f),e(d,b),e(d,g),e(g,h),e(d,_)},d(i){i&&t(d)}}}function vd(V){let d,b,g,h,_;return h=new ft({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yJTJDJTIwV2F2MlZlYzJDb25mb3JtZXJGb3JYVmVjdG9yJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBaW1wb3J0JTIwdG9yY2glMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmhmLWludGVybmFsLXRlc3RpbmclMkZsaWJyaXNwZWVjaF9hc3JfZGVtbyUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWRhdGFzZXQlMjAlM0QlMjBkYXRhc2V0LnNvcnQoJTIyaWQlMjIpJTBBc2FtcGxpbmdfcmF0ZSUyMCUzRCUyMGRhdGFzZXQuZmVhdHVyZXMlNUIlMjJhdWRpbyUyMiU1RC5zYW1wbGluZ19yYXRlJTBBJTBBZmVhdHVyZV9leHRyYWN0b3IlMjAlM0QlMjBBdXRvRmVhdHVyZUV4dHJhY3Rvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3YXYydmVjMi1jb25mb3JtZXItcm9wZS1sYXJnZS05NjBoLWZ0JTIyKSUwQW1vZGVsJTIwJTNEJTIwV2F2MlZlYzJDb25mb3JtZXJGb3JYVmVjdG9yLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRndhdjJ2ZWMyLWNvbmZvcm1lci1yb3BlLWxhcmdlLTk2MGgtZnQlMjIpJTBBJTBBJTIzJTIwYXVkaW8lMjBmaWxlJTIwaXMlMjBkZWNvZGVkJTIwb24lMjB0aGUlMjBmbHklMEFpbnB1dHMlMjAlM0QlMjBmZWF0dXJlX2V4dHJhY3RvciglMEElMjAlMjAlMjAlMjAlNUJkJTVCJTIyYXJyYXklMjIlNUQlMjBmb3IlMjBkJTIwaW4lMjBkYXRhc2V0JTVCJTNBMiU1RCU1QiUyMmF1ZGlvJTIyJTVEJTVEJTJDJTIwc2FtcGxpbmdfcmF0ZSUzRHNhbXBsaW5nX3JhdGUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTIwcGFkZGluZyUzRFRydWUlMEEpJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGVtYmVkZGluZ3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykuZW1iZWRkaW5ncyUwQSUwQWVtYmVkZGluZ3MlMjAlM0QlMjB0b3JjaC5ubi5mdW5jdGlvbmFsLm5vcm1hbGl6ZShlbWJlZGRpbmdzJTJDJTIwZGltJTNELTEpLmNwdSgpJTBBJTBBJTIzJTIwdGhlJTIwcmVzdWx0aW5nJTIwZW1iZWRkaW5ncyUyMGNhbiUyMGJlJTIwdXNlZCUyMGZvciUyMGNvc2luZSUyMHNpbWlsYXJpdHktYmFzZWQlMjByZXRyaWV2YWwlMEFjb3NpbmVfc2ltJTIwJTNEJTIwdG9yY2gubm4uQ29zaW5lU2ltaWxhcml0eShkaW0lM0QtMSklMEFzaW1pbGFyaXR5JTIwJTNEJTIwY29zaW5lX3NpbShlbWJlZGRpbmdzJTVCMCU1RCUyQyUyMGVtYmVkZGluZ3MlNUIxJTVEKSUwQXRocmVzaG9sZCUyMCUzRCUyMDAuNyUyMCUyMCUyMyUyMHRoZSUyMG9wdGltYWwlMjB0aHJlc2hvbGQlMjBpcyUyMGRhdGFzZXQtZGVwZW5kZW50JTBBaWYlMjBzaW1pbGFyaXR5JTIwJTNDJTIwdGhyZXNob2xkJTNBJTBBJTIwJTIwJTIwJTIwcHJpbnQoJTIyU3BlYWtlcnMlMjBhcmUlMjBub3QlMjB0aGUlMjBzYW1lISUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, Wav2Vec2ConformerForXVector
<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/wav2vec2-conformer-rope-large-960h-ft&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2ConformerForXVector.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-conformer-rope-large-960h-ft&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>)`}}),{c(){d=r("p"),b=s("Example:"),g=m(),y(h.$$.fragment)},l(i){d=n(i,"P",{});var f=a(d);b=l(f,"Example:"),f.forEach(t),g=p(i),w(h.$$.fragment,i)},m(i,f){v(i,d,f),e(d,b),v(i,g,f),M(h,i,f),_=!0},p:pt,i(i){_||(C(h.$$.fragment,i),_=!0)},o(i){T(h.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(g),W(h,i)}}}function _d(V){let d,b,g,h,_;return{c(){d=r("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r("code"),h=s("Module"),_=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){d=n(i,"P",{});var f=a(d);b=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(f,"CODE",{});var k=a(g);h=l(k,"Module"),k.forEach(t),_=l(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(i,f){v(i,d,f),e(d,b),e(d,g),e(g,h),e(d,_)},d(i){i&&t(d)}}}function bd(V){let d,b,g,h,_;return h=new ft({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b0ZlYXR1cmVFeHRyYWN0b3IlMkMlMjBXYXYyVmVjMkNvbmZvcm1lckZvclByZVRyYWluaW5nJTBBZnJvbSUyMHRyYW5zZm9ybWVycy5tb2RlbHMud2F2MnZlYzJfY29uZm9ybWVyLm1vZGVsaW5nX3dhdjJ2ZWMyX2NvbmZvcm1lciUyMGltcG9ydCUyMCglMEElMjAlMjAlMjAlMjBfY29tcHV0ZV9tYXNrX2luZGljZXMlMkMlMEElMjAlMjAlMjAlMjBfc2FtcGxlX25lZ2F0aXZlX2luZGljZXMlMkMlMEEpJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZmVhdHVyZV9leHRyYWN0b3IlMjAlM0QlMjBBdXRvRmVhdHVyZUV4dHJhY3Rvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3YXYydmVjMi1jb25mb3JtZXItcmVsLXBvcy1sYXJnZSUyMiklMEFtb2RlbCUyMCUzRCUyMFdhdjJWZWMyQ29uZm9ybWVyRm9yUHJlVHJhaW5pbmcuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGd2F2MnZlYzItY29uZm9ybWVyLXJlbC1wb3MtbGFyZ2UlMjIpJTBBJTBBZHMlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaGYtaW50ZXJuYWwtdGVzdGluZyUyRmxpYnJpc3BlZWNoX2Fzcl9kdW1teSUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWlucHV0X3ZhbHVlcyUyMCUzRCUyMGZlYXR1cmVfZXh0cmFjdG9yKGRzJTVCMCU1RCU1QiUyMmF1ZGlvJTIyJTVEJTVCJTIyYXJyYXklMjIlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5pbnB1dF92YWx1ZXMlMjAlMjAlMjMlMjBCYXRjaCUyMHNpemUlMjAxJTBBJTBBJTIzJTIwY29tcHV0ZSUyMG1hc2tlZCUyMGluZGljZXMlMEFiYXRjaF9zaXplJTJDJTIwcmF3X3NlcXVlbmNlX2xlbmd0aCUyMCUzRCUyMGlucHV0X3ZhbHVlcy5zaGFwZSUwQXNlcXVlbmNlX2xlbmd0aCUyMCUzRCUyMG1vZGVsLl9nZXRfZmVhdF9leHRyYWN0X291dHB1dF9sZW5ndGhzKHJhd19zZXF1ZW5jZV9sZW5ndGgpLml0ZW0oKSUwQW1hc2tfdGltZV9pbmRpY2VzJTIwJTNEJTIwX2NvbXB1dGVfbWFza19pbmRpY2VzKCUwQSUyMCUyMCUyMCUyMHNoYXBlJTNEKGJhdGNoX3NpemUlMkMlMjBzZXF1ZW5jZV9sZW5ndGgpJTJDJTIwbWFza19wcm9iJTNEMC4yJTJDJTIwbWFza19sZW5ndGglM0QyJTBBKSUwQXNhbXBsZWRfbmVnYXRpdmVfaW5kaWNlcyUyMCUzRCUyMF9zYW1wbGVfbmVnYXRpdmVfaW5kaWNlcyglMEElMjAlMjAlMjAlMjBmZWF0dXJlc19zaGFwZSUzRChiYXRjaF9zaXplJTJDJTIwc2VxdWVuY2VfbGVuZ3RoKSUyQyUwQSUyMCUyMCUyMCUyMG51bV9uZWdhdGl2ZXMlM0Rtb2RlbC5jb25maWcubnVtX25lZ2F0aXZlcyUyQyUwQSUyMCUyMCUyMCUyMG1hc2tfdGltZV9pbmRpY2VzJTNEbWFza190aW1lX2luZGljZXMlMkMlMEEpJTBBbWFza190aW1lX2luZGljZXMlMjAlM0QlMjB0b3JjaC50ZW5zb3IoZGF0YSUzRG1hc2tfdGltZV9pbmRpY2VzJTJDJTIwZGV2aWNlJTNEaW5wdXRfdmFsdWVzLmRldmljZSUyQyUyMGR0eXBlJTNEdG9yY2gubG9uZyklMEFzYW1wbGVkX25lZ2F0aXZlX2luZGljZXMlMjAlM0QlMjB0b3JjaC50ZW5zb3IoJTBBJTIwJTIwJTIwJTIwZGF0YSUzRHNhbXBsZWRfbmVnYXRpdmVfaW5kaWNlcyUyQyUyMGRldmljZSUzRGlucHV0X3ZhbHVlcy5kZXZpY2UlMkMlMjBkdHlwZSUzRHRvcmNoLmxvbmclMEEpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbChpbnB1dF92YWx1ZXMlMkMlMjBtYXNrX3RpbWVfaW5kaWNlcyUzRG1hc2tfdGltZV9pbmRpY2VzKSUwQSUwQSUyMyUyMGNvbXB1dGUlMjBjb3NpbmUlMjBzaW1pbGFyaXR5JTIwYmV0d2VlbiUyMHByZWRpY3RlZCUyMCglM0Rwcm9qZWN0ZWRfc3RhdGVzKSUyMGFuZCUyMHRhcmdldCUyMCglM0Rwcm9qZWN0ZWRfcXVhbnRpemVkX3N0YXRlcyklMEFjb3NpbmVfc2ltJTIwJTNEJTIwdG9yY2guY29zaW5lX3NpbWlsYXJpdHkob3V0cHV0cy5wcm9qZWN0ZWRfc3RhdGVzJTJDJTIwb3V0cHV0cy5wcm9qZWN0ZWRfcXVhbnRpemVkX3N0YXRlcyUyQyUyMGRpbSUzRC0xKSUwQSUwQSUyMyUyMHNob3clMjB0aGF0JTIwY29zaW5lJTIwc2ltaWxhcml0eSUyMGlzJTIwbXVjaCUyMGhpZ2hlciUyMHRoYW4lMjByYW5kb20lMEFjb3NpbmVfc2ltJTVCbWFza190aW1lX2luZGljZXMudG8odG9yY2guYm9vbCklNUQubWVhbigpJTIwJTNFJTIwMC41JTBBJTBBJTIzJTIwZm9yJTIwY29udHJhc3RpdmUlMjBsb3NzJTIwdHJhaW5pbmclMjBtb2RlbCUyMHNob3VsZCUyMGJlJTIwcHV0JTIwaW50byUyMHRyYWluJTIwbW9kZSUwQW1vZGVsJTIwJTNEJTIwbW9kZWwudHJhaW4oKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCglMEElMjAlMjAlMjAlMjBpbnB1dF92YWx1ZXMlMkMlMjBtYXNrX3RpbWVfaW5kaWNlcyUzRG1hc2tfdGltZV9pbmRpY2VzJTJDJTIwc2FtcGxlZF9uZWdhdGl2ZV9pbmRpY2VzJTNEc2FtcGxlZF9uZWdhdGl2ZV9pbmRpY2VzJTBBKS5sb3Nz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, Wav2Vec2ConformerForPreTraining
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.models.wav2vec2_conformer.modeling_wav2vec2_conformer <span class="hljs-keyword">import</span> (
<span class="hljs-meta">... </span>    _compute_mask_indices,
<span class="hljs-meta">... </span>    _sample_negative_indices,
<span class="hljs-meta">... </span>)
<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>feature_extractor = AutoFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-conformer-rel-pos-large&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2ConformerForPreTraining.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-conformer-rel-pos-large&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>ds = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_dummy&quot;</span>, <span class="hljs-string">&quot;clean&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>input_values = feature_extractor(ds[<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>).input_values  <span class="hljs-comment"># Batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute masked indices</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>batch_size, raw_sequence_length = input_values.shape
<span class="hljs-meta">&gt;&gt;&gt; </span>sequence_length = model._get_feat_extract_output_lengths(raw_sequence_length).item()
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_time_indices = _compute_mask_indices(
<span class="hljs-meta">... </span>    shape=(batch_size, sequence_length), mask_prob=<span class="hljs-number">0.2</span>, mask_length=<span class="hljs-number">2</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>sampled_negative_indices = _sample_negative_indices(
<span class="hljs-meta">... </span>    features_shape=(batch_size, sequence_length),
<span class="hljs-meta">... </span>    num_negatives=model.config.num_negatives,
<span class="hljs-meta">... </span>    mask_time_indices=mask_time_indices,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_time_indices = torch.tensor(data=mask_time_indices, device=input_values.device, dtype=torch.long)
<span class="hljs-meta">&gt;&gt;&gt; </span>sampled_negative_indices = torch.tensor(
<span class="hljs-meta">... </span>    data=sampled_negative_indices, device=input_values.device, dtype=torch.long
<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>    outputs = model(input_values, mask_time_indices=mask_time_indices)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute cosine similarity between predicted (=projected_states) and target (=projected_quantized_states)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>cosine_sim = torch.cosine_similarity(outputs.projected_states, outputs.projected_quantized_states, dim=-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># show that cosine similarity is much higher than random</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>cosine_sim[mask_time_indices.to(torch.<span class="hljs-built_in">bool</span>)].mean() &gt; <span class="hljs-number">0.5</span>
tensor(<span class="hljs-literal">True</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># for contrastive loss training model should be put into train mode</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = model.train()
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(
<span class="hljs-meta">... </span>    input_values, mask_time_indices=mask_time_indices, sampled_negative_indices=sampled_negative_indices
<span class="hljs-meta">... </span>).loss`}}),{c(){d=r("p"),b=s("Example:"),g=m(),y(h.$$.fragment)},l(i){d=n(i,"P",{});var f=a(d);b=l(f,"Example:"),f.forEach(t),g=p(i),w(h.$$.fragment,i)},m(i,f){v(i,d,f),e(d,b),v(i,g,f),M(h,i,f),_=!0},p:pt,i(i){_||(C(h.$$.fragment,i),_=!0)},o(i){T(h.$$.fragment,i),_=!1},d(i){i&&t(d),i&&t(g),W(h,i)}}}function yd(V){let d,b,g,h,_,i,f,k,Rn,Br,O,be,Yt,eo,Nn,Pt,qn,Ir,ye,An,oo,Sn,Yn,Rr,ht,Pn,Nr,we,Qn,to,Hn,Dn,qr,ut,Ln,Ar,E,Y,On,Qt,Kn,ea,Ht,oa,ta,ro,ra,na,aa,Dt,sa,la,Lt,ia,ca,no,da,Ot,ma,pa,Sr,Q,fa,ao,ha,ua,so,ga,va,Yr,K,Me,Kt,lo,_a,er,ba,Pr,Ce,or,gt,ya,wa,tr,vt,Ma,Qr,ee,Te,rr,io,Ca,nr,Ta,Hr,X,co,Wa,oe,Va,_t,ka,ja,mo,Ja,Fa,Za,te,$a,bt,Ua,xa,yt,Xa,Ea,za,We,Dr,re,Ve,ar,po,Ga,sr,Ba,Lr,ne,fo,Ia,ho,Ra,wt,Na,qa,Or,ae,ke,lr,uo,Aa,ir,Sa,Kr,Z,go,Ya,vo,Pa,_o,Qa,Ha,Da,bo,La,Mt,Oa,Ka,es,yo,os,wo,ts,rs,ns,z,Mo,as,se,ss,Ct,ls,is,cr,cs,ds,ms,je,ps,Je,en,le,Fe,dr,Co,fs,mr,hs,on,$,To,us,ie,gs,pr,vs,_s,Wo,bs,ys,ws,Vo,Ms,Tt,Cs,Ts,Ws,ko,Vs,jo,ks,js,Js,G,Jo,Fs,ce,Zs,Wt,$s,Us,fr,xs,Xs,Es,Ze,zs,$e,tn,de,Ue,hr,Fo,Gs,ur,Bs,rn,j,Zo,Is,gr,Rs,Ns,$o,qs,Uo,As,Ss,Ys,xo,Ps,Vt,Qs,Hs,Ds,Xo,Ls,Eo,Os,Ks,el,B,zo,ol,me,tl,kt,rl,nl,vr,al,sl,ll,xe,il,Xe,nn,pe,Ee,_r,Go,cl,br,dl,an,J,Bo,ml,yr,pl,fl,Io,hl,Ro,ul,gl,vl,No,_l,jt,bl,yl,wl,qo,Ml,Ao,Cl,Tl,Wl,I,So,Vl,fe,kl,Jt,jl,Jl,wr,Fl,Zl,$l,ze,Ul,Ge,sn,he,Be,Mr,Yo,xl,Cr,Xl,ln,F,Po,El,Tr,zl,Gl,Qo,Bl,Ho,Il,Rl,Nl,Do,ql,Ft,Al,Sl,Yl,Lo,Pl,Oo,Ql,Hl,Dl,R,Ko,Ll,ue,Ol,Zt,Kl,ei,Wr,oi,ti,ri,Ie,ni,Re,cn,ge,Ne,Vr,et,ai,kr,si,dn,U,ot,li,ve,ii,jr,ci,di,tt,mi,pi,fi,rt,hi,$t,ui,gi,vi,nt,_i,at,bi,yi,wi,N,st,Mi,_e,Ci,Ut,Ti,Wi,Jr,Vi,ki,ji,qe,Ji,Ae,mn;return i=new P({}),eo=new P({}),lo=new P({}),io=new P({}),co=new x({props:{name:"class transformers.Wav2Vec2ConformerConfig",anchor:"transformers.Wav2Vec2ConformerConfig",parameters:[{name:"vocab_size",val:" = None"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout",val:" = 0.1"},{name:"activation_dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.1"},{name:"feat_proj_dropout",val:" = 0.0"},{name:"feat_quantizer_dropout",val:" = 0.0"},{name:"final_dropout",val:" = 0.1"},{name:"layerdrop",val:" = 0.1"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"feat_extract_norm",val:" = 'group'"},{name:"feat_extract_activation",val:" = 'gelu'"},{name:"conv_dim",val:" = (512, 512, 512, 512, 512, 512, 512)"},{name:"conv_stride",val:" = (5, 2, 2, 2, 2, 2, 2)"},{name:"conv_kernel",val:" = (10, 3, 3, 3, 3, 2, 2)"},{name:"conv_bias",val:" = False"},{name:"num_conv_pos_embeddings",val:" = 128"},{name:"num_conv_pos_embedding_groups",val:" = 16"},{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:"num_codevectors_per_group",val:" = 320"},{name:"num_codevector_groups",val:" = 2"},{name:"contrastive_logits_temperature",val:" = 0.1"},{name:"num_negatives",val:" = 100"},{name:"codevector_dim",val:" = 256"},{name:"proj_codevector_dim",val:" = 256"},{name:"diversity_loss_weight",val:" = 0.1"},{name:"ctc_loss_reduction",val:" = 'sum'"},{name:"ctc_zero_infinity",val:" = False"},{name:"use_weighted_layer_sum",val:" = False"},{name:"classifier_proj_size",val:" = 256"},{name:"tdnn_dim",val:" = (512, 512, 512, 512, 1500)"},{name:"tdnn_kernel",val:" = (5, 3, 3, 1, 1)"},{name:"tdnn_dilation",val:" = (1, 2, 3, 1, 1)"},{name:"xvector_output_dim",val:" = 512"},{name:"pad_token_id",val:" = 0"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"add_adapter",val:" = False"},{name:"adapter_kernel_size",val:" = 3"},{name:"adapter_stride",val:" = 2"},{name:"num_adapter_layers",val:" = 3"},{name:"output_hidden_size",val:" = None"},{name:"position_embeddings_type",val:" = 'relative'"},{name:"rotary_embedding_base",val:" = 10000"},{name:"max_source_positions",val:" = 5000"},{name:"conv_depthwise_kernel_size",val:" = 31"},{name:"conformer_conv_dropout",val:" = 0.1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2ConformerConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Vocabulary size of the Wav2Vec2Conformer model. Defines the number of different tokens that can be
represented by the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerModel">Wav2Vec2ConformerModel</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/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerModel">Wav2Vec2ConformerModel</a>.`,name:"vocab_size"},{anchor:"transformers.Wav2Vec2ConformerConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.Wav2Vec2ConformerConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.Wav2Vec2ConformerConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.Wav2Vec2ConformerConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.Wav2Vec2ConformerConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.Wav2Vec2ConformerConfig.hidden_dropout",description:`<strong>hidden_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout"},{anchor:"transformers.Wav2Vec2ConformerConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.Wav2Vec2ConformerConfig.final_dropout",description:`<strong>final_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for the final projection layer of <a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerForCTC">Wav2Vec2ConformerForCTC</a>.`,name:"final_dropout"},{anchor:"transformers.Wav2Vec2ConformerConfig.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.Wav2Vec2ConformerConfig.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.Wav2Vec2ConformerConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.Wav2Vec2ConformerConfig.feat_extract_norm",description:`<strong>feat_extract_norm</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;group&quot;</code>) &#x2014;
The norm to be applied to 1D convolutional layers in feature encoder. One of <code>&quot;group&quot;</code> for group
normalization of only the first 1D convolutional layer or <code>&quot;layer&quot;</code> for layer normalization of all 1D
convolutional layers.`,name:"feat_extract_norm"},{anchor:"transformers.Wav2Vec2ConformerConfig.feat_proj_dropout",description:`<strong>feat_proj_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for output of the feature encoder.`,name:"feat_proj_dropout"},{anchor:"transformers.Wav2Vec2ConformerConfig.feat_extract_activation",description:"<strong>feat_extract_activation</strong> (<code>str, </code>optional<code>, defaults to </code>&#x201C;gelu&#x201D;<code>) -- The non-linear activation function (function or string) in the 1D convolutional layers of the feature extractor. If string, </code>&#x201C;gelu&#x201D;<code>, </code>&#x201C;relu&#x201D;<code>, </code>&#x201C;selu&#x201D;<code>and</code>&#x201C;gelu_new&#x201D;` are supported.",name:"feat_extract_activation"},{anchor:"transformers.Wav2Vec2ConformerConfig.feat_quantizer_dropout",description:`<strong>feat_quantizer_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probabilitiy for quantized feature encoder states.`,name:"feat_quantizer_dropout"},{anchor:"transformers.Wav2Vec2ConformerConfig.conv_dim",description:`<strong>conv_dim</strong> (<code>Tuple[int]</code> or <code>List[int]</code>, <em>optional</em>, defaults to <code>(512, 512, 512, 512, 512, 512, 512)</code>) &#x2014;
A tuple of integers defining the number of input and output channels of each 1D convolutional layer in the
feature encoder. The length of <em>conv_dim</em> defines the number of 1D convolutional layers.`,name:"conv_dim"},{anchor:"transformers.Wav2Vec2ConformerConfig.conv_stride",description:`<strong>conv_stride</strong> (<code>Tuple[int]</code> or <code>List[int]</code>, <em>optional</em>, defaults to <code>(5, 2, 2, 2, 2, 2, 2)</code>) &#x2014;
A tuple of integers defining the stride of each 1D convolutional layer in the feature encoder. The length
of <em>conv_stride</em> defines the number of convolutional layers and has to match the length of <em>conv_dim</em>.`,name:"conv_stride"},{anchor:"transformers.Wav2Vec2ConformerConfig.conv_kernel",description:`<strong>conv_kernel</strong> (<code>Tuple[int]</code> or <code>List[int]</code>, <em>optional</em>, defaults to <code>(10, 3, 3, 3, 3, 3, 3)</code>) &#x2014;
A tuple of integers defining the kernel size of each 1D convolutional layer in the feature encoder. The
length of <em>conv_kernel</em> defines the number of convolutional layers and has to match the length of
<em>conv_dim</em>.`,name:"conv_kernel"},{anchor:"transformers.Wav2Vec2ConformerConfig.conv_bias",description:`<strong>conv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the 1D convolutional layers have a bias.`,name:"conv_bias"},{anchor:"transformers.Wav2Vec2ConformerConfig.num_conv_pos_embeddings",description:`<strong>num_conv_pos_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
Number of convolutional positional embeddings. Defines the kernel size of 1D convolutional positional
embeddings layer.`,name:"num_conv_pos_embeddings"},{anchor:"transformers.Wav2Vec2ConformerConfig.num_conv_pos_embedding_groups",description:`<strong>num_conv_pos_embedding_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of groups of 1D convolutional positional embeddings layer.`,name:"num_conv_pos_embedding_groups"},{anchor:"transformers.Wav2Vec2ConformerConfig.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.Wav2Vec2ConformerConfig.mask_time_prob",description:`<strong>mask_time_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.05) &#x2014;
Percentage (between 0 and 1) of all feature vectors along the time axis which will be masked. The masking
procecure generates &#x201D;mask_time_prob<em>len(time_axis)/mask_time_length&#x201D; independent masks over the axis. If
reasoning from the propability of each feature vector to be chosen as the start of the vector span to be
masked, </em>mask_time_prob<em> should be \`prob_vector_start</em>mask_time_length<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.Wav2Vec2ConformerConfig.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.Wav2Vec2ConformerConfig.mask_time_min_masks",description:`<strong>mask_time_min_masks</strong> (<code>int</code>, <em>optional</em>, defaults to 2), &#x2014;
The minimum number of masks of length <code>mask_feature_length</code> generated along the time axis, each time step,
irrespectively of <code>mask_feature_prob</code>. Only relevant if &#x201D;mask_time_prob*len(time_axis)/mask_time_length &lt;
mask_time_min_masks&#x201D;`,name:"mask_time_min_masks"},{anchor:"transformers.Wav2Vec2ConformerConfig.mask_feature_prob",description:`<strong>mask_feature_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Percentage (between 0 and 1) of all feature vectors along the feature axis which will be masked. The
masking procecure generates &#x201D;mask_feature_prob<em>len(feature_axis)/mask_time_length&#x201D; independent masks over
the axis. If reasoning from the propability of each feature vector to be chosen as the start of the vector
span to be masked, </em>mask_feature_prob<em> should be \`prob_vector_start</em>mask_feature_length<code>. Note that overlap may decrease the actual percentage of masked vectors. This is only relevant if </code>apply_spec_augment is
True\`.`,name:"mask_feature_prob"},{anchor:"transformers.Wav2Vec2ConformerConfig.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.Wav2Vec2ConformerConfig.mask_feature_min_masks",description:`<strong>mask_feature_min_masks</strong> (<code>int</code>, <em>optional</em>, defaults to 0), &#x2014;
The minimum number of masks of length <code>mask_feature_length</code> generated along the feature axis, each time
step, irrespectively of <code>mask_feature_prob</code>. Only relevant if
&#x201D;mask_feature_prob*len(feature_axis)/mask_feature_length &lt; mask_feature_min_masks&#x201D;`,name:"mask_feature_min_masks"},{anchor:"transformers.Wav2Vec2ConformerConfig.num_codevectors_per_group",description:`<strong>num_codevectors_per_group</strong> (<code>int</code>, <em>optional</em>, defaults to 320) &#x2014;
Number of entries in each quantization codebook (group).`,name:"num_codevectors_per_group"},{anchor:"transformers.Wav2Vec2ConformerConfig.num_codevector_groups",description:`<strong>num_codevector_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
Number of codevector groups for product codevector quantization.`,name:"num_codevector_groups"},{anchor:"transformers.Wav2Vec2ConformerConfig.contrastive_logits_temperature",description:`<strong>contrastive_logits_temperature</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The temperature <em>kappa</em> in the contrastive loss.`,name:"contrastive_logits_temperature"},{anchor:"transformers.Wav2Vec2ConformerConfig.feat_quantizer_dropout",description:`<strong>feat_quantizer_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probabilitiy for the output of the feature encoder that&#x2019;s used by the quantizer.`,name:"feat_quantizer_dropout"},{anchor:"transformers.Wav2Vec2ConformerConfig.num_negatives",description:`<strong>num_negatives</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
Number of negative samples for the contrastive loss.`,name:"num_negatives"},{anchor:"transformers.Wav2Vec2ConformerConfig.codevector_dim",description:`<strong>codevector_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Dimensionality of the quantized feature vectors.`,name:"codevector_dim"},{anchor:"transformers.Wav2Vec2ConformerConfig.proj_codevector_dim",description:`<strong>proj_codevector_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Dimensionality of the final projection of both the quantized and the transformer features.`,name:"proj_codevector_dim"},{anchor:"transformers.Wav2Vec2ConformerConfig.diversity_loss_weight",description:`<strong>diversity_loss_weight</strong> (<code>int</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The weight of the codebook diversity loss component.`,name:"diversity_loss_weight"},{anchor:"transformers.Wav2Vec2ConformerConfig.ctc_loss_reduction",description:`<strong>ctc_loss_reduction</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;sum&quot;</code>) &#x2014;
Specifies the reduction to apply to the output of <code>torch.nn.CTCLoss</code>. Only relevant when training an
instance of <a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerForCTC">Wav2Vec2ConformerForCTC</a>.`,name:"ctc_loss_reduction"},{anchor:"transformers.Wav2Vec2ConformerConfig.ctc_zero_infinity",description:`<strong>ctc_zero_infinity</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to zero infinite losses and the associated gradients of <code>torch.nn.CTCLoss</code>. Infinite losses mainly
occur when the inputs are too short to be aligned to the targets. Only relevant when training an instance
of <a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerForCTC">Wav2Vec2ConformerForCTC</a>.`,name:"ctc_zero_infinity"},{anchor:"transformers.Wav2Vec2ConformerConfig.use_weighted_layer_sum",description:`<strong>use_weighted_layer_sum</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a weighted average of layer outputs with learned weights. Only relevant when using an
instance of <a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerForSequenceClassification">Wav2Vec2ConformerForSequenceClassification</a>.`,name:"use_weighted_layer_sum"},{anchor:"transformers.Wav2Vec2ConformerConfig.classifier_proj_size",description:`<strong>classifier_proj_size</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Dimensionality of the projection before token mean-pooling for classification.`,name:"classifier_proj_size"},{anchor:"transformers.Wav2Vec2ConformerConfig.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.Wav2Vec2ConformerConfig.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.Wav2Vec2ConformerConfig.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.Wav2Vec2ConformerConfig.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.Wav2Vec2ConformerConfig.add_adapter",description:`<strong>add_adapter</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether a convolutional network should be stacked on top of the Wav2Vec2Conformer Encoder. Can be very
useful for warm-starting Wav2Vec2Conformer for SpeechEncoderDecoder models.`,name:"add_adapter"},{anchor:"transformers.Wav2Vec2ConformerConfig.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.Wav2Vec2ConformerConfig.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.Wav2Vec2ConformerConfig.num_adapter_layers",description:`<strong>num_adapter_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Number of convolutional layers that should be used in the adapter network. Only relevant if <code>add_adapter is True</code>.`,name:"num_adapter_layers"},{anchor:"transformers.Wav2Vec2ConformerConfig.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.Wav2Vec2ConformerConfig.position_embeddings_type",description:`<strong>position_embeddings_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;relative&quot;</code>) &#x2014;
Can be specified to <code>relative</code> or <code>rotary</code> for relative or rotary position embeddings respectively. If left
<code>None</code> no relative position embedding is applied.`,name:"position_embeddings_type"},{anchor:"transformers.Wav2Vec2ConformerConfig.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.Wav2Vec2ConformerConfig.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.Wav2Vec2ConformerConfig.conv_depthwise_kernel_size",description:`<strong>conv_depthwise_kernel_size</strong> (<code>int</code>, defaults to 31) &#x2014;
Kernel size of convolutional depthwise 1D layer in Conformer blocks.`,name:"conv_depthwise_kernel_size"},{anchor:"transformers.Wav2Vec2ConformerConfig.conformer_conv_dropout",description:`<strong>conformer_conv_dropout</strong> (<code>float</code>, 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/v4.31.0/src/transformers/models/wav2vec2_conformer/configuration_wav2vec2_conformer.py#L33"}}),We=new mt({props:{anchor:"transformers.Wav2Vec2ConformerConfig.example",$$slots:{default:[ld]},$$scope:{ctx:V}}}),po=new P({}),fo=new x({props:{name:"class transformers.models.wav2vec2_conformer.modeling_wav2vec2_conformer.Wav2Vec2ConformerForPreTrainingOutput",anchor:"transformers.models.wav2vec2_conformer.modeling_wav2vec2_conformer.Wav2Vec2ConformerForPreTrainingOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"projected_states",val:": FloatTensor = None"},{name:"projected_quantized_states",val:": FloatTensor = None"},{name:"codevector_perplexity",val:": FloatTensor = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"contrastive_loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"diversity_loss",val:": typing.Optional[torch.FloatTensor] = None"}],parametersDescription:[{anchor:"transformers.models.wav2vec2_conformer.modeling_wav2vec2_conformer.Wav2Vec2ConformerForPreTrainingOutput.loss",description:`<strong>loss</strong> (<em>optional</em>, returned when <code>sample_negative_indices</code> are passed, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) &#x2014;
Total loss as the sum of the contrastive loss (L_m) and the diversity loss (L_d) as stated in the <a href="https://arxiv.org/pdf/2006.11477.pdf" rel="nofollow">official
paper</a> . (classification) loss.`,name:"loss"},{anchor:"transformers.models.wav2vec2_conformer.modeling_wav2vec2_conformer.Wav2Vec2ConformerForPreTrainingOutput.projected_states",description:`<strong>projected_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.proj_codevector_dim)</code>) &#x2014;
Hidden-states of the model projected to <em>config.proj_codevector_dim</em> that can be used to predict the masked
projected quantized states.`,name:"projected_states"},{anchor:"transformers.models.wav2vec2_conformer.modeling_wav2vec2_conformer.Wav2Vec2ConformerForPreTrainingOutput.projected_quantized_states",description:`<strong>projected_quantized_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.proj_codevector_dim)</code>) &#x2014;
Quantized extracted feature vectors projected to <em>config.proj_codevector_dim</em> representing the positive
target vectors for contrastive loss.`,name:"projected_quantized_states"},{anchor:"transformers.models.wav2vec2_conformer.modeling_wav2vec2_conformer.Wav2Vec2ConformerForPreTrainingOutput.hidden_states",description:`<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>) &#x2014;
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.`,name:"hidden_states"},{anchor:"transformers.models.wav2vec2_conformer.modeling_wav2vec2_conformer.Wav2Vec2ConformerForPreTrainingOutput.attentions",description:`<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>) &#x2014;
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.`,name:"attentions"},{anchor:"transformers.models.wav2vec2_conformer.modeling_wav2vec2_conformer.Wav2Vec2ConformerForPreTrainingOutput.contrastive_loss",description:`<strong>contrastive_loss</strong> (<em>optional</em>, returned when <code>sample_negative_indices</code> are passed, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) &#x2014;
The contrastive loss (L_m) as stated in the <a href="https://arxiv.org/pdf/2006.11477.pdf" rel="nofollow">official paper</a> .`,name:"contrastive_loss"},{anchor:"transformers.models.wav2vec2_conformer.modeling_wav2vec2_conformer.Wav2Vec2ConformerForPreTrainingOutput.diversity_loss",description:`<strong>diversity_loss</strong> (<em>optional</em>, returned when <code>sample_negative_indices</code> are passed, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) &#x2014;
The diversity loss (L_d) as stated in the <a href="https://arxiv.org/pdf/2006.11477.pdf" rel="nofollow">official paper</a> .`,name:"diversity_loss"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py#L74"}}),uo=new P({}),go=new x({props:{name:"class transformers.Wav2Vec2ConformerModel",anchor:"transformers.Wav2Vec2ConformerModel",parameters:[{name:"config",val:": Wav2Vec2ConformerConfig"}],parametersDescription:[{anchor:"transformers.Wav2Vec2ConformerModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerConfig">Wav2Vec2ConformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py#L1245"}}),Mo=new x({props:{name:"forward",anchor:"transformers.Wav2Vec2ConformerModel.forward",parameters:[{name:"input_values",val:": typing.Optional[torch.Tensor]"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"mask_time_indices",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Wav2Vec2ConformerModel.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <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_values</code>, the <a href="/docs/transformers/v4.31.0/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/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Wav2Vec2ConformerModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/wav2vec2-conformer-rel-pos-large" rel="nofollow">wav2vec2-conformer-rel-pos-large</a>,
<code>attention_mask</code> should <strong>not</strong> be passed to avoid degraded performance when doing batched inference. For
such models <code>input_values</code> should simply be padded with 0 and passed without <code>attention_mask</code>. Be aware
that these models also yield slightly different results depending on whether <code>input_values</code> is padded or
not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Wav2Vec2ConformerModel.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.Wav2Vec2ConformerModel.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.Wav2Vec2ConformerModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py#L1318",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.modeling_outputs.Wav2Vec2BaseModelOutput"
>transformers.modeling_outputs.Wav2Vec2BaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerConfig"
>Wav2Vec2ConformerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>extract_features</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, conv_dim[-1])</code>) \u2014 Sequence of extracted feature vectors of the last convolutional layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.modeling_outputs.Wav2Vec2BaseModelOutput"
>transformers.modeling_outputs.Wav2Vec2BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),je=new St({props:{$$slots:{default:[id]},$$scope:{ctx:V}}}),Je=new mt({props:{anchor:"transformers.Wav2Vec2ConformerModel.forward.example",$$slots:{default:[cd]},$$scope:{ctx:V}}}),Co=new P({}),To=new x({props:{name:"class transformers.Wav2Vec2ConformerForCTC",anchor:"transformers.Wav2Vec2ConformerForCTC",parameters:[{name:"config",val:""},{name:"target_lang",val:" = None"}],parametersDescription:[{anchor:"transformers.Wav2Vec2ConformerForCTC.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerConfig">Wav2Vec2ConformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py#L1604"}}),Jo=new x({props:{name:"forward",anchor:"transformers.Wav2Vec2ConformerForCTC.forward",parameters:[{name:"input_values",val:": typing.Optional[torch.Tensor]"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"transformers.Wav2Vec2ConformerForCTC.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <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_values</code>, the <a href="/docs/transformers/v4.31.0/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/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Wav2Vec2ConformerForCTC.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/wav2vec2-conformer-rel-pos-large" rel="nofollow">wav2vec2-conformer-rel-pos-large</a>,
<code>attention_mask</code> should <strong>not</strong> be passed to avoid degraded performance when doing batched inference. For
such models <code>input_values</code> should simply be padded with 0 and passed without <code>attention_mask</code>. Be aware
that these models also yield slightly different results depending on whether <code>input_values</code> is padded or
not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Wav2Vec2ConformerForCTC.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.Wav2Vec2ConformerForCTC.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.Wav2Vec2ConformerForCTC.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Wav2Vec2ConformerForCTC.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_length)</code>, <em>optional</em>) &#x2014;
Labels for connectionist temporal classification. Note that <code>target_length</code> has to be smaller or equal to
the sequence length of the output logits. Indices are selected in <code>[-100, 0, ..., config.vocab_size - 1]</code>.
All labels set to <code>-100</code> are ignored (masked), the loss is only computed for labels in <code>[0, ..., config.vocab_size - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py#L1637",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutput"
>transformers.modeling_outputs.CausalLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerConfig"
>Wav2Vec2ConformerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutput"
>transformers.modeling_outputs.CausalLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ze=new St({props:{$$slots:{default:[dd]},$$scope:{ctx:V}}}),$e=new mt({props:{anchor:"transformers.Wav2Vec2ConformerForCTC.forward.example",$$slots:{default:[md]},$$scope:{ctx:V}}}),Fo=new P({}),Zo=new x({props:{name:"class transformers.Wav2Vec2ConformerForSequenceClassification",anchor:"transformers.Wav2Vec2ConformerForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2ConformerForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerConfig">Wav2Vec2ConformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py#L1725"}}),zo=new x({props:{name:"forward",anchor:"transformers.Wav2Vec2ConformerForSequenceClassification.forward",parameters:[{name:"input_values",val:": typing.Optional[torch.Tensor]"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"transformers.Wav2Vec2ConformerForSequenceClassification.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <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_values</code>, the <a href="/docs/transformers/v4.31.0/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/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Wav2Vec2ConformerForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/wav2vec2-conformer-rel-pos-large" rel="nofollow">wav2vec2-conformer-rel-pos-large</a>,
<code>attention_mask</code> should <strong>not</strong> be passed to avoid degraded performance when doing batched inference. For
such models <code>input_values</code> should simply be padded with 0 and passed without <code>attention_mask</code>. Be aware
that these models also yield slightly different results depending on whether <code>input_values</code> is padded or
not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Wav2Vec2ConformerForSequenceClassification.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.Wav2Vec2ConformerForSequenceClassification.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.Wav2Vec2ConformerForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Wav2Vec2ConformerForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py#L1760",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerConfig"
>Wav2Vec2ConformerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),xe=new St({props:{$$slots:{default:[pd]},$$scope:{ctx:V}}}),Xe=new mt({props:{anchor:"transformers.Wav2Vec2ConformerForSequenceClassification.forward.example",$$slots:{default:[fd]},$$scope:{ctx:V}}}),Go=new P({}),Bo=new x({props:{name:"class transformers.Wav2Vec2ConformerForAudioFrameClassification",anchor:"transformers.Wav2Vec2ConformerForAudioFrameClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2ConformerForAudioFrameClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerConfig">Wav2Vec2ConformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py#L1836"}}),So=new x({props:{name:"forward",anchor:"transformers.Wav2Vec2ConformerForAudioFrameClassification.forward",parameters:[{name:"input_values",val:": typing.Optional[torch.Tensor]"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Wav2Vec2ConformerForAudioFrameClassification.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <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_values</code>, the <a href="/docs/transformers/v4.31.0/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/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Wav2Vec2ConformerForAudioFrameClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/wav2vec2-conformer-rel-pos-large" rel="nofollow">wav2vec2-conformer-rel-pos-large</a>,
<code>attention_mask</code> should <strong>not</strong> be passed to avoid degraded performance when doing batched inference. For
such models <code>input_values</code> should simply be padded with 0 and passed without <code>attention_mask</code>. Be aware
that these models also yield slightly different results depending on whether <code>input_values</code> is padded or
not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Wav2Vec2ConformerForAudioFrameClassification.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.Wav2Vec2ConformerForAudioFrameClassification.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.Wav2Vec2ConformerForAudioFrameClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Wav2Vec2ConformerForAudioFrameClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py#L1871",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerConfig"
>Wav2Vec2ConformerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ze=new St({props:{$$slots:{default:[hd]},$$scope:{ctx:V}}}),Ge=new mt({props:{anchor:"transformers.Wav2Vec2ConformerForAudioFrameClassification.forward.example",$$slots:{default:[ud]},$$scope:{ctx:V}}}),Yo=new P({}),Po=new x({props:{name:"class transformers.Wav2Vec2ConformerForXVector",anchor:"transformers.Wav2Vec2ConformerForXVector",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2ConformerForXVector.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerConfig">Wav2Vec2ConformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py#L1990"}}),Ko=new x({props:{name:"forward",anchor:"transformers.Wav2Vec2ConformerForXVector.forward",parameters:[{name:"input_values",val:": typing.Optional[torch.Tensor]"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"transformers.Wav2Vec2ConformerForXVector.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <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_values</code>, the <a href="/docs/transformers/v4.31.0/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/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Wav2Vec2ConformerForXVector.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/wav2vec2-conformer-rel-pos-large" rel="nofollow">wav2vec2-conformer-rel-pos-large</a>,
<code>attention_mask</code> should <strong>not</strong> be passed to avoid degraded performance when doing batched inference. For
such models <code>input_values</code> should simply be padded with 0 and passed without <code>attention_mask</code>. Be aware
that these models also yield slightly different results depending on whether <code>input_values</code> is padded or
not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Wav2Vec2ConformerForXVector.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.Wav2Vec2ConformerForXVector.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.Wav2Vec2ConformerForXVector.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Wav2Vec2ConformerForXVector.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py#L2043",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.XVectorOutput"
>transformers.modeling_outputs.XVectorOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerConfig"
>Wav2Vec2ConformerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.xvector_output_dim)</code>) \u2014 Classification hidden states before AMSoftmax.</p>
</li>
<li>
<p><strong>embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.xvector_output_dim)</code>) \u2014 Utterance embeddings used for vector similarity-based retrieval.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.XVectorOutput"
>transformers.modeling_outputs.XVectorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ie=new St({props:{$$slots:{default:[gd]},$$scope:{ctx:V}}}),Re=new mt({props:{anchor:"transformers.Wav2Vec2ConformerForXVector.forward.example",$$slots:{default:[vd]},$$scope:{ctx:V}}}),et=new P({}),ot=new x({props:{name:"class transformers.Wav2Vec2ConformerForPreTraining",anchor:"transformers.Wav2Vec2ConformerForPreTraining",parameters:[{name:"config",val:": Wav2Vec2ConformerConfig"}],parametersDescription:[{anchor:"transformers.Wav2Vec2ConformerForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerConfig">Wav2Vec2ConformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py#L1383"}}),st=new x({props:{name:"forward",anchor:"transformers.Wav2Vec2ConformerForPreTraining.forward",parameters:[{name:"input_values",val:": typing.Optional[torch.Tensor]"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"mask_time_indices",val:": typing.Optional[torch.BoolTensor] = None"},{name:"sampled_negative_indices",val:": typing.Optional[torch.BoolTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Wav2Vec2ConformerForPreTraining.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <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_values</code>, the <a href="/docs/transformers/v4.31.0/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/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Wav2Vec2ConformerForPreTraining.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/wav2vec2-conformer-rel-pos-large" rel="nofollow">wav2vec2-conformer-rel-pos-large</a>,
<code>attention_mask</code> should <strong>not</strong> be passed to avoid degraded performance when doing batched inference. For
such models <code>input_values</code> should simply be padded with 0 and passed without <code>attention_mask</code>. Be aware
that these models also yield slightly different results depending on whether <code>input_values</code> is padded or
not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Wav2Vec2ConformerForPreTraining.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.Wav2Vec2ConformerForPreTraining.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.Wav2Vec2ConformerForPreTraining.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Wav2Vec2ConformerForPreTraining.forward.mask_time_indices",description:`<strong>mask_time_indices</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices to mask extracted features for contrastive loss. When in training mode, model learns to predict
masked extracted features in <em>config.proj_codevector_dim</em> space.`,name:"mask_time_indices"},{anchor:"transformers.Wav2Vec2ConformerForPreTraining.forward.sampled_negative_indices",description:`<strong>sampled_negative_indices</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, sequence_length, num_negatives)</code>, <em>optional</em>) &#x2014;
Indices indicating which quantized target vectors are used as negative sampled vectors in contrastive loss.
Required input for pre-training.`,name:"sampled_negative_indices"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py#L1435",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.models.wav2vec2_conformer.modeling_wav2vec2_conformer.Wav2Vec2ConformerForPreTrainingOutput"
>transformers.models.wav2vec2_conformer.modeling_wav2vec2_conformer.Wav2Vec2ConformerForPreTrainingOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerConfig"
>Wav2Vec2ConformerConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<em>optional</em>, returned when <code>sample_negative_indices</code> are passed, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) \u2014 Total loss as the sum of the contrastive loss (L_m) and the diversity loss (L_d) as stated in the <a
  href="https://arxiv.org/pdf/2006.11477.pdf"
  rel="nofollow"
>official
paper</a> . (classification) loss.</p>
</li>
<li>
<p><strong>projected_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.proj_codevector_dim)</code>) \u2014 Hidden-states of the model projected to <em>config.proj_codevector_dim</em> that can be used to predict the masked
projected quantized states.</p>
</li>
<li>
<p><strong>projected_quantized_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.proj_codevector_dim)</code>) \u2014 Quantized extracted feature vectors projected to <em>config.proj_codevector_dim</em> representing the positive
target vectors for contrastive loss.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>contrastive_loss</strong> (<em>optional</em>, returned when <code>sample_negative_indices</code> are passed, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) \u2014 The contrastive loss (L_m) as stated in the <a
  href="https://arxiv.org/pdf/2006.11477.pdf"
  rel="nofollow"
>official paper</a> .</p>
</li>
<li>
<p><strong>diversity_loss</strong> (<em>optional</em>, returned when <code>sample_negative_indices</code> are passed, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) \u2014 The diversity loss (L_d) as stated in the <a
  href="https://arxiv.org/pdf/2006.11477.pdf"
  rel="nofollow"
>official paper</a> .</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.models.wav2vec2_conformer.modeling_wav2vec2_conformer.Wav2Vec2ConformerForPreTrainingOutput"
>transformers.models.wav2vec2_conformer.modeling_wav2vec2_conformer.Wav2Vec2ConformerForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),qe=new St({props:{$$slots:{default:[_d]},$$scope:{ctx:V}}}),Ae=new mt({props:{anchor:"transformers.Wav2Vec2ConformerForPreTraining.forward.example",$$slots:{default:[bd]},$$scope:{ctx:V}}}),{c(){d=r("meta"),b=m(),g=r("h1"),h=r("a"),_=r("span"),y(i.$$.fragment),f=m(),k=r("span"),Rn=s("Wav2Vec2-Conformer"),Br=m(),O=r("h2"),be=r("a"),Yt=r("span"),y(eo.$$.fragment),Nn=m(),Pt=r("span"),qn=s("Overview"),Ir=m(),ye=r("p"),An=s("The Wav2Vec2-Conformer was added to an updated version of "),oo=r("a"),Sn=s("fairseq S2T: Fast Speech-to-Text Modeling with fairseq"),Yn=s(" by Changhan Wang, Yun Tang, Xutai Ma, Anne Wu, Sravya Popuri, Dmytro Okhonko, Juan Pino."),Rr=m(),ht=r("p"),Pn=s("The official results of the model can be found in Table 3 and Table 4 of the paper."),Nr=m(),we=r("p"),Qn=s("The Wav2Vec2-Conformer weights were released by the Meta AI team within the "),to=r("a"),Hn=s("Fairseq library"),Dn=s("."),qr=m(),ut=r("p"),Ln=s("Tips:"),Ar=m(),E=r("ul"),Y=r("li"),On=s("Wav2Vec2-Conformer follows the same architecture as Wav2Vec2, but replaces the "),Qt=r("em"),Kn=s("Attention"),ea=s("-block with a "),Ht=r("em"),oa=s("Conformer"),ta=s(`-block
as introduced in `),ro=r("a"),ra=s("Conformer: Convolution-augmented Transformer for Speech Recognition"),na=s("."),aa=m(),Dt=r("li"),sa=s(`For the same number of layers, Wav2Vec2-Conformer requires more parameters than Wav2Vec2, but also yields
an improved word error rate.`),la=m(),Lt=r("li"),ia=s("Wav2Vec2-Conformer uses the same tokenizer and feature extractor as Wav2Vec2."),ca=m(),no=r("li"),da=s(`Wav2Vec2-Conformer can use either no relative position embeddings, Transformer-XL-like position embeddings, or
rotary position embeddings by setting the correct `),Ot=r("code"),ma=s("config.position_embeddings_type"),pa=s("."),Sr=m(),Q=r("p"),fa=s("This model was contributed by "),ao=r("a"),ha=s("patrickvonplaten"),ua=s(`.
The original code can be found `),so=r("a"),ga=s("here"),va=s("."),Yr=m(),K=r("h2"),Me=r("a"),Kt=r("span"),y(lo.$$.fragment),_a=m(),er=r("span"),ba=s("Documentation resources"),Pr=m(),Ce=r("ul"),or=r("li"),gt=r("a"),ya=s("Audio classification task guide"),wa=m(),tr=r("li"),vt=r("a"),Ma=s("Automatic speech recognition task guide"),Qr=m(),ee=r("h2"),Te=r("a"),rr=r("span"),y(io.$$.fragment),Ca=m(),nr=r("span"),Ta=s("Wav2Vec2ConformerConfig"),Hr=m(),X=r("div"),y(co.$$.fragment),Wa=m(),oe=r("p"),Va=s("This is the configuration class to store the configuration of a "),_t=r("a"),ka=s("Wav2Vec2ConformerModel"),ja=s(`. It is used to
instantiate an Wav2Vec2Conformer 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 Wav2Vec2Conformer
`),mo=r("a"),Ja=s("facebook/wav2vec2-conformer-rel-pos-large"),Fa=s(`
architecture.`),Za=m(),te=r("p"),$a=s("Configuration objects inherit from "),bt=r("a"),Ua=s("PretrainedConfig"),xa=s(` and can be used to control the model outputs. Read the
documentation from `),yt=r("a"),Xa=s("PretrainedConfig"),Ea=s(" for more information."),za=m(),y(We.$$.fragment),Dr=m(),re=r("h2"),Ve=r("a"),ar=r("span"),y(po.$$.fragment),Ga=m(),sr=r("span"),Ba=s("Wav2Vec2Conformer specific outputs"),Lr=m(),ne=r("div"),y(fo.$$.fragment),Ia=m(),ho=r("p"),Ra=s("Output type of "),wt=r("a"),Na=s("Wav2Vec2ConformerForPreTraining"),qa=s(", with potential hidden states and attentions."),Or=m(),ae=r("h2"),ke=r("a"),lr=r("span"),y(uo.$$.fragment),Aa=m(),ir=r("span"),Sa=s("Wav2Vec2ConformerModel"),Kr=m(),Z=r("div"),y(go.$$.fragment),Ya=m(),vo=r("p"),Pa=s(`The bare Wav2Vec2Conformer Model transformer outputting raw hidden-states without any specific head on top.
Wav2Vec2Conformer was proposed in `),_o=r("a"),Qa=s(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),Ha=s(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Da=m(),bo=r("p"),La=s("This model inherits from "),Mt=r("a"),Oa=s("PreTrainedModel"),Ka=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),es=m(),yo=r("p"),os=s("This model is a PyTorch "),wo=r("a"),ts=s("nn.Module"),rs=s(` sub-class. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),ns=m(),z=r("div"),y(Mo.$$.fragment),as=m(),se=r("p"),ss=s("The "),Ct=r("a"),ls=s("Wav2Vec2ConformerModel"),is=s(" forward method, overrides the "),cr=r("code"),cs=s("__call__"),ds=s(" special method."),ms=m(),y(je.$$.fragment),ps=m(),y(Je.$$.fragment),en=m(),le=r("h2"),Fe=r("a"),dr=r("span"),y(Co.$$.fragment),fs=m(),mr=r("span"),hs=s("Wav2Vec2ConformerForCTC"),on=m(),$=r("div"),y(To.$$.fragment),us=m(),ie=r("p"),gs=s("Wav2Vec2Conformer Model with a "),pr=r("code"),vs=s("language modeling"),_s=s(` head on top for Connectionist Temporal Classification (CTC).
Wav2Vec2Conformer was proposed in `),Wo=r("a"),bs=s(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),ys=s(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),ws=m(),Vo=r("p"),Ms=s("This model inherits from "),Tt=r("a"),Cs=s("PreTrainedModel"),Ts=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Ws=m(),ko=r("p"),Vs=s("This model is a PyTorch "),jo=r("a"),ks=s("nn.Module"),js=s(` sub-class. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),Js=m(),G=r("div"),y(Jo.$$.fragment),Fs=m(),ce=r("p"),Zs=s("The "),Wt=r("a"),$s=s("Wav2Vec2ConformerForCTC"),Us=s(" forward method, overrides the "),fr=r("code"),xs=s("__call__"),Xs=s(" special method."),Es=m(),y(Ze.$$.fragment),zs=m(),y($e.$$.fragment),tn=m(),de=r("h2"),Ue=r("a"),hr=r("span"),y(Fo.$$.fragment),Gs=m(),ur=r("span"),Bs=s("Wav2Vec2ConformerForSequenceClassification"),rn=m(),j=r("div"),y(Zo.$$.fragment),Is=m(),gr=r("p"),Rs=s(`Wav2Vec2Conformer Model with a sequence classification head on top (a linear layer over the pooled output) for
tasks like SUPERB Keyword Spotting.`),Ns=m(),$o=r("p"),qs=s("Wav2Vec2Conformer was proposed in "),Uo=r("a"),As=s(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),Ss=s(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Ys=m(),xo=r("p"),Ps=s("This model inherits from "),Vt=r("a"),Qs=s("PreTrainedModel"),Hs=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Ds=m(),Xo=r("p"),Ls=s("This model is a PyTorch "),Eo=r("a"),Os=s("nn.Module"),Ks=s(` sub-class. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),el=m(),B=r("div"),y(zo.$$.fragment),ol=m(),me=r("p"),tl=s("The "),kt=r("a"),rl=s("Wav2Vec2ConformerForSequenceClassification"),nl=s(" forward method, overrides the "),vr=r("code"),al=s("__call__"),sl=s(" special method."),ll=m(),y(xe.$$.fragment),il=m(),y(Xe.$$.fragment),nn=m(),pe=r("h2"),Ee=r("a"),_r=r("span"),y(Go.$$.fragment),cl=m(),br=r("span"),dl=s("Wav2Vec2ConformerForAudioFrameClassification"),an=m(),J=r("div"),y(Bo.$$.fragment),ml=m(),yr=r("p"),pl=s("Wav2Vec2Conformer Model with a frame classification head on top for tasks like Speaker Diarization."),fl=m(),Io=r("p"),hl=s("Wav2Vec2Conformer was proposed in "),Ro=r("a"),ul=s(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),gl=s(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),vl=m(),No=r("p"),_l=s("This model inherits from "),jt=r("a"),bl=s("PreTrainedModel"),yl=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),wl=m(),qo=r("p"),Ml=s("This model is a PyTorch "),Ao=r("a"),Cl=s("nn.Module"),Tl=s(` sub-class. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),Wl=m(),I=r("div"),y(So.$$.fragment),Vl=m(),fe=r("p"),kl=s("The "),Jt=r("a"),jl=s("Wav2Vec2ConformerForAudioFrameClassification"),Jl=s(" forward method, overrides the "),wr=r("code"),Fl=s("__call__"),Zl=s(" special method."),$l=m(),y(ze.$$.fragment),Ul=m(),y(Ge.$$.fragment),sn=m(),he=r("h2"),Be=r("a"),Mr=r("span"),y(Yo.$$.fragment),xl=m(),Cr=r("span"),Xl=s("Wav2Vec2ConformerForXVector"),ln=m(),F=r("div"),y(Po.$$.fragment),El=m(),Tr=r("p"),zl=s("Wav2Vec2Conformer Model with an XVector feature extraction head on top for tasks like Speaker Verification."),Gl=m(),Qo=r("p"),Bl=s("Wav2Vec2Conformer was proposed in "),Ho=r("a"),Il=s(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),Rl=s(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Nl=m(),Do=r("p"),ql=s("This model inherits from "),Ft=r("a"),Al=s("PreTrainedModel"),Sl=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Yl=m(),Lo=r("p"),Pl=s("This model is a PyTorch "),Oo=r("a"),Ql=s("nn.Module"),Hl=s(` sub-class. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),Dl=m(),R=r("div"),y(Ko.$$.fragment),Ll=m(),ue=r("p"),Ol=s("The "),Zt=r("a"),Kl=s("Wav2Vec2ConformerForXVector"),ei=s(" forward method, overrides the "),Wr=r("code"),oi=s("__call__"),ti=s(" special method."),ri=m(),y(Ie.$$.fragment),ni=m(),y(Re.$$.fragment),cn=m(),ge=r("h2"),Ne=r("a"),Vr=r("span"),y(et.$$.fragment),ai=m(),kr=r("span"),si=s("Wav2Vec2ConformerForPreTraining"),dn=m(),U=r("div"),y(ot.$$.fragment),li=m(),ve=r("p"),ii=s("Wav2Vec2Conformer Model with a quantizer and "),jr=r("code"),ci=s("VQ"),di=s(` head on top.
Wav2Vec2Conformer was proposed in `),tt=r("a"),mi=s(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),pi=s(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),fi=m(),rt=r("p"),hi=s("This model inherits from "),$t=r("a"),ui=s("PreTrainedModel"),gi=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),vi=m(),nt=r("p"),_i=s("This model is a PyTorch "),at=r("a"),bi=s("nn.Module"),yi=s(` sub-class. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),wi=m(),N=r("div"),y(st.$$.fragment),Mi=m(),_e=r("p"),Ci=s("The "),Ut=r("a"),Ti=s("Wav2Vec2ConformerForPreTraining"),Wi=s(" forward method, overrides the "),Jr=r("code"),Vi=s("__call__"),ki=s(" special method."),ji=m(),y(qe.$$.fragment),Ji=m(),y(Ae.$$.fragment),this.h()},l(o){const u=ad('[data-svelte="svelte-1phssyn"]',document.head);d=n(u,"META",{name:!0,content:!0}),u.forEach(t),b=p(o),g=n(o,"H1",{class:!0});var lt=a(g);h=n(lt,"A",{id:!0,class:!0,href:!0});var Fr=a(h);_=n(Fr,"SPAN",{});var Zr=a(_);w(i.$$.fragment,Zr),Zr.forEach(t),Fr.forEach(t),f=p(lt),k=n(lt,"SPAN",{});var $r=a(k);Rn=l($r,"Wav2Vec2-Conformer"),$r.forEach(t),lt.forEach(t),Br=p(o),O=n(o,"H2",{class:!0});var it=a(O);be=n(it,"A",{id:!0,class:!0,href:!0});var Ur=a(be);Yt=n(Ur,"SPAN",{});var xr=a(Yt);w(eo.$$.fragment,xr),xr.forEach(t),Ur.forEach(t),Nn=p(it),Pt=n(it,"SPAN",{});var Xr=a(Pt);qn=l(Xr,"Overview"),Xr.forEach(t),it.forEach(t),Ir=p(o),ye=n(o,"P",{});var ct=a(ye);An=l(ct,"The Wav2Vec2-Conformer was added to an updated version of "),oo=n(ct,"A",{href:!0,rel:!0});var Er=a(oo);Sn=l(Er,"fairseq S2T: Fast Speech-to-Text Modeling with fairseq"),Er.forEach(t),Yn=l(ct," by Changhan Wang, Yun Tang, Xutai Ma, Anne Wu, Sravya Popuri, Dmytro Okhonko, Juan Pino."),ct.forEach(t),Rr=p(o),ht=n(o,"P",{});var zr=a(ht);Pn=l(zr,"The official results of the model can be found in Table 3 and Table 4 of the paper."),zr.forEach(t),Nr=p(o),we=n(o,"P",{});var dt=a(we);Qn=l(dt,"The Wav2Vec2-Conformer weights were released by the Meta AI team within the "),to=n(dt,"A",{href:!0,rel:!0});var Gr=a(to);Hn=l(Gr,"Fairseq library"),Gr.forEach(t),Dn=l(dt,"."),dt.forEach(t),qr=p(o),ut=n(o,"P",{});var Fi=a(ut);Ln=l(Fi,"Tips:"),Fi.forEach(t),Ar=p(o),E=n(o,"UL",{});var Se=a(E);Y=n(Se,"LI",{});var Ye=a(Y);On=l(Ye,"Wav2Vec2-Conformer follows the same architecture as Wav2Vec2, but replaces the "),Qt=n(Ye,"EM",{});var Zi=a(Qt);Kn=l(Zi,"Attention"),Zi.forEach(t),ea=l(Ye,"-block with a "),Ht=n(Ye,"EM",{});var $i=a(Ht);oa=l($i,"Conformer"),$i.forEach(t),ta=l(Ye,`-block
as introduced in `),ro=n(Ye,"A",{href:!0,rel:!0});var Ui=a(ro);ra=l(Ui,"Conformer: Convolution-augmented Transformer for Speech Recognition"),Ui.forEach(t),na=l(Ye,"."),Ye.forEach(t),aa=p(Se),Dt=n(Se,"LI",{});var xi=a(Dt);sa=l(xi,`For the same number of layers, Wav2Vec2-Conformer requires more parameters than Wav2Vec2, but also yields
an improved word error rate.`),xi.forEach(t),la=p(Se),Lt=n(Se,"LI",{});var Xi=a(Lt);ia=l(Xi,"Wav2Vec2-Conformer uses the same tokenizer and feature extractor as Wav2Vec2."),Xi.forEach(t),ca=p(Se),no=n(Se,"LI",{});var pn=a(no);da=l(pn,`Wav2Vec2-Conformer can use either no relative position embeddings, Transformer-XL-like position embeddings, or
rotary position embeddings by setting the correct `),Ot=n(pn,"CODE",{});var Ei=a(Ot);ma=l(Ei,"config.position_embeddings_type"),Ei.forEach(t),pa=l(pn,"."),pn.forEach(t),Se.forEach(t),Sr=p(o),Q=n(o,"P",{});var xt=a(Q);fa=l(xt,"This model was contributed by "),ao=n(xt,"A",{href:!0,rel:!0});var zi=a(ao);ha=l(zi,"patrickvonplaten"),zi.forEach(t),ua=l(xt,`.
The original code can be found `),so=n(xt,"A",{href:!0,rel:!0});var Gi=a(so);ga=l(Gi,"here"),Gi.forEach(t),va=l(xt,"."),xt.forEach(t),Yr=p(o),K=n(o,"H2",{class:!0});var fn=a(K);Me=n(fn,"A",{id:!0,class:!0,href:!0});var Bi=a(Me);Kt=n(Bi,"SPAN",{});var Ii=a(Kt);w(lo.$$.fragment,Ii),Ii.forEach(t),Bi.forEach(t),_a=p(fn),er=n(fn,"SPAN",{});var Ri=a(er);ba=l(Ri,"Documentation resources"),Ri.forEach(t),fn.forEach(t),Pr=p(o),Ce=n(o,"UL",{});var hn=a(Ce);or=n(hn,"LI",{});var Ni=a(or);gt=n(Ni,"A",{href:!0});var qi=a(gt);ya=l(qi,"Audio classification task guide"),qi.forEach(t),Ni.forEach(t),wa=p(hn),tr=n(hn,"LI",{});var Ai=a(tr);vt=n(Ai,"A",{href:!0});var Si=a(vt);Ma=l(Si,"Automatic speech recognition task guide"),Si.forEach(t),Ai.forEach(t),hn.forEach(t),Qr=p(o),ee=n(o,"H2",{class:!0});var un=a(ee);Te=n(un,"A",{id:!0,class:!0,href:!0});var Yi=a(Te);rr=n(Yi,"SPAN",{});var Pi=a(rr);w(io.$$.fragment,Pi),Pi.forEach(t),Yi.forEach(t),Ca=p(un),nr=n(un,"SPAN",{});var Qi=a(nr);Ta=l(Qi,"Wav2Vec2ConformerConfig"),Qi.forEach(t),un.forEach(t),Hr=p(o),X=n(o,"DIV",{class:!0});var Pe=a(X);w(co.$$.fragment,Pe),Wa=p(Pe),oe=n(Pe,"P",{});var Xt=a(oe);Va=l(Xt,"This is the configuration class to store the configuration of a "),_t=n(Xt,"A",{href:!0});var Hi=a(_t);ka=l(Hi,"Wav2Vec2ConformerModel"),Hi.forEach(t),ja=l(Xt,`. It is used to
instantiate an Wav2Vec2Conformer 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 Wav2Vec2Conformer
`),mo=n(Xt,"A",{href:!0,rel:!0});var Di=a(mo);Ja=l(Di,"facebook/wav2vec2-conformer-rel-pos-large"),Di.forEach(t),Fa=l(Xt,`
architecture.`),Xt.forEach(t),Za=p(Pe),te=n(Pe,"P",{});var Et=a(te);$a=l(Et,"Configuration objects inherit from "),bt=n(Et,"A",{href:!0});var Li=a(bt);Ua=l(Li,"PretrainedConfig"),Li.forEach(t),xa=l(Et,` and can be used to control the model outputs. Read the
documentation from `),yt=n(Et,"A",{href:!0});var Oi=a(yt);Xa=l(Oi,"PretrainedConfig"),Oi.forEach(t),Ea=l(Et," for more information."),Et.forEach(t),za=p(Pe),w(We.$$.fragment,Pe),Pe.forEach(t),Dr=p(o),re=n(o,"H2",{class:!0});var gn=a(re);Ve=n(gn,"A",{id:!0,class:!0,href:!0});var Ki=a(Ve);ar=n(Ki,"SPAN",{});var ec=a(ar);w(po.$$.fragment,ec),ec.forEach(t),Ki.forEach(t),Ga=p(gn),sr=n(gn,"SPAN",{});var oc=a(sr);Ba=l(oc,"Wav2Vec2Conformer specific outputs"),oc.forEach(t),gn.forEach(t),Lr=p(o),ne=n(o,"DIV",{class:!0});var vn=a(ne);w(fo.$$.fragment,vn),Ia=p(vn),ho=n(vn,"P",{});var _n=a(ho);Ra=l(_n,"Output type of "),wt=n(_n,"A",{href:!0});var tc=a(wt);Na=l(tc,"Wav2Vec2ConformerForPreTraining"),tc.forEach(t),qa=l(_n,", with potential hidden states and attentions."),_n.forEach(t),vn.forEach(t),Or=p(o),ae=n(o,"H2",{class:!0});var bn=a(ae);ke=n(bn,"A",{id:!0,class:!0,href:!0});var rc=a(ke);lr=n(rc,"SPAN",{});var nc=a(lr);w(uo.$$.fragment,nc),nc.forEach(t),rc.forEach(t),Aa=p(bn),ir=n(bn,"SPAN",{});var ac=a(ir);Sa=l(ac,"Wav2Vec2ConformerModel"),ac.forEach(t),bn.forEach(t),Kr=p(o),Z=n(o,"DIV",{class:!0});var H=a(Z);w(go.$$.fragment,H),Ya=p(H),vo=n(H,"P",{});var yn=a(vo);Pa=l(yn,`The bare Wav2Vec2Conformer Model transformer outputting raw hidden-states without any specific head on top.
Wav2Vec2Conformer was proposed in `),_o=n(yn,"A",{href:!0,rel:!0});var sc=a(_o);Qa=l(sc,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),sc.forEach(t),Ha=l(yn,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),yn.forEach(t),Da=p(H),bo=n(H,"P",{});var wn=a(bo);La=l(wn,"This model inherits from "),Mt=n(wn,"A",{href:!0});var lc=a(Mt);Oa=l(lc,"PreTrainedModel"),lc.forEach(t),Ka=l(wn,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),wn.forEach(t),es=p(H),yo=n(H,"P",{});var Mn=a(yo);os=l(Mn,"This model is a PyTorch "),wo=n(Mn,"A",{href:!0,rel:!0});var ic=a(wo);ts=l(ic,"nn.Module"),ic.forEach(t),rs=l(Mn,` sub-class. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),Mn.forEach(t),ns=p(H),z=n(H,"DIV",{class:!0});var Qe=a(z);w(Mo.$$.fragment,Qe),as=p(Qe),se=n(Qe,"P",{});var zt=a(se);ss=l(zt,"The "),Ct=n(zt,"A",{href:!0});var cc=a(Ct);ls=l(cc,"Wav2Vec2ConformerModel"),cc.forEach(t),is=l(zt," forward method, overrides the "),cr=n(zt,"CODE",{});var dc=a(cr);cs=l(dc,"__call__"),dc.forEach(t),ds=l(zt," special method."),zt.forEach(t),ms=p(Qe),w(je.$$.fragment,Qe),ps=p(Qe),w(Je.$$.fragment,Qe),Qe.forEach(t),H.forEach(t),en=p(o),le=n(o,"H2",{class:!0});var Cn=a(le);Fe=n(Cn,"A",{id:!0,class:!0,href:!0});var mc=a(Fe);dr=n(mc,"SPAN",{});var pc=a(dr);w(Co.$$.fragment,pc),pc.forEach(t),mc.forEach(t),fs=p(Cn),mr=n(Cn,"SPAN",{});var fc=a(mr);hs=l(fc,"Wav2Vec2ConformerForCTC"),fc.forEach(t),Cn.forEach(t),on=p(o),$=n(o,"DIV",{class:!0});var D=a($);w(To.$$.fragment,D),us=p(D),ie=n(D,"P",{});var Gt=a(ie);gs=l(Gt,"Wav2Vec2Conformer Model with a "),pr=n(Gt,"CODE",{});var hc=a(pr);vs=l(hc,"language modeling"),hc.forEach(t),_s=l(Gt,` head on top for Connectionist Temporal Classification (CTC).
Wav2Vec2Conformer was proposed in `),Wo=n(Gt,"A",{href:!0,rel:!0});var uc=a(Wo);bs=l(uc,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),uc.forEach(t),ys=l(Gt,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Gt.forEach(t),ws=p(D),Vo=n(D,"P",{});var Tn=a(Vo);Ms=l(Tn,"This model inherits from "),Tt=n(Tn,"A",{href:!0});var gc=a(Tt);Cs=l(gc,"PreTrainedModel"),gc.forEach(t),Ts=l(Tn,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Tn.forEach(t),Ws=p(D),ko=n(D,"P",{});var Wn=a(ko);Vs=l(Wn,"This model is a PyTorch "),jo=n(Wn,"A",{href:!0,rel:!0});var vc=a(jo);ks=l(vc,"nn.Module"),vc.forEach(t),js=l(Wn,` sub-class. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),Wn.forEach(t),Js=p(D),G=n(D,"DIV",{class:!0});var He=a(G);w(Jo.$$.fragment,He),Fs=p(He),ce=n(He,"P",{});var Bt=a(ce);Zs=l(Bt,"The "),Wt=n(Bt,"A",{href:!0});var _c=a(Wt);$s=l(_c,"Wav2Vec2ConformerForCTC"),_c.forEach(t),Us=l(Bt," forward method, overrides the "),fr=n(Bt,"CODE",{});var bc=a(fr);xs=l(bc,"__call__"),bc.forEach(t),Xs=l(Bt," special method."),Bt.forEach(t),Es=p(He),w(Ze.$$.fragment,He),zs=p(He),w($e.$$.fragment,He),He.forEach(t),D.forEach(t),tn=p(o),de=n(o,"H2",{class:!0});var Vn=a(de);Ue=n(Vn,"A",{id:!0,class:!0,href:!0});var yc=a(Ue);hr=n(yc,"SPAN",{});var wc=a(hr);w(Fo.$$.fragment,wc),wc.forEach(t),yc.forEach(t),Gs=p(Vn),ur=n(Vn,"SPAN",{});var Mc=a(ur);Bs=l(Mc,"Wav2Vec2ConformerForSequenceClassification"),Mc.forEach(t),Vn.forEach(t),rn=p(o),j=n(o,"DIV",{class:!0});var q=a(j);w(Zo.$$.fragment,q),Is=p(q),gr=n(q,"P",{});var Cc=a(gr);Rs=l(Cc,`Wav2Vec2Conformer Model with a sequence classification head on top (a linear layer over the pooled output) for
tasks like SUPERB Keyword Spotting.`),Cc.forEach(t),Ns=p(q),$o=n(q,"P",{});var kn=a($o);qs=l(kn,"Wav2Vec2Conformer was proposed in "),Uo=n(kn,"A",{href:!0,rel:!0});var Tc=a(Uo);As=l(Tc,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),Tc.forEach(t),Ss=l(kn,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),kn.forEach(t),Ys=p(q),xo=n(q,"P",{});var jn=a(xo);Ps=l(jn,"This model inherits from "),Vt=n(jn,"A",{href:!0});var Wc=a(Vt);Qs=l(Wc,"PreTrainedModel"),Wc.forEach(t),Hs=l(jn,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),jn.forEach(t),Ds=p(q),Xo=n(q,"P",{});var Jn=a(Xo);Ls=l(Jn,"This model is a PyTorch "),Eo=n(Jn,"A",{href:!0,rel:!0});var Vc=a(Eo);Os=l(Vc,"nn.Module"),Vc.forEach(t),Ks=l(Jn,` sub-class. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),Jn.forEach(t),el=p(q),B=n(q,"DIV",{class:!0});var De=a(B);w(zo.$$.fragment,De),ol=p(De),me=n(De,"P",{});var It=a(me);tl=l(It,"The "),kt=n(It,"A",{href:!0});var kc=a(kt);rl=l(kc,"Wav2Vec2ConformerForSequenceClassification"),kc.forEach(t),nl=l(It," forward method, overrides the "),vr=n(It,"CODE",{});var jc=a(vr);al=l(jc,"__call__"),jc.forEach(t),sl=l(It," special method."),It.forEach(t),ll=p(De),w(xe.$$.fragment,De),il=p(De),w(Xe.$$.fragment,De),De.forEach(t),q.forEach(t),nn=p(o),pe=n(o,"H2",{class:!0});var Fn=a(pe);Ee=n(Fn,"A",{id:!0,class:!0,href:!0});var Jc=a(Ee);_r=n(Jc,"SPAN",{});var Fc=a(_r);w(Go.$$.fragment,Fc),Fc.forEach(t),Jc.forEach(t),cl=p(Fn),br=n(Fn,"SPAN",{});var Zc=a(br);dl=l(Zc,"Wav2Vec2ConformerForAudioFrameClassification"),Zc.forEach(t),Fn.forEach(t),an=p(o),J=n(o,"DIV",{class:!0});var A=a(J);w(Bo.$$.fragment,A),ml=p(A),yr=n(A,"P",{});var $c=a(yr);pl=l($c,"Wav2Vec2Conformer Model with a frame classification head on top for tasks like Speaker Diarization."),$c.forEach(t),fl=p(A),Io=n(A,"P",{});var Zn=a(Io);hl=l(Zn,"Wav2Vec2Conformer was proposed in "),Ro=n(Zn,"A",{href:!0,rel:!0});var Uc=a(Ro);ul=l(Uc,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),Uc.forEach(t),gl=l(Zn,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Zn.forEach(t),vl=p(A),No=n(A,"P",{});var $n=a(No);_l=l($n,"This model inherits from "),jt=n($n,"A",{href:!0});var xc=a(jt);bl=l(xc,"PreTrainedModel"),xc.forEach(t),yl=l($n,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),$n.forEach(t),wl=p(A),qo=n(A,"P",{});var Un=a(qo);Ml=l(Un,"This model is a PyTorch "),Ao=n(Un,"A",{href:!0,rel:!0});var Xc=a(Ao);Cl=l(Xc,"nn.Module"),Xc.forEach(t),Tl=l(Un,` sub-class. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),Un.forEach(t),Wl=p(A),I=n(A,"DIV",{class:!0});var Le=a(I);w(So.$$.fragment,Le),Vl=p(Le),fe=n(Le,"P",{});var Rt=a(fe);kl=l(Rt,"The "),Jt=n(Rt,"A",{href:!0});var Ec=a(Jt);jl=l(Ec,"Wav2Vec2ConformerForAudioFrameClassification"),Ec.forEach(t),Jl=l(Rt," forward method, overrides the "),wr=n(Rt,"CODE",{});var zc=a(wr);Fl=l(zc,"__call__"),zc.forEach(t),Zl=l(Rt," special method."),Rt.forEach(t),$l=p(Le),w(ze.$$.fragment,Le),Ul=p(Le),w(Ge.$$.fragment,Le),Le.forEach(t),A.forEach(t),sn=p(o),he=n(o,"H2",{class:!0});var xn=a(he);Be=n(xn,"A",{id:!0,class:!0,href:!0});var Gc=a(Be);Mr=n(Gc,"SPAN",{});var Bc=a(Mr);w(Yo.$$.fragment,Bc),Bc.forEach(t),Gc.forEach(t),xl=p(xn),Cr=n(xn,"SPAN",{});var Ic=a(Cr);Xl=l(Ic,"Wav2Vec2ConformerForXVector"),Ic.forEach(t),xn.forEach(t),ln=p(o),F=n(o,"DIV",{class:!0});var S=a(F);w(Po.$$.fragment,S),El=p(S),Tr=n(S,"P",{});var Rc=a(Tr);zl=l(Rc,"Wav2Vec2Conformer Model with an XVector feature extraction head on top for tasks like Speaker Verification."),Rc.forEach(t),Gl=p(S),Qo=n(S,"P",{});var Xn=a(Qo);Bl=l(Xn,"Wav2Vec2Conformer was proposed in "),Ho=n(Xn,"A",{href:!0,rel:!0});var Nc=a(Ho);Il=l(Nc,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),Nc.forEach(t),Rl=l(Xn,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Xn.forEach(t),Nl=p(S),Do=n(S,"P",{});var En=a(Do);ql=l(En,"This model inherits from "),Ft=n(En,"A",{href:!0});var qc=a(Ft);Al=l(qc,"PreTrainedModel"),qc.forEach(t),Sl=l(En,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),En.forEach(t),Yl=p(S),Lo=n(S,"P",{});var zn=a(Lo);Pl=l(zn,"This model is a PyTorch "),Oo=n(zn,"A",{href:!0,rel:!0});var Ac=a(Oo);Ql=l(Ac,"nn.Module"),Ac.forEach(t),Hl=l(zn,` sub-class. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),zn.forEach(t),Dl=p(S),R=n(S,"DIV",{class:!0});var Oe=a(R);w(Ko.$$.fragment,Oe),Ll=p(Oe),ue=n(Oe,"P",{});var Nt=a(ue);Ol=l(Nt,"The "),Zt=n(Nt,"A",{href:!0});var Sc=a(Zt);Kl=l(Sc,"Wav2Vec2ConformerForXVector"),Sc.forEach(t),ei=l(Nt," forward method, overrides the "),Wr=n(Nt,"CODE",{});var Yc=a(Wr);oi=l(Yc,"__call__"),Yc.forEach(t),ti=l(Nt," special method."),Nt.forEach(t),ri=p(Oe),w(Ie.$$.fragment,Oe),ni=p(Oe),w(Re.$$.fragment,Oe),Oe.forEach(t),S.forEach(t),cn=p(o),ge=n(o,"H2",{class:!0});var Gn=a(ge);Ne=n(Gn,"A",{id:!0,class:!0,href:!0});var Pc=a(Ne);Vr=n(Pc,"SPAN",{});var Qc=a(Vr);w(et.$$.fragment,Qc),Qc.forEach(t),Pc.forEach(t),ai=p(Gn),kr=n(Gn,"SPAN",{});var Hc=a(kr);si=l(Hc,"Wav2Vec2ConformerForPreTraining"),Hc.forEach(t),Gn.forEach(t),dn=p(o),U=n(o,"DIV",{class:!0});var L=a(U);w(ot.$$.fragment,L),li=p(L),ve=n(L,"P",{});var qt=a(ve);ii=l(qt,"Wav2Vec2Conformer Model with a quantizer and "),jr=n(qt,"CODE",{});var Dc=a(jr);ci=l(Dc,"VQ"),Dc.forEach(t),di=l(qt,` head on top.
Wav2Vec2Conformer was proposed in `),tt=n(qt,"A",{href:!0,rel:!0});var Lc=a(tt);mi=l(Lc,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),Lc.forEach(t),pi=l(qt,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),qt.forEach(t),fi=p(L),rt=n(L,"P",{});var Bn=a(rt);hi=l(Bn,"This model inherits from "),$t=n(Bn,"A",{href:!0});var Oc=a($t);ui=l(Oc,"PreTrainedModel"),Oc.forEach(t),gi=l(Bn,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Bn.forEach(t),vi=p(L),nt=n(L,"P",{});var In=a(nt);_i=l(In,"This model is a PyTorch "),at=n(In,"A",{href:!0,rel:!0});var Kc=a(at);bi=l(Kc,"nn.Module"),Kc.forEach(t),yi=l(In,` sub-class. Use it as a
regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`),In.forEach(t),wi=p(L),N=n(L,"DIV",{class:!0});var Ke=a(N);w(st.$$.fragment,Ke),Mi=p(Ke),_e=n(Ke,"P",{});var At=a(_e);Ci=l(At,"The "),Ut=n(At,"A",{href:!0});var ed=a(Ut);Ti=l(ed,"Wav2Vec2ConformerForPreTraining"),ed.forEach(t),Wi=l(At," forward method, overrides the "),Jr=n(At,"CODE",{});var od=a(Jr);Vi=l(od,"__call__"),od.forEach(t),ki=l(At," special method."),At.forEach(t),ji=p(Ke),w(qe.$$.fragment,Ke),Ji=p(Ke),w(Ae.$$.fragment,Ke),Ke.forEach(t),L.forEach(t),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(wd)),c(h,"id","wav2vec2conformer"),c(h,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(h,"href","#wav2vec2conformer"),c(g,"class","relative group"),c(be,"id","overview"),c(be,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(be,"href","#overview"),c(O,"class","relative group"),c(oo,"href","https://arxiv.org/abs/2010.05171"),c(oo,"rel","nofollow"),c(to,"href","https://github.com/pytorch/fairseq/blob/main/examples/wav2vec/README.md#pre-trained-models"),c(to,"rel","nofollow"),c(ro,"href","https://arxiv.org/abs/2005.08100"),c(ro,"rel","nofollow"),c(ao,"href","https://huggingface.co/patrickvonplaten"),c(ao,"rel","nofollow"),c(so,"href","https://github.com/pytorch/fairseq/tree/main/examples/wav2vec"),c(so,"rel","nofollow"),c(Me,"id","documentation-resources"),c(Me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Me,"href","#documentation-resources"),c(K,"class","relative group"),c(gt,"href","../tasks/audio_classification"),c(vt,"href","../tasks/asr"),c(Te,"id","transformers.Wav2Vec2ConformerConfig"),c(Te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Te,"href","#transformers.Wav2Vec2ConformerConfig"),c(ee,"class","relative group"),c(_t,"href","/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerModel"),c(mo,"href","https://huggingface.co/facebook/wav2vec2-conformer-rel-pos-large"),c(mo,"rel","nofollow"),c(bt,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(yt,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),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(Ve,"id","transformers.models.wav2vec2_conformer.modeling_wav2vec2_conformer.Wav2Vec2ConformerForPreTrainingOutput"),c(Ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Ve,"href","#transformers.models.wav2vec2_conformer.modeling_wav2vec2_conformer.Wav2Vec2ConformerForPreTrainingOutput"),c(re,"class","relative group"),c(wt,"href","/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerForPreTraining"),c(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ke,"id","transformers.Wav2Vec2ConformerModel"),c(ke,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ke,"href","#transformers.Wav2Vec2ConformerModel"),c(ae,"class","relative group"),c(_o,"href","https://arxiv.org/abs/2006.11477"),c(_o,"rel","nofollow"),c(Mt,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),c(wo,"href","https://pytorch.org/docs/stable/nn.html#nn.Module"),c(wo,"rel","nofollow"),c(Ct,"href","/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerModel"),c(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Fe,"id","transformers.Wav2Vec2ConformerForCTC"),c(Fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Fe,"href","#transformers.Wav2Vec2ConformerForCTC"),c(le,"class","relative group"),c(Wo,"href","https://arxiv.org/abs/2006.11477"),c(Wo,"rel","nofollow"),c(Tt,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),c(jo,"href","https://pytorch.org/docs/stable/nn.html#nn.Module"),c(jo,"rel","nofollow"),c(Wt,"href","/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerForCTC"),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($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ue,"id","transformers.Wav2Vec2ConformerForSequenceClassification"),c(Ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Ue,"href","#transformers.Wav2Vec2ConformerForSequenceClassification"),c(de,"class","relative group"),c(Uo,"href","https://arxiv.org/abs/2006.11477"),c(Uo,"rel","nofollow"),c(Vt,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),c(Eo,"href","https://pytorch.org/docs/stable/nn.html#nn.Module"),c(Eo,"rel","nofollow"),c(kt,"href","/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerForSequenceClassification"),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(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(Ee,"id","transformers.Wav2Vec2ConformerForAudioFrameClassification"),c(Ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Ee,"href","#transformers.Wav2Vec2ConformerForAudioFrameClassification"),c(pe,"class","relative group"),c(Ro,"href","https://arxiv.org/abs/2006.11477"),c(Ro,"rel","nofollow"),c(jt,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),c(Ao,"href","https://pytorch.org/docs/stable/nn.html#nn.Module"),c(Ao,"rel","nofollow"),c(Jt,"href","/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerForAudioFrameClassification"),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(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(Be,"id","transformers.Wav2Vec2ConformerForXVector"),c(Be,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Be,"href","#transformers.Wav2Vec2ConformerForXVector"),c(he,"class","relative group"),c(Ho,"href","https://arxiv.org/abs/2006.11477"),c(Ho,"rel","nofollow"),c(Ft,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),c(Oo,"href","https://pytorch.org/docs/stable/nn.html#nn.Module"),c(Oo,"rel","nofollow"),c(Zt,"href","/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerForXVector"),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(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(Ne,"id","transformers.Wav2Vec2ConformerForPreTraining"),c(Ne,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Ne,"href","#transformers.Wav2Vec2ConformerForPreTraining"),c(ge,"class","relative group"),c(tt,"href","https://arxiv.org/abs/2006.11477"),c(tt,"rel","nofollow"),c($t,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),c(at,"href","https://pytorch.org/docs/stable/nn.html#nn.Module"),c(at,"rel","nofollow"),c(Ut,"href","/docs/transformers/v4.31.0/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerForPreTraining"),c(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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")},m(o,u){e(document.head,d),v(o,b,u),v(o,g,u),e(g,h),e(h,_),M(i,_,null),e(g,f),e(g,k),e(k,Rn),v(o,Br,u),v(o,O,u),e(O,be),e(be,Yt),M(eo,Yt,null),e(O,Nn),e(O,Pt),e(Pt,qn),v(o,Ir,u),v(o,ye,u),e(ye,An),e(ye,oo),e(oo,Sn),e(ye,Yn),v(o,Rr,u),v(o,ht,u),e(ht,Pn),v(o,Nr,u),v(o,we,u),e(we,Qn),e(we,to),e(to,Hn),e(we,Dn),v(o,qr,u),v(o,ut,u),e(ut,Ln),v(o,Ar,u),v(o,E,u),e(E,Y),e(Y,On),e(Y,Qt),e(Qt,Kn),e(Y,ea),e(Y,Ht),e(Ht,oa),e(Y,ta),e(Y,ro),e(ro,ra),e(Y,na),e(E,aa),e(E,Dt),e(Dt,sa),e(E,la),e(E,Lt),e(Lt,ia),e(E,ca),e(E,no),e(no,da),e(no,Ot),e(Ot,ma),e(no,pa),v(o,Sr,u),v(o,Q,u),e(Q,fa),e(Q,ao),e(ao,ha),e(Q,ua),e(Q,so),e(so,ga),e(Q,va),v(o,Yr,u),v(o,K,u),e(K,Me),e(Me,Kt),M(lo,Kt,null),e(K,_a),e(K,er),e(er,ba),v(o,Pr,u),v(o,Ce,u),e(Ce,or),e(or,gt),e(gt,ya),e(Ce,wa),e(Ce,tr),e(tr,vt),e(vt,Ma),v(o,Qr,u),v(o,ee,u),e(ee,Te),e(Te,rr),M(io,rr,null),e(ee,Ca),e(ee,nr),e(nr,Ta),v(o,Hr,u),v(o,X,u),M(co,X,null),e(X,Wa),e(X,oe),e(oe,Va),e(oe,_t),e(_t,ka),e(oe,ja),e(oe,mo),e(mo,Ja),e(oe,Fa),e(X,Za),e(X,te),e(te,$a),e(te,bt),e(bt,Ua),e(te,xa),e(te,yt),e(yt,Xa),e(te,Ea),e(X,za),M(We,X,null),v(o,Dr,u),v(o,re,u),e(re,Ve),e(Ve,ar),M(po,ar,null),e(re,Ga),e(re,sr),e(sr,Ba),v(o,Lr,u),v(o,ne,u),M(fo,ne,null),e(ne,Ia),e(ne,ho),e(ho,Ra),e(ho,wt),e(wt,Na),e(ho,qa),v(o,Or,u),v(o,ae,u),e(ae,ke),e(ke,lr),M(uo,lr,null),e(ae,Aa),e(ae,ir),e(ir,Sa),v(o,Kr,u),v(o,Z,u),M(go,Z,null),e(Z,Ya),e(Z,vo),e(vo,Pa),e(vo,_o),e(_o,Qa),e(vo,Ha),e(Z,Da),e(Z,bo),e(bo,La),e(bo,Mt),e(Mt,Oa),e(bo,Ka),e(Z,es),e(Z,yo),e(yo,os),e(yo,wo),e(wo,ts),e(yo,rs),e(Z,ns),e(Z,z),M(Mo,z,null),e(z,as),e(z,se),e(se,ss),e(se,Ct),e(Ct,ls),e(se,is),e(se,cr),e(cr,cs),e(se,ds),e(z,ms),M(je,z,null),e(z,ps),M(Je,z,null),v(o,en,u),v(o,le,u),e(le,Fe),e(Fe,dr),M(Co,dr,null),e(le,fs),e(le,mr),e(mr,hs),v(o,on,u),v(o,$,u),M(To,$,null),e($,us),e($,ie),e(ie,gs),e(ie,pr),e(pr,vs),e(ie,_s),e(ie,Wo),e(Wo,bs),e(ie,ys),e($,ws),e($,Vo),e(Vo,Ms),e(Vo,Tt),e(Tt,Cs),e(Vo,Ts),e($,Ws),e($,ko),e(ko,Vs),e(ko,jo),e(jo,ks),e(ko,js),e($,Js),e($,G),M(Jo,G,null),e(G,Fs),e(G,ce),e(ce,Zs),e(ce,Wt),e(Wt,$s),e(ce,Us),e(ce,fr),e(fr,xs),e(ce,Xs),e(G,Es),M(Ze,G,null),e(G,zs),M($e,G,null),v(o,tn,u),v(o,de,u),e(de,Ue),e(Ue,hr),M(Fo,hr,null),e(de,Gs),e(de,ur),e(ur,Bs),v(o,rn,u),v(o,j,u),M(Zo,j,null),e(j,Is),e(j,gr),e(gr,Rs),e(j,Ns),e(j,$o),e($o,qs),e($o,Uo),e(Uo,As),e($o,Ss),e(j,Ys),e(j,xo),e(xo,Ps),e(xo,Vt),e(Vt,Qs),e(xo,Hs),e(j,Ds),e(j,Xo),e(Xo,Ls),e(Xo,Eo),e(Eo,Os),e(Xo,Ks),e(j,el),e(j,B),M(zo,B,null),e(B,ol),e(B,me),e(me,tl),e(me,kt),e(kt,rl),e(me,nl),e(me,vr),e(vr,al),e(me,sl),e(B,ll),M(xe,B,null),e(B,il),M(Xe,B,null),v(o,nn,u),v(o,pe,u),e(pe,Ee),e(Ee,_r),M(Go,_r,null),e(pe,cl),e(pe,br),e(br,dl),v(o,an,u),v(o,J,u),M(Bo,J,null),e(J,ml),e(J,yr),e(yr,pl),e(J,fl),e(J,Io),e(Io,hl),e(Io,Ro),e(Ro,ul),e(Io,gl),e(J,vl),e(J,No),e(No,_l),e(No,jt),e(jt,bl),e(No,yl),e(J,wl),e(J,qo),e(qo,Ml),e(qo,Ao),e(Ao,Cl),e(qo,Tl),e(J,Wl),e(J,I),M(So,I,null),e(I,Vl),e(I,fe),e(fe,kl),e(fe,Jt),e(Jt,jl),e(fe,Jl),e(fe,wr),e(wr,Fl),e(fe,Zl),e(I,$l),M(ze,I,null),e(I,Ul),M(Ge,I,null),v(o,sn,u),v(o,he,u),e(he,Be),e(Be,Mr),M(Yo,Mr,null),e(he,xl),e(he,Cr),e(Cr,Xl),v(o,ln,u),v(o,F,u),M(Po,F,null),e(F,El),e(F,Tr),e(Tr,zl),e(F,Gl),e(F,Qo),e(Qo,Bl),e(Qo,Ho),e(Ho,Il),e(Qo,Rl),e(F,Nl),e(F,Do),e(Do,ql),e(Do,Ft),e(Ft,Al),e(Do,Sl),e(F,Yl),e(F,Lo),e(Lo,Pl),e(Lo,Oo),e(Oo,Ql),e(Lo,Hl),e(F,Dl),e(F,R),M(Ko,R,null),e(R,Ll),e(R,ue),e(ue,Ol),e(ue,Zt),e(Zt,Kl),e(ue,ei),e(ue,Wr),e(Wr,oi),e(ue,ti),e(R,ri),M(Ie,R,null),e(R,ni),M(Re,R,null),v(o,cn,u),v(o,ge,u),e(ge,Ne),e(Ne,Vr),M(et,Vr,null),e(ge,ai),e(ge,kr),e(kr,si),v(o,dn,u),v(o,U,u),M(ot,U,null),e(U,li),e(U,ve),e(ve,ii),e(ve,jr),e(jr,ci),e(ve,di),e(ve,tt),e(tt,mi),e(ve,pi),e(U,fi),e(U,rt),e(rt,hi),e(rt,$t),e($t,ui),e(rt,gi),e(U,vi),e(U,nt),e(nt,_i),e(nt,at),e(at,bi),e(nt,yi),e(U,wi),e(U,N),M(st,N,null),e(N,Mi),e(N,_e),e(_e,Ci),e(_e,Ut),e(Ut,Ti),e(_e,Wi),e(_e,Jr),e(Jr,Vi),e(_e,ki),e(N,ji),M(qe,N,null),e(N,Ji),M(Ae,N,null),mn=!0},p(o,[u]){const lt={};u&2&&(lt.$$scope={dirty:u,ctx:o}),We.$set(lt);const Fr={};u&2&&(Fr.$$scope={dirty:u,ctx:o}),je.$set(Fr);const Zr={};u&2&&(Zr.$$scope={dirty:u,ctx:o}),Je.$set(Zr);const $r={};u&2&&($r.$$scope={dirty:u,ctx:o}),Ze.$set($r);const it={};u&2&&(it.$$scope={dirty:u,ctx:o}),$e.$set(it);const Ur={};u&2&&(Ur.$$scope={dirty:u,ctx:o}),xe.$set(Ur);const xr={};u&2&&(xr.$$scope={dirty:u,ctx:o}),Xe.$set(xr);const Xr={};u&2&&(Xr.$$scope={dirty:u,ctx:o}),ze.$set(Xr);const ct={};u&2&&(ct.$$scope={dirty:u,ctx:o}),Ge.$set(ct);const Er={};u&2&&(Er.$$scope={dirty:u,ctx:o}),Ie.$set(Er);const zr={};u&2&&(zr.$$scope={dirty:u,ctx:o}),Re.$set(zr);const dt={};u&2&&(dt.$$scope={dirty:u,ctx:o}),qe.$set(dt);const Gr={};u&2&&(Gr.$$scope={dirty:u,ctx:o}),Ae.$set(Gr)},i(o){mn||(C(i.$$.fragment,o),C(eo.$$.fragment,o),C(lo.$$.fragment,o),C(io.$$.fragment,o),C(co.$$.fragment,o),C(We.$$.fragment,o),C(po.$$.fragment,o),C(fo.$$.fragment,o),C(uo.$$.fragment,o),C(go.$$.fragment,o),C(Mo.$$.fragment,o),C(je.$$.fragment,o),C(Je.$$.fragment,o),C(Co.$$.fragment,o),C(To.$$.fragment,o),C(Jo.$$.fragment,o),C(Ze.$$.fragment,o),C($e.$$.fragment,o),C(Fo.$$.fragment,o),C(Zo.$$.fragment,o),C(zo.$$.fragment,o),C(xe.$$.fragment,o),C(Xe.$$.fragment,o),C(Go.$$.fragment,o),C(Bo.$$.fragment,o),C(So.$$.fragment,o),C(ze.$$.fragment,o),C(Ge.$$.fragment,o),C(Yo.$$.fragment,o),C(Po.$$.fragment,o),C(Ko.$$.fragment,o),C(Ie.$$.fragment,o),C(Re.$$.fragment,o),C(et.$$.fragment,o),C(ot.$$.fragment,o),C(st.$$.fragment,o),C(qe.$$.fragment,o),C(Ae.$$.fragment,o),mn=!0)},o(o){T(i.$$.fragment,o),T(eo.$$.fragment,o),T(lo.$$.fragment,o),T(io.$$.fragment,o),T(co.$$.fragment,o),T(We.$$.fragment,o),T(po.$$.fragment,o),T(fo.$$.fragment,o),T(uo.$$.fragment,o),T(go.$$.fragment,o),T(Mo.$$.fragment,o),T(je.$$.fragment,o),T(Je.$$.fragment,o),T(Co.$$.fragment,o),T(To.$$.fragment,o),T(Jo.$$.fragment,o),T(Ze.$$.fragment,o),T($e.$$.fragment,o),T(Fo.$$.fragment,o),T(Zo.$$.fragment,o),T(zo.$$.fragment,o),T(xe.$$.fragment,o),T(Xe.$$.fragment,o),T(Go.$$.fragment,o),T(Bo.$$.fragment,o),T(So.$$.fragment,o),T(ze.$$.fragment,o),T(Ge.$$.fragment,o),T(Yo.$$.fragment,o),T(Po.$$.fragment,o),T(Ko.$$.fragment,o),T(Ie.$$.fragment,o),T(Re.$$.fragment,o),T(et.$$.fragment,o),T(ot.$$.fragment,o),T(st.$$.fragment,o),T(qe.$$.fragment,o),T(Ae.$$.fragment,o),mn=!1},d(o){t(d),o&&t(b),o&&t(g),W(i),o&&t(Br),o&&t(O),W(eo),o&&t(Ir),o&&t(ye),o&&t(Rr),o&&t(ht),o&&t(Nr),o&&t(we),o&&t(qr),o&&t(ut),o&&t(Ar),o&&t(E),o&&t(Sr),o&&t(Q),o&&t(Yr),o&&t(K),W(lo),o&&t(Pr),o&&t(Ce),o&&t(Qr),o&&t(ee),W(io),o&&t(Hr),o&&t(X),W(co),W(We),o&&t(Dr),o&&t(re),W(po),o&&t(Lr),o&&t(ne),W(fo),o&&t(Or),o&&t(ae),W(uo),o&&t(Kr),o&&t(Z),W(go),W(Mo),W(je),W(Je),o&&t(en),o&&t(le),W(Co),o&&t(on),o&&t($),W(To),W(Jo),W(Ze),W($e),o&&t(tn),o&&t(de),W(Fo),o&&t(rn),o&&t(j),W(Zo),W(zo),W(xe),W(Xe),o&&t(nn),o&&t(pe),W(Go),o&&t(an),o&&t(J),W(Bo),W(So),W(ze),W(Ge),o&&t(sn),o&&t(he),W(Yo),o&&t(ln),o&&t(F),W(Po),W(Ko),W(Ie),W(Re),o&&t(cn),o&&t(ge),W(et),o&&t(dn),o&&t(U),W(ot),W(st),W(qe),W(Ae)}}}const wd={local:"wav2vec2conformer",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.Wav2Vec2ConformerConfig",title:"Wav2Vec2ConformerConfig"},{local:"transformers.models.wav2vec2_conformer.modeling_wav2vec2_conformer.Wav2Vec2ConformerForPreTrainingOutput",title:"Wav2Vec2Conformer specific outputs"},{local:"transformers.Wav2Vec2ConformerModel",title:"Wav2Vec2ConformerModel"},{local:"transformers.Wav2Vec2ConformerForCTC",title:"Wav2Vec2ConformerForCTC"},{local:"transformers.Wav2Vec2ConformerForSequenceClassification",title:"Wav2Vec2ConformerForSequenceClassification"},{local:"transformers.Wav2Vec2ConformerForAudioFrameClassification",title:"Wav2Vec2ConformerForAudioFrameClassification"},{local:"transformers.Wav2Vec2ConformerForXVector",title:"Wav2Vec2ConformerForXVector"},{local:"transformers.Wav2Vec2ConformerForPreTraining",title:"Wav2Vec2ConformerForPreTraining"}],title:"Wav2Vec2-Conformer"};function Md(V){return sd(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Jd extends td{constructor(d){super();rd(this,d,Md,yd,nd,{})}}export{Jd as default,wd as metadata};
