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