import{S as _i,i as yi,s as bi,e as n,k as m,w as b,t as l,M as Mi,c as s,d as o,m as u,a as r,x as M,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 zt}from"../../chunks/vendor-hf-doc-builder.js";import{T as oa}from"../../chunks/Tip-hf-doc-builder.js";import{D as S}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Bt}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(C){let d,y,f,h,_;return h=new Bt({props:{code:"",highlighted:""}}),{c(){d=n("p"),y=l("Example:"),f=m(),b(h.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);y=i(p,"Example:"),p.forEach(o),f=u(a),M(h.$$.fragment,a)},m(a,p){v(a,d,p),e(d,y),v(a,f,p),w(h,a,p),_=!0},p:zt,i(a){_||(T(h.$$.fragment,a),_=!0)},o(a){W(h.$$.fragment,a),_=!1},d(a){a&&o(d),a&&o(f),k(h,a)}}}function Wi(C){let d,y,f,h,_;return h=new Bt({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"),y=l("Example:"),f=m(),b(h.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);y=i(p,"Example:"),p.forEach(o),f=u(a),M(h.$$.fragment,a)},m(a,p){v(a,d,p),e(d,y),v(a,f,p),w(h,a,p),_=!0},p:zt,i(a){_||(T(h.$$.fragment,a),_=!0)},o(a){W(h.$$.fragment,a),_=!1},d(a){a&&o(d),a&&o(f),k(h,a)}}}function ki(C){let d,y,f,h,_;return{c(){d=n("p"),y=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),h=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);y=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(p,"CODE",{});var j=r(f);h=i(j,"Module"),j.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,y),e(d,f),e(f,h),e(d,_)},d(a){a&&o(d)}}}function Ci(C){let d,y,f,h,_;return h=new Bt({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"),y=l("Example:"),f=m(),b(h.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);y=i(p,"Example:"),p.forEach(o),f=u(a),M(h.$$.fragment,a)},m(a,p){v(a,d,p),e(d,y),v(a,f,p),w(h,a,p),_=!0},p:zt,i(a){_||(T(h.$$.fragment,a),_=!0)},o(a){W(h.$$.fragment,a),_=!1},d(a){a&&o(d),a&&o(f),k(h,a)}}}function ji(C){let d,y,f,h,_;return{c(){d=n("p"),y=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),h=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);y=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(p,"CODE",{});var j=r(f);h=i(j,"Module"),j.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,y),e(d,f),e(f,h),e(d,_)},d(a){a&&o(d)}}}function Ji(C){let d,y,f,h,_;return h=new Bt({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"),y=l("Example:"),f=m(),b(h.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);y=i(p,"Example:"),p.forEach(o),f=u(a),M(h.$$.fragment,a)},m(a,p){v(a,d,p),e(d,y),v(a,f,p),w(h,a,p),_=!0},p:zt,i(a){_||(T(h.$$.fragment,a),_=!0)},o(a){W(h.$$.fragment,a),_=!1},d(a){a&&o(d),a&&o(f),k(h,a)}}}function Li(C){let d,y,f,h,_;return{c(){d=n("p"),y=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),h=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);y=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(p,"CODE",{});var j=r(f);h=i(j,"Module"),j.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,y),e(d,f),e(f,h),e(d,_)},d(a){a&&o(d)}}}function Fi(C){let d,y,f,h,_;return h=new Bt({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"),y=l("Example:"),f=m(),b(h.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);y=i(p,"Example:"),p.forEach(o),f=u(a),M(h.$$.fragment,a)},m(a,p){v(a,d,p),e(d,y),v(a,f,p),w(h,a,p),_=!0},p:zt,i(a){_||(T(h.$$.fragment,a),_=!0)},o(a){W(h.$$.fragment,a),_=!1},d(a){a&&o(d),a&&o(f),k(h,a)}}}function $i(C){let d,y,f,h,_;return{c(){d=n("p"),y=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),h=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);y=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(p,"CODE",{});var j=r(f);h=i(j,"Module"),j.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,y),e(d,f),e(f,h),e(d,_)},d(a){a&&o(d)}}}function Ui(C){let d,y,f,h,_;return h=new Bt({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"),y=l("Example:"),f=m(),b(h.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);y=i(p,"Example:"),p.forEach(o),f=u(a),M(h.$$.fragment,a)},m(a,p){v(a,d,p),e(d,y),v(a,f,p),w(h,a,p),_=!0},p:zt,i(a){_||(T(h.$$.fragment,a),_=!0)},o(a){W(h.$$.fragment,a),_=!1},d(a){a&&o(d),a&&o(f),k(h,a)}}}function Zi(C){let d,y,f,h,_;return{c(){d=n("p"),y=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),h=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);y=i(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=s(p,"CODE",{});var j=r(f);h=i(j,"Module"),j.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,y),e(d,f),e(f,h),e(d,_)},d(a){a&&o(d)}}}function Ei(C){let d,y,f,h,_;return h=new Bt({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"),y=l("Example:"),f=m(),b(h.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);y=i(p,"Example:"),p.forEach(o),f=u(a),M(h.$$.fragment,a)},m(a,p){v(a,d,p),e(d,y),v(a,f,p),w(h,a,p),_=!0},p:zt,i(a){_||(T(h.$$.fragment,a),_=!0)},o(a){W(h.$$.fragment,a),_=!1},d(a){a&&o(d),a&&o(f),k(h,a)}}}function Xi(C){let d,y,f,h,_,a,p,j,Ha,aa,Q,pe,_o,ze,Oa,yo,Ka,na,he,en,Be,tn,on,sa,Nt,an,ra,St,bo,nn,la,Rt,sn,ia,R,Ne,rn,It,ln,dn,cn,Se,pn,Yt,hn,mn,un,Mo,fn,da,me,gn,Re,vn,_n,ca,I,yn,Ie,bn,Mn,Ye,wn,Tn,pa,P,ue,wo,qe,Wn,To,kn,ha,fe,Wo,qt,Cn,jn,ko,At,Jn,ma,D,ge,Co,Ae,Ln,jo,Fn,ua,$,Qe,$n,H,Un,Qt,Zn,En,Pe,Xn,xn,Gn,O,Vn,Pt,zn,Bn,Dt,Nn,Sn,Rn,ve,In,_e,fa,K,ye,Jo,De,Yn,Lo,qn,ga,U,He,An,Oe,Qn,Ke,Pn,Dn,Hn,et,On,Ht,Kn,es,ts,tt,os,ot,as,ns,ss,E,at,rs,ee,ls,Ot,is,ds,Fo,cs,ps,hs,be,ms,Me,va,te,we,$o,nt,us,Uo,fs,_a,Z,st,gs,oe,vs,Zo,_s,ys,rt,bs,Ms,ws,lt,Ts,Kt,Ws,ks,Cs,it,js,dt,Js,Ls,Fs,X,ct,$s,ae,Us,eo,Zs,Es,Eo,Xs,xs,Gs,Te,Vs,We,ya,ne,ke,Xo,pt,zs,xo,Bs,ba,J,ht,Ns,Go,Ss,Rs,mt,Is,ut,Ys,qs,As,ft,Qs,to,Ps,Ds,Hs,gt,Os,vt,Ks,er,tr,x,_t,or,se,ar,oo,nr,sr,Vo,rr,lr,ir,Ce,dr,je,Ma,re,Je,zo,yt,cr,Bo,pr,wa,L,bt,hr,No,mr,ur,Mt,fr,wt,gr,vr,_r,Tt,yr,ao,br,Mr,wr,Wt,Tr,kt,Wr,kr,Cr,G,Ct,jr,le,Jr,no,Lr,Fr,So,$r,Ur,Zr,Le,Er,Fe,Ta,ie,$e,Ro,jt,Xr,Io,xr,Wa,F,Jt,Gr,Yo,Vr,zr,Lt,Br,Ft,Nr,Sr,Rr,$t,Ir,so,Yr,qr,Ar,Ut,Qr,Zt,Pr,Dr,Hr,V,Et,Or,de,Kr,ro,el,tl,qo,ol,al,nl,Ue,sl,Ze,ka;return a=new ce({}),ze=new ce({}),qe=new ce({}),Ae=new ce({}),Qe=new S({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.33.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.33.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.33.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.33.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.33.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.33.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.33.0/src/transformers/models/wavlm/configuration_wavlm.py#L32"}}),ve=new Vt({props:{anchor:"transformers.WavLMConfig.example",$$slots:{default:[Ti]},$$scope:{ctx:C}}}),_e=new Vt({props:{anchor:"transformers.WavLMConfig.example-2",$$slots:{default:[Wi]},$$scope:{ctx:C}}}),De=new ce({}),He=new S({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.33.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.33.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.33.0/src/transformers/models/wavlm/modeling_wavlm.py#L1122"}}),at=new S({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.33.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.33.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.33.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.33.0/src/transformers/models/wavlm/modeling_wavlm.py#L1208",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.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.33.0/en/model_doc/wav2vec2#transformers.modeling_outputs.Wav2Vec2BaseModelOutput"
>transformers.modeling_outputs.Wav2Vec2BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),be=new oa({props:{$$slots:{default:[ki]},$$scope:{ctx:C}}}),Me=new Vt({props:{anchor:"transformers.WavLMModel.forward.example",$$slots:{default:[Ci]},$$scope:{ctx:C}}}),nt=new ce({}),st=new S({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.33.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.33.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.33.0/src/transformers/models/wavlm/modeling_wavlm.py#L1274"}}),ct=new S({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.33.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.33.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.33.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.33.0/src/transformers/models/wavlm/modeling_wavlm.py#L1346",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.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.33.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:[ji]},$$scope:{ctx:C}}}),We=new Vt({props:{anchor:"transformers.WavLMForCTC.forward.example",$$slots:{default:[Ji]},$$scope:{ctx:C}}}),pt=new ce({}),ht=new S({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.33.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.33.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.33.0/src/transformers/models/wavlm/modeling_wavlm.py#L1433"}}),_t=new S({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.33.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.33.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.33.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.33.0/src/transformers/models/wavlm/modeling_wavlm.py#L1481",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.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.33.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ce=new oa({props:{$$slots:{default:[Li]},$$scope:{ctx:C}}}),je=new Vt({props:{anchor:"transformers.WavLMForSequenceClassification.forward.example",$$slots:{default:[Fi]},$$scope:{ctx:C}}}),yt=new ce({}),bt=new S({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.33.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.33.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.33.0/src/transformers/models/wavlm/modeling_wavlm.py#L1558"}}),Ct=new S({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.33.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.33.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.33.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.33.0/src/transformers/models/wavlm/modeling_wavlm.py#L1602",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.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.33.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Le=new oa({props:{$$slots:{default:[$i]},$$scope:{ctx:C}}}),Fe=new Vt({props:{anchor:"transformers.WavLMForAudioFrameClassification.forward.example",$$slots:{default:[Ui]},$$scope:{ctx:C}}}),jt=new ce({}),Jt=new S({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.33.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.33.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.33.0/src/transformers/models/wavlm/modeling_wavlm.py#L1722"}}),Et=new S({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.33.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.33.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.33.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.33.0/src/transformers/models/wavlm/modeling_wavlm.py#L1784",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.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.33.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:C}}}),Ze=new Vt({props:{anchor:"transformers.WavLMForXVector.forward.example",$$slots:{default:[Ei]},$$scope:{ctx:C}}}),{c(){d=n("meta"),y=m(),f=n("h1"),h=n("a"),_=n("span"),b(a.$$.fragment),p=m(),j=n("span"),Ha=l("WavLM"),aa=m(),Q=n("h2"),pe=n("a"),_o=n("span"),b(ze.$$.fragment),Oa=m(),yo=n("span"),Ka=l("Overview"),na=m(),he=n("p"),en=l("The WavLM model was proposed in "),Be=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=m(),Nt=n("p"),an=l("The abstract from the paper is the following:"),ra=m(),St=n("p"),bo=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=m(),Rt=n("p"),sn=l("Tips:"),ia=m(),R=n("ul"),Ne=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
`),It=n("a"),ln=l("Wav2Vec2Processor"),dn=l(" for the feature extraction."),cn=m(),Se=n("li"),pn=l(`WavLM model can be fine-tuned using connectionist temporal classification (CTC) so the model output has to be decoded
using `),Yt=n("a"),hn=l("Wav2Vec2CTCTokenizer"),mn=l("."),un=m(),Mo=n("li"),fn=l("WavLM performs especially well on speaker verification, speaker identification, and speaker diarization tasks."),da=m(),me=n("p"),gn=l("Relevant checkpoints can be found under "),Re=n("a"),vn=l("https://huggingface.co/models?other=wavlm"),_n=l("."),ca=m(),I=n("p"),yn=l("This model was contributed by "),Ie=n("a"),bn=l("patrickvonplaten"),Mn=l(`. The Authors\u2019 code can be
found `),Ye=n("a"),wn=l("here"),Tn=l("."),pa=m(),P=n("h2"),ue=n("a"),wo=n("span"),b(qe.$$.fragment),Wn=m(),To=n("span"),kn=l("Documentation resources"),ha=m(),fe=n("ul"),Wo=n("li"),qt=n("a"),Cn=l("Audio classification task guide"),jn=m(),ko=n("li"),At=n("a"),Jn=l("Automatic speech recognition task guide"),ma=m(),D=n("h2"),ge=n("a"),Co=n("span"),b(Ae.$$.fragment),Ln=m(),jo=n("span"),Fn=l("WavLMConfig"),ua=m(),$=n("div"),b(Qe.$$.fragment),$n=m(),H=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=m(),O=n("p"),Vn=l("Configuration objects inherit from "),Pt=n("a"),zn=l("PretrainedConfig"),Bn=l(` and can be used to control the model outputs. Read the
documentation from `),Dt=n("a"),Nn=l("PretrainedConfig"),Sn=l(" for more information."),Rn=m(),b(ve.$$.fragment),In=m(),b(_e.$$.fragment),fa=m(),K=n("h2"),ye=n("a"),Jo=n("span"),b(De.$$.fragment),Yn=m(),Lo=n("span"),qn=l("WavLMModel"),ga=m(),U=n("div"),b(He.$$.fragment),An=m(),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`),Dn=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, Xiangzhan Yu, Furu Wei.`),Hn=m(),et=n("p"),On=l("This model inherits from "),Ht=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=m(),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=m(),E=n("div"),b(at.$$.fragment),rs=m(),ee=n("p"),ls=l("The "),Ot=n("a"),is=l("WavLMModel"),ds=l(" forward method, overrides the "),Fo=n("code"),cs=l("__call__"),ps=l(" special method."),hs=m(),b(be.$$.fragment),ms=m(),b(Me.$$.fragment),va=m(),te=n("h2"),we=n("a"),$o=n("span"),b(nt.$$.fragment),us=m(),Uo=n("span"),fs=l("WavLMForCTC"),_a=m(),Z=n("div"),b(st.$$.fragment),gs=m(),oe=n("p"),vs=l("WavLM Model with a "),Zo=n("code"),_s=l("language modeling"),ys=l(` head on top for Connectionist Temporal Classification (CTC).
WavLM was proposed in `),rt=n("a"),bs=l(`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),Ms=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, Xiangzhan Yu, Furu Wei.`),ws=m(),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.).`),Cs=m(),it=n("p"),js=l("This model is a PyTorch "),dt=n("a"),Js=l("torch.nn.Module"),Ls=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.`),Fs=m(),X=n("div"),b(ct.$$.fragment),$s=m(),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=m(),b(Te.$$.fragment),Vs=m(),b(We.$$.fragment),ya=m(),ne=n("h2"),ke=n("a"),Xo=n("span"),b(pt.$$.fragment),zs=m(),xo=n("span"),Bs=l("WavLMForSequenceClassification"),ba=m(),J=n("div"),b(ht.$$.fragment),Ns=m(),Go=n("p"),Ss=l(`WavLM Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like
SUPERB Keyword Spotting.`),Rs=m(),mt=n("p"),Is=l("WavLM was proposed in "),ut=n("a"),Ys=l(`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),qs=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, Xiangzhan Yu, Furu Wei.`),As=m(),ft=n("p"),Qs=l("This model inherits from "),to=n("a"),Ps=l("PreTrainedModel"),Ds=l(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Hs=m(),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=m(),x=n("div"),b(_t.$$.fragment),or=m(),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=m(),b(Ce.$$.fragment),dr=m(),b(je.$$.fragment),Ma=m(),re=n("h2"),Je=n("a"),zo=n("span"),b(yt.$$.fragment),cr=m(),Bo=n("span"),pr=l("WavLMForAudioFrameClassification"),wa=m(),L=n("div"),b(bt.$$.fragment),hr=m(),No=n("p"),mr=l("WavLM Model with a frame classification head on top for tasks like Speaker Diarization."),ur=m(),Mt=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 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, Xiangzhan Yu, Furu Wei.`),_r=m(),Tt=n("p"),yr=l("This model inherits from "),ao=n("a"),br=l("PreTrainedModel"),Mr=l(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),wr=m(),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.`),Cr=m(),G=n("div"),b(Ct.$$.fragment),jr=m(),le=n("p"),Jr=l("The "),no=n("a"),Lr=l("WavLMForAudioFrameClassification"),Fr=l(" forward method, overrides the "),So=n("code"),$r=l("__call__"),Ur=l(" special method."),Zr=m(),b(Le.$$.fragment),Er=m(),b(Fe.$$.fragment),Ta=m(),ie=n("h2"),$e=n("a"),Ro=n("span"),b(jt.$$.fragment),Xr=m(),Io=n("span"),xr=l("WavLMForXVector"),Wa=m(),F=n("div"),b(Jt.$$.fragment),Gr=m(),Yo=n("p"),Vr=l("WavLM Model with an XVector feature extraction head on top for tasks like Speaker Verification."),zr=m(),Lt=n("p"),Br=l("WavLM was proposed in "),Ft=n("a"),Nr=l(`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),Sr=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, Xiangzhan Yu, Furu Wei.`),Rr=m(),$t=n("p"),Ir=l("This model inherits from "),so=n("a"),Yr=l("PreTrainedModel"),qr=l(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Ar=m(),Ut=n("p"),Qr=l("This model is a PyTorch "),Zt=n("a"),Pr=l("torch.nn.Module"),Dr=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.`),Hr=m(),V=n("div"),b(Et.$$.fragment),Or=m(),de=n("p"),Kr=l("The "),ro=n("a"),el=l("WavLMForXVector"),tl=l(" forward method, overrides the "),qo=n("code"),ol=l("__call__"),al=l(" special method."),nl=m(),b(Ue.$$.fragment),sl=m(),b(Ze.$$.fragment),this.h()},l(t){const g=Mi('[data-svelte="svelte-1phssyn"]',document.head);d=s(g,"META",{name:!0,content:!0}),g.forEach(o),y=u(t),f=s(t,"H1",{class:!0});var Xt=r(f);h=s(Xt,"A",{id:!0,class:!0,href:!0});var Ao=r(h);_=s(Ao,"SPAN",{});var Qo=r(_);M(a.$$.fragment,Qo),Qo.forEach(o),Ao.forEach(o),p=u(Xt),j=s(Xt,"SPAN",{});var Po=r(j);Ha=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 Do=r(pe);_o=s(Do,"SPAN",{});var Ho=r(_o);M(ze.$$.fragment,Ho),Ho.forEach(o),Do.forEach(o),Oa=u(xt),yo=s(xt,"SPAN",{});var Oo=r(yo);Ka=i(Oo,"Overview"),Oo.forEach(o),xt.forEach(o),na=u(t),he=s(t,"P",{});var Gt=r(he);en=i(Gt,"The WavLM model was proposed in "),Be=s(Gt,"A",{href:!0,rel:!0});var Ko=r(Be);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),Nt=s(t,"P",{});var ea=r(Nt);an=i(ea,"The abstract from the paper is the following:"),ea.forEach(o),ra=u(t),St=s(t,"P",{});var ta=r(St);bo=s(ta,"EM",{});var rl=r(bo);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);Ne=s(lo,"LI",{});var Ca=r(Ne);rn=i(Ca,`WavLM is a speech model that accepts a float array corresponding to the raw waveform of the speech signal. Please use
`),It=s(Ca,"A",{href:!0});var il=r(It);ln=i(il,"Wav2Vec2Processor"),il.forEach(o),dn=i(Ca," for the feature extraction."),Ca.forEach(o),cn=u(lo),Se=s(lo,"LI",{});var ja=r(Se);pn=i(ja,`WavLM model can be fine-tuned using connectionist temporal classification (CTC) so the model output has to be decoded
using `),Yt=s(ja,"A",{href:!0});var dl=r(Yt);hn=i(dl,"Wav2Vec2CTCTokenizer"),dl.forEach(o),mn=i(ja,"."),ja.forEach(o),un=u(lo),Mo=s(lo,"LI",{});var cl=r(Mo);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),me=s(t,"P",{});var Ja=r(me);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),I=s(t,"P",{});var io=r(I);yn=i(io,"This model was contributed by "),Ie=s(io,"A",{href:!0,rel:!0});var hl=r(Ie);bn=i(hl,"patrickvonplaten"),hl.forEach(o),Mn=i(io,`. The Authors\u2019 code can be
found `),Ye=s(io,"A",{href:!0,rel:!0});var ml=r(Ye);wn=i(ml,"here"),ml.forEach(o),Tn=i(io,"."),io.forEach(o),pa=u(t),P=s(t,"H2",{class:!0});var La=r(P);ue=s(La,"A",{id:!0,class:!0,href:!0});var ul=r(ue);wo=s(ul,"SPAN",{});var fl=r(wo);M(qe.$$.fragment,fl),fl.forEach(o),ul.forEach(o),Wn=u(La),To=s(La,"SPAN",{});var gl=r(To);kn=i(gl,"Documentation resources"),gl.forEach(o),La.forEach(o),ha=u(t),fe=s(t,"UL",{});var Fa=r(fe);Wo=s(Fa,"LI",{});var vl=r(Wo);qt=s(vl,"A",{href:!0});var _l=r(qt);Cn=i(_l,"Audio classification task guide"),_l.forEach(o),vl.forEach(o),jn=u(Fa),ko=s(Fa,"LI",{});var yl=r(ko);At=s(yl,"A",{href:!0});var bl=r(At);Jn=i(bl,"Automatic speech recognition task guide"),bl.forEach(o),yl.forEach(o),Fa.forEach(o),ma=u(t),D=s(t,"H2",{class:!0});var $a=r(D);ge=s($a,"A",{id:!0,class:!0,href:!0});var Ml=r(ge);Co=s(Ml,"SPAN",{});var wl=r(Co);M(Ae.$$.fragment,wl),wl.forEach(o),Ml.forEach(o),Ln=u($a),jo=s($a,"SPAN",{});var Tl=r(jo);Fn=i(Tl,"WavLMConfig"),Tl.forEach(o),$a.forEach(o),ua=u(t),$=s(t,"DIV",{class:!0});var Y=r($);M(Qe.$$.fragment,Y),$n=u(Y),H=s(Y,"P",{});var co=r(H);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(Y),O=s(Y,"P",{});var po=r(O);Vn=i(po,"Configuration objects inherit from "),Pt=s(po,"A",{href:!0});var Cl=r(Pt);zn=i(Cl,"PretrainedConfig"),Cl.forEach(o),Bn=i(po,` and can be used to control the model outputs. Read the
documentation from `),Dt=s(po,"A",{href:!0});var jl=r(Dt);Nn=i(jl,"PretrainedConfig"),jl.forEach(o),Sn=i(po," for more information."),po.forEach(o),Rn=u(Y),M(ve.$$.fragment,Y),In=u(Y),M(_e.$$.fragment,Y),Y.forEach(o),fa=u(t),K=s(t,"H2",{class:!0});var Ua=r(K);ye=s(Ua,"A",{id:!0,class:!0,href:!0});var Jl=r(ye);Jo=s(Jl,"SPAN",{});var Ll=r(Jo);M(De.$$.fragment,Ll),Ll.forEach(o),Jl.forEach(o),Yn=u(Ua),Lo=s(Ua,"SPAN",{});var Fl=r(Lo);qn=i(Fl,"WavLMModel"),Fl.forEach(o),Ua.forEach(o),ga=u(t),U=s(t,"DIV",{class:!0});var q=r(U);M(He.$$.fragment,q),An=u(q),Oe=s(q,"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),Dn=i(Za,` 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, Xiangzhan Yu, Furu Wei.`),Za.forEach(o),Hn=u(q),et=s(q,"P",{});var Ea=r(et);On=i(Ea,"This model inherits from "),Ht=s(Ea,"A",{href:!0});var Ul=r(Ht);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(q),tt=s(q,"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(q),E=s(q,"DIV",{class:!0});var Ee=r(E);M(at.$$.fragment,Ee),rs=u(Ee),ee=s(Ee,"P",{});var ho=r(ee);ls=i(ho,"The "),Ot=s(ho,"A",{href:!0});var El=r(Ot);is=i(El,"WavLMModel"),El.forEach(o),ds=i(ho," forward method, overrides the "),Fo=s(ho,"CODE",{});var Xl=r(Fo);cs=i(Xl,"__call__"),Xl.forEach(o),ps=i(ho," special method."),ho.forEach(o),hs=u(Ee),M(be.$$.fragment,Ee),ms=u(Ee),M(Me.$$.fragment,Ee),Ee.forEach(o),q.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);M(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);M(st.$$.fragment,A),gs=u(A),oe=s(A,"P",{});var mo=r(oe);vs=i(mo,"WavLM Model with a "),Zo=s(mo,"CODE",{});var zl=r(Zo);_s=i(zl,"language modeling"),zl.forEach(o),ys=i(mo,` head on top for Connectionist Temporal Classification (CTC).
WavLM was proposed in `),rt=s(mo,"A",{href:!0,rel:!0});var Bl=r(rt);bs=i(Bl,`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),Bl.forEach(o),Ms=i(mo,` 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, Xiangzhan Yu, Furu Wei.`),mo.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 Nl=r(Kt);Ws=i(Nl,"PreTrainedModel"),Nl.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),Cs=u(A),it=s(A,"P",{});var Va=r(it);js=i(Va,"This model is a PyTorch "),dt=s(Va,"A",{href:!0,rel:!0});var Sl=r(dt);Js=i(Sl,"torch.nn.Module"),Sl.forEach(o),Ls=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),Fs=u(A),X=s(A,"DIV",{class:!0});var Xe=r(X);M(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 Il=r(Eo);Xs=i(Il,"__call__"),Il.forEach(o),xs=i(uo," special method."),uo.forEach(o),Gs=u(Xe),M(Te.$$.fragment,Xe),Vs=u(Xe),M(We.$$.fragment,Xe),Xe.forEach(o),A.forEach(o),ya=u(t),ne=s(t,"H2",{class:!0});var za=r(ne);ke=s(za,"A",{id:!0,class:!0,href:!0});var Yl=r(ke);Xo=s(Yl,"SPAN",{});var ql=r(Xo);M(pt.$$.fragment,ql),ql.forEach(o),Yl.forEach(o),zs=u(za),xo=s(za,"SPAN",{});var Al=r(xo);Bs=i(Al,"WavLMForSequenceClassification"),Al.forEach(o),za.forEach(o),ba=u(t),J=s(t,"DIV",{class:!0});var z=r(J);M(ht.$$.fragment,z),Ns=u(z),Go=s(z,"P",{});var Ql=r(Go);Ss=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(z),mt=s(z,"P",{});var Ba=r(mt);Is=i(Ba,"WavLM was proposed in "),ut=s(Ba,"A",{href:!0,rel:!0});var Pl=r(ut);Ys=i(Pl,`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),Pl.forEach(o),qs=i(Ba,` 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, Xiangzhan Yu, Furu Wei.`),Ba.forEach(o),As=u(z),ft=s(z,"P",{});var Na=r(ft);Qs=i(Na,"This model inherits from "),to=s(Na,"A",{href:!0});var Dl=r(to);Ps=i(Dl,"PreTrainedModel"),Dl.forEach(o),Ds=i(Na,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Na.forEach(o),Hs=u(z),gt=s(z,"P",{});var Sa=r(gt);Os=i(Sa,"This model is a PyTorch "),vt=s(Sa,"A",{href:!0,rel:!0});var Hl=r(vt);Ks=i(Hl,"torch.nn.Module"),Hl.forEach(o),er=i(Sa,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Sa.forEach(o),tr=u(z),x=s(z,"DIV",{class:!0});var xe=r(x);M(_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),M(Ce.$$.fragment,xe),dr=u(xe),M(je.$$.fragment,xe),xe.forEach(o),z.forEach(o),Ma=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);zo=s(ei,"SPAN",{});var ti=r(zo);M(yt.$$.fragment,ti),ti.forEach(o),ei.forEach(o),cr=u(Ra),Bo=s(Ra,"SPAN",{});var oi=r(Bo);pr=i(oi,"WavLMForAudioFrameClassification"),oi.forEach(o),Ra.forEach(o),wa=u(t),L=s(t,"DIV",{class:!0});var B=r(L);M(bt.$$.fragment,B),hr=u(B),No=s(B,"P",{});var ai=r(No);mr=i(ai,"WavLM Model with a frame classification head on top for tasks like Speaker Diarization."),ai.forEach(o),ur=u(B),Mt=s(B,"P",{});var Ia=r(Mt);fr=i(Ia,"WavLM was proposed in "),wt=s(Ia,"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(Ia,` 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, Xiangzhan Yu, Furu Wei.`),Ia.forEach(o),_r=u(B),Tt=s(B,"P",{});var Ya=r(Tt);yr=i(Ya,"This model inherits from "),ao=s(Ya,"A",{href:!0});var si=r(ao);br=i(si,"PreTrainedModel"),si.forEach(o),Mr=i(Ya,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Ya.forEach(o),wr=u(B),Wt=s(B,"P",{});var qa=r(Wt);Tr=i(qa,"This model is a PyTorch "),kt=s(qa,"A",{href:!0,rel:!0});var ri=r(kt);Wr=i(ri,"torch.nn.Module"),ri.forEach(o),kr=i(qa,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),qa.forEach(o),Cr=u(B),G=s(B,"DIV",{class:!0});var Ge=r(G);M(Ct.$$.fragment,Ge),jr=u(Ge),le=s(Ge,"P",{});var go=r(le);Jr=i(go,"The "),no=s(go,"A",{href:!0});var li=r(no);Lr=i(li,"WavLMForAudioFrameClassification"),li.forEach(o),Fr=i(go," forward method, overrides the "),So=s(go,"CODE",{});var ii=r(So);$r=i(ii,"__call__"),ii.forEach(o),Ur=i(go," special method."),go.forEach(o),Zr=u(Ge),M(Le.$$.fragment,Ge),Er=u(Ge),M(Fe.$$.fragment,Ge),Ge.forEach(o),B.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);M(jt.$$.fragment,ci),ci.forEach(o),di.forEach(o),Xr=u(Aa),Io=s(Aa,"SPAN",{});var pi=r(Io);xr=i(pi,"WavLMForXVector"),pi.forEach(o),Aa.forEach(o),Wa=u(t),F=s(t,"DIV",{class:!0});var N=r(F);M(Jt.$$.fragment,N),Gr=u(N),Yo=s(N,"P",{});var hi=r(Yo);Vr=i(hi,"WavLM Model with an XVector feature extraction head on top for tasks like Speaker Verification."),hi.forEach(o),zr=u(N),Lt=s(N,"P",{});var Qa=r(Lt);Br=i(Qa,"WavLM was proposed in "),Ft=s(Qa,"A",{href:!0,rel:!0});var mi=r(Ft);Nr=i(mi,`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),mi.forEach(o),Sr=i(Qa,` 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, Xiangzhan Yu, Furu Wei.`),Qa.forEach(o),Rr=u(N),$t=s(N,"P",{});var Pa=r($t);Ir=i(Pa,"This model inherits from "),so=s(Pa,"A",{href:!0});var ui=r(so);Yr=i(ui,"PreTrainedModel"),ui.forEach(o),qr=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(N),Ut=s(N,"P",{});var Da=r(Ut);Qr=i(Da,"This model is a PyTorch "),Zt=s(Da,"A",{href:!0,rel:!0});var fi=r(Zt);Pr=i(fi,"torch.nn.Module"),fi.forEach(o),Dr=i(Da,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Da.forEach(o),Hr=u(N),V=s(N,"DIV",{class:!0});var Ve=r(V);M(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 "),qo=s(vo,"CODE",{});var vi=r(qo);ol=i(vi,"__call__"),vi.forEach(o),al=i(vo," special method."),vo.forEach(o),nl=u(Ve),M(Ue.$$.fragment,Ve),sl=u(Ve),M(Ze.$$.fragment,Ve),Ve.forEach(o),N.forEach(o),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(xi)),c(h,"id","wavlm"),c(h,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(h,"href","#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(Be,"href","https://arxiv.org/abs/2110.13900"),c(Be,"rel","nofollow"),c(It,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor"),c(Yt,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer"),c(Re,"href","https://huggingface.co/models?other=wavlm"),c(Re,"rel","nofollow"),c(Ie,"href","https://huggingface.co/patrickvonplaten"),c(Ie,"rel","nofollow"),c(Ye,"href","https://github.com/microsoft/unilm/tree/master/wavlm"),c(Ye,"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(qt,"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(D,"class","relative group"),c(Qt,"href","/docs/transformers/v4.33.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.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Dt,"href","/docs/transformers/v4.33.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(ye,"id","transformers.WavLMModel"),c(ye,"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(ye,"href","#transformers.WavLMModel"),c(K,"class","relative group"),c(Ke,"href","https://arxiv.org/abs/2110.13900"),c(Ke,"rel","nofollow"),c(Ht,"href","/docs/transformers/v4.33.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.33.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/2110.13900"),c(rt,"rel","nofollow"),c(Kt,"href","/docs/transformers/v4.33.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.33.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/2110.13900"),c(ut,"rel","nofollow"),c(to,"href","/docs/transformers/v4.33.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.33.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/2110.13900"),c(wt,"rel","nofollow"),c(ao,"href","/docs/transformers/v4.33.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.33.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(L,"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(Ft,"href","https://arxiv.org/abs/2110.13900"),c(Ft,"rel","nofollow"),c(so,"href","/docs/transformers/v4.33.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.33.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(F,"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,y,g),v(t,f,g),e(f,h),e(h,_),w(a,_,null),e(f,p),e(f,j),e(j,Ha),v(t,aa,g),v(t,Q,g),e(Q,pe),e(pe,_o),w(ze,_o,null),e(Q,Oa),e(Q,yo),e(yo,Ka),v(t,na,g),v(t,he,g),e(he,en),e(he,Be),e(Be,tn),e(he,on),v(t,sa,g),v(t,Nt,g),e(Nt,an),v(t,ra,g),v(t,St,g),e(St,bo),e(bo,nn),v(t,la,g),v(t,Rt,g),e(Rt,sn),v(t,ia,g),v(t,R,g),e(R,Ne),e(Ne,rn),e(Ne,It),e(It,ln),e(Ne,dn),e(R,cn),e(R,Se),e(Se,pn),e(Se,Yt),e(Yt,hn),e(Se,mn),e(R,un),e(R,Mo),e(Mo,fn),v(t,da,g),v(t,me,g),e(me,gn),e(me,Re),e(Re,vn),e(me,_n),v(t,ca,g),v(t,I,g),e(I,yn),e(I,Ie),e(Ie,bn),e(I,Mn),e(I,Ye),e(Ye,wn),e(I,Tn),v(t,pa,g),v(t,P,g),e(P,ue),e(ue,wo),w(qe,wo,null),e(P,Wn),e(P,To),e(To,kn),v(t,ha,g),v(t,fe,g),e(fe,Wo),e(Wo,qt),e(qt,Cn),e(fe,jn),e(fe,ko),e(ko,At),e(At,Jn),v(t,ma,g),v(t,D,g),e(D,ge),e(ge,Co),w(Ae,Co,null),e(D,Ln),e(D,jo),e(jo,Fn),v(t,ua,g),v(t,$,g),w(Qe,$,null),e($,$n),e($,H),e(H,Un),e(H,Qt),e(Qt,Zn),e(H,En),e(H,Pe),e(Pe,Xn),e(H,xn),e($,Gn),e($,O),e(O,Vn),e(O,Pt),e(Pt,zn),e(O,Bn),e(O,Dt),e(Dt,Nn),e(O,Sn),e($,Rn),w(ve,$,null),e($,In),w(_e,$,null),v(t,fa,g),v(t,K,g),e(K,ye),e(ye,Jo),w(De,Jo,null),e(K,Yn),e(K,Lo),e(Lo,qn),v(t,ga,g),v(t,U,g),w(He,U,null),e(U,An),e(U,Oe),e(Oe,Qn),e(Oe,Ke),e(Ke,Pn),e(Oe,Dn),e(U,Hn),e(U,et),e(et,On),e(et,Ht),e(Ht,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,Fo),e(Fo,cs),e(ee,ps),e(E,hs),w(be,E,null),e(E,ms),w(Me,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,ys),e(oe,rt),e(rt,bs),e(oe,Ms),e(Z,ws),e(Z,lt),e(lt,Ts),e(lt,Kt),e(Kt,Ws),e(lt,ks),e(Z,Cs),e(Z,it),e(it,js),e(it,dt),e(dt,Js),e(it,Ls),e(Z,Fs),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,ya,g),v(t,ne,g),e(ne,ke),e(ke,Xo),w(pt,Xo,null),e(ne,zs),e(ne,xo),e(xo,Bs),v(t,ba,g),v(t,J,g),w(ht,J,null),e(J,Ns),e(J,Go),e(Go,Ss),e(J,Rs),e(J,mt),e(mt,Is),e(mt,ut),e(ut,Ys),e(mt,qs),e(J,As),e(J,ft),e(ft,Qs),e(ft,to),e(to,Ps),e(ft,Ds),e(J,Hs),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(Ce,x,null),e(x,dr),w(je,x,null),v(t,Ma,g),v(t,re,g),e(re,Je),e(Je,zo),w(yt,zo,null),e(re,cr),e(re,Bo),e(Bo,pr),v(t,wa,g),v(t,L,g),w(bt,L,null),e(L,hr),e(L,No),e(No,mr),e(L,ur),e(L,Mt),e(Mt,fr),e(Mt,wt),e(wt,gr),e(Mt,vr),e(L,_r),e(L,Tt),e(Tt,yr),e(Tt,ao),e(ao,br),e(Tt,Mr),e(L,wr),e(L,Wt),e(Wt,Tr),e(Wt,kt),e(kt,Wr),e(Wt,kr),e(L,Cr),e(L,G),w(Ct,G,null),e(G,jr),e(G,le),e(le,Jr),e(le,no),e(no,Lr),e(le,Fr),e(le,So),e(So,$r),e(le,Ur),e(G,Zr),w(Le,G,null),e(G,Er),w(Fe,G,null),v(t,Ta,g),v(t,ie,g),e(ie,$e),e($e,Ro),w(jt,Ro,null),e(ie,Xr),e(ie,Io),e(Io,xr),v(t,Wa,g),v(t,F,g),w(Jt,F,null),e(F,Gr),e(F,Yo),e(Yo,Vr),e(F,zr),e(F,Lt),e(Lt,Br),e(Lt,Ft),e(Ft,Nr),e(Lt,Sr),e(F,Rr),e(F,$t),e($t,Ir),e($t,so),e(so,Yr),e($t,qr),e(F,Ar),e(F,Ut),e(Ut,Qr),e(Ut,Zt),e(Zt,Pr),e(Ut,Dr),e(F,Hr),e(F,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,qo),e(qo,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}),be.$set(Qo);const Po={};g&2&&(Po.$$scope={dirty:g,ctx:t}),Me.$set(Po);const xt={};g&2&&(xt.$$scope={dirty:g,ctx:t}),Te.$set(xt);const Do={};g&2&&(Do.$$scope={dirty:g,ctx:t}),We.$set(Do);const Ho={};g&2&&(Ho.$$scope={dirty:g,ctx:t}),Ce.$set(Ho);const Oo={};g&2&&(Oo.$$scope={dirty:g,ctx:t}),je.$set(Oo);const Gt={};g&2&&(Gt.$$scope={dirty:g,ctx:t}),Le.$set(Gt);const Ko={};g&2&&(Ko.$$scope={dirty:g,ctx:t}),Fe.$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(ze.$$.fragment,t),T(qe.$$.fragment,t),T(Ae.$$.fragment,t),T(Qe.$$.fragment,t),T(ve.$$.fragment,t),T(_e.$$.fragment,t),T(De.$$.fragment,t),T(He.$$.fragment,t),T(at.$$.fragment,t),T(be.$$.fragment,t),T(Me.$$.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(ht.$$.fragment,t),T(_t.$$.fragment,t),T(Ce.$$.fragment,t),T(je.$$.fragment,t),T(yt.$$.fragment,t),T(bt.$$.fragment,t),T(Ct.$$.fragment,t),T(Le.$$.fragment,t),T(Fe.$$.fragment,t),T(jt.$$.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(ze.$$.fragment,t),W(qe.$$.fragment,t),W(Ae.$$.fragment,t),W(Qe.$$.fragment,t),W(ve.$$.fragment,t),W(_e.$$.fragment,t),W(De.$$.fragment,t),W(He.$$.fragment,t),W(at.$$.fragment,t),W(be.$$.fragment,t),W(Me.$$.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(ht.$$.fragment,t),W(_t.$$.fragment,t),W(Ce.$$.fragment,t),W(je.$$.fragment,t),W(yt.$$.fragment,t),W(bt.$$.fragment,t),W(Ct.$$.fragment,t),W(Le.$$.fragment,t),W(Fe.$$.fragment,t),W(jt.$$.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(y),t&&o(f),k(a),t&&o(aa),t&&o(Q),k(ze),t&&o(na),t&&o(he),t&&o(sa),t&&o(Nt),t&&o(ra),t&&o(St),t&&o(la),t&&o(Rt),t&&o(ia),t&&o(R),t&&o(da),t&&o(me),t&&o(ca),t&&o(I),t&&o(pa),t&&o(P),k(qe),t&&o(ha),t&&o(fe),t&&o(ma),t&&o(D),k(Ae),t&&o(ua),t&&o($),k(Qe),k(ve),k(_e),t&&o(fa),t&&o(K),k(De),t&&o(ga),t&&o(U),k(He),k(at),k(be),k(Me),t&&o(va),t&&o(te),k(nt),t&&o(_a),t&&o(Z),k(st),k(ct),k(Te),k(We),t&&o(ya),t&&o(ne),k(pt),t&&o(ba),t&&o(J),k(ht),k(_t),k(Ce),k(je),t&&o(Ma),t&&o(re),k(yt),t&&o(wa),t&&o(L),k(bt),k(Ct),k(Le),k(Fe),t&&o(Ta),t&&o(ie),k(jt),t&&o(Wa),t&&o(F),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(C){return wi(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ii extends _i{constructor(d){super();yi(this,d,Gi,Xi,bi,{})}}export{Ii as default,xi as metadata};
