import{S as xs,i as qs,s as js,e as n,k as p,w,t as r,M as Ps,c as a,d as o,m,a as s,x as y,h as i,b as d,G as e,g as _,y as E,q as S,o as $,B as D,v as Fs,L as Co}from"../../chunks/vendor-hf-doc-builder.js";import{T as Fa}from"../../chunks/Tip-hf-doc-builder.js";import{D as Ye}from"../../chunks/Docstring-hf-doc-builder.js";import{C as xo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ge}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as To}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function As(k){let c,b,g,h,v;return h=new xo({props:{code:`from transformers import SEWDConfig, SEWDModel

# Initializing a SEW-D asapp/sew-d-tiny-100k style configuration
configuration = SEWDConfig()

# Initializing a model (with random weights) from the asapp/sew-d-tiny-100k style configuration
model = SEWDModel(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> SEWDConfig, SEWDModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a SEW-D asapp/sew-d-tiny-100k style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = SEWDConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the asapp/sew-d-tiny-100k style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SEWDModel(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(){c=n("p"),b=r("Example:"),g=p(),w(h.$$.fragment)},l(l){c=a(l,"P",{});var u=s(c);b=i(u,"Example:"),u.forEach(o),g=m(l),y(h.$$.fragment,l)},m(l,u){_(l,c,u),e(c,b),_(l,g,u),E(h,l,u),v=!0},p:Co,i(l){v||(S(h.$$.fragment,l),v=!0)},o(l){$(h.$$.fragment,l),v=!1},d(l){l&&o(c),l&&o(g),D(h,l)}}}function Ms(k){let c,b,g,h,v;return{c(){c=n("p"),b=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),h=r("Module"),v=r(`
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(l){c=a(l,"P",{});var u=s(c);b=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(u,"CODE",{});var x=s(g);h=i(x,"Module"),x.forEach(o),v=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(o)},m(l,u){_(l,c,u),e(c,b),e(c,g),e(g,h),e(c,v)},d(l){l&&o(c)}}}function zs(k){let c,b,g,h,v;return h=new xo({props:{code:`from transformers import AutoProcessor, SEWDModel
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("asapp/sew-d-tiny-100k-ft-ls100h")
model = SEWDModel.from_pretrained("asapp/sew-d-tiny-100k-ft-ls100h")

# 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, SEWDModel
<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;asapp/sew-d-tiny-100k-ft-ls100h&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SEWDModel.from_pretrained(<span class="hljs-string">&quot;asapp/sew-d-tiny-100k-ft-ls100h&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">384</span>]`}}),{c(){c=n("p"),b=r("Example:"),g=p(),w(h.$$.fragment)},l(l){c=a(l,"P",{});var u=s(c);b=i(u,"Example:"),u.forEach(o),g=m(l),y(h.$$.fragment,l)},m(l,u){_(l,c,u),e(c,b),_(l,g,u),E(h,l,u),v=!0},p:Co,i(l){v||(S(h.$$.fragment,l),v=!0)},o(l){$(h.$$.fragment,l),v=!1},d(l){l&&o(c),l&&o(g),D(h,l)}}}function Os(k){let c,b,g,h,v;return{c(){c=n("p"),b=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),h=r("Module"),v=r(`
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(l){c=a(l,"P",{});var u=s(c);b=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(u,"CODE",{});var x=s(g);h=i(x,"Module"),x.forEach(o),v=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(o)},m(l,u){_(l,c,u),e(c,b),e(c,g),e(g,h),e(c,v)},d(l){l&&o(c)}}}function Ls(k){let c,b,g,h,v;return h=new xo({props:{code:`from transformers import AutoProcessor, SEWDForCTC
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("asapp/sew-d-tiny-100k-ft-ls100h")
model = SEWDForCTC.from_pretrained("asapp/sew-d-tiny-100k-ft-ls100h")

# 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, SEWDForCTC
<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;asapp/sew-d-tiny-100k-ft-ls100h&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SEWDForCTC.from_pretrained(<span class="hljs-string">&quot;asapp/sew-d-tiny-100k-ft-ls100h&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 APOSTIL 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">0.21</span>`}}),{c(){c=n("p"),b=r("Example:"),g=p(),w(h.$$.fragment)},l(l){c=a(l,"P",{});var u=s(c);b=i(u,"Example:"),u.forEach(o),g=m(l),y(h.$$.fragment,l)},m(l,u){_(l,c,u),e(c,b),_(l,g,u),E(h,l,u),v=!0},p:Co,i(l){v||(S(h.$$.fragment,l),v=!0)},o(l){$(h.$$.fragment,l),v=!1},d(l){l&&o(c),l&&o(g),D(h,l)}}}function Is(k){let c,b,g,h,v;return{c(){c=n("p"),b=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),h=r("Module"),v=r(`
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(l){c=a(l,"P",{});var u=s(c);b=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(u,"CODE",{});var x=s(g);h=i(x,"Module"),x.forEach(o),v=i(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(o)},m(l,u){_(l,c,u),e(c,b),e(c,g),e(g,h),e(c,v)},d(l){l&&o(c)}}}function Ns(k){let c,b,g,h,v;return h=new xo({props:{code:`from transformers import AutoFeatureExtractor, SEWDForSequenceClassification
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("anton-l/sew-d-mid-400k-ft-keyword-spotting")
model = SEWDForSequenceClassification.from_pretrained("anton-l/sew-d-mid-400k-ft-keyword-spotting")

# 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]
predicted_label

# 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
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> AutoFeatureExtractor, SEWDForSequenceClassification
<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;anton-l/sew-d-mid-400k-ft-keyword-spotting&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SEWDForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;anton-l/sew-d-mid-400k-ft-keyword-spotting&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>predicted_label
<span class="hljs-string">&#x27;_unknown_&#x27;</span>

<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
<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">3.16</span>`}}),{c(){c=n("p"),b=r("Example:"),g=p(),w(h.$$.fragment)},l(l){c=a(l,"P",{});var u=s(c);b=i(u,"Example:"),u.forEach(o),g=m(l),y(h.$$.fragment,l)},m(l,u){_(l,c,u),e(c,b),_(l,g,u),E(h,l,u),v=!0},p:Co,i(l){v||(S(h.$$.fragment,l),v=!0)},o(l){$(h.$$.fragment,l),v=!1},d(l){l&&o(c),l&&o(g),D(h,l)}}}function Ks(k){let c,b,g,h,v,l,u,x,qo,Ut,O,Y,bt,_e,jo,wt,Po,Rt,G,Fo,ve,Ao,Mo,Bt,Xe,zo,Jt,Ze,yt,Oo,Qt,et,Lo,Yt,X,Et,Io,No,be,Ko,tt,Vo,Ho,Gt,Z,Uo,we,Ro,Bo,Xt,L,ee,St,ye,Jo,$t,Qo,Zt,te,Dt,ot,Yo,Go,Wt,nt,Xo,eo,I,oe,kt,Ee,Zo,Tt,en,to,q,Se,tn,N,on,at,nn,an,$e,sn,rn,ln,K,dn,st,cn,pn,rt,mn,fn,hn,ne,oo,V,ae,Ct,De,un,xt,gn,no,T,We,_n,ke,vn,Te,bn,wn,yn,Ce,En,it,Sn,$n,Dn,xe,Wn,qe,kn,Tn,Cn,j,je,xn,H,qn,lt,jn,Pn,qt,Fn,An,Mn,se,zn,re,ao,U,ie,jt,Pe,On,Pt,Ln,so,C,Fe,In,R,Nn,Ft,Kn,Vn,Ae,Hn,Un,Rn,Me,Bn,dt,Jn,Qn,Yn,ze,Gn,Oe,Xn,Zn,ea,P,Le,ta,B,oa,ct,na,aa,At,sa,ra,ia,le,la,de,ro,J,ce,Mt,Ie,da,zt,ca,io,W,Ne,pa,Ot,ma,fa,Ke,ha,Ve,ua,ga,_a,He,va,pt,ba,wa,ya,Ue,Ea,Re,Sa,$a,Da,F,Be,Wa,Q,ka,mt,Ta,Ca,Lt,xa,qa,ja,pe,Pa,me,lo;return l=new Ge({}),_e=new Ge({}),ye=new Ge({}),Ee=new Ge({}),Se=new Ye({props:{name:"class transformers.SEWDConfig",anchor:"transformers.SEWDConfig",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:"squeeze_factor",val:" = 2"},{name:"max_position_embeddings",val:" = 512"},{name:"position_buckets",val:" = 256"},{name:"share_att_key",val:" = True"},{name:"relative_attention",val:" = True"},{name:"pos_att_type",val:" = ('p2c', 'c2p')"},{name:"norm_rel_ebd",val:" = 'layer_norm'"},{name:"hidden_act",val:" = 'gelu_python'"},{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:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-07"},{name:"feature_layer_norm_eps",val:" = 1e-05"},{name:"feat_extract_norm",val:" = 'group'"},{name:"feat_extract_activation",val:" = 'gelu'"},{name:"conv_dim",val:" = (64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512)"},{name:"conv_stride",val:" = (5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)"},{name:"conv_kernel",val:" = (10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)"},{name:"conv_bias",val:" = False"},{name:"num_conv_pos_embeddings",val:" = 128"},{name:"num_conv_pos_embedding_groups",val:" = 16"},{name:"apply_spec_augment",val:" = True"},{name:"mask_time_prob",val:" = 0.05"},{name:"mask_time_length",val:" = 10"},{name:"mask_time_min_masks",val:" = 2"},{name:"mask_feature_prob",val:" = 0.0"},{name:"mask_feature_length",val:" = 10"},{name:"mask_feature_min_masks",val:" = 0"},{name:"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:"pad_token_id",val:" = 0"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.SEWDConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Vocabulary size of the SEW-D model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <code>SEWD</code>.`,name:"vocab_size"},{anchor:"transformers.SEWDConfig.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.SEWDConfig.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.SEWDConfig.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.SEWDConfig.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.SEWDConfig.squeeze_factor",description:`<strong>squeeze_factor</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
Sequence length downsampling factor after the encoder and upsampling factor after the transformer.`,name:"squeeze_factor"},{anchor:"transformers.SEWDConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.SEWDConfig.position_buckets",description:`<strong>position_buckets</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
The maximum size of relative position embeddings.`,name:"position_buckets"},{anchor:"transformers.SEWDConfig.share_att_key",description:`<strong>share_att_key</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to share attention key with c2p and p2c.`,name:"share_att_key"},{anchor:"transformers.SEWDConfig.relative_attention",description:`<strong>relative_attention</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use relative position encoding.`,name:"relative_attention"},{anchor:"transformers.SEWDConfig.pos_att_type",description:`<strong>pos_att_type</strong> (<code>Tuple[str]</code>, <em>optional</em>, defaults to <code>(&quot;p2c&quot;, &quot;c2p&quot;)</code>) &#x2014;
The type of relative position attention, it can be a combination of <code>(&quot;p2c&quot;, &quot;c2p&quot;)</code>, e.g. <code>(&quot;p2c&quot;)</code>,
<code>(&quot;p2c&quot;, &quot;c2p&quot;)</code>, <code>(&quot;p2c&quot;, &quot;c2p&quot;)</code>.`,name:"pos_att_type"},{anchor:"transformers.SEWDConfig.norm_rel_ebd",description:`<strong>norm_rel_ebd</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;layer_norm&quot;</code>) &#x2014;
Whether to use layer norm in relative embedding (<code>&quot;layer_norm&quot;</code> if yes)`,name:"norm_rel_ebd"},{anchor:"transformers.SEWDConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu_python&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code>, <code>&quot;gelu_python&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.SEWDConfig.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.SEWDConfig.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.SEWDConfig.final_dropout",description:`<strong>final_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for the final projection layer of <a href="/docs/transformers/v4.27.1/en/model_doc/sew-d#transformers.SEWDForCTC">SEWDForCTC</a>.`,name:"final_dropout"},{anchor:"transformers.SEWDConfig.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.SEWDConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-7) &#x2014;
The epsilon used by the layer normalization layers in the transformer encoder.`,name:"layer_norm_eps"},{anchor:"transformers.SEWDConfig.feature_layer_norm_eps",description:`<strong>feature_layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization after the feature encoder.`,name:"feature_layer_norm_eps"},{anchor:"transformers.SEWDConfig.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.SEWDConfig.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.SEWDConfig.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.SEWDConfig.conv_dim",description:`<strong>conv_dim</strong> (<code>Tuple[int]</code> or <code>List[int]</code>, <em>optional</em>, defaults to <code>(64, 128, 128, 128, 128, 256, 256, 256, 256, 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.SEWDConfig.conv_stride",description:`<strong>conv_stride</strong> (<code>Tuple[int]</code> or <code>List[int]</code>, <em>optional</em>, defaults to <code>(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)</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.SEWDConfig.conv_kernel",description:`<strong>conv_kernel</strong> (<code>Tuple[int]</code> or <code>List[int]</code>, <em>optional</em>, defaults to <code>(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)</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.SEWDConfig.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.SEWDConfig.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.SEWDConfig.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.SEWDConfig.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.SEWDConfig.mask_time_prob",description:`<strong>mask_time_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.05) &#x2014;
Percentage (between 0 and 1) of all feature vectors along the time axis which will be masked. The masking
procecure generates &#x201D;mask_time_prob<em>len(time_axis)/mask_time_length&#x201D; independent masks over the axis. If
reasoning from the propability of each feature vector to be chosen as the start of the vector span to be
masked, </em>mask_time_prob<em> should be \`prob_vector_start</em>mask_time_length<code>. Note that overlap may decrease the actual percentage of masked vectors. This is only relevant if </code>apply_spec_augment is True\`.`,name:"mask_time_prob"},{anchor:"transformers.SEWDConfig.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.SEWDConfig.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.SEWDConfig.mask_feature_prob",description:`<strong>mask_feature_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Percentage (between 0 and 1) of all feature vectors along the feature axis which will be masked. The
masking procecure generates &#x201D;mask_feature_prob<em>len(feature_axis)/mask_time_length&#x201D; independent masks over
the axis. If reasoning from the propability of each feature vector to be chosen as the start of the vector
span to be masked, </em>mask_feature_prob<em> should be \`prob_vector_start</em>mask_feature_length<code>. Note that overlap may decrease the actual percentage of masked vectors. This is only relevant if </code>apply_spec_augment is
True\`.`,name:"mask_feature_prob"},{anchor:"transformers.SEWDConfig.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.SEWDConfig.mask_feature_min_masks",description:`<strong>mask_feature_min_masks</strong> (<code>int</code>, <em>optional</em>, defaults to 0), &#x2014;
The minimum number of masks of length <code>mask_feature_length</code> generated along the feature axis, each time
step, irrespectively of <code>mask_feature_prob</code>. Only relevant if
&#x201D;mask_feature_prob*len(feature_axis)/mask_feature_length &lt; mask_feature_min_masks&#x201D;`,name:"mask_feature_min_masks"},{anchor:"transformers.SEWDConfig.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.SEWDConfig.ctc_loss_reduction",description:`<strong>ctc_loss_reduction</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;sum&quot;</code>) &#x2014;
Specifies the reduction to apply to the output of <code>torch.nn.CTCLoss</code>. Only relevant when training an
instance of <a href="/docs/transformers/v4.27.1/en/model_doc/sew-d#transformers.SEWDForCTC">SEWDForCTC</a>.`,name:"ctc_loss_reduction"},{anchor:"transformers.SEWDConfig.ctc_zero_infinity",description:`<strong>ctc_zero_infinity</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to zero infinite losses and the associated gradients of <code>torch.nn.CTCLoss</code>. Infinite losses mainly
occur when the inputs are too short to be aligned to the targets. Only relevant when training an instance
of <a href="/docs/transformers/v4.27.1/en/model_doc/sew-d#transformers.SEWDForCTC">SEWDForCTC</a>.`,name:"ctc_zero_infinity"},{anchor:"transformers.SEWDConfig.use_weighted_layer_sum",description:`<strong>use_weighted_layer_sum</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a weighted average of layer outputs with learned weights. Only relevant when using an
instance of <a href="/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2ForSequenceClassification">Wav2Vec2ForSequenceClassification</a>.`,name:"use_weighted_layer_sum"},{anchor:"transformers.SEWDConfig.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"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/sew_d/configuration_sew_d.py#L32"}}),ne=new To({props:{anchor:"transformers.SEWDConfig.example",$$slots:{default:[As]},$$scope:{ctx:k}}}),De=new Ge({}),We=new Ye({props:{name:"class transformers.SEWDModel",anchor:"transformers.SEWDModel",parameters:[{name:"config",val:": SEWDConfig"}],parametersDescription:[{anchor:"transformers.SEWDModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/sew-d#transformers.SEWDConfig">SEWDConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/sew_d/modeling_sew_d.py#L1383"}}),je=new Ye({props:{name:"forward",anchor:"transformers.SEWDModel.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.SEWDModel.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <code>.flac</code> or <code>.wav</code> audio file
into an array of type <code>List[float]</code> or a <code>numpy.ndarray</code>, <em>e.g.</em> via the soundfile library (<code>pip install soundfile</code>). To prepare the array into <code>input_values</code>, the <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.SEWDModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.SEWDModel.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.SEWDModel.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.SEWDModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/sew_d/modeling_sew_d.py#L1450",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/sew-d#transformers.SEWDConfig"
>SEWDConfig</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>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),se=new Fa({props:{$$slots:{default:[Ms]},$$scope:{ctx:k}}}),re=new To({props:{anchor:"transformers.SEWDModel.forward.example",$$slots:{default:[zs]},$$scope:{ctx:k}}}),Pe=new Ge({}),Fe=new Ye({props:{name:"class transformers.SEWDForCTC",anchor:"transformers.SEWDForCTC",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SEWDForCTC.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/sew-d#transformers.SEWDConfig">SEWDConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/sew_d/modeling_sew_d.py#L1512"}}),Le=new Ye({props:{name:"forward",anchor:"transformers.SEWDForCTC.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.SEWDForCTC.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <code>.flac</code> or <code>.wav</code> audio file
into an array of type <code>List[float]</code> or a <code>numpy.ndarray</code>, <em>e.g.</em> via the soundfile library (<code>pip install soundfile</code>). To prepare the array into <code>input_values</code>, the <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.SEWDForCTC.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.SEWDForCTC.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.SEWDForCTC.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.SEWDForCTC.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SEWDForCTC.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_length)</code>, <em>optional</em>) &#x2014;
Labels for connectionist temporal classification. Note that <code>target_length</code> has to be smaller or equal to
the sequence length of the output logits. Indices are selected in <code>[-100, 0, ..., config.vocab_size - 1]</code>.
All labels set to <code>-100</code> are ignored (masked), the loss is only computed for labels in <code>[0, ..., config.vocab_size - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/sew_d/modeling_sew_d.py#L1553",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.CausalLMOutput"
>transformers.modeling_outputs.CausalLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/sew-d#transformers.SEWDConfig"
>SEWDConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.CausalLMOutput"
>transformers.modeling_outputs.CausalLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),le=new Fa({props:{$$slots:{default:[Os]},$$scope:{ctx:k}}}),de=new To({props:{anchor:"transformers.SEWDForCTC.forward.example",$$slots:{default:[Ls]},$$scope:{ctx:k}}}),Ie=new Ge({}),Ne=new Ye({props:{name:"class transformers.SEWDForSequenceClassification",anchor:"transformers.SEWDForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SEWDForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/sew-d#transformers.SEWDConfig">SEWDConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/sew_d/modeling_sew_d.py#L1641"}}),Be=new Ye({props:{name:"forward",anchor:"transformers.SEWDForSequenceClassification.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.SEWDForSequenceClassification.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <code>.flac</code> or <code>.wav</code> audio file
into an array of type <code>List[float]</code> or a <code>numpy.ndarray</code>, <em>e.g.</em> via the soundfile library (<code>pip install soundfile</code>). To prepare the array into <code>input_values</code>, the <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.SEWDForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.SEWDForSequenceClassification.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.SEWDForSequenceClassification.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.SEWDForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SEWDForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/sew_d/modeling_sew_d.py#L1686",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/sew-d#transformers.SEWDConfig"
>SEWDConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),pe=new Fa({props:{$$slots:{default:[Is]},$$scope:{ctx:k}}}),me=new To({props:{anchor:"transformers.SEWDForSequenceClassification.forward.example",$$slots:{default:[Ns]},$$scope:{ctx:k}}}),{c(){c=n("meta"),b=p(),g=n("h1"),h=n("a"),v=n("span"),w(l.$$.fragment),u=p(),x=n("span"),qo=r("SEW-D"),Ut=p(),O=n("h2"),Y=n("a"),bt=n("span"),w(_e.$$.fragment),jo=p(),wt=n("span"),Po=r("Overview"),Rt=p(),G=n("p"),Fo=r("SEW-D (Squeezed and Efficient Wav2Vec with Disentangled attention) was proposed in "),ve=n("a"),Ao=r(`Performance-Efficiency Trade-offs
in Unsupervised Pre-training for Speech Recognition`),Mo=r(` by Felix Wu, Kwangyoun Kim,
Jing Pan, Kyu Han, Kilian Q. Weinberger, Yoav Artzi.`),Bt=p(),Xe=n("p"),zo=r("The abstract from the paper is the following:"),Jt=p(),Ze=n("p"),yt=n("em"),Oo=r(`This paper is a study of performance-efficiency trade-offs in pre-trained models for automatic speech recognition
(ASR). We focus on wav2vec 2.0, and formalize several architecture designs that influence both the model performance
and its efficiency. Putting together all our observations, we introduce SEW (Squeezed and Efficient Wav2vec), a
pre-trained model architecture with significant improvements along both performance and efficiency dimensions across a
variety of training setups. For example, under the 100h-960h semi-supervised setup on LibriSpeech, SEW achieves a 1.9x
inference speedup compared to wav2vec 2.0, with a 13.5% relative reduction in word error rate. With a similar inference
time, SEW reduces word error rate by 25-50% across different model sizes.`),Qt=p(),et=n("p"),Lo=r("Tips:"),Yt=p(),X=n("ul"),Et=n("li"),Io=r("SEW-D is a speech model that accepts a float array corresponding to the raw waveform of the speech signal."),No=p(),be=n("li"),Ko=r(`SEWDForCTC is fine-tuned using connectionist temporal classification (CTC) so the model output has to be decoded
using `),tt=n("a"),Vo=r("Wav2Vec2CTCTokenizer"),Ho=r("."),Gt=p(),Z=n("p"),Uo=r("This model was contributed by "),we=n("a"),Ro=r("anton-l"),Bo=r("."),Xt=p(),L=n("h2"),ee=n("a"),St=n("span"),w(ye.$$.fragment),Jo=p(),$t=n("span"),Qo=r("Documentation resources"),Zt=p(),te=n("ul"),Dt=n("li"),ot=n("a"),Yo=r("Audio classification task guide"),Go=p(),Wt=n("li"),nt=n("a"),Xo=r("Automatic speech recognition task guide"),eo=p(),I=n("h2"),oe=n("a"),kt=n("span"),w(Ee.$$.fragment),Zo=p(),Tt=n("span"),en=r("SEWDConfig"),to=p(),q=n("div"),w(Se.$$.fragment),tn=p(),N=n("p"),on=r("This is the configuration class to store the configuration of a "),at=n("a"),nn=r("SEWDModel"),an=r(`. It is used to instantiate a SEW-D
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 SEW-D
`),$e=n("a"),sn=r("asapp/sew-d-tiny-100k"),rn=r(" architecture."),ln=p(),K=n("p"),dn=r("Configuration objects inherit from "),st=n("a"),cn=r("PretrainedConfig"),pn=r(` and can be used to control the model outputs. Read the
documentation from `),rt=n("a"),mn=r("PretrainedConfig"),fn=r(" for more information."),hn=p(),w(ne.$$.fragment),oo=p(),V=n("h2"),ae=n("a"),Ct=n("span"),w(De.$$.fragment),un=p(),xt=n("span"),gn=r("SEWDModel"),no=p(),T=n("div"),w(We.$$.fragment),_n=p(),ke=n("p"),vn=r(`The bare SEW-D Model transformer outputting raw hidden-states without any specific head on top.
SEW-D was proposed in `),Te=n("a"),bn=r(`Performance-Efficiency Trade-offs in Unsupervised Pre-training for Speech
Recognition`),wn=r(` by Felix Wu, Kwangyoun Kim, Jing Pan, Kyu Han, Kilian Q. Weinberger,
Yoav Artzi.`),yn=p(),Ce=n("p"),En=r("This model inherits from "),it=n("a"),Sn=r("PreTrainedModel"),$n=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Dn=p(),xe=n("p"),Wn=r("This model is a PyTorch "),qe=n("a"),kn=r("torch.nn.Module"),Tn=r(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Cn=p(),j=n("div"),w(je.$$.fragment),xn=p(),H=n("p"),qn=r("The "),lt=n("a"),jn=r("SEWDModel"),Pn=r(" forward method, overrides the "),qt=n("code"),Fn=r("__call__"),An=r(" special method."),Mn=p(),w(se.$$.fragment),zn=p(),w(re.$$.fragment),ao=p(),U=n("h2"),ie=n("a"),jt=n("span"),w(Pe.$$.fragment),On=p(),Pt=n("span"),Ln=r("SEWDForCTC"),so=p(),C=n("div"),w(Fe.$$.fragment),In=p(),R=n("p"),Nn=r("SEW-D Model with a "),Ft=n("code"),Kn=r("language modeling"),Vn=r(` head on top for Connectionist Temporal Classification (CTC).
SEW-D was proposed in `),Ae=n("a"),Hn=r(`Performance-Efficiency Trade-offs in Unsupervised Pre-training for Speech
Recognition`),Un=r(` by Felix Wu, Kwangyoun Kim, Jing Pan, Kyu Han, Kilian Q. Weinberger,
Yoav Artzi.`),Rn=p(),Me=n("p"),Bn=r("This model inherits from "),dt=n("a"),Jn=r("PreTrainedModel"),Qn=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Yn=p(),ze=n("p"),Gn=r("This model is a PyTorch "),Oe=n("a"),Xn=r("torch.nn.Module"),Zn=r(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ea=p(),P=n("div"),w(Le.$$.fragment),ta=p(),B=n("p"),oa=r("The "),ct=n("a"),na=r("SEWDForCTC"),aa=r(" forward method, overrides the "),At=n("code"),sa=r("__call__"),ra=r(" special method."),ia=p(),w(le.$$.fragment),la=p(),w(de.$$.fragment),ro=p(),J=n("h2"),ce=n("a"),Mt=n("span"),w(Ie.$$.fragment),da=p(),zt=n("span"),ca=r("SEWDForSequenceClassification"),io=p(),W=n("div"),w(Ne.$$.fragment),pa=p(),Ot=n("p"),ma=r(`SEWD Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like SUPERB
Keyword Spotting.`),fa=p(),Ke=n("p"),ha=r("SEW-D was proposed in "),Ve=n("a"),ua=r(`Performance-Efficiency Trade-offs in Unsupervised Pre-training for Speech
Recognition`),ga=r(` by Felix Wu, Kwangyoun Kim, Jing Pan, Kyu Han, Kilian Q. Weinberger,
Yoav Artzi.`),_a=p(),He=n("p"),va=r("This model inherits from "),pt=n("a"),ba=r("PreTrainedModel"),wa=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),ya=p(),Ue=n("p"),Ea=r("This model is a PyTorch "),Re=n("a"),Sa=r("torch.nn.Module"),$a=r(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Da=p(),F=n("div"),w(Be.$$.fragment),Wa=p(),Q=n("p"),ka=r("The "),mt=n("a"),Ta=r("SEWDForSequenceClassification"),Ca=r(" forward method, overrides the "),Lt=n("code"),xa=r("__call__"),qa=r(" special method."),ja=p(),w(pe.$$.fragment),Pa=p(),w(me.$$.fragment),this.h()},l(t){const f=Ps('[data-svelte="svelte-1phssyn"]',document.head);c=a(f,"META",{name:!0,content:!0}),f.forEach(o),b=m(t),g=a(t,"H1",{class:!0});var Je=s(g);h=a(Je,"A",{id:!0,class:!0,href:!0});var It=s(h);v=a(It,"SPAN",{});var Nt=s(v);y(l.$$.fragment,Nt),Nt.forEach(o),It.forEach(o),u=m(Je),x=a(Je,"SPAN",{});var Kt=s(x);qo=i(Kt,"SEW-D"),Kt.forEach(o),Je.forEach(o),Ut=m(t),O=a(t,"H2",{class:!0});var Qe=s(O);Y=a(Qe,"A",{id:!0,class:!0,href:!0});var Vt=s(Y);bt=a(Vt,"SPAN",{});var Ht=s(bt);y(_e.$$.fragment,Ht),Ht.forEach(o),Vt.forEach(o),jo=m(Qe),wt=a(Qe,"SPAN",{});var Aa=s(wt);Po=i(Aa,"Overview"),Aa.forEach(o),Qe.forEach(o),Rt=m(t),G=a(t,"P",{});var co=s(G);Fo=i(co,"SEW-D (Squeezed and Efficient Wav2Vec with Disentangled attention) was proposed in "),ve=a(co,"A",{href:!0,rel:!0});var Ma=s(ve);Ao=i(Ma,`Performance-Efficiency Trade-offs
in Unsupervised Pre-training for Speech Recognition`),Ma.forEach(o),Mo=i(co,` by Felix Wu, Kwangyoun Kim,
Jing Pan, Kyu Han, Kilian Q. Weinberger, Yoav Artzi.`),co.forEach(o),Bt=m(t),Xe=a(t,"P",{});var za=s(Xe);zo=i(za,"The abstract from the paper is the following:"),za.forEach(o),Jt=m(t),Ze=a(t,"P",{});var Oa=s(Ze);yt=a(Oa,"EM",{});var La=s(yt);Oo=i(La,`This paper is a study of performance-efficiency trade-offs in pre-trained models for automatic speech recognition
(ASR). We focus on wav2vec 2.0, and formalize several architecture designs that influence both the model performance
and its efficiency. Putting together all our observations, we introduce SEW (Squeezed and Efficient Wav2vec), a
pre-trained model architecture with significant improvements along both performance and efficiency dimensions across a
variety of training setups. For example, under the 100h-960h semi-supervised setup on LibriSpeech, SEW achieves a 1.9x
inference speedup compared to wav2vec 2.0, with a 13.5% relative reduction in word error rate. With a similar inference
time, SEW reduces word error rate by 25-50% across different model sizes.`),La.forEach(o),Oa.forEach(o),Qt=m(t),et=a(t,"P",{});var Ia=s(et);Lo=i(Ia,"Tips:"),Ia.forEach(o),Yt=m(t),X=a(t,"UL",{});var po=s(X);Et=a(po,"LI",{});var Na=s(Et);Io=i(Na,"SEW-D is a speech model that accepts a float array corresponding to the raw waveform of the speech signal."),Na.forEach(o),No=m(po),be=a(po,"LI",{});var mo=s(be);Ko=i(mo,`SEWDForCTC is fine-tuned using connectionist temporal classification (CTC) so the model output has to be decoded
using `),tt=a(mo,"A",{href:!0});var Ka=s(tt);Vo=i(Ka,"Wav2Vec2CTCTokenizer"),Ka.forEach(o),Ho=i(mo,"."),mo.forEach(o),po.forEach(o),Gt=m(t),Z=a(t,"P",{});var fo=s(Z);Uo=i(fo,"This model was contributed by "),we=a(fo,"A",{href:!0,rel:!0});var Va=s(we);Ro=i(Va,"anton-l"),Va.forEach(o),Bo=i(fo,"."),fo.forEach(o),Xt=m(t),L=a(t,"H2",{class:!0});var ho=s(L);ee=a(ho,"A",{id:!0,class:!0,href:!0});var Ha=s(ee);St=a(Ha,"SPAN",{});var Ua=s(St);y(ye.$$.fragment,Ua),Ua.forEach(o),Ha.forEach(o),Jo=m(ho),$t=a(ho,"SPAN",{});var Ra=s($t);Qo=i(Ra,"Documentation resources"),Ra.forEach(o),ho.forEach(o),Zt=m(t),te=a(t,"UL",{});var uo=s(te);Dt=a(uo,"LI",{});var Ba=s(Dt);ot=a(Ba,"A",{href:!0});var Ja=s(ot);Yo=i(Ja,"Audio classification task guide"),Ja.forEach(o),Ba.forEach(o),Go=m(uo),Wt=a(uo,"LI",{});var Qa=s(Wt);nt=a(Qa,"A",{href:!0});var Ya=s(nt);Xo=i(Ya,"Automatic speech recognition task guide"),Ya.forEach(o),Qa.forEach(o),uo.forEach(o),eo=m(t),I=a(t,"H2",{class:!0});var go=s(I);oe=a(go,"A",{id:!0,class:!0,href:!0});var Ga=s(oe);kt=a(Ga,"SPAN",{});var Xa=s(kt);y(Ee.$$.fragment,Xa),Xa.forEach(o),Ga.forEach(o),Zo=m(go),Tt=a(go,"SPAN",{});var Za=s(Tt);en=i(Za,"SEWDConfig"),Za.forEach(o),go.forEach(o),to=m(t),q=a(t,"DIV",{class:!0});var fe=s(q);y(Se.$$.fragment,fe),tn=m(fe),N=a(fe,"P",{});var ft=s(N);on=i(ft,"This is the configuration class to store the configuration of a "),at=a(ft,"A",{href:!0});var es=s(at);nn=i(es,"SEWDModel"),es.forEach(o),an=i(ft,`. It is used to instantiate a SEW-D
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 SEW-D
`),$e=a(ft,"A",{href:!0,rel:!0});var ts=s($e);sn=i(ts,"asapp/sew-d-tiny-100k"),ts.forEach(o),rn=i(ft," architecture."),ft.forEach(o),ln=m(fe),K=a(fe,"P",{});var ht=s(K);dn=i(ht,"Configuration objects inherit from "),st=a(ht,"A",{href:!0});var os=s(st);cn=i(os,"PretrainedConfig"),os.forEach(o),pn=i(ht,` and can be used to control the model outputs. Read the
documentation from `),rt=a(ht,"A",{href:!0});var ns=s(rt);mn=i(ns,"PretrainedConfig"),ns.forEach(o),fn=i(ht," for more information."),ht.forEach(o),hn=m(fe),y(ne.$$.fragment,fe),fe.forEach(o),oo=m(t),V=a(t,"H2",{class:!0});var _o=s(V);ae=a(_o,"A",{id:!0,class:!0,href:!0});var as=s(ae);Ct=a(as,"SPAN",{});var ss=s(Ct);y(De.$$.fragment,ss),ss.forEach(o),as.forEach(o),un=m(_o),xt=a(_o,"SPAN",{});var rs=s(xt);gn=i(rs,"SEWDModel"),rs.forEach(o),_o.forEach(o),no=m(t),T=a(t,"DIV",{class:!0});var M=s(T);y(We.$$.fragment,M),_n=m(M),ke=a(M,"P",{});var vo=s(ke);vn=i(vo,`The bare SEW-D Model transformer outputting raw hidden-states without any specific head on top.
SEW-D was proposed in `),Te=a(vo,"A",{href:!0,rel:!0});var is=s(Te);bn=i(is,`Performance-Efficiency Trade-offs in Unsupervised Pre-training for Speech
Recognition`),is.forEach(o),wn=i(vo,` by Felix Wu, Kwangyoun Kim, Jing Pan, Kyu Han, Kilian Q. Weinberger,
Yoav Artzi.`),vo.forEach(o),yn=m(M),Ce=a(M,"P",{});var bo=s(Ce);En=i(bo,"This model inherits from "),it=a(bo,"A",{href:!0});var ls=s(it);Sn=i(ls,"PreTrainedModel"),ls.forEach(o),$n=i(bo,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),bo.forEach(o),Dn=m(M),xe=a(M,"P",{});var wo=s(xe);Wn=i(wo,"This model is a PyTorch "),qe=a(wo,"A",{href:!0,rel:!0});var ds=s(qe);kn=i(ds,"torch.nn.Module"),ds.forEach(o),Tn=i(wo,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),wo.forEach(o),Cn=m(M),j=a(M,"DIV",{class:!0});var he=s(j);y(je.$$.fragment,he),xn=m(he),H=a(he,"P",{});var ut=s(H);qn=i(ut,"The "),lt=a(ut,"A",{href:!0});var cs=s(lt);jn=i(cs,"SEWDModel"),cs.forEach(o),Pn=i(ut," forward method, overrides the "),qt=a(ut,"CODE",{});var ps=s(qt);Fn=i(ps,"__call__"),ps.forEach(o),An=i(ut," special method."),ut.forEach(o),Mn=m(he),y(se.$$.fragment,he),zn=m(he),y(re.$$.fragment,he),he.forEach(o),M.forEach(o),ao=m(t),U=a(t,"H2",{class:!0});var yo=s(U);ie=a(yo,"A",{id:!0,class:!0,href:!0});var ms=s(ie);jt=a(ms,"SPAN",{});var fs=s(jt);y(Pe.$$.fragment,fs),fs.forEach(o),ms.forEach(o),On=m(yo),Pt=a(yo,"SPAN",{});var hs=s(Pt);Ln=i(hs,"SEWDForCTC"),hs.forEach(o),yo.forEach(o),so=m(t),C=a(t,"DIV",{class:!0});var z=s(C);y(Fe.$$.fragment,z),In=m(z),R=a(z,"P",{});var gt=s(R);Nn=i(gt,"SEW-D Model with a "),Ft=a(gt,"CODE",{});var us=s(Ft);Kn=i(us,"language modeling"),us.forEach(o),Vn=i(gt,` head on top for Connectionist Temporal Classification (CTC).
SEW-D was proposed in `),Ae=a(gt,"A",{href:!0,rel:!0});var gs=s(Ae);Hn=i(gs,`Performance-Efficiency Trade-offs in Unsupervised Pre-training for Speech
Recognition`),gs.forEach(o),Un=i(gt,` by Felix Wu, Kwangyoun Kim, Jing Pan, Kyu Han, Kilian Q. Weinberger,
Yoav Artzi.`),gt.forEach(o),Rn=m(z),Me=a(z,"P",{});var Eo=s(Me);Bn=i(Eo,"This model inherits from "),dt=a(Eo,"A",{href:!0});var _s=s(dt);Jn=i(_s,"PreTrainedModel"),_s.forEach(o),Qn=i(Eo,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Eo.forEach(o),Yn=m(z),ze=a(z,"P",{});var So=s(ze);Gn=i(So,"This model is a PyTorch "),Oe=a(So,"A",{href:!0,rel:!0});var vs=s(Oe);Xn=i(vs,"torch.nn.Module"),vs.forEach(o),Zn=i(So,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),So.forEach(o),ea=m(z),P=a(z,"DIV",{class:!0});var ue=s(P);y(Le.$$.fragment,ue),ta=m(ue),B=a(ue,"P",{});var _t=s(B);oa=i(_t,"The "),ct=a(_t,"A",{href:!0});var bs=s(ct);na=i(bs,"SEWDForCTC"),bs.forEach(o),aa=i(_t," forward method, overrides the "),At=a(_t,"CODE",{});var ws=s(At);sa=i(ws,"__call__"),ws.forEach(o),ra=i(_t," special method."),_t.forEach(o),ia=m(ue),y(le.$$.fragment,ue),la=m(ue),y(de.$$.fragment,ue),ue.forEach(o),z.forEach(o),ro=m(t),J=a(t,"H2",{class:!0});var $o=s(J);ce=a($o,"A",{id:!0,class:!0,href:!0});var ys=s(ce);Mt=a(ys,"SPAN",{});var Es=s(Mt);y(Ie.$$.fragment,Es),Es.forEach(o),ys.forEach(o),da=m($o),zt=a($o,"SPAN",{});var Ss=s(zt);ca=i(Ss,"SEWDForSequenceClassification"),Ss.forEach(o),$o.forEach(o),io=m(t),W=a(t,"DIV",{class:!0});var A=s(W);y(Ne.$$.fragment,A),pa=m(A),Ot=a(A,"P",{});var $s=s(Ot);ma=i($s,`SEWD Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like SUPERB
Keyword Spotting.`),$s.forEach(o),fa=m(A),Ke=a(A,"P",{});var Do=s(Ke);ha=i(Do,"SEW-D was proposed in "),Ve=a(Do,"A",{href:!0,rel:!0});var Ds=s(Ve);ua=i(Ds,`Performance-Efficiency Trade-offs in Unsupervised Pre-training for Speech
Recognition`),Ds.forEach(o),ga=i(Do,` by Felix Wu, Kwangyoun Kim, Jing Pan, Kyu Han, Kilian Q. Weinberger,
Yoav Artzi.`),Do.forEach(o),_a=m(A),He=a(A,"P",{});var Wo=s(He);va=i(Wo,"This model inherits from "),pt=a(Wo,"A",{href:!0});var Ws=s(pt);ba=i(Ws,"PreTrainedModel"),Ws.forEach(o),wa=i(Wo,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Wo.forEach(o),ya=m(A),Ue=a(A,"P",{});var ko=s(Ue);Ea=i(ko,"This model is a PyTorch "),Re=a(ko,"A",{href:!0,rel:!0});var ks=s(Re);Sa=i(ks,"torch.nn.Module"),ks.forEach(o),$a=i(ko,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ko.forEach(o),Da=m(A),F=a(A,"DIV",{class:!0});var ge=s(F);y(Be.$$.fragment,ge),Wa=m(ge),Q=a(ge,"P",{});var vt=s(Q);ka=i(vt,"The "),mt=a(vt,"A",{href:!0});var Ts=s(mt);Ta=i(Ts,"SEWDForSequenceClassification"),Ts.forEach(o),Ca=i(vt," forward method, overrides the "),Lt=a(vt,"CODE",{});var Cs=s(Lt);xa=i(Cs,"__call__"),Cs.forEach(o),qa=i(vt," special method."),vt.forEach(o),ja=m(ge),y(pe.$$.fragment,ge),Pa=m(ge),y(me.$$.fragment,ge),ge.forEach(o),A.forEach(o),this.h()},h(){d(c,"name","hf:doc:metadata"),d(c,"content",JSON.stringify(Vs)),d(h,"id","sewd"),d(h,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(h,"href","#sewd"),d(g,"class","relative group"),d(Y,"id","overview"),d(Y,"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"),d(Y,"href","#overview"),d(O,"class","relative group"),d(ve,"href","https://arxiv.org/abs/2109.06870"),d(ve,"rel","nofollow"),d(tt,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer"),d(we,"href","https://huggingface.co/anton-l"),d(we,"rel","nofollow"),d(ee,"id","documentation-resources"),d(ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ee,"href","#documentation-resources"),d(L,"class","relative group"),d(ot,"href","./tasks/audio_classification"),d(nt,"href","./tasks/asr"),d(oe,"id","transformers.SEWDConfig"),d(oe,"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"),d(oe,"href","#transformers.SEWDConfig"),d(I,"class","relative group"),d(at,"href","/docs/transformers/v4.27.1/en/model_doc/sew-d#transformers.SEWDModel"),d($e,"href","https://huggingface.co/asapp/sew-d-tiny-100k"),d($e,"rel","nofollow"),d(st,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(rt,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ae,"id","transformers.SEWDModel"),d(ae,"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"),d(ae,"href","#transformers.SEWDModel"),d(V,"class","relative group"),d(Te,"href","https://arxiv.org/abs/2109.06870"),d(Te,"rel","nofollow"),d(it,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),d(qe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(qe,"rel","nofollow"),d(lt,"href","/docs/transformers/v4.27.1/en/model_doc/sew-d#transformers.SEWDModel"),d(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ie,"id","transformers.SEWDForCTC"),d(ie,"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"),d(ie,"href","#transformers.SEWDForCTC"),d(U,"class","relative group"),d(Ae,"href","https://arxiv.org/abs/2109.06870"),d(Ae,"rel","nofollow"),d(dt,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),d(Oe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Oe,"rel","nofollow"),d(ct,"href","/docs/transformers/v4.27.1/en/model_doc/sew-d#transformers.SEWDForCTC"),d(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ce,"id","transformers.SEWDForSequenceClassification"),d(ce,"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"),d(ce,"href","#transformers.SEWDForSequenceClassification"),d(J,"class","relative group"),d(Ve,"href","https://arxiv.org/abs/2109.06870"),d(Ve,"rel","nofollow"),d(pt,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),d(Re,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Re,"rel","nofollow"),d(mt,"href","/docs/transformers/v4.27.1/en/model_doc/sew-d#transformers.SEWDForSequenceClassification"),d(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(W,"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,f){e(document.head,c),_(t,b,f),_(t,g,f),e(g,h),e(h,v),E(l,v,null),e(g,u),e(g,x),e(x,qo),_(t,Ut,f),_(t,O,f),e(O,Y),e(Y,bt),E(_e,bt,null),e(O,jo),e(O,wt),e(wt,Po),_(t,Rt,f),_(t,G,f),e(G,Fo),e(G,ve),e(ve,Ao),e(G,Mo),_(t,Bt,f),_(t,Xe,f),e(Xe,zo),_(t,Jt,f),_(t,Ze,f),e(Ze,yt),e(yt,Oo),_(t,Qt,f),_(t,et,f),e(et,Lo),_(t,Yt,f),_(t,X,f),e(X,Et),e(Et,Io),e(X,No),e(X,be),e(be,Ko),e(be,tt),e(tt,Vo),e(be,Ho),_(t,Gt,f),_(t,Z,f),e(Z,Uo),e(Z,we),e(we,Ro),e(Z,Bo),_(t,Xt,f),_(t,L,f),e(L,ee),e(ee,St),E(ye,St,null),e(L,Jo),e(L,$t),e($t,Qo),_(t,Zt,f),_(t,te,f),e(te,Dt),e(Dt,ot),e(ot,Yo),e(te,Go),e(te,Wt),e(Wt,nt),e(nt,Xo),_(t,eo,f),_(t,I,f),e(I,oe),e(oe,kt),E(Ee,kt,null),e(I,Zo),e(I,Tt),e(Tt,en),_(t,to,f),_(t,q,f),E(Se,q,null),e(q,tn),e(q,N),e(N,on),e(N,at),e(at,nn),e(N,an),e(N,$e),e($e,sn),e(N,rn),e(q,ln),e(q,K),e(K,dn),e(K,st),e(st,cn),e(K,pn),e(K,rt),e(rt,mn),e(K,fn),e(q,hn),E(ne,q,null),_(t,oo,f),_(t,V,f),e(V,ae),e(ae,Ct),E(De,Ct,null),e(V,un),e(V,xt),e(xt,gn),_(t,no,f),_(t,T,f),E(We,T,null),e(T,_n),e(T,ke),e(ke,vn),e(ke,Te),e(Te,bn),e(ke,wn),e(T,yn),e(T,Ce),e(Ce,En),e(Ce,it),e(it,Sn),e(Ce,$n),e(T,Dn),e(T,xe),e(xe,Wn),e(xe,qe),e(qe,kn),e(xe,Tn),e(T,Cn),e(T,j),E(je,j,null),e(j,xn),e(j,H),e(H,qn),e(H,lt),e(lt,jn),e(H,Pn),e(H,qt),e(qt,Fn),e(H,An),e(j,Mn),E(se,j,null),e(j,zn),E(re,j,null),_(t,ao,f),_(t,U,f),e(U,ie),e(ie,jt),E(Pe,jt,null),e(U,On),e(U,Pt),e(Pt,Ln),_(t,so,f),_(t,C,f),E(Fe,C,null),e(C,In),e(C,R),e(R,Nn),e(R,Ft),e(Ft,Kn),e(R,Vn),e(R,Ae),e(Ae,Hn),e(R,Un),e(C,Rn),e(C,Me),e(Me,Bn),e(Me,dt),e(dt,Jn),e(Me,Qn),e(C,Yn),e(C,ze),e(ze,Gn),e(ze,Oe),e(Oe,Xn),e(ze,Zn),e(C,ea),e(C,P),E(Le,P,null),e(P,ta),e(P,B),e(B,oa),e(B,ct),e(ct,na),e(B,aa),e(B,At),e(At,sa),e(B,ra),e(P,ia),E(le,P,null),e(P,la),E(de,P,null),_(t,ro,f),_(t,J,f),e(J,ce),e(ce,Mt),E(Ie,Mt,null),e(J,da),e(J,zt),e(zt,ca),_(t,io,f),_(t,W,f),E(Ne,W,null),e(W,pa),e(W,Ot),e(Ot,ma),e(W,fa),e(W,Ke),e(Ke,ha),e(Ke,Ve),e(Ve,ua),e(Ke,ga),e(W,_a),e(W,He),e(He,va),e(He,pt),e(pt,ba),e(He,wa),e(W,ya),e(W,Ue),e(Ue,Ea),e(Ue,Re),e(Re,Sa),e(Ue,$a),e(W,Da),e(W,F),E(Be,F,null),e(F,Wa),e(F,Q),e(Q,ka),e(Q,mt),e(mt,Ta),e(Q,Ca),e(Q,Lt),e(Lt,xa),e(Q,qa),e(F,ja),E(pe,F,null),e(F,Pa),E(me,F,null),lo=!0},p(t,[f]){const Je={};f&2&&(Je.$$scope={dirty:f,ctx:t}),ne.$set(Je);const It={};f&2&&(It.$$scope={dirty:f,ctx:t}),se.$set(It);const Nt={};f&2&&(Nt.$$scope={dirty:f,ctx:t}),re.$set(Nt);const Kt={};f&2&&(Kt.$$scope={dirty:f,ctx:t}),le.$set(Kt);const Qe={};f&2&&(Qe.$$scope={dirty:f,ctx:t}),de.$set(Qe);const Vt={};f&2&&(Vt.$$scope={dirty:f,ctx:t}),pe.$set(Vt);const Ht={};f&2&&(Ht.$$scope={dirty:f,ctx:t}),me.$set(Ht)},i(t){lo||(S(l.$$.fragment,t),S(_e.$$.fragment,t),S(ye.$$.fragment,t),S(Ee.$$.fragment,t),S(Se.$$.fragment,t),S(ne.$$.fragment,t),S(De.$$.fragment,t),S(We.$$.fragment,t),S(je.$$.fragment,t),S(se.$$.fragment,t),S(re.$$.fragment,t),S(Pe.$$.fragment,t),S(Fe.$$.fragment,t),S(Le.$$.fragment,t),S(le.$$.fragment,t),S(de.$$.fragment,t),S(Ie.$$.fragment,t),S(Ne.$$.fragment,t),S(Be.$$.fragment,t),S(pe.$$.fragment,t),S(me.$$.fragment,t),lo=!0)},o(t){$(l.$$.fragment,t),$(_e.$$.fragment,t),$(ye.$$.fragment,t),$(Ee.$$.fragment,t),$(Se.$$.fragment,t),$(ne.$$.fragment,t),$(De.$$.fragment,t),$(We.$$.fragment,t),$(je.$$.fragment,t),$(se.$$.fragment,t),$(re.$$.fragment,t),$(Pe.$$.fragment,t),$(Fe.$$.fragment,t),$(Le.$$.fragment,t),$(le.$$.fragment,t),$(de.$$.fragment,t),$(Ie.$$.fragment,t),$(Ne.$$.fragment,t),$(Be.$$.fragment,t),$(pe.$$.fragment,t),$(me.$$.fragment,t),lo=!1},d(t){o(c),t&&o(b),t&&o(g),D(l),t&&o(Ut),t&&o(O),D(_e),t&&o(Rt),t&&o(G),t&&o(Bt),t&&o(Xe),t&&o(Jt),t&&o(Ze),t&&o(Qt),t&&o(et),t&&o(Yt),t&&o(X),t&&o(Gt),t&&o(Z),t&&o(Xt),t&&o(L),D(ye),t&&o(Zt),t&&o(te),t&&o(eo),t&&o(I),D(Ee),t&&o(to),t&&o(q),D(Se),D(ne),t&&o(oo),t&&o(V),D(De),t&&o(no),t&&o(T),D(We),D(je),D(se),D(re),t&&o(ao),t&&o(U),D(Pe),t&&o(so),t&&o(C),D(Fe),D(Le),D(le),D(de),t&&o(ro),t&&o(J),D(Ie),t&&o(io),t&&o(W),D(Ne),D(Be),D(pe),D(me)}}}const Vs={local:"sewd",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.SEWDConfig",title:"SEWDConfig"},{local:"transformers.SEWDModel",title:"SEWDModel"},{local:"transformers.SEWDForCTC",title:"SEWDForCTC"},{local:"transformers.SEWDForSequenceClassification",title:"SEWDForSequenceClassification"}],title:"SEW-D"};function Hs(k){return Fs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Gs extends xs{constructor(c){super();qs(this,c,Hs,Ks,js,{})}}export{Gs as default,Vs as metadata};
