import{S as _i,i as bi,s as Mi,e as n,k as h,w as M,t as l,M as yi,c as s,d as o,m as u,a as r,x as y,h as i,b as c,G as e,g as v,y as w,q as T,o as W,B as k,v as wi,L as Bt}from"../../chunks/vendor-hf-doc-builder.js";import{T as oa}from"../../chunks/Tip-hf-doc-builder.js";import{D as N}from"../../chunks/Docstring-hf-doc-builder.js";import{C as It}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ce}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Vt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ti(j){let d,b,f,m,_;return m=new It({props:{code:"",highlighted:""}}),{c(){d=n("p"),b=l("Example:"),f=h(),M(m.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);b=i(p,"Example:"),p.forEach(o),f=u(a),y(m.$$.fragment,a)},m(a,p){v(a,d,p),e(d,b),v(a,f,p),w(m,a,p),_=!0},p:Bt,i(a){_||(T(m.$$.fragment,a),_=!0)},o(a){W(m.$$.fragment,a),_=!1},d(a){a&&o(d),a&&o(f),k(m,a)}}}function Wi(j){let d,b,f,m,_;return m=new It({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFdhdkxNQ29uZmlnJTJDJTIwV2F2TE1Nb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBXYXZMTSUyMGZhY2Vib29rJTJGd2F2bG0tYmFzZS05NjBoJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMFdhdkxNQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMGZhY2Vib29rJTJGd2F2bG0tYmFzZS05NjBoJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBXYXZMTU1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> WavLMConfig, WavLMModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a WavLM facebook/wavlm-base-960h style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = WavLMConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the facebook/wavlm-base-960h style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = WavLMModel(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=n("p"),b=l("Example:"),f=h(),M(m.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);b=i(p,"Example:"),p.forEach(o),f=u(a),y(m.$$.fragment,a)},m(a,p){v(a,d,p),e(d,b),v(a,f,p),w(m,a,p),_=!0},p:Bt,i(a){_||(T(m.$$.fragment,a),_=!0)},o(a){W(m.$$.fragment,a),_=!1},d(a){a&&o(d),a&&o(f),k(m,a)}}}function ki(j){let d,b,f,m,_;return{c(){d=n("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=l("Module"),_=l(`
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(a){d=s(a,"P",{});var p=r(d);b=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(p,"CODE",{});var C=r(f);m=i(C,"Module"),C.forEach(o),_=i(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(a,p){v(a,d,p),e(d,b),e(d,f),e(f,m),e(d,_)},d(a){a&&o(d)}}}function ji(j){let d,b,f,m,_;return m=new It({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBXYXZMTU1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmhmLWludGVybmFsLXRlc3RpbmclMkZsaWJyaXNwZWVjaF9hc3JfZGVtbyUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWRhdGFzZXQlMjAlM0QlMjBkYXRhc2V0LnNvcnQoJTIyaWQlMjIpJTBBc2FtcGxpbmdfcmF0ZSUyMCUzRCUyMGRhdGFzZXQuZmVhdHVyZXMlNUIlMjJhdWRpbyUyMiU1RC5zYW1wbGluZ19yYXRlJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIycGF0cmlja3ZvbnBsYXRlbiUyRndhdmxtLWxpYnJpLWNsZWFuLTEwMGgtYmFzZS1wbHVzJTIyKSUwQW1vZGVsJTIwJTNEJTIwV2F2TE1Nb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIycGF0cmlja3ZvbnBsYXRlbiUyRndhdmxtLWxpYnJpLWNsZWFuLTEwMGgtYmFzZS1wbHVzJTIyKSUwQSUwQSUyMyUyMGF1ZGlvJTIwZmlsZSUyMGlzJTIwZGVjb2RlZCUyMG9uJTIwdGhlJTIwZmx5JTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGRhdGFzZXQlNUIwJTVEJTVCJTIyYXVkaW8lMjIlNUQlNUIlMjJhcnJheSUyMiU1RCUyQyUyMHNhbXBsaW5nX3JhdGUlM0RzYW1wbGluZ19yYXRlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, WavLMModel
<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;patrickvonplaten/wavlm-libri-clean-100h-base-plus&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = WavLMModel.from_pretrained(<span class="hljs-string">&quot;patrickvonplaten/wavlm-libri-clean-100h-base-plus&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">292</span>, <span class="hljs-number">768</span>]`}}),{c(){d=n("p"),b=l("Example:"),f=h(),M(m.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);b=i(p,"Example:"),p.forEach(o),f=u(a),y(m.$$.fragment,a)},m(a,p){v(a,d,p),e(d,b),v(a,f,p),w(m,a,p),_=!0},p:Bt,i(a){_||(T(m.$$.fragment,a),_=!0)},o(a){W(m.$$.fragment,a),_=!1},d(a){a&&o(d),a&&o(f),k(m,a)}}}function Ci(j){let d,b,f,m,_;return{c(){d=n("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=l("Module"),_=l(`
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(a){d=s(a,"P",{});var p=r(d);b=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(p,"CODE",{});var C=r(f);m=i(C,"Module"),C.forEach(o),_=i(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(a,p){v(a,d,p),e(d,b),e(d,f),e(f,m),e(d,_)},d(a){a&&o(d)}}}function Ji(j){let d,b,f,m,_;return m=new It({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBXYXZMTUZvckNUQyUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJoZi1pbnRlcm5hbC10ZXN0aW5nJTJGbGlicmlzcGVlY2hfYXNyX2RlbW8lMjIlMkMlMjAlMjJjbGVhbiUyMiUyQyUyMHNwbGl0JTNEJTIydmFsaWRhdGlvbiUyMiklMEFkYXRhc2V0JTIwJTNEJTIwZGF0YXNldC5zb3J0KCUyMmlkJTIyKSUwQXNhbXBsaW5nX3JhdGUlMjAlM0QlMjBkYXRhc2V0LmZlYXR1cmVzJTVCJTIyYXVkaW8lMjIlNUQuc2FtcGxpbmdfcmF0ZSUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMnBhdHJpY2t2b25wbGF0ZW4lMkZ3YXZsbS1saWJyaS1jbGVhbi0xMDBoLWJhc2UtcGx1cyUyMiklMEFtb2RlbCUyMCUzRCUyMFdhdkxNRm9yQ1RDLmZyb21fcHJldHJhaW5lZCglMjJwYXRyaWNrdm9ucGxhdGVuJTJGd2F2bG0tbGlicmktY2xlYW4tMTAwaC1iYXNlLXBsdXMlMjIpJTBBJTBBJTIzJTIwYXVkaW8lMjBmaWxlJTIwaXMlMjBkZWNvZGVkJTIwb24lMjB0aGUlMjBmbHklMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoZGF0YXNldCU1QjAlNUQlNUIlMjJhdWRpbyUyMiU1RCU1QiUyMmFycmF5JTIyJTVEJTJDJTIwc2FtcGxpbmdfcmF0ZSUzRHNhbXBsaW5nX3JhdGUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBcHJlZGljdGVkX2lkcyUyMCUzRCUyMHRvcmNoLmFyZ21heChsb2dpdHMlMkMlMjBkaW0lM0QtMSklMEElMEElMjMlMjB0cmFuc2NyaWJlJTIwc3BlZWNoJTBBdHJhbnNjcmlwdGlvbiUyMCUzRCUyMHByb2Nlc3Nvci5iYXRjaF9kZWNvZGUocHJlZGljdGVkX2lkcyklMEF0cmFuc2NyaXB0aW9uJTVCMCU1RCUwQSUwQWlucHV0cyU1QiUyMmxhYmVscyUyMiU1RCUyMCUzRCUyMHByb2Nlc3Nvcih0ZXh0JTNEZGF0YXNldCU1QjAlNUQlNUIlMjJ0ZXh0JTIyJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikuaW5wdXRfaWRzJTBBJTBBJTIzJTIwY29tcHV0ZSUyMGxvc3MlMEFsb3NzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvc3MlMEFyb3VuZChsb3NzLml0ZW0oKSUyQyUyMDIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, WavLMForCTC
<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;patrickvonplaten/wavlm-libri-clean-100h-base-plus&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = WavLMForCTC.from_pretrained(<span class="hljs-string">&quot;patrickvonplaten/wavlm-libri-clean-100h-base-plus&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 aposle 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">12.51</span>`}}),{c(){d=n("p"),b=l("Example:"),f=h(),M(m.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);b=i(p,"Example:"),p.forEach(o),f=u(a),y(m.$$.fragment,a)},m(a,p){v(a,d,p),e(d,b),v(a,f,p),w(m,a,p),_=!0},p:Bt,i(a){_||(T(m.$$.fragment,a),_=!0)},o(a){W(m.$$.fragment,a),_=!1},d(a){a&&o(d),a&&o(f),k(m,a)}}}function Fi(j){let d,b,f,m,_;return{c(){d=n("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=l("Module"),_=l(`
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(a){d=s(a,"P",{});var p=r(d);b=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(p,"CODE",{});var C=r(f);m=i(C,"Module"),C.forEach(o),_=i(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(a,p){v(a,d,p),e(d,b),e(d,f),e(f,m),e(d,_)},d(a){a&&o(d)}}}function Li(j){let d,b,f,m,_;return m=new It({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yJTJDJTIwV2F2TE1Gb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBaW1wb3J0JTIwdG9yY2glMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmhmLWludGVybmFsLXRlc3RpbmclMkZsaWJyaXNwZWVjaF9hc3JfZGVtbyUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWRhdGFzZXQlMjAlM0QlMjBkYXRhc2V0LnNvcnQoJTIyaWQlMjIpJTBBc2FtcGxpbmdfcmF0ZSUyMCUzRCUyMGRhdGFzZXQuZmVhdHVyZXMlNUIlMjJhdWRpbyUyMiU1RC5zYW1wbGluZ19yYXRlJTBBJTBBZmVhdHVyZV9leHRyYWN0b3IlMjAlM0QlMjBBdXRvRmVhdHVyZUV4dHJhY3Rvci5mcm9tX3ByZXRyYWluZWQoJTIycGF0cmlja3ZvbnBsYXRlbiUyRndhdmxtLWxpYnJpLWNsZWFuLTEwMGgtYmFzZS1wbHVzJTIyKSUwQW1vZGVsJTIwJTNEJTIwV2F2TE1Gb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJwYXRyaWNrdm9ucGxhdGVuJTJGd2F2bG0tbGlicmktY2xlYW4tMTAwaC1iYXNlLXBsdXMlMjIpJTBBJTBBJTIzJTIwYXVkaW8lMjBmaWxlJTIwaXMlMjBkZWNvZGVkJTIwb24lMjB0aGUlMjBmbHklMEFpbnB1dHMlMjAlM0QlMjBmZWF0dXJlX2V4dHJhY3RvcihkYXRhc2V0JTVCMCU1RCU1QiUyMmF1ZGlvJTIyJTVEJTVCJTIyYXJyYXklMjIlNUQlMkMlMjBzYW1wbGluZ19yYXRlJTNEc2FtcGxpbmdfcmF0ZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWRzJTIwJTNEJTIwdG9yY2guYXJnbWF4KGxvZ2l0cyUyQyUyMGRpbSUzRC0xKS5pdGVtKCklMEFwcmVkaWN0ZWRfbGFiZWwlMjAlM0QlMjBtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfY2xhc3NfaWRzJTVEJTBBJTBBJTIzJTIwY29tcHV0ZSUyMGxvc3MlMjAtJTIwdGFyZ2V0X2xhYmVsJTIwaXMlMjBlLmcuJTIwJTIyZG93biUyMiUwQXRhcmdldF9sYWJlbCUyMCUzRCUyMG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QjAlNUQlMEFpbnB1dHMlNUIlMjJsYWJlbHMlMjIlNUQlMjAlM0QlMjB0b3JjaC50ZW5zb3IoJTVCbW9kZWwuY29uZmlnLmxhYmVsMmlkJTVCdGFyZ2V0X2xhYmVsJTVEJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, WavLMForSequenceClassification
<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;patrickvonplaten/wavlm-libri-clean-100h-base-plus&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = WavLMForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;patrickvonplaten/wavlm-libri-clean-100h-base-plus&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=n("p"),b=l("Example:"),f=h(),M(m.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);b=i(p,"Example:"),p.forEach(o),f=u(a),y(m.$$.fragment,a)},m(a,p){v(a,d,p),e(d,b),v(a,f,p),w(m,a,p),_=!0},p:Bt,i(a){_||(T(m.$$.fragment,a),_=!0)},o(a){W(m.$$.fragment,a),_=!1},d(a){a&&o(d),a&&o(f),k(m,a)}}}function $i(j){let d,b,f,m,_;return{c(){d=n("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=l("Module"),_=l(`
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(a){d=s(a,"P",{});var p=r(d);b=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(p,"CODE",{});var C=r(f);m=i(C,"Module"),C.forEach(o),_=i(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(a,p){v(a,d,p),e(d,b),e(d,f),e(f,m),e(d,_)},d(a){a&&o(d)}}}function Ui(j){let d,b,f,m,_;return m=new It({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yJTJDJTIwV2F2TE1Gb3JBdWRpb0ZyYW1lQ2xhc3NpZmljYXRpb24lMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaGYtaW50ZXJuYWwtdGVzdGluZyUyRmxpYnJpc3BlZWNoX2Fzcl9kZW1vJTIyJTJDJTIwJTIyY2xlYW4lMjIlMkMlMjBzcGxpdCUzRCUyMnZhbGlkYXRpb24lMjIpJTBBZGF0YXNldCUyMCUzRCUyMGRhdGFzZXQuc29ydCglMjJpZCUyMiklMEFzYW1wbGluZ19yYXRlJTIwJTNEJTIwZGF0YXNldC5mZWF0dXJlcyU1QiUyMmF1ZGlvJTIyJTVELnNhbXBsaW5nX3JhdGUlMEElMEFmZWF0dXJlX2V4dHJhY3RvciUyMCUzRCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZ3YXZsbS1iYXNlLXBsdXMtc2QlMjIpJTBBbW9kZWwlMjAlM0QlMjBXYXZMTUZvckF1ZGlvRnJhbWVDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGd2F2bG0tYmFzZS1wbHVzLXNkJTIyKSUwQSUwQSUyMyUyMGF1ZGlvJTIwZmlsZSUyMGlzJTIwZGVjb2RlZCUyMG9uJTIwdGhlJTIwZmx5JTBBaW5wdXRzJTIwJTNEJTIwZmVhdHVyZV9leHRyYWN0b3IoZGF0YXNldCU1QjAlNUQlNUIlMjJhdWRpbyUyMiU1RCU1QiUyMmFycmF5JTIyJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUyQyUyMHNhbXBsaW5nX3JhdGUlM0RzYW1wbGluZ19yYXRlKSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJvYmFiaWxpdGllcyUyMCUzRCUyMHRvcmNoLnNpZ21vaWQobG9naXRzJTVCMCU1RCklMEElMjMlMjBsYWJlbHMlMjBpcyUyMGElMjBvbmUtaG90JTIwYXJyYXklMjBvZiUyMHNoYXBlJTIwKG51bV9mcmFtZXMlMkMlMjBudW1fc3BlYWtlcnMpJTBBbGFiZWxzJTIwJTNEJTIwKHByb2JhYmlsaXRpZXMlMjAlM0UlMjAwLjUpLmxvbmcoKSUwQWxhYmVscyU1QjAlNUQudG9saXN0KCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, WavLMForAudioFrameClassification
<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;microsoft/wavlm-base-plus-sd&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = WavLMForAudioFrameClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/wavlm-base-plus-sd&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>probabilities = torch.sigmoid(logits[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># labels is a one-hot array of shape (num_frames, num_speakers)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = (probabilities &gt; <span class="hljs-number">0.5</span>).long()
<span class="hljs-meta">&gt;&gt;&gt; </span>labels[<span class="hljs-number">0</span>].tolist()
[<span class="hljs-number">0</span>, <span class="hljs-number">0</span>]`}}),{c(){d=n("p"),b=l("Example:"),f=h(),M(m.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);b=i(p,"Example:"),p.forEach(o),f=u(a),y(m.$$.fragment,a)},m(a,p){v(a,d,p),e(d,b),v(a,f,p),w(m,a,p),_=!0},p:Bt,i(a){_||(T(m.$$.fragment,a),_=!0)},o(a){W(m.$$.fragment,a),_=!1},d(a){a&&o(d),a&&o(f),k(m,a)}}}function Zi(j){let d,b,f,m,_;return{c(){d=n("p"),b=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),m=l("Module"),_=l(`
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(a){d=s(a,"P",{});var p=r(d);b=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(p,"CODE",{});var C=r(f);m=i(C,"Module"),C.forEach(o),_=i(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(a,p){v(a,d,p),e(d,b),e(d,f),e(f,m),e(d,_)},d(a){a&&o(d)}}}function Ei(j){let d,b,f,m,_;return m=new It({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yJTJDJTIwV2F2TE1Gb3JYVmVjdG9yJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBaW1wb3J0JTIwdG9yY2glMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmhmLWludGVybmFsLXRlc3RpbmclMkZsaWJyaXNwZWVjaF9hc3JfZGVtbyUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWRhdGFzZXQlMjAlM0QlMjBkYXRhc2V0LnNvcnQoJTIyaWQlMjIpJTBBc2FtcGxpbmdfcmF0ZSUyMCUzRCUyMGRhdGFzZXQuZmVhdHVyZXMlNUIlMjJhdWRpbyUyMiU1RC5zYW1wbGluZ19yYXRlJTBBJTBBZmVhdHVyZV9leHRyYWN0b3IlMjAlM0QlMjBBdXRvRmVhdHVyZUV4dHJhY3Rvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGd2F2bG0tYmFzZS1wbHVzLXN2JTIyKSUwQW1vZGVsJTIwJTNEJTIwV2F2TE1Gb3JYVmVjdG9yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZ3YXZsbS1iYXNlLXBsdXMtc3YlMjIpJTBBJTBBJTIzJTIwYXVkaW8lMjBmaWxlJTIwaXMlMjBkZWNvZGVkJTIwb24lMjB0aGUlMjBmbHklMEFpbnB1dHMlMjAlM0QlMjBmZWF0dXJlX2V4dHJhY3RvciglMEElMjAlMjAlMjAlMjAlNUJkJTVCJTIyYXJyYXklMjIlNUQlMjBmb3IlMjBkJTIwaW4lMjBkYXRhc2V0JTVCJTNBMiU1RCU1QiUyMmF1ZGlvJTIyJTVEJTVEJTJDJTIwc2FtcGxpbmdfcmF0ZSUzRHNhbXBsaW5nX3JhdGUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTIwcGFkZGluZyUzRFRydWUlMEEpJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGVtYmVkZGluZ3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykuZW1iZWRkaW5ncyUwQSUwQWVtYmVkZGluZ3MlMjAlM0QlMjB0b3JjaC5ubi5mdW5jdGlvbmFsLm5vcm1hbGl6ZShlbWJlZGRpbmdzJTJDJTIwZGltJTNELTEpLmNwdSgpJTBBJTBBJTIzJTIwdGhlJTIwcmVzdWx0aW5nJTIwZW1iZWRkaW5ncyUyMGNhbiUyMGJlJTIwdXNlZCUyMGZvciUyMGNvc2luZSUyMHNpbWlsYXJpdHktYmFzZWQlMjByZXRyaWV2YWwlMEFjb3NpbmVfc2ltJTIwJTNEJTIwdG9yY2gubm4uQ29zaW5lU2ltaWxhcml0eShkaW0lM0QtMSklMEFzaW1pbGFyaXR5JTIwJTNEJTIwY29zaW5lX3NpbShlbWJlZGRpbmdzJTVCMCU1RCUyQyUyMGVtYmVkZGluZ3MlNUIxJTVEKSUwQXRocmVzaG9sZCUyMCUzRCUyMDAuNyUyMCUyMCUyMyUyMHRoZSUyMG9wdGltYWwlMjB0aHJlc2hvbGQlMjBpcyUyMGRhdGFzZXQtZGVwZW5kZW50JTBBaWYlMjBzaW1pbGFyaXR5JTIwJTNDJTIwdGhyZXNob2xkJTNBJTBBJTIwJTIwJTIwJTIwcHJpbnQoJTIyU3BlYWtlcnMlMjBhcmUlMjBub3QlMjB0aGUlMjBzYW1lISUyMiklMEFyb3VuZChzaW1pbGFyaXR5Lml0ZW0oKSUyQyUyMDIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, WavLMForXVector
<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;microsoft/wavlm-base-plus-sv&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = WavLMForXVector.from_pretrained(<span class="hljs-string">&quot;microsoft/wavlm-base-plus-sv&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the resulting embeddings can be used for cosine similarity-based retrieval</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>cosine_sim = torch.nn.CosineSimilarity(dim=-<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>similarity = cosine_sim(embeddings[<span class="hljs-number">0</span>], embeddings[<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>threshold = <span class="hljs-number">0.7</span>  <span class="hljs-comment"># the optimal threshold is dataset-dependent</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">if</span> similarity &lt; threshold:
<span class="hljs-meta">... </span>    <span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Speakers are not the same!&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(similarity.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">0.97</span>`}}),{c(){d=n("p"),b=l("Example:"),f=h(),M(m.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);b=i(p,"Example:"),p.forEach(o),f=u(a),y(m.$$.fragment,a)},m(a,p){v(a,d,p),e(d,b),v(a,f,p),w(m,a,p),_=!0},p:Bt,i(a){_||(T(m.$$.fragment,a),_=!0)},o(a){W(m.$$.fragment,a),_=!1},d(a){a&&o(d),a&&o(f),k(m,a)}}}function xi(j){let d,b,f,m,_,a,p,C,Da,aa,Q,pe,_o,Be,Oa,bo,Ka,na,me,en,Ie,tn,on,sa,zt,an,ra,Nt,Mo,nn,la,Rt,sn,ia,R,ze,rn,St,ln,dn,cn,Ne,pn,qt,mn,hn,un,yo,fn,da,he,gn,Re,vn,_n,ca,S,bn,Se,Mn,yn,qe,wn,Tn,pa,P,ue,wo,Ye,Wn,To,kn,ma,fe,Wo,Yt,jn,Cn,ko,At,Jn,ha,H,ge,jo,Ae,Fn,Co,Ln,ua,$,Qe,$n,D,Un,Qt,Zn,En,Pe,xn,Xn,Gn,O,Vn,Pt,Bn,In,Ht,zn,Nn,Rn,ve,Sn,_e,fa,K,be,Jo,He,qn,Fo,Yn,ga,U,De,An,Oe,Qn,Ke,Pn,Hn,Dn,et,On,Dt,Kn,es,ts,tt,os,ot,as,ns,ss,E,at,rs,ee,ls,Ot,is,ds,Lo,cs,ps,ms,Me,hs,ye,va,te,we,$o,nt,us,Uo,fs,_a,Z,st,gs,oe,vs,Zo,_s,bs,rt,Ms,ys,ws,lt,Ts,Kt,Ws,ks,js,it,Cs,dt,Js,Fs,Ls,x,ct,$s,ae,Us,eo,Zs,Es,Eo,xs,Xs,Gs,Te,Vs,We,ba,ne,ke,xo,pt,Bs,Xo,Is,Ma,J,mt,zs,Go,Ns,Rs,ht,Ss,ut,qs,Ys,As,ft,Qs,to,Ps,Hs,Ds,gt,Os,vt,Ks,er,tr,X,_t,or,se,ar,oo,nr,sr,Vo,rr,lr,ir,je,dr,Ce,ya,re,Je,Bo,bt,cr,Io,pr,wa,F,Mt,mr,zo,hr,ur,yt,fr,wt,gr,vr,_r,Tt,br,ao,Mr,yr,wr,Wt,Tr,kt,Wr,kr,jr,G,jt,Cr,le,Jr,no,Fr,Lr,No,$r,Ur,Zr,Fe,Er,Le,Ta,ie,$e,Ro,Ct,xr,So,Xr,Wa,L,Jt,Gr,qo,Vr,Br,Ft,Ir,Lt,zr,Nr,Rr,$t,Sr,so,qr,Yr,Ar,Ut,Qr,Zt,Pr,Hr,Dr,V,Et,Or,de,Kr,ro,el,tl,Yo,ol,al,nl,Ue,sl,Ze,ka;return a=new ce({}),Be=new ce({}),Ye=new ce({}),Ae=new ce({}),Qe=new N({props:{name:"class transformers.WavLMConfig",anchor:"transformers.WavLMConfig",parameters:[{name:"vocab_size",val:" = 32"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout",val:" = 0.1"},{name:"activation_dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.1"},{name:"feat_proj_dropout",val:" = 0.0"},{name:"final_dropout",val:" = 0.1"},{name:"layerdrop",val:" = 0.1"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"feat_extract_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:"num_buckets",val:" = 320"},{name:"max_bucket_distance",val:" = 800"},{name:"do_stable_layer_norm",val:" = False"},{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:"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:" = 'mean'"},{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:"num_ctc_classes",val:" = 80"},{name:"pad_token_id",val:" = 0"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"add_adapter",val:" = False"},{name:"adapter_kernel_size",val:" = 3"},{name:"adapter_stride",val:" = 2"},{name:"num_adapter_layers",val:" = 3"},{name:"output_hidden_size",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.WavLMConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Vocabulary size of the WavLM 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/wavlm#transformers.WavLMModel">WavLMModel</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/wavlm#transformers.WavLMModel">WavLMModel</a>.`,name:"vocab_size"},{anchor:"transformers.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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/wavlm#transformers.WavLMForCTC">WavLMForCTC</a>.`,name:"final_dropout"},{anchor:"transformers.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.do_stable_layer_norm",description:`<strong>do_stable_layer_norm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to apply <em>stable</em> layer norm architecture of the Transformer encoder. <code>do_stable_layer_norm is True</code> corresponds to applying layer norm before the attention layer, whereas <code>do_stable_layer_norm is False</code> corresponds to applying layer norm after the attention layer.`,name:"do_stable_layer_norm"},{anchor:"transformers.WavLMConfig.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.WavLMConfig.mask_time_prob",description:`<strong>mask_time_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.05) &#x2014;
Propability of each feature vector along the time axis to be chosen as the start of the vector span to be
masked. Approximately <code>mask_time_prob * sequence_length // mask_time_length</code> feature vectors will be masked
along the time axis. This is only relevant if <code>apply_spec_augment is True</code>.`,name:"mask_time_prob"},{anchor:"transformers.WavLMConfig.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.WavLMConfig.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.WavLMConfig.mask_feature_prob",description:`<strong>mask_feature_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Propability of each feature vector along the feature axis to be chosen as the start of the vector span to
be masked. Approximately <code>mask_time_prob * hidden_size // mask_time_length</code> feature vectors will be masked
along the time axis. This is only relevant if <code>apply_spec_augment is True</code>.`,name:"mask_feature_prob"},{anchor:"transformers.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.ctc_loss_reduction",description:`<strong>ctc_loss_reduction</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;mean&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/wavlm#transformers.WavLMForCTC">WavLMForCTC</a>.`,name:"ctc_loss_reduction"},{anchor:"transformers.WavLMConfig.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/wavlm#transformers.WavLMForCTC">WavLMForCTC</a>.`,name:"ctc_zero_infinity"},{anchor:"transformers.WavLMConfig.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/wavlm#transformers.WavLMForSequenceClassification">WavLMForSequenceClassification</a>.`,name:"use_weighted_layer_sum"},{anchor:"transformers.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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 Wav2Vec2 Encoder. Can be very useful for
warm-starting Wav2Vec2 for SpeechEncoderDecoder models.`,name:"add_adapter"},{anchor:"transformers.WavLMConfig.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.WavLMConfig.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.WavLMConfig.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.WavLMConfig.output_hidden_size",description:`<strong>output_hidden_size</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Dimensionality of the encoder output layer. If not defined, this defaults to <em>hidden-size</em>. Only relevant
if <code>add_adapter is True</code>.`,name:"output_hidden_size"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/wavlm/configuration_wavlm.py#L32"}}),ve=new Vt({props:{anchor:"transformers.WavLMConfig.example",$$slots:{default:[Ti]},$$scope:{ctx:j}}}),_e=new Vt({props:{anchor:"transformers.WavLMConfig.example-2",$$slots:{default:[Wi]},$$scope:{ctx:j}}}),He=new ce({}),De=new N({props:{name:"class transformers.WavLMModel",anchor:"transformers.WavLMModel",parameters:[{name:"config",val:": WavLMConfig"}],parametersDescription:[{anchor:"transformers.WavLMModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/wavlm#transformers.WavLMConfig">WavLMConfig</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/wavlm/modeling_wavlm.py#L1121"}}),at=new N({props:{name:"forward",anchor:"transformers.WavLMModel.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.WavLMModel.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.WavLMModel.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>, <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.WavLMModel.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.WavLMModel.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.WavLMModel.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/wavlm/modeling_wavlm.py#L1207",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/wavlm#transformers.WavLMConfig"
>WavLMConfig</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>
`}}),Me=new oa({props:{$$slots:{default:[ki]},$$scope:{ctx:j}}}),ye=new Vt({props:{anchor:"transformers.WavLMModel.forward.example",$$slots:{default:[ji]},$$scope:{ctx:j}}}),nt=new ce({}),st=new N({props:{name:"class transformers.WavLMForCTC",anchor:"transformers.WavLMForCTC",parameters:[{name:"config",val:""},{name:"target_lang",val:": typing.Optional[str] = None"}],parametersDescription:[{anchor:"transformers.WavLMForCTC.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/wavlm#transformers.WavLMConfig">WavLMConfig</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/wavlm/modeling_wavlm.py#L1273"}}),ct=new N({props:{name:"forward",anchor:"transformers.WavLMForCTC.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.WavLMForCTC.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.WavLMForCTC.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>, <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.WavLMForCTC.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.WavLMForCTC.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.WavLMForCTC.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.WavLMForCTC.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/wavlm/modeling_wavlm.py#L1345",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/wavlm#transformers.WavLMConfig"
>WavLMConfig</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>
`}}),Te=new oa({props:{$$slots:{default:[Ci]},$$scope:{ctx:j}}}),We=new Vt({props:{anchor:"transformers.WavLMForCTC.forward.example",$$slots:{default:[Ji]},$$scope:{ctx:j}}}),pt=new ce({}),mt=new N({props:{name:"class transformers.WavLMForSequenceClassification",anchor:"transformers.WavLMForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.WavLMForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/wavlm#transformers.WavLMConfig">WavLMConfig</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/wavlm/modeling_wavlm.py#L1432"}}),_t=new N({props:{name:"forward",anchor:"transformers.WavLMForSequenceClassification.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.WavLMForSequenceClassification.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.WavLMForSequenceClassification.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>, <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.WavLMForSequenceClassification.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.WavLMForSequenceClassification.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.WavLMForSequenceClassification.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.WavLMForSequenceClassification.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/wavlm/modeling_wavlm.py#L1480",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/wavlm#transformers.WavLMConfig"
>WavLMConfig</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>
`}}),je=new oa({props:{$$slots:{default:[Fi]},$$scope:{ctx:j}}}),Ce=new Vt({props:{anchor:"transformers.WavLMForSequenceClassification.forward.example",$$slots:{default:[Li]},$$scope:{ctx:j}}}),bt=new ce({}),Mt=new N({props:{name:"class transformers.WavLMForAudioFrameClassification",anchor:"transformers.WavLMForAudioFrameClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.WavLMForAudioFrameClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/wavlm#transformers.WavLMConfig">WavLMConfig</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/wavlm/modeling_wavlm.py#L1557"}}),jt=new N({props:{name:"forward",anchor:"transformers.WavLMForAudioFrameClassification.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.WavLMForAudioFrameClassification.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.WavLMForAudioFrameClassification.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>, <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.WavLMForAudioFrameClassification.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.WavLMForAudioFrameClassification.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.WavLMForAudioFrameClassification.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.WavLMForAudioFrameClassification.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/wavlm/modeling_wavlm.py#L1601",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/wavlm#transformers.WavLMConfig"
>WavLMConfig</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>
`}}),Fe=new oa({props:{$$slots:{default:[$i]},$$scope:{ctx:j}}}),Le=new Vt({props:{anchor:"transformers.WavLMForAudioFrameClassification.forward.example",$$slots:{default:[Ui]},$$scope:{ctx:j}}}),Ct=new ce({}),Jt=new N({props:{name:"class transformers.WavLMForXVector",anchor:"transformers.WavLMForXVector",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.WavLMForXVector.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/wavlm#transformers.WavLMConfig">WavLMConfig</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/wavlm/modeling_wavlm.py#L1721"}}),Et=new N({props:{name:"forward",anchor:"transformers.WavLMForXVector.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.WavLMForXVector.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.WavLMForXVector.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>, <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.WavLMForXVector.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.WavLMForXVector.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.WavLMForXVector.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.WavLMForXVector.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/wavlm/modeling_wavlm.py#L1783",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/wavlm#transformers.WavLMConfig"
>WavLMConfig</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>
`}}),Ue=new oa({props:{$$slots:{default:[Zi]},$$scope:{ctx:j}}}),Ze=new Vt({props:{anchor:"transformers.WavLMForXVector.forward.example",$$slots:{default:[Ei]},$$scope:{ctx:j}}}),{c(){d=n("meta"),b=h(),f=n("h1"),m=n("a"),_=n("span"),M(a.$$.fragment),p=h(),C=n("span"),Da=l("WavLM"),aa=h(),Q=n("h2"),pe=n("a"),_o=n("span"),M(Be.$$.fragment),Oa=h(),bo=n("span"),Ka=l("Overview"),na=h(),me=n("p"),en=l("The WavLM model was proposed in "),Ie=n("a"),tn=l("WavLM: Large-Scale Self-Supervised Pre-Training for Full Stack Speech Processing"),on=l(` by Sanyuan Chen, Chengyi Wang, Zhengyang Chen, Yu Wu, Shujie Liu, Zhuo Chen,
Jinyu Li, Naoyuki Kanda, Takuya Yoshioka, Xiong Xiao, Jian Wu, Long Zhou, Shuo Ren, Yanmin Qian, Yao Qian, Jian Wu,
Michael Zeng, Furu Wei.`),sa=h(),zt=n("p"),an=l("The abstract from the paper is the following:"),ra=h(),Nt=n("p"),Mo=n("em"),nn=l(`Self-supervised learning (SSL) achieves great success in speech recognition, while limited exploration has been
attempted for other speech processing tasks. As speech signal contains multi-faceted information including speaker
identity, paralinguistics, spoken content, etc., learning universal representations for all speech tasks is
challenging. In this paper, we propose a new pre-trained model, WavLM, to solve full-stack downstream speech tasks.
WavLM is built based on the HuBERT framework, with an emphasis on both spoken content modeling and speaker identity
preservation. We first equip the Transformer structure with gated relative position bias to improve its capability on
recognition tasks. For better speaker discrimination, we propose an utterance mixing training strategy, where
additional overlapped utterances are created unsupervisely and incorporated during model training. Lastly, we scale up
the training dataset from 60k hours to 94k hours. WavLM Large achieves state-of-the-art performance on the SUPERB
benchmark, and brings significant improvements for various speech processing tasks on their representative benchmarks.`),la=h(),Rt=n("p"),sn=l("Tips:"),ia=h(),R=n("ul"),ze=n("li"),rn=l(`WavLM is a speech model that accepts a float array corresponding to the raw waveform of the speech signal. Please use
`),St=n("a"),ln=l("Wav2Vec2Processor"),dn=l(" for the feature extraction."),cn=h(),Ne=n("li"),pn=l(`WavLM model can be fine-tuned using connectionist temporal classification (CTC) so the model output has to be decoded
using `),qt=n("a"),mn=l("Wav2Vec2CTCTokenizer"),hn=l("."),un=h(),yo=n("li"),fn=l("WavLM performs especially well on speaker verification, speaker identification, and speaker diarization tasks."),da=h(),he=n("p"),gn=l("Relevant checkpoints can be found under "),Re=n("a"),vn=l("https://huggingface.co/models?other=wavlm"),_n=l("."),ca=h(),S=n("p"),bn=l("This model was contributed by "),Se=n("a"),Mn=l("patrickvonplaten"),yn=l(`. The Authors\u2019 code can be
found `),qe=n("a"),wn=l("here"),Tn=l("."),pa=h(),P=n("h2"),ue=n("a"),wo=n("span"),M(Ye.$$.fragment),Wn=h(),To=n("span"),kn=l("Documentation resources"),ma=h(),fe=n("ul"),Wo=n("li"),Yt=n("a"),jn=l("Audio classification task guide"),Cn=h(),ko=n("li"),At=n("a"),Jn=l("Automatic speech recognition task guide"),ha=h(),H=n("h2"),ge=n("a"),jo=n("span"),M(Ae.$$.fragment),Fn=h(),Co=n("span"),Ln=l("WavLMConfig"),ua=h(),$=n("div"),M(Qe.$$.fragment),$n=h(),D=n("p"),Un=l("This is the configuration class to store the configuration of a "),Qt=n("a"),Zn=l("WavLMModel"),En=l(`. It is used to instantiate an WavLM
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 WavLM
`),Pe=n("a"),xn=l("microsoft/wavlm-base"),Xn=l(" architecture."),Gn=h(),O=n("p"),Vn=l("Configuration objects inherit from "),Pt=n("a"),Bn=l("PretrainedConfig"),In=l(` and can be used to control the model outputs. Read the
documentation from `),Ht=n("a"),zn=l("PretrainedConfig"),Nn=l(" for more information."),Rn=h(),M(ve.$$.fragment),Sn=h(),M(_e.$$.fragment),fa=h(),K=n("h2"),be=n("a"),Jo=n("span"),M(He.$$.fragment),qn=h(),Fo=n("span"),Yn=l("WavLMModel"),ga=h(),U=n("div"),M(De.$$.fragment),An=h(),Oe=n("p"),Qn=l(`The bare WavLM Model transformer outputting raw hidden-states without any specific head on top.
WavLM was proposed in `),Ke=n("a"),Pn=l(`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),Hn=l(` by Chengyi Wang, Yu Wu, Yao Qian, Kenichi Kumatani, Shujie Liu, Furu Wei,
Michael Zeng, Xuedong Huang.`),Dn=h(),et=n("p"),On=l("This model inherits from "),Dt=n("a"),Kn=l("PreTrainedModel"),es=l(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),ts=h(),tt=n("p"),os=l("This model is a PyTorch "),ot=n("a"),as=l("torch.nn.Module"),ns=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ss=h(),E=n("div"),M(at.$$.fragment),rs=h(),ee=n("p"),ls=l("The "),Ot=n("a"),is=l("WavLMModel"),ds=l(" forward method, overrides the "),Lo=n("code"),cs=l("__call__"),ps=l(" special method."),ms=h(),M(Me.$$.fragment),hs=h(),M(ye.$$.fragment),va=h(),te=n("h2"),we=n("a"),$o=n("span"),M(nt.$$.fragment),us=h(),Uo=n("span"),fs=l("WavLMForCTC"),_a=h(),Z=n("div"),M(st.$$.fragment),gs=h(),oe=n("p"),vs=l("WavLM Model with a "),Zo=n("code"),_s=l("language modeling"),bs=l(` head on top for Connectionist Temporal Classification (CTC).
WavLM was proposed in `),rt=n("a"),Ms=l(`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),ys=l(` by Chengyi Wang, Yu Wu, Yao Qian, Kenichi Kumatani, Shujie Liu, Furu Wei,
Michael Zeng, Xuedong Huang.`),ws=h(),lt=n("p"),Ts=l("This model inherits from "),Kt=n("a"),Ws=l("PreTrainedModel"),ks=l(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),js=h(),it=n("p"),Cs=l("This model is a PyTorch "),dt=n("a"),Js=l("torch.nn.Module"),Fs=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ls=h(),x=n("div"),M(ct.$$.fragment),$s=h(),ae=n("p"),Us=l("The "),eo=n("a"),Zs=l("WavLMForCTC"),Es=l(" forward method, overrides the "),Eo=n("code"),xs=l("__call__"),Xs=l(" special method."),Gs=h(),M(Te.$$.fragment),Vs=h(),M(We.$$.fragment),ba=h(),ne=n("h2"),ke=n("a"),xo=n("span"),M(pt.$$.fragment),Bs=h(),Xo=n("span"),Is=l("WavLMForSequenceClassification"),Ma=h(),J=n("div"),M(mt.$$.fragment),zs=h(),Go=n("p"),Ns=l(`WavLM Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like
SUPERB Keyword Spotting.`),Rs=h(),ht=n("p"),Ss=l("WavLM was proposed in "),ut=n("a"),qs=l(`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),Ys=l(` by Chengyi Wang, Yu Wu, Yao Qian, Kenichi Kumatani, Shujie Liu, Furu Wei,
Michael Zeng, Xuedong Huang.`),As=h(),ft=n("p"),Qs=l("This model inherits from "),to=n("a"),Ps=l("PreTrainedModel"),Hs=l(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Ds=h(),gt=n("p"),Os=l("This model is a PyTorch "),vt=n("a"),Ks=l("torch.nn.Module"),er=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),tr=h(),X=n("div"),M(_t.$$.fragment),or=h(),se=n("p"),ar=l("The "),oo=n("a"),nr=l("WavLMForSequenceClassification"),sr=l(" forward method, overrides the "),Vo=n("code"),rr=l("__call__"),lr=l(" special method."),ir=h(),M(je.$$.fragment),dr=h(),M(Ce.$$.fragment),ya=h(),re=n("h2"),Je=n("a"),Bo=n("span"),M(bt.$$.fragment),cr=h(),Io=n("span"),pr=l("WavLMForAudioFrameClassification"),wa=h(),F=n("div"),M(Mt.$$.fragment),mr=h(),zo=n("p"),hr=l("WavLM Model with a frame classification head on top for tasks like Speaker Diarization."),ur=h(),yt=n("p"),fr=l("WavLM was proposed in "),wt=n("a"),gr=l(`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),vr=l(` by Chengyi Wang, Yu Wu, Yao Qian, Kenichi Kumatani, Shujie Liu, Furu Wei,
Michael Zeng, Xuedong Huang.`),_r=h(),Tt=n("p"),br=l("This model inherits from "),ao=n("a"),Mr=l("PreTrainedModel"),yr=l(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),wr=h(),Wt=n("p"),Tr=l("This model is a PyTorch "),kt=n("a"),Wr=l("torch.nn.Module"),kr=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),jr=h(),G=n("div"),M(jt.$$.fragment),Cr=h(),le=n("p"),Jr=l("The "),no=n("a"),Fr=l("WavLMForAudioFrameClassification"),Lr=l(" forward method, overrides the "),No=n("code"),$r=l("__call__"),Ur=l(" special method."),Zr=h(),M(Fe.$$.fragment),Er=h(),M(Le.$$.fragment),Ta=h(),ie=n("h2"),$e=n("a"),Ro=n("span"),M(Ct.$$.fragment),xr=h(),So=n("span"),Xr=l("WavLMForXVector"),Wa=h(),L=n("div"),M(Jt.$$.fragment),Gr=h(),qo=n("p"),Vr=l("WavLM Model with an XVector feature extraction head on top for tasks like Speaker Verification."),Br=h(),Ft=n("p"),Ir=l("WavLM was proposed in "),Lt=n("a"),zr=l(`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),Nr=l(` by Chengyi Wang, Yu Wu, Yao Qian, Kenichi Kumatani, Shujie Liu, Furu Wei,
Michael Zeng, Xuedong Huang.`),Rr=h(),$t=n("p"),Sr=l("This model inherits from "),so=n("a"),qr=l("PreTrainedModel"),Yr=l(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Ar=h(),Ut=n("p"),Qr=l("This model is a PyTorch "),Zt=n("a"),Pr=l("torch.nn.Module"),Hr=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Dr=h(),V=n("div"),M(Et.$$.fragment),Or=h(),de=n("p"),Kr=l("The "),ro=n("a"),el=l("WavLMForXVector"),tl=l(" forward method, overrides the "),Yo=n("code"),ol=l("__call__"),al=l(" special method."),nl=h(),M(Ue.$$.fragment),sl=h(),M(Ze.$$.fragment),this.h()},l(t){const g=yi('[data-svelte="svelte-1phssyn"]',document.head);d=s(g,"META",{name:!0,content:!0}),g.forEach(o),b=u(t),f=s(t,"H1",{class:!0});var xt=r(f);m=s(xt,"A",{id:!0,class:!0,href:!0});var Ao=r(m);_=s(Ao,"SPAN",{});var Qo=r(_);y(a.$$.fragment,Qo),Qo.forEach(o),Ao.forEach(o),p=u(xt),C=s(xt,"SPAN",{});var Po=r(C);Da=i(Po,"WavLM"),Po.forEach(o),xt.forEach(o),aa=u(t),Q=s(t,"H2",{class:!0});var Xt=r(Q);pe=s(Xt,"A",{id:!0,class:!0,href:!0});var Ho=r(pe);_o=s(Ho,"SPAN",{});var Do=r(_o);y(Be.$$.fragment,Do),Do.forEach(o),Ho.forEach(o),Oa=u(Xt),bo=s(Xt,"SPAN",{});var Oo=r(bo);Ka=i(Oo,"Overview"),Oo.forEach(o),Xt.forEach(o),na=u(t),me=s(t,"P",{});var Gt=r(me);en=i(Gt,"The WavLM model was proposed in "),Ie=s(Gt,"A",{href:!0,rel:!0});var Ko=r(Ie);tn=i(Ko,"WavLM: Large-Scale Self-Supervised Pre-Training for Full Stack Speech Processing"),Ko.forEach(o),on=i(Gt,` by Sanyuan Chen, Chengyi Wang, Zhengyang Chen, Yu Wu, Shujie Liu, Zhuo Chen,
Jinyu Li, Naoyuki Kanda, Takuya Yoshioka, Xiong Xiao, Jian Wu, Long Zhou, Shuo Ren, Yanmin Qian, Yao Qian, Jian Wu,
Michael Zeng, Furu Wei.`),Gt.forEach(o),sa=u(t),zt=s(t,"P",{});var ea=r(zt);an=i(ea,"The abstract from the paper is the following:"),ea.forEach(o),ra=u(t),Nt=s(t,"P",{});var ta=r(Nt);Mo=s(ta,"EM",{});var rl=r(Mo);nn=i(rl,`Self-supervised learning (SSL) achieves great success in speech recognition, while limited exploration has been
attempted for other speech processing tasks. As speech signal contains multi-faceted information including speaker
identity, paralinguistics, spoken content, etc., learning universal representations for all speech tasks is
challenging. In this paper, we propose a new pre-trained model, WavLM, to solve full-stack downstream speech tasks.
WavLM is built based on the HuBERT framework, with an emphasis on both spoken content modeling and speaker identity
preservation. We first equip the Transformer structure with gated relative position bias to improve its capability on
recognition tasks. For better speaker discrimination, we propose an utterance mixing training strategy, where
additional overlapped utterances are created unsupervisely and incorporated during model training. Lastly, we scale up
the training dataset from 60k hours to 94k hours. WavLM Large achieves state-of-the-art performance on the SUPERB
benchmark, and brings significant improvements for various speech processing tasks on their representative benchmarks.`),rl.forEach(o),ta.forEach(o),la=u(t),Rt=s(t,"P",{});var ll=r(Rt);sn=i(ll,"Tips:"),ll.forEach(o),ia=u(t),R=s(t,"UL",{});var lo=r(R);ze=s(lo,"LI",{});var ja=r(ze);rn=i(ja,`WavLM is a speech model that accepts a float array corresponding to the raw waveform of the speech signal. Please use
`),St=s(ja,"A",{href:!0});var il=r(St);ln=i(il,"Wav2Vec2Processor"),il.forEach(o),dn=i(ja," for the feature extraction."),ja.forEach(o),cn=u(lo),Ne=s(lo,"LI",{});var Ca=r(Ne);pn=i(Ca,`WavLM model can be fine-tuned using connectionist temporal classification (CTC) so the model output has to be decoded
using `),qt=s(Ca,"A",{href:!0});var dl=r(qt);mn=i(dl,"Wav2Vec2CTCTokenizer"),dl.forEach(o),hn=i(Ca,"."),Ca.forEach(o),un=u(lo),yo=s(lo,"LI",{});var cl=r(yo);fn=i(cl,"WavLM performs especially well on speaker verification, speaker identification, and speaker diarization tasks."),cl.forEach(o),lo.forEach(o),da=u(t),he=s(t,"P",{});var Ja=r(he);gn=i(Ja,"Relevant checkpoints can be found under "),Re=s(Ja,"A",{href:!0,rel:!0});var pl=r(Re);vn=i(pl,"https://huggingface.co/models?other=wavlm"),pl.forEach(o),_n=i(Ja,"."),Ja.forEach(o),ca=u(t),S=s(t,"P",{});var io=r(S);bn=i(io,"This model was contributed by "),Se=s(io,"A",{href:!0,rel:!0});var ml=r(Se);Mn=i(ml,"patrickvonplaten"),ml.forEach(o),yn=i(io,`. The Authors\u2019 code can be
found `),qe=s(io,"A",{href:!0,rel:!0});var hl=r(qe);wn=i(hl,"here"),hl.forEach(o),Tn=i(io,"."),io.forEach(o),pa=u(t),P=s(t,"H2",{class:!0});var Fa=r(P);ue=s(Fa,"A",{id:!0,class:!0,href:!0});var ul=r(ue);wo=s(ul,"SPAN",{});var fl=r(wo);y(Ye.$$.fragment,fl),fl.forEach(o),ul.forEach(o),Wn=u(Fa),To=s(Fa,"SPAN",{});var gl=r(To);kn=i(gl,"Documentation resources"),gl.forEach(o),Fa.forEach(o),ma=u(t),fe=s(t,"UL",{});var La=r(fe);Wo=s(La,"LI",{});var vl=r(Wo);Yt=s(vl,"A",{href:!0});var _l=r(Yt);jn=i(_l,"Audio classification task guide"),_l.forEach(o),vl.forEach(o),Cn=u(La),ko=s(La,"LI",{});var bl=r(ko);At=s(bl,"A",{href:!0});var Ml=r(At);Jn=i(Ml,"Automatic speech recognition task guide"),Ml.forEach(o),bl.forEach(o),La.forEach(o),ha=u(t),H=s(t,"H2",{class:!0});var $a=r(H);ge=s($a,"A",{id:!0,class:!0,href:!0});var yl=r(ge);jo=s(yl,"SPAN",{});var wl=r(jo);y(Ae.$$.fragment,wl),wl.forEach(o),yl.forEach(o),Fn=u($a),Co=s($a,"SPAN",{});var Tl=r(Co);Ln=i(Tl,"WavLMConfig"),Tl.forEach(o),$a.forEach(o),ua=u(t),$=s(t,"DIV",{class:!0});var q=r($);y(Qe.$$.fragment,q),$n=u(q),D=s(q,"P",{});var co=r(D);Un=i(co,"This is the configuration class to store the configuration of a "),Qt=s(co,"A",{href:!0});var Wl=r(Qt);Zn=i(Wl,"WavLMModel"),Wl.forEach(o),En=i(co,`. It is used to instantiate an WavLM
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 WavLM
`),Pe=s(co,"A",{href:!0,rel:!0});var kl=r(Pe);xn=i(kl,"microsoft/wavlm-base"),kl.forEach(o),Xn=i(co," architecture."),co.forEach(o),Gn=u(q),O=s(q,"P",{});var po=r(O);Vn=i(po,"Configuration objects inherit from "),Pt=s(po,"A",{href:!0});var jl=r(Pt);Bn=i(jl,"PretrainedConfig"),jl.forEach(o),In=i(po,` and can be used to control the model outputs. Read the
documentation from `),Ht=s(po,"A",{href:!0});var Cl=r(Ht);zn=i(Cl,"PretrainedConfig"),Cl.forEach(o),Nn=i(po," for more information."),po.forEach(o),Rn=u(q),y(ve.$$.fragment,q),Sn=u(q),y(_e.$$.fragment,q),q.forEach(o),fa=u(t),K=s(t,"H2",{class:!0});var Ua=r(K);be=s(Ua,"A",{id:!0,class:!0,href:!0});var Jl=r(be);Jo=s(Jl,"SPAN",{});var Fl=r(Jo);y(He.$$.fragment,Fl),Fl.forEach(o),Jl.forEach(o),qn=u(Ua),Fo=s(Ua,"SPAN",{});var Ll=r(Fo);Yn=i(Ll,"WavLMModel"),Ll.forEach(o),Ua.forEach(o),ga=u(t),U=s(t,"DIV",{class:!0});var Y=r(U);y(De.$$.fragment,Y),An=u(Y),Oe=s(Y,"P",{});var Za=r(Oe);Qn=i(Za,`The bare WavLM Model transformer outputting raw hidden-states without any specific head on top.
WavLM was proposed in `),Ke=s(Za,"A",{href:!0,rel:!0});var $l=r(Ke);Pn=i($l,`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),$l.forEach(o),Hn=i(Za,` by Chengyi Wang, Yu Wu, Yao Qian, Kenichi Kumatani, Shujie Liu, Furu Wei,
Michael Zeng, Xuedong Huang.`),Za.forEach(o),Dn=u(Y),et=s(Y,"P",{});var Ea=r(et);On=i(Ea,"This model inherits from "),Dt=s(Ea,"A",{href:!0});var Ul=r(Dt);Kn=i(Ul,"PreTrainedModel"),Ul.forEach(o),es=i(Ea,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Ea.forEach(o),ts=u(Y),tt=s(Y,"P",{});var xa=r(tt);os=i(xa,"This model is a PyTorch "),ot=s(xa,"A",{href:!0,rel:!0});var Zl=r(ot);as=i(Zl,"torch.nn.Module"),Zl.forEach(o),ns=i(xa,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),xa.forEach(o),ss=u(Y),E=s(Y,"DIV",{class:!0});var Ee=r(E);y(at.$$.fragment,Ee),rs=u(Ee),ee=s(Ee,"P",{});var mo=r(ee);ls=i(mo,"The "),Ot=s(mo,"A",{href:!0});var El=r(Ot);is=i(El,"WavLMModel"),El.forEach(o),ds=i(mo," forward method, overrides the "),Lo=s(mo,"CODE",{});var xl=r(Lo);cs=i(xl,"__call__"),xl.forEach(o),ps=i(mo," special method."),mo.forEach(o),ms=u(Ee),y(Me.$$.fragment,Ee),hs=u(Ee),y(ye.$$.fragment,Ee),Ee.forEach(o),Y.forEach(o),va=u(t),te=s(t,"H2",{class:!0});var Xa=r(te);we=s(Xa,"A",{id:!0,class:!0,href:!0});var Xl=r(we);$o=s(Xl,"SPAN",{});var Gl=r($o);y(nt.$$.fragment,Gl),Gl.forEach(o),Xl.forEach(o),us=u(Xa),Uo=s(Xa,"SPAN",{});var Vl=r(Uo);fs=i(Vl,"WavLMForCTC"),Vl.forEach(o),Xa.forEach(o),_a=u(t),Z=s(t,"DIV",{class:!0});var A=r(Z);y(st.$$.fragment,A),gs=u(A),oe=s(A,"P",{});var ho=r(oe);vs=i(ho,"WavLM Model with a "),Zo=s(ho,"CODE",{});var Bl=r(Zo);_s=i(Bl,"language modeling"),Bl.forEach(o),bs=i(ho,` head on top for Connectionist Temporal Classification (CTC).
WavLM was proposed in `),rt=s(ho,"A",{href:!0,rel:!0});var Il=r(rt);Ms=i(Il,`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),Il.forEach(o),ys=i(ho,` by Chengyi Wang, Yu Wu, Yao Qian, Kenichi Kumatani, Shujie Liu, Furu Wei,
Michael Zeng, Xuedong Huang.`),ho.forEach(o),ws=u(A),lt=s(A,"P",{});var Ga=r(lt);Ts=i(Ga,"This model inherits from "),Kt=s(Ga,"A",{href:!0});var zl=r(Kt);Ws=i(zl,"PreTrainedModel"),zl.forEach(o),ks=i(Ga,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Ga.forEach(o),js=u(A),it=s(A,"P",{});var Va=r(it);Cs=i(Va,"This model is a PyTorch "),dt=s(Va,"A",{href:!0,rel:!0});var Nl=r(dt);Js=i(Nl,"torch.nn.Module"),Nl.forEach(o),Fs=i(Va,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Va.forEach(o),Ls=u(A),x=s(A,"DIV",{class:!0});var xe=r(x);y(ct.$$.fragment,xe),$s=u(xe),ae=s(xe,"P",{});var uo=r(ae);Us=i(uo,"The "),eo=s(uo,"A",{href:!0});var Rl=r(eo);Zs=i(Rl,"WavLMForCTC"),Rl.forEach(o),Es=i(uo," forward method, overrides the "),Eo=s(uo,"CODE",{});var Sl=r(Eo);xs=i(Sl,"__call__"),Sl.forEach(o),Xs=i(uo," special method."),uo.forEach(o),Gs=u(xe),y(Te.$$.fragment,xe),Vs=u(xe),y(We.$$.fragment,xe),xe.forEach(o),A.forEach(o),ba=u(t),ne=s(t,"H2",{class:!0});var Ba=r(ne);ke=s(Ba,"A",{id:!0,class:!0,href:!0});var ql=r(ke);xo=s(ql,"SPAN",{});var Yl=r(xo);y(pt.$$.fragment,Yl),Yl.forEach(o),ql.forEach(o),Bs=u(Ba),Xo=s(Ba,"SPAN",{});var Al=r(Xo);Is=i(Al,"WavLMForSequenceClassification"),Al.forEach(o),Ba.forEach(o),Ma=u(t),J=s(t,"DIV",{class:!0});var B=r(J);y(mt.$$.fragment,B),zs=u(B),Go=s(B,"P",{});var Ql=r(Go);Ns=i(Ql,`WavLM Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like
SUPERB Keyword Spotting.`),Ql.forEach(o),Rs=u(B),ht=s(B,"P",{});var Ia=r(ht);Ss=i(Ia,"WavLM was proposed in "),ut=s(Ia,"A",{href:!0,rel:!0});var Pl=r(ut);qs=i(Pl,`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),Pl.forEach(o),Ys=i(Ia,` by Chengyi Wang, Yu Wu, Yao Qian, Kenichi Kumatani, Shujie Liu, Furu Wei,
Michael Zeng, Xuedong Huang.`),Ia.forEach(o),As=u(B),ft=s(B,"P",{});var za=r(ft);Qs=i(za,"This model inherits from "),to=s(za,"A",{href:!0});var Hl=r(to);Ps=i(Hl,"PreTrainedModel"),Hl.forEach(o),Hs=i(za,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),za.forEach(o),Ds=u(B),gt=s(B,"P",{});var Na=r(gt);Os=i(Na,"This model is a PyTorch "),vt=s(Na,"A",{href:!0,rel:!0});var Dl=r(vt);Ks=i(Dl,"torch.nn.Module"),Dl.forEach(o),er=i(Na,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Na.forEach(o),tr=u(B),X=s(B,"DIV",{class:!0});var Xe=r(X);y(_t.$$.fragment,Xe),or=u(Xe),se=s(Xe,"P",{});var fo=r(se);ar=i(fo,"The "),oo=s(fo,"A",{href:!0});var Ol=r(oo);nr=i(Ol,"WavLMForSequenceClassification"),Ol.forEach(o),sr=i(fo," forward method, overrides the "),Vo=s(fo,"CODE",{});var Kl=r(Vo);rr=i(Kl,"__call__"),Kl.forEach(o),lr=i(fo," special method."),fo.forEach(o),ir=u(Xe),y(je.$$.fragment,Xe),dr=u(Xe),y(Ce.$$.fragment,Xe),Xe.forEach(o),B.forEach(o),ya=u(t),re=s(t,"H2",{class:!0});var Ra=r(re);Je=s(Ra,"A",{id:!0,class:!0,href:!0});var ei=r(Je);Bo=s(ei,"SPAN",{});var ti=r(Bo);y(bt.$$.fragment,ti),ti.forEach(o),ei.forEach(o),cr=u(Ra),Io=s(Ra,"SPAN",{});var oi=r(Io);pr=i(oi,"WavLMForAudioFrameClassification"),oi.forEach(o),Ra.forEach(o),wa=u(t),F=s(t,"DIV",{class:!0});var I=r(F);y(Mt.$$.fragment,I),mr=u(I),zo=s(I,"P",{});var ai=r(zo);hr=i(ai,"WavLM Model with a frame classification head on top for tasks like Speaker Diarization."),ai.forEach(o),ur=u(I),yt=s(I,"P",{});var Sa=r(yt);fr=i(Sa,"WavLM was proposed in "),wt=s(Sa,"A",{href:!0,rel:!0});var ni=r(wt);gr=i(ni,`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),ni.forEach(o),vr=i(Sa,` by Chengyi Wang, Yu Wu, Yao Qian, Kenichi Kumatani, Shujie Liu, Furu Wei,
Michael Zeng, Xuedong Huang.`),Sa.forEach(o),_r=u(I),Tt=s(I,"P",{});var qa=r(Tt);br=i(qa,"This model inherits from "),ao=s(qa,"A",{href:!0});var si=r(ao);Mr=i(si,"PreTrainedModel"),si.forEach(o),yr=i(qa,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),qa.forEach(o),wr=u(I),Wt=s(I,"P",{});var Ya=r(Wt);Tr=i(Ya,"This model is a PyTorch "),kt=s(Ya,"A",{href:!0,rel:!0});var ri=r(kt);Wr=i(ri,"torch.nn.Module"),ri.forEach(o),kr=i(Ya,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ya.forEach(o),jr=u(I),G=s(I,"DIV",{class:!0});var Ge=r(G);y(jt.$$.fragment,Ge),Cr=u(Ge),le=s(Ge,"P",{});var go=r(le);Jr=i(go,"The "),no=s(go,"A",{href:!0});var li=r(no);Fr=i(li,"WavLMForAudioFrameClassification"),li.forEach(o),Lr=i(go," forward method, overrides the "),No=s(go,"CODE",{});var ii=r(No);$r=i(ii,"__call__"),ii.forEach(o),Ur=i(go," special method."),go.forEach(o),Zr=u(Ge),y(Fe.$$.fragment,Ge),Er=u(Ge),y(Le.$$.fragment,Ge),Ge.forEach(o),I.forEach(o),Ta=u(t),ie=s(t,"H2",{class:!0});var Aa=r(ie);$e=s(Aa,"A",{id:!0,class:!0,href:!0});var di=r($e);Ro=s(di,"SPAN",{});var ci=r(Ro);y(Ct.$$.fragment,ci),ci.forEach(o),di.forEach(o),xr=u(Aa),So=s(Aa,"SPAN",{});var pi=r(So);Xr=i(pi,"WavLMForXVector"),pi.forEach(o),Aa.forEach(o),Wa=u(t),L=s(t,"DIV",{class:!0});var z=r(L);y(Jt.$$.fragment,z),Gr=u(z),qo=s(z,"P",{});var mi=r(qo);Vr=i(mi,"WavLM Model with an XVector feature extraction head on top for tasks like Speaker Verification."),mi.forEach(o),Br=u(z),Ft=s(z,"P",{});var Qa=r(Ft);Ir=i(Qa,"WavLM was proposed in "),Lt=s(Qa,"A",{href:!0,rel:!0});var hi=r(Lt);zr=i(hi,`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),hi.forEach(o),Nr=i(Qa,` by Chengyi Wang, Yu Wu, Yao Qian, Kenichi Kumatani, Shujie Liu, Furu Wei,
Michael Zeng, Xuedong Huang.`),Qa.forEach(o),Rr=u(z),$t=s(z,"P",{});var Pa=r($t);Sr=i(Pa,"This model inherits from "),so=s(Pa,"A",{href:!0});var ui=r(so);qr=i(ui,"PreTrainedModel"),ui.forEach(o),Yr=i(Pa,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Pa.forEach(o),Ar=u(z),Ut=s(z,"P",{});var Ha=r(Ut);Qr=i(Ha,"This model is a PyTorch "),Zt=s(Ha,"A",{href:!0,rel:!0});var fi=r(Zt);Pr=i(fi,"torch.nn.Module"),fi.forEach(o),Hr=i(Ha,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ha.forEach(o),Dr=u(z),V=s(z,"DIV",{class:!0});var Ve=r(V);y(Et.$$.fragment,Ve),Or=u(Ve),de=s(Ve,"P",{});var vo=r(de);Kr=i(vo,"The "),ro=s(vo,"A",{href:!0});var gi=r(ro);el=i(gi,"WavLMForXVector"),gi.forEach(o),tl=i(vo," forward method, overrides the "),Yo=s(vo,"CODE",{});var vi=r(Yo);ol=i(vi,"__call__"),vi.forEach(o),al=i(vo," special method."),vo.forEach(o),nl=u(Ve),y(Ue.$$.fragment,Ve),sl=u(Ve),y(Ze.$$.fragment,Ve),Ve.forEach(o),z.forEach(o),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(Xi)),c(m,"id","wavlm"),c(m,"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(m,"href","#wavlm"),c(f,"class","relative group"),c(pe,"id","overview"),c(pe,"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(pe,"href","#overview"),c(Q,"class","relative group"),c(Ie,"href","https://arxiv.org/abs/2110.13900"),c(Ie,"rel","nofollow"),c(St,"href","/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor"),c(qt,"href","/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer"),c(Re,"href","https://huggingface.co/models?other=wavlm"),c(Re,"rel","nofollow"),c(Se,"href","https://huggingface.co/patrickvonplaten"),c(Se,"rel","nofollow"),c(qe,"href","https://github.com/microsoft/unilm/tree/master/wavlm"),c(qe,"rel","nofollow"),c(ue,"id","documentation-resources"),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","#documentation-resources"),c(P,"class","relative group"),c(Yt,"href","../tasks/audio_classification"),c(At,"href","../tasks/asr"),c(ge,"id","transformers.WavLMConfig"),c(ge,"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(ge,"href","#transformers.WavLMConfig"),c(H,"class","relative group"),c(Qt,"href","/docs/transformers/v4.31.0/en/model_doc/wavlm#transformers.WavLMModel"),c(Pe,"href","https://huggingface.co/microsoft/wavlm-base"),c(Pe,"rel","nofollow"),c(Pt,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Ht,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),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(be,"id","transformers.WavLMModel"),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.WavLMModel"),c(K,"class","relative group"),c(Ke,"href","https://arxiv.org/abs/2101.07597"),c(Ke,"rel","nofollow"),c(Dt,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),c(ot,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(ot,"rel","nofollow"),c(Ot,"href","/docs/transformers/v4.31.0/en/model_doc/wavlm#transformers.WavLMModel"),c(E,"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"),c(we,"id","transformers.WavLMForCTC"),c(we,"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(we,"href","#transformers.WavLMForCTC"),c(te,"class","relative group"),c(rt,"href","https://arxiv.org/abs/2101.07597"),c(rt,"rel","nofollow"),c(Kt,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),c(dt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(dt,"rel","nofollow"),c(eo,"href","/docs/transformers/v4.31.0/en/model_doc/wavlm#transformers.WavLMForCTC"),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(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(ke,"id","transformers.WavLMForSequenceClassification"),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.WavLMForSequenceClassification"),c(ne,"class","relative group"),c(ut,"href","https://arxiv.org/abs/2101.07597"),c(ut,"rel","nofollow"),c(to,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),c(vt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(vt,"rel","nofollow"),c(oo,"href","/docs/transformers/v4.31.0/en/model_doc/wavlm#transformers.WavLMForSequenceClassification"),c(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Je,"id","transformers.WavLMForAudioFrameClassification"),c(Je,"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(Je,"href","#transformers.WavLMForAudioFrameClassification"),c(re,"class","relative group"),c(wt,"href","https://arxiv.org/abs/2101.07597"),c(wt,"rel","nofollow"),c(ao,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),c(kt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(kt,"rel","nofollow"),c(no,"href","/docs/transformers/v4.31.0/en/model_doc/wavlm#transformers.WavLMForAudioFrameClassification"),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(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($e,"id","transformers.WavLMForXVector"),c($e,"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($e,"href","#transformers.WavLMForXVector"),c(ie,"class","relative group"),c(Lt,"href","https://arxiv.org/abs/2101.07597"),c(Lt,"rel","nofollow"),c(so,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),c(Zt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Zt,"rel","nofollow"),c(ro,"href","/docs/transformers/v4.31.0/en/model_doc/wavlm#transformers.WavLMForXVector"),c(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,g){e(document.head,d),v(t,b,g),v(t,f,g),e(f,m),e(m,_),w(a,_,null),e(f,p),e(f,C),e(C,Da),v(t,aa,g),v(t,Q,g),e(Q,pe),e(pe,_o),w(Be,_o,null),e(Q,Oa),e(Q,bo),e(bo,Ka),v(t,na,g),v(t,me,g),e(me,en),e(me,Ie),e(Ie,tn),e(me,on),v(t,sa,g),v(t,zt,g),e(zt,an),v(t,ra,g),v(t,Nt,g),e(Nt,Mo),e(Mo,nn),v(t,la,g),v(t,Rt,g),e(Rt,sn),v(t,ia,g),v(t,R,g),e(R,ze),e(ze,rn),e(ze,St),e(St,ln),e(ze,dn),e(R,cn),e(R,Ne),e(Ne,pn),e(Ne,qt),e(qt,mn),e(Ne,hn),e(R,un),e(R,yo),e(yo,fn),v(t,da,g),v(t,he,g),e(he,gn),e(he,Re),e(Re,vn),e(he,_n),v(t,ca,g),v(t,S,g),e(S,bn),e(S,Se),e(Se,Mn),e(S,yn),e(S,qe),e(qe,wn),e(S,Tn),v(t,pa,g),v(t,P,g),e(P,ue),e(ue,wo),w(Ye,wo,null),e(P,Wn),e(P,To),e(To,kn),v(t,ma,g),v(t,fe,g),e(fe,Wo),e(Wo,Yt),e(Yt,jn),e(fe,Cn),e(fe,ko),e(ko,At),e(At,Jn),v(t,ha,g),v(t,H,g),e(H,ge),e(ge,jo),w(Ae,jo,null),e(H,Fn),e(H,Co),e(Co,Ln),v(t,ua,g),v(t,$,g),w(Qe,$,null),e($,$n),e($,D),e(D,Un),e(D,Qt),e(Qt,Zn),e(D,En),e(D,Pe),e(Pe,xn),e(D,Xn),e($,Gn),e($,O),e(O,Vn),e(O,Pt),e(Pt,Bn),e(O,In),e(O,Ht),e(Ht,zn),e(O,Nn),e($,Rn),w(ve,$,null),e($,Sn),w(_e,$,null),v(t,fa,g),v(t,K,g),e(K,be),e(be,Jo),w(He,Jo,null),e(K,qn),e(K,Fo),e(Fo,Yn),v(t,ga,g),v(t,U,g),w(De,U,null),e(U,An),e(U,Oe),e(Oe,Qn),e(Oe,Ke),e(Ke,Pn),e(Oe,Hn),e(U,Dn),e(U,et),e(et,On),e(et,Dt),e(Dt,Kn),e(et,es),e(U,ts),e(U,tt),e(tt,os),e(tt,ot),e(ot,as),e(tt,ns),e(U,ss),e(U,E),w(at,E,null),e(E,rs),e(E,ee),e(ee,ls),e(ee,Ot),e(Ot,is),e(ee,ds),e(ee,Lo),e(Lo,cs),e(ee,ps),e(E,ms),w(Me,E,null),e(E,hs),w(ye,E,null),v(t,va,g),v(t,te,g),e(te,we),e(we,$o),w(nt,$o,null),e(te,us),e(te,Uo),e(Uo,fs),v(t,_a,g),v(t,Z,g),w(st,Z,null),e(Z,gs),e(Z,oe),e(oe,vs),e(oe,Zo),e(Zo,_s),e(oe,bs),e(oe,rt),e(rt,Ms),e(oe,ys),e(Z,ws),e(Z,lt),e(lt,Ts),e(lt,Kt),e(Kt,Ws),e(lt,ks),e(Z,js),e(Z,it),e(it,Cs),e(it,dt),e(dt,Js),e(it,Fs),e(Z,Ls),e(Z,x),w(ct,x,null),e(x,$s),e(x,ae),e(ae,Us),e(ae,eo),e(eo,Zs),e(ae,Es),e(ae,Eo),e(Eo,xs),e(ae,Xs),e(x,Gs),w(Te,x,null),e(x,Vs),w(We,x,null),v(t,ba,g),v(t,ne,g),e(ne,ke),e(ke,xo),w(pt,xo,null),e(ne,Bs),e(ne,Xo),e(Xo,Is),v(t,Ma,g),v(t,J,g),w(mt,J,null),e(J,zs),e(J,Go),e(Go,Ns),e(J,Rs),e(J,ht),e(ht,Ss),e(ht,ut),e(ut,qs),e(ht,Ys),e(J,As),e(J,ft),e(ft,Qs),e(ft,to),e(to,Ps),e(ft,Hs),e(J,Ds),e(J,gt),e(gt,Os),e(gt,vt),e(vt,Ks),e(gt,er),e(J,tr),e(J,X),w(_t,X,null),e(X,or),e(X,se),e(se,ar),e(se,oo),e(oo,nr),e(se,sr),e(se,Vo),e(Vo,rr),e(se,lr),e(X,ir),w(je,X,null),e(X,dr),w(Ce,X,null),v(t,ya,g),v(t,re,g),e(re,Je),e(Je,Bo),w(bt,Bo,null),e(re,cr),e(re,Io),e(Io,pr),v(t,wa,g),v(t,F,g),w(Mt,F,null),e(F,mr),e(F,zo),e(zo,hr),e(F,ur),e(F,yt),e(yt,fr),e(yt,wt),e(wt,gr),e(yt,vr),e(F,_r),e(F,Tt),e(Tt,br),e(Tt,ao),e(ao,Mr),e(Tt,yr),e(F,wr),e(F,Wt),e(Wt,Tr),e(Wt,kt),e(kt,Wr),e(Wt,kr),e(F,jr),e(F,G),w(jt,G,null),e(G,Cr),e(G,le),e(le,Jr),e(le,no),e(no,Fr),e(le,Lr),e(le,No),e(No,$r),e(le,Ur),e(G,Zr),w(Fe,G,null),e(G,Er),w(Le,G,null),v(t,Ta,g),v(t,ie,g),e(ie,$e),e($e,Ro),w(Ct,Ro,null),e(ie,xr),e(ie,So),e(So,Xr),v(t,Wa,g),v(t,L,g),w(Jt,L,null),e(L,Gr),e(L,qo),e(qo,Vr),e(L,Br),e(L,Ft),e(Ft,Ir),e(Ft,Lt),e(Lt,zr),e(Ft,Nr),e(L,Rr),e(L,$t),e($t,Sr),e($t,so),e(so,qr),e($t,Yr),e(L,Ar),e(L,Ut),e(Ut,Qr),e(Ut,Zt),e(Zt,Pr),e(Ut,Hr),e(L,Dr),e(L,V),w(Et,V,null),e(V,Or),e(V,de),e(de,Kr),e(de,ro),e(ro,el),e(de,tl),e(de,Yo),e(Yo,ol),e(de,al),e(V,nl),w(Ue,V,null),e(V,sl),w(Ze,V,null),ka=!0},p(t,[g]){const xt={};g&2&&(xt.$$scope={dirty:g,ctx:t}),ve.$set(xt);const Ao={};g&2&&(Ao.$$scope={dirty:g,ctx:t}),_e.$set(Ao);const Qo={};g&2&&(Qo.$$scope={dirty:g,ctx:t}),Me.$set(Qo);const Po={};g&2&&(Po.$$scope={dirty:g,ctx:t}),ye.$set(Po);const Xt={};g&2&&(Xt.$$scope={dirty:g,ctx:t}),Te.$set(Xt);const Ho={};g&2&&(Ho.$$scope={dirty:g,ctx:t}),We.$set(Ho);const Do={};g&2&&(Do.$$scope={dirty:g,ctx:t}),je.$set(Do);const Oo={};g&2&&(Oo.$$scope={dirty:g,ctx:t}),Ce.$set(Oo);const Gt={};g&2&&(Gt.$$scope={dirty:g,ctx:t}),Fe.$set(Gt);const Ko={};g&2&&(Ko.$$scope={dirty:g,ctx:t}),Le.$set(Ko);const ea={};g&2&&(ea.$$scope={dirty:g,ctx:t}),Ue.$set(ea);const ta={};g&2&&(ta.$$scope={dirty:g,ctx:t}),Ze.$set(ta)},i(t){ka||(T(a.$$.fragment,t),T(Be.$$.fragment,t),T(Ye.$$.fragment,t),T(Ae.$$.fragment,t),T(Qe.$$.fragment,t),T(ve.$$.fragment,t),T(_e.$$.fragment,t),T(He.$$.fragment,t),T(De.$$.fragment,t),T(at.$$.fragment,t),T(Me.$$.fragment,t),T(ye.$$.fragment,t),T(nt.$$.fragment,t),T(st.$$.fragment,t),T(ct.$$.fragment,t),T(Te.$$.fragment,t),T(We.$$.fragment,t),T(pt.$$.fragment,t),T(mt.$$.fragment,t),T(_t.$$.fragment,t),T(je.$$.fragment,t),T(Ce.$$.fragment,t),T(bt.$$.fragment,t),T(Mt.$$.fragment,t),T(jt.$$.fragment,t),T(Fe.$$.fragment,t),T(Le.$$.fragment,t),T(Ct.$$.fragment,t),T(Jt.$$.fragment,t),T(Et.$$.fragment,t),T(Ue.$$.fragment,t),T(Ze.$$.fragment,t),ka=!0)},o(t){W(a.$$.fragment,t),W(Be.$$.fragment,t),W(Ye.$$.fragment,t),W(Ae.$$.fragment,t),W(Qe.$$.fragment,t),W(ve.$$.fragment,t),W(_e.$$.fragment,t),W(He.$$.fragment,t),W(De.$$.fragment,t),W(at.$$.fragment,t),W(Me.$$.fragment,t),W(ye.$$.fragment,t),W(nt.$$.fragment,t),W(st.$$.fragment,t),W(ct.$$.fragment,t),W(Te.$$.fragment,t),W(We.$$.fragment,t),W(pt.$$.fragment,t),W(mt.$$.fragment,t),W(_t.$$.fragment,t),W(je.$$.fragment,t),W(Ce.$$.fragment,t),W(bt.$$.fragment,t),W(Mt.$$.fragment,t),W(jt.$$.fragment,t),W(Fe.$$.fragment,t),W(Le.$$.fragment,t),W(Ct.$$.fragment,t),W(Jt.$$.fragment,t),W(Et.$$.fragment,t),W(Ue.$$.fragment,t),W(Ze.$$.fragment,t),ka=!1},d(t){o(d),t&&o(b),t&&o(f),k(a),t&&o(aa),t&&o(Q),k(Be),t&&o(na),t&&o(me),t&&o(sa),t&&o(zt),t&&o(ra),t&&o(Nt),t&&o(la),t&&o(Rt),t&&o(ia),t&&o(R),t&&o(da),t&&o(he),t&&o(ca),t&&o(S),t&&o(pa),t&&o(P),k(Ye),t&&o(ma),t&&o(fe),t&&o(ha),t&&o(H),k(Ae),t&&o(ua),t&&o($),k(Qe),k(ve),k(_e),t&&o(fa),t&&o(K),k(He),t&&o(ga),t&&o(U),k(De),k(at),k(Me),k(ye),t&&o(va),t&&o(te),k(nt),t&&o(_a),t&&o(Z),k(st),k(ct),k(Te),k(We),t&&o(ba),t&&o(ne),k(pt),t&&o(Ma),t&&o(J),k(mt),k(_t),k(je),k(Ce),t&&o(ya),t&&o(re),k(bt),t&&o(wa),t&&o(F),k(Mt),k(jt),k(Fe),k(Le),t&&o(Ta),t&&o(ie),k(Ct),t&&o(Wa),t&&o(L),k(Jt),k(Et),k(Ue),k(Ze)}}}const Xi={local:"wavlm",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.WavLMConfig",title:"WavLMConfig"},{local:"transformers.WavLMModel",title:"WavLMModel"},{local:"transformers.WavLMForCTC",title:"WavLMForCTC"},{local:"transformers.WavLMForSequenceClassification",title:"WavLMForSequenceClassification"},{local:"transformers.WavLMForAudioFrameClassification",title:"WavLMForAudioFrameClassification"},{local:"transformers.WavLMForXVector",title:"WavLMForXVector"}],title:"WavLM"};function Gi(j){return wi(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Si extends _i{constructor(d){super();bi(this,d,Gi,xi,Mi,{})}}export{Si as default,Xi as metadata};
