import{S as js,i as qs,s as Ps,e as n,k as p,w,t as r,M as Fs,c as a,d as o,m as f,a as s,x as E,h as i,b as c,G as e,g as _,y,q as S,o as $,B as W,v as As,L as xo}from"../../chunks/vendor-hf-doc-builder.js";import{T as Aa}from"../../chunks/Tip-hf-doc-builder.js";import{D as Ye}from"../../chunks/Docstring-hf-doc-builder.js";import{C as jo}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 Ms(C){let d,b,g,h,v;return h=new jo({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(){d=n("p"),b=r("Example:"),g=p(),w(h.$$.fragment)},l(l){d=a(l,"P",{});var u=s(d);b=i(u,"Example:"),u.forEach(o),g=f(l),E(h.$$.fragment,l)},m(l,u){_(l,d,u),e(d,b),_(l,g,u),y(h,l,u),v=!0},p:xo,i(l){v||(S(h.$$.fragment,l),v=!0)},o(l){$(h.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(g),W(h,l)}}}function zs(C){let d,b,g,h,v;return{c(){d=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){d=a(l,"P",{});var u=s(d);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 j=s(g);h=i(j,"Module"),j.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,d,u),e(d,b),e(d,g),e(g,h),e(d,v)},d(l){l&&o(d)}}}function Ds(C){let d,b,g,h,v;return h=new jo({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(){d=n("p"),b=r("Example:"),g=p(),w(h.$$.fragment)},l(l){d=a(l,"P",{});var u=s(d);b=i(u,"Example:"),u.forEach(o),g=f(l),E(h.$$.fragment,l)},m(l,u){_(l,d,u),e(d,b),_(l,g,u),y(h,l,u),v=!0},p:xo,i(l){v||(S(h.$$.fragment,l),v=!0)},o(l){$(h.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(g),W(h,l)}}}function Os(C){let d,b,g,h,v;return{c(){d=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){d=a(l,"P",{});var u=s(d);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 j=s(g);h=i(j,"Module"),j.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,d,u),e(d,b),e(d,g),e(g,h),e(d,v)},d(l){l&&o(d)}}}function Ls(C){let d,b,g,h,v;return h=new jo({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(){d=n("p"),b=r("Example:"),g=p(),w(h.$$.fragment)},l(l){d=a(l,"P",{});var u=s(d);b=i(u,"Example:"),u.forEach(o),g=f(l),E(h.$$.fragment,l)},m(l,u){_(l,d,u),e(d,b),_(l,g,u),y(h,l,u),v=!0},p:xo,i(l){v||(S(h.$$.fragment,l),v=!0)},o(l){$(h.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(g),W(h,l)}}}function Is(C){let d,b,g,h,v;return{c(){d=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){d=a(l,"P",{});var u=s(d);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 j=s(g);h=i(j,"Module"),j.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,d,u),e(d,b),e(d,g),e(g,h),e(d,v)},d(l){l&&o(d)}}}function Ns(C){let d,b,g,h,v;return h=new jo({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(){d=n("p"),b=r("Example:"),g=p(),w(h.$$.fragment)},l(l){d=a(l,"P",{});var u=s(d);b=i(u,"Example:"),u.forEach(o),g=f(l),E(h.$$.fragment,l)},m(l,u){_(l,d,u),e(d,b),_(l,g,u),y(h,l,u),v=!0},p:xo,i(l){v||(S(h.$$.fragment,l),v=!0)},o(l){$(h.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(g),W(h,l)}}}function Ks(C){let d,b,g,h,v,l,u,j,qo,Ut,O,Y,bt,_e,Po,wt,Fo,Rt,G,Ao,ve,Mo,zo,Bt,Xe,Do,Jt,Ze,Et,Oo,Qt,et,Lo,Yt,X,yt,Io,No,be,Ko,tt,Vo,Ho,Gt,Z,Uo,we,Ro,Bo,Xt,L,ee,St,Ee,Jo,$t,Qo,Zt,te,Wt,ot,Yo,Go,kt,nt,Xo,eo,I,oe,Ct,ye,Zo,Tt,en,to,q,Se,tn,N,on,at,nn,an,$e,sn,rn,ln,K,cn,st,dn,pn,rt,fn,mn,hn,ne,oo,V,ae,xt,We,un,jt,gn,no,T,ke,_n,Ce,vn,Te,bn,wn,En,xe,yn,it,Sn,$n,Wn,je,kn,qe,Cn,Tn,xn,P,Pe,jn,H,qn,lt,Pn,Fn,qt,An,Mn,zn,se,Dn,re,ao,U,ie,Pt,Fe,On,Ft,Ln,so,x,Ae,In,R,Nn,At,Kn,Vn,Me,Hn,Un,Rn,ze,Bn,ct,Jn,Qn,Yn,De,Gn,Oe,Xn,Zn,ea,F,Le,ta,B,oa,dt,na,aa,Mt,sa,ra,ia,le,la,ce,ro,J,de,zt,Ie,ca,Dt,da,io,k,Ne,pa,Ot,fa,ma,Ke,ha,Ve,ua,ga,_a,He,va,pt,ba,wa,Ea,Ue,ya,Re,Sa,$a,Wa,A,Be,ka,Q,Ca,ft,Ta,xa,Lt,ja,qa,Pa,pe,Fa,fe,lo;return l=new Ge({}),_e=new Ge({}),Ee=new Ge({}),ye=new Ge({}),Se=new Ye({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/v4.27.1/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/v4.27.1/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/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/sew/configuration_sew.py#L32"}}),ne=new To({props:{anchor:"transformers.SEWConfig.example",$$slots:{default:[Ms]},$$scope:{ctx:C}}}),We=new Ge({}),ke=new Ye({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/v4.27.1/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/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/modeling_sew.py#L843"}}),Pe=new Ye({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/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.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/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/modeling_sew.py#L910",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#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/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 Aa({props:{$$slots:{default:[zs]},$$scope:{ctx:C}}}),re=new To({props:{anchor:"transformers.SEWModel.forward.example",$$slots:{default:[Ds]},$$scope:{ctx:C}}}),Fe=new Ge({}),Ae=new Ye({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/v4.27.1/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/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/modeling_sew.py#L972"}}),Le=new Ye({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/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.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/v4.27.1/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/v4.27.1/src/transformers/models/sew/modeling_sew.py#L1013",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#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/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 Aa({props:{$$slots:{default:[Os]},$$scope:{ctx:C}}}),ce=new To({props:{anchor:"transformers.SEWForCTC.forward.example",$$slots:{default:[Ls]},$$scope:{ctx:C}}}),Ie=new Ge({}),Ne=new Ye({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/v4.27.1/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/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/modeling_sew.py#L1101"}}),Be=new Ye({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/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.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/v4.27.1/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/v4.27.1/src/transformers/models/sew/modeling_sew.py#L1146",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#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/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 Aa({props:{$$slots:{default:[Is]},$$scope:{ctx:C}}}),fe=new To({props:{anchor:"transformers.SEWForSequenceClassification.forward.example",$$slots:{default:[Ns]},$$scope:{ctx:C}}}),{c(){d=n("meta"),b=p(),g=n("h1"),h=n("a"),v=n("span"),w(l.$$.fragment),u=p(),j=n("span"),qo=r("SEW"),Ut=p(),O=n("h2"),Y=n("a"),bt=n("span"),w(_e.$$.fragment),Po=p(),wt=n("span"),Fo=r("Overview"),Rt=p(),G=n("p"),Ao=r("SEW (Squeezed and Efficient Wav2Vec) was proposed in "),ve=n("a"),Mo=r(`Performance-Efficiency Trade-offs in Unsupervised Pre-training
for Speech Recognition`),zo=r(` by Felix Wu, Kwangyoun Kim, Jing Pan, Kyu Han, Kilian Q.
Weinberger, Yoav Artzi.`),Bt=p(),Xe=n("p"),Do=r("The abstract from the paper is the following:"),Jt=p(),Ze=n("p"),Et=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"),yt=n("li"),Io=r("SEW 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(`SEWForCTC 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(Ee.$$.fragment),Jo=p(),$t=n("span"),Qo=r("Documentation resources"),Zt=p(),te=n("ul"),Wt=n("li"),ot=n("a"),Yo=r("Audio classification task guide"),Go=p(),kt=n("li"),nt=n("a"),Xo=r("Automatic speech recognition task guide"),eo=p(),I=n("h2"),oe=n("a"),Ct=n("span"),w(ye.$$.fragment),Zo=p(),Tt=n("span"),en=r("SEWConfig"),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("SEWModel"),an=r(`. 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
`),$e=n("a"),sn=r("asapp/sew-tiny-100k"),rn=r(" architecture."),ln=p(),K=n("p"),cn=r("Configuration objects inherit from "),st=n("a"),dn=r("PretrainedConfig"),pn=r(` and can be used to control the model outputs. Read the
documentation from `),rt=n("a"),fn=r("PretrainedConfig"),mn=r(" for more information."),hn=p(),w(ne.$$.fragment),oo=p(),V=n("h2"),ae=n("a"),xt=n("span"),w(We.$$.fragment),un=p(),jt=n("span"),gn=r("SEWModel"),no=p(),T=n("div"),w(ke.$$.fragment),_n=p(),Ce=n("p"),vn=r(`The bare SEW Model transformer outputting raw hidden-states without any specific head on top.
SEW 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.`),En=p(),xe=n("p"),yn=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.).`),Wn=p(),je=n("p"),kn=r("This model is a PyTorch "),qe=n("a"),Cn=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.`),xn=p(),P=n("div"),w(Pe.$$.fragment),jn=p(),H=n("p"),qn=r("The "),lt=n("a"),Pn=r("SEWModel"),Fn=r(" forward method, overrides the "),qt=n("code"),An=r("__call__"),Mn=r(" special method."),zn=p(),w(se.$$.fragment),Dn=p(),w(re.$$.fragment),ao=p(),U=n("h2"),ie=n("a"),Pt=n("span"),w(Fe.$$.fragment),On=p(),Ft=n("span"),Ln=r("SEWForCTC"),so=p(),x=n("div"),w(Ae.$$.fragment),In=p(),R=n("p"),Nn=r("SEW Model with a "),At=n("code"),Kn=r("language modeling"),Vn=r(` head on top for Connectionist Temporal Classification (CTC).
SEW was proposed in `),Me=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(),ze=n("p"),Bn=r("This model inherits from "),ct=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(),De=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(),F=n("div"),w(Le.$$.fragment),ta=p(),B=n("p"),oa=r("The "),dt=n("a"),na=r("SEWForCTC"),aa=r(" forward method, overrides the "),Mt=n("code"),sa=r("__call__"),ra=r(" special method."),ia=p(),w(le.$$.fragment),la=p(),w(ce.$$.fragment),ro=p(),J=n("h2"),de=n("a"),zt=n("span"),w(Ie.$$.fragment),ca=p(),Dt=n("span"),da=r("SEWForSequenceClassification"),io=p(),k=n("div"),w(Ne.$$.fragment),pa=p(),Ot=n("p"),fa=r(`SEW Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like SUPERB
Keyword Spotting.`),ma=p(),Ke=n("p"),ha=r("SEW 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.).`),Ea=p(),Ue=n("p"),ya=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.`),Wa=p(),A=n("div"),w(Be.$$.fragment),ka=p(),Q=n("p"),Ca=r("The "),ft=n("a"),Ta=r("SEWForSequenceClassification"),xa=r(" forward method, overrides the "),Lt=n("code"),ja=r("__call__"),qa=r(" special method."),Pa=p(),w(pe.$$.fragment),Fa=p(),w(fe.$$.fragment),this.h()},l(t){const m=Fs('[data-svelte="svelte-1phssyn"]',document.head);d=a(m,"META",{name:!0,content:!0}),m.forEach(o),b=f(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);E(l.$$.fragment,Nt),Nt.forEach(o),It.forEach(o),u=f(Je),j=a(Je,"SPAN",{});var Kt=s(j);qo=i(Kt,"SEW"),Kt.forEach(o),Je.forEach(o),Ut=f(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);E(_e.$$.fragment,Ht),Ht.forEach(o),Vt.forEach(o),Po=f(Qe),wt=a(Qe,"SPAN",{});var Ma=s(wt);Fo=i(Ma,"Overview"),Ma.forEach(o),Qe.forEach(o),Rt=f(t),G=a(t,"P",{});var co=s(G);Ao=i(co,"SEW (Squeezed and Efficient Wav2Vec) was proposed in "),ve=a(co,"A",{href:!0,rel:!0});var za=s(ve);Mo=i(za,`Performance-Efficiency Trade-offs in Unsupervised Pre-training
for Speech Recognition`),za.forEach(o),zo=i(co,` by Felix Wu, Kwangyoun Kim, Jing Pan, Kyu Han, Kilian Q.
Weinberger, Yoav Artzi.`),co.forEach(o),Bt=f(t),Xe=a(t,"P",{});var Da=s(Xe);Do=i(Da,"The abstract from the paper is the following:"),Da.forEach(o),Jt=f(t),Ze=a(t,"P",{});var Oa=s(Ze);Et=a(Oa,"EM",{});var La=s(Et);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=f(t),et=a(t,"P",{});var Ia=s(et);Lo=i(Ia,"Tips:"),Ia.forEach(o),Yt=f(t),X=a(t,"UL",{});var po=s(X);yt=a(po,"LI",{});var Na=s(yt);Io=i(Na,"SEW is a speech model that accepts a float array corresponding to the raw waveform of the speech signal."),Na.forEach(o),No=f(po),be=a(po,"LI",{});var fo=s(be);Ko=i(fo,`SEWForCTC is fine-tuned using connectionist temporal classification (CTC) so the model output has to be decoded using
`),tt=a(fo,"A",{href:!0});var Ka=s(tt);Vo=i(Ka,"Wav2Vec2CTCTokenizer"),Ka.forEach(o),Ho=i(fo,"."),fo.forEach(o),po.forEach(o),Gt=f(t),Z=a(t,"P",{});var mo=s(Z);Uo=i(mo,"This model was contributed by "),we=a(mo,"A",{href:!0,rel:!0});var Va=s(we);Ro=i(Va,"anton-l"),Va.forEach(o),Bo=i(mo,"."),mo.forEach(o),Xt=f(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);E(Ee.$$.fragment,Ua),Ua.forEach(o),Ha.forEach(o),Jo=f(ho),$t=a(ho,"SPAN",{});var Ra=s($t);Qo=i(Ra,"Documentation resources"),Ra.forEach(o),ho.forEach(o),Zt=f(t),te=a(t,"UL",{});var uo=s(te);Wt=a(uo,"LI",{});var Ba=s(Wt);ot=a(Ba,"A",{href:!0});var Ja=s(ot);Yo=i(Ja,"Audio classification task guide"),Ja.forEach(o),Ba.forEach(o),Go=f(uo),kt=a(uo,"LI",{});var Qa=s(kt);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=f(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);Ct=a(Ga,"SPAN",{});var Xa=s(Ct);E(ye.$$.fragment,Xa),Xa.forEach(o),Ga.forEach(o),Zo=f(go),Tt=a(go,"SPAN",{});var Za=s(Tt);en=i(Za,"SEWConfig"),Za.forEach(o),go.forEach(o),to=f(t),q=a(t,"DIV",{class:!0});var me=s(q);E(Se.$$.fragment,me),tn=f(me),N=a(me,"P",{});var mt=s(N);on=i(mt,"This is the configuration class to store the configuration of a "),at=a(mt,"A",{href:!0});var es=s(at);nn=i(es,"SEWModel"),es.forEach(o),an=i(mt,`. 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
`),$e=a(mt,"A",{href:!0,rel:!0});var ts=s($e);sn=i(ts,"asapp/sew-tiny-100k"),ts.forEach(o),rn=i(mt," architecture."),mt.forEach(o),ln=f(me),K=a(me,"P",{});var ht=s(K);cn=i(ht,"Configuration objects inherit from "),st=a(ht,"A",{href:!0});var os=s(st);dn=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);fn=i(ns,"PretrainedConfig"),ns.forEach(o),mn=i(ht," for more information."),ht.forEach(o),hn=f(me),E(ne.$$.fragment,me),me.forEach(o),oo=f(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);xt=a(as,"SPAN",{});var ss=s(xt);E(We.$$.fragment,ss),ss.forEach(o),as.forEach(o),un=f(_o),jt=a(_o,"SPAN",{});var rs=s(jt);gn=i(rs,"SEWModel"),rs.forEach(o),_o.forEach(o),no=f(t),T=a(t,"DIV",{class:!0});var z=s(T);E(ke.$$.fragment,z),_n=f(z),Ce=a(z,"P",{});var vo=s(Ce);vn=i(vo,`The bare SEW Model transformer outputting raw hidden-states without any specific head on top.
SEW 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),En=f(z),xe=a(z,"P",{});var bo=s(xe);yn=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),Wn=f(z),je=a(z,"P",{});var wo=s(je);kn=i(wo,"This model is a PyTorch "),qe=a(wo,"A",{href:!0,rel:!0});var cs=s(qe);Cn=i(cs,"torch.nn.Module"),cs.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),xn=f(z),P=a(z,"DIV",{class:!0});var he=s(P);E(Pe.$$.fragment,he),jn=f(he),H=a(he,"P",{});var ut=s(H);qn=i(ut,"The "),lt=a(ut,"A",{href:!0});var ds=s(lt);Pn=i(ds,"SEWModel"),ds.forEach(o),Fn=i(ut," forward method, overrides the "),qt=a(ut,"CODE",{});var ps=s(qt);An=i(ps,"__call__"),ps.forEach(o),Mn=i(ut," special method."),ut.forEach(o),zn=f(he),E(se.$$.fragment,he),Dn=f(he),E(re.$$.fragment,he),he.forEach(o),z.forEach(o),ao=f(t),U=a(t,"H2",{class:!0});var Eo=s(U);ie=a(Eo,"A",{id:!0,class:!0,href:!0});var fs=s(ie);Pt=a(fs,"SPAN",{});var ms=s(Pt);E(Fe.$$.fragment,ms),ms.forEach(o),fs.forEach(o),On=f(Eo),Ft=a(Eo,"SPAN",{});var hs=s(Ft);Ln=i(hs,"SEWForCTC"),hs.forEach(o),Eo.forEach(o),so=f(t),x=a(t,"DIV",{class:!0});var D=s(x);E(Ae.$$.fragment,D),In=f(D),R=a(D,"P",{});var gt=s(R);Nn=i(gt,"SEW Model with a "),At=a(gt,"CODE",{});var us=s(At);Kn=i(us,"language modeling"),us.forEach(o),Vn=i(gt,` head on top for Connectionist Temporal Classification (CTC).
SEW was proposed in `),Me=a(gt,"A",{href:!0,rel:!0});var gs=s(Me);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=f(D),ze=a(D,"P",{});var yo=s(ze);Bn=i(yo,"This model inherits from "),ct=a(yo,"A",{href:!0});var _s=s(ct);Jn=i(_s,"PreTrainedModel"),_s.forEach(o),Qn=i(yo,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),yo.forEach(o),Yn=f(D),De=a(D,"P",{});var So=s(De);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=f(D),F=a(D,"DIV",{class:!0});var ue=s(F);E(Le.$$.fragment,ue),ta=f(ue),B=a(ue,"P",{});var _t=s(B);oa=i(_t,"The "),dt=a(_t,"A",{href:!0});var bs=s(dt);na=i(bs,"SEWForCTC"),bs.forEach(o),aa=i(_t," forward method, overrides the "),Mt=a(_t,"CODE",{});var ws=s(Mt);sa=i(ws,"__call__"),ws.forEach(o),ra=i(_t," special method."),_t.forEach(o),ia=f(ue),E(le.$$.fragment,ue),la=f(ue),E(ce.$$.fragment,ue),ue.forEach(o),D.forEach(o),ro=f(t),J=a(t,"H2",{class:!0});var $o=s(J);de=a($o,"A",{id:!0,class:!0,href:!0});var Es=s(de);zt=a(Es,"SPAN",{});var ys=s(zt);E(Ie.$$.fragment,ys),ys.forEach(o),Es.forEach(o),ca=f($o),Dt=a($o,"SPAN",{});var Ss=s(Dt);da=i(Ss,"SEWForSequenceClassification"),Ss.forEach(o),$o.forEach(o),io=f(t),k=a(t,"DIV",{class:!0});var M=s(k);E(Ne.$$.fragment,M),pa=f(M),Ot=a(M,"P",{});var $s=s(Ot);fa=i($s,`SEW Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like SUPERB
Keyword Spotting.`),$s.forEach(o),ma=f(M),Ke=a(M,"P",{});var Wo=s(Ke);ha=i(Wo,"SEW was proposed in "),Ve=a(Wo,"A",{href:!0,rel:!0});var Ws=s(Ve);ua=i(Ws,`Performance-Efficiency Trade-offs in Unsupervised Pre-training for Speech
Recognition`),Ws.forEach(o),ga=i(Wo,` by Felix Wu, Kwangyoun Kim, Jing Pan, Kyu Han, Kilian Q. Weinberger,
Yoav Artzi.`),Wo.forEach(o),_a=f(M),He=a(M,"P",{});var ko=s(He);va=i(ko,"This model inherits from "),pt=a(ko,"A",{href:!0});var ks=s(pt);ba=i(ks,"PreTrainedModel"),ks.forEach(o),wa=i(ko,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),ko.forEach(o),Ea=f(M),Ue=a(M,"P",{});var Co=s(Ue);ya=i(Co,"This model is a PyTorch "),Re=a(Co,"A",{href:!0,rel:!0});var Cs=s(Re);Sa=i(Cs,"torch.nn.Module"),Cs.forEach(o),$a=i(Co,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Co.forEach(o),Wa=f(M),A=a(M,"DIV",{class:!0});var ge=s(A);E(Be.$$.fragment,ge),ka=f(ge),Q=a(ge,"P",{});var vt=s(Q);Ca=i(vt,"The "),ft=a(vt,"A",{href:!0});var Ts=s(ft);Ta=i(Ts,"SEWForSequenceClassification"),Ts.forEach(o),xa=i(vt," forward method, overrides the "),Lt=a(vt,"CODE",{});var xs=s(Lt);ja=i(xs,"__call__"),xs.forEach(o),qa=i(vt," special method."),vt.forEach(o),Pa=f(ge),E(pe.$$.fragment,ge),Fa=f(ge),E(fe.$$.fragment,ge),ge.forEach(o),M.forEach(o),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(Vs)),c(h,"id","sew"),c(h,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(h,"href","#sew"),c(g,"class","relative group"),c(Y,"id","overview"),c(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"),c(Y,"href","#overview"),c(O,"class","relative group"),c(ve,"href","https://arxiv.org/abs/2109.06870"),c(ve,"rel","nofollow"),c(tt,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer"),c(we,"href","https://huggingface.co/anton-l"),c(we,"rel","nofollow"),c(ee,"id","documentation-resources"),c(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"),c(ee,"href","#documentation-resources"),c(L,"class","relative group"),c(ot,"href","./tasks/audio_classification"),c(nt,"href","./tasks/asr"),c(oe,"id","transformers.SEWConfig"),c(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"),c(oe,"href","#transformers.SEWConfig"),c(I,"class","relative group"),c(at,"href","/docs/transformers/v4.27.1/en/model_doc/sew#transformers.SEWModel"),c($e,"href","https://huggingface.co/asapp/sew-tiny-100k"),c($e,"rel","nofollow"),c(st,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(rt,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ae,"id","transformers.SEWModel"),c(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"),c(ae,"href","#transformers.SEWModel"),c(V,"class","relative group"),c(Te,"href","https://arxiv.org/abs/2109.06870"),c(Te,"rel","nofollow"),c(it,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(qe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(qe,"rel","nofollow"),c(lt,"href","/docs/transformers/v4.27.1/en/model_doc/sew#transformers.SEWModel"),c(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ie,"id","transformers.SEWForCTC"),c(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"),c(ie,"href","#transformers.SEWForCTC"),c(U,"class","relative group"),c(Me,"href","https://arxiv.org/abs/2109.06870"),c(Me,"rel","nofollow"),c(ct,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(Oe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Oe,"rel","nofollow"),c(dt,"href","/docs/transformers/v4.27.1/en/model_doc/sew#transformers.SEWForCTC"),c(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(de,"id","transformers.SEWForSequenceClassification"),c(de,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(de,"href","#transformers.SEWForSequenceClassification"),c(J,"class","relative group"),c(Ve,"href","https://arxiv.org/abs/2109.06870"),c(Ve,"rel","nofollow"),c(pt,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(Re,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Re,"rel","nofollow"),c(ft,"href","/docs/transformers/v4.27.1/en/model_doc/sew#transformers.SEWForSequenceClassification"),c(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(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,m){e(document.head,d),_(t,b,m),_(t,g,m),e(g,h),e(h,v),y(l,v,null),e(g,u),e(g,j),e(j,qo),_(t,Ut,m),_(t,O,m),e(O,Y),e(Y,bt),y(_e,bt,null),e(O,Po),e(O,wt),e(wt,Fo),_(t,Rt,m),_(t,G,m),e(G,Ao),e(G,ve),e(ve,Mo),e(G,zo),_(t,Bt,m),_(t,Xe,m),e(Xe,Do),_(t,Jt,m),_(t,Ze,m),e(Ze,Et),e(Et,Oo),_(t,Qt,m),_(t,et,m),e(et,Lo),_(t,Yt,m),_(t,X,m),e(X,yt),e(yt,Io),e(X,No),e(X,be),e(be,Ko),e(be,tt),e(tt,Vo),e(be,Ho),_(t,Gt,m),_(t,Z,m),e(Z,Uo),e(Z,we),e(we,Ro),e(Z,Bo),_(t,Xt,m),_(t,L,m),e(L,ee),e(ee,St),y(Ee,St,null),e(L,Jo),e(L,$t),e($t,Qo),_(t,Zt,m),_(t,te,m),e(te,Wt),e(Wt,ot),e(ot,Yo),e(te,Go),e(te,kt),e(kt,nt),e(nt,Xo),_(t,eo,m),_(t,I,m),e(I,oe),e(oe,Ct),y(ye,Ct,null),e(I,Zo),e(I,Tt),e(Tt,en),_(t,to,m),_(t,q,m),y(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,cn),e(K,st),e(st,dn),e(K,pn),e(K,rt),e(rt,fn),e(K,mn),e(q,hn),y(ne,q,null),_(t,oo,m),_(t,V,m),e(V,ae),e(ae,xt),y(We,xt,null),e(V,un),e(V,jt),e(jt,gn),_(t,no,m),_(t,T,m),y(ke,T,null),e(T,_n),e(T,Ce),e(Ce,vn),e(Ce,Te),e(Te,bn),e(Ce,wn),e(T,En),e(T,xe),e(xe,yn),e(xe,it),e(it,Sn),e(xe,$n),e(T,Wn),e(T,je),e(je,kn),e(je,qe),e(qe,Cn),e(je,Tn),e(T,xn),e(T,P),y(Pe,P,null),e(P,jn),e(P,H),e(H,qn),e(H,lt),e(lt,Pn),e(H,Fn),e(H,qt),e(qt,An),e(H,Mn),e(P,zn),y(se,P,null),e(P,Dn),y(re,P,null),_(t,ao,m),_(t,U,m),e(U,ie),e(ie,Pt),y(Fe,Pt,null),e(U,On),e(U,Ft),e(Ft,Ln),_(t,so,m),_(t,x,m),y(Ae,x,null),e(x,In),e(x,R),e(R,Nn),e(R,At),e(At,Kn),e(R,Vn),e(R,Me),e(Me,Hn),e(R,Un),e(x,Rn),e(x,ze),e(ze,Bn),e(ze,ct),e(ct,Jn),e(ze,Qn),e(x,Yn),e(x,De),e(De,Gn),e(De,Oe),e(Oe,Xn),e(De,Zn),e(x,ea),e(x,F),y(Le,F,null),e(F,ta),e(F,B),e(B,oa),e(B,dt),e(dt,na),e(B,aa),e(B,Mt),e(Mt,sa),e(B,ra),e(F,ia),y(le,F,null),e(F,la),y(ce,F,null),_(t,ro,m),_(t,J,m),e(J,de),e(de,zt),y(Ie,zt,null),e(J,ca),e(J,Dt),e(Dt,da),_(t,io,m),_(t,k,m),y(Ne,k,null),e(k,pa),e(k,Ot),e(Ot,fa),e(k,ma),e(k,Ke),e(Ke,ha),e(Ke,Ve),e(Ve,ua),e(Ke,ga),e(k,_a),e(k,He),e(He,va),e(He,pt),e(pt,ba),e(He,wa),e(k,Ea),e(k,Ue),e(Ue,ya),e(Ue,Re),e(Re,Sa),e(Ue,$a),e(k,Wa),e(k,A),y(Be,A,null),e(A,ka),e(A,Q),e(Q,Ca),e(Q,ft),e(ft,Ta),e(Q,xa),e(Q,Lt),e(Lt,ja),e(Q,qa),e(A,Pa),y(pe,A,null),e(A,Fa),y(fe,A,null),lo=!0},p(t,[m]){const Je={};m&2&&(Je.$$scope={dirty:m,ctx:t}),ne.$set(Je);const It={};m&2&&(It.$$scope={dirty:m,ctx:t}),se.$set(It);const Nt={};m&2&&(Nt.$$scope={dirty:m,ctx:t}),re.$set(Nt);const Kt={};m&2&&(Kt.$$scope={dirty:m,ctx:t}),le.$set(Kt);const Qe={};m&2&&(Qe.$$scope={dirty:m,ctx:t}),ce.$set(Qe);const Vt={};m&2&&(Vt.$$scope={dirty:m,ctx:t}),pe.$set(Vt);const Ht={};m&2&&(Ht.$$scope={dirty:m,ctx:t}),fe.$set(Ht)},i(t){lo||(S(l.$$.fragment,t),S(_e.$$.fragment,t),S(Ee.$$.fragment,t),S(ye.$$.fragment,t),S(Se.$$.fragment,t),S(ne.$$.fragment,t),S(We.$$.fragment,t),S(ke.$$.fragment,t),S(Pe.$$.fragment,t),S(se.$$.fragment,t),S(re.$$.fragment,t),S(Fe.$$.fragment,t),S(Ae.$$.fragment,t),S(Le.$$.fragment,t),S(le.$$.fragment,t),S(ce.$$.fragment,t),S(Ie.$$.fragment,t),S(Ne.$$.fragment,t),S(Be.$$.fragment,t),S(pe.$$.fragment,t),S(fe.$$.fragment,t),lo=!0)},o(t){$(l.$$.fragment,t),$(_e.$$.fragment,t),$(Ee.$$.fragment,t),$(ye.$$.fragment,t),$(Se.$$.fragment,t),$(ne.$$.fragment,t),$(We.$$.fragment,t),$(ke.$$.fragment,t),$(Pe.$$.fragment,t),$(se.$$.fragment,t),$(re.$$.fragment,t),$(Fe.$$.fragment,t),$(Ae.$$.fragment,t),$(Le.$$.fragment,t),$(le.$$.fragment,t),$(ce.$$.fragment,t),$(Ie.$$.fragment,t),$(Ne.$$.fragment,t),$(Be.$$.fragment,t),$(pe.$$.fragment,t),$(fe.$$.fragment,t),lo=!1},d(t){o(d),t&&o(b),t&&o(g),W(l),t&&o(Ut),t&&o(O),W(_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),W(Ee),t&&o(Zt),t&&o(te),t&&o(eo),t&&o(I),W(ye),t&&o(to),t&&o(q),W(Se),W(ne),t&&o(oo),t&&o(V),W(We),t&&o(no),t&&o(T),W(ke),W(Pe),W(se),W(re),t&&o(ao),t&&o(U),W(Fe),t&&o(so),t&&o(x),W(Ae),W(Le),W(le),W(ce),t&&o(ro),t&&o(J),W(Ie),t&&o(io),t&&o(k),W(Ne),W(Be),W(pe),W(fe)}}}const Vs={local:"sew",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.SEWConfig",title:"SEWConfig"},{local:"transformers.SEWModel",title:"SEWModel"},{local:"transformers.SEWForCTC",title:"SEWForCTC"},{local:"transformers.SEWForSequenceClassification",title:"SEWForSequenceClassification"}],title:"SEW"};function Hs(C){return As(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Gs extends js{constructor(d){super();qs(this,d,Hs,Ks,Ps,{})}}export{Gs as default,Vs as metadata};
