import{S as Hi,i as Ki,s as Ri,e as r,k as h,w,t as n,M as Bi,c as i,d as o,m as u,a as l,x as y,h as s,b as c,G as e,g as _,y as M,q as k,o as $,B as L,v as Zi,L as At}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ho}from"../../chunks/Tip-hf-doc-builder.js";import{D as X}from"../../chunks/Docstring-hf-doc-builder.js";import{C as St}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ae}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Pt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Qi(W){let d,b,f,m,v;return m=new St({props:{code:"",highlighted:""}}),{c(){d=r("p"),b=n("Example:"),f=h(),w(m.$$.fragment)},l(a){d=i(a,"P",{});var p=l(d);b=s(p,"Example:"),p.forEach(o),f=u(a),y(m.$$.fragment,a)},m(a,p){_(a,d,p),e(d,b),_(a,f,p),M(m,a,p),v=!0},p:At,i(a){v||(k(m.$$.fragment,a),v=!0)},o(a){$(m.$$.fragment,a),v=!1},d(a){a&&o(d),a&&o(f),L(m,a)}}}function Ji(W){let d,b,f,m,v;return m=new St({props:{code:`from transformers import WavLMConfig, WavLMModel

# Initializing a WavLM facebook/wavlm-base-960h style configuration
configuration = WavLMConfig()

# Initializing a model (with random weights) from the facebook/wavlm-base-960h style configuration
model = WavLMModel(configuration)

# Accessing the model configuration
configuration = model.config`,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=r("p"),b=n("Example:"),f=h(),w(m.$$.fragment)},l(a){d=i(a,"P",{});var p=l(d);b=s(p,"Example:"),p.forEach(o),f=u(a),y(m.$$.fragment,a)},m(a,p){_(a,d,p),e(d,b),_(a,f,p),M(m,a,p),v=!0},p:At,i(a){v||(k(m.$$.fragment,a),v=!0)},o(a){$(m.$$.fragment,a),v=!1},d(a){a&&o(d),a&&o(f),L(m,a)}}}function Gi(W){let d,b,f,m,v;return{c(){d=r("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),m=n("Module"),v=n(`
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=i(a,"P",{});var p=l(d);b=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=i(p,"CODE",{});var T=l(f);m=s(T,"Module"),T.forEach(o),v=s(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){_(a,d,p),e(d,b),e(d,f),e(f,m),e(d,v)},d(a){a&&o(d)}}}function el(W){let d,b,f,m,v;return m=new St({props:{code:`from transformers import AutoProcessor, WavLMModel
import torch
from datasets import load_dataset

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

processor = AutoProcessor.from_pretrained("patrickvonplaten/wavlm-libri-clean-100h-base-plus")
model = WavLMModel.from_pretrained("patrickvonplaten/wavlm-libri-clean-100h-base-plus")

# audio file is decoded on the fly
inputs = processor(dataset[0]["audio"]["array"], sampling_rate=sampling_rate, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,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=r("p"),b=n("Example:"),f=h(),w(m.$$.fragment)},l(a){d=i(a,"P",{});var p=l(d);b=s(p,"Example:"),p.forEach(o),f=u(a),y(m.$$.fragment,a)},m(a,p){_(a,d,p),e(d,b),_(a,f,p),M(m,a,p),v=!0},p:At,i(a){v||(k(m.$$.fragment,a),v=!0)},o(a){$(m.$$.fragment,a),v=!1},d(a){a&&o(d),a&&o(f),L(m,a)}}}function tl(W){let d,b,f,m,v;return{c(){d=r("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),m=n("Module"),v=n(`
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=i(a,"P",{});var p=l(d);b=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=i(p,"CODE",{});var T=l(f);m=s(T,"Module"),T.forEach(o),v=s(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){_(a,d,p),e(d,b),e(d,f),e(f,m),e(d,v)},d(a){a&&o(d)}}}function ol(W){let d,b,f,m,v;return m=new St({props:{code:`from transformers import AutoProcessor, WavLMForCTC
from datasets import load_dataset
import torch

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

processor = AutoProcessor.from_pretrained("patrickvonplaten/wavlm-libri-clean-100h-base-plus")
model = WavLMForCTC.from_pretrained("patrickvonplaten/wavlm-libri-clean-100h-base-plus")

# audio file is decoded on the fly
inputs = processor(dataset[0]["audio"]["array"], sampling_rate=sampling_rate, return_tensors="pt")
with torch.no_grad():
    logits = model(**inputs).logits
predicted_ids = torch.argmax(logits, dim=-1)

# transcribe speech
transcription = processor.batch_decode(predicted_ids)
transcription[0]

inputs["labels"] = processor(text=dataset[0]["text"], return_tensors="pt").input_ids

# compute loss
loss = model(**inputs).loss
round(loss.item(), 2)`,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=r("p"),b=n("Example:"),f=h(),w(m.$$.fragment)},l(a){d=i(a,"P",{});var p=l(d);b=s(p,"Example:"),p.forEach(o),f=u(a),y(m.$$.fragment,a)},m(a,p){_(a,d,p),e(d,b),_(a,f,p),M(m,a,p),v=!0},p:At,i(a){v||(k(m.$$.fragment,a),v=!0)},o(a){$(m.$$.fragment,a),v=!1},d(a){a&&o(d),a&&o(f),L(m,a)}}}function al(W){let d,b,f,m,v;return{c(){d=r("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),m=n("Module"),v=n(`
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=i(a,"P",{});var p=l(d);b=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=i(p,"CODE",{});var T=l(f);m=s(T,"Module"),T.forEach(o),v=s(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){_(a,d,p),e(d,b),e(d,f),e(f,m),e(d,v)},d(a){a&&o(d)}}}function nl(W){let d,b,f,m,v;return m=new St({props:{code:`from transformers import AutoFeatureExtractor, WavLMForSequenceClassification
from datasets import load_dataset
import torch

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

feature_extractor = AutoFeatureExtractor.from_pretrained("patrickvonplaten/wavlm-libri-clean-100h-base-plus")
model = WavLMForSequenceClassification.from_pretrained("patrickvonplaten/wavlm-libri-clean-100h-base-plus")

# audio file is decoded on the fly
inputs = feature_extractor(dataset[0]["audio"]["array"], sampling_rate=sampling_rate, return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_ids = torch.argmax(logits, dim=-1).item()
predicted_label = model.config.id2label[predicted_class_ids]

# compute loss - target_label is e.g. "down"
target_label = model.config.id2label[0]
inputs["labels"] = torch.tensor([model.config.label2id[target_label]])
loss = model(**inputs).loss`,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=r("p"),b=n("Example:"),f=h(),w(m.$$.fragment)},l(a){d=i(a,"P",{});var p=l(d);b=s(p,"Example:"),p.forEach(o),f=u(a),y(m.$$.fragment,a)},m(a,p){_(a,d,p),e(d,b),_(a,f,p),M(m,a,p),v=!0},p:At,i(a){v||(k(m.$$.fragment,a),v=!0)},o(a){$(m.$$.fragment,a),v=!1},d(a){a&&o(d),a&&o(f),L(m,a)}}}function sl(W){let d,b,f,m,v;return{c(){d=r("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),m=n("Module"),v=n(`
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=i(a,"P",{});var p=l(d);b=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=i(p,"CODE",{});var T=l(f);m=s(T,"Module"),T.forEach(o),v=s(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){_(a,d,p),e(d,b),e(d,f),e(f,m),e(d,v)},d(a){a&&o(d)}}}function rl(W){let d,b,f,m,v;return m=new St({props:{code:`from transformers import AutoFeatureExtractor, WavLMForAudioFrameClassification
from datasets import load_dataset
import torch

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

feature_extractor = AutoFeatureExtractor.from_pretrained("microsoft/wavlm-base-plus-sd")
model = WavLMForAudioFrameClassification.from_pretrained("microsoft/wavlm-base-plus-sd")

# audio file is decoded on the fly
inputs = feature_extractor(dataset[0]["audio"]["array"], return_tensors="pt", sampling_rate=sampling_rate)
with torch.no_grad():
    logits = model(**inputs).logits

probabilities = torch.sigmoid(logits[0])
# labels is a one-hot array of shape (num_frames, num_speakers)
labels = (probabilities > 0.5).long()
labels[0].tolist()`,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=r("p"),b=n("Example:"),f=h(),w(m.$$.fragment)},l(a){d=i(a,"P",{});var p=l(d);b=s(p,"Example:"),p.forEach(o),f=u(a),y(m.$$.fragment,a)},m(a,p){_(a,d,p),e(d,b),_(a,f,p),M(m,a,p),v=!0},p:At,i(a){v||(k(m.$$.fragment,a),v=!0)},o(a){$(m.$$.fragment,a),v=!1},d(a){a&&o(d),a&&o(f),L(m,a)}}}function il(W){let d,b,f,m,v;return{c(){d=r("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r("code"),m=n("Module"),v=n(`
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=i(a,"P",{});var p=l(d);b=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=i(p,"CODE",{});var T=l(f);m=s(T,"Module"),T.forEach(o),v=s(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){_(a,d,p),e(d,b),e(d,f),e(f,m),e(d,v)},d(a){a&&o(d)}}}function ll(W){let d,b,f,m,v;return m=new St({props:{code:`from transformers import AutoFeatureExtractor, WavLMForXVector
from datasets import load_dataset
import torch

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

feature_extractor = AutoFeatureExtractor.from_pretrained("microsoft/wavlm-base-plus-sv")
model = WavLMForXVector.from_pretrained("microsoft/wavlm-base-plus-sv")

# audio file is decoded on the fly
inputs = feature_extractor(
    [d["array"] for d in dataset[:2]["audio"]], sampling_rate=sampling_rate, return_tensors="pt", padding=True
)
with torch.no_grad():
    embeddings = model(**inputs).embeddings

embeddings = torch.nn.functional.normalize(embeddings, dim=-1).cpu()

# the resulting embeddings can be used for cosine similarity-based retrieval
cosine_sim = torch.nn.CosineSimilarity(dim=-1)
similarity = cosine_sim(embeddings[0], embeddings[1])
threshold = 0.7  # the optimal threshold is dataset-dependent
if similarity < threshold:
    print("Speakers are not the same!")
round(similarity.item(), 2)`,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=r("p"),b=n("Example:"),f=h(),w(m.$$.fragment)},l(a){d=i(a,"P",{});var p=l(d);b=s(p,"Example:"),p.forEach(o),f=u(a),y(m.$$.fragment,a)},m(a,p){_(a,d,p),e(d,b),_(a,f,p),M(m,a,p),v=!0},p:At,i(a){v||(k(m.$$.fragment,a),v=!0)},o(a){$(m.$$.fragment,a),v=!1},d(a){a&&o(d),a&&o(f),L(m,a)}}}function dl(W){let d,b,f,m,v,a,p,T,za,Ko,R,de,mo,Se,Da,ho,Oa,Ro,ce,Va,ze,Na,Xa,Bo,zt,Ia,Zo,Dt,uo,Ua,Qo,Ot,Ya,Jo,I,De,Ha,Vt,Ka,Ra,Ba,Oe,Za,Nt,Qa,Ja,Ga,fo,en,Go,pe,tn,Ve,on,an,ea,U,nn,Ne,sn,rn,Xe,ln,dn,ta,B,me,go,Ie,cn,_o,pn,oa,x,Ue,mn,Z,hn,Xt,un,fn,Ye,gn,_n,vn,Q,bn,It,wn,yn,Ut,Mn,kn,$n,he,Ln,ue,aa,J,fe,vo,He,Wn,bo,Tn,na,q,Ke,Cn,Re,jn,Be,Fn,xn,qn,Ze,En,Yt,Pn,An,Sn,Qe,zn,Je,Dn,On,Vn,P,Ge,Nn,G,Xn,Ht,In,Un,wo,Yn,Hn,Kn,ge,Rn,_e,sa,ee,ve,yo,et,Bn,Mo,Zn,ra,E,tt,Qn,te,Jn,ko,Gn,es,ot,ts,os,as,at,ns,Kt,ss,rs,is,nt,ls,st,ds,cs,ps,A,rt,ms,oe,hs,Rt,us,fs,$o,gs,_s,vs,be,bs,we,ia,ae,ye,Lo,it,ws,Wo,ys,la,C,lt,Ms,To,ks,$s,dt,Ls,ct,Ws,Ts,Cs,pt,js,Bt,Fs,xs,qs,mt,Es,ht,Ps,As,Ss,S,ut,zs,ne,Ds,Zt,Os,Vs,Co,Ns,Xs,Is,Me,Us,ke,da,se,$e,jo,ft,Ys,Fo,Hs,ca,j,gt,Ks,xo,Rs,Bs,_t,Zs,vt,Qs,Js,Gs,bt,er,Qt,tr,or,ar,wt,nr,yt,sr,rr,ir,z,Mt,lr,re,dr,Jt,cr,pr,qo,mr,hr,ur,Le,fr,We,pa,ie,Te,Eo,kt,gr,Po,_r,ma,F,$t,vr,Ao,br,wr,Lt,yr,Wt,Mr,kr,$r,Tt,Lr,Gt,Wr,Tr,Cr,Ct,jr,jt,Fr,xr,qr,D,Ft,Er,le,Pr,eo,Ar,Sr,So,zr,Dr,Or,Ce,Vr,je,ha;return a=new Ae({}),Se=new Ae({}),Ie=new Ae({}),Ue=new X({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/main/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/main/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/main/en/model_doc/wavlm#transformers.WavLMForCTC">WavLMForCTC</a>.`,name:"final_dropout"},{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/main/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/main/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/main/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/main/src/transformers/models/wavlm/configuration_wavlm.py#L32"}}),he=new Pt({props:{anchor:"transformers.WavLMConfig.example",$$slots:{default:[Qi]},$$scope:{ctx:W}}}),ue=new Pt({props:{anchor:"transformers.WavLMConfig.example-2",$$slots:{default:[Ji]},$$scope:{ctx:W}}}),He=new Ae({}),Ke=new X({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/wavlm/modeling_wavlm.py#L1120"}}),Ge=new X({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/main/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/main/en/model_doc/wav2vec2#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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/wavlm/modeling_wavlm.py#L1206",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/wav2vec2#transformers.modeling_outputs.Wav2Vec2BaseModelOutput"
>transformers.modeling_outputs.Wav2Vec2BaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/en/model_doc/wav2vec2#transformers.modeling_outputs.Wav2Vec2BaseModelOutput"
>transformers.modeling_outputs.Wav2Vec2BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ge=new Ho({props:{$$slots:{default:[Gi]},$$scope:{ctx:W}}}),_e=new Pt({props:{anchor:"transformers.WavLMModel.forward.example",$$slots:{default:[el]},$$scope:{ctx:W}}}),et=new Ae({}),tt=new X({props:{name:"class transformers.WavLMForCTC",anchor:"transformers.WavLMForCTC",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.WavLMForCTC.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/wavlm/modeling_wavlm.py#L1272"}}),rt=new X({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/main/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/main/en/model_doc/wav2vec2#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/main/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/main/src/transformers/models/wavlm/modeling_wavlm.py#L1313",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutput"
>transformers.modeling_outputs.CausalLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutput"
>transformers.modeling_outputs.CausalLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),be=new Ho({props:{$$slots:{default:[tl]},$$scope:{ctx:W}}}),we=new Pt({props:{anchor:"transformers.WavLMForCTC.forward.example",$$slots:{default:[ol]},$$scope:{ctx:W}}}),it=new Ae({}),lt=new X({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/wavlm/modeling_wavlm.py#L1401"}}),ut=new X({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/main/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/main/en/model_doc/wav2vec2#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/main/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/main/src/transformers/models/wavlm/modeling_wavlm.py#L1449",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Me=new Ho({props:{$$slots:{default:[al]},$$scope:{ctx:W}}}),ke=new Pt({props:{anchor:"transformers.WavLMForSequenceClassification.forward.example",$$slots:{default:[nl]},$$scope:{ctx:W}}}),ft=new Ae({}),gt=new X({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/wavlm/modeling_wavlm.py#L1526"}}),Mt=new X({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/main/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/main/en/model_doc/wav2vec2#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/main/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/main/src/transformers/models/wavlm/modeling_wavlm.py#L1570",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Le=new Ho({props:{$$slots:{default:[sl]},$$scope:{ctx:W}}}),We=new Pt({props:{anchor:"transformers.WavLMForAudioFrameClassification.forward.example",$$slots:{default:[rl]},$$scope:{ctx:W}}}),kt=new Ae({}),$t=new X({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/wavlm/modeling_wavlm.py#L1690"}}),Ft=new X({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/main/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/main/en/model_doc/wav2vec2#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/main/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/main/src/transformers/models/wavlm/modeling_wavlm.py#L1752",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.XVectorOutput"
>transformers.modeling_outputs.XVectorOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/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/main/en/main_classes/output#transformers.modeling_outputs.XVectorOutput"
>transformers.modeling_outputs.XVectorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ce=new Ho({props:{$$slots:{default:[il]},$$scope:{ctx:W}}}),je=new Pt({props:{anchor:"transformers.WavLMForXVector.forward.example",$$slots:{default:[ll]},$$scope:{ctx:W}}}),{c(){d=r("meta"),b=h(),f=r("h1"),m=r("a"),v=r("span"),w(a.$$.fragment),p=h(),T=r("span"),za=n("WavLM"),Ko=h(),R=r("h2"),de=r("a"),mo=r("span"),w(Se.$$.fragment),Da=h(),ho=r("span"),Oa=n("Overview"),Ro=h(),ce=r("p"),Va=n("The WavLM model was proposed in "),ze=r("a"),Na=n("WavLM: Large-Scale Self-Supervised Pre-Training for Full Stack Speech Processing"),Xa=n(` 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.`),Bo=h(),zt=r("p"),Ia=n("The abstract from the paper is the following:"),Zo=h(),Dt=r("p"),uo=r("em"),Ua=n(`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.`),Qo=h(),Ot=r("p"),Ya=n("Tips:"),Jo=h(),I=r("ul"),De=r("li"),Ha=n(`WavLM is a speech model that accepts a float array corresponding to the raw waveform of the speech signal. Please use
`),Vt=r("a"),Ka=n("Wav2Vec2Processor"),Ra=n(" for the feature extraction."),Ba=h(),Oe=r("li"),Za=n(`WavLM model can be fine-tuned using connectionist temporal classification (CTC) so the model output has to be decoded
using `),Nt=r("a"),Qa=n("Wav2Vec2CTCTokenizer"),Ja=n("."),Ga=h(),fo=r("li"),en=n("WavLM performs especially well on speaker verification, speaker identification, and speaker diarization tasks."),Go=h(),pe=r("p"),tn=n("Relevant checkpoints can be found under "),Ve=r("a"),on=n("https://huggingface.co/models?other=wavlm"),an=n("."),ea=h(),U=r("p"),nn=n("This model was contributed by "),Ne=r("a"),sn=n("patrickvonplaten"),rn=n(`. The Authors\u2019 code can be
found `),Xe=r("a"),ln=n("here"),dn=n("."),ta=h(),B=r("h2"),me=r("a"),go=r("span"),w(Ie.$$.fragment),cn=h(),_o=r("span"),pn=n("WavLMConfig"),oa=h(),x=r("div"),w(Ue.$$.fragment),mn=h(),Z=r("p"),hn=n("This is the configuration class to store the configuration of a "),Xt=r("a"),un=n("WavLMModel"),fn=n(`. 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
`),Ye=r("a"),gn=n("microsoft/wavlm-base"),_n=n(" architecture."),vn=h(),Q=r("p"),bn=n("Configuration objects inherit from "),It=r("a"),wn=n("PretrainedConfig"),yn=n(` and can be used to control the model outputs. Read the
documentation from `),Ut=r("a"),Mn=n("PretrainedConfig"),kn=n(" for more information."),$n=h(),w(he.$$.fragment),Ln=h(),w(ue.$$.fragment),aa=h(),J=r("h2"),fe=r("a"),vo=r("span"),w(He.$$.fragment),Wn=h(),bo=r("span"),Tn=n("WavLMModel"),na=h(),q=r("div"),w(Ke.$$.fragment),Cn=h(),Re=r("p"),jn=n(`The bare WavLM Model transformer outputting raw hidden-states without any specific head on top.
WavLM was proposed in `),Be=r("a"),Fn=n(`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),xn=n(` by Chengyi Wang, Yu Wu, Yao Qian, Kenichi Kumatani, Shujie Liu, Furu Wei,
Michael Zeng, Xuedong Huang.`),qn=h(),Ze=r("p"),En=n("This model inherits from "),Yt=r("a"),Pn=n("PreTrainedModel"),An=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Sn=h(),Qe=r("p"),zn=n("This model is a PyTorch "),Je=r("a"),Dn=n("torch.nn.Module"),On=n(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Vn=h(),P=r("div"),w(Ge.$$.fragment),Nn=h(),G=r("p"),Xn=n("The "),Ht=r("a"),In=n("WavLMModel"),Un=n(" forward method, overrides the "),wo=r("code"),Yn=n("__call__"),Hn=n(" special method."),Kn=h(),w(ge.$$.fragment),Rn=h(),w(_e.$$.fragment),sa=h(),ee=r("h2"),ve=r("a"),yo=r("span"),w(et.$$.fragment),Bn=h(),Mo=r("span"),Zn=n("WavLMForCTC"),ra=h(),E=r("div"),w(tt.$$.fragment),Qn=h(),te=r("p"),Jn=n("WavLM Model with a "),ko=r("code"),Gn=n("language modeling"),es=n(` head on top for Connectionist Temporal Classification (CTC).
WavLM was proposed in `),ot=r("a"),ts=n(`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),os=n(` by Chengyi Wang, Yu Wu, Yao Qian, Kenichi Kumatani, Shujie Liu, Furu Wei,
Michael Zeng, Xuedong Huang.`),as=h(),at=r("p"),ns=n("This model inherits from "),Kt=r("a"),ss=n("PreTrainedModel"),rs=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),is=h(),nt=r("p"),ls=n("This model is a PyTorch "),st=r("a"),ds=n("torch.nn.Module"),cs=n(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ps=h(),A=r("div"),w(rt.$$.fragment),ms=h(),oe=r("p"),hs=n("The "),Rt=r("a"),us=n("WavLMForCTC"),fs=n(" forward method, overrides the "),$o=r("code"),gs=n("__call__"),_s=n(" special method."),vs=h(),w(be.$$.fragment),bs=h(),w(we.$$.fragment),ia=h(),ae=r("h2"),ye=r("a"),Lo=r("span"),w(it.$$.fragment),ws=h(),Wo=r("span"),ys=n("WavLMForSequenceClassification"),la=h(),C=r("div"),w(lt.$$.fragment),Ms=h(),To=r("p"),ks=n(`WavLM Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like
SUPERB Keyword Spotting.`),$s=h(),dt=r("p"),Ls=n("WavLM was proposed in "),ct=r("a"),Ws=n(`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),Ts=n(` by Chengyi Wang, Yu Wu, Yao Qian, Kenichi Kumatani, Shujie Liu, Furu Wei,
Michael Zeng, Xuedong Huang.`),Cs=h(),pt=r("p"),js=n("This model inherits from "),Bt=r("a"),Fs=n("PreTrainedModel"),xs=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),qs=h(),mt=r("p"),Es=n("This model is a PyTorch "),ht=r("a"),Ps=n("torch.nn.Module"),As=n(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ss=h(),S=r("div"),w(ut.$$.fragment),zs=h(),ne=r("p"),Ds=n("The "),Zt=r("a"),Os=n("WavLMForSequenceClassification"),Vs=n(" forward method, overrides the "),Co=r("code"),Ns=n("__call__"),Xs=n(" special method."),Is=h(),w(Me.$$.fragment),Us=h(),w(ke.$$.fragment),da=h(),se=r("h2"),$e=r("a"),jo=r("span"),w(ft.$$.fragment),Ys=h(),Fo=r("span"),Hs=n("WavLMForAudioFrameClassification"),ca=h(),j=r("div"),w(gt.$$.fragment),Ks=h(),xo=r("p"),Rs=n("WavLM Model with a frame classification head on top for tasks like Speaker Diarization."),Bs=h(),_t=r("p"),Zs=n("WavLM was proposed in "),vt=r("a"),Qs=n(`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),Js=n(` by Chengyi Wang, Yu Wu, Yao Qian, Kenichi Kumatani, Shujie Liu, Furu Wei,
Michael Zeng, Xuedong Huang.`),Gs=h(),bt=r("p"),er=n("This model inherits from "),Qt=r("a"),tr=n("PreTrainedModel"),or=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),ar=h(),wt=r("p"),nr=n("This model is a PyTorch "),yt=r("a"),sr=n("torch.nn.Module"),rr=n(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ir=h(),z=r("div"),w(Mt.$$.fragment),lr=h(),re=r("p"),dr=n("The "),Jt=r("a"),cr=n("WavLMForAudioFrameClassification"),pr=n(" forward method, overrides the "),qo=r("code"),mr=n("__call__"),hr=n(" special method."),ur=h(),w(Le.$$.fragment),fr=h(),w(We.$$.fragment),pa=h(),ie=r("h2"),Te=r("a"),Eo=r("span"),w(kt.$$.fragment),gr=h(),Po=r("span"),_r=n("WavLMForXVector"),ma=h(),F=r("div"),w($t.$$.fragment),vr=h(),Ao=r("p"),br=n("WavLM Model with an XVector feature extraction head on top for tasks like Speaker Verification."),wr=h(),Lt=r("p"),yr=n("WavLM was proposed in "),Wt=r("a"),Mr=n(`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),kr=n(` by Chengyi Wang, Yu Wu, Yao Qian, Kenichi Kumatani, Shujie Liu, Furu Wei,
Michael Zeng, Xuedong Huang.`),$r=h(),Tt=r("p"),Lr=n("This model inherits from "),Gt=r("a"),Wr=n("PreTrainedModel"),Tr=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Cr=h(),Ct=r("p"),jr=n("This model is a PyTorch "),jt=r("a"),Fr=n("torch.nn.Module"),xr=n(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),qr=h(),D=r("div"),w(Ft.$$.fragment),Er=h(),le=r("p"),Pr=n("The "),eo=r("a"),Ar=n("WavLMForXVector"),Sr=n(" forward method, overrides the "),So=r("code"),zr=n("__call__"),Dr=n(" special method."),Or=h(),w(Ce.$$.fragment),Vr=h(),w(je.$$.fragment),this.h()},l(t){const g=Bi('[data-svelte="svelte-1phssyn"]',document.head);d=i(g,"META",{name:!0,content:!0}),g.forEach(o),b=u(t),f=i(t,"H1",{class:!0});var xt=l(f);m=i(xt,"A",{id:!0,class:!0,href:!0});var zo=l(m);v=i(zo,"SPAN",{});var Do=l(v);y(a.$$.fragment,Do),Do.forEach(o),zo.forEach(o),p=u(xt),T=i(xt,"SPAN",{});var Oo=l(T);za=s(Oo,"WavLM"),Oo.forEach(o),xt.forEach(o),Ko=u(t),R=i(t,"H2",{class:!0});var qt=l(R);de=i(qt,"A",{id:!0,class:!0,href:!0});var Vo=l(de);mo=i(Vo,"SPAN",{});var No=l(mo);y(Se.$$.fragment,No),No.forEach(o),Vo.forEach(o),Da=u(qt),ho=i(qt,"SPAN",{});var Xo=l(ho);Oa=s(Xo,"Overview"),Xo.forEach(o),qt.forEach(o),Ro=u(t),ce=i(t,"P",{});var Et=l(ce);Va=s(Et,"The WavLM model was proposed in "),ze=i(Et,"A",{href:!0,rel:!0});var Io=l(ze);Na=s(Io,"WavLM: Large-Scale Self-Supervised Pre-Training for Full Stack Speech Processing"),Io.forEach(o),Xa=s(Et,` 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.`),Et.forEach(o),Bo=u(t),zt=i(t,"P",{});var Uo=l(zt);Ia=s(Uo,"The abstract from the paper is the following:"),Uo.forEach(o),Zo=u(t),Dt=i(t,"P",{});var Yo=l(Dt);uo=i(Yo,"EM",{});var Nr=l(uo);Ua=s(Nr,`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.`),Nr.forEach(o),Yo.forEach(o),Qo=u(t),Ot=i(t,"P",{});var Xr=l(Ot);Ya=s(Xr,"Tips:"),Xr.forEach(o),Jo=u(t),I=i(t,"UL",{});var to=l(I);De=i(to,"LI",{});var ua=l(De);Ha=s(ua,`WavLM is a speech model that accepts a float array corresponding to the raw waveform of the speech signal. Please use
`),Vt=i(ua,"A",{href:!0});var Ir=l(Vt);Ka=s(Ir,"Wav2Vec2Processor"),Ir.forEach(o),Ra=s(ua," for the feature extraction."),ua.forEach(o),Ba=u(to),Oe=i(to,"LI",{});var fa=l(Oe);Za=s(fa,`WavLM model can be fine-tuned using connectionist temporal classification (CTC) so the model output has to be decoded
using `),Nt=i(fa,"A",{href:!0});var Ur=l(Nt);Qa=s(Ur,"Wav2Vec2CTCTokenizer"),Ur.forEach(o),Ja=s(fa,"."),fa.forEach(o),Ga=u(to),fo=i(to,"LI",{});var Yr=l(fo);en=s(Yr,"WavLM performs especially well on speaker verification, speaker identification, and speaker diarization tasks."),Yr.forEach(o),to.forEach(o),Go=u(t),pe=i(t,"P",{});var ga=l(pe);tn=s(ga,"Relevant checkpoints can be found under "),Ve=i(ga,"A",{href:!0,rel:!0});var Hr=l(Ve);on=s(Hr,"https://huggingface.co/models?other=wavlm"),Hr.forEach(o),an=s(ga,"."),ga.forEach(o),ea=u(t),U=i(t,"P",{});var oo=l(U);nn=s(oo,"This model was contributed by "),Ne=i(oo,"A",{href:!0,rel:!0});var Kr=l(Ne);sn=s(Kr,"patrickvonplaten"),Kr.forEach(o),rn=s(oo,`. The Authors\u2019 code can be
found `),Xe=i(oo,"A",{href:!0,rel:!0});var Rr=l(Xe);ln=s(Rr,"here"),Rr.forEach(o),dn=s(oo,"."),oo.forEach(o),ta=u(t),B=i(t,"H2",{class:!0});var _a=l(B);me=i(_a,"A",{id:!0,class:!0,href:!0});var Br=l(me);go=i(Br,"SPAN",{});var Zr=l(go);y(Ie.$$.fragment,Zr),Zr.forEach(o),Br.forEach(o),cn=u(_a),_o=i(_a,"SPAN",{});var Qr=l(_o);pn=s(Qr,"WavLMConfig"),Qr.forEach(o),_a.forEach(o),oa=u(t),x=i(t,"DIV",{class:!0});var Y=l(x);y(Ue.$$.fragment,Y),mn=u(Y),Z=i(Y,"P",{});var ao=l(Z);hn=s(ao,"This is the configuration class to store the configuration of a "),Xt=i(ao,"A",{href:!0});var Jr=l(Xt);un=s(Jr,"WavLMModel"),Jr.forEach(o),fn=s(ao,`. 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
`),Ye=i(ao,"A",{href:!0,rel:!0});var Gr=l(Ye);gn=s(Gr,"microsoft/wavlm-base"),Gr.forEach(o),_n=s(ao," architecture."),ao.forEach(o),vn=u(Y),Q=i(Y,"P",{});var no=l(Q);bn=s(no,"Configuration objects inherit from "),It=i(no,"A",{href:!0});var ei=l(It);wn=s(ei,"PretrainedConfig"),ei.forEach(o),yn=s(no,` and can be used to control the model outputs. Read the
documentation from `),Ut=i(no,"A",{href:!0});var ti=l(Ut);Mn=s(ti,"PretrainedConfig"),ti.forEach(o),kn=s(no," for more information."),no.forEach(o),$n=u(Y),y(he.$$.fragment,Y),Ln=u(Y),y(ue.$$.fragment,Y),Y.forEach(o),aa=u(t),J=i(t,"H2",{class:!0});var va=l(J);fe=i(va,"A",{id:!0,class:!0,href:!0});var oi=l(fe);vo=i(oi,"SPAN",{});var ai=l(vo);y(He.$$.fragment,ai),ai.forEach(o),oi.forEach(o),Wn=u(va),bo=i(va,"SPAN",{});var ni=l(bo);Tn=s(ni,"WavLMModel"),ni.forEach(o),va.forEach(o),na=u(t),q=i(t,"DIV",{class:!0});var H=l(q);y(Ke.$$.fragment,H),Cn=u(H),Re=i(H,"P",{});var ba=l(Re);jn=s(ba,`The bare WavLM Model transformer outputting raw hidden-states without any specific head on top.
WavLM was proposed in `),Be=i(ba,"A",{href:!0,rel:!0});var si=l(Be);Fn=s(si,`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),si.forEach(o),xn=s(ba,` by Chengyi Wang, Yu Wu, Yao Qian, Kenichi Kumatani, Shujie Liu, Furu Wei,
Michael Zeng, Xuedong Huang.`),ba.forEach(o),qn=u(H),Ze=i(H,"P",{});var wa=l(Ze);En=s(wa,"This model inherits from "),Yt=i(wa,"A",{href:!0});var ri=l(Yt);Pn=s(ri,"PreTrainedModel"),ri.forEach(o),An=s(wa,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),wa.forEach(o),Sn=u(H),Qe=i(H,"P",{});var ya=l(Qe);zn=s(ya,"This model is a PyTorch "),Je=i(ya,"A",{href:!0,rel:!0});var ii=l(Je);Dn=s(ii,"torch.nn.Module"),ii.forEach(o),On=s(ya,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ya.forEach(o),Vn=u(H),P=i(H,"DIV",{class:!0});var Fe=l(P);y(Ge.$$.fragment,Fe),Nn=u(Fe),G=i(Fe,"P",{});var so=l(G);Xn=s(so,"The "),Ht=i(so,"A",{href:!0});var li=l(Ht);In=s(li,"WavLMModel"),li.forEach(o),Un=s(so," forward method, overrides the "),wo=i(so,"CODE",{});var di=l(wo);Yn=s(di,"__call__"),di.forEach(o),Hn=s(so," special method."),so.forEach(o),Kn=u(Fe),y(ge.$$.fragment,Fe),Rn=u(Fe),y(_e.$$.fragment,Fe),Fe.forEach(o),H.forEach(o),sa=u(t),ee=i(t,"H2",{class:!0});var Ma=l(ee);ve=i(Ma,"A",{id:!0,class:!0,href:!0});var ci=l(ve);yo=i(ci,"SPAN",{});var pi=l(yo);y(et.$$.fragment,pi),pi.forEach(o),ci.forEach(o),Bn=u(Ma),Mo=i(Ma,"SPAN",{});var mi=l(Mo);Zn=s(mi,"WavLMForCTC"),mi.forEach(o),Ma.forEach(o),ra=u(t),E=i(t,"DIV",{class:!0});var K=l(E);y(tt.$$.fragment,K),Qn=u(K),te=i(K,"P",{});var ro=l(te);Jn=s(ro,"WavLM Model with a "),ko=i(ro,"CODE",{});var hi=l(ko);Gn=s(hi,"language modeling"),hi.forEach(o),es=s(ro,` head on top for Connectionist Temporal Classification (CTC).
WavLM was proposed in `),ot=i(ro,"A",{href:!0,rel:!0});var ui=l(ot);ts=s(ui,`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),ui.forEach(o),os=s(ro,` by Chengyi Wang, Yu Wu, Yao Qian, Kenichi Kumatani, Shujie Liu, Furu Wei,
Michael Zeng, Xuedong Huang.`),ro.forEach(o),as=u(K),at=i(K,"P",{});var ka=l(at);ns=s(ka,"This model inherits from "),Kt=i(ka,"A",{href:!0});var fi=l(Kt);ss=s(fi,"PreTrainedModel"),fi.forEach(o),rs=s(ka,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),ka.forEach(o),is=u(K),nt=i(K,"P",{});var $a=l(nt);ls=s($a,"This model is a PyTorch "),st=i($a,"A",{href:!0,rel:!0});var gi=l(st);ds=s(gi,"torch.nn.Module"),gi.forEach(o),cs=s($a,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),$a.forEach(o),ps=u(K),A=i(K,"DIV",{class:!0});var xe=l(A);y(rt.$$.fragment,xe),ms=u(xe),oe=i(xe,"P",{});var io=l(oe);hs=s(io,"The "),Rt=i(io,"A",{href:!0});var _i=l(Rt);us=s(_i,"WavLMForCTC"),_i.forEach(o),fs=s(io," forward method, overrides the "),$o=i(io,"CODE",{});var vi=l($o);gs=s(vi,"__call__"),vi.forEach(o),_s=s(io," special method."),io.forEach(o),vs=u(xe),y(be.$$.fragment,xe),bs=u(xe),y(we.$$.fragment,xe),xe.forEach(o),K.forEach(o),ia=u(t),ae=i(t,"H2",{class:!0});var La=l(ae);ye=i(La,"A",{id:!0,class:!0,href:!0});var bi=l(ye);Lo=i(bi,"SPAN",{});var wi=l(Lo);y(it.$$.fragment,wi),wi.forEach(o),bi.forEach(o),ws=u(La),Wo=i(La,"SPAN",{});var yi=l(Wo);ys=s(yi,"WavLMForSequenceClassification"),yi.forEach(o),La.forEach(o),la=u(t),C=i(t,"DIV",{class:!0});var O=l(C);y(lt.$$.fragment,O),Ms=u(O),To=i(O,"P",{});var Mi=l(To);ks=s(Mi,`WavLM Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like
SUPERB Keyword Spotting.`),Mi.forEach(o),$s=u(O),dt=i(O,"P",{});var Wa=l(dt);Ls=s(Wa,"WavLM was proposed in "),ct=i(Wa,"A",{href:!0,rel:!0});var ki=l(ct);Ws=s(ki,`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),ki.forEach(o),Ts=s(Wa,` by Chengyi Wang, Yu Wu, Yao Qian, Kenichi Kumatani, Shujie Liu, Furu Wei,
Michael Zeng, Xuedong Huang.`),Wa.forEach(o),Cs=u(O),pt=i(O,"P",{});var Ta=l(pt);js=s(Ta,"This model inherits from "),Bt=i(Ta,"A",{href:!0});var $i=l(Bt);Fs=s($i,"PreTrainedModel"),$i.forEach(o),xs=s(Ta,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Ta.forEach(o),qs=u(O),mt=i(O,"P",{});var Ca=l(mt);Es=s(Ca,"This model is a PyTorch "),ht=i(Ca,"A",{href:!0,rel:!0});var Li=l(ht);Ps=s(Li,"torch.nn.Module"),Li.forEach(o),As=s(Ca,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ca.forEach(o),Ss=u(O),S=i(O,"DIV",{class:!0});var qe=l(S);y(ut.$$.fragment,qe),zs=u(qe),ne=i(qe,"P",{});var lo=l(ne);Ds=s(lo,"The "),Zt=i(lo,"A",{href:!0});var Wi=l(Zt);Os=s(Wi,"WavLMForSequenceClassification"),Wi.forEach(o),Vs=s(lo," forward method, overrides the "),Co=i(lo,"CODE",{});var Ti=l(Co);Ns=s(Ti,"__call__"),Ti.forEach(o),Xs=s(lo," special method."),lo.forEach(o),Is=u(qe),y(Me.$$.fragment,qe),Us=u(qe),y(ke.$$.fragment,qe),qe.forEach(o),O.forEach(o),da=u(t),se=i(t,"H2",{class:!0});var ja=l(se);$e=i(ja,"A",{id:!0,class:!0,href:!0});var Ci=l($e);jo=i(Ci,"SPAN",{});var ji=l(jo);y(ft.$$.fragment,ji),ji.forEach(o),Ci.forEach(o),Ys=u(ja),Fo=i(ja,"SPAN",{});var Fi=l(Fo);Hs=s(Fi,"WavLMForAudioFrameClassification"),Fi.forEach(o),ja.forEach(o),ca=u(t),j=i(t,"DIV",{class:!0});var V=l(j);y(gt.$$.fragment,V),Ks=u(V),xo=i(V,"P",{});var xi=l(xo);Rs=s(xi,"WavLM Model with a frame classification head on top for tasks like Speaker Diarization."),xi.forEach(o),Bs=u(V),_t=i(V,"P",{});var Fa=l(_t);Zs=s(Fa,"WavLM was proposed in "),vt=i(Fa,"A",{href:!0,rel:!0});var qi=l(vt);Qs=s(qi,`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),qi.forEach(o),Js=s(Fa,` by Chengyi Wang, Yu Wu, Yao Qian, Kenichi Kumatani, Shujie Liu, Furu Wei,
Michael Zeng, Xuedong Huang.`),Fa.forEach(o),Gs=u(V),bt=i(V,"P",{});var xa=l(bt);er=s(xa,"This model inherits from "),Qt=i(xa,"A",{href:!0});var Ei=l(Qt);tr=s(Ei,"PreTrainedModel"),Ei.forEach(o),or=s(xa,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),xa.forEach(o),ar=u(V),wt=i(V,"P",{});var qa=l(wt);nr=s(qa,"This model is a PyTorch "),yt=i(qa,"A",{href:!0,rel:!0});var Pi=l(yt);sr=s(Pi,"torch.nn.Module"),Pi.forEach(o),rr=s(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),ir=u(V),z=i(V,"DIV",{class:!0});var Ee=l(z);y(Mt.$$.fragment,Ee),lr=u(Ee),re=i(Ee,"P",{});var co=l(re);dr=s(co,"The "),Jt=i(co,"A",{href:!0});var Ai=l(Jt);cr=s(Ai,"WavLMForAudioFrameClassification"),Ai.forEach(o),pr=s(co," forward method, overrides the "),qo=i(co,"CODE",{});var Si=l(qo);mr=s(Si,"__call__"),Si.forEach(o),hr=s(co," special method."),co.forEach(o),ur=u(Ee),y(Le.$$.fragment,Ee),fr=u(Ee),y(We.$$.fragment,Ee),Ee.forEach(o),V.forEach(o),pa=u(t),ie=i(t,"H2",{class:!0});var Ea=l(ie);Te=i(Ea,"A",{id:!0,class:!0,href:!0});var zi=l(Te);Eo=i(zi,"SPAN",{});var Di=l(Eo);y(kt.$$.fragment,Di),Di.forEach(o),zi.forEach(o),gr=u(Ea),Po=i(Ea,"SPAN",{});var Oi=l(Po);_r=s(Oi,"WavLMForXVector"),Oi.forEach(o),Ea.forEach(o),ma=u(t),F=i(t,"DIV",{class:!0});var N=l(F);y($t.$$.fragment,N),vr=u(N),Ao=i(N,"P",{});var Vi=l(Ao);br=s(Vi,"WavLM Model with an XVector feature extraction head on top for tasks like Speaker Verification."),Vi.forEach(o),wr=u(N),Lt=i(N,"P",{});var Pa=l(Lt);yr=s(Pa,"WavLM was proposed in "),Wt=i(Pa,"A",{href:!0,rel:!0});var Ni=l(Wt);Mr=s(Ni,`WavLM: Unified Speech Representation Learning with Labeled and Unlabeled
Data`),Ni.forEach(o),kr=s(Pa,` by Chengyi Wang, Yu Wu, Yao Qian, Kenichi Kumatani, Shujie Liu, Furu Wei,
Michael Zeng, Xuedong Huang.`),Pa.forEach(o),$r=u(N),Tt=i(N,"P",{});var Aa=l(Tt);Lr=s(Aa,"This model inherits from "),Gt=i(Aa,"A",{href:!0});var Xi=l(Gt);Wr=s(Xi,"PreTrainedModel"),Xi.forEach(o),Tr=s(Aa,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Aa.forEach(o),Cr=u(N),Ct=i(N,"P",{});var Sa=l(Ct);jr=s(Sa,"This model is a PyTorch "),jt=i(Sa,"A",{href:!0,rel:!0});var Ii=l(jt);Fr=s(Ii,"torch.nn.Module"),Ii.forEach(o),xr=s(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),qr=u(N),D=i(N,"DIV",{class:!0});var Pe=l(D);y(Ft.$$.fragment,Pe),Er=u(Pe),le=i(Pe,"P",{});var po=l(le);Pr=s(po,"The "),eo=i(po,"A",{href:!0});var Ui=l(eo);Ar=s(Ui,"WavLMForXVector"),Ui.forEach(o),Sr=s(po," forward method, overrides the "),So=i(po,"CODE",{});var Yi=l(So);zr=s(Yi,"__call__"),Yi.forEach(o),Dr=s(po," special method."),po.forEach(o),Or=u(Pe),y(Ce.$$.fragment,Pe),Vr=u(Pe),y(je.$$.fragment,Pe),Pe.forEach(o),N.forEach(o),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(cl)),c(m,"id","wavlm"),c(m,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(m,"href","#wavlm"),c(f,"class","relative group"),c(de,"id","overview"),c(de,"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(de,"href","#overview"),c(R,"class","relative group"),c(ze,"href","https://arxiv.org/abs/2110.13900"),c(ze,"rel","nofollow"),c(Vt,"href","/docs/transformers/main/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor"),c(Nt,"href","/docs/transformers/main/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer"),c(Ve,"href","https://huggingface.co/models?other=wavlm"),c(Ve,"rel","nofollow"),c(Ne,"href","https://huggingface.co/patrickvonplaten"),c(Ne,"rel","nofollow"),c(Xe,"href","https://github.com/microsoft/unilm/tree/master/wavlm"),c(Xe,"rel","nofollow"),c(me,"id","transformers.WavLMConfig"),c(me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(me,"href","#transformers.WavLMConfig"),c(B,"class","relative group"),c(Xt,"href","/docs/transformers/main/en/model_doc/wavlm#transformers.WavLMModel"),c(Ye,"href","https://huggingface.co/microsoft/wavlm-base"),c(Ye,"rel","nofollow"),c(It,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(Ut,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(fe,"id","transformers.WavLMModel"),c(fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(fe,"href","#transformers.WavLMModel"),c(J,"class","relative group"),c(Be,"href","https://arxiv.org/abs/2101.07597"),c(Be,"rel","nofollow"),c(Yt,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),c(Je,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Je,"rel","nofollow"),c(Ht,"href","/docs/transformers/main/en/model_doc/wavlm#transformers.WavLMModel"),c(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ve,"id","transformers.WavLMForCTC"),c(ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ve,"href","#transformers.WavLMForCTC"),c(ee,"class","relative group"),c(ot,"href","https://arxiv.org/abs/2101.07597"),c(ot,"rel","nofollow"),c(Kt,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),c(st,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(st,"rel","nofollow"),c(Rt,"href","/docs/transformers/main/en/model_doc/wavlm#transformers.WavLMForCTC"),c(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(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(ye,"id","transformers.WavLMForSequenceClassification"),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.WavLMForSequenceClassification"),c(ae,"class","relative group"),c(ct,"href","https://arxiv.org/abs/2101.07597"),c(ct,"rel","nofollow"),c(Bt,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),c(ht,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(ht,"rel","nofollow"),c(Zt,"href","/docs/transformers/main/en/model_doc/wavlm#transformers.WavLMForSequenceClassification"),c(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(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($e,"id","transformers.WavLMForAudioFrameClassification"),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.WavLMForAudioFrameClassification"),c(se,"class","relative group"),c(vt,"href","https://arxiv.org/abs/2101.07597"),c(vt,"rel","nofollow"),c(Qt,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),c(yt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(yt,"rel","nofollow"),c(Jt,"href","/docs/transformers/main/en/model_doc/wavlm#transformers.WavLMForAudioFrameClassification"),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(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(Te,"id","transformers.WavLMForXVector"),c(Te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Te,"href","#transformers.WavLMForXVector"),c(ie,"class","relative group"),c(Wt,"href","https://arxiv.org/abs/2101.07597"),c(Wt,"rel","nofollow"),c(Gt,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),c(jt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(jt,"rel","nofollow"),c(eo,"href","/docs/transformers/main/en/model_doc/wavlm#transformers.WavLMForXVector"),c(D,"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),_(t,b,g),_(t,f,g),e(f,m),e(m,v),M(a,v,null),e(f,p),e(f,T),e(T,za),_(t,Ko,g),_(t,R,g),e(R,de),e(de,mo),M(Se,mo,null),e(R,Da),e(R,ho),e(ho,Oa),_(t,Ro,g),_(t,ce,g),e(ce,Va),e(ce,ze),e(ze,Na),e(ce,Xa),_(t,Bo,g),_(t,zt,g),e(zt,Ia),_(t,Zo,g),_(t,Dt,g),e(Dt,uo),e(uo,Ua),_(t,Qo,g),_(t,Ot,g),e(Ot,Ya),_(t,Jo,g),_(t,I,g),e(I,De),e(De,Ha),e(De,Vt),e(Vt,Ka),e(De,Ra),e(I,Ba),e(I,Oe),e(Oe,Za),e(Oe,Nt),e(Nt,Qa),e(Oe,Ja),e(I,Ga),e(I,fo),e(fo,en),_(t,Go,g),_(t,pe,g),e(pe,tn),e(pe,Ve),e(Ve,on),e(pe,an),_(t,ea,g),_(t,U,g),e(U,nn),e(U,Ne),e(Ne,sn),e(U,rn),e(U,Xe),e(Xe,ln),e(U,dn),_(t,ta,g),_(t,B,g),e(B,me),e(me,go),M(Ie,go,null),e(B,cn),e(B,_o),e(_o,pn),_(t,oa,g),_(t,x,g),M(Ue,x,null),e(x,mn),e(x,Z),e(Z,hn),e(Z,Xt),e(Xt,un),e(Z,fn),e(Z,Ye),e(Ye,gn),e(Z,_n),e(x,vn),e(x,Q),e(Q,bn),e(Q,It),e(It,wn),e(Q,yn),e(Q,Ut),e(Ut,Mn),e(Q,kn),e(x,$n),M(he,x,null),e(x,Ln),M(ue,x,null),_(t,aa,g),_(t,J,g),e(J,fe),e(fe,vo),M(He,vo,null),e(J,Wn),e(J,bo),e(bo,Tn),_(t,na,g),_(t,q,g),M(Ke,q,null),e(q,Cn),e(q,Re),e(Re,jn),e(Re,Be),e(Be,Fn),e(Re,xn),e(q,qn),e(q,Ze),e(Ze,En),e(Ze,Yt),e(Yt,Pn),e(Ze,An),e(q,Sn),e(q,Qe),e(Qe,zn),e(Qe,Je),e(Je,Dn),e(Qe,On),e(q,Vn),e(q,P),M(Ge,P,null),e(P,Nn),e(P,G),e(G,Xn),e(G,Ht),e(Ht,In),e(G,Un),e(G,wo),e(wo,Yn),e(G,Hn),e(P,Kn),M(ge,P,null),e(P,Rn),M(_e,P,null),_(t,sa,g),_(t,ee,g),e(ee,ve),e(ve,yo),M(et,yo,null),e(ee,Bn),e(ee,Mo),e(Mo,Zn),_(t,ra,g),_(t,E,g),M(tt,E,null),e(E,Qn),e(E,te),e(te,Jn),e(te,ko),e(ko,Gn),e(te,es),e(te,ot),e(ot,ts),e(te,os),e(E,as),e(E,at),e(at,ns),e(at,Kt),e(Kt,ss),e(at,rs),e(E,is),e(E,nt),e(nt,ls),e(nt,st),e(st,ds),e(nt,cs),e(E,ps),e(E,A),M(rt,A,null),e(A,ms),e(A,oe),e(oe,hs),e(oe,Rt),e(Rt,us),e(oe,fs),e(oe,$o),e($o,gs),e(oe,_s),e(A,vs),M(be,A,null),e(A,bs),M(we,A,null),_(t,ia,g),_(t,ae,g),e(ae,ye),e(ye,Lo),M(it,Lo,null),e(ae,ws),e(ae,Wo),e(Wo,ys),_(t,la,g),_(t,C,g),M(lt,C,null),e(C,Ms),e(C,To),e(To,ks),e(C,$s),e(C,dt),e(dt,Ls),e(dt,ct),e(ct,Ws),e(dt,Ts),e(C,Cs),e(C,pt),e(pt,js),e(pt,Bt),e(Bt,Fs),e(pt,xs),e(C,qs),e(C,mt),e(mt,Es),e(mt,ht),e(ht,Ps),e(mt,As),e(C,Ss),e(C,S),M(ut,S,null),e(S,zs),e(S,ne),e(ne,Ds),e(ne,Zt),e(Zt,Os),e(ne,Vs),e(ne,Co),e(Co,Ns),e(ne,Xs),e(S,Is),M(Me,S,null),e(S,Us),M(ke,S,null),_(t,da,g),_(t,se,g),e(se,$e),e($e,jo),M(ft,jo,null),e(se,Ys),e(se,Fo),e(Fo,Hs),_(t,ca,g),_(t,j,g),M(gt,j,null),e(j,Ks),e(j,xo),e(xo,Rs),e(j,Bs),e(j,_t),e(_t,Zs),e(_t,vt),e(vt,Qs),e(_t,Js),e(j,Gs),e(j,bt),e(bt,er),e(bt,Qt),e(Qt,tr),e(bt,or),e(j,ar),e(j,wt),e(wt,nr),e(wt,yt),e(yt,sr),e(wt,rr),e(j,ir),e(j,z),M(Mt,z,null),e(z,lr),e(z,re),e(re,dr),e(re,Jt),e(Jt,cr),e(re,pr),e(re,qo),e(qo,mr),e(re,hr),e(z,ur),M(Le,z,null),e(z,fr),M(We,z,null),_(t,pa,g),_(t,ie,g),e(ie,Te),e(Te,Eo),M(kt,Eo,null),e(ie,gr),e(ie,Po),e(Po,_r),_(t,ma,g),_(t,F,g),M($t,F,null),e(F,vr),e(F,Ao),e(Ao,br),e(F,wr),e(F,Lt),e(Lt,yr),e(Lt,Wt),e(Wt,Mr),e(Lt,kr),e(F,$r),e(F,Tt),e(Tt,Lr),e(Tt,Gt),e(Gt,Wr),e(Tt,Tr),e(F,Cr),e(F,Ct),e(Ct,jr),e(Ct,jt),e(jt,Fr),e(Ct,xr),e(F,qr),e(F,D),M(Ft,D,null),e(D,Er),e(D,le),e(le,Pr),e(le,eo),e(eo,Ar),e(le,Sr),e(le,So),e(So,zr),e(le,Dr),e(D,Or),M(Ce,D,null),e(D,Vr),M(je,D,null),ha=!0},p(t,[g]){const xt={};g&2&&(xt.$$scope={dirty:g,ctx:t}),he.$set(xt);const zo={};g&2&&(zo.$$scope={dirty:g,ctx:t}),ue.$set(zo);const Do={};g&2&&(Do.$$scope={dirty:g,ctx:t}),ge.$set(Do);const Oo={};g&2&&(Oo.$$scope={dirty:g,ctx:t}),_e.$set(Oo);const qt={};g&2&&(qt.$$scope={dirty:g,ctx:t}),be.$set(qt);const Vo={};g&2&&(Vo.$$scope={dirty:g,ctx:t}),we.$set(Vo);const No={};g&2&&(No.$$scope={dirty:g,ctx:t}),Me.$set(No);const Xo={};g&2&&(Xo.$$scope={dirty:g,ctx:t}),ke.$set(Xo);const Et={};g&2&&(Et.$$scope={dirty:g,ctx:t}),Le.$set(Et);const Io={};g&2&&(Io.$$scope={dirty:g,ctx:t}),We.$set(Io);const Uo={};g&2&&(Uo.$$scope={dirty:g,ctx:t}),Ce.$set(Uo);const Yo={};g&2&&(Yo.$$scope={dirty:g,ctx:t}),je.$set(Yo)},i(t){ha||(k(a.$$.fragment,t),k(Se.$$.fragment,t),k(Ie.$$.fragment,t),k(Ue.$$.fragment,t),k(he.$$.fragment,t),k(ue.$$.fragment,t),k(He.$$.fragment,t),k(Ke.$$.fragment,t),k(Ge.$$.fragment,t),k(ge.$$.fragment,t),k(_e.$$.fragment,t),k(et.$$.fragment,t),k(tt.$$.fragment,t),k(rt.$$.fragment,t),k(be.$$.fragment,t),k(we.$$.fragment,t),k(it.$$.fragment,t),k(lt.$$.fragment,t),k(ut.$$.fragment,t),k(Me.$$.fragment,t),k(ke.$$.fragment,t),k(ft.$$.fragment,t),k(gt.$$.fragment,t),k(Mt.$$.fragment,t),k(Le.$$.fragment,t),k(We.$$.fragment,t),k(kt.$$.fragment,t),k($t.$$.fragment,t),k(Ft.$$.fragment,t),k(Ce.$$.fragment,t),k(je.$$.fragment,t),ha=!0)},o(t){$(a.$$.fragment,t),$(Se.$$.fragment,t),$(Ie.$$.fragment,t),$(Ue.$$.fragment,t),$(he.$$.fragment,t),$(ue.$$.fragment,t),$(He.$$.fragment,t),$(Ke.$$.fragment,t),$(Ge.$$.fragment,t),$(ge.$$.fragment,t),$(_e.$$.fragment,t),$(et.$$.fragment,t),$(tt.$$.fragment,t),$(rt.$$.fragment,t),$(be.$$.fragment,t),$(we.$$.fragment,t),$(it.$$.fragment,t),$(lt.$$.fragment,t),$(ut.$$.fragment,t),$(Me.$$.fragment,t),$(ke.$$.fragment,t),$(ft.$$.fragment,t),$(gt.$$.fragment,t),$(Mt.$$.fragment,t),$(Le.$$.fragment,t),$(We.$$.fragment,t),$(kt.$$.fragment,t),$($t.$$.fragment,t),$(Ft.$$.fragment,t),$(Ce.$$.fragment,t),$(je.$$.fragment,t),ha=!1},d(t){o(d),t&&o(b),t&&o(f),L(a),t&&o(Ko),t&&o(R),L(Se),t&&o(Ro),t&&o(ce),t&&o(Bo),t&&o(zt),t&&o(Zo),t&&o(Dt),t&&o(Qo),t&&o(Ot),t&&o(Jo),t&&o(I),t&&o(Go),t&&o(pe),t&&o(ea),t&&o(U),t&&o(ta),t&&o(B),L(Ie),t&&o(oa),t&&o(x),L(Ue),L(he),L(ue),t&&o(aa),t&&o(J),L(He),t&&o(na),t&&o(q),L(Ke),L(Ge),L(ge),L(_e),t&&o(sa),t&&o(ee),L(et),t&&o(ra),t&&o(E),L(tt),L(rt),L(be),L(we),t&&o(ia),t&&o(ae),L(it),t&&o(la),t&&o(C),L(lt),L(ut),L(Me),L(ke),t&&o(da),t&&o(se),L(ft),t&&o(ca),t&&o(j),L(gt),L(Mt),L(Le),L(We),t&&o(pa),t&&o(ie),L(kt),t&&o(ma),t&&o(F),L($t),L(Ft),L(Ce),L(je)}}}const cl={local:"wavlm",sections:[{local:"overview",title:"Overview"},{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 pl(W){return Zi(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class vl extends Hi{constructor(d){super();Ki(this,d,pl,dl,Ri,{})}}export{vl as default,cl as metadata};
