import{S as as,i as ss,s as rs,e as a,k as f,w,t as i,M as is,c as s,d as o,m as h,a as r,x as y,h as l,b as d,G as e,g as _,y as E,q as S,o as $,B as W,v as ls,L as uo}from"../../chunks/vendor-hf-doc-builder.js";import{T as ua}from"../../chunks/Tip-hf-doc-builder.js";import{D as Ue}from"../../chunks/Docstring-hf-doc-builder.js";import{C as go}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as mt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ho}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function cs(C){let c,b,g,p,v;return p=new go({props:{code:`from transformers import SEWConfig, SEWModel

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the asapp/sew-tiny-100k style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SEWModel(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=a("p"),b=i("Example:"),g=f(),w(p.$$.fragment)},l(n){c=s(n,"P",{});var m=r(c);b=l(m,"Example:"),m.forEach(o),g=h(n),y(p.$$.fragment,n)},m(n,m){_(n,c,m),e(c,b),_(n,g,m),E(p,n,m),v=!0},p:uo,i(n){v||(S(p.$$.fragment,n),v=!0)},o(n){$(p.$$.fragment,n),v=!1},d(n){n&&o(c),n&&o(g),W(p,n)}}}function ds(C){let c,b,g,p,v;return{c(){c=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),p=i("Module"),v=i(`
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(n){c=s(n,"P",{});var m=r(c);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(m,"CODE",{});var j=r(g);p=l(j,"Module"),j.forEach(o),v=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(n,m){_(n,c,m),e(c,b),e(c,g),e(g,p),e(c,v)},d(n){n&&o(c)}}}function ps(C){let c,b,g,p,v;return p=new go({props:{code:`from transformers import AutoProcessor, SEWModel
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-tiny-100k-ft-ls100h")
model = SEWModel.from_pretrained("asapp/sew-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, SEWModel
<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-tiny-100k-ft-ls100h&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SEWModel.from_pretrained(<span class="hljs-string">&quot;asapp/sew-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">512</span>]`}}),{c(){c=a("p"),b=i("Example:"),g=f(),w(p.$$.fragment)},l(n){c=s(n,"P",{});var m=r(c);b=l(m,"Example:"),m.forEach(o),g=h(n),y(p.$$.fragment,n)},m(n,m){_(n,c,m),e(c,b),_(n,g,m),E(p,n,m),v=!0},p:uo,i(n){v||(S(p.$$.fragment,n),v=!0)},o(n){$(p.$$.fragment,n),v=!1},d(n){n&&o(c),n&&o(g),W(p,n)}}}function ms(C){let c,b,g,p,v;return{c(){c=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),p=i("Module"),v=i(`
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(n){c=s(n,"P",{});var m=r(c);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(m,"CODE",{});var j=r(g);p=l(j,"Module"),j.forEach(o),v=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(n,m){_(n,c,m),e(c,b),e(c,g),e(g,p),e(c,v)},d(n){n&&o(c)}}}function fs(C){let c,b,g,p,v;return p=new go({props:{code:`from transformers import AutoProcessor, SEWForCTC
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-tiny-100k-ft-ls100h")
model = SEWForCTC.from_pretrained("asapp/sew-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, SEWForCTC
<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-tiny-100k-ft-ls100h&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SEWForCTC.from_pretrained(<span class="hljs-string">&quot;asapp/sew-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 APPOSTILE OF THE MIDDLE CLASSES AND WE ARE GLAD TO WELCOME HIS GOSPOLLE&#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.42</span>`}}),{c(){c=a("p"),b=i("Example:"),g=f(),w(p.$$.fragment)},l(n){c=s(n,"P",{});var m=r(c);b=l(m,"Example:"),m.forEach(o),g=h(n),y(p.$$.fragment,n)},m(n,m){_(n,c,m),e(c,b),_(n,g,m),E(p,n,m),v=!0},p:uo,i(n){v||(S(p.$$.fragment,n),v=!0)},o(n){$(p.$$.fragment,n),v=!1},d(n){n&&o(c),n&&o(g),W(p,n)}}}function hs(C){let c,b,g,p,v;return{c(){c=a("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a("code"),p=i("Module"),v=i(`
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(n){c=s(n,"P",{});var m=r(c);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(m,"CODE",{});var j=r(g);p=l(j,"Module"),j.forEach(o),v=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(n,m){_(n,c,m),e(c,b),e(c,g),e(g,p),e(c,v)},d(n){n&&o(c)}}}function us(C){let c,b,g,p,v;return p=new go({props:{code:`from transformers import AutoFeatureExtractor, SEWForSequenceClassification
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-mid-100k-ft-keyword-spotting")
model = SEWForSequenceClassification.from_pretrained("anton-l/sew-mid-100k-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, SEWForSequenceClassification
<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-mid-100k-ft-keyword-spotting&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SEWForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;anton-l/sew-mid-100k-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">9.52</span>`}}),{c(){c=a("p"),b=i("Example:"),g=f(),w(p.$$.fragment)},l(n){c=s(n,"P",{});var m=r(c);b=l(m,"Example:"),m.forEach(o),g=h(n),y(p.$$.fragment,n)},m(n,m){_(n,c,m),e(c,b),_(n,g,m),E(p,n,m),v=!0},p:uo,i(n){v||(S(p.$$.fragment,n),v=!0)},o(n){$(p.$$.fragment,n),v=!1},d(n){n&&o(c),n&&o(g),W(p,n)}}}function gs(C){let c,b,g,p,v,n,m,j,_o,At,O,Q,ft,he,vo,ht,bo,zt,Y,wo,ue,yo,Eo,Dt,Be,So,Ot,Je,ut,$o,Lt,Qe,Wo,It,G,gt,ko,Co,ge,To,Ye,xo,jo,Nt,X,qo,_e,Po,Fo,Kt,L,Z,_t,ve,Mo,vt,Ao,Vt,q,be,zo,I,Do,Ge,Oo,Lo,we,Io,No,Ko,N,Vo,Xe,Ho,Ro,Ze,Uo,Bo,Jo,ee,Ht,K,te,bt,ye,Qo,wt,Yo,Rt,T,Ee,Go,Se,Xo,$e,Zo,en,tn,We,on,et,nn,an,sn,ke,rn,Ce,ln,cn,dn,P,Te,pn,V,mn,tt,fn,hn,yt,un,gn,_n,oe,vn,ne,Ut,H,ae,Et,xe,bn,St,wn,Bt,x,je,yn,R,En,$t,Sn,$n,qe,Wn,kn,Cn,Pe,Tn,ot,xn,jn,qn,Fe,Pn,Me,Fn,Mn,An,F,Ae,zn,U,Dn,nt,On,Ln,Wt,In,Nn,Kn,se,Vn,re,Jt,B,ie,kt,ze,Hn,Ct,Rn,Qt,k,De,Un,Tt,Bn,Jn,Oe,Qn,Le,Yn,Gn,Xn,Ie,Zn,at,ea,ta,oa,Ne,na,Ke,aa,sa,ra,M,Ve,ia,J,la,st,ca,da,xt,pa,ma,fa,le,ha,ce,Yt;return n=new mt({}),he=new mt({}),ve=new mt({}),be=new Ue({props:{name:"class transformers.SEWConfig",anchor:"transformers.SEWConfig",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:"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:" = (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.SEWConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Vocabulary size of the SEW model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <code>SEW</code>.`,name:"vocab_size"},{anchor:"transformers.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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/sew#transformers.SEWForCTC">SEWForCTC</a>.`,name:"final_dropout"},{anchor:"transformers.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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.SEWConfig.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/main/en/model_doc/sew#transformers.SEWForCTC">SEWForCTC</a>.`,name:"ctc_loss_reduction"},{anchor:"transformers.SEWConfig.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/sew#transformers.SEWForCTC">SEWForCTC</a>.`,name:"ctc_zero_infinity"},{anchor:"transformers.SEWConfig.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/wav2vec2#transformers.Wav2Vec2ForSequenceClassification">Wav2Vec2ForSequenceClassification</a>.`,name:"use_weighted_layer_sum"},{anchor:"transformers.SEWConfig.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/main/src/transformers/models/sew/configuration_sew.py#L32"}}),ee=new ho({props:{anchor:"transformers.SEWConfig.example",$$slots:{default:[cs]},$$scope:{ctx:C}}}),ye=new mt({}),Ee=new Ue({props:{name:"class transformers.SEWModel",anchor:"transformers.SEWModel",parameters:[{name:"config",val:": SEWConfig"}],parametersDescription:[{anchor:"transformers.SEWModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/sew#transformers.SEWConfig">SEWConfig</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/sew/modeling_sew.py#L844"}}),Te=new Ue({props:{name:"forward",anchor:"transformers.SEWModel.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.SEWModel.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.SEWModel.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.SEWModel.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.SEWModel.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.SEWModel.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/sew/modeling_sew.py#L911",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/en/model_doc/sew#transformers.SEWConfig"
>SEWConfig</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/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),oe=new ua({props:{$$slots:{default:[ds]},$$scope:{ctx:C}}}),ne=new ho({props:{anchor:"transformers.SEWModel.forward.example",$$slots:{default:[ps]},$$scope:{ctx:C}}}),xe=new mt({}),je=new Ue({props:{name:"class transformers.SEWForCTC",anchor:"transformers.SEWForCTC",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SEWForCTC.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/sew#transformers.SEWConfig">SEWConfig</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/sew/modeling_sew.py#L973"}}),Ae=new Ue({props:{name:"forward",anchor:"transformers.SEWForCTC.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.SEWForCTC.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.SEWForCTC.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.SEWForCTC.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.SEWForCTC.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.SEWForCTC.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.SEWForCTC.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/sew/modeling_sew.py#L1014",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/sew#transformers.SEWConfig"
>SEWConfig</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>
`}}),se=new ua({props:{$$slots:{default:[ms]},$$scope:{ctx:C}}}),re=new ho({props:{anchor:"transformers.SEWForCTC.forward.example",$$slots:{default:[fs]},$$scope:{ctx:C}}}),ze=new mt({}),De=new Ue({props:{name:"class transformers.SEWForSequenceClassification",anchor:"transformers.SEWForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SEWForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/sew#transformers.SEWConfig">SEWConfig</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/sew/modeling_sew.py#L1103"}}),Ve=new Ue({props:{name:"forward",anchor:"transformers.SEWForSequenceClassification.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.SEWForSequenceClassification.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.SEWForSequenceClassification.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.SEWForSequenceClassification.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.SEWForSequenceClassification.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.SEWForSequenceClassification.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.SEWForSequenceClassification.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/sew/modeling_sew.py#L1148",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/sew#transformers.SEWConfig"
>SEWConfig</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>
`}}),le=new ua({props:{$$slots:{default:[hs]},$$scope:{ctx:C}}}),ce=new ho({props:{anchor:"transformers.SEWForSequenceClassification.forward.example",$$slots:{default:[us]},$$scope:{ctx:C}}}),{c(){c=a("meta"),b=f(),g=a("h1"),p=a("a"),v=a("span"),w(n.$$.fragment),m=f(),j=a("span"),_o=i("SEW"),At=f(),O=a("h2"),Q=a("a"),ft=a("span"),w(he.$$.fragment),vo=f(),ht=a("span"),bo=i("Overview"),zt=f(),Y=a("p"),wo=i("SEW (Squeezed and Efficient Wav2Vec) was proposed in "),ue=a("a"),yo=i(`Performance-Efficiency Trade-offs in Unsupervised Pre-training
for Speech Recognition`),Eo=i(` by Felix Wu, Kwangyoun Kim, Jing Pan, Kyu Han, Kilian Q.
Weinberger, Yoav Artzi.`),Dt=f(),Be=a("p"),So=i("The abstract from the paper is the following:"),Ot=f(),Je=a("p"),ut=a("em"),$o=i(`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.`),Lt=f(),Qe=a("p"),Wo=i("Tips:"),It=f(),G=a("ul"),gt=a("li"),ko=i("SEW is a speech model that accepts a float array corresponding to the raw waveform of the speech signal."),Co=f(),ge=a("li"),To=i(`SEWForCTC is fine-tuned using connectionist temporal classification (CTC) so the model output has to be decoded using
`),Ye=a("a"),xo=i("Wav2Vec2CTCTokenizer"),jo=i("."),Nt=f(),X=a("p"),qo=i("This model was contributed by "),_e=a("a"),Po=i("anton-l"),Fo=i("."),Kt=f(),L=a("h2"),Z=a("a"),_t=a("span"),w(ve.$$.fragment),Mo=f(),vt=a("span"),Ao=i("SEWConfig"),Vt=f(),q=a("div"),w(be.$$.fragment),zo=f(),I=a("p"),Do=i("This is the configuration class to store the configuration of a "),Ge=a("a"),Oo=i("SEWModel"),Lo=i(`. It is used to instantiate a SEW 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
`),we=a("a"),Io=i("asapp/sew-tiny-100k"),No=i(" architecture."),Ko=f(),N=a("p"),Vo=i("Configuration objects inherit from "),Xe=a("a"),Ho=i("PretrainedConfig"),Ro=i(` and can be used to control the model outputs. Read the
documentation from `),Ze=a("a"),Uo=i("PretrainedConfig"),Bo=i(" for more information."),Jo=f(),w(ee.$$.fragment),Ht=f(),K=a("h2"),te=a("a"),bt=a("span"),w(ye.$$.fragment),Qo=f(),wt=a("span"),Yo=i("SEWModel"),Rt=f(),T=a("div"),w(Ee.$$.fragment),Go=f(),Se=a("p"),Xo=i(`The bare SEW Model transformer outputting raw hidden-states without any specific head on top.
SEW was proposed in `),$e=a("a"),Zo=i(`Performance-Efficiency Trade-offs in Unsupervised Pre-training for Speech
Recognition`),en=i(` by Felix Wu, Kwangyoun Kim, Jing Pan, Kyu Han, Kilian Q. Weinberger,
Yoav Artzi.`),tn=f(),We=a("p"),on=i("This model inherits from "),et=a("a"),nn=i("PreTrainedModel"),an=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),sn=f(),ke=a("p"),rn=i("This model is a PyTorch "),Ce=a("a"),ln=i("torch.nn.Module"),cn=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),dn=f(),P=a("div"),w(Te.$$.fragment),pn=f(),V=a("p"),mn=i("The "),tt=a("a"),fn=i("SEWModel"),hn=i(" forward method, overrides the "),yt=a("code"),un=i("__call__"),gn=i(" special method."),_n=f(),w(oe.$$.fragment),vn=f(),w(ne.$$.fragment),Ut=f(),H=a("h2"),ae=a("a"),Et=a("span"),w(xe.$$.fragment),bn=f(),St=a("span"),wn=i("SEWForCTC"),Bt=f(),x=a("div"),w(je.$$.fragment),yn=f(),R=a("p"),En=i("SEW Model with a "),$t=a("code"),Sn=i("language modeling"),$n=i(` head on top for Connectionist Temporal Classification (CTC).
SEW was proposed in `),qe=a("a"),Wn=i(`Performance-Efficiency Trade-offs in Unsupervised Pre-training for Speech
Recognition`),kn=i(` by Felix Wu, Kwangyoun Kim, Jing Pan, Kyu Han, Kilian Q. Weinberger,
Yoav Artzi.`),Cn=f(),Pe=a("p"),Tn=i("This model inherits from "),ot=a("a"),xn=i("PreTrainedModel"),jn=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),qn=f(),Fe=a("p"),Pn=i("This model is a PyTorch "),Me=a("a"),Fn=i("torch.nn.Module"),Mn=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),An=f(),F=a("div"),w(Ae.$$.fragment),zn=f(),U=a("p"),Dn=i("The "),nt=a("a"),On=i("SEWForCTC"),Ln=i(" forward method, overrides the "),Wt=a("code"),In=i("__call__"),Nn=i(" special method."),Kn=f(),w(se.$$.fragment),Vn=f(),w(re.$$.fragment),Jt=f(),B=a("h2"),ie=a("a"),kt=a("span"),w(ze.$$.fragment),Hn=f(),Ct=a("span"),Rn=i("SEWForSequenceClassification"),Qt=f(),k=a("div"),w(De.$$.fragment),Un=f(),Tt=a("p"),Bn=i(`SEW Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like SUPERB
Keyword Spotting.`),Jn=f(),Oe=a("p"),Qn=i("SEW was proposed in "),Le=a("a"),Yn=i(`Performance-Efficiency Trade-offs in Unsupervised Pre-training for Speech
Recognition`),Gn=i(` by Felix Wu, Kwangyoun Kim, Jing Pan, Kyu Han, Kilian Q. Weinberger,
Yoav Artzi.`),Xn=f(),Ie=a("p"),Zn=i("This model inherits from "),at=a("a"),ea=i("PreTrainedModel"),ta=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),oa=f(),Ne=a("p"),na=i("This model is a PyTorch "),Ke=a("a"),aa=i("torch.nn.Module"),sa=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ra=f(),M=a("div"),w(Ve.$$.fragment),ia=f(),J=a("p"),la=i("The "),st=a("a"),ca=i("SEWForSequenceClassification"),da=i(" forward method, overrides the "),xt=a("code"),pa=i("__call__"),ma=i(" special method."),fa=f(),w(le.$$.fragment),ha=f(),w(ce.$$.fragment),this.h()},l(t){const u=is('[data-svelte="svelte-1phssyn"]',document.head);c=s(u,"META",{name:!0,content:!0}),u.forEach(o),b=h(t),g=s(t,"H1",{class:!0});var He=r(g);p=s(He,"A",{id:!0,class:!0,href:!0});var jt=r(p);v=s(jt,"SPAN",{});var qt=r(v);y(n.$$.fragment,qt),qt.forEach(o),jt.forEach(o),m=h(He),j=s(He,"SPAN",{});var Pt=r(j);_o=l(Pt,"SEW"),Pt.forEach(o),He.forEach(o),At=h(t),O=s(t,"H2",{class:!0});var Re=r(O);Q=s(Re,"A",{id:!0,class:!0,href:!0});var Ft=r(Q);ft=s(Ft,"SPAN",{});var Mt=r(ft);y(he.$$.fragment,Mt),Mt.forEach(o),Ft.forEach(o),vo=h(Re),ht=s(Re,"SPAN",{});var ga=r(ht);bo=l(ga,"Overview"),ga.forEach(o),Re.forEach(o),zt=h(t),Y=s(t,"P",{});var Gt=r(Y);wo=l(Gt,"SEW (Squeezed and Efficient Wav2Vec) was proposed in "),ue=s(Gt,"A",{href:!0,rel:!0});var _a=r(ue);yo=l(_a,`Performance-Efficiency Trade-offs in Unsupervised Pre-training
for Speech Recognition`),_a.forEach(o),Eo=l(Gt,` by Felix Wu, Kwangyoun Kim, Jing Pan, Kyu Han, Kilian Q.
Weinberger, Yoav Artzi.`),Gt.forEach(o),Dt=h(t),Be=s(t,"P",{});var va=r(Be);So=l(va,"The abstract from the paper is the following:"),va.forEach(o),Ot=h(t),Je=s(t,"P",{});var ba=r(Je);ut=s(ba,"EM",{});var wa=r(ut);$o=l(wa,`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.`),wa.forEach(o),ba.forEach(o),Lt=h(t),Qe=s(t,"P",{});var ya=r(Qe);Wo=l(ya,"Tips:"),ya.forEach(o),It=h(t),G=s(t,"UL",{});var Xt=r(G);gt=s(Xt,"LI",{});var Ea=r(gt);ko=l(Ea,"SEW is a speech model that accepts a float array corresponding to the raw waveform of the speech signal."),Ea.forEach(o),Co=h(Xt),ge=s(Xt,"LI",{});var Zt=r(ge);To=l(Zt,`SEWForCTC is fine-tuned using connectionist temporal classification (CTC) so the model output has to be decoded using
`),Ye=s(Zt,"A",{href:!0});var Sa=r(Ye);xo=l(Sa,"Wav2Vec2CTCTokenizer"),Sa.forEach(o),jo=l(Zt,"."),Zt.forEach(o),Xt.forEach(o),Nt=h(t),X=s(t,"P",{});var eo=r(X);qo=l(eo,"This model was contributed by "),_e=s(eo,"A",{href:!0,rel:!0});var $a=r(_e);Po=l($a,"anton-l"),$a.forEach(o),Fo=l(eo,"."),eo.forEach(o),Kt=h(t),L=s(t,"H2",{class:!0});var to=r(L);Z=s(to,"A",{id:!0,class:!0,href:!0});var Wa=r(Z);_t=s(Wa,"SPAN",{});var ka=r(_t);y(ve.$$.fragment,ka),ka.forEach(o),Wa.forEach(o),Mo=h(to),vt=s(to,"SPAN",{});var Ca=r(vt);Ao=l(Ca,"SEWConfig"),Ca.forEach(o),to.forEach(o),Vt=h(t),q=s(t,"DIV",{class:!0});var de=r(q);y(be.$$.fragment,de),zo=h(de),I=s(de,"P",{});var rt=r(I);Do=l(rt,"This is the configuration class to store the configuration of a "),Ge=s(rt,"A",{href:!0});var Ta=r(Ge);Oo=l(Ta,"SEWModel"),Ta.forEach(o),Lo=l(rt,`. It is used to instantiate a SEW 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
`),we=s(rt,"A",{href:!0,rel:!0});var xa=r(we);Io=l(xa,"asapp/sew-tiny-100k"),xa.forEach(o),No=l(rt," architecture."),rt.forEach(o),Ko=h(de),N=s(de,"P",{});var it=r(N);Vo=l(it,"Configuration objects inherit from "),Xe=s(it,"A",{href:!0});var ja=r(Xe);Ho=l(ja,"PretrainedConfig"),ja.forEach(o),Ro=l(it,` and can be used to control the model outputs. Read the
documentation from `),Ze=s(it,"A",{href:!0});var qa=r(Ze);Uo=l(qa,"PretrainedConfig"),qa.forEach(o),Bo=l(it," for more information."),it.forEach(o),Jo=h(de),y(ee.$$.fragment,de),de.forEach(o),Ht=h(t),K=s(t,"H2",{class:!0});var oo=r(K);te=s(oo,"A",{id:!0,class:!0,href:!0});var Pa=r(te);bt=s(Pa,"SPAN",{});var Fa=r(bt);y(ye.$$.fragment,Fa),Fa.forEach(o),Pa.forEach(o),Qo=h(oo),wt=s(oo,"SPAN",{});var Ma=r(wt);Yo=l(Ma,"SEWModel"),Ma.forEach(o),oo.forEach(o),Rt=h(t),T=s(t,"DIV",{class:!0});var z=r(T);y(Ee.$$.fragment,z),Go=h(z),Se=s(z,"P",{});var no=r(Se);Xo=l(no,`The bare SEW Model transformer outputting raw hidden-states without any specific head on top.
SEW was proposed in `),$e=s(no,"A",{href:!0,rel:!0});var Aa=r($e);Zo=l(Aa,`Performance-Efficiency Trade-offs in Unsupervised Pre-training for Speech
Recognition`),Aa.forEach(o),en=l(no,` by Felix Wu, Kwangyoun Kim, Jing Pan, Kyu Han, Kilian Q. Weinberger,
Yoav Artzi.`),no.forEach(o),tn=h(z),We=s(z,"P",{});var ao=r(We);on=l(ao,"This model inherits from "),et=s(ao,"A",{href:!0});var za=r(et);nn=l(za,"PreTrainedModel"),za.forEach(o),an=l(ao,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),ao.forEach(o),sn=h(z),ke=s(z,"P",{});var so=r(ke);rn=l(so,"This model is a PyTorch "),Ce=s(so,"A",{href:!0,rel:!0});var Da=r(Ce);ln=l(Da,"torch.nn.Module"),Da.forEach(o),cn=l(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),dn=h(z),P=s(z,"DIV",{class:!0});var pe=r(P);y(Te.$$.fragment,pe),pn=h(pe),V=s(pe,"P",{});var lt=r(V);mn=l(lt,"The "),tt=s(lt,"A",{href:!0});var Oa=r(tt);fn=l(Oa,"SEWModel"),Oa.forEach(o),hn=l(lt," forward method, overrides the "),yt=s(lt,"CODE",{});var La=r(yt);un=l(La,"__call__"),La.forEach(o),gn=l(lt," special method."),lt.forEach(o),_n=h(pe),y(oe.$$.fragment,pe),vn=h(pe),y(ne.$$.fragment,pe),pe.forEach(o),z.forEach(o),Ut=h(t),H=s(t,"H2",{class:!0});var ro=r(H);ae=s(ro,"A",{id:!0,class:!0,href:!0});var Ia=r(ae);Et=s(Ia,"SPAN",{});var Na=r(Et);y(xe.$$.fragment,Na),Na.forEach(o),Ia.forEach(o),bn=h(ro),St=s(ro,"SPAN",{});var Ka=r(St);wn=l(Ka,"SEWForCTC"),Ka.forEach(o),ro.forEach(o),Bt=h(t),x=s(t,"DIV",{class:!0});var D=r(x);y(je.$$.fragment,D),yn=h(D),R=s(D,"P",{});var ct=r(R);En=l(ct,"SEW Model with a "),$t=s(ct,"CODE",{});var Va=r($t);Sn=l(Va,"language modeling"),Va.forEach(o),$n=l(ct,` head on top for Connectionist Temporal Classification (CTC).
SEW was proposed in `),qe=s(ct,"A",{href:!0,rel:!0});var Ha=r(qe);Wn=l(Ha,`Performance-Efficiency Trade-offs in Unsupervised Pre-training for Speech
Recognition`),Ha.forEach(o),kn=l(ct,` by Felix Wu, Kwangyoun Kim, Jing Pan, Kyu Han, Kilian Q. Weinberger,
Yoav Artzi.`),ct.forEach(o),Cn=h(D),Pe=s(D,"P",{});var io=r(Pe);Tn=l(io,"This model inherits from "),ot=s(io,"A",{href:!0});var Ra=r(ot);xn=l(Ra,"PreTrainedModel"),Ra.forEach(o),jn=l(io,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),io.forEach(o),qn=h(D),Fe=s(D,"P",{});var lo=r(Fe);Pn=l(lo,"This model is a PyTorch "),Me=s(lo,"A",{href:!0,rel:!0});var Ua=r(Me);Fn=l(Ua,"torch.nn.Module"),Ua.forEach(o),Mn=l(lo,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),lo.forEach(o),An=h(D),F=s(D,"DIV",{class:!0});var me=r(F);y(Ae.$$.fragment,me),zn=h(me),U=s(me,"P",{});var dt=r(U);Dn=l(dt,"The "),nt=s(dt,"A",{href:!0});var Ba=r(nt);On=l(Ba,"SEWForCTC"),Ba.forEach(o),Ln=l(dt," forward method, overrides the "),Wt=s(dt,"CODE",{});var Ja=r(Wt);In=l(Ja,"__call__"),Ja.forEach(o),Nn=l(dt," special method."),dt.forEach(o),Kn=h(me),y(se.$$.fragment,me),Vn=h(me),y(re.$$.fragment,me),me.forEach(o),D.forEach(o),Jt=h(t),B=s(t,"H2",{class:!0});var co=r(B);ie=s(co,"A",{id:!0,class:!0,href:!0});var Qa=r(ie);kt=s(Qa,"SPAN",{});var Ya=r(kt);y(ze.$$.fragment,Ya),Ya.forEach(o),Qa.forEach(o),Hn=h(co),Ct=s(co,"SPAN",{});var Ga=r(Ct);Rn=l(Ga,"SEWForSequenceClassification"),Ga.forEach(o),co.forEach(o),Qt=h(t),k=s(t,"DIV",{class:!0});var A=r(k);y(De.$$.fragment,A),Un=h(A),Tt=s(A,"P",{});var Xa=r(Tt);Bn=l(Xa,`SEW Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like SUPERB
Keyword Spotting.`),Xa.forEach(o),Jn=h(A),Oe=s(A,"P",{});var po=r(Oe);Qn=l(po,"SEW was proposed in "),Le=s(po,"A",{href:!0,rel:!0});var Za=r(Le);Yn=l(Za,`Performance-Efficiency Trade-offs in Unsupervised Pre-training for Speech
Recognition`),Za.forEach(o),Gn=l(po,` by Felix Wu, Kwangyoun Kim, Jing Pan, Kyu Han, Kilian Q. Weinberger,
Yoav Artzi.`),po.forEach(o),Xn=h(A),Ie=s(A,"P",{});var mo=r(Ie);Zn=l(mo,"This model inherits from "),at=s(mo,"A",{href:!0});var es=r(at);ea=l(es,"PreTrainedModel"),es.forEach(o),ta=l(mo,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),mo.forEach(o),oa=h(A),Ne=s(A,"P",{});var fo=r(Ne);na=l(fo,"This model is a PyTorch "),Ke=s(fo,"A",{href:!0,rel:!0});var ts=r(Ke);aa=l(ts,"torch.nn.Module"),ts.forEach(o),sa=l(fo,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),fo.forEach(o),ra=h(A),M=s(A,"DIV",{class:!0});var fe=r(M);y(Ve.$$.fragment,fe),ia=h(fe),J=s(fe,"P",{});var pt=r(J);la=l(pt,"The "),st=s(pt,"A",{href:!0});var os=r(st);ca=l(os,"SEWForSequenceClassification"),os.forEach(o),da=l(pt," forward method, overrides the "),xt=s(pt,"CODE",{});var ns=r(xt);pa=l(ns,"__call__"),ns.forEach(o),ma=l(pt," special method."),pt.forEach(o),fa=h(fe),y(le.$$.fragment,fe),ha=h(fe),y(ce.$$.fragment,fe),fe.forEach(o),A.forEach(o),this.h()},h(){d(c,"name","hf:doc:metadata"),d(c,"content",JSON.stringify(_s)),d(p,"id","sew"),d(p,"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(p,"href","#sew"),d(g,"class","relative group"),d(Q,"id","overview"),d(Q,"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(Q,"href","#overview"),d(O,"class","relative group"),d(ue,"href","https://arxiv.org/abs/2109.06870"),d(ue,"rel","nofollow"),d(Ye,"href","/docs/transformers/main/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer"),d(_e,"href","https://huggingface.co/anton-l"),d(_e,"rel","nofollow"),d(Z,"id","transformers.SEWConfig"),d(Z,"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(Z,"href","#transformers.SEWConfig"),d(L,"class","relative group"),d(Ge,"href","/docs/transformers/main/en/model_doc/sew#transformers.SEWModel"),d(we,"href","https://huggingface.co/asapp/sew-tiny-100k"),d(we,"rel","nofollow"),d(Xe,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(Ze,"href","/docs/transformers/main/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(te,"id","transformers.SEWModel"),d(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"),d(te,"href","#transformers.SEWModel"),d(K,"class","relative group"),d($e,"href","https://arxiv.org/abs/2109.06870"),d($e,"rel","nofollow"),d(et,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(Ce,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ce,"rel","nofollow"),d(tt,"href","/docs/transformers/main/en/model_doc/sew#transformers.SEWModel"),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(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(ae,"id","transformers.SEWForCTC"),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.SEWForCTC"),d(H,"class","relative group"),d(qe,"href","https://arxiv.org/abs/2109.06870"),d(qe,"rel","nofollow"),d(ot,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(Me,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Me,"rel","nofollow"),d(nt,"href","/docs/transformers/main/en/model_doc/sew#transformers.SEWForCTC"),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(x,"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.SEWForSequenceClassification"),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.SEWForSequenceClassification"),d(B,"class","relative group"),d(Le,"href","https://arxiv.org/abs/2109.06870"),d(Le,"rel","nofollow"),d(at,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(Ke,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ke,"rel","nofollow"),d(st,"href","/docs/transformers/main/en/model_doc/sew#transformers.SEWForSequenceClassification"),d(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(k,"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,u){e(document.head,c),_(t,b,u),_(t,g,u),e(g,p),e(p,v),E(n,v,null),e(g,m),e(g,j),e(j,_o),_(t,At,u),_(t,O,u),e(O,Q),e(Q,ft),E(he,ft,null),e(O,vo),e(O,ht),e(ht,bo),_(t,zt,u),_(t,Y,u),e(Y,wo),e(Y,ue),e(ue,yo),e(Y,Eo),_(t,Dt,u),_(t,Be,u),e(Be,So),_(t,Ot,u),_(t,Je,u),e(Je,ut),e(ut,$o),_(t,Lt,u),_(t,Qe,u),e(Qe,Wo),_(t,It,u),_(t,G,u),e(G,gt),e(gt,ko),e(G,Co),e(G,ge),e(ge,To),e(ge,Ye),e(Ye,xo),e(ge,jo),_(t,Nt,u),_(t,X,u),e(X,qo),e(X,_e),e(_e,Po),e(X,Fo),_(t,Kt,u),_(t,L,u),e(L,Z),e(Z,_t),E(ve,_t,null),e(L,Mo),e(L,vt),e(vt,Ao),_(t,Vt,u),_(t,q,u),E(be,q,null),e(q,zo),e(q,I),e(I,Do),e(I,Ge),e(Ge,Oo),e(I,Lo),e(I,we),e(we,Io),e(I,No),e(q,Ko),e(q,N),e(N,Vo),e(N,Xe),e(Xe,Ho),e(N,Ro),e(N,Ze),e(Ze,Uo),e(N,Bo),e(q,Jo),E(ee,q,null),_(t,Ht,u),_(t,K,u),e(K,te),e(te,bt),E(ye,bt,null),e(K,Qo),e(K,wt),e(wt,Yo),_(t,Rt,u),_(t,T,u),E(Ee,T,null),e(T,Go),e(T,Se),e(Se,Xo),e(Se,$e),e($e,Zo),e(Se,en),e(T,tn),e(T,We),e(We,on),e(We,et),e(et,nn),e(We,an),e(T,sn),e(T,ke),e(ke,rn),e(ke,Ce),e(Ce,ln),e(ke,cn),e(T,dn),e(T,P),E(Te,P,null),e(P,pn),e(P,V),e(V,mn),e(V,tt),e(tt,fn),e(V,hn),e(V,yt),e(yt,un),e(V,gn),e(P,_n),E(oe,P,null),e(P,vn),E(ne,P,null),_(t,Ut,u),_(t,H,u),e(H,ae),e(ae,Et),E(xe,Et,null),e(H,bn),e(H,St),e(St,wn),_(t,Bt,u),_(t,x,u),E(je,x,null),e(x,yn),e(x,R),e(R,En),e(R,$t),e($t,Sn),e(R,$n),e(R,qe),e(qe,Wn),e(R,kn),e(x,Cn),e(x,Pe),e(Pe,Tn),e(Pe,ot),e(ot,xn),e(Pe,jn),e(x,qn),e(x,Fe),e(Fe,Pn),e(Fe,Me),e(Me,Fn),e(Fe,Mn),e(x,An),e(x,F),E(Ae,F,null),e(F,zn),e(F,U),e(U,Dn),e(U,nt),e(nt,On),e(U,Ln),e(U,Wt),e(Wt,In),e(U,Nn),e(F,Kn),E(se,F,null),e(F,Vn),E(re,F,null),_(t,Jt,u),_(t,B,u),e(B,ie),e(ie,kt),E(ze,kt,null),e(B,Hn),e(B,Ct),e(Ct,Rn),_(t,Qt,u),_(t,k,u),E(De,k,null),e(k,Un),e(k,Tt),e(Tt,Bn),e(k,Jn),e(k,Oe),e(Oe,Qn),e(Oe,Le),e(Le,Yn),e(Oe,Gn),e(k,Xn),e(k,Ie),e(Ie,Zn),e(Ie,at),e(at,ea),e(Ie,ta),e(k,oa),e(k,Ne),e(Ne,na),e(Ne,Ke),e(Ke,aa),e(Ne,sa),e(k,ra),e(k,M),E(Ve,M,null),e(M,ia),e(M,J),e(J,la),e(J,st),e(st,ca),e(J,da),e(J,xt),e(xt,pa),e(J,ma),e(M,fa),E(le,M,null),e(M,ha),E(ce,M,null),Yt=!0},p(t,[u]){const He={};u&2&&(He.$$scope={dirty:u,ctx:t}),ee.$set(He);const jt={};u&2&&(jt.$$scope={dirty:u,ctx:t}),oe.$set(jt);const qt={};u&2&&(qt.$$scope={dirty:u,ctx:t}),ne.$set(qt);const Pt={};u&2&&(Pt.$$scope={dirty:u,ctx:t}),se.$set(Pt);const Re={};u&2&&(Re.$$scope={dirty:u,ctx:t}),re.$set(Re);const Ft={};u&2&&(Ft.$$scope={dirty:u,ctx:t}),le.$set(Ft);const Mt={};u&2&&(Mt.$$scope={dirty:u,ctx:t}),ce.$set(Mt)},i(t){Yt||(S(n.$$.fragment,t),S(he.$$.fragment,t),S(ve.$$.fragment,t),S(be.$$.fragment,t),S(ee.$$.fragment,t),S(ye.$$.fragment,t),S(Ee.$$.fragment,t),S(Te.$$.fragment,t),S(oe.$$.fragment,t),S(ne.$$.fragment,t),S(xe.$$.fragment,t),S(je.$$.fragment,t),S(Ae.$$.fragment,t),S(se.$$.fragment,t),S(re.$$.fragment,t),S(ze.$$.fragment,t),S(De.$$.fragment,t),S(Ve.$$.fragment,t),S(le.$$.fragment,t),S(ce.$$.fragment,t),Yt=!0)},o(t){$(n.$$.fragment,t),$(he.$$.fragment,t),$(ve.$$.fragment,t),$(be.$$.fragment,t),$(ee.$$.fragment,t),$(ye.$$.fragment,t),$(Ee.$$.fragment,t),$(Te.$$.fragment,t),$(oe.$$.fragment,t),$(ne.$$.fragment,t),$(xe.$$.fragment,t),$(je.$$.fragment,t),$(Ae.$$.fragment,t),$(se.$$.fragment,t),$(re.$$.fragment,t),$(ze.$$.fragment,t),$(De.$$.fragment,t),$(Ve.$$.fragment,t),$(le.$$.fragment,t),$(ce.$$.fragment,t),Yt=!1},d(t){o(c),t&&o(b),t&&o(g),W(n),t&&o(At),t&&o(O),W(he),t&&o(zt),t&&o(Y),t&&o(Dt),t&&o(Be),t&&o(Ot),t&&o(Je),t&&o(Lt),t&&o(Qe),t&&o(It),t&&o(G),t&&o(Nt),t&&o(X),t&&o(Kt),t&&o(L),W(ve),t&&o(Vt),t&&o(q),W(be),W(ee),t&&o(Ht),t&&o(K),W(ye),t&&o(Rt),t&&o(T),W(Ee),W(Te),W(oe),W(ne),t&&o(Ut),t&&o(H),W(xe),t&&o(Bt),t&&o(x),W(je),W(Ae),W(se),W(re),t&&o(Jt),t&&o(B),W(ze),t&&o(Qt),t&&o(k),W(De),W(Ve),W(le),W(ce)}}}const _s={local:"sew",sections:[{local:"overview",title:"Overview"},{local:"transformers.SEWConfig",title:"SEWConfig"},{local:"transformers.SEWModel",title:"SEWModel"},{local:"transformers.SEWForCTC",title:"SEWForCTC"},{local:"transformers.SEWForSequenceClassification",title:"SEWForSequenceClassification"}],title:"SEW"};function vs(C){return ls(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ws extends as{constructor(c){super();ss(this,c,vs,gs,rs,{})}}export{Ws as default,_s as metadata};
