import{S as zs,i as Gs,s as Rs,e as n,k as p,w as b,t as r,M as Is,c as a,d as o,m,a as s,x as w,h as l,b as c,G as e,g as _,y as E,q as M,o as T,B as W,v as Xs,L as Fo}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ia}from"../../chunks/Tip-hf-doc-builder.js";import{D as ye}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Uo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ke}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Jo}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ns(S){let d,v,g,h,y;return h=new Uo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFNFV0RDb25maWclMkMlMjBTRVdETW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwU0VXLUQlMjBhc2FwcCUyRnNldy1kLXRpbnktMTAwayUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBTRVdEQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMGFzYXBwJTJGc2V3LWQtdGlueS0xMDBrJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBTRVdETW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SEWDConfig, SEWDModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the asapp/sew-d-tiny-100k style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SEWDModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){d=n("p"),v=r("Example:"),g=p(),b(h.$$.fragment)},l(i){d=a(i,"P",{});var u=s(d);v=l(u,"Example:"),u.forEach(o),g=m(i),w(h.$$.fragment,i)},m(i,u){_(i,d,u),e(d,v),_(i,g,u),E(h,i,u),y=!0},p:Fo,i(i){y||(M(h.$$.fragment,i),y=!0)},o(i){T(h.$$.fragment,i),y=!1},d(i){i&&o(d),i&&o(g),W(h,i)}}}function Ps(S){let d,v,g,h,y;return{c(){d=n("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),h=r("Module"),y=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(i){d=a(i,"P",{});var u=s(d);v=l(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(u,"CODE",{});var D=s(g);h=l(D,"Module"),D.forEach(o),y=l(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(i,u){_(i,d,u),e(d,v),e(d,g),e(g,h),e(d,y)},d(i){i&&o(d)}}}function Bs(S){let d,v,g,h,y;return h=new Uo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBTRVdETW9kZWwlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaGYtaW50ZXJuYWwtdGVzdGluZyUyRmxpYnJpc3BlZWNoX2Fzcl9kZW1vJTIyJTJDJTIwJTIyY2xlYW4lMjIlMkMlMjBzcGxpdCUzRCUyMnZhbGlkYXRpb24lMjIpJTBBZGF0YXNldCUyMCUzRCUyMGRhdGFzZXQuc29ydCglMjJpZCUyMiklMEFzYW1wbGluZ19yYXRlJTIwJTNEJTIwZGF0YXNldC5mZWF0dXJlcyU1QiUyMmF1ZGlvJTIyJTVELnNhbXBsaW5nX3JhdGUlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJhc2FwcCUyRnNldy1kLXRpbnktMTAway1mdC1sczEwMGglMjIpJTBBbW9kZWwlMjAlM0QlMjBTRVdETW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmFzYXBwJTJGc2V3LWQtdGlueS0xMDBrLWZ0LWxzMTAwaCUyMiklMEElMEElMjMlMjBhdWRpbyUyMGZpbGUlMjBpcyUyMGRlY29kZWQlMjBvbiUyMHRoZSUyMGZseSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihkYXRhc2V0JTVCMCU1RCU1QiUyMmF1ZGlvJTIyJTVEJTVCJTIyYXJyYXklMjIlNUQlMkMlMjBzYW1wbGluZ19yYXRlJTNEc2FtcGxpbmdfcmF0ZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBbGlzdChsYXN0X2hpZGRlbl9zdGF0ZXMuc2hhcGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, SEWDModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_demo&quot;</span>, <span class="hljs-string">&quot;clean&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.sort(<span class="hljs-string">&quot;id&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>sampling_rate = dataset.features[<span class="hljs-string">&quot;audio&quot;</span>].sampling_rate

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;asapp/sew-d-tiny-100k-ft-ls100h&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SEWDModel.from_pretrained(<span class="hljs-string">&quot;asapp/sew-d-tiny-100k-ft-ls100h&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># audio file is decoded on the fly</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>], sampling_rate=sampling_rate, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">292</span>, <span class="hljs-number">384</span>]`}}),{c(){d=n("p"),v=r("Example:"),g=p(),b(h.$$.fragment)},l(i){d=a(i,"P",{});var u=s(d);v=l(u,"Example:"),u.forEach(o),g=m(i),w(h.$$.fragment,i)},m(i,u){_(i,d,u),e(d,v),_(i,g,u),E(h,i,u),y=!0},p:Fo,i(i){y||(M(h.$$.fragment,i),y=!0)},o(i){T(h.$$.fragment,i),y=!1},d(i){i&&o(d),i&&o(g),W(h,i)}}}function As(S){let d,v,g,h,y;return{c(){d=n("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),h=r("Module"),y=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(i){d=a(i,"P",{});var u=s(d);v=l(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(u,"CODE",{});var D=s(g);h=l(D,"Module"),D.forEach(o),y=l(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(i,u){_(i,d,u),e(d,v),e(d,g),e(g,h),e(d,y)},d(i){i&&o(d)}}}function Qs(S){let d,v,g,h,y;return h=new Uo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBTRVdERm9yQ1RDJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBaW1wb3J0JTIwdG9yY2glMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmhmLWludGVybmFsLXRlc3RpbmclMkZsaWJyaXNwZWVjaF9hc3JfZGVtbyUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWRhdGFzZXQlMjAlM0QlMjBkYXRhc2V0LnNvcnQoJTIyaWQlMjIpJTBBc2FtcGxpbmdfcmF0ZSUyMCUzRCUyMGRhdGFzZXQuZmVhdHVyZXMlNUIlMjJhdWRpbyUyMiU1RC5zYW1wbGluZ19yYXRlJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyYXNhcHAlMkZzZXctZC10aW55LTEwMGstZnQtbHMxMDBoJTIyKSUwQW1vZGVsJTIwJTNEJTIwU0VXREZvckNUQy5mcm9tX3ByZXRyYWluZWQoJTIyYXNhcHAlMkZzZXctZC10aW55LTEwMGstZnQtbHMxMDBoJTIyKSUwQSUwQSUyMyUyMGF1ZGlvJTIwZmlsZSUyMGlzJTIwZGVjb2RlZCUyMG9uJTIwdGhlJTIwZmx5JTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGRhdGFzZXQlNUIwJTVEJTVCJTIyYXVkaW8lMjIlNUQlNUIlMjJhcnJheSUyMiU1RCUyQyUyMHNhbXBsaW5nX3JhdGUlM0RzYW1wbGluZ19yYXRlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQXByZWRpY3RlZF9pZHMlMjAlM0QlMjB0b3JjaC5hcmdtYXgobG9naXRzJTJDJTIwZGltJTNELTEpJTBBJTBBJTIzJTIwdHJhbnNjcmliZSUyMHNwZWVjaCUwQXRyYW5zY3JpcHRpb24lMjAlM0QlMjBwcm9jZXNzb3IuYmF0Y2hfZGVjb2RlKHByZWRpY3RlZF9pZHMpJTBBdHJhbnNjcmlwdGlvbiU1QjAlNUQlMEElMEFpbnB1dHMlNUIlMjJsYWJlbHMlMjIlNUQlMjAlM0QlMjBwcm9jZXNzb3IodGV4dCUzRGRhdGFzZXQlNUIwJTVEJTVCJTIydGV4dCUyMiU1RCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLmlucHV0X2lkcyUwQSUwQSUyMyUyMGNvbXB1dGUlMjBsb3NzJTBBbG9zcyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb3NzJTBBcm91bmQobG9zcy5pdGVtKCklMkMlMjAyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, SEWDForCTC
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_demo&quot;</span>, <span class="hljs-string">&quot;clean&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.sort(<span class="hljs-string">&quot;id&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>sampling_rate = dataset.features[<span class="hljs-string">&quot;audio&quot;</span>].sampling_rate

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;asapp/sew-d-tiny-100k-ft-ls100h&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SEWDForCTC.from_pretrained(<span class="hljs-string">&quot;asapp/sew-d-tiny-100k-ft-ls100h&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># audio file is decoded on the fly</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>], sampling_rate=sampling_rate, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_ids = torch.argmax(logits, dim=-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># transcribe speech</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>transcription = processor.batch_decode(predicted_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>transcription[<span class="hljs-number">0</span>]
<span class="hljs-string">&#x27;MISTER QUILTER IS THE APOSTIL OF THE MIDDLE CLASSES AND WE ARE GLAD TO WELCOME HIS GOSPEL&#x27;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs[<span class="hljs-string">&quot;labels&quot;</span>] = processor(text=dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;text&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute loss</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">0.21</span>`}}),{c(){d=n("p"),v=r("Example:"),g=p(),b(h.$$.fragment)},l(i){d=a(i,"P",{});var u=s(d);v=l(u,"Example:"),u.forEach(o),g=m(i),w(h.$$.fragment,i)},m(i,u){_(i,d,u),e(d,v),_(i,g,u),E(h,i,u),y=!0},p:Fo,i(i){y||(M(h.$$.fragment,i),y=!0)},o(i){T(h.$$.fragment,i),y=!1},d(i){i&&o(d),i&&o(g),W(h,i)}}}function Vs(S){let d,v,g,h,y;return{c(){d=n("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),h=r("Module"),y=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(i){d=a(i,"P",{});var u=s(d);v=l(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(u,"CODE",{});var D=s(g);h=l(D,"Module"),D.forEach(o),y=l(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(i,u){_(i,d,u),e(d,v),e(d,g),e(g,h),e(d,y)},d(i){i&&o(d)}}}function Ys(S){let d,v,g,h,y;return h=new Uo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yJTJDJTIwU0VXREZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaGYtaW50ZXJuYWwtdGVzdGluZyUyRmxpYnJpc3BlZWNoX2Fzcl9kZW1vJTIyJTJDJTIwJTIyY2xlYW4lMjIlMkMlMjBzcGxpdCUzRCUyMnZhbGlkYXRpb24lMjIpJTBBZGF0YXNldCUyMCUzRCUyMGRhdGFzZXQuc29ydCglMjJpZCUyMiklMEFzYW1wbGluZ19yYXRlJTIwJTNEJTIwZGF0YXNldC5mZWF0dXJlcyU1QiUyMmF1ZGlvJTIyJTVELnNhbXBsaW5nX3JhdGUlMEElMEFmZWF0dXJlX2V4dHJhY3RvciUyMCUzRCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yLmZyb21fcHJldHJhaW5lZCglMjJhbnRvbi1sJTJGc2V3LWQtbWlkLTQwMGstZnQta2V5d29yZC1zcG90dGluZyUyMiklMEFtb2RlbCUyMCUzRCUyMFNFV0RGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJhbnRvbi1sJTJGc2V3LWQtbWlkLTQwMGstZnQta2V5d29yZC1zcG90dGluZyUyMiklMEElMEElMjMlMjBhdWRpbyUyMGZpbGUlMjBpcyUyMGRlY29kZWQlMjBvbiUyMHRoZSUyMGZseSUwQWlucHV0cyUyMCUzRCUyMGZlYXR1cmVfZXh0cmFjdG9yKGRhdGFzZXQlNUIwJTVEJTVCJTIyYXVkaW8lMjIlNUQlNUIlMjJhcnJheSUyMiU1RCUyQyUyMHNhbXBsaW5nX3JhdGUlM0RzYW1wbGluZ19yYXRlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQXByZWRpY3RlZF9jbGFzc19pZHMlMjAlM0QlMjB0b3JjaC5hcmdtYXgobG9naXRzJTJDJTIwZGltJTNELTEpLml0ZW0oKSUwQXByZWRpY3RlZF9sYWJlbCUyMCUzRCUyMG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9jbGFzc19pZHMlNUQlMEFwcmVkaWN0ZWRfbGFiZWwlMEElMEElMjMlMjBjb21wdXRlJTIwbG9zcyUyMC0lMjB0YXJnZXRfbGFiZWwlMjBpcyUyMGUuZy4lMjAlMjJkb3duJTIyJTBBdGFyZ2V0X2xhYmVsJTIwJTNEJTIwbW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCMCU1RCUwQWlucHV0cyU1QiUyMmxhYmVscyUyMiU1RCUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUJtb2RlbC5jb25maWcubGFiZWwyaWQlNUJ0YXJnZXRfbGFiZWwlNUQlNUQpJTBBbG9zcyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb3NzJTBBcm91bmQobG9zcy5pdGVtKCklMkMlMjAyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, SEWDForSequenceClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_demo&quot;</span>, <span class="hljs-string">&quot;clean&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.sort(<span class="hljs-string">&quot;id&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>sampling_rate = dataset.features[<span class="hljs-string">&quot;audio&quot;</span>].sampling_rate

<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = AutoFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;anton-l/sew-d-mid-400k-ft-keyword-spotting&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SEWDForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;anton-l/sew-d-mid-400k-ft-keyword-spotting&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># audio file is decoded on the fly</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = feature_extractor(dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>], sampling_rate=sampling_rate, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_ids = torch.argmax(logits, dim=-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = model.config.id2label[predicted_class_ids]
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label
<span class="hljs-string">&#x27;_unknown_&#x27;</span>

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