import{S as B1,i as N1,s as X1,e as a,k as d,w as y,t as n,M as G1,c as s,d as t,m as p,a as l,x as w,h as r,b as c,G as e,g as _,y as T,q as M,o as j,B as k,v as R1,L as Ge}from"../../chunks/vendor-hf-doc-builder.js";import{T as we}from"../../chunks/Tip-hf-doc-builder.js";import{D as F}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Fe}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as L}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Xe}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as z1}from"../../chunks/PipelineTag-hf-doc-builder.js";function A1(W){let m,b,u,f,v;return f=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFdhdjJWZWMyQ29uZmlnJTJDJTIwV2F2MlZlYzJNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBXYXYyVmVjMiUyMGZhY2Vib29rJTJGd2F2MnZlYzItYmFzZS05NjBoJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMFdhdjJWZWMyQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMGZhY2Vib29rJTJGd2F2MnZlYzItYmFzZS05NjBoJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBXYXYyVmVjMk1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2Config, Wav2Vec2Model

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Wav2Vec2 facebook/wav2vec2-base-960h style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Wav2Vec2Config()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the facebook/wav2vec2-base-960h style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2Model(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(){m=a("p"),b=n("Example:"),u=d(),y(f.$$.fragment)},l(i){m=s(i,"P",{});var h=l(m);b=r(h,"Example:"),h.forEach(t),u=p(i),w(f.$$.fragment,i)},m(i,h){_(i,m,h),e(m,b),_(i,u,h),T(f,i,h),v=!0},p:Ge,i(i){v||(M(f.$$.fragment,i),v=!0)},o(i){j(f.$$.fragment,i),v=!1},d(i){i&&t(m),i&&t(u),k(f,i)}}}function q1(W){let m,b,u,f,v;return f=new Fe({props:{code:"JTIzJTIwTGV0J3MlMjBzZWUlMjBob3clMjB0byUyMHJldHJpZXZlJTIwdGltZSUyMHN0ZXBzJTIwZm9yJTIwYSUyMG1vZGVsJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvRmVhdHVyZUV4dHJhY3RvciUyQyUyMEF1dG9Nb2RlbEZvckNUQyUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQWltcG9ydCUyMGRhdGFzZXRzJTBBaW1wb3J0JTIwdG9yY2glMEElMEElMjMlMjBpbXBvcnQlMjBtb2RlbCUyQyUyMGZlYXR1cmUlMjBleHRyYWN0b3IlMkMlMjB0b2tlbml6ZXIlMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvck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TIyZW5kX29mZnNldCUyMiU1RCUyMColMjB0aW1lX29mZnNldCUyQyUyMDIpJTJDJTBBJTIwJTIwJTIwJTIwJTdEJTBBJTIwJTIwJTIwJTIwZm9yJTIwZCUyMGluJTIwb3V0cHV0cy53b3JkX29mZnNldHMlMEElNUQlMEElMjMlMjBjb21wYXJlJTIwd29yZCUyMG9mZnNldHMlMjB3aXRoJTIwYXVkaW8lMjAlNjBjb21tb25fdm9pY2VfZW5fMTAwMDM4Lm1wMyU2MCUyMG9ubGluZSUyMG9uJTIwdGhlJTIwZGF0YXNldCUyMHZpZXdlciUzQSUwQSUyMyUyMGh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmNvbW1vbl92b2ljZSUyRnZpZXdlciUyRmVuJTJGdHJhaW4lMEF3b3JkX29mZnNldHMlNUIlM0EzJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Let&#x27;s see how to retrieve time steps for a model</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoFeatureExtractor, AutoModelForCTC
<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> datasets
<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-comment"># import model, feature extractor, tokenizer</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCTC.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-base-960h&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-base-960h&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = AutoFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-base-960h&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># load first sample of English common_voice</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;common_voice&quot;</span>, <span class="hljs-string">&quot;en&quot;</span>, split=<span class="hljs-string">&quot;train&quot;</span>, streaming=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.cast_column(<span class="hljs-string">&quot;audio&quot;</span>, datasets.Audio(sampling_rate=<span class="hljs-number">16_000</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset_iter = <span class="hljs-built_in">iter</span>(dataset)
<span class="hljs-meta">&gt;&gt;&gt; </span>sample = <span class="hljs-built_in">next</span>(dataset_iter)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward sample through model to get greedily predicted transcription ids</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_values = feature_extractor(sample[<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_values
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(input_values).logits[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>pred_ids = torch.argmax(logits, axis=-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve word stamps (analogous commands for \`output_char_offsets\`)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = tokenizer.decode(pred_ids, output_word_offsets=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute \`time_offset\` in seconds as product of downsampling ratio and sampling_rate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>time_offset = model.config.inputs_to_logits_ratio / feature_extractor.sampling_rate

<span class="hljs-meta">&gt;&gt;&gt; </span>word_offsets = [
<span class="hljs-meta">... </span>    {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;word&quot;</span>: d[<span class="hljs-string">&quot;word&quot;</span>],
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;start_time&quot;</span>: <span class="hljs-built_in">round</span>(d[<span class="hljs-string">&quot;start_offset&quot;</span>] * time_offset, <span class="hljs-number">2</span>),
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;end_time&quot;</span>: <span class="hljs-built_in">round</span>(d[<span class="hljs-string">&quot;end_offset&quot;</span>] * time_offset, <span class="hljs-number">2</span>),
<span class="hljs-meta">... </span>    }
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> d <span class="hljs-keyword">in</span> outputs.word_offsets
<span class="hljs-meta">... </span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compare word offsets with audio \`common_voice_en_100038.mp3\` online on the dataset viewer:</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># https://huggingface.co/datasets/common_voice/viewer/en/train</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>word_offsets[:<span class="hljs-number">3</span>]
[{<span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;WHY&#x27;</span>, <span class="hljs-string">&#x27;start_time&#x27;</span>: <span class="hljs-number">1.42</span>, <span class="hljs-string">&#x27;end_time&#x27;</span>: <span class="hljs-number">1.54</span>}, {<span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;DOES&#x27;</span>, <span class="hljs-string">&#x27;start_time&#x27;</span>: <span class="hljs-number">1.64</span>, <span class="hljs-string">&#x27;end_time&#x27;</span>: <span class="hljs-number">1.9</span>}, {<span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;MILISANDRA&#x27;</span>, <span class="hljs-string">&#x27;start_time&#x27;</span>: <span class="hljs-number">2.26</span>, <span class="hljs-string">&#x27;end_time&#x27;</span>: <span class="hljs-number">2.9</span>}]`}}),{c(){m=a("p"),b=n("Example:"),u=d(),y(f.$$.fragment)},l(i){m=s(i,"P",{});var h=l(m);b=r(h,"Example:"),h.forEach(t),u=p(i),w(f.$$.fragment,i)},m(i,h){_(i,m,h),e(m,b),_(i,u,h),T(f,i,h),v=!0},p:Ge,i(i){v||(M(f.$$.fragment,i),v=!0)},o(i){j(f.$$.fragment,i),v=!1},d(i){i&&t(m),i&&t(u),k(f,i)}}}function Y1(W){let m,b,u,f,v,i,h,J;return{c(){m=a("p"),b=n("This class method is simply calling "),u=a("a"),f=n("save_pretrained()"),v=n(` and
`),i=a("a"),h=n("save_pretrained()"),J=n(`. Please refer to the docstrings of the
methods above for more information.`),this.h()},l(I){m=s(I,"P",{});var z=l(m);b=r(z,"This class method is simply calling "),u=s(z,"A",{href:!0});var E=l(u);f=r(E,"save_pretrained()"),E.forEach(t),v=r(z,` and
`),i=s(z,"A",{href:!0});var Z=l(i);h=r(Z,"save_pretrained()"),Z.forEach(t),J=r(z,`. Please refer to the docstrings of the
methods above for more information.`),z.forEach(t),this.h()},h(){c(u,"href","/docs/transformers/v4.33.0/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.save_pretrained"),c(i,"href","/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.save_pretrained")},m(I,z){_(I,m,z),e(m,b),e(m,u),e(u,f),e(m,v),e(m,i),e(i,h),e(m,J)},d(I){I&&t(m)}}}function P1(W){let m,b,u,f,v,i,h,J,I,z,E,Z,R,x;return{c(){m=a("p"),b=n(`This class method is simply calling Wav2Vec2FeatureExtractor\u2019s
`),u=a("a"),f=n("from_pretrained()"),v=n(`, Wav2Vec2CTCTokenizer\u2019s
`),i=a("a"),h=n("from_pretrained()"),J=n(`, and
`),I=a("code"),z=n("pyctcdecode.BeamSearchDecoderCTC.load_from_hf_hub"),E=n("."),Z=d(),R=a("p"),x=n("Please refer to the docstrings of the methods above for more information."),this.h()},l(B){m=s(B,"P",{});var $=l(m);b=r($,`This class method is simply calling Wav2Vec2FeatureExtractor\u2019s
`),u=s($,"A",{href:!0});var ce=l(u);f=r(ce,"from_pretrained()"),ce.forEach(t),v=r($,`, Wav2Vec2CTCTokenizer\u2019s
`),i=s($,"A",{href:!0});var H=l(i);h=r(H,"from_pretrained()"),H.forEach(t),J=r($,`, and
`),I=s($,"CODE",{});var X=l(I);z=r(X,"pyctcdecode.BeamSearchDecoderCTC.load_from_hf_hub"),X.forEach(t),E=r($,"."),$.forEach(t),Z=p(B),R=s(B,"P",{});var de=l(R);x=r(de,"Please refer to the docstrings of the methods above for more information."),de.forEach(t),this.h()},h(){c(u,"href","/docs/transformers/v4.33.0/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.from_pretrained"),c(i,"href","/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.from_pretrained")},m(B,$){_(B,m,$),e(m,b),e(m,u),e(u,f),e(m,v),e(m,i),e(i,h),e(m,J),e(m,I),e(I,z),e(m,E),_(B,Z,$),_(B,R,$),e(R,x)},d(B){B&&t(m),B&&t(Z),B&&t(R)}}}function S1(W){let m,b,u,f,v,i,h,J,I,z,E,Z,R,x,B,$,ce,H,X,de;return{c(){m=a("p"),b=n(`This function makes use of Python\u2019s multiprocessing. Currently, multiprocessing is available only on Unix
systems (see this `),u=a("a"),f=n("issue"),v=n(")."),i=d(),h=a("p"),J=n("If you are decoding multiple batches, consider creating a "),I=a("code"),z=n("Pool"),E=n(" and passing it to "),Z=a("code"),R=n("batch_decode"),x=n(`. Otherwise,
`),B=a("code"),$=n("batch_decode"),ce=n(" will be very slow since it will create a fresh "),H=a("code"),X=n("Pool"),de=n(" for each call. See usage example below."),this.h()},l(G){m=s(G,"P",{});var q=l(m);b=r(q,`This function makes use of Python\u2019s multiprocessing. Currently, multiprocessing is available only on Unix
systems (see this `),u=s(q,"A",{href:!0,rel:!0});var Re=l(u);f=r(Re,"issue"),Re.forEach(t),v=r(q,")."),q.forEach(t),i=p(G),h=s(G,"P",{});var S=l(h);J=r(S,"If you are decoding multiple batches, consider creating a "),I=s(S,"CODE",{});var D=l(I);z=r(D,"Pool"),D.forEach(t),E=r(S," and passing it to "),Z=s(S,"CODE",{});var Ae=l(Z);R=r(Ae,"batch_decode"),Ae.forEach(t),x=r(S,`. Otherwise,
`),B=s(S,"CODE",{});var xe=l(B);$=r(xe,"batch_decode"),xe.forEach(t),ce=r(S," will be very slow since it will create a fresh "),H=s(S,"CODE",{});var O=l(H);X=r(O,"Pool"),O.forEach(t),de=r(S," for each call. See usage example below."),S.forEach(t),this.h()},h(){c(u,"href","https://github.com/kensho-technologies/pyctcdecode/issues/65"),c(u,"rel","nofollow")},m(G,q){_(G,m,q),e(m,b),e(m,u),e(u,f),e(m,v),_(G,i,q),_(G,h,q),e(h,J),e(h,I),e(I,z),e(h,E),e(h,Z),e(Z,R),e(h,x),e(h,B),e(B,$),e(h,ce),e(h,H),e(H,X),e(h,de)},d(G){G&&t(m),G&&t(i),G&&t(h)}}}function Q1(W){let m,b,u,f,v;return f=new Fe({props:{code:"JTIzJTIwTGV0J3MlMjBzZWUlMjBob3clMjB0byUyMHJldHJpZXZlJTIwdGltZSUyMHN0ZXBzJTIwZm9yJTIwYSUyMG1vZGVsJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvUHJvY2Vzc29yJTJDJTIwQXV0b01vZGVsRm9yQ1RDJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBaW1wb3J0JTIwZGF0YXNldHMlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQSUyMyUyMGltcG9ydCUyMG1vZGVsJTJDJTIwZmVhdHVyZSUyMGV4dHJhY3RvciUyQyUyMHRva2VuaXplciUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ1RDLmZyb21fcHJldHJhaW5lZCglMjJw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GluJTIwb3V0cHV0cy53b3JkX29mZnNldHMlMEElNUQlMEElMjMlMjBjb21wYXJlJTIwd29yZCUyMG9mZnNldHMlMjB3aXRoJTIwYXVkaW8lMjAlNjBjb21tb25fdm9pY2VfZW5fMTAwMDM4Lm1wMyU2MCUyMG9ubGluZSUyMG9uJTIwdGhlJTIwZGF0YXNldCUyMHZpZXdlciUzQSUwQSUyMyUyMGh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmNvbW1vbl92b2ljZSUyRnZpZXdlciUyRmVuJTJGdHJhaW4lMEF3b3JkX29mZnNldHMlNUIlM0E0JTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Let&#x27;s see how to retrieve time steps for a model</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoProcessor, AutoModelForCTC
<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> datasets
<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-comment"># import model, feature extractor, tokenizer</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCTC.from_pretrained(<span class="hljs-string">&quot;patrickvonplaten/wav2vec2-base-100h-with-lm&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;patrickvonplaten/wav2vec2-base-100h-with-lm&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># load first sample of English common_voice</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;common_voice&quot;</span>, <span class="hljs-string">&quot;en&quot;</span>, split=<span class="hljs-string">&quot;train&quot;</span>, streaming=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.cast_column(<span class="hljs-string">&quot;audio&quot;</span>, datasets.Audio(sampling_rate=<span class="hljs-number">16_000</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset_iter = <span class="hljs-built_in">iter</span>(dataset)
<span class="hljs-meta">&gt;&gt;&gt; </span>sample = <span class="hljs-built_in">next</span>(dataset_iter)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward sample through model to get greedily predicted transcription ids</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_values = processor(sample[<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_values
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(input_values).logits[<span class="hljs-number">0</span>].cpu().numpy()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve word stamps (analogous commands for \`output_char_offsets\`)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = processor.decode(logits, output_word_offsets=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute \`time_offset\` in seconds as product of downsampling ratio and sampling_rate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>time_offset = model.config.inputs_to_logits_ratio / processor.feature_extractor.sampling_rate

<span class="hljs-meta">&gt;&gt;&gt; </span>word_offsets = [
<span class="hljs-meta">... </span>    {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;word&quot;</span>: d[<span class="hljs-string">&quot;word&quot;</span>],
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;start_time&quot;</span>: <span class="hljs-built_in">round</span>(d[<span class="hljs-string">&quot;start_offset&quot;</span>] * time_offset, <span class="hljs-number">2</span>),
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;end_time&quot;</span>: <span class="hljs-built_in">round</span>(d[<span class="hljs-string">&quot;end_offset&quot;</span>] * time_offset, <span class="hljs-number">2</span>),
<span class="hljs-meta">... </span>    }
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> d <span class="hljs-keyword">in</span> outputs.word_offsets
<span class="hljs-meta">... </span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compare word offsets with audio \`common_voice_en_100038.mp3\` online on the dataset viewer:</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># https://huggingface.co/datasets/common_voice/viewer/en/train</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>word_offsets[:<span class="hljs-number">4</span>]
[{<span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;WHY&#x27;</span>, <span class="hljs-string">&#x27;start_time&#x27;</span>: <span class="hljs-number">1.42</span>, <span class="hljs-string">&#x27;end_time&#x27;</span>: <span class="hljs-number">1.54</span>}, {<span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;DOES&#x27;</span>, <span class="hljs-string">&#x27;start_time&#x27;</span>: <span class="hljs-number">1.66</span>, <span class="hljs-string">&#x27;end_time&#x27;</span>: <span class="hljs-number">1.9</span>}, {<span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;MILISANDRA&#x27;</span>, <span class="hljs-string">&#x27;start_time&#x27;</span>: <span class="hljs-number">2.26</span>, <span class="hljs-string">&#x27;end_time&#x27;</span>: <span class="hljs-number">2.9</span>}, {<span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;LOOK&#x27;</span>, <span class="hljs-string">&#x27;start_time&#x27;</span>: <span class="hljs-number">3.0</span>, <span class="hljs-string">&#x27;end_time&#x27;</span>: <span class="hljs-number">3.16</span>}]`}}),{c(){m=a("p"),b=n("Example:"),u=d(),y(f.$$.fragment)},l(i){m=s(i,"P",{});var h=l(m);b=r(h,"Example:"),h.forEach(t),u=p(i),w(f.$$.fragment,i)},m(i,h){_(i,m,h),e(m,b),_(i,u,h),T(f,i,h),v=!0},p:Ge,i(i){v||(M(f.$$.fragment,i),v=!0)},o(i){j(f.$$.fragment,i),v=!1},d(i){i&&t(m),i&&t(u),k(f,i)}}}function L1(W){let m,b,u,f,v;return{c(){m=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=n("Module"),v=n(`
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){m=s(i,"P",{});var h=l(m);b=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(h,"CODE",{});var J=l(u);f=r(J,"Module"),J.forEach(t),v=r(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(i,h){_(i,m,h),e(m,b),e(m,u),e(u,f),e(m,v)},d(i){i&&t(m)}}}function H1(W){let m,b,u,f,v;return f=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBXYXYyVmVjMk1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmhmLWludGVybmFsLXRlc3RpbmclMkZsaWJyaXNwZWVjaF9hc3JfZGVtbyUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWRhdGFzZXQlMjAlM0QlMjBkYXRhc2V0LnNvcnQoJTIyaWQlMjIpJTBBc2FtcGxpbmdfcmF0ZSUyMCUzRCUyMGRhdGFzZXQuZmVhdHVyZXMlNUIlMjJhdWRpbyUyMiU1RC5zYW1wbGluZ19yYXRlJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3YXYydmVjMi1iYXNlLTk2MGglMjIpJTBBbW9kZWwlMjAlM0QlMjBXYXYyVmVjMk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRndhdjJ2ZWMyLWJhc2UtOTYwaCUyMiklMEElMEElMjMlMjBhdWRpbyUyMGZpbGUlMjBpcyUyMGRlY29kZWQlMjBvbiUyMHRoZSUyMGZseSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihkYXRhc2V0JTVCMCU1RCU1QiUyMmF1ZGlvJTIyJTVEJTVCJTIyYXJyYXklMjIlNUQlMkMlMjBzYW1wbGluZ19yYXRlJTNEc2FtcGxpbmdfcmF0ZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBbGlzdChsYXN0X2hpZGRlbl9zdGF0ZXMuc2hhcGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, Wav2Vec2Model
<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;facebook/wav2vec2-base-960h&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2Model.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-base-960h&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">768</span>]`}}),{c(){m=a("p"),b=n("Example:"),u=d(),y(f.$$.fragment)},l(i){m=s(i,"P",{});var h=l(m);b=r(h,"Example:"),h.forEach(t),u=p(i),w(f.$$.fragment,i)},m(i,h){_(i,m,h),e(m,b),_(i,u,h),T(f,i,h),v=!0},p:Ge,i(i){v||(M(f.$$.fragment,i),v=!0)},o(i){j(f.$$.fragment,i),v=!1},d(i){i&&t(m),i&&t(u),k(f,i)}}}function D1(W){let m,b,u,f,v;return{c(){m=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=n("Module"),v=n(`
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){m=s(i,"P",{});var h=l(m);b=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(h,"CODE",{});var J=l(u);f=r(J,"Module"),J.forEach(t),v=r(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(i,h){_(i,m,h),e(m,b),e(m,u),e(u,f),e(m,v)},d(i){i&&t(m)}}}function O1(W){let m,b,u,f,v;return f=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBXYXYyVmVjMkZvckNUQyUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJoZi1pbnRlcm5hbC10ZXN0aW5nJTJGbGlicmlzcGVlY2hfYXNyX2RlbW8lMjIlMkMlMjAlMjJjbGVhbiUyMiUyQyUyMHNwbGl0JTNEJTIydmFsaWRhdGlvbiUyMiklMEFkYXRhc2V0JTIwJTNEJTIwZGF0YXNldC5zb3J0KCUyMmlkJTIyKSUwQXNhbXBsaW5nX3JhdGUlMjAlM0QlMjBkYXRhc2V0LmZlYXR1cmVzJTVCJTIyYXVkaW8lMjIlNUQuc2FtcGxpbmdfcmF0ZSUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGd2F2MnZlYzItYmFzZS05NjBoJTIyKSUwQW1vZGVsJTIwJTNEJTIwV2F2MlZlYzJGb3JDVEMuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGd2F2MnZlYzItYmFzZS05NjBoJTIyKSUwQSUwQSUyMyUyMGF1ZGlvJTIwZmlsZSUyMGlzJTIwZGVjb2RlZCUyMG9uJTIwdGhlJTIwZmx5JTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGRhdGFzZXQlNUIwJTVEJTVCJTIyYXVkaW8lMjIlNUQlNUIlMjJhcnJheSUyMiU1RCUyQyUyMHNhbXBsaW5nX3JhdGUlM0RzYW1wbGluZ19yYXRlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQXByZWRpY3RlZF9pZHMlMjAlM0QlMjB0b3JjaC5hcmdtYXgobG9naXRzJTJDJTIwZGltJTNELTEpJTBBJTBBJTIzJTIwdHJhbnNjcmliZSUyMHNwZWVjaCUwQXRyYW5zY3JpcHRpb24lMjAlM0QlMjBwcm9jZXNzb3IuYmF0Y2hfZGVjb2RlKHByZWRpY3RlZF9pZHMpJTBBdHJhbnNjcmlwdGlvbiU1QjAlNUQlMEElMEFpbnB1dHMlNUIlMjJsYWJlbHMlMjIlNUQlMjAlM0QlMjBwcm9jZXNzb3IodGV4dCUzRGRhdGFzZXQlNUIwJTVEJTVCJTIydGV4dCUyMiU1RCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLmlucHV0X2lkcyUwQSUwQSUyMyUyMGNvbXB1dGUlMjBsb3NzJTBBbG9zcyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb3NzJTBBcm91bmQobG9zcy5pdGVtKCklMkMlMjAyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, Wav2Vec2ForCTC
<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;facebook/wav2vec2-base-960h&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2ForCTC.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-base-960h&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 APOSTLE 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">53.48</span>`}}),{c(){m=a("p"),b=n("Example:"),u=d(),y(f.$$.fragment)},l(i){m=s(i,"P",{});var h=l(m);b=r(h,"Example:"),h.forEach(t),u=p(i),w(f.$$.fragment,i)},m(i,h){_(i,m,h),e(m,b),_(i,u,h),T(f,i,h),v=!0},p:Ge,i(i){v||(M(f.$$.fragment,i),v=!0)},o(i){j(f.$$.fragment,i),v=!1},d(i){i&&t(m),i&&t(u),k(f,i)}}}function K1(W){let m,b,u,f,v;return{c(){m=a("p"),b=n("Activate the special "),u=a("a"),f=n("\u201Coffline-mode\u201D"),v=n(` to
use this method in a firewalled environment.`),this.h()},l(i){m=s(i,"P",{});var h=l(m);b=r(h,"Activate the special "),u=s(h,"A",{href:!0,rel:!0});var J=l(u);f=r(J,"\u201Coffline-mode\u201D"),J.forEach(t),v=r(h,` to
use this method in a firewalled environment.`),h.forEach(t),this.h()},h(){c(u,"href","https://huggingface.co/transformers/installation.html#offline-mode"),c(u,"rel","nofollow")},m(i,h){_(i,m,h),e(m,b),e(m,u),e(u,f),e(m,v)},d(i){i&&t(m)}}}function ek(W){let m,b,u,f,v;return f=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFdhdjJWZWMyRm9yQ1RDJTJDJTIwQXV0b1Byb2Nlc3NvciUwQSUwQWNrcHQlMjAlM0QlMjAlMjJmYWNlYm9vayUyRm1tcy0xYi1hbGwlMjIlMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZChja3B0KSUwQW1vZGVsJTIwJTNEJTIwV2F2MlZlYzJGb3JDVEMuZnJvbV9wcmV0cmFpbmVkKGNrcHQlMkMlMjB0YXJnZXRfbGFuZyUzRCUyMmVuZyUyMiklMEElMjMlMjBzZXQlMjBzcGVjaWZpYyUyMGxhbmd1YWdlJTBBcHJvY2Vzc29yLnRva2VuaXplci5zZXRfdGFyZ2V0X2xhbmcoJTIyc3BhJTIyKSUwQW1vZGVsLmxvYWRfYWRhcHRlciglMjJzcGElMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2ForCTC, AutoProcessor

<span class="hljs-meta">&gt;&gt;&gt; </span>ckpt = <span class="hljs-string">&quot;facebook/mms-1b-all&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(ckpt)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2ForCTC.from_pretrained(ckpt, target_lang=<span class="hljs-string">&quot;eng&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># set specific language</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>processor.tokenizer.set_target_lang(<span class="hljs-string">&quot;spa&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.load_adapter(<span class="hljs-string">&quot;spa&quot;</span>)`}}),{c(){m=a("p"),b=n("Examples:"),u=d(),y(f.$$.fragment)},l(i){m=s(i,"P",{});var h=l(m);b=r(h,"Examples:"),h.forEach(t),u=p(i),w(f.$$.fragment,i)},m(i,h){_(i,m,h),e(m,b),_(i,u,h),T(f,i,h),v=!0},p:Ge,i(i){v||(M(f.$$.fragment,i),v=!0)},o(i){j(f.$$.fragment,i),v=!1},d(i){i&&t(m),i&&t(u),k(f,i)}}}function tk(W){let m,b,u,f,v;return{c(){m=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=n("Module"),v=n(`
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){m=s(i,"P",{});var h=l(m);b=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(h,"CODE",{});var J=l(u);f=r(J,"Module"),J.forEach(t),v=r(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(i,h){_(i,m,h),e(m,b),e(m,u),e(u,f),e(m,v)},d(i){i&&t(m)}}}function ok(W){let m,b,u,f,v;return f=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yJTJDJTIwV2F2MlZlYzJGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBaW1wb3J0JTIwdG9yY2glMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmhmLWludGVybmFsLXRlc3RpbmclMkZsaWJyaXNwZWVjaF9hc3JfZGVtbyUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWRhdGFzZXQlMjAlM0QlMjBkYXRhc2V0LnNvcnQoJTIyaWQlMjIpJTBBc2FtcGxpbmdfcmF0ZSUyMCUzRCUyMGRhdGFzZXQuZmVhdHVyZXMlNUIlMjJhdWRpbyUyMiU1RC5zYW1wbGluZ19yYXRlJTBBJTBBZmVhdHVyZV9leHRyYWN0b3IlMjAlM0QlMjBBdXRvRmVhdHVyZUV4dHJhY3Rvci5mcm9tX3ByZXRyYWluZWQoJTIyc3VwZXJiJTJGd2F2MnZlYzItYmFzZS1zdXBlcmIta3MlMjIpJTBBbW9kZWwlMjAlM0QlMjBXYXYyVmVjMkZvclNlcXVlbmNlQ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zLml0ZW0oKSUyQyUyMDIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, Wav2Vec2ForSequenceClassification
<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;superb/wav2vec2-base-superb-ks&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2ForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;superb/wav2vec2-base-superb-ks&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">6.54</span>`}}),{c(){m=a("p"),b=n("Example:"),u=d(),y(f.$$.fragment)},l(i){m=s(i,"P",{});var h=l(m);b=r(h,"Example:"),h.forEach(t),u=p(i),w(f.$$.fragment,i)},m(i,h){_(i,m,h),e(m,b),_(i,u,h),T(f,i,h),v=!0},p:Ge,i(i){v||(M(f.$$.fragment,i),v=!0)},o(i){j(f.$$.fragment,i),v=!1},d(i){i&&t(m),i&&t(u),k(f,i)}}}function ak(W){let m,b,u,f,v;return{c(){m=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=n("Module"),v=n(`
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){m=s(i,"P",{});var h=l(m);b=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(h,"CODE",{});var J=l(u);f=r(J,"Module"),J.forEach(t),v=r(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(i,h){_(i,m,h),e(m,b),e(m,u),e(u,f),e(m,v)},d(i){i&&t(m)}}}function sk(W){let m,b,u,f,v;return f=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9yb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JhdGUlM0RzYW1wbGluZ19yYXRlKSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJvYmFiaWxpdGllcyUyMCUzRCUyMHRvcmNoLnNpZ21vaWQobG9naXRzJTVCMCU1RCklMEElMjMlMjBsYWJlbHMlMjBpcyUyMGElMjBvbmUtaG90JTIwYXJyYXklMjBvZiUyMHNoYXBlJTIwKG51bV9mcmFtZXMlMkMlMjBudW1fc3BlYWtlcnMpJTBBbGFiZWxzJTIwJTNEJTIwKHByb2JhYmlsaXRpZXMlMjAlM0UlMjAwLjUpLmxvbmcoKSUwQWxhYmVscyU1QjAlNUQudG9saXN0KCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, Wav2Vec2ForAudioFrameClassification
<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/wav2vec2-base-superb-sd&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2ForAudioFrameClassification.from_pretrained(<span class="hljs-string">&quot;anton-l/wav2vec2-base-superb-sd&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>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, sampling_rate=sampling_rate)
<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>probabilities = torch.sigmoid(logits[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># labels is a one-hot array of shape (num_frames, num_speakers)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = (probabilities &gt; <span class="hljs-number">0.5</span>).long()
<span class="hljs-meta">&gt;&gt;&gt; </span>labels[<span class="hljs-number">0</span>].tolist()
[<span class="hljs-number">0</span>, <span class="hljs-number">0</span>]`}}),{c(){m=a("p"),b=n("Example:"),u=d(),y(f.$$.fragment)},l(i){m=s(i,"P",{});var h=l(m);b=r(h,"Example:"),h.forEach(t),u=p(i),w(f.$$.fragment,i)},m(i,h){_(i,m,h),e(m,b),_(i,u,h),T(f,i,h),v=!0},p:Ge,i(i){v||(M(f.$$.fragment,i),v=!0)},o(i){j(f.$$.fragment,i),v=!1},d(i){i&&t(m),i&&t(u),k(f,i)}}}function nk(W){let m,b,u,f,v;return{c(){m=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=n("Module"),v=n(`
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){m=s(i,"P",{});var h=l(m);b=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(h,"CODE",{});var J=l(u);f=r(J,"Module"),J.forEach(t),v=r(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(i,h){_(i,m,h),e(m,b),e(m,u),e(u,f),e(m,v)},d(i){i&&t(m)}}}function rk(W){let m,b,u,f,v;return f=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yJTJDJTIwV2F2MlZlYzJGb3JYVmVjdG9yJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBaW1wb3J0JTIwdG9yY2glMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmhmLWludGVybmFsLXRlc3RpbmclMkZsaWJyaXNwZWVjaF9hc3JfZGVtbyUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWRhdGFzZXQlMjAlM0QlMjBkYXRhc2V0LnNvcnQoJTIyaWQlMjIpJTBBc2FtcGxpbmdfcmF0ZSUyMCUzRCUyMGRhdGFzZXQuZmVhdHVyZXMlNUIlMjJhdWRpbyUyMiU1RC5zYW1wbGluZ19yYXRlJTBBJTBBZmVhdHVyZV9leHRyYWN0b3IlMjAlM0QlMjBBdXRvRmVhdHVyZUV4dHJhY3Rvci5mcm9tX3ByZXRyYWluZWQoJTIyYW50b24tbCUyRndhdjJ2ZWMyLWJhc2Utc3VwZXJiLXN2JTIyKSUwQW1vZGVsJTIwJTNEJTIwV2F2MlZlYzJGb3JYVmVjdG9yLmZyb21fcHJldHJhaW5lZCglMjJhbnRvbi1sJTJGd2F2MnZlYzItYmFzZS1zdXBlcmItc3YlMjIpJTBBJTBBJTIzJTIwYXVkaW8lMjBmaWxlJTIwaXMlMjBkZWNvZGVkJTIwb24lMjB0aGUlMjBmbHklMEFpbnB1dHMlMjAlM0QlMjBmZWF0dXJlX2V4dHJhY3RvciglME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bGFyaXR5Lml0ZW0oKSUyQyUyMDIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, Wav2Vec2ForXVector
<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/wav2vec2-base-superb-sv&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2ForXVector.from_pretrained(<span class="hljs-string">&quot;anton-l/wav2vec2-base-superb-sv&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(
<span class="hljs-meta">... </span>    [d[<span class="hljs-string">&quot;array&quot;</span>] <span class="hljs-keyword">for</span> d <span class="hljs-keyword">in</span> dataset[:<span class="hljs-number">2</span>][<span class="hljs-string">&quot;audio&quot;</span>]], sampling_rate=sampling_rate, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    embeddings = model(**inputs).embeddings

<span class="hljs-meta">&gt;&gt;&gt; </span>embeddings = torch.nn.functional.normalize(embeddings, dim=-<span class="hljs-number">1</span>).cpu()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the resulting embeddings can be used for cosine similarity-based retrieval</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>cosine_sim = torch.nn.CosineSimilarity(dim=-<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>similarity = cosine_sim(embeddings[<span class="hljs-number">0</span>], embeddings[<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>threshold = <span class="hljs-number">0.7</span>  <span class="hljs-comment"># the optimal threshold is dataset-dependent</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">if</span> similarity &lt; threshold:
<span class="hljs-meta">... </span>    <span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Speakers are not the same!&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(similarity.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">0.98</span>`}}),{c(){m=a("p"),b=n("Example:"),u=d(),y(f.$$.fragment)},l(i){m=s(i,"P",{});var h=l(m);b=r(h,"Example:"),h.forEach(t),u=p(i),w(f.$$.fragment,i)},m(i,h){_(i,m,h),e(m,b),_(i,u,h),T(f,i,h),v=!0},p:Ge,i(i){v||(M(f.$$.fragment,i),v=!0)},o(i){j(f.$$.fragment,i),v=!1},d(i){i&&t(m),i&&t(u),k(f,i)}}}function lk(W){let m,b,u,f,v;return{c(){m=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=n("Module"),v=n(`
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){m=s(i,"P",{});var h=l(m);b=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(h,"CODE",{});var J=l(u);f=r(J,"Module"),J.forEach(t),v=r(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(i,h){_(i,m,h),e(m,b),e(m,u),e(u,f),e(m,v)},d(i){i&&t(m)}}}function ik(W){let m,b,u,f,v;return f=new Fe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b0ZlYXR1cmVFeHRyYWN0b3IlMkMlMjBXYXYyVmVjMkZvclByZVRyYWluaW5nJTBBZnJvbSUyMHRyYW5zZm9ybWVycy5tb2RlbHMud2F2MnZlYzIubW9kZWxpbmdfd2F2MnZlYzIlMjBpbXBvcnQlMjBfY29tcHV0ZV9tYXNrX2luZGljZXMlMkMlMjBfc2FtcGxlX25lZ2F0aXZlX2luZGljZXMlMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFmZWF0dXJlX2V4dHJhY3RvciUyMCUzRCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRndhdjJ2ZWMyLWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBXYXYyVmVjMkZvclByZVRyYWluaW5nLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRndhdjJ2ZWMyLWJhc2UlMjIpJTBBJTBBZHMlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaGYtaW50ZXJuYWwtdGVzdGluZyUyRmxpYnJpc3BlZWNoX2Fzcl9kdW1teSUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWlucHV0X3ZhbHVlcyUyMCUzRCUyMGZlYXR1cmVfZXh0cmFjdG9yKGRzJTVCMCU1RCU1QiUyMmF1ZGlvJTIyJTVEJTVCJTIyYXJyYXklMjIlNUQlMkMlMjByZXR1cm5fdGVuc29yc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aW4oKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCglMEElMjAlMjAlMjAlMjBpbnB1dF92YWx1ZXMlMkMlMjBtYXNrX3RpbWVfaW5kaWNlcyUzRG1hc2tfdGltZV9pbmRpY2VzJTJDJTIwc2FtcGxlZF9uZWdhdGl2ZV9pbmRpY2VzJTNEc2FtcGxlZF9uZWdhdGl2ZV9pbmRpY2VzJTBBKS5sb3Nz",highlighted:`<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> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, Wav2Vec2ForPreTraining
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.models.wav2vec2.modeling_wav2vec2 <span class="hljs-keyword">import</span> _compute_mask_indices, _sample_negative_indices
<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>feature_extractor = AutoFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2ForPreTraining.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>ds = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_dummy&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>input_values = feature_extractor(ds[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_values  <span class="hljs-comment"># Batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute masked indices</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>batch_size, raw_sequence_length = input_values.shape
<span class="hljs-meta">&gt;&gt;&gt; </span>sequence_length = model._get_feat_extract_output_lengths(raw_sequence_length).item()
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_time_indices = _compute_mask_indices(
<span class="hljs-meta">... </span>    shape=(batch_size, sequence_length), mask_prob=<span class="hljs-number">0.2</span>, mask_length=<span class="hljs-number">2</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>sampled_negative_indices = _sample_negative_indices(
<span class="hljs-meta">... </span>    features_shape=(batch_size, sequence_length),
<span class="hljs-meta">... </span>    num_negatives=model.config.num_negatives,
<span class="hljs-meta">... </span>    mask_time_indices=mask_time_indices,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_time_indices = torch.tensor(data=mask_time_indices, device=input_values.device, dtype=torch.long)
<span class="hljs-meta">&gt;&gt;&gt; </span>sampled_negative_indices = torch.tensor(
<span class="hljs-meta">... </span>    data=sampled_negative_indices, device=input_values.device, dtype=torch.long
<span class="hljs-meta">... </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(input_values, mask_time_indices=mask_time_indices)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute cosine similarity between predicted (=projected_states) and target (=projected_quantized_states)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>cosine_sim = torch.cosine_similarity(outputs.projected_states, outputs.projected_quantized_states, dim=-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># show that cosine similarity is much higher than random</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>cosine_sim[mask_time_indices.to(torch.<span class="hljs-built_in">bool</span>)].mean() &gt; <span class="hljs-number">0.5</span>
tensor(<span class="hljs-literal">True</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># for contrastive loss training model should be put into train mode</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = model.train()
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(
<span class="hljs-meta">... </span>    input_values, mask_time_indices=mask_time_indices, sampled_negative_indices=sampled_negative_indices
<span class="hljs-meta">... </span>).loss`}}),{c(){m=a("p"),b=n("Example:"),u=d(),y(f.$$.fragment)},l(i){m=s(i,"P",{});var h=l(m);b=r(h,"Example:"),h.forEach(t),u=p(i),w(f.$$.fragment,i)},m(i,h){_(i,m,h),e(m,b),_(i,u,h),T(f,i,h),v=!0},p:Ge,i(i){v||(M(f.$$.fragment,i),v=!0)},o(i){j(f.$$.fragment,i),v=!1},d(i){i&&t(m),i&&t(u),k(f,i)}}}function ck(W){let m,b,u,f,v,i,h,J,I,z,E,Z,R,x,B,$,ce,H,X,de,G,q,Re,S,D,Ae,xe,O,Le,Vt,qe,N,K,tt,se,He,Jt,$e,Ce,Ft,Y,xt,Ue,ot,Te,Ee,Ze,$t,he,at,ee,Me,Ie,A,Ct,te,Ut,st;return{c(){m=a("p"),b=n("TensorFlow models and layers in "),u=a("code"),f=n("transformers"),v=n(" accept two formats as input:"),i=d(),h=a("ul"),J=a("li"),I=n("having all inputs as keyword arguments (like PyTorch models), or"),z=d(),E=a("li"),Z=n("having all inputs as a list, tuple or dict in the first positional argument."),R=d(),x=a("p"),B=n(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),$=a("code"),ce=n("model.fit()"),H=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),X=a("code"),de=n("model.fit()"),G=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),q=a("code"),Re=n("fit()"),S=n(" and "),D=a("code"),Ae=n("predict()"),xe=n(`, such as when creating your own layers or models with
the Keras `),O=a("code"),Le=n("Functional"),Vt=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),qe=d(),N=a("ul"),K=a("li"),tt=n("a single Tensor with "),se=a("code"),He=n("input_values"),Jt=n(" only and nothing else: "),$e=a("code"),Ce=n("model(input_values)"),Ft=d(),Y=a("li"),xt=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Ue=a("code"),ot=n("model([input_values, attention_mask])"),Te=n(" or "),Ee=a("code"),Ze=n("model([input_values, attention_mask, token_type_ids])"),$t=d(),he=a("li"),at=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ee=a("code"),Me=n('model({"input_values": input_values, "token_type_ids": token_type_ids})'),Ie=d(),A=a("p"),Ct=n(`Note that when creating models and layers with
`),te=a("a"),Ut=n("subclassing"),st=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(V){m=s(V,"P",{});var C=l(m);b=r(C,"TensorFlow models and layers in "),u=s(C,"CODE",{});var qt=l(u);f=r(qt,"transformers"),qt.forEach(t),v=r(C," accept two formats as input:"),C.forEach(t),i=p(V),h=s(V,"UL",{});var fe=l(h);J=s(fe,"LI",{});var Yt=l(J);I=r(Yt,"having all inputs as keyword arguments (like PyTorch models), or"),Yt.forEach(t),z=p(fe),E=s(fe,"LI",{});var je=l(E);Z=r(je,"having all inputs as a list, tuple or dict in the first positional argument."),je.forEach(t),fe.forEach(t),R=p(V),x=s(V,"P",{});var U=l(x);B=r(U,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),$=s(U,"CODE",{});var Kt=l($);ce=r(Kt,"model.fit()"),Kt.forEach(t),H=r(U,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),X=s(U,"CODE",{});var De=l(X);de=r(De,"model.fit()"),De.forEach(t),G=r(U,` supports! If, however, you want to use the second
format outside of Keras methods like `),q=s(U,"CODE",{});var eo=l(q);Re=r(eo,"fit()"),eo.forEach(t),S=r(U," and "),D=s(U,"CODE",{});var to=l(D);Ae=r(to,"predict()"),to.forEach(t),xe=r(U,`, such as when creating your own layers or models with
the Keras `),O=s(U,"CODE",{});var oo=l(O);Le=r(oo,"Functional"),oo.forEach(t),Vt=r(U,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),U.forEach(t),qe=p(V),N=s(V,"UL",{});var P=l(N);K=s(P,"LI",{});var pe=l(K);tt=r(pe,"a single Tensor with "),se=s(pe,"CODE",{});var ao=l(se);He=r(ao,"input_values"),ao.forEach(t),Jt=r(pe," only and nothing else: "),$e=s(pe,"CODE",{});var so=l($e);Ce=r(so,"model(input_values)"),so.forEach(t),pe.forEach(t),Ft=p(P),Y=s(P,"LI",{});var ne=l(Y);xt=r(ne,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Ue=s(ne,"CODE",{});var no=l(Ue);ot=r(no,"model([input_values, attention_mask])"),no.forEach(t),Te=r(ne," or "),Ee=s(ne,"CODE",{});var ro=l(Ee);Ze=r(ro,"model([input_values, attention_mask, token_type_ids])"),ro.forEach(t),ne.forEach(t),$t=p(P),he=s(P,"LI",{});var ze=l(he);at=r(ze,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ee=s(ze,"CODE",{});var lo=l(ee);Me=r(lo,'model({"input_values": input_values, "token_type_ids": token_type_ids})'),lo.forEach(t),ze.forEach(t),P.forEach(t),Ie=p(V),A=s(V,"P",{});var Oe=l(A);Ct=r(Oe,`Note that when creating models and layers with
`),te=s(Oe,"A",{href:!0,rel:!0});var io=l(te);Ut=r(io,"subclassing"),io.forEach(t),st=r(Oe,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),Oe.forEach(t),this.h()},h(){c(te,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),c(te,"rel","nofollow")},m(V,C){_(V,m,C),e(m,b),e(m,u),e(u,f),e(m,v),_(V,i,C),_(V,h,C),e(h,J),e(J,I),e(h,z),e(h,E),e(E,Z),_(V,R,C),_(V,x,C),e(x,B),e(x,$),e($,ce),e(x,H),e(x,X),e(X,de),e(x,G),e(x,q),e(q,Re),e(x,S),e(x,D),e(D,Ae),e(x,xe),e(x,O),e(O,Le),e(x,Vt),_(V,qe,C),_(V,N,C),e(N,K),e(K,tt),e(K,se),e(se,He),e(K,Jt),e(K,$e),e($e,Ce),e(N,Ft),e(N,Y),e(Y,xt),e(Y,Ue),e(Ue,ot),e(Y,Te),e(Y,Ee),e(Ee,Ze),e(N,$t),e(N,he),e(he,at),e(he,ee),e(ee,Me),_(V,Ie,C),_(V,A,C),e(A,Ct),e(A,te),e(te,Ut),e(A,st)},d(V){V&&t(m),V&&t(i),V&&t(h),V&&t(R),V&&t(x),V&&t(qe),V&&t(N),V&&t(Ie),V&&t(A)}}}function dk(W){let m,b,u,f,v;return{c(){m=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=n("Module"),v=n(`
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){m=s(i,"P",{});var h=l(m);b=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(h,"CODE",{});var J=l(u);f=r(J,"Module"),J.forEach(t),v=r(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(i,h){_(i,m,h),e(m,b),e(m,u),e(u,f),e(m,v)},d(i){i&&t(m)}}}function pk(W){let m,b,u,f,v;return f=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBURldhdjJWZWMyTW9kZWwlMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEFpbXBvcnQlMjBzb3VuZGZpbGUlMjBhcyUyMHNmJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3YXYydmVjMi1iYXNlLTk2MGglMjIpJTBBbW9kZWwlMjAlM0QlMjBURldhdjJWZWMyTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGd2F2MnZlYzItYmFzZS05NjBoJTIyKSUwQSUwQSUwQWRlZiUyMG1hcF90b19hcnJheShiYXRjaCklM0ElMEElMjAlMjAlMjAlMjBzcGVlY2glMkMlMjBfJTIwJTNEJTIwc2YucmVhZChiYXRjaCU1QiUyMmZpbGUlMjIlNUQpJTBBJTIwJTIwJTIwJTIwYmF0Y2glNUIlMjJzcGVlY2glMjIlNUQlMjAlM0QlMjBzcGVlY2glMEElMjAlMjAlMjAlMjByZXR1cm4lMjBiYXRjaCUwQSUwQSUwQWRzJTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmhmLWludGVybmFsLXRlc3RpbmclMkZsaWJyaXNwZWVjaF9hc3JfZHVtbXklMjIlMkMlMjAlMjJjbGVhbiUyMiUyQyUyMHNwbGl0JTNEJTIydmFsaWRhdGlvbiUyMiklMEFkcyUyMCUzRCUyMGRzLm1hcChtYXBfdG9fYXJyYXkpJTBBJTBBaW5wdXRfdmFsdWVzJTIwJTNEJTIwcHJvY2Vzc29yKGRzJTVCJTIyc3BlZWNoJTIyJTVEJTVCMCU1RCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpLmlucHV0X3ZhbHVlcyUyMCUyMCUyMyUyMEJhdGNoJTIwc2l6ZSUyMDElMEFoaWRkZW5fc3RhdGVzJTIwJTNEJTIwbW9kZWwoaW5wdXRfdmFsdWVzKS5sYXN0X2hpZGRlbl9zdGF0ZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, TFWav2Vec2Model
<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> soundfile <span class="hljs-keyword">as</span> sf

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-base-960h&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFWav2Vec2Model.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-base-960h&quot;</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">map_to_array</span>(<span class="hljs-params">batch</span>):
<span class="hljs-meta">... </span>    speech, _ = sf.read(batch[<span class="hljs-string">&quot;file&quot;</span>])
<span class="hljs-meta">... </span>    batch[<span class="hljs-string">&quot;speech&quot;</span>] = speech
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> batch


<span class="hljs-meta">&gt;&gt;&gt; </span>ds = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_dummy&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>ds = ds.<span class="hljs-built_in">map</span>(map_to_array)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_values = processor(ds[<span class="hljs-string">&quot;speech&quot;</span>][<span class="hljs-number">0</span>], return_tensors=<span class="hljs-string">&quot;tf&quot;</span>).input_values  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>hidden_states = model(input_values).last_hidden_state`}}),{c(){m=a("p"),b=n("Example:"),u=d(),y(f.$$.fragment)},l(i){m=s(i,"P",{});var h=l(m);b=r(h,"Example:"),h.forEach(t),u=p(i),w(f.$$.fragment,i)},m(i,h){_(i,m,h),e(m,b),_(i,u,h),T(f,i,h),v=!0},p:Ge,i(i){v||(M(f.$$.fragment,i),v=!0)},o(i){j(f.$$.fragment,i),v=!1},d(i){i&&t(m),i&&t(u),k(f,i)}}}function mk(W){let m,b,u,f,v,i,h,J,I,z,E,Z,R,x,B,$,ce,H,X,de,G,q,Re,S,D,Ae,xe,O,Le,Vt,qe,N,K,tt,se,He,Jt,$e,Ce,Ft,Y,xt,Ue,ot,Te,Ee,Ze,$t,he,at,ee,Me,Ie,A,Ct,te,Ut,st;return{c(){m=a("p"),b=n("TensorFlow models and layers in "),u=a("code"),f=n("transformers"),v=n(" accept two formats as input:"),i=d(),h=a("ul"),J=a("li"),I=n("having all inputs as keyword arguments (like PyTorch models), or"),z=d(),E=a("li"),Z=n("having all inputs as a list, tuple or dict in the first positional argument."),R=d(),x=a("p"),B=n(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),$=a("code"),ce=n("model.fit()"),H=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),X=a("code"),de=n("model.fit()"),G=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),q=a("code"),Re=n("fit()"),S=n(" and "),D=a("code"),Ae=n("predict()"),xe=n(`, such as when creating your own layers or models with
the Keras `),O=a("code"),Le=n("Functional"),Vt=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),qe=d(),N=a("ul"),K=a("li"),tt=n("a single Tensor with "),se=a("code"),He=n("input_values"),Jt=n(" only and nothing else: "),$e=a("code"),Ce=n("model(input_values)"),Ft=d(),Y=a("li"),xt=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Ue=a("code"),ot=n("model([input_values, attention_mask])"),Te=n(" or "),Ee=a("code"),Ze=n("model([input_values, attention_mask, token_type_ids])"),$t=d(),he=a("li"),at=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ee=a("code"),Me=n('model({"input_values": input_values, "token_type_ids": token_type_ids})'),Ie=d(),A=a("p"),Ct=n(`Note that when creating models and layers with
`),te=a("a"),Ut=n("subclassing"),st=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(V){m=s(V,"P",{});var C=l(m);b=r(C,"TensorFlow models and layers in "),u=s(C,"CODE",{});var qt=l(u);f=r(qt,"transformers"),qt.forEach(t),v=r(C," accept two formats as input:"),C.forEach(t),i=p(V),h=s(V,"UL",{});var fe=l(h);J=s(fe,"LI",{});var Yt=l(J);I=r(Yt,"having all inputs as keyword arguments (like PyTorch models), or"),Yt.forEach(t),z=p(fe),E=s(fe,"LI",{});var je=l(E);Z=r(je,"having all inputs as a list, tuple or dict in the first positional argument."),je.forEach(t),fe.forEach(t),R=p(V),x=s(V,"P",{});var U=l(x);B=r(U,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),$=s(U,"CODE",{});var Kt=l($);ce=r(Kt,"model.fit()"),Kt.forEach(t),H=r(U,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),X=s(U,"CODE",{});var De=l(X);de=r(De,"model.fit()"),De.forEach(t),G=r(U,` supports! If, however, you want to use the second
format outside of Keras methods like `),q=s(U,"CODE",{});var eo=l(q);Re=r(eo,"fit()"),eo.forEach(t),S=r(U," and "),D=s(U,"CODE",{});var to=l(D);Ae=r(to,"predict()"),to.forEach(t),xe=r(U,`, such as when creating your own layers or models with
the Keras `),O=s(U,"CODE",{});var oo=l(O);Le=r(oo,"Functional"),oo.forEach(t),Vt=r(U,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),U.forEach(t),qe=p(V),N=s(V,"UL",{});var P=l(N);K=s(P,"LI",{});var pe=l(K);tt=r(pe,"a single Tensor with "),se=s(pe,"CODE",{});var ao=l(se);He=r(ao,"input_values"),ao.forEach(t),Jt=r(pe," only and nothing else: "),$e=s(pe,"CODE",{});var so=l($e);Ce=r(so,"model(input_values)"),so.forEach(t),pe.forEach(t),Ft=p(P),Y=s(P,"LI",{});var ne=l(Y);xt=r(ne,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Ue=s(ne,"CODE",{});var no=l(Ue);ot=r(no,"model([input_values, attention_mask])"),no.forEach(t),Te=r(ne," or "),Ee=s(ne,"CODE",{});var ro=l(Ee);Ze=r(ro,"model([input_values, attention_mask, token_type_ids])"),ro.forEach(t),ne.forEach(t),$t=p(P),he=s(P,"LI",{});var ze=l(he);at=r(ze,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ee=s(ze,"CODE",{});var lo=l(ee);Me=r(lo,'model({"input_values": input_values, "token_type_ids": token_type_ids})'),lo.forEach(t),ze.forEach(t),P.forEach(t),Ie=p(V),A=s(V,"P",{});var Oe=l(A);Ct=r(Oe,`Note that when creating models and layers with
`),te=s(Oe,"A",{href:!0,rel:!0});var io=l(te);Ut=r(io,"subclassing"),io.forEach(t),st=r(Oe,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),Oe.forEach(t),this.h()},h(){c(te,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),c(te,"rel","nofollow")},m(V,C){_(V,m,C),e(m,b),e(m,u),e(u,f),e(m,v),_(V,i,C),_(V,h,C),e(h,J),e(J,I),e(h,z),e(h,E),e(E,Z),_(V,R,C),_(V,x,C),e(x,B),e(x,$),e($,ce),e(x,H),e(x,X),e(X,de),e(x,G),e(x,q),e(q,Re),e(x,S),e(x,D),e(D,Ae),e(x,xe),e(x,O),e(O,Le),e(x,Vt),_(V,qe,C),_(V,N,C),e(N,K),e(K,tt),e(K,se),e(se,He),e(K,Jt),e(K,$e),e($e,Ce),e(N,Ft),e(N,Y),e(Y,xt),e(Y,Ue),e(Ue,ot),e(Y,Te),e(Y,Ee),e(Ee,Ze),e(N,$t),e(N,he),e(he,at),e(he,ee),e(ee,Me),_(V,Ie,C),_(V,A,C),e(A,Ct),e(A,te),e(te,Ut),e(A,st)},d(V){V&&t(m),V&&t(i),V&&t(h),V&&t(R),V&&t(x),V&&t(qe),V&&t(N),V&&t(Ie),V&&t(A)}}}function hk(W){let m,b,u,f,v;return{c(){m=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=n("Module"),v=n(`
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){m=s(i,"P",{});var h=l(m);b=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(h,"CODE",{});var J=l(u);f=r(J,"Module"),J.forEach(t),v=r(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(i,h){_(i,m,h),e(m,b),e(m,u),e(u,f),e(m,v)},d(i){i&&t(m)}}}function fk(W){let m,b,u,f,v;return f=new Fe({props:{code:"aW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMFRGV2F2MlZlYzJGb3JDVEMlMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEFpbXBvcnQlMjBzb3VuZGZpbGUlMjBhcyUyMHNmJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3YXYydmVjMi1iYXNlLTk2MGglMjIpJTBBbW9kZWwlMjAlM0QlMjBURldhdjJWZWMyRm9yQ1RDLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRndhdjJ2ZWMyLWJhc2UtOTYwaCUyMiklMEElMEElMEFkZWYlMjBtYXBfdG9fYXJyYXkoYmF0Y2gpJTNBJTBBJTIwJTIwJTIwJTIwc3BlZWNoJTJDJTIwXyUyMCUzRCUyMHNmLnJlYWQoYmF0Y2glNUIlMjJmaWxlJTIyJTVEKSUwQSUyMCUyMCUyMCUyMGJhdGNoJTVCJTIyc3BlZWNoJTIyJTVEJTIwJTNEJTIwc3BlZWNoJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwYmF0Y2glMEElMEElMEFkcyUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJoZi1pbnRlcm5hbC10ZXN0aW5nJTJGbGlicmlzcGVlY2hfYXNyX2R1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span> tf
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, TFWav2Vec2ForCTC
<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> soundfile <span class="hljs-keyword">as</span> sf

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-base-960h&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFWav2Vec2ForCTC.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-base-960h&quot;</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">map_to_array</span>(<span class="hljs-params">batch</span>):
<span class="hljs-meta">... </span>    speech, _ = sf.read(batch[<span class="hljs-string">&quot;file&quot;</span>])
<span class="hljs-meta">... </span>    batch[<span class="hljs-string">&quot;speech&quot;</span>] = speech
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> batch


<span class="hljs-meta">&gt;&gt;&gt; </span>ds = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_dummy&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>ds = ds.<span class="hljs-built_in">map</span>(map_to_array)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_values = processor(ds[<span class="hljs-string">&quot;speech&quot;</span>][<span class="hljs-number">0</span>], return_tensors=<span class="hljs-string">&quot;tf&quot;</span>).input_values  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(input_values).logits
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_ids = tf.argmax(logits, axis=-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>transcription = processor.decode(predicted_ids[<span class="hljs-number">0</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute loss</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_transcription = <span class="hljs-string">&quot;A MAN SAID TO THE UNIVERSE SIR I EXIST&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Pass transcription as \`text\` to encode labels</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = processor(text=transcription, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>).input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(input_values, labels=labels).loss`}}),{c(){m=a("p"),b=n("Example:"),u=d(),y(f.$$.fragment)},l(i){m=s(i,"P",{});var h=l(m);b=r(h,"Example:"),h.forEach(t),u=p(i),w(f.$$.fragment,i)},m(i,h){_(i,m,h),e(m,b),_(i,u,h),T(f,i,h),v=!0},p:Ge,i(i){v||(M(f.$$.fragment,i),v=!0)},o(i){j(f.$$.fragment,i),v=!1},d(i){i&&t(m),i&&t(u),k(f,i)}}}function uk(W){let m,b,u,f,v;return{c(){m=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=n("Module"),v=n(`
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){m=s(i,"P",{});var h=l(m);b=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(h,"CODE",{});var J=l(u);f=r(J,"Module"),J.forEach(t),v=r(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(i,h){_(i,m,h),e(m,b),e(m,u),e(u,f),e(m,v)},d(i){i&&t(m)}}}function gk(W){let m,b,u,f,v;return f=new Fe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBGbGF4V2F2MlZlYzJNb2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ZGVuX3N0YXRlcyUyMCUzRCUyMG1vZGVsKGlucHV0X3ZhbHVlcykubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, FlaxWav2Vec2Model
<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> soundfile <span class="hljs-keyword">as</span> sf

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-large-lv60&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxWav2Vec2Model.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-large-lv60&quot;</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">map_to_array</span>(<span class="hljs-params">batch</span>):
<span class="hljs-meta">... </span>    speech, _ = sf.read(batch[<span class="hljs-string">&quot;file&quot;</span>])
<span class="hljs-meta">... </span>    batch[<span class="hljs-string">&quot;speech&quot;</span>] = speech
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> batch


<span class="hljs-meta">&gt;&gt;&gt; </span>ds = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_dummy&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>ds = ds.<span class="hljs-built_in">map</span>(map_to_array)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_values = processor(
<span class="hljs-meta">... </span>    ds[<span class="hljs-string">&quot;speech&quot;</span>][<span class="hljs-number">0</span>], sampling_rate=<span class="hljs-number">16_000</span>, return_tensors=<span class="hljs-string">&quot;np&quot;</span>
<span class="hljs-meta">... </span>).input_values  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>hidden_states = model(input_values).last_hidden_state`}}),{c(){m=a("p"),b=n("Example:"),u=d(),y(f.$$.fragment)},l(i){m=s(i,"P",{});var h=l(m);b=r(h,"Example:"),h.forEach(t),u=p(i),w(f.$$.fragment,i)},m(i,h){_(i,m,h),e(m,b),_(i,u,h),T(f,i,h),v=!0},p:Ge,i(i){v||(M(f.$$.fragment,i),v=!0)},o(i){j(f.$$.fragment,i),v=!1},d(i){i&&t(m),i&&t(u),k(f,i)}}}function _k(W){let m,b,u,f,v;return{c(){m=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=n("Module"),v=n(`
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){m=s(i,"P",{});var h=l(m);b=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(h,"CODE",{});var J=l(u);f=r(J,"Module"),J.forEach(t),v=r(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(i,h){_(i,m,h),e(m,b),e(m,u),e(u,f),e(m,v)},d(i){i&&t(m)}}}function vk(W){let m,b,u,f,v;return f=new Fe({props:{code:"aW1wb3J0JTIwamF4Lm51bXB5JTIwYXMlMjBqbnAlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEZsYXhXYXYyVmVjMkZvckNUQyUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQWltcG9ydCUyMHNvdW5kZmlsZSUyMGFzJTIwc2YlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRndhdjJ2ZWMyLWxhcmdlLTk2MGgtbHY2MCUyMiklMEFtb2RlbCUyMCUzRCU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MlMjBzaG91bGQlMjBnaXZlJTNBJTIwJTIwJTIyQSUyME1BTiUyMFNBSUQlMjBUTyUyMFRIRSUyMFVOSVZFUlNFJTIwU0lSJTIwSSUyMEVYSVNUJTIy",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax.numpy <span class="hljs-keyword">as</span> jnp
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, FlaxWav2Vec2ForCTC
<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> soundfile <span class="hljs-keyword">as</span> sf

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-large-960h-lv60&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxWav2Vec2ForCTC.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-large-960h-lv60&quot;</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">map_to_array</span>(<span class="hljs-params">batch</span>):
<span class="hljs-meta">... </span>    speech, _ = sf.read(batch[<span class="hljs-string">&quot;file&quot;</span>])
<span class="hljs-meta">... </span>    batch[<span class="hljs-string">&quot;speech&quot;</span>] = speech
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> batch


<span class="hljs-meta">&gt;&gt;&gt; </span>ds = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_dummy&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>ds = ds.<span class="hljs-built_in">map</span>(map_to_array)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_values = processor(
<span class="hljs-meta">... </span>    ds[<span class="hljs-string">&quot;speech&quot;</span>][<span class="hljs-number">0</span>], sampling_rate=<span class="hljs-number">16_000</span>, return_tensors=<span class="hljs-string">&quot;np&quot;</span>
<span class="hljs-meta">... </span>).input_values  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(input_values).logits
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_ids = jnp.argmax(logits, axis=-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>transcription = processor.decode(predicted_ids[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># should give:  &quot;A MAN SAID TO THE UNIVERSE SIR I EXIST&quot;</span>`}}),{c(){m=a("p"),b=n("Example:"),u=d(),y(f.$$.fragment)},l(i){m=s(i,"P",{});var h=l(m);b=r(h,"Example:"),h.forEach(t),u=p(i),w(f.$$.fragment,i)},m(i,h){_(i,m,h),e(m,b),_(i,u,h),T(f,i,h),v=!0},p:Ge,i(i){v||(M(f.$$.fragment,i),v=!0)},o(i){j(f.$$.fragment,i),v=!1},d(i){i&&t(m),i&&t(u),k(f,i)}}}function bk(W){let m,b,u,f,v;return{c(){m=a("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),f=n("Module"),v=n(`
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){m=s(i,"P",{});var h=l(m);b=r(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(h,"CODE",{});var J=l(u);f=r(J,"Module"),J.forEach(t),v=r(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(i,h){_(i,m,h),e(m,b),e(m,u),e(u,f),e(m,v)},d(i){i&&t(m)}}}function yk(W){let m,b,u,f,v;return f=new Fe({props:{code:"aW1wb3J0JTIwb3B0YXglMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEFp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dHB1dHMucHJvamVjdGVkX3F1YW50aXplZF9zdGF0ZXMpJTBBJTBBJTIzJTIwc2hvdyUyMHRoYXQlMjBjb3NpbmUlMjBzaW1pbGFyaXR5JTIwaXMlMjBtdWNoJTIwaGlnaGVyJTIwdGhhbiUyMHJhbmRvbSUwQWFzc2VydCUyMG5wLmFzYXJyYXkoY29zaW5lX3NpbSklNUJtYXNrX3RpbWVfaW5kaWNlcyU1RC5tZWFuKCklMjAlM0UlMjAwLjU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> optax
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax.numpy <span class="hljs-keyword">as</span> jnp
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, FlaxWav2Vec2ForPreTraining
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.models.wav2vec2.modeling_flax_wav2vec2 <span class="hljs-keyword">import</span> _compute_mask_indices
<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> soundfile <span class="hljs-keyword">as</span> sf

<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = AutoFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-large-lv60&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxWav2Vec2ForPreTraining.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-large-lv60&quot;</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">map_to_array</span>(<span class="hljs-params">batch</span>):
<span class="hljs-meta">... </span>    speech, _ = sf.read(batch[<span class="hljs-string">&quot;file&quot;</span>])
<span class="hljs-meta">... </span>    batch[<span class="hljs-string">&quot;speech&quot;</span>] = speech
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> batch


<span class="hljs-meta">&gt;&gt;&gt; </span>ds = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_dummy&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>ds = ds.<span class="hljs-built_in">map</span>(map_to_array)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_values = feature_extractor(ds[<span class="hljs-string">&quot;speech&quot;</span>][<span class="hljs-number">0</span>], return_tensors=<span class="hljs-string">&quot;np&quot;</span>).input_values  <span class="hljs-comment"># Batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute masked indices</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>batch_size, raw_sequence_length = input_values.shape
<span class="hljs-meta">&gt;&gt;&gt; </span>sequence_length = model._get_feat_extract_output_lengths(raw_sequence_length)
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_time_indices = _compute_mask_indices((batch_size, sequence_length), mask_prob=<span class="hljs-number">0.2</span>, mask_length=<span class="hljs-number">2</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_values, mask_time_indices=mask_time_indices)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute cosine similarity between predicted (=projected_states) and target (=projected_quantized_states)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>cosine_sim = optax.cosine_similarity(outputs.projected_states, outputs.projected_quantized_states)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># show that cosine similarity is much higher than random</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> np.asarray(cosine_sim)[mask_time_indices].mean() &gt; <span class="hljs-number">0.5</span>`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d,Sr,my,xd,hy,um,ye,Qr,fy,Lr,uy,$d,gy,_y,vy,Hr,by,Ei,yy,wy,Ty,Dr,My,Or,jy,ky,Wy,Qa,Vy,ut,Kr,Jy,Go,Fy,Zi,xy,$y,Cd,Cy,Uy,Ey,La,Zy,Ha,gm,Ro,Da,Ud,el,Iy,Ed,zy,_m,re,tl,By,ol,Ny,al,Xy,Gy,Ry,sl,Ay,Ii,qy,Yy,Py,nl,Sy,rl,Qy,Ly,Hy,Zd,Dy,Oy,Xt,Id,ll,Ky,ew,zd,il,tw,ow,Bd,cl,aw,sw,Nd,dl,nw,rw,gt,pl,lw,Ao,iw,Xd,cw,dw,Gd,pw,mw,hw,Oa,fw,Ka,vm,qo,es,Rd,ml,uw,Ad,gw,bm,le,hl,_w,Yo,vw,qd,bw,yw,fl,ww,Tw,Mw,ul,jw,zi,kw,Ww,Vw,gl,Jw,_l,Fw,xw,$w,Yd,Cw,Uw,Gt,Pd,vl,Ew,Zw,Sd,bl,Iw,zw,Qd,yl,Bw,Nw,Ld,wl,Xw,Gw,_t,Tl,Rw,Po,Aw,Hd,qw,Yw,Dd,Pw,Sw,Qw,ts,Lw,os,ym,So,as,Od,Ml,Hw,Kd,Dw,wm,ie,jl,Ow,Qo,Kw,ep,eT,tT,kl,oT,aT,sT,Wl,nT,Bi,rT,lT,iT,Vl,cT,Jl,dT,pT,mT,tp,hT,fT,Rt,op,Fl,uT,gT,ap,xl,_T,vT,sp,$l,bT,yT,np,Cl,wT,TT,vt,Ul,MT,Lo,jT,Ni,kT,WT,rp,VT,JT,FT,ss,xT,ns,Tm;return i=new L({}),x=new L({}),A=new L({}),fe=new z1({props:{pipeline:"audio-classification"}}),Fs=new z1({props:{pipeline:"automatic-speech-recognition"}}),Rs=new L({}),As=new F({props:{name:"class transformers.Wav2Vec2Config",anchor:"transformers.Wav2Vec2Config",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:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout",val:" = 0.1"},{name:"activation_dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.1"},{name:"feat_proj_dropout",val:" = 0.0"},{name:"feat_quantizer_dropout",val:" = 0.0"},{name:"final_dropout",val:" = 0.1"},{name:"layerdrop",val:" = 0.1"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"feat_extract_norm",val:" = 'group'"},{name:"feat_extract_activation",val:" = 'gelu'"},{name:"conv_dim",val:" = (512, 512, 512, 512, 512, 512, 512)"},{name:"conv_stride",val:" = (5, 2, 2, 2, 2, 2, 2)"},{name:"conv_kernel",val:" = (10, 3, 3, 3, 3, 2, 2)"},{name:"conv_bias",val:" = False"},{name:"num_conv_pos_embeddings",val:" = 128"},{name:"num_conv_pos_embedding_groups",val:" = 16"},{name:"do_stable_layer_norm",val:" = False"},{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:"num_codevectors_per_group",val:" = 320"},{name:"num_codevector_groups",val:" = 2"},{name:"contrastive_logits_temperature",val:" = 0.1"},{name:"num_negatives",val:" = 100"},{name:"codevector_dim",val:" = 256"},{name:"proj_codevector_dim",val:" = 256"},{name:"diversity_loss_weight",val:" = 0.1"},{name:"ctc_loss_reduction",val:" = 'sum'"},{name:"ctc_zero_infinity",val:" = False"},{name:"use_weighted_layer_sum",val:" = False"},{name:"classifier_proj_size",val:" = 256"},{name:"tdnn_dim",val:" = (512, 512, 512, 512, 1500)"},{name:"tdnn_kernel",val:" = (5, 3, 3, 1, 1)"},{name:"tdnn_dilation",val:" = (1, 2, 3, 1, 1)"},{name:"xvector_output_dim",val:" = 512"},{name:"pad_token_id",val:" = 0"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"add_adapter",val:" = False"},{name:"adapter_kernel_size",val:" = 3"},{name:"adapter_stride",val:" = 2"},{name:"num_adapter_layers",val:" = 3"},{name:"output_hidden_size",val:" = None"},{name:"adapter_attn_dim",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2Config.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Vocabulary size of the Wav2Vec2 model. Defines the number of different tokens that can be represented by
the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Model">Wav2Vec2Model</a> or <a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.TFWav2Vec2Model">TFWav2Vec2Model</a>. Vocabulary size of the
model. Defines the different tokens that can be represented by the <em>inputs_ids</em> passed to the forward
method of <a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Model">Wav2Vec2Model</a>.`,name:"vocab_size"},{anchor:"transformers.Wav2Vec2Config.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.Wav2Vec2Config.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.Wav2Vec2Config.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.Wav2Vec2Config.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.Wav2Vec2Config.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.Wav2Vec2Config.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.Wav2Vec2Config.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.Wav2Vec2Config.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.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC">Wav2Vec2ForCTC</a>.`,name:"final_dropout"},{anchor:"transformers.Wav2Vec2Config.layerdrop",description:`<strong>layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The LayerDrop probability. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>) for more
details.`,name:"layerdrop"},{anchor:"transformers.Wav2Vec2Config.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.Wav2Vec2Config.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.Wav2Vec2Config.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.Wav2Vec2Config.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.Wav2Vec2Config.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.Wav2Vec2Config.feat_quantizer_dropout",description:`<strong>feat_quantizer_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probabilitiy for quantized feature encoder states.`,name:"feat_quantizer_dropout"},{anchor:"transformers.Wav2Vec2Config.conv_dim",description:`<strong>conv_dim</strong> (<code>Tuple[int]</code> or <code>List[int]</code>, <em>optional</em>, defaults to <code>(512, 512, 512, 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.Wav2Vec2Config.conv_stride",description:`<strong>conv_stride</strong> (<code>Tuple[int]</code> or <code>List[int]</code>, <em>optional</em>, defaults to <code>(5, 2, 2, 2, 2, 2, 2)</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.Wav2Vec2Config.conv_kernel",description:`<strong>conv_kernel</strong> (<code>Tuple[int]</code> or <code>List[int]</code>, <em>optional</em>, defaults to <code>(10, 3, 3, 3, 3, 3, 3)</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.Wav2Vec2Config.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.Wav2Vec2Config.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.Wav2Vec2Config.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.Wav2Vec2Config.do_stable_layer_norm",description:`<strong>do_stable_layer_norm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to apply <em>stable</em> layer norm architecture of the Transformer encoder. <code>do_stable_layer_norm is True</code> corresponds to applying layer norm before the attention layer, whereas <code>do_stable_layer_norm is False</code> corresponds to applying layer norm after the attention layer.`,name:"do_stable_layer_norm"},{anchor:"transformers.Wav2Vec2Config.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.Wav2Vec2Config.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.Wav2Vec2Config.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.Wav2Vec2Config.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.Wav2Vec2Config.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.Wav2Vec2Config.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.Wav2Vec2Config.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.Wav2Vec2Config.num_codevectors_per_group",description:`<strong>num_codevectors_per_group</strong> (<code>int</code>, <em>optional</em>, defaults to 320) &#x2014;
Number of entries in each quantization codebook (group).`,name:"num_codevectors_per_group"},{anchor:"transformers.Wav2Vec2Config.num_codevector_groups",description:`<strong>num_codevector_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
Number of codevector groups for product codevector quantization.`,name:"num_codevector_groups"},{anchor:"transformers.Wav2Vec2Config.contrastive_logits_temperature",description:`<strong>contrastive_logits_temperature</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The temperature <em>kappa</em> in the contrastive loss.`,name:"contrastive_logits_temperature"},{anchor:"transformers.Wav2Vec2Config.feat_quantizer_dropout",description:`<strong>feat_quantizer_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probabilitiy for the output of the feature encoder that&#x2019;s used by the quantizer.`,name:"feat_quantizer_dropout"},{anchor:"transformers.Wav2Vec2Config.num_negatives",description:`<strong>num_negatives</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
Number of negative samples for the contrastive loss.`,name:"num_negatives"},{anchor:"transformers.Wav2Vec2Config.codevector_dim",description:`<strong>codevector_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Dimensionality of the quantized feature vectors.`,name:"codevector_dim"},{anchor:"transformers.Wav2Vec2Config.proj_codevector_dim",description:`<strong>proj_codevector_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Dimensionality of the final projection of both the quantized and the transformer features.`,name:"proj_codevector_dim"},{anchor:"transformers.Wav2Vec2Config.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.Wav2Vec2Config.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.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC">Wav2Vec2ForCTC</a>.`,name:"ctc_loss_reduction"},{anchor:"transformers.Wav2Vec2Config.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.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC">Wav2Vec2ForCTC</a>.`,name:"ctc_zero_infinity"},{anchor:"transformers.Wav2Vec2Config.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.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2ForSequenceClassification">Wav2Vec2ForSequenceClassification</a>.`,name:"use_weighted_layer_sum"},{anchor:"transformers.Wav2Vec2Config.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"},{anchor:"transformers.Wav2Vec2Config.tdnn_dim",description:`<strong>tdnn_dim</strong> (<code>Tuple[int]</code> or <code>List[int]</code>, <em>optional</em>, defaults to <code>(512, 512, 512, 512, 1500)</code>) &#x2014;
A tuple of integers defining the number of output channels of each 1D convolutional layer in the <em>TDNN</em>
module of the <em>XVector</em> model. The length of <em>tdnn_dim</em> defines the number of <em>TDNN</em> layers.`,name:"tdnn_dim"},{anchor:"transformers.Wav2Vec2Config.tdnn_kernel",description:`<strong>tdnn_kernel</strong> (<code>Tuple[int]</code> or <code>List[int]</code>, <em>optional</em>, defaults to <code>(5, 3, 3, 1, 1)</code>) &#x2014;
A tuple of integers defining the kernel size of each 1D convolutional layer in the <em>TDNN</em> module of the
<em>XVector</em> model. The length of <em>tdnn_kernel</em> has to match the length of <em>tdnn_dim</em>.`,name:"tdnn_kernel"},{anchor:"transformers.Wav2Vec2Config.tdnn_dilation",description:`<strong>tdnn_dilation</strong> (<code>Tuple[int]</code> or <code>List[int]</code>, <em>optional</em>, defaults to <code>(1, 2, 3, 1, 1)</code>) &#x2014;
A tuple of integers defining the dilation factor of each 1D convolutional layer in <em>TDNN</em> module of the
<em>XVector</em> model. The length of <em>tdnn_dilation</em> has to match the length of <em>tdnn_dim</em>.`,name:"tdnn_dilation"},{anchor:"transformers.Wav2Vec2Config.xvector_output_dim",description:`<strong>xvector_output_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of the <em>XVector</em> embedding vectors.`,name:"xvector_output_dim"},{anchor:"transformers.Wav2Vec2Config.add_adapter",description:`<strong>add_adapter</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether a convolutional network should be stacked on top of the Wav2Vec2 Encoder. Can be very useful for
warm-starting Wav2Vec2 for SpeechEncoderDecoder models.`,name:"add_adapter"},{anchor:"transformers.Wav2Vec2Config.adapter_kernel_size",description:`<strong>adapter_kernel_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Kernel size of the convolutional layers in the adapter network. Only relevant if <code>add_adapter is True</code>.`,name:"adapter_kernel_size"},{anchor:"transformers.Wav2Vec2Config.adapter_stride",description:`<strong>adapter_stride</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
Stride of the convolutional layers in the adapter network. Only relevant if <code>add_adapter is True</code>.`,name:"adapter_stride"},{anchor:"transformers.Wav2Vec2Config.num_adapter_layers",description:`<strong>num_adapter_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Number of convolutional layers that should be used in the adapter network. Only relevant if <code>add_adapter is True</code>.`,name:"num_adapter_layers"},{anchor:"transformers.Wav2Vec2Config.adapter_attn_dim",description:`<strong>adapter_attn_dim</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Dimension of the attention adapter weights to be used in each attention block. An example of a model using
attention adapters is <a href="https://huggingface.co/facebook/mms-1b-all" rel="nofollow">facebook/mms-1b-all</a>.`,name:"adapter_attn_dim"},{anchor:"transformers.Wav2Vec2Config.output_hidden_size",description:`<strong>output_hidden_size</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Dimensionality of the encoder output layer. If not defined, this defaults to <em>hidden-size</em>. Only relevant
if <code>add_adapter is True</code>.`,name:"output_hidden_size"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/configuration_wav2vec2.py#L32"}}),Oo=new Xe({props:{anchor:"transformers.Wav2Vec2Config.example",$$slots:{default:[A1]},$$scope:{ctx:W}}}),Ys=new L({}),Ps=new F({props:{name:"class transformers.Wav2Vec2CTCTokenizer",anchor:"transformers.Wav2Vec2CTCTokenizer",parameters:[{name:"vocab_file",val:""},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"word_delimiter_token",val:" = '|'"},{name:"replace_word_delimiter_char",val:" = ' '"},{name:"do_lower_case",val:" = False"},{name:"target_lang",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2CTCTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.Wav2Vec2CTCTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sentence token.`,name:"bos_token"},{anchor:"transformers.Wav2Vec2CTCTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sentence token.`,name:"eos_token"},{anchor:"transformers.Wav2Vec2CTCTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.Wav2Vec2CTCTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.Wav2Vec2CTCTokenizer.word_delimiter_token",description:`<strong>word_delimiter_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;|&quot;</code>) &#x2014;
The token used for defining the end of a word.`,name:"word_delimiter_token"},{anchor:"transformers.Wav2Vec2CTCTokenizer.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to accept lowercase input and lowercase the output when decoding.`,name:"do_lower_case"},{anchor:"transformers.Wav2Vec2CTCTokenizer.target_lang",description:`<strong>target_lang</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A target language the tokenizer should set by default. <code>target_lang</code> has to be defined for multi-lingual,
nested vocabulary such as <a href="https://huggingface.co/facebook/mms-1b-all" rel="nofollow">facebook/mms-1b-all</a>.</p>
<p>**kwargs &#x2014;
Additional keyword arguments passed along to <a href="/docs/transformers/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>`,name:"target_lang"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/tokenization_wav2vec2.py#L127"}}),Qs=new F({props:{name:"__call__",anchor:"transformers.Wav2Vec2CTCTokenizer.__call__",parameters:[{name:"text",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]] = None"},{name:"text_pair",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]], NoneType] = None"},{name:"text_target",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]] = None"},{name:"text_pair_target",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]], NoneType] = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"is_split_into_words",val:": bool = False"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"return_token_type_ids",val:": typing.Optional[bool] = None"},{name:"return_attention_mask",val:": typing.Optional[bool] = None"},{name:"return_overflowing_tokens",val:": bool = False"},{name:"return_special_tokens_mask",val:": bool = False"},{name:"return_offsets_mapping",val:": bool = False"},{name:"return_length",val:": bool = False"},{name:"verbose",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.text",description:`<strong>text</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.text_pair",description:`<strong>text_pair</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text_pair"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.text_target",description:`<strong>text_target</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded as target texts. Each sequence can be a string or a
list of strings (pretokenized string). If the sequences are provided as list of strings (pretokenized),
you must set <code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text_target"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.text_pair_target",description:`<strong>text_pair_target</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded as target texts. Each sequence can be a string or a
list of strings (pretokenized string). If the sequences are provided as list of strings (pretokenized),
you must set <code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text_pair_target"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.add_special_tokens",description:`<strong>add_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to encode the sequences with the special tokens relative to their model.`,name:"add_special_tokens"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.33.0/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls truncation. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or
to the maximum acceptable input length for the model if that argument is not provided. This will
truncate token by token, removing a token from the longest sequence in the pair if a pair of
sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the first sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_second&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>False</code> or <code>&apos;do_not_truncate&apos;</code> (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).</li>
</ul>`,name:"truncation"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Controls the maximum length to use by one of the truncation/padding parameters.</p>
<p>If left unset or set to <code>None</code>, this will use the predefined model maximum length if a maximum length
is required by one of the truncation/padding parameters. If the model has no specific maximum input
length (like XLNet) truncation/padding to a maximum length will be deactivated.`,name:"max_length"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.stride",description:`<strong>stride</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If set to a number along with <code>max_length</code>, the overflowing tokens returned when
<code>return_overflowing_tokens=True</code> will contain some tokens from the end of the truncated sequence
returned to provide some overlap between truncated and overflowing sequences. The value of this
argument defines the number of overlapping tokens.`,name:"stride"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.is_split_into_words",description:`<strong>is_split_into_words</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the input is already pre-tokenized (e.g., split into words). If set to <code>True</code>, the
tokenizer assumes the input is already split into words (for instance, by splitting it on whitespace)
which it will tokenize. This is useful for NER or token classification.`,name:"is_split_into_words"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If set will pad the sequence to a multiple of the provided value. Requires <code>padding</code> to be activated.
This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability
<code>&gt;= 7.5</code> (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.33.0/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of list of python integers. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return Numpy <code>np.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.return_token_type_ids",description:`<strong>return_token_type_ids</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to return token type IDs. If left to the default, will return the token type IDs according to
the specific tokenizer&#x2019;s default, defined by the <code>return_outputs</code> attribute.</p>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"return_token_type_ids"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.return_attention_mask",description:`<strong>return_attention_mask</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to return the attention mask. If left to the default, will return the attention mask according
to the specific tokenizer&#x2019;s default, defined by the <code>return_outputs</code> attribute.</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"return_attention_mask"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.return_overflowing_tokens",description:`<strong>return_overflowing_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return overflowing token sequences. If a pair of sequences of input ids (or a batch
of pairs) is provided with <code>truncation_strategy = longest_first</code> or <code>True</code>, an error is raised instead
of returning overflowing tokens.`,name:"return_overflowing_tokens"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.return_special_tokens_mask",description:`<strong>return_special_tokens_mask</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return special tokens mask information.`,name:"return_special_tokens_mask"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.return_offsets_mapping",description:`<strong>return_offsets_mapping</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return <code>(char_start, char_end)</code> for each token.</p>
<p>This is only available on fast tokenizers inheriting from <a href="/docs/transformers/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a>, if using
Python&#x2019;s tokenizer, this method will raise <code>NotImplementedError</code>.`,name:"return_offsets_mapping"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.return_length",description:`<strong>return_length</strong>  (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return the lengths of the encoded inputs.`,name:"return_length"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.verbose",description:`<strong>verbose</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to print more information and warnings.
**kwargs &#x2014; passed to the <code>self.tokenize()</code> method`,name:"verbose"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/tokenization_utils_base.py#L2528",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a> with the following fields:</p>
<ul>
<li>
<p><strong>input_ids</strong> \u2014 List of token ids to be fed to a model.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
</li>
<li>
<p><strong>token_type_ids</strong> \u2014 List of token type ids to be fed to a model (when <code>return_token_type_ids=True</code> or
if <em>\u201Ctoken_type_ids\u201D</em> is in <code>self.model_input_names</code>).</p>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a></p>
</li>
<li>
<p><strong>attention_mask</strong> \u2014 List of indices specifying which tokens should be attended to by the model (when
<code>return_attention_mask=True</code> or if <em>\u201Cattention_mask\u201D</em> is in <code>self.model_input_names</code>).</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
</li>
<li>
<p><strong>overflowing_tokens</strong> \u2014 List of overflowing tokens sequences (when a <code>max_length</code> is specified and
<code>return_overflowing_tokens=True</code>).</p>
</li>
<li>
<p><strong>num_truncated_tokens</strong> \u2014 Number of tokens truncated (when a <code>max_length</code> is specified and
<code>return_overflowing_tokens=True</code>).</p>
</li>
<li>
<p><strong>special_tokens_mask</strong> \u2014 List of 0s and 1s, with 1 specifying added special tokens and 0 specifying
regular sequence tokens (when <code>add_special_tokens=True</code> and <code>return_special_tokens_mask=True</code>).</p>
</li>
<li>
<p><strong>length</strong> \u2014 The length of the inputs (when <code>return_length=True</code>)</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),Ls=new F({props:{name:"save_vocabulary",anchor:"transformers.Wav2Vec2CTCTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/tokenization_wav2vec2.py#L635"}}),Hs=new F({props:{name:"decode",anchor:"transformers.Wav2Vec2CTCTokenizer.decode",parameters:[{name:"token_ids",val:": typing.Union[int, typing.List[int], ForwardRef('np.ndarray'), ForwardRef('torch.Tensor'), ForwardRef('tf.Tensor')]"},{name:"skip_special_tokens",val:": bool = False"},{name:"clean_up_tokenization_spaces",val:": bool = None"},{name:"output_char_offsets",val:": bool = False"},{name:"output_word_offsets",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2CTCTokenizer.decode.token_ids",description:`<strong>token_ids</strong> (<code>Union[int, List[int], np.ndarray, torch.Tensor, tf.Tensor]</code>) &#x2014;
List of tokenized input ids. Can be obtained using the <code>__call__</code> method.`,name:"token_ids"},{anchor:"transformers.Wav2Vec2CTCTokenizer.decode.skip_special_tokens",description:`<strong>skip_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to remove special tokens in the decoding.`,name:"skip_special_tokens"},{anchor:"transformers.Wav2Vec2CTCTokenizer.decode.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to clean up the tokenization spaces.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.Wav2Vec2CTCTokenizer.decode.output_char_offsets",description:`<strong>output_char_offsets</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to output character offsets. Character offsets can be used in combination with the
sampling rate and model downsampling rate to compute the time-stamps of transcribed characters.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>Please take a look at the example below to better understand how to make use of <code>output_char_offsets</code>.</p>

					</div>`,name:"output_char_offsets"},{anchor:"transformers.Wav2Vec2CTCTokenizer.decode.output_word_offsets",description:`<strong>output_word_offsets</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to output word offsets. Word offsets can be used in combination with the sampling rate
and model downsampling rate to compute the time-stamps of transcribed words.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>Please take a look at the example below to better understand how to make use of <code>output_word_offsets</code>.</p>

					</div>`,name:"output_word_offsets"},{anchor:"transformers.Wav2Vec2CTCTokenizer.decode.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Will be passed to the underlying model specific decode method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/tokenization_wav2vec2.py#L530",returnDescription:`
<p>The list of decoded
sentences. Will be a <code>Wav2Vec2CTCTokenizerOutput</code> when
<code>output_char_offsets == True</code> or <code>output_word_offsets == True</code>.</p>
`,returnType:`
<p><code>str</code> or <code>Wav2Vec2CTCTokenizerOutput</code></p>
`}}),ta=new Xe({props:{anchor:"transformers.Wav2Vec2CTCTokenizer.decode.example",$$slots:{default:[q1]},$$scope:{ctx:W}}}),Os=new F({props:{name:"batch_decode",anchor:"transformers.Wav2Vec2CTCTokenizer.batch_decode",parameters:[{name:"sequences",val:": typing.Union[typing.List[int], typing.List[typing.List[int]], ForwardRef('np.ndarray'), ForwardRef('torch.Tensor'), ForwardRef('tf.Tensor')]"},{name:"skip_special_tokens",val:": bool = False"},{name:"clean_up_tokenization_spaces",val:": bool = None"},{name:"output_char_offsets",val:": bool = False"},{name:"output_word_offsets",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2CTCTokenizer.batch_decode.sequences",description:`<strong>sequences</strong> (<code>Union[List[int], List[List[int]], np.ndarray, torch.Tensor, tf.Tensor]</code>) &#x2014;
List of tokenized input ids. Can be obtained using the <code>__call__</code> method.`,name:"sequences"},{anchor:"transformers.Wav2Vec2CTCTokenizer.batch_decode.skip_special_tokens",description:`<strong>skip_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to remove special tokens in the decoding.`,name:"skip_special_tokens"},{anchor:"transformers.Wav2Vec2CTCTokenizer.batch_decode.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to clean up the tokenization spaces.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.Wav2Vec2CTCTokenizer.batch_decode.output_char_offsets",description:`<strong>output_char_offsets</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to output character offsets. Character offsets can be used in combination with the
sampling rate and model downsampling rate to compute the time-stamps of transcribed characters.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>Please take a look at the Example of <a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.decode">decode()</a> to better understand how to make
use of <code>output_char_offsets</code>. <a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.batch_decode">batch_decode()</a> works the same way with batched
output.</p>

					</div>`,name:"output_char_offsets"},{anchor:"transformers.Wav2Vec2CTCTokenizer.batch_decode.output_word_offsets",description:`<strong>output_word_offsets</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to output word offsets. Word offsets can be used in combination with the sampling rate
and model downsampling rate to compute the time-stamps of transcribed words.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>Please take a look at the Example of <a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.decode">decode()</a> to better understand how to make
use of <code>output_word_offsets</code>. <a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.batch_decode">batch_decode()</a> works the same way with batched
output.</p>

					</div>`,name:"output_word_offsets"},{anchor:"transformers.Wav2Vec2CTCTokenizer.batch_decode.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Will be passed to the underlying model specific decode method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/tokenization_wav2vec2.py#L460",returnDescription:`
<p>The list of decoded
sentences. Will be a <code>Wav2Vec2CTCTokenizerOutput</code> when
<code>output_char_offsets == True</code> or <code>output_word_offsets == True</code>.</p>
`,returnType:`
<p><code>List[str]</code> or <code>Wav2Vec2CTCTokenizerOutput</code></p>
`}}),Ks=new F({props:{name:"set_target_lang",anchor:"transformers.Wav2Vec2CTCTokenizer.set_target_lang",parameters:[{name:"target_lang",val:": str"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/tokenization_wav2vec2.py#L215"}}),en=new L({}),tn=new F({props:{name:"class transformers.Wav2Vec2FeatureExtractor",anchor:"transformers.Wav2Vec2FeatureExtractor",parameters:[{name:"feature_size",val:" = 1"},{name:"sampling_rate",val:" = 16000"},{name:"padding_value",val:" = 0.0"},{name:"return_attention_mask",val:" = False"},{name:"do_normalize",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2FeatureExtractor.feature_size",description:`<strong>feature_size</strong> (<code>int</code>, defaults to 1) &#x2014;
The feature dimension of the extracted features.`,name:"feature_size"},{anchor:"transformers.Wav2Vec2FeatureExtractor.sampling_rate",description:`<strong>sampling_rate</strong> (<code>int</code>, defaults to 16000) &#x2014;
The sampling rate at which the audio files should be digitalized expressed in hertz (Hz).`,name:"sampling_rate"},{anchor:"transformers.Wav2Vec2FeatureExtractor.padding_value",description:`<strong>padding_value</strong> (<code>float</code>, defaults to 0.0) &#x2014;
The value that is used to fill the padding values.`,name:"padding_value"},{anchor:"transformers.Wav2Vec2FeatureExtractor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to zero-mean unit-variance normalize the input. Normalizing can help to significantly
improve the performance for some models, <em>e.g.</em>,
<a href="https://huggingface.co/models?search=lv60" rel="nofollow">wav2vec2-lv60</a>.`,name:"do_normalize"},{anchor:"transformers.Wav2Vec2FeatureExtractor.return_attention_mask",description:`<strong>return_attention_mask</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not <a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor.__call__"><strong>call</strong>()</a> should return <code>attention_mask</code>.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>Wav2Vec2 models that have set <code>config.feat_extract_norm == &quot;group&quot;</code>, such as
<a href="https://huggingface.co/facebook/wav2vec2-base-960h" rel="nofollow">wav2vec2-base</a>, have <strong>not</strong> been trained using
<code>attention_mask</code>. For such models, <code>input_values</code> should simply be padded with 0 and no <code>attention_mask</code>
should be passed.</p>
<p>For Wav2Vec2 models that have set <code>config.feat_extract_norm == &quot;layer&quot;</code>, such as
<a href="https://huggingface.co/facebook/wav2vec2-large-960h-lv60-self" rel="nofollow">wav2vec2-lv60</a>, <code>attention_mask</code> should be
passed for batched inference.</p>

					</div>`,name:"return_attention_mask"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/feature_extraction_wav2vec2.py#L31"}}),an=new F({props:{name:"__call__",anchor:"transformers.Wav2Vec2FeatureExtractor.__call__",parameters:[{name:"raw_speech",val:": typing.Union[numpy.ndarray, typing.List[float], typing.List[numpy.ndarray], typing.List[typing.List[float]]]"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"truncation",val:": bool = False"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = None"},{name:"return_attention_mask",val:": typing.Optional[bool] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"sampling_rate",val:": typing.Optional[int] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2FeatureExtractor.__call__.raw_speech",description:`<strong>raw_speech</strong> (<code>np.ndarray</code>, <code>List[float]</code>, <code>List[np.ndarray]</code>, <code>List[List[float]]</code>) &#x2014;
The sequence or batch of sequences to be padded. Each sequence can be a numpy array, a list of float
values, a list of numpy arrays or a list of list of float values. Must be mono channel audio, not
stereo, i.e. single float per timestep.`,name:"raw_speech"},{anchor:"transformers.Wav2Vec2FeatureExtractor.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.33.0/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Select a strategy to pad the returned sequences (according to the model&#x2019;s padding side and padding
index) among:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.Wav2Vec2FeatureExtractor.__call__.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Maximum length of the returned list and optionally padding length (see above).`,name:"max_length"},{anchor:"transformers.Wav2Vec2FeatureExtractor.__call__.truncation",description:`<strong>truncation</strong> (<code>bool</code>) &#x2014;
Activates truncation to cut input sequences longer than <em>max_length</em> to <em>max_length</em>.`,name:"truncation"},{anchor:"transformers.Wav2Vec2FeatureExtractor.__call__.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If set will pad the sequence to a multiple of the provided value.</p>
<p>This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability
<code>&gt;= 7.5</code> (Volta), or on TPUs which benefit from having sequence lengths be a multiple of 128.`,name:"pad_to_multiple_of"},{anchor:"transformers.Wav2Vec2FeatureExtractor.__call__.return_attention_mask",description:`<strong>return_attention_mask</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to return the attention mask. If left to the default, will return the attention mask according
to the specific feature_extractor&#x2019;s default.</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>Wav2Vec2 models that have set <code>config.feat_extract_norm == &quot;group&quot;</code>, such as
<a href="https://huggingface.co/facebook/wav2vec2-base-960h" rel="nofollow">wav2vec2-base</a>, have <strong>not</strong> been trained using
<code>attention_mask</code>. For such models, <code>input_values</code> should simply be padded with 0 and no
<code>attention_mask</code> should be passed.</p>
<p>For Wav2Vec2 models that have set <code>config.feat_extract_norm == &quot;layer&quot;</code>, such as
<a href="https://huggingface.co/facebook/wav2vec2-large-960h-lv60-self" rel="nofollow">wav2vec2-lv60</a>, <code>attention_mask</code> should
be passed for batched inference.</p>

					</div>`,name:"return_attention_mask"},{anchor:"transformers.Wav2Vec2FeatureExtractor.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.33.0/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of list of python integers. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return Numpy <code>np.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.Wav2Vec2FeatureExtractor.__call__.sampling_rate",description:`<strong>sampling_rate</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The sampling rate at which the <code>raw_speech</code> input was sampled. It is strongly recommended to pass
<code>sampling_rate</code> at the forward call to prevent silent errors.`,name:"sampling_rate"},{anchor:"transformers.Wav2Vec2FeatureExtractor.__call__.padding_value",description:"<strong>padding_value</strong> (<code>float</code>, defaults to 0.0) &#x2014;",name:"padding_value"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/feature_extraction_wav2vec2.py#L102"}}),sn=new L({}),nn=new F({props:{name:"class transformers.Wav2Vec2Processor",anchor:"transformers.Wav2Vec2Processor",parameters:[{name:"feature_extractor",val:""},{name:"tokenizer",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2Processor.feature_extractor",description:`<strong>feature_extractor</strong> (<code>Wav2Vec2FeatureExtractor</code>) &#x2014;
An instance of <a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor">Wav2Vec2FeatureExtractor</a>. The feature extractor is a required input.`,name:"feature_extractor"},{anchor:"transformers.Wav2Vec2Processor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
An instance of <a href="/docs/transformers/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/processing_wav2vec2.py#L26"}}),ln=new F({props:{name:"__call__",anchor:"transformers.Wav2Vec2Processor.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/processing_wav2vec2.py#L67"}}),pn=new F({props:{name:"pad",anchor:"transformers.Wav2Vec2Processor.pad",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/processing_wav2vec2.py#L105"}}),mn=new F({props:{name:"from_pretrained",anchor:"transformers.Wav2Vec2Processor.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/processing_wav2vec2.py#L48"}}),hn=new F({props:{name:"save_pretrained",anchor:"transformers.Wav2Vec2Processor.save_pretrained",parameters:[{name:"save_directory",val:""},{name:"push_to_hub",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2Processor.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory where the feature extractor JSON file and the tokenizer files will be saved (directory will
be created if it does not exist).`,name:"save_directory"},{anchor:"transformers.Wav2Vec2Processor.save_pretrained.push_to_hub",description:`<strong>push_to_hub</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to push your model to the Hugging Face model hub after saving it. You can specify the
repository you want to push to with <code>repo_id</code> (will default to the name of <code>save_directory</code> in your
namespace).`,name:"push_to_hub"},{anchor:"transformers.Wav2Vec2Processor.save_pretrained.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional key word arguments passed along to the <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/processing_utils.py#L93"}}),ca=new we({props:{$$slots:{default:[Y1]},$$scope:{ctx:W}}}),un=new F({props:{name:"batch_decode",anchor:"transformers.Wav2Vec2Processor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/processing_wav2vec2.py#L135"}}),_n=new F({props:{name:"decode",anchor:"transformers.Wav2Vec2Processor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/processing_wav2vec2.py#L142"}}),bn=new L({}),yn=new F({props:{name:"class transformers.Wav2Vec2ProcessorWithLM",anchor:"transformers.Wav2Vec2ProcessorWithLM",parameters:[{name:"feature_extractor",val:": FeatureExtractionMixin"},{name:"tokenizer",val:": PreTrainedTokenizerBase"},{name:"decoder",val:": BeamSearchDecoderCTC"}],parametersDescription:[{anchor:"transformers.Wav2Vec2ProcessorWithLM.feature_extractor",description:`<strong>feature_extractor</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor">Wav2Vec2FeatureExtractor</a>) &#x2014;
An instance of <a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor">Wav2Vec2FeatureExtractor</a>. The feature extractor is a required input.`,name:"feature_extractor"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer">Wav2Vec2CTCTokenizer</a>) &#x2014;
An instance of <a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer">Wav2Vec2CTCTokenizer</a>. The tokenizer is a required input.`,name:"tokenizer"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.decoder",description:`<strong>decoder</strong> (<code>pyctcdecode.BeamSearchDecoderCTC</code>) &#x2014;
An instance of <code>pyctcdecode.BeamSearchDecoderCTC</code>. The decoder is a required input.`,name:"decoder"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L67"}}),wn=new F({props:{name:"__call__",anchor:"transformers.Wav2Vec2ProcessorWithLM.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L214"}}),jn=new F({props:{name:"pad",anchor:"transformers.Wav2Vec2ProcessorWithLM.pad",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L253"}}),kn=new F({props:{name:"from_pretrained",anchor:"transformers.Wav2Vec2ProcessorWithLM.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2ProcessorWithLM.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
This can be either:</p>
<ul>
<li>a string, the <em>model id</em> of a pretrained feature_extractor hosted inside a model repo on
huggingface.co. Valid model ids can be located at the root-level, like <code>bert-base-uncased</code>, or
namespaced under a user or organization name, like <code>dbmdz/bert-base-german-cased</code>.</li>
<li>a path to a <em>directory</em> containing a feature extractor file saved using the
<a href="/docs/transformers/v4.33.0/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.save_pretrained">save_pretrained()</a> method, e.g., <code>./my_model_directory/</code>.</li>
<li>a path or url to a saved feature extractor JSON <em>file</em>, e.g.,
<code>./my_model_directory/preprocessor_config.json</code>.
**kwargs &#x2014;
Additional keyword arguments passed along to both <a href="/docs/transformers/v4.33.0/en/main_classes/feature_extractor#transformers.SequenceFeatureExtractor">SequenceFeatureExtractor</a> and
<a href="/docs/transformers/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a></li>
</ul>`,name:"pretrained_model_name_or_path"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L112"}}),ua=new we({props:{$$slots:{default:[P1]},$$scope:{ctx:W}}}),Vn=new F({props:{name:"save_pretrained",anchor:"transformers.Wav2Vec2ProcessorWithLM.save_pretrained",parameters:[{name:"save_directory",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L108"}}),Jn=new F({props:{name:"batch_decode",anchor:"transformers.Wav2Vec2ProcessorWithLM.batch_decode",parameters:[{name:"logits",val:": ndarray"},{name:"pool",val:": typing.Union[<bound method BaseContext.Pool of <multiprocessing.context.DefaultContext object at 0x7ff17adbf760>>, NoneType] = None"},{name:"num_processes",val:": typing.Optional[int] = None"},{name:"beam_width",val:": typing.Optional[int] = None"},{name:"beam_prune_logp",val:": typing.Optional[float] = None"},{name:"token_min_logp",val:": typing.Optional[float] = None"},{name:"hotwords",val:": typing.Optional[typing.Iterable[str]] = None"},{name:"hotword_weight",val:": typing.Optional[float] = None"},{name:"alpha",val:": typing.Optional[float] = None"},{name:"beta",val:": typing.Optional[float] = None"},{name:"unk_score_offset",val:": typing.Optional[float] = None"},{name:"lm_score_boundary",val:": typing.Optional[bool] = None"},{name:"output_word_offsets",val:": bool = False"},{name:"n_best",val:": int = 1"}],parametersDescription:[{anchor:"transformers.Wav2Vec2ProcessorWithLM.batch_decode.logits",description:`<strong>logits</strong> (<code>np.ndarray</code>) &#x2014;
The logits output vector of the model representing the log probabilities for each token.`,name:"logits"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.batch_decode.pool",description:`<strong>pool</strong> (<code>multiprocessing.Pool</code>, <em>optional</em>) &#x2014;
An optional user-managed pool. If not set, one will be automatically created and closed. The pool
should be instantiated <em>after</em> <code>Wav2Vec2ProcessorWithLM</code>. Otherwise, the LM won&#x2019;t be available to the
pool&#x2019;s sub-processes.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>Currently, only pools created with a &#x2018;fork&#x2019; context can be used. If a &#x2018;spawn&#x2019; pool is passed, it will
be ignored and sequential decoding will be used instead.</p>

					</div>`,name:"pool"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.batch_decode.num_processes",description:`<strong>num_processes</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If <code>pool</code> is not set, number of processes on which the function should be parallelized over. Defaults
to the number of available CPUs.`,name:"num_processes"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.batch_decode.beam_width",description:`<strong>beam_width</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Maximum number of beams at each step in decoding. Defaults to pyctcdecode&#x2019;s DEFAULT_BEAM_WIDTH.`,name:"beam_width"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.batch_decode.beam_prune_logp",description:`<strong>beam_prune_logp</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Beams that are much worse than best beam will be pruned Defaults to pyctcdecode&#x2019;s DEFAULT_PRUNE_LOGP.`,name:"beam_prune_logp"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.batch_decode.token_min_logp",description:`<strong>token_min_logp</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Tokens below this logp are skipped unless they are argmax of frame Defaults to pyctcdecode&#x2019;s
DEFAULT_MIN_TOKEN_LOGP.`,name:"token_min_logp"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.batch_decode.hotwords",description:`<strong>hotwords</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
List of words with extra importance, can be OOV for LM`,name:"hotwords"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.batch_decode.hotword_weight",description:`<strong>hotword_weight</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Weight factor for hotword importance Defaults to pyctcdecode&#x2019;s DEFAULT_HOTWORD_WEIGHT.`,name:"hotword_weight"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.batch_decode.alpha",description:`<strong>alpha</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Weight for language model during shallow fusion`,name:"alpha"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.batch_decode.beta",description:`<strong>beta</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Weight for length score adjustment of during scoring`,name:"beta"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.batch_decode.unk_score_offset",description:`<strong>unk_score_offset</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Amount of log score offset for unknown tokens`,name:"unk_score_offset"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.batch_decode.lm_score_boundary",description:`<strong>lm_score_boundary</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to have kenlm respect boundaries when scoring`,name:"lm_score_boundary"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.batch_decode.output_word_offsets",description:`<strong>output_word_offsets</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to output word offsets. Word offsets can be used in combination with the sampling rate
and model downsampling rate to compute the time-stamps of transcribed words.`,name:"output_word_offsets"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.batch_decode.n_best",description:`<strong>n_best</strong> (<code>int</code>, <em>optional</em>, defaults to <code>1</code>) &#x2014;
Number of best hypotheses to return. If <code>n_best</code> is greater than 1, the returned <code>text</code> will be a list
of lists of strings, <code>logit_score</code> will be a list of lists of floats, and <code>lm_score</code> will be a list of
lists of floats, where the length of the outer list will correspond to the batch size and the length of
the inner list will correspond to the number of returned hypotheses . The value should be &gt;= 1.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>Please take a look at the Example of <a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2ProcessorWithLM.decode">decode()</a> to better understand how to
make use of <code>output_word_offsets</code>. <a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2ProcessorWithLM.batch_decode">batch_decode()</a> works the same way with
batched output.</p>

					</div>`,name:"n_best"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L284",returnDescription:`
<p><code>~models.wav2vec2.Wav2Vec2DecoderWithLMOutput</code>.</p>
`}}),ga=new we({props:{$$slots:{default:[S1]},$$scope:{ctx:W}}}),xn=new F({props:{name:"decode",anchor:"transformers.Wav2Vec2ProcessorWithLM.decode",parameters:[{name:"logits",val:": ndarray"},{name:"beam_width",val:": typing.Optional[int] = None"},{name:"beam_prune_logp",val:": typing.Optional[float] = None"},{name:"token_min_logp",val:": typing.Optional[float] = None"},{name:"hotwords",val:": typing.Optional[typing.Iterable[str]] = None"},{name:"hotword_weight",val:": typing.Optional[float] = None"},{name:"alpha",val:": typing.Optional[float] = None"},{name:"beta",val:": typing.Optional[float] = None"},{name:"unk_score_offset",val:": typing.Optional[float] = None"},{name:"lm_score_boundary",val:": typing.Optional[bool] = None"},{name:"output_word_offsets",val:": bool = False"},{name:"n_best",val:": int = 1"}],parametersDescription:[{anchor:"transformers.Wav2Vec2ProcessorWithLM.decode.logits",description:`<strong>logits</strong> (<code>np.ndarray</code>) &#x2014;
The logits output vector of the model representing the log probabilities for each token.`,name:"logits"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.decode.beam_width",description:`<strong>beam_width</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Maximum number of beams at each step in decoding. Defaults to pyctcdecode&#x2019;s DEFAULT_BEAM_WIDTH.`,name:"beam_width"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.decode.beam_prune_logp",description:`<strong>beam_prune_logp</strong> (<code>int</code>, <em>optional</em>) &#x2014;
A threshold to prune beams with log-probs less than best_beam_logp + beam_prune_logp. The value should
be &lt;= 0. Defaults to pyctcdecode&#x2019;s DEFAULT_PRUNE_LOGP.`,name:"beam_prune_logp"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.decode.token_min_logp",description:`<strong>token_min_logp</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Tokens with log-probs below token_min_logp are skipped unless they are have the maximum log-prob for an
utterance. Defaults to pyctcdecode&#x2019;s DEFAULT_MIN_TOKEN_LOGP.`,name:"token_min_logp"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.decode.hotwords",description:`<strong>hotwords</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
List of words with extra importance which can be missing from the LM&#x2019;s vocabulary, e.g. [&#x201C;huggingface&#x201D;]`,name:"hotwords"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.decode.hotword_weight",description:`<strong>hotword_weight</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Weight multiplier that boosts hotword scores. Defaults to pyctcdecode&#x2019;s DEFAULT_HOTWORD_WEIGHT.`,name:"hotword_weight"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.decode.alpha",description:`<strong>alpha</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Weight for language model during shallow fusion`,name:"alpha"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.decode.beta",description:`<strong>beta</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Weight for length score adjustment of during scoring`,name:"beta"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.decode.unk_score_offset",description:`<strong>unk_score_offset</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Amount of log score offset for unknown tokens`,name:"unk_score_offset"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.decode.lm_score_boundary",description:`<strong>lm_score_boundary</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to have kenlm respect boundaries when scoring`,name:"lm_score_boundary"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.decode.output_word_offsets",description:`<strong>output_word_offsets</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to output word offsets. Word offsets can be used in combination with the sampling rate
and model downsampling rate to compute the time-stamps of transcribed words.`,name:"output_word_offsets"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.decode.n_best",description:`<strong>n_best</strong> (<code>int</code>, <em>optional</em>, defaults to <code>1</code>) &#x2014;
Number of best hypotheses to return. If <code>n_best</code> is greater than 1, the returned <code>text</code> will be a list
of strings, <code>logit_score</code> will be a list of floats, and <code>lm_score</code> will be a list of floats, where the
length of these lists will correspond to the number of returned hypotheses. The value should be &gt;= 1.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>Please take a look at the example below to better understand how to make use of <code>output_word_offsets</code>.</p>

					</div>`,name:"n_best"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L469",returnDescription:`
<p><code>~models.wav2vec2.Wav2Vec2DecoderWithLMOutput</code>.</p>
`}}),_a=new Xe({props:{anchor:"transformers.Wav2Vec2ProcessorWithLM.decode.example",$$slots:{default:[Q1]},$$scope:{ctx:W}}}),$n=new L({}),Cn=new Fe({props:{code:"JTIzJTIwTGV0J3MlMjBzZWUlMjBob3clMjB0byUyMHVzZSUyMGElMjB1c2VyLW1hbmFnZWQlMjBwb29sJTIwZm9y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yYW5zY3JpcHRpb24lMjIlNUQlNUIlM0EyJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Let&#x27;s see how to use a user-managed pool for batch decoding multiple audios</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> multiprocessing <span class="hljs-keyword">import</span> get_context
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoProcessor, AutoModelForCTC
<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> datasets
<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-comment"># import model, feature extractor, tokenizer</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCTC.from_pretrained(<span class="hljs-string">&quot;patrickvonplaten/wav2vec2-base-100h-with-lm&quot;</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;patrickvonplaten/wav2vec2-base-100h-with-lm&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># load example dataset</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_dummy&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.cast_column(<span class="hljs-string">&quot;audio&quot;</span>, datasets.Audio(sampling_rate=<span class="hljs-number">16_000</span>))


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">map_to_array</span>(<span class="hljs-params">batch</span>):
<span class="hljs-meta">... </span>    batch[<span class="hljs-string">&quot;speech&quot;</span>] = batch[<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>]
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> batch


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># prepare speech data for batch inference</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.<span class="hljs-built_in">map</span>(map_to_array, remove_columns=[<span class="hljs-string">&quot;audio&quot;</span>])


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">map_to_pred</span>(<span class="hljs-params">batch, pool</span>):
<span class="hljs-meta">... </span>    inputs = processor(batch[<span class="hljs-string">&quot;speech&quot;</span>], sampling_rate=<span class="hljs-number">16_000</span>, padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">... </span>    inputs = {k: v.to(<span class="hljs-string">&quot;cuda&quot;</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> inputs.items()}

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

<span class="hljs-meta">... </span>    transcription = processor.batch_decode(logits.cpu().numpy(), pool).text
<span class="hljs-meta">... </span>    batch[<span class="hljs-string">&quot;transcription&quot;</span>] = transcription
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> batch


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># note: pool should be instantiated *after* \`Wav2Vec2ProcessorWithLM\`.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment">#       otherwise, the LM won&#x27;t be available to the pool&#x27;s sub-processes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># select number of processes and batch_size based on number of CPU cores available and on dataset size</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> get_context(<span class="hljs-string">&quot;fork&quot;</span>).Pool(processes=<span class="hljs-number">2</span>) <span class="hljs-keyword">as</span> pool:
<span class="hljs-meta">... </span>    result = dataset.<span class="hljs-built_in">map</span>(
<span class="hljs-meta">... </span>        map_to_pred, batched=<span class="hljs-literal">True</span>, batch_size=<span class="hljs-number">2</span>, fn_kwargs={<span class="hljs-string">&quot;pool&quot;</span>: pool}, remove_columns=[<span class="hljs-string">&quot;speech&quot;</span>]
<span class="hljs-meta">... </span>    )

<span class="hljs-meta">&gt;&gt;&gt; </span>result[<span class="hljs-string">&quot;transcription&quot;</span>][:<span class="hljs-number">2</span>]
[<span class="hljs-string">&#x27;MISTER QUILTER IS THE APOSTLE OF THE MIDDLE CLASSES AND WE ARE GLAD TO WELCOME HIS GOSPEL&#x27;</span>, <span class="hljs-string">&quot;NOR IS MISTER COULTER&#x27;S MANNER LESS INTERESTING THAN HIS MATTER&quot;</span>]`}}),Un=new L({}),En=new F({props:{name:"class transformers.models.wav2vec2_with_lm.processing_wav2vec2_with_lm.Wav2Vec2DecoderWithLMOutput",anchor:"transformers.models.wav2vec2_with_lm.processing_wav2vec2_with_lm.Wav2Vec2DecoderWithLMOutput",parameters:[{name:"text",val:": typing.Union[typing.List[typing.List[str]], typing.List[str], str]"},{name:"logit_score",val:": typing.Union[typing.List[typing.List[float]], typing.List[float], float] = None"},{name:"lm_score",val:": typing.Union[typing.List[typing.List[float]], typing.List[float], float] = None"},{name:"word_offsets",val:": typing.Union[typing.List[typing.List[typing.List[typing.Dict[str, typing.Union[int, str]]]]], typing.List[typing.List[typing.Dict[str, typing.Union[int, str]]]], typing.List[typing.Dict[str, typing.Union[int, str]]]] = None"}],parametersDescription:[{anchor:"transformers.models.wav2vec2_with_lm.processing_wav2vec2_with_lm.Wav2Vec2DecoderWithLMOutput.text",description:`<strong>text</strong> (list of <code>str</code> or <code>str</code>) &#x2014;
Decoded logits in text from. Usually the speech transcription.`,name:"text"},{anchor:"transformers.models.wav2vec2_with_lm.processing_wav2vec2_with_lm.Wav2Vec2DecoderWithLMOutput.logit_score",description:`<strong>logit_score</strong> (list of <code>float</code> or <code>float</code>) &#x2014;
Total logit score of the beams associated with produced text.`,name:"logit_score"},{anchor:"transformers.models.wav2vec2_with_lm.processing_wav2vec2_with_lm.Wav2Vec2DecoderWithLMOutput.lm_score",description:`<strong>lm_score</strong> (list of <code>float</code>) &#x2014;
Fused lm_score of the beams associated with produced text.`,name:"lm_score"},{anchor:"transformers.models.wav2vec2_with_lm.processing_wav2vec2_with_lm.Wav2Vec2DecoderWithLMOutput.word_offsets",description:`<strong>word_offsets</strong> (list of <code>List[Dict[str, Union[int, str]]]</code> or <code>List[Dict[str, Union[int, str]]]</code>) &#x2014;
Offsets of the decoded words. In combination with sampling rate and model downsampling rate word offsets
can be used to compute time stamps for each word.`,name:"word_offsets"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L45"}}),In=new F({props:{name:"class transformers.modeling_outputs.Wav2Vec2BaseModelOutput",anchor:"transformers.modeling_outputs.Wav2Vec2BaseModelOutput",parameters:[{name:"last_hidden_state",val:": FloatTensor = None"},{name:"extract_features",val:": FloatTensor = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.modeling_outputs.Wav2Vec2BaseModelOutput.last_hidden_state",description:`<strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the output of the last layer of the model.`,name:"last_hidden_state"},{anchor:"transformers.modeling_outputs.Wav2Vec2BaseModelOutput.extract_features",description:`<strong>extract_features</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, conv_dim[-1])</code>) &#x2014;
Sequence of extracted feature vectors of the last convolutional layer of the model.`,name:"extract_features"},{anchor:"transformers.modeling_outputs.Wav2Vec2BaseModelOutput.hidden_states",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + 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 initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.modeling_outputs.Wav2Vec2BaseModelOutput.attentions",description:`<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>) &#x2014;
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.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/modeling_outputs.py#L1286"}}),zn=new F({props:{name:"class transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForPreTrainingOutput",anchor:"transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForPreTrainingOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"projected_states",val:": FloatTensor = None"},{name:"projected_quantized_states",val:": FloatTensor = None"},{name:"codevector_perplexity",val:": FloatTensor = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"contrastive_loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"diversity_loss",val:": typing.Optional[torch.FloatTensor] = None"}],parametersDescription:[{anchor:"transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForPreTrainingOutput.loss",description:`<strong>loss</strong> (<em>optional</em>, returned when <code>sample_negative_indices</code> are passed, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) &#x2014;
Total loss as the sum of the contrastive loss (L_m) and the diversity loss (L_d) as stated in the <a href="https://arxiv.org/pdf/2006.11477.pdf" rel="nofollow">official
paper</a> . (classification) loss.`,name:"loss"},{anchor:"transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForPreTrainingOutput.projected_states",description:`<strong>projected_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.proj_codevector_dim)</code>) &#x2014;
Hidden-states of the model projected to <em>config.proj_codevector_dim</em> that can be used to predict the masked
projected quantized states.`,name:"projected_states"},{anchor:"transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForPreTrainingOutput.projected_quantized_states",description:`<strong>projected_quantized_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.proj_codevector_dim)</code>) &#x2014;
Quantized extracted feature vectors projected to <em>config.proj_codevector_dim</em> representing the positive
target vectors for contrastive loss.`,name:"projected_quantized_states"},{anchor:"transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForPreTrainingOutput.hidden_states",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + 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 initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForPreTrainingOutput.attentions",description:`<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>) &#x2014;
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.`,name:"attentions"},{anchor:"transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForPreTrainingOutput.contrastive_loss",description:`<strong>contrastive_loss</strong> (<em>optional</em>, returned when <code>sample_negative_indices</code> are passed, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) &#x2014;
The contrastive loss (L_m) as stated in the <a href="https://arxiv.org/pdf/2006.11477.pdf" rel="nofollow">official paper</a> .`,name:"contrastive_loss"},{anchor:"transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForPreTrainingOutput.diversity_loss",description:`<strong>diversity_loss</strong> (<em>optional</em>, returned when <code>sample_negative_indices</code> are passed, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) &#x2014;
The diversity loss (L_d) as stated in the <a href="https://arxiv.org/pdf/2006.11477.pdf" rel="nofollow">official paper</a> .`,name:"diversity_loss"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L100"}}),Nn=new F({props:{name:"class transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2BaseModelOutput",anchor:"transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2BaseModelOutput",parameters:[{name:"last_hidden_state",val:": Array = None"},{name:"extract_features",val:": Array = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[jax.Array]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[jax.Array]] = None"}],parametersDescription:[{anchor:"transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2BaseModelOutput.last_hidden_state",description:`<strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the output of the last layer of the model.`,name:"last_hidden_state"},{anchor:"transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2BaseModelOutput.extract_features",description:`<strong>extract_features</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, last_conv_dim)</code>) &#x2014;
Sequence of extracted feature vectors of the last convolutional layer of the model with <code>last_conv_dim</code>
being the dimension of the last convolutional layer.`,name:"extract_features"},{anchor:"transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2BaseModelOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2BaseModelOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>jnp.ndarray</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.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L45"}}),Gn=new F({props:{name:"replace",anchor:"transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2BaseModelOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/flax/struct.py#L111"}}),Rn=new F({props:{name:"class transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2ForPreTrainingOutput",anchor:"transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2ForPreTrainingOutput",parameters:[{name:"projected_states",val:": Array = None"},{name:"projected_quantized_states",val:": Array = None"},{name:"codevector_perplexity",val:": Array = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[jax.Array]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[jax.Array]] = None"}],parametersDescription:[{anchor:"transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2ForPreTrainingOutput.loss",description:`<strong>loss</strong> (<em>optional</em>, returned when model is in train mode, <code>jnp.ndarray</code> of shape <code>(1,)</code>) &#x2014;
Total loss as the sum of the contrastive loss (L_m) and the diversity loss (L_d) as stated in the <a href="https://arxiv.org/pdf/2006.11477.pdf" rel="nofollow">official
paper</a> . (classification) loss.`,name:"loss"},{anchor:"transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2ForPreTrainingOutput.projected_states",description:`<strong>projected_states</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.proj_codevector_dim)</code>) &#x2014;
Hidden-states of the model projected to <em>config.proj_codevector_dim</em> that can be used to predict the masked
projected quantized states.`,name:"projected_states"},{anchor:"transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2ForPreTrainingOutput.projected_quantized_states",description:`<strong>projected_quantized_states</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.proj_codevector_dim)</code>) &#x2014;
Quantized extracted feature vectors projected to <em>config.proj_codevector_dim</em> representing the positive
target vectors for contrastive loss.`,name:"projected_quantized_states"},{anchor:"transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2ForPreTrainingOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2ForPreTrainingOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>jnp.ndarray</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.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L75"}}),qn=new F({props:{name:"replace",anchor:"transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2ForPreTrainingOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/flax/struct.py#L111"}}),Yn=new L({}),Pn=new F({props:{name:"class transformers.Wav2Vec2Model",anchor:"transformers.Wav2Vec2Model",parameters:[{name:"config",val:": Wav2Vec2Config"}],parametersDescription:[{anchor:"transformers.Wav2Vec2Model.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Config">Wav2Vec2Config</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.33.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.33.0/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L1456"}}),On=new F({props:{name:"forward",anchor:"transformers.Wav2Vec2Model.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.Wav2Vec2Model.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.33.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.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Wav2Vec2Model.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></p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/wav2vec2-base-960h" rel="nofollow">wav2vec2-base</a>, <code>attention_mask</code> should <strong>not</strong> be
passed to avoid degraded performance when doing batched inference. For such models <code>input_values</code> should
simply be padded with 0 and passed without <code>attention_mask</code>. Be aware that these models also yield slightly
different results depending on whether <code>input_values</code> is padded or not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Wav2Vec2Model.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.Wav2Vec2Model.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.Wav2Vec2Model.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.33.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.33.0/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L1542",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.modeling_outputs.Wav2Vec2BaseModelOutput"
>transformers.modeling_outputs.Wav2Vec2BaseModelOutput</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.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Config"
>Wav2Vec2Config</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>extract_features</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, conv_dim[-1])</code>) \u2014 Sequence of extracted feature vectors of the last convolutional 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 + 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 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.33.0/en/model_doc/wav2vec2#transformers.modeling_outputs.Wav2Vec2BaseModelOutput"
>transformers.modeling_outputs.Wav2Vec2BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ma=new we({props:{$$slots:{default:[L1]},$$scope:{ctx:W}}}),ja=new Xe({props:{anchor:"transformers.Wav2Vec2Model.forward.example",$$slots:{default:[H1]},$$scope:{ctx:W}}}),Kn=new L({}),er=new F({props:{name:"class transformers.Wav2Vec2ForCTC",anchor:"transformers.Wav2Vec2ForCTC",parameters:[{name:"config",val:""},{name:"target_lang",val:": typing.Optional[str] = None"}],parametersDescription:[{anchor:"transformers.Wav2Vec2ForCTC.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Config">Wav2Vec2Config</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.33.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.33.0/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L1875"}}),nr=new F({props:{name:"forward",anchor:"transformers.Wav2Vec2ForCTC.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.Wav2Vec2ForCTC.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.33.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.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Wav2Vec2ForCTC.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></p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/wav2vec2-base-960h" rel="nofollow">wav2vec2-base</a>, <code>attention_mask</code> should <strong>not</strong> be
passed to avoid degraded performance when doing batched inference. For such models <code>input_values</code> should
simply be padded with 0 and passed without <code>attention_mask</code>. Be aware that these models also yield slightly
different results depending on whether <code>input_values</code> is padded or not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Wav2Vec2ForCTC.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.Wav2Vec2ForCTC.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.Wav2Vec2ForCTC.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Wav2Vec2ForCTC.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.33.0/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L1947",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Config"
>Wav2Vec2Config</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.33.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutput"
>transformers.modeling_outputs.CausalLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Wa=new we({props:{$$slots:{default:[D1]},$$scope:{ctx:W}}}),Va=new Xe({props:{anchor:"transformers.Wav2Vec2ForCTC.forward.example",$$slots:{default:[O1]},$$scope:{ctx:W}}}),rr=new F({props:{name:"load_adapter",anchor:"transformers.Wav2Vec2ForCTC.load_adapter",parameters:[{name:"target_lang",val:": str"},{name:"force_load",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2ForCTC.load_adapter.target_lang",description:`<strong>target_lang</strong> (<code>str</code>) &#x2014;
Has to be a language id of an existing adapter weight. Adapter weights are stored in the format
adapter.<lang>.safetensors or adapter.<lang>.bin</lang></lang>`,name:"target_lang"},{anchor:"transformers.Wav2Vec2ForCTC.load_adapter.force_load",description:`<strong>force_load</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether the weights shall be loaded even if <code>target_lang</code> matches <code>self.target_lang</code>.`,name:"force_load"},{anchor:"transformers.Wav2Vec2ForCTC.load_adapter.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.`,name:"cache_dir"},{anchor:"transformers.Wav2Vec2ForCTC.load_adapter.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"transformers.Wav2Vec2ForCTC.load_adapter.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.`,name:"resume_download"},{anchor:"transformers.Wav2Vec2ForCTC.load_adapter.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, e.g., <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"transformers.Wav2Vec2ForCTC.load_adapter.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{anchor:"transformers.Wav2Vec2ForCTC.load_adapter.token",description:`<strong>token</strong> (<code>str</code> or <code>bool</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, or not specified, will use
the token generated when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"transformers.Wav2Vec2ForCTC.load_adapter.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be any
identifier allowed by git.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>To test a pull request you made on the Hub, you can pass \`revision=&#x201C;refs/pr/<pr_number>&#x201C;.</pr_number></p>

					</div>`,name:"revision"},{anchor:"transformers.Wav2Vec2ForCTC.load_adapter.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to accelerate downloads in China. If you are from China and have an accessibility
problem, you can set this option to resolve it. Note that we do not guarantee the timeliness or safety.
Please refer to the mirror site for more information.`,name:"mirror"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L1209"}}),Ja=new we({props:{$$slots:{default:[K1]},$$scope:{ctx:W}}}),Fa=new Xe({props:{anchor:"transformers.Wav2Vec2ForCTC.load_adapter.example",$$slots:{default:[ek]},$$scope:{ctx:W}}}),lr=new L({}),ir=new F({props:{name:"class transformers.Wav2Vec2ForSequenceClassification",anchor:"transformers.Wav2Vec2ForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2ForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Config">Wav2Vec2Config</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.33.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.33.0/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L2034"}}),fr=new F({props:{name:"forward",anchor:"transformers.Wav2Vec2ForSequenceClassification.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.Wav2Vec2ForSequenceClassification.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.33.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.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Wav2Vec2ForSequenceClassification.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></p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/wav2vec2-base-960h" rel="nofollow">wav2vec2-base</a>, <code>attention_mask</code> should <strong>not</strong> be
passed to avoid degraded performance when doing batched inference. For such models <code>input_values</code> should
simply be padded with 0 and passed without <code>attention_mask</code>. Be aware that these models also yield slightly
different results depending on whether <code>input_values</code> is padded or not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Wav2Vec2ForSequenceClassification.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.Wav2Vec2ForSequenceClassification.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.Wav2Vec2ForSequenceClassification.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Wav2Vec2ForSequenceClassification.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.33.0/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L2079",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Config"
>Wav2Vec2Config</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.33.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$a=new we({props:{$$slots:{default:[tk]},$$scope:{ctx:W}}}),Ca=new Xe({props:{anchor:"transformers.Wav2Vec2ForSequenceClassification.forward.example",$$slots:{default:[ok]},$$scope:{ctx:W}}}),ur=new L({}),gr=new F({props:{name:"class transformers.Wav2Vec2ForAudioFrameClassification",anchor:"transformers.Wav2Vec2ForAudioFrameClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2ForAudioFrameClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Config">Wav2Vec2Config</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.33.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.33.0/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L2156"}}),Tr=new F({props:{name:"forward",anchor:"transformers.Wav2Vec2ForAudioFrameClassification.forward",parameters:[{name:"input_values",val:": typing.Optional[torch.Tensor]"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",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"}],parametersDescription:[{anchor:"transformers.Wav2Vec2ForAudioFrameClassification.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.33.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.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Wav2Vec2ForAudioFrameClassification.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></p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/wav2vec2-base-960h" rel="nofollow">wav2vec2-base</a>, <code>attention_mask</code> should <strong>not</strong> be
passed to avoid degraded performance when doing batched inference. For such models <code>input_values</code> should
simply be padded with 0 and passed without <code>attention_mask</code>. Be aware that these models also yield slightly
different results depending on whether <code>input_values</code> is padded or not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Wav2Vec2ForAudioFrameClassification.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.Wav2Vec2ForAudioFrameClassification.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.Wav2Vec2ForAudioFrameClassification.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Wav2Vec2ForAudioFrameClassification.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.33.0/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L2200",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</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.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Config"
>Wav2Vec2Config</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 loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification 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.33.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ea=new we({props:{$$slots:{default:[ak]},$$scope:{ctx:W}}}),Za=new Xe({props:{anchor:"transformers.Wav2Vec2ForAudioFrameClassification.forward.example",$$slots:{default:[sk]},$$scope:{ctx:W}}}),Mr=new L({}),jr=new F({props:{name:"class transformers.Wav2Vec2ForXVector",anchor:"transformers.Wav2Vec2ForXVector",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2ForXVector.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Config">Wav2Vec2Config</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.33.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.33.0/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L2317"}}),xr=new F({props:{name:"forward",anchor:"transformers.Wav2Vec2ForXVector.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.Wav2Vec2ForXVector.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.33.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.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Wav2Vec2ForXVector.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></p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/wav2vec2-base-960h" rel="nofollow">wav2vec2-base</a>, <code>attention_mask</code> should <strong>not</strong> be
passed to avoid degraded performance when doing batched inference. For such models <code>input_values</code> should
simply be padded with 0 and passed without <code>attention_mask</code>. Be aware that these models also yield slightly
different results depending on whether <code>input_values</code> is padded or not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Wav2Vec2ForXVector.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.Wav2Vec2ForXVector.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.Wav2Vec2ForXVector.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Wav2Vec2ForXVector.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.33.0/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L2379",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.XVectorOutput"
>transformers.modeling_outputs.XVectorOutput</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.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Config"
>Wav2Vec2Config</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 loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.xvector_output_dim)</code>) \u2014 Classification hidden states before AMSoftmax.</p>
</li>
<li>
<p><strong>embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.xvector_output_dim)</code>) \u2014 Utterance embeddings used for vector similarity-based retrieval.</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 + 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 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.33.0/en/main_classes/output#transformers.modeling_outputs.XVectorOutput"
>transformers.modeling_outputs.XVectorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),za=new we({props:{$$slots:{default:[nk]},$$scope:{ctx:W}}}),Ba=new Xe({props:{anchor:"transformers.Wav2Vec2ForXVector.forward.example",$$slots:{default:[rk]},$$scope:{ctx:W}}}),$r=new L({}),Cr=new F({props:{name:"class transformers.Wav2Vec2ForPreTraining",anchor:"transformers.Wav2Vec2ForPreTraining",parameters:[{name:"config",val:": Wav2Vec2Config"}],parametersDescription:[{anchor:"transformers.Wav2Vec2ForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Config">Wav2Vec2Config</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.33.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.33.0/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L1604"}}),zr=new F({props:{name:"forward",anchor:"transformers.Wav2Vec2ForPreTraining.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.BoolTensor] = None"},{name:"sampled_negative_indices",val:": typing.Optional[torch.BoolTensor] = 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.Wav2Vec2ForPreTraining.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.33.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.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.Wav2Vec2ForPreTraining.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></p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/wav2vec2-base-960h" rel="nofollow">wav2vec2-base</a>, <code>attention_mask</code> should <strong>not</strong> be
passed to avoid degraded performance when doing batched inference. For such models <code>input_values</code> should
simply be padded with 0 and passed without <code>attention_mask</code>. Be aware that these models also yield slightly
different results depending on whether <code>input_values</code> is padded or not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.Wav2Vec2ForPreTraining.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.Wav2Vec2ForPreTraining.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.Wav2Vec2ForPreTraining.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Wav2Vec2ForPreTraining.forward.mask_time_indices",description:`<strong>mask_time_indices</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices to mask extracted features for contrastive loss. When in training mode, model learns to predict
masked extracted features in <em>config.proj_codevector_dim</em> space.`,name:"mask_time_indices"},{anchor:"transformers.Wav2Vec2ForPreTraining.forward.sampled_negative_indices",description:`<strong>sampled_negative_indices</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, sequence_length, num_negatives)</code>, <em>optional</em>) &#x2014;
Indices indicating which quantized target vectors are used as negative sampled vectors in contrastive loss.
Required input for pre-training.`,name:"sampled_negative_indices"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L1664",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForPreTrainingOutput"
>transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForPreTrainingOutput</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.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Config"
>Wav2Vec2Config</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<em>optional</em>, returned when <code>sample_negative_indices</code> are passed, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) \u2014 Total loss as the sum of the contrastive loss (L_m) and the diversity loss (L_d) as stated in the <a
  href="https://arxiv.org/pdf/2006.11477.pdf"
  rel="nofollow"
>official
paper</a> . (classification) loss.</p>
</li>
<li>
<p><strong>projected_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.proj_codevector_dim)</code>) \u2014 Hidden-states of the model projected to <em>config.proj_codevector_dim</em> that can be used to predict the masked
projected quantized states.</p>
</li>
<li>
<p><strong>projected_quantized_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.proj_codevector_dim)</code>) \u2014 Quantized extracted feature vectors projected to <em>config.proj_codevector_dim</em> representing the positive
target vectors for contrastive loss.</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 + 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 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>
<li>
<p><strong>contrastive_loss</strong> (<em>optional</em>, returned when <code>sample_negative_indices</code> are passed, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) \u2014 The contrastive loss (L_m) as stated in the <a
  href="https://arxiv.org/pdf/2006.11477.pdf"
  rel="nofollow"
>official paper</a> .</p>
</li>
<li>
<p><strong>diversity_loss</strong> (<em>optional</em>, returned when <code>sample_negative_indices</code> are passed, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) \u2014 The diversity loss (L_d) as stated in the <a
  href="https://arxiv.org/pdf/2006.11477.pdf"
  rel="nofollow"
>official paper</a> .</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForPreTrainingOutput"
>transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Xa=new we({props:{$$slots:{default:[lk]},$$scope:{ctx:W}}}),Ga=new Xe({props:{anchor:"transformers.Wav2Vec2ForPreTraining.forward.example",$$slots:{default:[ik]},$$scope:{ctx:W}}}),Br=new L({}),Nr=new F({props:{name:"class transformers.TFWav2Vec2Model",anchor:"transformers.TFWav2Vec2Model",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFWav2Vec2Model.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Config">Wav2Vec2Config</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.33.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.33.0/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py#L1353"}}),Aa=new we({props:{$$slots:{default:[ck]},$$scope:{ctx:W}}}),Ar=new F({props:{name:"call",anchor:"transformers.TFWav2Vec2Model.call",parameters:[{name:"input_values",val:": tf.Tensor"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"token_type_ids",val:": tf.Tensor | None = None"},{name:"position_ids",val:": tf.Tensor | None = None"},{name:"head_mask",val:": tf.Tensor | None = None"},{name:"inputs_embeds",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFWav2Vec2Model.call.input_values",description:`<strong>input_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> <code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_values"},{anchor:"transformers.TFWav2Vec2Model.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Mask to avoid performing 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.TFWav2Vec2Model.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFWav2Vec2Model.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFWav2Vec2Model.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFWav2Vec2Model.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>({0}, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_values</code> you can choose to directly pass an embedded representation.
This is useful if you want more control over how to convert <code>input_values</code> indices into associated vectors
than the model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFWav2Vec2Model.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFWav2Vec2Model.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFWav2Vec2Model.call.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFWav2Vec2Model.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py#L1359",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutput"
>transformers.modeling_tf_outputs.TFBaseModelOutput</a> or a tuple of <code>tf.Tensor</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.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Config"
>Wav2Vec2Config</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</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(tf.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>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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.33.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutput"
>transformers.modeling_tf_outputs.TFBaseModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),qa=new we({props:{$$slots:{default:[dk]},$$scope:{ctx:W}}}),Ya=new Xe({props:{anchor:"transformers.TFWav2Vec2Model.call.example",$$slots:{default:[pk]},$$scope:{ctx:W}}}),qr=new L({}),Yr=new F({props:{name:"class transformers.TFWav2Vec2ForSequenceClassification",anchor:"transformers.TFWav2Vec2ForSequenceClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py#L1576"}}),Pr=new F({props:{name:"call",anchor:"transformers.TFWav2Vec2ForSequenceClassification.call",parameters:[{name:"input_values",val:": tf.Tensor"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": bool | None = None"},{name:"output_hidden_states",val:": bool | None = None"},{name:"return_dict",val:": bool | None = None"},{name:"labels",val:": tf.Tensor | None = None"},{name:"training",val:": bool = False"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py#L1617"}}),Sr=new L({}),Qr=new F({props:{name:"class transformers.TFWav2Vec2ForCTC",anchor:"transformers.TFWav2Vec2ForCTC",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFWav2Vec2ForCTC.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Config">Wav2Vec2Config</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.33.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.33.0/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py#L1427"}}),Qa=new we({props:{$$slots:{default:[mk]},$$scope:{ctx:W}}}),Kr=new F({props:{name:"call",anchor:"transformers.TFWav2Vec2ForCTC.call",parameters:[{name:"input_values",val:": tf.Tensor"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"token_type_ids",val:": tf.Tensor | None = None"},{name:"position_ids",val:": tf.Tensor | None = None"},{name:"head_mask",val:": tf.Tensor | None = None"},{name:"inputs_embeds",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"labels",val:": tf.Tensor | None = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFWav2Vec2ForCTC.call.input_values",description:`<strong>input_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> <code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_values"},{anchor:"transformers.TFWav2Vec2ForCTC.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Mask to avoid performing 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.TFWav2Vec2ForCTC.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFWav2Vec2ForCTC.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFWav2Vec2ForCTC.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFWav2Vec2ForCTC.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>({0}, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_values</code> you can choose to directly pass an embedded representation.
This is useful if you want more control over how to convert <code>input_values</code> indices into associated vectors
than the model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFWav2Vec2ForCTC.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFWav2Vec2ForCTC.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFWav2Vec2ForCTC.call.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.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFWav2Vec2ForCTC.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFWav2Vec2ForCTC.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> or <code>np.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_values</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked),
the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py#L1454",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutput"
>transformers.modeling_tf_outputs.TFCausalLMOutput</a> or a tuple of <code>tf.Tensor</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.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Config"
>Wav2Vec2Config</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</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(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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.33.0/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutput"
>transformers.modeling_tf_outputs.TFCausalLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),La=new we({props:{$$slots:{default:[hk]},$$scope:{ctx:W}}}),Ha=new Xe({props:{anchor:"transformers.TFWav2Vec2ForCTC.call.example",$$slots:{default:[fk]},$$scope:{ctx:W}}}),el=new L({}),tl=new F({props:{name:"class transformers.FlaxWav2Vec2Model",anchor:"transformers.FlaxWav2Vec2Model",parameters:[{name:"config",val:": Wav2Vec2Config"},{name:"input_shape",val:": typing.Tuple = (1, 1024)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxWav2Vec2Model.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Config">Wav2Vec2Config</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.33.0/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxWav2Vec2Model.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L1055"}}),pl=new F({props:{name:"__call__",anchor:"transformers.FlaxWav2Vec2Model.__call__",parameters:[{name:"input_values",val:""},{name:"attention_mask",val:" = None"},{name:"mask_time_indices",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"freeze_feature_encoder",val:": bool = False"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FlaxWav2Vec2Model.__call__.input_values",description:`<strong>input_values</strong> (<code>jnp.ndarray</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.33.0/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>jnp.ndarray</code>. See <a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.FlaxWav2Vec2Model.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</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> .. warning:: <code>attention_mask</code> should only be passed
if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor
has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/wav2vec2-base-960h" rel="nofollow">wav2vec2-base</a>, <code>attention_mask</code> should <strong>not</strong> be
passed to avoid degraded performance when doing batched inference. For such models <code>input_values</code> should
simply be padded with 0 and passed without <code>attention_mask</code>. Be aware that these models also yield slightly
different results depending on whether <code>input_values</code> is padded or not.`,name:"attention_mask"},{anchor:"transformers.FlaxWav2Vec2Model.__call__.mask_time_indices",description:`<strong>mask_time_indices</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices to mask extracted features for contrastive loss. When in training mode, model learns to predict
masked extracted features in <em>config.proj_codevector_dim</em> space.`,name:"mask_time_indices"},{anchor:"transformers.FlaxWav2Vec2Model.__call__.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.FlaxWav2Vec2Model.__call__.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.FlaxWav2Vec2Model.__call__.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.33.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.33.0/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L888",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2BaseModelOutput"
>transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2BaseModelOutput</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 (<code>&lt;class 'transformers.models.wav2vec2.configuration_wav2vec2.Wav2Vec2Config'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</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>extract_features</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, last_conv_dim)</code>) \u2014 Sequence of extracted feature vectors of the last convolutional layer of the model with <code>last_conv_dim</code>
being the dimension of the last convolutional layer.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</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.33.0/en/model_doc/wav2vec2#transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2BaseModelOutput"
>transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Oa=new we({props:{$$slots:{default:[uk]},$$scope:{ctx:W}}}),Ka=new Xe({props:{anchor:"transformers.FlaxWav2Vec2Model.__call__.example",$$slots:{default:[gk]},$$scope:{ctx:W}}}),ml=new L({}),hl=new F({props:{name:"class transformers.FlaxWav2Vec2ForCTC",anchor:"transformers.FlaxWav2Vec2ForCTC",parameters:[{name:"config",val:": Wav2Vec2Config"},{name:"input_shape",val:": typing.Tuple = (1, 1024)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxWav2Vec2ForCTC.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Config">Wav2Vec2Config</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.33.0/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxWav2Vec2ForCTC.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L1173"}}),Tl=new F({props:{name:"__call__",anchor:"transformers.FlaxWav2Vec2ForCTC.__call__",parameters:[{name:"input_values",val:""},{name:"attention_mask",val:" = None"},{name:"mask_time_indices",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"freeze_feature_encoder",val:": bool = False"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FlaxWav2Vec2ForCTC.__call__.input_values",description:`<strong>input_values</strong> (<code>jnp.ndarray</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.33.0/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>jnp.ndarray</code>. See <a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.FlaxWav2Vec2ForCTC.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</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> .. warning:: <code>attention_mask</code> should only be passed
if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor
has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/wav2vec2-base-960h" rel="nofollow">wav2vec2-base</a>, <code>attention_mask</code> should <strong>not</strong> be
passed to avoid degraded performance when doing batched inference. For such models <code>input_values</code> should
simply be padded with 0 and passed without <code>attention_mask</code>. Be aware that these models also yield slightly
different results depending on whether <code>input_values</code> is padded or not.`,name:"attention_mask"},{anchor:"transformers.FlaxWav2Vec2ForCTC.__call__.mask_time_indices",description:`<strong>mask_time_indices</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices to mask extracted features for contrastive loss. When in training mode, model learns to predict
masked extracted features in <em>config.proj_codevector_dim</em> space.`,name:"mask_time_indices"},{anchor:"transformers.FlaxWav2Vec2ForCTC.__call__.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.FlaxWav2Vec2ForCTC.__call__.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.FlaxWav2Vec2ForCTC.__call__.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.33.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.33.0/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L888",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</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 (<code>&lt;class 'transformers.models.wav2vec2.configuration_wav2vec2.Wav2Vec2Config'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</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(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</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.33.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ts=new we({props:{$$slots:{default:[_k]},$$scope:{ctx:W}}}),os=new Xe({props:{anchor:"transformers.FlaxWav2Vec2ForCTC.__call__.example",$$slots:{default:[vk]},$$scope:{ctx:W}}}),Ml=new L({}),jl=new F({props:{name:"class transformers.FlaxWav2Vec2ForPreTraining",anchor:"transformers.FlaxWav2Vec2ForPreTraining",parameters:[{name:"config",val:": Wav2Vec2Config"},{name:"input_shape",val:": typing.Tuple = (1, 1024)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxWav2Vec2ForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Config">Wav2Vec2Config</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.33.0/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxWav2Vec2ForPreTraining.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L1319"}}),Ul=new F({props:{name:"__call__",anchor:"transformers.FlaxWav2Vec2ForPreTraining.__call__",parameters:[{name:"input_values",val:""},{name:"attention_mask",val:" = None"},{name:"mask_time_indices",val:" = None"},{name:"gumbel_temperature",val:": int = 1"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"gumbel_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"freeze_feature_encoder",val:": bool = False"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FlaxWav2Vec2ForPreTraining.__call__.input_values",description:`<strong>input_values</strong> (<code>jnp.ndarray</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.33.0/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>jnp.ndarray</code>. See <a href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.FlaxWav2Vec2ForPreTraining.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</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> .. warning:: <code>attention_mask</code> should only be passed
if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor
has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/wav2vec2-base-960h" rel="nofollow">wav2vec2-base</a>, <code>attention_mask</code> should <strong>not</strong> be
passed to avoid degraded performance when doing batched inference. For such models <code>input_values</code> should
simply be padded with 0 and passed without <code>attention_mask</code>. Be aware that these models also yield slightly
different results depending on whether <code>input_values</code> is padded or not.`,name:"attention_mask"},{anchor:"transformers.FlaxWav2Vec2ForPreTraining.__call__.mask_time_indices",description:`<strong>mask_time_indices</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices to mask extracted features for contrastive loss. When in training mode, model learns to predict
masked extracted features in <em>config.proj_codevector_dim</em> space.`,name:"mask_time_indices"},{anchor:"transformers.FlaxWav2Vec2ForPreTraining.__call__.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.FlaxWav2Vec2ForPreTraining.__call__.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.FlaxWav2Vec2ForPreTraining.__call__.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.33.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.33.0/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L1322",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2ForPreTrainingOutput"
>transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2ForPreTrainingOutput</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 (<code>&lt;class 'transformers.models.wav2vec2.configuration_wav2vec2.Wav2Vec2Config'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<em>optional</em>, returned when model is in train mode, <code>jnp.ndarray</code> of shape <code>(1,)</code>) \u2014 Total loss as the sum of the contrastive loss (L_m) and the diversity loss (L_d) as stated in the <a
  href="https://arxiv.org/pdf/2006.11477.pdf"
  rel="nofollow"
>official
paper</a> . (classification) loss.</p>
</li>
<li>
<p><strong>projected_states</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.proj_codevector_dim)</code>) \u2014 Hidden-states of the model projected to <em>config.proj_codevector_dim</em> that can be used to predict the masked
projected quantized states.</p>
</li>
<li>
<p><strong>projected_quantized_states</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.proj_codevector_dim)</code>) \u2014 Quantized extracted feature vectors projected to <em>config.proj_codevector_dim</em> representing the positive
target vectors for contrastive loss.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</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.33.0/en/model_doc/wav2vec2#transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2ForPreTrainingOutput"
>transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2ForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ss=new we({props:{$$slots:{default:[bk]},$$scope:{ctx:W}}}),ns=new Xe({props:{anchor:"transformers.FlaxWav2Vec2ForPreTraining.__call__.example",$$slots:{default:[yk]},$$scope:{ctx:W}}}),{c(){m=a("meta"),b=d(),u=a("h1"),f=a("a"),v=a("span"),y(i.$$.fragment),h=d(),J=a("span"),I=n("Wav2Vec2"),z=d(),E=a("h2"),Z=a("a"),R=a("span"),y(x.$$.fragment),B=d(),$=a("span"),ce=n("Overview"),H=d(),X=a("p"),de=n("The Wav2Vec2 model was proposed in "),G=a("a"),q=n("wav2vec 2.0: A Framework for Self-Supervised Learning of Speech Representations"),Re=n(" by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael Auli."),S=d(),D=a("p"),Ae=n("The abstract from the paper is the following:"),xe=d(),O=a("p"),Le=a("em"),Vt=n(`We show for the first time that learning powerful representations from speech audio alone followed by fine-tuning on
transcribed speech can outperform the best semi-supervised methods while being conceptually simpler. wav2vec 2.0 masks
the speech input in the latent space and solves a contrastive task defined over a quantization of the latent
representations which are jointly learned. Experiments using all labeled data of Librispeech achieve 1.8/3.3 WER on the
clean/other test sets. When lowering the amount of labeled data to one hour, wav2vec 2.0 outperforms the previous state
of the art on the 100 hour subset while using 100 times less labeled data. Using just ten minutes of labeled data and
pre-training on 53k hours of unlabeled data still achieves 4.8/8.2 WER. This demonstrates the feasibility of speech
recognition with limited amounts of labeled data.`),qe=d(),N=a("p"),K=n("Tips:"),tt=d(),se=a("ul"),He=a("li"),Jt=n("Wav2Vec2 is a speech model that accepts a float array corresponding to the raw waveform of the speech signal."),$e=d(),Ce=a("li"),Ft=n(`Wav2Vec2 model was trained using connectionist temporal classification (CTC) so the model output has to be decoded
using `),Y=a("a"),xt=n("Wav2Vec2CTCTokenizer"),Ue=n("."),ot=d(),Te=a("p"),Ee=n("This model was contributed by "),Ze=a("a"),$t=n("patrickvonplaten"),he=n("."),at=d(),ee=a("h2"),Me=a("a"),Ie=a("span"),y(A.$$.fragment),Ct=d(),te=a("span"),Ut=n("Resources"),st=d(),V=a("p"),C=n("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with Wav2Vec2. If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),qt=d(),y(fe.$$.fragment),Yt=d(),je=a("ul"),U=a("li"),Kt=n("A notebook on how to "),De=a("a"),eo=n("leverage a pretrained Wav2Vec2 model for emotion classification"),to=n(". \u{1F30E}"),oo=d(),P=a("li"),pe=a("a"),ao=n("Wav2Vec2ForCTC"),so=n(" is supported by this "),ne=a("a"),no=n("example script"),ro=n(" and "),ze=a("a"),lo=n("notebook"),Oe=n("."),io=d(),ic=a("li"),Al=a("a"),Lh=n("Audio classification task guide"),Fp=d(),y(Fs.$$.fragment),xp=d(),ke=a("ul"),xs=a("li"),Hh=n("A blog post on "),$s=a("a"),Dh=n("boosting Wav2Vec2 with n-grams in \u{1F917} Transformers"),Oh=n("."),Kh=d(),Cs=a("li"),ef=n("A blog post on how to "),Us=a("a"),tf=n("finetune Wav2Vec2 for English ASR with \u{1F917} Transformers"),of=n("."),af=d(),Es=a("li"),sf=n("A blog post on "),Zs=a("a"),nf=n("finetuning XLS-R for Multi-Lingual ASR with \u{1F917} Transformers"),rf=n("."),lf=d(),Is=a("li"),cf=n("A notebook on how to "),zs=a("a"),df=n("create YouTube captions from any video by transcribing audio with Wav2Vec2"),pf=n(". \u{1F30E}"),mf=d(),Pt=a("li"),ql=a("a"),hf=n("Wav2Vec2ForCTC"),ff=n(" is supported by a notebook on "),Bs=a("a"),uf=n("how to finetune a speech recognition model in English"),gf=n(", and "),Ns=a("a"),_f=n("how to finetune a speech recognition model in any language"),vf=n("."),bf=d(),cc=a("li"),Yl=a("a"),yf=n("Automatic speech recognition task guide"),$p=d(),Pl=a("p"),wf=n("\u{1F680} Deploy"),Cp=d(),Sl=a("ul"),Xs=a("li"),Tf=n("A blog post on how to deploy Wav2Vec2 for "),Gs=a("a"),Mf=n("Automatic Speech Recogntion with Hugging Face\u2019s Transformers & Amazon SageMaker"),jf=n("."),Up=d(),co=a("h2"),Do=a("a"),dc=a("span"),y(Rs.$$.fragment),kf=d(),pc=a("span"),Wf=n("Wav2Vec2Config"),Ep=d(),Ke=a("div"),y(As.$$.fragment),Vf=d(),po=a("p"),Jf=n("This is the configuration class to store the configuration of a "),Ql=a("a"),Ff=n("Wav2Vec2Model"),xf=n(`. It is used to instantiate an
Wav2Vec2 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 Wav2Vec2
`),qs=a("a"),$f=n("facebook/wav2vec2-base-960h"),Cf=n(" architecture."),Uf=d(),mo=a("p"),Ef=n("Configuration objects inherit from "),Ll=a("a"),Zf=n("PretrainedConfig"),If=n(` and can be used to control the model outputs. Read the
documentation from `),Hl=a("a"),zf=n("PretrainedConfig"),Bf=n(" for more information."),Nf=d(),y(Oo.$$.fragment),Zp=d(),ho=a("h2"),Ko=a("a"),mc=a("span"),y(Ys.$$.fragment),Xf=d(),hc=a("span"),Gf=n("Wav2Vec2CTCTokenizer"),Ip=d(),oe=a("div"),y(Ps.$$.fragment),Rf=d(),fc=a("p"),Af=n("Constructs a Wav2Vec2CTC tokenizer."),qf=d(),Ss=a("p"),Yf=n("This tokenizer inherits from "),Dl=a("a"),Pf=n("PreTrainedTokenizer"),Sf=n(` which contains some of the main methods. Users should refer to
the superclass for more information regarding such methods.`),Qf=d(),ea=a("div"),y(Qs.$$.fragment),Lf=d(),uc=a("p"),Hf=n(`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),Df=d(),Ol=a("div"),y(Ls.$$.fragment),Of=d(),nt=a("div"),y(Hs.$$.fragment),Kf=d(),gc=a("p"),eu=n(`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),tu=d(),Ds=a("p"),ou=n("Similar to doing "),_c=a("code"),au=n("self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),su=n("."),nu=d(),y(ta.$$.fragment),ru=d(),oa=a("div"),y(Os.$$.fragment),lu=d(),vc=a("p"),iu=n("Convert a list of lists of token ids into a list of strings by calling decode."),cu=d(),aa=a("div"),y(Ks.$$.fragment),du=d(),bc=a("p"),pu=n("Set the target language of a nested multi-lingual dictionary"),zp=d(),fo=a("h2"),sa=a("a"),yc=a("span"),y(en.$$.fragment),mu=d(),wc=a("span"),hu=n("Wav2Vec2FeatureExtractor"),Bp=d(),et=a("div"),y(tn.$$.fragment),fu=d(),Tc=a("p"),uu=n("Constructs a Wav2Vec2 feature extractor."),gu=d(),on=a("p"),_u=n("This feature extractor inherits from "),Kl=a("a"),vu=n("SequenceFeatureExtractor"),bu=n(` which contains
most of the main methods. Users should refer to this superclass for more information regarding those methods.`),yu=d(),na=a("div"),y(an.$$.fragment),wu=d(),Mc=a("p"),Tu=n("Main method to featurize and prepare for the model one or several sequence(s)."),Np=d(),uo=a("h2"),ra=a("a"),jc=a("span"),y(sn.$$.fragment),Mu=d(),kc=a("span"),ju=n("Wav2Vec2Processor"),Xp=d(),Q=a("div"),y(nn.$$.fragment),ku=d(),Wc=a("p"),Wu=n(`Constructs a Wav2Vec2 processor which wraps a Wav2Vec2 feature extractor and a Wav2Vec2 CTC tokenizer into a single
processor.`),Vu=d(),Ye=a("p"),ei=a("a"),Ju=n("Wav2Vec2Processor"),Fu=n(" offers all the functionalities of "),ti=a("a"),xu=n("Wav2Vec2FeatureExtractor"),$u=n(" and "),oi=a("a"),Cu=n("PreTrainedTokenizer"),Uu=n(`.
See the docstring of `),rn=a("a"),Vc=a("strong"),Eu=n("call"),Zu=n("()"),Iu=n(" and "),ai=a("a"),zu=n("decode()"),Bu=n(" for more information."),Nu=d(),la=a("div"),y(ln.$$.fragment),Xu=d(),Et=a("p"),Gu=n(`When used in normal mode, this method forwards all its arguments to Wav2Vec2FeatureExtractor\u2019s
`),cn=a("a"),Jc=a("strong"),Ru=n("call"),Au=n("()"),qu=n(` and returns its output. If used in the context
`),Fc=a("code"),Yu=n("as_target_processor()"),Pu=n(` this method forwards all its arguments to PreTrainedTokenizer\u2019s
`),dn=a("a"),xc=a("strong"),Su=n("call"),Qu=n("()"),Lu=n(". Please refer to the docstring of the above two methods for more information."),Hu=d(),ia=a("div"),y(pn.$$.fragment),Du=d(),Zt=a("p"),Ou=n(`When used in normal mode, this method forwards all its arguments to Wav2Vec2FeatureExtractor\u2019s
`),si=a("a"),Ku=n("pad()"),eg=n(` and returns its output. If used in the context
`),$c=a("code"),tg=n("as_target_processor()"),og=n(` this method forwards all its arguments to PreTrainedTokenizer\u2019s
`),ni=a("a"),ag=n("pad()"),sg=n(". Please refer to the docstring of the above two methods for more information."),ng=d(),ri=a("div"),y(mn.$$.fragment),rg=d(),St=a("div"),y(hn.$$.fragment),lg=d(),fn=a("p"),ig=n(`Saves the attributes of this processor (feature extractor, tokenizer\u2026) in the specified directory so that it
can be reloaded using the `),li=a("a"),cg=n("from_pretrained()"),dg=n(" method."),pg=d(),y(ca.$$.fragment),mg=d(),da=a("div"),y(un.$$.fragment),hg=d(),gn=a("p"),fg=n("This method forwards all its arguments to PreTrainedTokenizer\u2019s "),ii=a("a"),ug=n("batch_decode()"),gg=n(`. Please
refer to the docstring of this method for more information.`),_g=d(),pa=a("div"),y(_n.$$.fragment),vg=d(),vn=a("p"),bg=n("This method forwards all its arguments to PreTrainedTokenizer\u2019s "),ci=a("a"),yg=n("decode()"),wg=n(`. Please refer
to the docstring of this method for more information.`),Gp=d(),go=a("h2"),ma=a("a"),Cc=a("span"),y(bn.$$.fragment),Tg=d(),Uc=a("span"),Mg=n("Wav2Vec2ProcessorWithLM"),Rp=d(),ae=a("div"),y(yn.$$.fragment),jg=d(),Ec=a("p"),kg=n(`Constructs a Wav2Vec2 processor which wraps a Wav2Vec2 feature extractor, a Wav2Vec2 CTC tokenizer and a decoder
with language model support into a single processor for language model boosted speech recognition decoding.`),Wg=d(),ha=a("div"),y(wn.$$.fragment),Vg=d(),It=a("p"),Jg=n(`When used in normal mode, this method forwards all its arguments to Wav2Vec2FeatureExtractor\u2019s
`),Tn=a("a"),Zc=a("strong"),Fg=n("call"),xg=n("()"),$g=n(` and returns its output. If used in the context
`),Ic=a("code"),Cg=n("as_target_processor()"),Ug=n(` this method forwards all its arguments to
Wav2Vec2CTCTokenizer\u2019s `),Mn=a("a"),zc=a("strong"),Eg=n("call"),Zg=n("()"),Ig=n(`. Please refer to the docstring of the above two
methods for more information.`),zg=d(),fa=a("div"),y(jn.$$.fragment),Bg=d(),zt=a("p"),Ng=n(`When used in normal mode, this method forwards all its arguments to Wav2Vec2FeatureExtractor\u2019s
`),di=a("a"),Xg=n("pad()"),Gg=n(` and returns its output. If used in the context
`),Bc=a("code"),Rg=n("as_target_processor()"),Ag=n(` this method forwards all its arguments to
Wav2Vec2CTCTokenizer\u2019s `),pi=a("a"),qg=n("pad()"),Yg=n(`. Please refer to the docstring of the above two methods
for more information.`),Pg=d(),Qt=a("div"),y(kn.$$.fragment),Sg=d(),Wn=a("p"),Qg=n("Instantiate a "),mi=a("a"),Lg=n("Wav2Vec2ProcessorWithLM"),Hg=n(" from a pretrained Wav2Vec2 processor."),Dg=d(),y(ua.$$.fragment),Og=d(),hi=a("div"),y(Vn.$$.fragment),Kg=d(),rt=a("div"),y(Jn.$$.fragment),e_=d(),Nc=a("p"),t_=n("Batch decode output logits to audio transcription with language model support."),o_=d(),y(ga.$$.fragment),a_=d(),Fn=a("p"),s_=n(`Example:
See `),fi=a("a"),n_=n("Decoding multiple audios"),r_=n("."),l_=d(),Lt=a("div"),y(xn.$$.fragment),i_=d(),Xc=a("p"),c_=n("Decode output logits to audio transcription with language model support."),d_=d(),y(_a.$$.fragment),Ap=d(),_o=a("h3"),va=a("a"),Gc=a("span"),y($n.$$.fragment),p_=d(),Rc=a("span"),m_=n("Decoding multiple audios"),qp=d(),We=a("p"),h_=n("If you are planning to decode multiple batches of audios, you should consider using "),ui=a("a"),f_=n("batch_decode()"),u_=n(" and passing an instantiated "),Ac=a("code"),g_=n("multiprocessing.Pool"),__=n(`.
Otherwise, `),gi=a("a"),v_=n("batch_decode()"),b_=n(" performance will be slower than calling "),_i=a("a"),y_=n("decode()"),w_=n(" for each audio individually, as it internally instantiates a new "),qc=a("code"),T_=n("Pool"),M_=n(" for every call. See the example below:"),Yp=d(),y(Cn.$$.fragment),Pp=d(),vo=a("h2"),ba=a("a"),Yc=a("span"),y(Un.$$.fragment),j_=d(),Pc=a("span"),k_=n("Wav2Vec2 specific outputs"),Sp=d(),bo=a("div"),y(En.$$.fragment),W_=d(),Zn=a("p"),V_=n("Output type of "),Sc=a("code"),J_=n("Wav2Vec2DecoderWithLM"),F_=n(", with transcription."),Qp=d(),yo=a("div"),y(In.$$.fragment),x_=d(),Qc=a("p"),$_=n("Base class for models that have been trained with the Wav2Vec2 loss objective."),Lp=d(),wo=a("div"),y(zn.$$.fragment),C_=d(),Bn=a("p"),U_=n("Output type of "),vi=a("a"),E_=n("Wav2Vec2ForPreTraining"),Z_=n(", with potential hidden states and attentions."),Hp=d(),Bt=a("div"),y(Nn.$$.fragment),I_=d(),Xn=a("p"),z_=n("Output type of "),Lc=a("code"),B_=n("FlaxWav2Vec2BaseModelOutput"),N_=n(", with potential hidden states and attentions."),X_=d(),ya=a("div"),y(Gn.$$.fragment),G_=d(),Hc=a("p"),R_=n("\u201CReturns a new object replacing the specified fields with new values."),Dp=d(),Nt=a("div"),y(Rn.$$.fragment),A_=d(),An=a("p"),q_=n("Output type of "),Dc=a("code"),Y_=n("FlaxWav2Vec2ForPreTrainingOutput"),P_=n(", with potential hidden states and attentions."),S_=d(),wa=a("div"),y(qn.$$.fragment),Q_=d(),Oc=a("p"),L_=n("\u201CReturns a new object replacing the specified fields with new values."),Op=d(),To=a("h2"),Ta=a("a"),Kc=a("span"),y(Yn.$$.fragment),H_=d(),ed=a("span"),D_=n("Wav2Vec2Model"),Kp=d(),Be=a("div"),y(Pn.$$.fragment),O_=d(),Sn=a("p"),K_=n(`The bare Wav2Vec2 Model transformer outputting raw hidden-states without any specific head on top.
Wav2Vec2 was proposed in `),Qn=a("a"),ev=n(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),tv=n(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),ov=d(),Ln=a("p"),av=n("This model inherits from "),bi=a("a"),sv=n("PreTrainedModel"),nv=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),rv=d(),Hn=a("p"),lv=n("This model is a PyTorch "),Dn=a("a"),iv=n("torch.nn.Module"),cv=n(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),dv=d(),lt=a("div"),y(On.$$.fragment),pv=d(),Mo=a("p"),mv=n("The "),yi=a("a"),hv=n("Wav2Vec2Model"),fv=n(" forward method, overrides the "),td=a("code"),uv=n("__call__"),gv=n(" special method."),_v=d(),y(Ma.$$.fragment),vv=d(),y(ja.$$.fragment),em=d(),jo=a("h2"),ka=a("a"),od=a("span"),y(Kn.$$.fragment),bv=d(),ad=a("span"),yv=n("Wav2Vec2ForCTC"),tm=d(),ue=a("div"),y(er.$$.fragment),wv=d(),ko=a("p"),Tv=n("Wav2Vec2 Model with a "),sd=a("code"),Mv=n("language modeling"),jv=n(` head on top for Connectionist Temporal Classification (CTC).
Wav2Vec2 was proposed in `),tr=a("a"),kv=n(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),Wv=n(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Vv=d(),or=a("p"),Jv=n("This model inherits from "),wi=a("a"),Fv=n("PreTrainedModel"),xv=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),$v=d(),ar=a("p"),Cv=n("This model is a PyTorch "),sr=a("a"),Uv=n("torch.nn.Module"),Ev=n(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Zv=d(),it=a("div"),y(nr.$$.fragment),Iv=d(),Wo=a("p"),zv=n("The "),Ti=a("a"),Bv=n("Wav2Vec2ForCTC"),Nv=n(" forward method, overrides the "),nd=a("code"),Xv=n("__call__"),Gv=n(" special method."),Rv=d(),y(Wa.$$.fragment),Av=d(),y(Va.$$.fragment),qv=d(),ct=a("div"),y(rr.$$.fragment),Yv=d(),rd=a("p"),Pv=n("Load a language adapter model from a pre-trained adapter model."),Sv=d(),y(Ja.$$.fragment),Qv=d(),y(Fa.$$.fragment),om=d(),Vo=a("h2"),xa=a("a"),ld=a("span"),y(lr.$$.fragment),Lv=d(),id=a("span"),Hv=n("Wav2Vec2ForSequenceClassification"),am=d(),ge=a("div"),y(ir.$$.fragment),Dv=d(),cd=a("p"),Ov=n(`Wav2Vec2 Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like
SUPERB Keyword Spotting.`),Kv=d(),cr=a("p"),e2=n("Wav2Vec2 was proposed in "),dr=a("a"),t2=n(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),o2=n(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),a2=d(),pr=a("p"),s2=n("This model inherits from "),Mi=a("a"),n2=n("PreTrainedModel"),r2=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),l2=d(),mr=a("p"),i2=n("This model is a PyTorch "),hr=a("a"),c2=n("torch.nn.Module"),d2=n(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),p2=d(),dt=a("div"),y(fr.$$.fragment),m2=d(),Jo=a("p"),h2=n("The "),ji=a("a"),f2=n("Wav2Vec2ForSequenceClassification"),u2=n(" forward method, overrides the "),dd=a("code"),g2=n("__call__"),_2=n(" special method."),v2=d(),y($a.$$.fragment),b2=d(),y(Ca.$$.fragment),sm=d(),Fo=a("h2"),Ua=a("a"),pd=a("span"),y(ur.$$.fragment),y2=d(),md=a("span"),w2=n("Wav2Vec2ForAudioFrameClassification"),nm=d(),_e=a("div"),y(gr.$$.fragment),T2=d(),hd=a("p"),M2=n("Wav2Vec2 Model with a frame classification head on top for tasks like Speaker Diarization."),j2=d(),_r=a("p"),k2=n("Wav2Vec2 was proposed in "),vr=a("a"),W2=n(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),V2=n(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),J2=d(),br=a("p"),F2=n("This model inherits from "),ki=a("a"),x2=n("PreTrainedModel"),$2=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),C2=d(),yr=a("p"),U2=n("This model is a PyTorch "),wr=a("a"),E2=n("torch.nn.Module"),Z2=n(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),I2=d(),pt=a("div"),y(Tr.$$.fragment),z2=d(),xo=a("p"),B2=n("The "),Wi=a("a"),N2=n("Wav2Vec2ForAudioFrameClassification"),X2=n(" forward method, overrides the "),fd=a("code"),G2=n("__call__"),R2=n(" special method."),A2=d(),y(Ea.$$.fragment),q2=d(),y(Za.$$.fragment),rm=d(),$o=a("h2"),Ia=a("a"),ud=a("span"),y(Mr.$$.fragment),Y2=d(),gd=a("span"),P2=n("Wav2Vec2ForXVector"),lm=d(),ve=a("div"),y(jr.$$.fragment),S2=d(),_d=a("p"),Q2=n("Wav2Vec2 Model with an XVector feature extraction head on top for tasks like Speaker Verification."),L2=d(),kr=a("p"),H2=n("Wav2Vec2 was proposed in "),Wr=a("a"),D2=n(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),O2=n(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),K2=d(),Vr=a("p"),eb=n("This model inherits from "),Vi=a("a"),tb=n("PreTrainedModel"),ob=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),ab=d(),Jr=a("p"),sb=n("This model is a PyTorch "),Fr=a("a"),nb=n("torch.nn.Module"),rb=n(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),lb=d(),mt=a("div"),y(xr.$$.fragment),ib=d(),Co=a("p"),cb=n("The "),Ji=a("a"),db=n("Wav2Vec2ForXVector"),pb=n(" forward method, overrides the "),vd=a("code"),mb=n("__call__"),hb=n(" special method."),fb=d(),y(za.$$.fragment),ub=d(),y(Ba.$$.fragment),im=d(),Uo=a("h2"),Na=a("a"),bd=a("span"),y($r.$$.fragment),gb=d(),yd=a("span"),_b=n("Wav2Vec2ForPreTraining"),cm=d(),Ne=a("div"),y(Cr.$$.fragment),vb=d(),Eo=a("p"),bb=n("Wav2Vec2 Model with a quantizer and "),wd=a("code"),yb=n("VQ"),wb=n(` head on top.
Wav2Vec2 was proposed in `),Ur=a("a"),Tb=n(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),Mb=n(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),jb=d(),Er=a("p"),kb=n("This model inherits from "),Fi=a("a"),Wb=n("PreTrainedModel"),Vb=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Jb=d(),Zr=a("p"),Fb=n("This model is a PyTorch "),Ir=a("a"),xb=n("torch.nn.Module"),$b=n(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Cb=d(),ht=a("div"),y(zr.$$.fragment),Ub=d(),Zo=a("p"),Eb=n("The "),xi=a("a"),Zb=n("Wav2Vec2ForPreTraining"),Ib=n(" forward method, overrides the "),Td=a("code"),zb=n("__call__"),Bb=n(" special method."),Nb=d(),y(Xa.$$.fragment),Xb=d(),y(Ga.$$.fragment),dm=d(),Io=a("h2"),Ra=a("a"),Md=a("span"),y(Br.$$.fragment),Gb=d(),jd=a("span"),Rb=n("TFWav2Vec2Model"),pm=d(),be=a("div"),y(Nr.$$.fragment),Ab=d(),kd=a("p"),qb=n("The bare TFWav2Vec2 Model transformer outputing raw hidden-states without any specific head on top."),Yb=d(),Xr=a("p"),Pb=n("This model inherits from "),$i=a("a"),Sb=n("TFPreTrainedModel"),Qb=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Lb=d(),Gr=a("p"),Hb=n("This model is also a "),Rr=a("a"),Db=n("tf.keras.Model"),Ob=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Kb=d(),y(Aa.$$.fragment),ey=d(),ft=a("div"),y(Ar.$$.fragment),ty=d(),zo=a("p"),oy=n("The "),Ci=a("a"),ay=n("TFWav2Vec2Model"),sy=n(" forward method, overrides the "),Wd=a("code"),ny=n("__call__"),ry=n(" special method."),ly=d(),y(qa.$$.fragment),iy=d(),y(Ya.$$.fragment),mm=d(),Bo=a("h2"),Pa=a("a"),Vd=a("span"),y(qr.$$.fragment),cy=d(),Jd=a("span"),dy=n("TFWav2Vec2ForSequenceClassification"),hm=d(),No=a("div"),y(Yr.$$.fragment),py=d(),Ui=a("div"),y(Pr.$$.fragment),fm=d(),Xo=a("h2"),Sa=a("a"),Fd=a("span"),y(Sr.$$.fragment),my=d(),xd=a("span"),hy=n("TFWav2Vec2ForCTC"),um=d(),ye=a("div"),y(Qr.$$.fragment),fy=d(),Lr=a("p"),uy=n("TFWav2Vec2 Model with a "),$d=a("code"),gy=n("language modeling"),_y=n(" head on top for Connectionist Temporal Classification (CTC)."),vy=d(),Hr=a("p"),by=n("This model inherits from "),Ei=a("a"),yy=n("TFPreTrainedModel"),wy=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ty=d(),Dr=a("p"),My=n("This model is also a "),Or=a("a"),jy=n("tf.keras.Model"),ky=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Wy=d(),y(Qa.$$.fragment),Vy=d(),ut=a("div"),y(Kr.$$.fragment),Jy=d(),Go=a("p"),Fy=n("The "),Zi=a("a"),xy=n("TFWav2Vec2ForCTC"),$y=n(" forward method, overrides the "),Cd=a("code"),Cy=n("__call__"),Uy=n(" special method."),Ey=d(),y(La.$$.fragment),Zy=d(),y(Ha.$$.fragment),gm=d(),Ro=a("h2"),Da=a("a"),Ud=a("span"),y(el.$$.fragment),Iy=d(),Ed=a("span"),zy=n("FlaxWav2Vec2Model"),_m=d(),re=a("div"),y(tl.$$.fragment),By=d(),ol=a("p"),Ny=n(`The bare Wav2Vec2 Model transformer outputting raw hidden-states without any specific head on top.
Wav2Vec2 was proposed in `),al=a("a"),Xy=n(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),Gy=n(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Ry=d(),sl=a("p"),Ay=n("This model inherits from "),Ii=a("a"),qy=n("FlaxPreTrainedModel"),Yy=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Py=d(),nl=a("p"),Sy=n(`This model is also a Flax Linen
`),rl=a("a"),Qy=n("flax.nn.Module"),Ly=n(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Hy=d(),Zd=a("p"),Dy=n("Finally, this model supports inherent JAX features such as:"),Oy=d(),Xt=a("ul"),Id=a("li"),ll=a("a"),Ky=n("Just-In-Time (JIT) compilation"),ew=d(),zd=a("li"),il=a("a"),tw=n("Automatic Differentiation"),ow=d(),Bd=a("li"),cl=a("a"),aw=n("Vectorization"),sw=d(),Nd=a("li"),dl=a("a"),nw=n("Parallelization"),rw=d(),gt=a("div"),y(pl.$$.fragment),lw=d(),Ao=a("p"),iw=n("The "),Xd=a("code"),cw=n("FlaxWav2Vec2PreTrainedModel"),dw=n(" forward method, overrides the "),Gd=a("code"),pw=n("__call__"),mw=n(" special method."),hw=d(),y(Oa.$$.fragment),fw=d(),y(Ka.$$.fragment),vm=d(),qo=a("h2"),es=a("a"),Rd=a("span"),y(ml.$$.fragment),uw=d(),Ad=a("span"),gw=n("FlaxWav2Vec2ForCTC"),bm=d(),le=a("div"),y(hl.$$.fragment),_w=d(),Yo=a("p"),vw=n("Wav2Vec2 Model with a "),qd=a("code"),bw=n("language modeling"),yw=n(` head on top for Connectionist Temporal Classification (CTC).
Wav2Vec2 was proposed in `),fl=a("a"),ww=n(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),Tw=n(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Mw=d(),ul=a("p"),jw=n("This model inherits from "),zi=a("a"),kw=n("FlaxPreTrainedModel"),Ww=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Vw=d(),gl=a("p"),Jw=n(`This model is also a Flax Linen
`),_l=a("a"),Fw=n("flax.nn.Module"),xw=n(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),$w=d(),Yd=a("p"),Cw=n("Finally, this model supports inherent JAX features such as:"),Uw=d(),Gt=a("ul"),Pd=a("li"),vl=a("a"),Ew=n("Just-In-Time (JIT) compilation"),Zw=d(),Sd=a("li"),bl=a("a"),Iw=n("Automatic Differentiation"),zw=d(),Qd=a("li"),yl=a("a"),Bw=n("Vectorization"),Nw=d(),Ld=a("li"),wl=a("a"),Xw=n("Parallelization"),Gw=d(),_t=a("div"),y(Tl.$$.fragment),Rw=d(),Po=a("p"),Aw=n("The "),Hd=a("code"),qw=n("FlaxWav2Vec2PreTrainedModel"),Yw=n(" forward method, overrides the "),Dd=a("code"),Pw=n("__call__"),Sw=n(" special method."),Qw=d(),y(ts.$$.fragment),Lw=d(),y(os.$$.fragment),ym=d(),So=a("h2"),as=a("a"),Od=a("span"),y(Ml.$$.fragment),Hw=d(),Kd=a("span"),Dw=n("FlaxWav2Vec2ForPreTraining"),wm=d(),ie=a("div"),y(jl.$$.fragment),Ow=d(),Qo=a("p"),Kw=n("Wav2Vec2 Model with a quantizer and "),ep=a("code"),eT=n("VQ"),tT=n(` head on top.
Wav2Vec2 was proposed in `),kl=a("a"),oT=n(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),aT=n(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),sT=d(),Wl=a("p"),nT=n("This model inherits from "),Bi=a("a"),rT=n("FlaxPreTrainedModel"),lT=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),iT=d(),Vl=a("p"),cT=n(`This model is also a Flax Linen
`),Jl=a("a"),dT=n("flax.nn.Module"),pT=n(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),mT=d(),tp=a("p"),hT=n("Finally, this model supports inherent JAX features such as:"),fT=d(),Rt=a("ul"),op=a("li"),Fl=a("a"),uT=n("Just-In-Time (JIT) compilation"),gT=d(),ap=a("li"),xl=a("a"),_T=n("Automatic Differentiation"),vT=d(),sp=a("li"),$l=a("a"),bT=n("Vectorization"),yT=d(),np=a("li"),Cl=a("a"),wT=n("Parallelization"),TT=d(),vt=a("div"),y(Ul.$$.fragment),MT=d(),Lo=a("p"),jT=n("The "),Ni=a("a"),kT=n("FlaxWav2Vec2ForPreTraining"),WT=n(" forward method, overrides the "),rp=a("code"),VT=n("__call__"),JT=n(" special method."),FT=d(),y(ss.$$.fragment),xT=d(),y(ns.$$.fragment),this.h()},l(o){const g=G1('[data-svelte="svelte-1phssyn"]',document.head);m=s(g,"META",{name:!0,content:!0}),g.forEach(t),b=p(o),u=s(o,"H1",{class:!0});var El=l(u);f=s(El,"A",{id:!0,class:!0,href:!0});var lp=l(f);v=s(lp,"SPAN",{});var ip=l(v);w(i.$$.fragment,ip),ip.forEach(t),lp.forEach(t),h=p(El),J=s(El,"SPAN",{});var cp=l(J);I=r(cp,"Wav2Vec2"),cp.forEach(t),El.forEach(t),z=p(o),E=s(o,"H2",{class:!0});var Zl=l(E);Z=s(Zl,"A",{id:!0,class:!0,href:!0});var dp=l(Z);R=s(dp,"SPAN",{});var pp=l(R);w(x.$$.fragment,pp),pp.forEach(t),dp.forEach(t),B=p(Zl),$=s(Zl,"SPAN",{});var mp=l($);ce=r(mp,"Overview"),mp.forEach(t),Zl.forEach(t),H=p(o),X=s(o,"P",{});var Il=l(X);de=r(Il,"The Wav2Vec2 model was proposed in "),G=s(Il,"A",{href:!0,rel:!0});var hp=l(G);q=r(hp,"wav2vec 2.0: A Framework for Self-Supervised Learning of Speech Representations"),hp.forEach(t),Re=r(Il," by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael Auli."),Il.forEach(t),S=p(o),D=s(o,"P",{});var fp=l(D);Ae=r(fp,"The abstract from the paper is the following:"),fp.forEach(t),xe=p(o),O=s(o,"P",{});var up=l(O);Le=s(up,"EM",{});var gp=l(Le);Vt=r(gp,`We show for the first time that learning powerful representations from speech audio alone followed by fine-tuning on
transcribed speech can outperform the best semi-supervised methods while being conceptually simpler. wav2vec 2.0 masks
the speech input in the latent space and solves a contrastive task defined over a quantization of the latent
representations which are jointly learned. Experiments using all labeled data of Librispeech achieve 1.8/3.3 WER on the
clean/other test sets. When lowering the amount of labeled data to one hour, wav2vec 2.0 outperforms the previous state
of the art on the 100 hour subset while using 100 times less labeled data. Using just ten minutes of labeled data and
pre-training on 53k hours of unlabeled data still achieves 4.8/8.2 WER. This demonstrates the feasibility of speech
recognition with limited amounts of labeled data.`),gp.forEach(t),up.forEach(t),qe=p(o),N=s(o,"P",{});var _p=l(N);K=r(_p,"Tips:"),_p.forEach(t),tt=p(o),se=s(o,"UL",{});var zl=l(se);He=s(zl,"LI",{});var vp=l(He);Jt=r(vp,"Wav2Vec2 is a speech model that accepts a float array corresponding to the raw waveform of the speech signal."),vp.forEach(t),$e=p(zl),Ce=s(zl,"LI",{});var Bl=l(Ce);Ft=r(Bl,`Wav2Vec2 model was trained using connectionist temporal classification (CTC) so the model output has to be decoded
using `),Y=s(Bl,"A",{href:!0});var bp=l(Y);xt=r(bp,"Wav2Vec2CTCTokenizer"),bp.forEach(t),Ue=r(Bl,"."),Bl.forEach(t),zl.forEach(t),ot=p(o),Te=s(o,"P",{});var Nl=l(Te);Ee=r(Nl,"This model was contributed by "),Ze=s(Nl,"A",{href:!0,rel:!0});var yp=l(Ze);$t=r(yp,"patrickvonplaten"),yp.forEach(t),he=r(Nl,"."),Nl.forEach(t),at=p(o),ee=s(o,"H2",{class:!0});var Xl=l(ee);Me=s(Xl,"A",{id:!0,class:!0,href:!0});var wp=l(Me);Ie=s(wp,"SPAN",{});var Tp=l(Ie);w(A.$$.fragment,Tp),Tp.forEach(t),wp.forEach(t),Ct=p(Xl),te=s(Xl,"SPAN",{});var Mp=l(te);Ut=r(Mp,"Resources"),Mp.forEach(t),Xl.forEach(t),st=p(o),V=s(o,"P",{});var jp=l(V);C=r(jp,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with Wav2Vec2. If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),jp.forEach(t),qt=p(o),w(fe.$$.fragment,o),Yt=p(o),je=s(o,"UL",{});var Ho=l(je);U=s(Ho,"LI",{});var Gl=l(U);Kt=r(Gl,"A notebook on how to "),De=s(Gl,"A",{href:!0,rel:!0});var kp=l(De);eo=r(kp,"leverage a pretrained Wav2Vec2 model for emotion classification"),kp.forEach(t),to=r(Gl,". \u{1F30E}"),Gl.forEach(t),oo=p(Ho),P=s(Ho,"LI",{});var Ht=l(P);pe=s(Ht,"A",{href:!0});var Wp=l(pe);ao=r(Wp,"Wav2Vec2ForCTC"),Wp.forEach(t),so=r(Ht," is supported by this "),ne=s(Ht,"A",{href:!0,rel:!0});var Vp=l(ne);no=r(Vp,"example script"),Vp.forEach(t),ro=r(Ht," and "),ze=s(Ht,"A",{href:!0,rel:!0});var Jp=l(ze);lo=r(Jp,"notebook"),Jp.forEach(t),Oe=r(Ht,"."),Ht.forEach(t),io=p(Ho),ic=s(Ho,"LI",{});var IT=l(ic);Al=s(IT,"A",{href:!0});var zT=l(Al);Lh=r(zT,"Audio classification task guide"),zT.forEach(t),IT.forEach(t),Ho.forEach(t),Fp=p(o),w(Fs.$$.fragment,o),xp=p(o),ke=s(o,"UL",{});var bt=l(ke);xs=s(bt,"LI",{});var Mm=l(xs);Hh=r(Mm,"A blog post on "),$s=s(Mm,"A",{href:!0,rel:!0});var BT=l($s);Dh=r(BT,"boosting Wav2Vec2 with n-grams in \u{1F917} Transformers"),BT.forEach(t),Oh=r(Mm,"."),Mm.forEach(t),Kh=p(bt),Cs=s(bt,"LI",{});var jm=l(Cs);ef=r(jm,"A blog post on how to "),Us=s(jm,"A",{href:!0,rel:!0});var NT=l(Us);tf=r(NT,"finetune Wav2Vec2 for English ASR with \u{1F917} Transformers"),NT.forEach(t),of=r(jm,"."),jm.forEach(t),af=p(bt),Es=s(bt,"LI",{});var km=l(Es);sf=r(km,"A blog post on "),Zs=s(km,"A",{href:!0,rel:!0});var XT=l(Zs);nf=r(XT,"finetuning XLS-R for Multi-Lingual ASR with \u{1F917} Transformers"),XT.forEach(t),rf=r(km,"."),km.forEach(t),lf=p(bt),Is=s(bt,"LI",{});var Wm=l(Is);cf=r(Wm,"A notebook on how to "),zs=s(Wm,"A",{href:!0,rel:!0});var GT=l(zs);df=r(GT,"create YouTube captions from any video by transcribing audio with Wav2Vec2"),GT.forEach(t),pf=r(Wm,". \u{1F30E}"),Wm.forEach(t),mf=p(bt),Pt=s(bt,"LI",{});var Rl=l(Pt);ql=s(Rl,"A",{href:!0});var RT=l(ql);hf=r(RT,"Wav2Vec2ForCTC"),RT.forEach(t),ff=r(Rl," is supported by a notebook on "),Bs=s(Rl,"A",{href:!0,rel:!0});var AT=l(Bs);uf=r(AT,"how to finetune a speech recognition model in English"),AT.forEach(t),gf=r(Rl,", and "),Ns=s(Rl,"A",{href:!0,rel:!0});var qT=l(Ns);_f=r(qT,"how to finetune a speech recognition model in any language"),qT.forEach(t),vf=r(Rl,"."),Rl.forEach(t),bf=p(bt),cc=s(bt,"LI",{});var YT=l(cc);Yl=s(YT,"A",{href:!0});var PT=l(Yl);yf=r(PT,"Automatic speech recognition task guide"),PT.forEach(t),YT.forEach(t),bt.forEach(t),$p=p(o),Pl=s(o,"P",{});var ST=l(Pl);wf=r(ST,"\u{1F680} Deploy"),ST.forEach(t),Cp=p(o),Sl=s(o,"UL",{});var QT=l(Sl);Xs=s(QT,"LI",{});var Vm=l(Xs);Tf=r(Vm,"A blog post on how to deploy Wav2Vec2 for "),Gs=s(Vm,"A",{href:!0,rel:!0});var LT=l(Gs);Mf=r(LT,"Automatic Speech Recogntion with Hugging Face\u2019s Transformers & Amazon SageMaker"),LT.forEach(t),jf=r(Vm,"."),Vm.forEach(t),QT.forEach(t),Up=p(o),co=s(o,"H2",{class:!0});var Jm=l(co);Do=s(Jm,"A",{id:!0,class:!0,href:!0});var HT=l(Do);dc=s(HT,"SPAN",{});var DT=l(dc);w(Rs.$$.fragment,DT),DT.forEach(t),HT.forEach(t),kf=p(Jm),pc=s(Jm,"SPAN",{});var OT=l(pc);Wf=r(OT,"Wav2Vec2Config"),OT.forEach(t),Jm.forEach(t),Ep=p(o),Ke=s(o,"DIV",{class:!0});var rs=l(Ke);w(As.$$.fragment,rs),Vf=p(rs),po=s(rs,"P",{});var Xi=l(po);Jf=r(Xi,"This is the configuration class to store the configuration of a "),Ql=s(Xi,"A",{href:!0});var KT=l(Ql);Ff=r(KT,"Wav2Vec2Model"),KT.forEach(t),xf=r(Xi,`. It is used to instantiate an
Wav2Vec2 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 Wav2Vec2
`),qs=s(Xi,"A",{href:!0,rel:!0});var eM=l(qs);$f=r(eM,"facebook/wav2vec2-base-960h"),eM.forEach(t),Cf=r(Xi," architecture."),Xi.forEach(t),Uf=p(rs),mo=s(rs,"P",{});var Gi=l(mo);Ef=r(Gi,"Configuration objects inherit from "),Ll=s(Gi,"A",{href:!0});var tM=l(Ll);Zf=r(tM,"PretrainedConfig"),tM.forEach(t),If=r(Gi,` and can be used to control the model outputs. Read the
documentation from `),Hl=s(Gi,"A",{href:!0});var oM=l(Hl);zf=r(oM,"PretrainedConfig"),oM.forEach(t),Bf=r(Gi," for more information."),Gi.forEach(t),Nf=p(rs),w(Oo.$$.fragment,rs),rs.forEach(t),Zp=p(o),ho=s(o,"H2",{class:!0});var Fm=l(ho);Ko=s(Fm,"A",{id:!0,class:!0,href:!0});var aM=l(Ko);mc=s(aM,"SPAN",{});var sM=l(mc);w(Ys.$$.fragment,sM),sM.forEach(t),aM.forEach(t),Xf=p(Fm),hc=s(Fm,"SPAN",{});var nM=l(hc);Gf=r(nM,"Wav2Vec2CTCTokenizer"),nM.forEach(t),Fm.forEach(t),Ip=p(o),oe=s(o,"DIV",{class:!0});var Ve=l(oe);w(Ps.$$.fragment,Ve),Rf=p(Ve),fc=s(Ve,"P",{});var rM=l(fc);Af=r(rM,"Constructs a Wav2Vec2CTC tokenizer."),rM.forEach(t),qf=p(Ve),Ss=s(Ve,"P",{});var xm=l(Ss);Yf=r(xm,"This tokenizer inherits from "),Dl=s(xm,"A",{href:!0});var lM=l(Dl);Pf=r(lM,"PreTrainedTokenizer"),lM.forEach(t),Sf=r(xm,` which contains some of the main methods. Users should refer to
the superclass for more information regarding such methods.`),xm.forEach(t),Qf=p(Ve),ea=s(Ve,"DIV",{class:!0});var $m=l(ea);w(Qs.$$.fragment,$m),Lf=p($m),uc=s($m,"P",{});var iM=l(uc);Hf=r(iM,`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),iM.forEach(t),$m.forEach(t),Df=p(Ve),Ol=s(Ve,"DIV",{class:!0});var cM=l(Ol);w(Ls.$$.fragment,cM),cM.forEach(t),Of=p(Ve),nt=s(Ve,"DIV",{class:!0});var ls=l(nt);w(Hs.$$.fragment,ls),Kf=p(ls),gc=s(ls,"P",{});var dM=l(gc);eu=r(dM,`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),dM.forEach(t),tu=p(ls),Ds=s(ls,"P",{});var Cm=l(Ds);ou=r(Cm,"Similar to doing "),_c=s(Cm,"CODE",{});var pM=l(_c);au=r(pM,"self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),pM.forEach(t),su=r(Cm,"."),Cm.forEach(t),nu=p(ls),w(ta.$$.fragment,ls),ls.forEach(t),ru=p(Ve),oa=s(Ve,"DIV",{class:!0});var Um=l(oa);w(Os.$$.fragment,Um),lu=p(Um),vc=s(Um,"P",{});var mM=l(vc);iu=r(mM,"Convert a list of lists of token ids into a list of strings by calling decode."),mM.forEach(t),Um.forEach(t),cu=p(Ve),aa=s(Ve,"DIV",{class:!0});var Em=l(aa);w(Ks.$$.fragment,Em),du=p(Em),bc=s(Em,"P",{});var hM=l(bc);pu=r(hM,"Set the target language of a nested multi-lingual dictionary"),hM.forEach(t),Em.forEach(t),Ve.forEach(t),zp=p(o),fo=s(o,"H2",{class:!0});var Zm=l(fo);sa=s(Zm,"A",{id:!0,class:!0,href:!0});var fM=l(sa);yc=s(fM,"SPAN",{});var uM=l(yc);w(en.$$.fragment,uM),uM.forEach(t),fM.forEach(t),mu=p(Zm),wc=s(Zm,"SPAN",{});var gM=l(wc);hu=r(gM,"Wav2Vec2FeatureExtractor"),gM.forEach(t),Zm.forEach(t),Bp=p(o),et=s(o,"DIV",{class:!0});var is=l(et);w(tn.$$.fragment,is),fu=p(is),Tc=s(is,"P",{});var _M=l(Tc);uu=r(_M,"Constructs a Wav2Vec2 feature extractor."),_M.forEach(t),gu=p(is),on=s(is,"P",{});var Im=l(on);_u=r(Im,"This feature extractor inherits from "),Kl=s(Im,"A",{href:!0});var vM=l(Kl);vu=r(vM,"SequenceFeatureExtractor"),vM.forEach(t),bu=r(Im,` which contains
most of the main methods. Users should refer to this superclass for more information regarding those methods.`),Im.forEach(t),yu=p(is),na=s(is,"DIV",{class:!0});var zm=l(na);w(an.$$.fragment,zm),wu=p(zm),Mc=s(zm,"P",{});var bM=l(Mc);Tu=r(bM,"Main method to featurize and prepare for the model one or several sequence(s)."),bM.forEach(t),zm.forEach(t),is.forEach(t),Np=p(o),uo=s(o,"H2",{class:!0});var Bm=l(uo);ra=s(Bm,"A",{id:!0,class:!0,href:!0});var yM=l(ra);jc=s(yM,"SPAN",{});var wM=l(jc);w(sn.$$.fragment,wM),wM.forEach(t),yM.forEach(t),Mu=p(Bm),kc=s(Bm,"SPAN",{});var TM=l(kc);ju=r(TM,"Wav2Vec2Processor"),TM.forEach(t),Bm.forEach(t),Xp=p(o),Q=s(o,"DIV",{class:!0});var me=l(Q);w(nn.$$.fragment,me),ku=p(me),Wc=s(me,"P",{});var MM=l(Wc);Wu=r(MM,`Constructs a Wav2Vec2 processor which wraps a Wav2Vec2 feature extractor and a Wav2Vec2 CTC tokenizer into a single
processor.`),MM.forEach(t),Vu=p(me),Ye=s(me,"P",{});var At=l(Ye);ei=s(At,"A",{href:!0});var jM=l(ei);Ju=r(jM,"Wav2Vec2Processor"),jM.forEach(t),Fu=r(At," offers all the functionalities of "),ti=s(At,"A",{href:!0});var kM=l(ti);xu=r(kM,"Wav2Vec2FeatureExtractor"),kM.forEach(t),$u=r(At," and "),oi=s(At,"A",{href:!0});var WM=l(oi);Cu=r(WM,"PreTrainedTokenizer"),WM.forEach(t),Uu=r(At,`.
See the docstring of `),rn=s(At,"A",{href:!0});var $T=l(rn);Vc=s($T,"STRONG",{});var VM=l(Vc);Eu=r(VM,"call"),VM.forEach(t),Zu=r($T,"()"),$T.forEach(t),Iu=r(At," and "),ai=s(At,"A",{href:!0});var JM=l(ai);zu=r(JM,"decode()"),JM.forEach(t),Bu=r(At," for more information."),At.forEach(t),Nu=p(me),la=s(me,"DIV",{class:!0});var Nm=l(la);w(ln.$$.fragment,Nm),Xu=p(Nm),Et=s(Nm,"P",{});var cs=l(Et);Gu=r(cs,`When used in normal mode, this method forwards all its arguments to Wav2Vec2FeatureExtractor\u2019s
`),cn=s(cs,"A",{href:!0});var CT=l(cn);Jc=s(CT,"STRONG",{});var FM=l(Jc);Ru=r(FM,"call"),FM.forEach(t),Au=r(CT,"()"),CT.forEach(t),qu=r(cs,` and returns its output. If used in the context
`),Fc=s(cs,"CODE",{});var xM=l(Fc);Yu=r(xM,"as_target_processor()"),xM.forEach(t),Pu=r(cs,` this method forwards all its arguments to PreTrainedTokenizer\u2019s
`),dn=s(cs,"A",{href:!0});var UT=l(dn);xc=s(UT,"STRONG",{});var $M=l(xc);Su=r($M,"call"),$M.forEach(t),Qu=r(UT,"()"),UT.forEach(t),Lu=r(cs,". Please refer to the docstring of the above two methods for more information."),cs.forEach(t),Nm.forEach(t),Hu=p(me),ia=s(me,"DIV",{class:!0});var Xm=l(ia);w(pn.$$.fragment,Xm),Du=p(Xm),Zt=s(Xm,"P",{});var ds=l(Zt);Ou=r(ds,`When used in normal mode, this method forwards all its arguments to Wav2Vec2FeatureExtractor\u2019s
`),si=s(ds,"A",{href:!0});var CM=l(si);Ku=r(CM,"pad()"),CM.forEach(t),eg=r(ds,` and returns its output. If used in the context
`),$c=s(ds,"CODE",{});var UM=l($c);tg=r(UM,"as_target_processor()"),UM.forEach(t),og=r(ds,` this method forwards all its arguments to PreTrainedTokenizer\u2019s
`),ni=s(ds,"A",{href:!0});var EM=l(ni);ag=r(EM,"pad()"),EM.forEach(t),sg=r(ds,". Please refer to the docstring of the above two methods for more information."),ds.forEach(t),Xm.forEach(t),ng=p(me),ri=s(me,"DIV",{class:!0});var ZM=l(ri);w(mn.$$.fragment,ZM),ZM.forEach(t),rg=p(me),St=s(me,"DIV",{class:!0});var Ri=l(St);w(hn.$$.fragment,Ri),lg=p(Ri),fn=s(Ri,"P",{});var Gm=l(fn);ig=r(Gm,`Saves the attributes of this processor (feature extractor, tokenizer\u2026) in the specified directory so that it
can be reloaded using the `),li=s(Gm,"A",{href:!0});var IM=l(li);cg=r(IM,"from_pretrained()"),IM.forEach(t),dg=r(Gm," method."),Gm.forEach(t),pg=p(Ri),w(ca.$$.fragment,Ri),Ri.forEach(t),mg=p(me),da=s(me,"DIV",{class:!0});var Rm=l(da);w(un.$$.fragment,Rm),hg=p(Rm),gn=s(Rm,"P",{});var Am=l(gn);fg=r(Am,"This method forwards all its arguments to PreTrainedTokenizer\u2019s "),ii=s(Am,"A",{href:!0});var zM=l(ii);ug=r(zM,"batch_decode()"),zM.forEach(t),gg=r(Am,`. Please
refer to the docstring of this method for more information.`),Am.forEach(t),Rm.forEach(t),_g=p(me),pa=s(me,"DIV",{class:!0});var qm=l(pa);w(_n.$$.fragment,qm),vg=p(qm),vn=s(qm,"P",{});var Ym=l(vn);bg=r(Ym,"This method forwards all its arguments to PreTrainedTokenizer\u2019s "),ci=s(Ym,"A",{href:!0});var BM=l(ci);yg=r(BM,"decode()"),BM.forEach(t),wg=r(Ym,`. Please refer
to the docstring of this method for more information.`),Ym.forEach(t),qm.forEach(t),me.forEach(t),Gp=p(o),go=s(o,"H2",{class:!0});var Pm=l(go);ma=s(Pm,"A",{id:!0,class:!0,href:!0});var NM=l(ma);Cc=s(NM,"SPAN",{});var XM=l(Cc);w(bn.$$.fragment,XM),XM.forEach(t),NM.forEach(t),Tg=p(Pm),Uc=s(Pm,"SPAN",{});var GM=l(Uc);Mg=r(GM,"Wav2Vec2ProcessorWithLM"),GM.forEach(t),Pm.forEach(t),Rp=p(o),ae=s(o,"DIV",{class:!0});var Je=l(ae);w(yn.$$.fragment,Je),jg=p(Je),Ec=s(Je,"P",{});var RM=l(Ec);kg=r(RM,`Constructs a Wav2Vec2 processor which wraps a Wav2Vec2 feature extractor, a Wav2Vec2 CTC tokenizer and a decoder
with language model support into a single processor for language model boosted speech recognition decoding.`),RM.forEach(t),Wg=p(Je),ha=s(Je,"DIV",{class:!0});var Sm=l(ha);w(wn.$$.fragment,Sm),Vg=p(Sm),It=s(Sm,"P",{});var ps=l(It);Jg=r(ps,`When used in normal mode, this method forwards all its arguments to Wav2Vec2FeatureExtractor\u2019s
`),Tn=s(ps,"A",{href:!0});var ET=l(Tn);Zc=s(ET,"STRONG",{});var AM=l(Zc);Fg=r(AM,"call"),AM.forEach(t),xg=r(ET,"()"),ET.forEach(t),$g=r(ps,` and returns its output. If used in the context
`),Ic=s(ps,"CODE",{});var qM=l(Ic);Cg=r(qM,"as_target_processor()"),qM.forEach(t),Ug=r(ps,` this method forwards all its arguments to
Wav2Vec2CTCTokenizer\u2019s `),Mn=s(ps,"A",{href:!0});var ZT=l(Mn);zc=s(ZT,"STRONG",{});var YM=l(zc);Eg=r(YM,"call"),YM.forEach(t),Zg=r(ZT,"()"),ZT.forEach(t),Ig=r(ps,`. Please refer to the docstring of the above two
methods for more information.`),ps.forEach(t),Sm.forEach(t),zg=p(Je),fa=s(Je,"DIV",{class:!0});var Qm=l(fa);w(jn.$$.fragment,Qm),Bg=p(Qm),zt=s(Qm,"P",{});var ms=l(zt);Ng=r(ms,`When used in normal mode, this method forwards all its arguments to Wav2Vec2FeatureExtractor\u2019s
`),di=s(ms,"A",{href:!0});var PM=l(di);Xg=r(PM,"pad()"),PM.forEach(t),Gg=r(ms,` and returns its output. If used in the context
`),Bc=s(ms,"CODE",{});var SM=l(Bc);Rg=r(SM,"as_target_processor()"),SM.forEach(t),Ag=r(ms,` this method forwards all its arguments to
Wav2Vec2CTCTokenizer\u2019s `),pi=s(ms,"A",{href:!0});var QM=l(pi);qg=r(QM,"pad()"),QM.forEach(t),Yg=r(ms,`. Please refer to the docstring of the above two methods
for more information.`),ms.forEach(t),Qm.forEach(t),Pg=p(Je),Qt=s(Je,"DIV",{class:!0});var Ai=l(Qt);w(kn.$$.fragment,Ai),Sg=p(Ai),Wn=s(Ai,"P",{});var Lm=l(Wn);Qg=r(Lm,"Instantiate a "),mi=s(Lm,"A",{href:!0});var LM=l(mi);Lg=r(LM,"Wav2Vec2ProcessorWithLM"),LM.forEach(t),Hg=r(Lm," from a pretrained Wav2Vec2 processor."),Lm.forEach(t),Dg=p(Ai),w(ua.$$.fragment,Ai),Ai.forEach(t),Og=p(Je),hi=s(Je,"DIV",{class:!0});var HM=l(hi);w(Vn.$$.fragment,HM),HM.forEach(t),Kg=p(Je),rt=s(Je,"DIV",{class:!0});var hs=l(rt);w(Jn.$$.fragment,hs),e_=p(hs),Nc=s(hs,"P",{});var DM=l(Nc);t_=r(DM,"Batch decode output logits to audio transcription with language model support."),DM.forEach(t),o_=p(hs),w(ga.$$.fragment,hs),a_=p(hs),Fn=s(hs,"P",{});var Hm=l(Fn);s_=r(Hm,`Example:
See `),fi=s(Hm,"A",{href:!0});var OM=l(fi);n_=r(OM,"Decoding multiple audios"),OM.forEach(t),r_=r(Hm,"."),Hm.forEach(t),hs.forEach(t),l_=p(Je),Lt=s(Je,"DIV",{class:!0});var qi=l(Lt);w(xn.$$.fragment,qi),i_=p(qi),Xc=s(qi,"P",{});var KM=l(Xc);c_=r(KM,"Decode output logits to audio transcription with language model support."),KM.forEach(t),d_=p(qi),w(_a.$$.fragment,qi),qi.forEach(t),Je.forEach(t),Ap=p(o),_o=s(o,"H3",{class:!0});var Dm=l(_o);va=s(Dm,"A",{id:!0,class:!0,href:!0});var e0=l(va);Gc=s(e0,"SPAN",{});var t0=l(Gc);w($n.$$.fragment,t0),t0.forEach(t),e0.forEach(t),p_=p(Dm),Rc=s(Dm,"SPAN",{});var o0=l(Rc);m_=r(o0,"Decoding multiple audios"),o0.forEach(t),Dm.forEach(t),qp=p(o),We=s(o,"P",{});var yt=l(We);h_=r(yt,"If you are planning to decode multiple batches of audios, you should consider using "),ui=s(yt,"A",{href:!0});var a0=l(ui);f_=r(a0,"batch_decode()"),a0.forEach(t),u_=r(yt," and passing an instantiated "),Ac=s(yt,"CODE",{});var s0=l(Ac);g_=r(s0,"multiprocessing.Pool"),s0.forEach(t),__=r(yt,`.
Otherwise, `),gi=s(yt,"A",{href:!0});var n0=l(gi);v_=r(n0,"batch_decode()"),n0.forEach(t),b_=r(yt," performance will be slower than calling "),_i=s(yt,"A",{href:!0});var r0=l(_i);y_=r(r0,"decode()"),r0.forEach(t),w_=r(yt," for each audio individually, as it internally instantiates a new "),qc=s(yt,"CODE",{});var l0=l(qc);T_=r(l0,"Pool"),l0.forEach(t),M_=r(yt," for every call. See the example below:"),yt.forEach(t),Yp=p(o),w(Cn.$$.fragment,o),Pp=p(o),vo=s(o,"H2",{class:!0});var Om=l(vo);ba=s(Om,"A",{id:!0,class:!0,href:!0});var i0=l(ba);Yc=s(i0,"SPAN",{});var c0=l(Yc);w(Un.$$.fragment,c0),c0.forEach(t),i0.forEach(t),j_=p(Om),Pc=s(Om,"SPAN",{});var d0=l(Pc);k_=r(d0,"Wav2Vec2 specific outputs"),d0.forEach(t),Om.forEach(t),Sp=p(o),bo=s(o,"DIV",{class:!0});var Km=l(bo);w(En.$$.fragment,Km),W_=p(Km),Zn=s(Km,"P",{});var eh=l(Zn);V_=r(eh,"Output type of "),Sc=s(eh,"CODE",{});var p0=l(Sc);J_=r(p0,"Wav2Vec2DecoderWithLM"),p0.forEach(t),F_=r(eh,", with transcription."),eh.forEach(t),Km.forEach(t),Qp=p(o),yo=s(o,"DIV",{class:!0});var th=l(yo);w(In.$$.fragment,th),x_=p(th),Qc=s(th,"P",{});var m0=l(Qc);$_=r(m0,"Base class for models that have been trained with the Wav2Vec2 loss objective."),m0.forEach(t),th.forEach(t),Lp=p(o),wo=s(o,"DIV",{class:!0});var oh=l(wo);w(zn.$$.fragment,oh),C_=p(oh),Bn=s(oh,"P",{});var ah=l(Bn);U_=r(ah,"Output type of "),vi=s(ah,"A",{href:!0});var h0=l(vi);E_=r(h0,"Wav2Vec2ForPreTraining"),h0.forEach(t),Z_=r(ah,", with potential hidden states and attentions."),ah.forEach(t),oh.forEach(t),Hp=p(o),Bt=s(o,"DIV",{class:!0});var Yi=l(Bt);w(Nn.$$.fragment,Yi),I_=p(Yi),Xn=s(Yi,"P",{});var sh=l(Xn);z_=r(sh,"Output type of "),Lc=s(sh,"CODE",{});var f0=l(Lc);B_=r(f0,"FlaxWav2Vec2BaseModelOutput"),f0.forEach(t),N_=r(sh,", with potential hidden states and attentions."),sh.forEach(t),X_=p(Yi),ya=s(Yi,"DIV",{class:!0});var nh=l(ya);w(Gn.$$.fragment,nh),G_=p(nh),Hc=s(nh,"P",{});var u0=l(Hc);R_=r(u0,"\u201CReturns a new object replacing the specified fields with new values."),u0.forEach(t),nh.forEach(t),Yi.forEach(t),Dp=p(o),Nt=s(o,"DIV",{class:!0});var Pi=l(Nt);w(Rn.$$.fragment,Pi),A_=p(Pi),An=s(Pi,"P",{});var rh=l(An);q_=r(rh,"Output type of "),Dc=s(rh,"CODE",{});var g0=l(Dc);Y_=r(g0,"FlaxWav2Vec2ForPreTrainingOutput"),g0.forEach(t),P_=r(rh,", with potential hidden states and attentions."),rh.forEach(t),S_=p(Pi),wa=s(Pi,"DIV",{class:!0});var lh=l(wa);w(qn.$$.fragment,lh),Q_=p(lh),Oc=s(lh,"P",{});var _0=l(Oc);L_=r(_0,"\u201CReturns a new object replacing the specified fields with new values."),_0.forEach(t),lh.forEach(t),Pi.forEach(t),Op=p(o),To=s(o,"H2",{class:!0});var ih=l(To);Ta=s(ih,"A",{id:!0,class:!0,href:!0});var v0=l(Ta);Kc=s(v0,"SPAN",{});var b0=l(Kc);w(Yn.$$.fragment,b0),b0.forEach(t),v0.forEach(t),H_=p(ih),ed=s(ih,"SPAN",{});var y0=l(ed);D_=r(y0,"Wav2Vec2Model"),y0.forEach(t),ih.forEach(t),Kp=p(o),Be=s(o,"DIV",{class:!0});var Dt=l(Be);w(Pn.$$.fragment,Dt),O_=p(Dt),Sn=s(Dt,"P",{});var ch=l(Sn);K_=r(ch,`The bare Wav2Vec2 Model transformer outputting raw hidden-states without any specific head on top.
Wav2Vec2 was proposed in `),Qn=s(ch,"A",{href:!0,rel:!0});var w0=l(Qn);ev=r(w0,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),w0.forEach(t),tv=r(ch,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),ch.forEach(t),ov=p(Dt),Ln=s(Dt,"P",{});var dh=l(Ln);av=r(dh,"This model inherits from "),bi=s(dh,"A",{href:!0});var T0=l(bi);sv=r(T0,"PreTrainedModel"),T0.forEach(t),nv=r(dh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),dh.forEach(t),rv=p(Dt),Hn=s(Dt,"P",{});var ph=l(Hn);lv=r(ph,"This model is a PyTorch "),Dn=s(ph,"A",{href:!0,rel:!0});var M0=l(Dn);iv=r(M0,"torch.nn.Module"),M0.forEach(t),cv=r(ph,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ph.forEach(t),dv=p(Dt),lt=s(Dt,"DIV",{class:!0});var fs=l(lt);w(On.$$.fragment,fs),pv=p(fs),Mo=s(fs,"P",{});var Si=l(Mo);mv=r(Si,"The "),yi=s(Si,"A",{href:!0});var j0=l(yi);hv=r(j0,"Wav2Vec2Model"),j0.forEach(t),fv=r(Si," forward method, overrides the "),td=s(Si,"CODE",{});var k0=l(td);uv=r(k0,"__call__"),k0.forEach(t),gv=r(Si," special method."),Si.forEach(t),_v=p(fs),w(Ma.$$.fragment,fs),vv=p(fs),w(ja.$$.fragment,fs),fs.forEach(t),Dt.forEach(t),em=p(o),jo=s(o,"H2",{class:!0});var mh=l(jo);ka=s(mh,"A",{id:!0,class:!0,href:!0});var W0=l(ka);od=s(W0,"SPAN",{});var V0=l(od);w(Kn.$$.fragment,V0),V0.forEach(t),W0.forEach(t),bv=p(mh),ad=s(mh,"SPAN",{});var J0=l(ad);yv=r(J0,"Wav2Vec2ForCTC"),J0.forEach(t),mh.forEach(t),tm=p(o),ue=s(o,"DIV",{class:!0});var wt=l(ue);w(er.$$.fragment,wt),wv=p(wt),ko=s(wt,"P",{});var Qi=l(ko);Tv=r(Qi,"Wav2Vec2 Model with a "),sd=s(Qi,"CODE",{});var F0=l(sd);Mv=r(F0,"language modeling"),F0.forEach(t),jv=r(Qi,` head on top for Connectionist Temporal Classification (CTC).
Wav2Vec2 was proposed in `),tr=s(Qi,"A",{href:!0,rel:!0});var x0=l(tr);kv=r(x0,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),x0.forEach(t),Wv=r(Qi,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Qi.forEach(t),Vv=p(wt),or=s(wt,"P",{});var hh=l(or);Jv=r(hh,"This model inherits from "),wi=s(hh,"A",{href:!0});var $0=l(wi);Fv=r($0,"PreTrainedModel"),$0.forEach(t),xv=r(hh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),hh.forEach(t),$v=p(wt),ar=s(wt,"P",{});var fh=l(ar);Cv=r(fh,"This model is a PyTorch "),sr=s(fh,"A",{href:!0,rel:!0});var C0=l(sr);Uv=r(C0,"torch.nn.Module"),C0.forEach(t),Ev=r(fh,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),fh.forEach(t),Zv=p(wt),it=s(wt,"DIV",{class:!0});var us=l(it);w(nr.$$.fragment,us),Iv=p(us),Wo=s(us,"P",{});var Li=l(Wo);zv=r(Li,"The "),Ti=s(Li,"A",{href:!0});var U0=l(Ti);Bv=r(U0,"Wav2Vec2ForCTC"),U0.forEach(t),Nv=r(Li," forward method, overrides the "),nd=s(Li,"CODE",{});var E0=l(nd);Xv=r(E0,"__call__"),E0.forEach(t),Gv=r(Li," special method."),Li.forEach(t),Rv=p(us),w(Wa.$$.fragment,us),Av=p(us),w(Va.$$.fragment,us),us.forEach(t),qv=p(wt),ct=s(wt,"DIV",{class:!0});var gs=l(ct);w(rr.$$.fragment,gs),Yv=p(gs),rd=s(gs,"P",{});var Z0=l(rd);Pv=r(Z0,"Load a language adapter model from a pre-trained adapter model."),Z0.forEach(t),Sv=p(gs),w(Ja.$$.fragment,gs),Qv=p(gs),w(Fa.$$.fragment,gs),gs.forEach(t),wt.forEach(t),om=p(o),Vo=s(o,"H2",{class:!0});var uh=l(Vo);xa=s(uh,"A",{id:!0,class:!0,href:!0});var I0=l(xa);ld=s(I0,"SPAN",{});var z0=l(ld);w(lr.$$.fragment,z0),z0.forEach(t),I0.forEach(t),Lv=p(uh),id=s(uh,"SPAN",{});var B0=l(id);Hv=r(B0,"Wav2Vec2ForSequenceClassification"),B0.forEach(t),uh.forEach(t),am=p(o),ge=s(o,"DIV",{class:!0});var Tt=l(ge);w(ir.$$.fragment,Tt),Dv=p(Tt),cd=s(Tt,"P",{});var N0=l(cd);Ov=r(N0,`Wav2Vec2 Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like
SUPERB Keyword Spotting.`),N0.forEach(t),Kv=p(Tt),cr=s(Tt,"P",{});var gh=l(cr);e2=r(gh,"Wav2Vec2 was proposed in "),dr=s(gh,"A",{href:!0,rel:!0});var X0=l(dr);t2=r(X0,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),X0.forEach(t),o2=r(gh,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),gh.forEach(t),a2=p(Tt),pr=s(Tt,"P",{});var _h=l(pr);s2=r(_h,"This model inherits from "),Mi=s(_h,"A",{href:!0});var G0=l(Mi);n2=r(G0,"PreTrainedModel"),G0.forEach(t),r2=r(_h,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),_h.forEach(t),l2=p(Tt),mr=s(Tt,"P",{});var vh=l(mr);i2=r(vh,"This model is a PyTorch "),hr=s(vh,"A",{href:!0,rel:!0});var R0=l(hr);c2=r(R0,"torch.nn.Module"),R0.forEach(t),d2=r(vh,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),vh.forEach(t),p2=p(Tt),dt=s(Tt,"DIV",{class:!0});var _s=l(dt);w(fr.$$.fragment,_s),m2=p(_s),Jo=s(_s,"P",{});var Hi=l(Jo);h2=r(Hi,"The "),ji=s(Hi,"A",{href:!0});var A0=l(ji);f2=r(A0,"Wav2Vec2ForSequenceClassification"),A0.forEach(t),u2=r(Hi," forward method, overrides the "),dd=s(Hi,"CODE",{});var q0=l(dd);g2=r(q0,"__call__"),q0.forEach(t),_2=r(Hi," special method."),Hi.forEach(t),v2=p(_s),w($a.$$.fragment,_s),b2=p(_s),w(Ca.$$.fragment,_s),_s.forEach(t),Tt.forEach(t),sm=p(o),Fo=s(o,"H2",{class:!0});var bh=l(Fo);Ua=s(bh,"A",{id:!0,class:!0,href:!0});var Y0=l(Ua);pd=s(Y0,"SPAN",{});var P0=l(pd);w(ur.$$.fragment,P0),P0.forEach(t),Y0.forEach(t),y2=p(bh),md=s(bh,"SPAN",{});var S0=l(md);w2=r(S0,"Wav2Vec2ForAudioFrameClassification"),S0.forEach(t),bh.forEach(t),nm=p(o),_e=s(o,"DIV",{class:!0});var Mt=l(_e);w(gr.$$.fragment,Mt),T2=p(Mt),hd=s(Mt,"P",{});var Q0=l(hd);M2=r(Q0,"Wav2Vec2 Model with a frame classification head on top for tasks like Speaker Diarization."),Q0.forEach(t),j2=p(Mt),_r=s(Mt,"P",{});var yh=l(_r);k2=r(yh,"Wav2Vec2 was proposed in "),vr=s(yh,"A",{href:!0,rel:!0});var L0=l(vr);W2=r(L0,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),L0.forEach(t),V2=r(yh,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),yh.forEach(t),J2=p(Mt),br=s(Mt,"P",{});var wh=l(br);F2=r(wh,"This model inherits from "),ki=s(wh,"A",{href:!0});var H0=l(ki);x2=r(H0,"PreTrainedModel"),H0.forEach(t),$2=r(wh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),wh.forEach(t),C2=p(Mt),yr=s(Mt,"P",{});var Th=l(yr);U2=r(Th,"This model is a PyTorch "),wr=s(Th,"A",{href:!0,rel:!0});var D0=l(wr);E2=r(D0,"torch.nn.Module"),D0.forEach(t),Z2=r(Th,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Th.forEach(t),I2=p(Mt),pt=s(Mt,"DIV",{class:!0});var vs=l(pt);w(Tr.$$.fragment,vs),z2=p(vs),xo=s(vs,"P",{});var Di=l(xo);B2=r(Di,"The "),Wi=s(Di,"A",{href:!0});var O0=l(Wi);N2=r(O0,"Wav2Vec2ForAudioFrameClassification"),O0.forEach(t),X2=r(Di," forward method, overrides the "),fd=s(Di,"CODE",{});var K0=l(fd);G2=r(K0,"__call__"),K0.forEach(t),R2=r(Di," special method."),Di.forEach(t),A2=p(vs),w(Ea.$$.fragment,vs),q2=p(vs),w(Za.$$.fragment,vs),vs.forEach(t),Mt.forEach(t),rm=p(o),$o=s(o,"H2",{class:!0});var Mh=l($o);Ia=s(Mh,"A",{id:!0,class:!0,href:!0});var ej=l(Ia);ud=s(ej,"SPAN",{});var tj=l(ud);w(Mr.$$.fragment,tj),tj.forEach(t),ej.forEach(t),Y2=p(Mh),gd=s(Mh,"SPAN",{});var oj=l(gd);P2=r(oj,"Wav2Vec2ForXVector"),oj.forEach(t),Mh.forEach(t),lm=p(o),ve=s(o,"DIV",{class:!0});var jt=l(ve);w(jr.$$.fragment,jt),S2=p(jt),_d=s(jt,"P",{});var aj=l(_d);Q2=r(aj,"Wav2Vec2 Model with an XVector feature extraction head on top for tasks like Speaker Verification."),aj.forEach(t),L2=p(jt),kr=s(jt,"P",{});var jh=l(kr);H2=r(jh,"Wav2Vec2 was proposed in "),Wr=s(jh,"A",{href:!0,rel:!0});var sj=l(Wr);D2=r(sj,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),sj.forEach(t),O2=r(jh,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),jh.forEach(t),K2=p(jt),Vr=s(jt,"P",{});var kh=l(Vr);eb=r(kh,"This model inherits from "),Vi=s(kh,"A",{href:!0});var nj=l(Vi);tb=r(nj,"PreTrainedModel"),nj.forEach(t),ob=r(kh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),kh.forEach(t),ab=p(jt),Jr=s(jt,"P",{});var Wh=l(Jr);sb=r(Wh,"This model is a PyTorch "),Fr=s(Wh,"A",{href:!0,rel:!0});var rj=l(Fr);nb=r(rj,"torch.nn.Module"),rj.forEach(t),rb=r(Wh,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Wh.forEach(t),lb=p(jt),mt=s(jt,"DIV",{class:!0});var bs=l(mt);w(xr.$$.fragment,bs),ib=p(bs),Co=s(bs,"P",{});var Oi=l(Co);cb=r(Oi,"The "),Ji=s(Oi,"A",{href:!0});var lj=l(Ji);db=r(lj,"Wav2Vec2ForXVector"),lj.forEach(t),pb=r(Oi," forward method, overrides the "),vd=s(Oi,"CODE",{});var ij=l(vd);mb=r(ij,"__call__"),ij.forEach(t),hb=r(Oi," special method."),Oi.forEach(t),fb=p(bs),w(za.$$.fragment,bs),ub=p(bs),w(Ba.$$.fragment,bs),bs.forEach(t),jt.forEach(t),im=p(o),Uo=s(o,"H2",{class:!0});var Vh=l(Uo);Na=s(Vh,"A",{id:!0,class:!0,href:!0});var cj=l(Na);bd=s(cj,"SPAN",{});var dj=l(bd);w($r.$$.fragment,dj),dj.forEach(t),cj.forEach(t),gb=p(Vh),yd=s(Vh,"SPAN",{});var pj=l(yd);_b=r(pj,"Wav2Vec2ForPreTraining"),pj.forEach(t),Vh.forEach(t),cm=p(o),Ne=s(o,"DIV",{class:!0});var Ot=l(Ne);w(Cr.$$.fragment,Ot),vb=p(Ot),Eo=s(Ot,"P",{});var Ki=l(Eo);bb=r(Ki,"Wav2Vec2 Model with a quantizer and "),wd=s(Ki,"CODE",{});var mj=l(wd);yb=r(mj,"VQ"),mj.forEach(t),wb=r(Ki,` head on top.
Wav2Vec2 was proposed in `),Ur=s(Ki,"A",{href:!0,rel:!0});var hj=l(Ur);Tb=r(hj,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),hj.forEach(t),Mb=r(Ki,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Ki.forEach(t),jb=p(Ot),Er=s(Ot,"P",{});var Jh=l(Er);kb=r(Jh,"This model inherits from "),Fi=s(Jh,"A",{href:!0});var fj=l(Fi);Wb=r(fj,"PreTrainedModel"),fj.forEach(t),Vb=r(Jh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Jh.forEach(t),Jb=p(Ot),Zr=s(Ot,"P",{});var Fh=l(Zr);Fb=r(Fh,"This model is a PyTorch "),Ir=s(Fh,"A",{href:!0,rel:!0});var uj=l(Ir);xb=r(uj,"torch.nn.Module"),uj.forEach(t),$b=r(Fh,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Fh.forEach(t),Cb=p(Ot),ht=s(Ot,"DIV",{class:!0});var ys=l(ht);w(zr.$$.fragment,ys),Ub=p(ys),Zo=s(ys,"P",{});var ec=l(Zo);Eb=r(ec,"The "),xi=s(ec,"A",{href:!0});var gj=l(xi);Zb=r(gj,"Wav2Vec2ForPreTraining"),gj.forEach(t),Ib=r(ec," forward method, overrides the "),Td=s(ec,"CODE",{});var _j=l(Td);zb=r(_j,"__call__"),_j.forEach(t),Bb=r(ec," special method."),ec.forEach(t),Nb=p(ys),w(Xa.$$.fragment,ys),Xb=p(ys),w(Ga.$$.fragment,ys),ys.forEach(t),Ot.forEach(t),dm=p(o),Io=s(o,"H2",{class:!0});var xh=l(Io);Ra=s(xh,"A",{id:!0,class:!0,href:!0});var vj=l(Ra);Md=s(vj,"SPAN",{});var bj=l(Md);w(Br.$$.fragment,bj),bj.forEach(t),vj.forEach(t),Gb=p(xh),jd=s(xh,"SPAN",{});var yj=l(jd);Rb=r(yj,"TFWav2Vec2Model"),yj.forEach(t),xh.forEach(t),pm=p(o),be=s(o,"DIV",{class:!0});var kt=l(be);w(Nr.$$.fragment,kt),Ab=p(kt),kd=s(kt,"P",{});var wj=l(kd);qb=r(wj,"The bare TFWav2Vec2 Model transformer outputing raw hidden-states without any specific head on top."),wj.forEach(t),Yb=p(kt),Xr=s(kt,"P",{});var $h=l(Xr);Pb=r($h,"This model inherits from "),$i=s($h,"A",{href:!0});var Tj=l($i);Sb=r(Tj,"TFPreTrainedModel"),Tj.forEach(t),Qb=r($h,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),$h.forEach(t),Lb=p(kt),Gr=s(kt,"P",{});var Ch=l(Gr);Hb=r(Ch,"This model is also a "),Rr=s(Ch,"A",{href:!0,rel:!0});var Mj=l(Rr);Db=r(Mj,"tf.keras.Model"),Mj.forEach(t),Ob=r(Ch,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Ch.forEach(t),Kb=p(kt),w(Aa.$$.fragment,kt),ey=p(kt),ft=s(kt,"DIV",{class:!0});var ws=l(ft);w(Ar.$$.fragment,ws),ty=p(ws),zo=s(ws,"P",{});var tc=l(zo);oy=r(tc,"The "),Ci=s(tc,"A",{href:!0});var jj=l(Ci);ay=r(jj,"TFWav2Vec2Model"),jj.forEach(t),sy=r(tc," forward method, overrides the "),Wd=s(tc,"CODE",{});var kj=l(Wd);ny=r(kj,"__call__"),kj.forEach(t),ry=r(tc," special method."),tc.forEach(t),ly=p(ws),w(qa.$$.fragment,ws),iy=p(ws),w(Ya.$$.fragment,ws),ws.forEach(t),kt.forEach(t),mm=p(o),Bo=s(o,"H2",{class:!0});var Uh=l(Bo);Pa=s(Uh,"A",{id:!0,class:!0,href:!0});var Wj=l(Pa);Vd=s(Wj,"SPAN",{});var Vj=l(Vd);w(qr.$$.fragment,Vj),Vj.forEach(t),Wj.forEach(t),cy=p(Uh),Jd=s(Uh,"SPAN",{});var Jj=l(Jd);dy=r(Jj,"TFWav2Vec2ForSequenceClassification"),Jj.forEach(t),Uh.forEach(t),hm=p(o),No=s(o,"DIV",{class:!0});var Eh=l(No);w(Yr.$$.fragment,Eh),py=p(Eh),Ui=s(Eh,"DIV",{class:!0});var Fj=l(Ui);w(Pr.$$.fragment,Fj),Fj.forEach(t),Eh.forEach(t),fm=p(o),Xo=s(o,"H2",{class:!0});var Zh=l(Xo);Sa=s(Zh,"A",{id:!0,class:!0,href:!0});var xj=l(Sa);Fd=s(xj,"SPAN",{});var $j=l(Fd);w(Sr.$$.fragment,$j),$j.forEach(t),xj.forEach(t),my=p(Zh),xd=s(Zh,"SPAN",{});var Cj=l(xd);hy=r(Cj,"TFWav2Vec2ForCTC"),Cj.forEach(t),Zh.forEach(t),um=p(o),ye=s(o,"DIV",{class:!0});var Wt=l(ye);w(Qr.$$.fragment,Wt),fy=p(Wt),Lr=s(Wt,"P",{});var Ih=l(Lr);uy=r(Ih,"TFWav2Vec2 Model with a "),$d=s(Ih,"CODE",{});var Uj=l($d);gy=r(Uj,"language modeling"),Uj.forEach(t),_y=r(Ih," head on top for Connectionist Temporal Classification (CTC)."),Ih.forEach(t),vy=p(Wt),Hr=s(Wt,"P",{});var zh=l(Hr);by=r(zh,"This model inherits from "),Ei=s(zh,"A",{href:!0});var Ej=l(Ei);yy=r(Ej,"TFPreTrainedModel"),Ej.forEach(t),wy=r(zh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),zh.forEach(t),Ty=p(Wt),Dr=s(Wt,"P",{});var Bh=l(Dr);My=r(Bh,"This model is also a "),Or=s(Bh,"A",{href:!0,rel:!0});var Zj=l(Or);jy=r(Zj,"tf.keras.Model"),Zj.forEach(t),ky=r(Bh,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Bh.forEach(t),Wy=p(Wt),w(Qa.$$.fragment,Wt),Vy=p(Wt),ut=s(Wt,"DIV",{class:!0});var Ts=l(ut);w(Kr.$$.fragment,Ts),Jy=p(Ts),Go=s(Ts,"P",{});var oc=l(Go);Fy=r(oc,"The "),Zi=s(oc,"A",{href:!0});var Ij=l(Zi);xy=r(Ij,"TFWav2Vec2ForCTC"),Ij.forEach(t),$y=r(oc," forward method, overrides the "),Cd=s(oc,"CODE",{});var zj=l(Cd);Cy=r(zj,"__call__"),zj.forEach(t),Uy=r(oc," special method."),oc.forEach(t),Ey=p(Ts),w(La.$$.fragment,Ts),Zy=p(Ts),w(Ha.$$.fragment,Ts),Ts.forEach(t),Wt.forEach(t),gm=p(o),Ro=s(o,"H2",{class:!0});var Nh=l(Ro);Da=s(Nh,"A",{id:!0,class:!0,href:!0});var Bj=l(Da);Ud=s(Bj,"SPAN",{});var Nj=l(Ud);w(el.$$.fragment,Nj),Nj.forEach(t),Bj.forEach(t),Iy=p(Nh),Ed=s(Nh,"SPAN",{});var Xj=l(Ed);zy=r(Xj,"FlaxWav2Vec2Model"),Xj.forEach(t),Nh.forEach(t),_m=p(o),re=s(o,"DIV",{class:!0});var Pe=l(re);w(tl.$$.fragment,Pe),By=p(Pe),ol=s(Pe,"P",{});var Xh=l(ol);Ny=r(Xh,`The bare Wav2Vec2 Model transformer outputting raw hidden-states without any specific head on top.
Wav2Vec2 was proposed in `),al=s(Xh,"A",{href:!0,rel:!0});var Gj=l(al);Xy=r(Gj,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),Gj.forEach(t),Gy=r(Xh,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Xh.forEach(t),Ry=p(Pe),sl=s(Pe,"P",{});var Gh=l(sl);Ay=r(Gh,"This model inherits from "),Ii=s(Gh,"A",{href:!0});var Rj=l(Ii);qy=r(Rj,"FlaxPreTrainedModel"),Rj.forEach(t),Yy=r(Gh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Gh.forEach(t),Py=p(Pe),nl=s(Pe,"P",{});var Rh=l(nl);Sy=r(Rh,`This model is also a Flax Linen
`),rl=s(Rh,"A",{href:!0,rel:!0});var Aj=l(rl);Qy=r(Aj,"flax.nn.Module"),Aj.forEach(t),Ly=r(Rh,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Rh.forEach(t),Hy=p(Pe),Zd=s(Pe,"P",{});var qj=l(Zd);Dy=r(qj,"Finally, this model supports inherent JAX features such as:"),qj.forEach(t),Oy=p(Pe),Xt=s(Pe,"UL",{});var Ms=l(Xt);Id=s(Ms,"LI",{});var Yj=l(Id);ll=s(Yj,"A",{href:!0,rel:!0});var Pj=l(ll);Ky=r(Pj,"Just-In-Time (JIT) compilation"),Pj.forEach(t),Yj.forEach(t),ew=p(Ms),zd=s(Ms,"LI",{});var Sj=l(zd);il=s(Sj,"A",{href:!0,rel:!0});var Qj=l(il);tw=r(Qj,"Automatic Differentiation"),Qj.forEach(t),Sj.forEach(t),ow=p(Ms),Bd=s(Ms,"LI",{});var Lj=l(Bd);cl=s(Lj,"A",{href:!0,rel:!0});var Hj=l(cl);aw=r(Hj,"Vectorization"),Hj.forEach(t),Lj.forEach(t),sw=p(Ms),Nd=s(Ms,"LI",{});var Dj=l(Nd);dl=s(Dj,"A",{href:!0,rel:!0});var Oj=l(dl);nw=r(Oj,"Parallelization"),Oj.forEach(t),Dj.forEach(t),Ms.forEach(t),rw=p(Pe),gt=s(Pe,"DIV",{class:!0});var js=l(gt);w(pl.$$.fragment,js),lw=p(js),Ao=s(js,"P",{});var ac=l(Ao);iw=r(ac,"The "),Xd=s(ac,"CODE",{});var Kj=l(Xd);cw=r(Kj,"FlaxWav2Vec2PreTrainedModel"),Kj.forEach(t),dw=r(ac," forward method, overrides the "),Gd=s(ac,"CODE",{});var e1=l(Gd);pw=r(e1,"__call__"),e1.forEach(t),mw=r(ac," special method."),ac.forEach(t),hw=p(js),w(Oa.$$.fragment,js),fw=p(js),w(Ka.$$.fragment,js),js.forEach(t),Pe.forEach(t),vm=p(o),qo=s(o,"H2",{class:!0});var Ah=l(qo);es=s(Ah,"A",{id:!0,class:!0,href:!0});var t1=l(es);Rd=s(t1,"SPAN",{});var o1=l(Rd);w(ml.$$.fragment,o1),o1.forEach(t),t1.forEach(t),uw=p(Ah),Ad=s(Ah,"SPAN",{});var a1=l(Ad);gw=r(a1,"FlaxWav2Vec2ForCTC"),a1.forEach(t),Ah.forEach(t),bm=p(o),le=s(o,"DIV",{class:!0});var Se=l(le);w(hl.$$.fragment,Se),_w=p(Se),Yo=s(Se,"P",{});var sc=l(Yo);vw=r(sc,"Wav2Vec2 Model with a "),qd=s(sc,"CODE",{});var s1=l(qd);bw=r(s1,"language modeling"),s1.forEach(t),yw=r(sc,` head on top for Connectionist Temporal Classification (CTC).
Wav2Vec2 was proposed in `),fl=s(sc,"A",{href:!0,rel:!0});var n1=l(fl);ww=r(n1,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),n1.forEach(t),Tw=r(sc,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),sc.forEach(t),Mw=p(Se),ul=s(Se,"P",{});var qh=l(ul);jw=r(qh,"This model inherits from "),zi=s(qh,"A",{href:!0});var r1=l(zi);kw=r(r1,"FlaxPreTrainedModel"),r1.forEach(t),Ww=r(qh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),qh.forEach(t),Vw=p(Se),gl=s(Se,"P",{});var Yh=l(gl);Jw=r(Yh,`This model is also a Flax Linen
`),_l=s(Yh,"A",{href:!0,rel:!0});var l1=l(_l);Fw=r(l1,"flax.nn.Module"),l1.forEach(t),xw=r(Yh,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Yh.forEach(t),$w=p(Se),Yd=s(Se,"P",{});var i1=l(Yd);Cw=r(i1,"Finally, this model supports inherent JAX features such as:"),i1.forEach(t),Uw=p(Se),Gt=s(Se,"UL",{});var ks=l(Gt);Pd=s(ks,"LI",{});var c1=l(Pd);vl=s(c1,"A",{href:!0,rel:!0});var d1=l(vl);Ew=r(d1,"Just-In-Time (JIT) compilation"),d1.forEach(t),c1.forEach(t),Zw=p(ks),Sd=s(ks,"LI",{});var p1=l(Sd);bl=s(p1,"A",{href:!0,rel:!0});var m1=l(bl);Iw=r(m1,"Automatic Differentiation"),m1.forEach(t),p1.forEach(t),zw=p(ks),Qd=s(ks,"LI",{});var h1=l(Qd);yl=s(h1,"A",{href:!0,rel:!0});var f1=l(yl);Bw=r(f1,"Vectorization"),f1.forEach(t),h1.forEach(t),Nw=p(ks),Ld=s(ks,"LI",{});var u1=l(Ld);wl=s(u1,"A",{href:!0,rel:!0});var g1=l(wl);Xw=r(g1,"Parallelization"),g1.forEach(t),u1.forEach(t),ks.forEach(t),Gw=p(Se),_t=s(Se,"DIV",{class:!0});var Ws=l(_t);w(Tl.$$.fragment,Ws),Rw=p(Ws),Po=s(Ws,"P",{});var nc=l(Po);Aw=r(nc,"The "),Hd=s(nc,"CODE",{});var _1=l(Hd);qw=r(_1,"FlaxWav2Vec2PreTrainedModel"),_1.forEach(t),Yw=r(nc," forward method, overrides the "),Dd=s(nc,"CODE",{});var v1=l(Dd);Pw=r(v1,"__call__"),v1.forEach(t),Sw=r(nc," special method."),nc.forEach(t),Qw=p(Ws),w(ts.$$.fragment,Ws),Lw=p(Ws),w(os.$$.fragment,Ws),Ws.forEach(t),Se.forEach(t),ym=p(o),So=s(o,"H2",{class:!0});var Ph=l(So);as=s(Ph,"A",{id:!0,class:!0,href:!0});var b1=l(as);Od=s(b1,"SPAN",{});var y1=l(Od);w(Ml.$$.fragment,y1),y1.forEach(t),b1.forEach(t),Hw=p(Ph),Kd=s(Ph,"SPAN",{});var w1=l(Kd);Dw=r(w1,"FlaxWav2Vec2ForPreTraining"),w1.forEach(t),Ph.forEach(t),wm=p(o),ie=s(o,"DIV",{class:!0});var Qe=l(ie);w(jl.$$.fragment,Qe),Ow=p(Qe),Qo=s(Qe,"P",{});var rc=l(Qo);Kw=r(rc,"Wav2Vec2 Model with a quantizer and "),ep=s(rc,"CODE",{});var T1=l(ep);eT=r(T1,"VQ"),T1.forEach(t),tT=r(rc,` head on top.
Wav2Vec2 was proposed in `),kl=s(rc,"A",{href:!0,rel:!0});var M1=l(kl);oT=r(M1,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),M1.forEach(t),aT=r(rc,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),rc.forEach(t),sT=p(Qe),Wl=s(Qe,"P",{});var Sh=l(Wl);nT=r(Sh,"This model inherits from "),Bi=s(Sh,"A",{href:!0});var j1=l(Bi);rT=r(j1,"FlaxPreTrainedModel"),j1.forEach(t),lT=r(Sh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Sh.forEach(t),iT=p(Qe),Vl=s(Qe,"P",{});var Qh=l(Vl);cT=r(Qh,`This model is also a Flax Linen
`),Jl=s(Qh,"A",{href:!0,rel:!0});var k1=l(Jl);dT=r(k1,"flax.nn.Module"),k1.forEach(t),pT=r(Qh,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Qh.forEach(t),mT=p(Qe),tp=s(Qe,"P",{});var W1=l(tp);hT=r(W1,"Finally, this model supports inherent JAX features such as:"),W1.forEach(t),fT=p(Qe),Rt=s(Qe,"UL",{});var Vs=l(Rt);op=s(Vs,"LI",{});var V1=l(op);Fl=s(V1,"A",{href:!0,rel:!0});var J1=l(Fl);uT=r(J1,"Just-In-Time (JIT) compilation"),J1.forEach(t),V1.forEach(t),gT=p(Vs),ap=s(Vs,"LI",{});var F1=l(ap);xl=s(F1,"A",{href:!0,rel:!0});var x1=l(xl);_T=r(x1,"Automatic Differentiation"),x1.forEach(t),F1.forEach(t),vT=p(Vs),sp=s(Vs,"LI",{});var $1=l(sp);$l=s($1,"A",{href:!0,rel:!0});var C1=l($l);bT=r(C1,"Vectorization"),C1.forEach(t),$1.forEach(t),yT=p(Vs),np=s(Vs,"LI",{});var U1=l(np);Cl=s(U1,"A",{href:!0,rel:!0});var E1=l(Cl);wT=r(E1,"Parallelization"),E1.forEach(t),U1.forEach(t),Vs.forEach(t),TT=p(Qe),vt=s(Qe,"DIV",{class:!0});var Js=l(vt);w(Ul.$$.fragment,Js),MT=p(Js),Lo=s(Js,"P",{});var lc=l(Lo);jT=r(lc,"The "),Ni=s(lc,"A",{href:!0});var Z1=l(Ni);kT=r(Z1,"FlaxWav2Vec2ForPreTraining"),Z1.forEach(t),WT=r(lc," forward method, overrides the "),rp=s(lc,"CODE",{});var I1=l(rp);VT=r(I1,"__call__"),I1.forEach(t),JT=r(lc," special method."),lc.forEach(t),FT=p(Js),w(ss.$$.fragment,Js),xT=p(Js),w(ns.$$.fragment,Js),Js.forEach(t),Qe.forEach(t),this.h()},h(){c(m,"name","hf:doc:metadata"),c(m,"content",JSON.stringify(Tk)),c(f,"id","wav2vec2"),c(f,"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(f,"href","#wav2vec2"),c(u,"class","relative group"),c(Z,"id","overview"),c(Z,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Z,"href","#overview"),c(E,"class","relative group"),c(G,"href","https://arxiv.org/abs/2006.11477"),c(G,"rel","nofollow"),c(Y,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer"),c(Ze,"href","https://huggingface.co/patrickvonplaten"),c(Ze,"rel","nofollow"),c(Me,"id","resources"),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","#resources"),c(ee,"class","relative group"),c(De,"href","https://colab.research.google.com/github/m3hrdadfi/soxan/blob/main/notebooks/Emotion_recognition_in_Greek_speech_using_Wav2Vec2.ipynb"),c(De,"rel","nofollow"),c(pe,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC"),c(ne,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/audio-classification"),c(ne,"rel","nofollow"),c(ze,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/audio_classification.ipynb"),c(ze,"rel","nofollow"),c(Al,"href","../tasks/audio_classification"),c($s,"href","https://huggingface.co/blog/wav2vec2-with-ngram"),c($s,"rel","nofollow"),c(Us,"href","https://huggingface.co/blog/fine-tune-wav2vec2-english"),c(Us,"rel","nofollow"),c(Zs,"href","https://huggingface.co/blog/fine-tune-xlsr-wav2vec2"),c(Zs,"rel","nofollow"),c(zs,"href","https://colab.research.google.com/github/Muennighoff/ytclipcc/blob/main/wav2vec_youtube_captions.ipynb"),c(zs,"rel","nofollow"),c(ql,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC"),c(Bs,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/speech_recognition.ipynb"),c(Bs,"rel","nofollow"),c(Ns,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multi_lingual_speech_recognition.ipynb"),c(Ns,"rel","nofollow"),c(Yl,"href","../tasks/asr"),c(Gs,"href","https://www.philschmid.de/automatic-speech-recognition-sagemaker"),c(Gs,"rel","nofollow"),c(Do,"id","transformers.Wav2Vec2Config"),c(Do,"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(Do,"href","#transformers.Wav2Vec2Config"),c(co,"class","relative group"),c(Ql,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Model"),c(qs,"href","https://huggingface.co/facebook/wav2vec2-base-960h"),c(qs,"rel","nofollow"),c(Ll,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Hl,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ko,"id","transformers.Wav2Vec2CTCTokenizer"),c(Ko,"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(Ko,"href","#transformers.Wav2Vec2CTCTokenizer"),c(ho,"class","relative group"),c(Dl,"href","/docs/transformers/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),c(ea,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ol,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(oa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(aa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(sa,"id","transformers.Wav2Vec2FeatureExtractor"),c(sa,"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(sa,"href","#transformers.Wav2Vec2FeatureExtractor"),c(fo,"class","relative group"),c(Kl,"href","/docs/transformers/v4.33.0/en/main_classes/feature_extractor#transformers.SequenceFeatureExtractor"),c(na,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ra,"id","transformers.Wav2Vec2Processor"),c(ra,"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(ra,"href","#transformers.Wav2Vec2Processor"),c(uo,"class","relative group"),c(ei,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor"),c(ti,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor"),c(oi,"href","/docs/transformers/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),c(rn,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__"),c(ai,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.decode"),c(cn,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor.__call__"),c(dn,"href","/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"),c(la,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(si,"href","/docs/transformers/v4.33.0/en/main_classes/feature_extractor#transformers.SequenceFeatureExtractor.pad"),c(ni,"href","/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.pad"),c(ia,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ri,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(li,"href","/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutProcessor.from_pretrained"),c(St,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ii,"href","/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode"),c(da,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ci,"href","/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode"),c(pa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ma,"id","transformers.Wav2Vec2ProcessorWithLM"),c(ma,"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(ma,"href","#transformers.Wav2Vec2ProcessorWithLM"),c(go,"class","relative group"),c(Tn,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor.__call__"),c(Mn,"href","/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"),c(ha,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(di,"href","/docs/transformers/v4.33.0/en/main_classes/feature_extractor#transformers.SequenceFeatureExtractor.pad"),c(pi,"href","/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.pad"),c(fa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(mi,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2ProcessorWithLM"),c(Qt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(hi,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(fi,"href","#decoding-multiple-audios"),c(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Lt,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(va,"id","decoding-multiple-audios"),c(va,"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(va,"href","#decoding-multiple-audios"),c(_o,"class","relative group"),c(ui,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2ProcessorWithLM.batch_decode"),c(gi,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2ProcessorWithLM.batch_decode"),c(_i,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2ProcessorWithLM.decode"),c(ba,"id","transformers.models.wav2vec2_with_lm.processing_wav2vec2_with_lm.Wav2Vec2DecoderWithLMOutput"),c(ba,"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(ba,"href","#transformers.models.wav2vec2_with_lm.processing_wav2vec2_with_lm.Wav2Vec2DecoderWithLMOutput"),c(vo,"class","relative group"),c(bo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(yo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(vi,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2ForPreTraining"),c(wo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ya,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(wa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ta,"id","transformers.Wav2Vec2Model"),c(Ta,"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(Ta,"href","#transformers.Wav2Vec2Model"),c(To,"class","relative group"),c(Qn,"href","https://arxiv.org/abs/2006.11477"),c(Qn,"rel","nofollow"),c(bi,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),c(Dn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Dn,"rel","nofollow"),c(yi,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Model"),c(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ka,"id","transformers.Wav2Vec2ForCTC"),c(ka,"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(ka,"href","#transformers.Wav2Vec2ForCTC"),c(jo,"class","relative group"),c(tr,"href","https://arxiv.org/abs/2006.11477"),c(tr,"rel","nofollow"),c(wi,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),c(sr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(sr,"rel","nofollow"),c(Ti,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC"),c(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(xa,"id","transformers.Wav2Vec2ForSequenceClassification"),c(xa,"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(xa,"href","#transformers.Wav2Vec2ForSequenceClassification"),c(Vo,"class","relative group"),c(dr,"href","https://arxiv.org/abs/2006.11477"),c(dr,"rel","nofollow"),c(Mi,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),c(hr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(hr,"rel","nofollow"),c(ji,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2ForSequenceClassification"),c(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ua,"id","transformers.Wav2Vec2ForAudioFrameClassification"),c(Ua,"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(Ua,"href","#transformers.Wav2Vec2ForAudioFrameClassification"),c(Fo,"class","relative group"),c(vr,"href","https://arxiv.org/abs/2006.11477"),c(vr,"rel","nofollow"),c(ki,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),c(wr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(wr,"rel","nofollow"),c(Wi,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2ForAudioFrameClassification"),c(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ia,"id","transformers.Wav2Vec2ForXVector"),c(Ia,"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(Ia,"href","#transformers.Wav2Vec2ForXVector"),c($o,"class","relative group"),c(Wr,"href","https://arxiv.org/abs/2006.11477"),c(Wr,"rel","nofollow"),c(Vi,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),c(Fr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Fr,"rel","nofollow"),c(Ji,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2ForXVector"),c(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Na,"id","transformers.Wav2Vec2ForPreTraining"),c(Na,"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(Na,"href","#transformers.Wav2Vec2ForPreTraining"),c(Uo,"class","relative group"),c(Ur,"href","https://arxiv.org/abs/2006.11477"),c(Ur,"rel","nofollow"),c(Fi,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),c(Ir,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Ir,"rel","nofollow"),c(xi,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.Wav2Vec2ForPreTraining"),c(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ra,"id","transformers.TFWav2Vec2Model"),c(Ra,"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(Ra,"href","#transformers.TFWav2Vec2Model"),c(Io,"class","relative group"),c($i,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.TFPreTrainedModel"),c(Rr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),c(Rr,"rel","nofollow"),c(Ci,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.TFWav2Vec2Model"),c(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Pa,"id","transformers.TFWav2Vec2ForSequenceClassification"),c(Pa,"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(Pa,"href","#transformers.TFWav2Vec2ForSequenceClassification"),c(Bo,"class","relative group"),c(Ui,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(No,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Sa,"id","transformers.TFWav2Vec2ForCTC"),c(Sa,"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(Sa,"href","#transformers.TFWav2Vec2ForCTC"),c(Xo,"class","relative group"),c(Ei,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.TFPreTrainedModel"),c(Or,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),c(Or,"rel","nofollow"),c(Zi,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.TFWav2Vec2ForCTC"),c(ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Da,"id","transformers.FlaxWav2Vec2Model"),c(Da,"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(Da,"href","#transformers.FlaxWav2Vec2Model"),c(Ro,"class","relative group"),c(al,"href","https://arxiv.org/abs/2006.11477"),c(al,"rel","nofollow"),c(Ii,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),c(rl,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),c(rl,"rel","nofollow"),c(ll,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),c(ll,"rel","nofollow"),c(il,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),c(il,"rel","nofollow"),c(cl,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),c(cl,"rel","nofollow"),c(dl,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),c(dl,"rel","nofollow"),c(gt,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(es,"id","transformers.FlaxWav2Vec2ForCTC"),c(es,"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(es,"href","#transformers.FlaxWav2Vec2ForCTC"),c(qo,"class","relative group"),c(fl,"href","https://arxiv.org/abs/2006.11477"),c(fl,"rel","nofollow"),c(zi,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),c(_l,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),c(_l,"rel","nofollow"),c(vl,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),c(vl,"rel","nofollow"),c(bl,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),c(bl,"rel","nofollow"),c(yl,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),c(yl,"rel","nofollow"),c(wl,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),c(wl,"rel","nofollow"),c(_t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(as,"id","transformers.FlaxWav2Vec2ForPreTraining"),c(as,"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(as,"href","#transformers.FlaxWav2Vec2ForPreTraining"),c(So,"class","relative group"),c(kl,"href","https://arxiv.org/abs/2006.11477"),c(kl,"rel","nofollow"),c(Bi,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),c(Jl,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),c(Jl,"rel","nofollow"),c(Fl,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),c(Fl,"rel","nofollow"),c(xl,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),c(xl,"rel","nofollow"),c($l,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),c($l,"rel","nofollow"),c(Cl,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),c(Cl,"rel","nofollow"),c(Ni,"href","/docs/transformers/v4.33.0/en/model_doc/wav2vec2#transformers.FlaxWav2Vec2ForPreTraining"),c(vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,g){e(document.head,m),_(o,b,g),_(o,u,g),e(u,f),e(f,v),T(i,v,null),e(u,h),e(u,J),e(J,I),_(o,z,g),_(o,E,g),e(E,Z),e(Z,R),T(x,R,null),e(E,B),e(E,$),e($,ce),_(o,H,g),_(o,X,g),e(X,de),e(X,G),e(G,q),e(X,Re),_(o,S,g),_(o,D,g),e(D,Ae),_(o,xe,g),_(o,O,g),e(O,Le),e(Le,Vt),_(o,qe,g),_(o,N,g),e(N,K),_(o,tt,g),_(o,se,g),e(se,He),e(He,Jt),e(se,$e),e(se,Ce),e(Ce,Ft),e(Ce,Y),e(Y,xt),e(Ce,Ue),_(o,ot,g),_(o,Te,g),e(Te,Ee),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(o,Zp,g),_(o,ho,g),e(ho,Ko),e(Ko,mc),T(Ys,mc,null),e(ho,Xf),e(ho,hc),e(hc,Gf),_(o,Ip,g),_(o,oe,g),T(Ps,oe,null),e(oe,Rf),e(oe,fc),e(fc,Af),e(oe,qf),e(oe,Ss),e(Ss,Yf),e(Ss,Dl),e(Dl,Pf),e(Ss,Sf),e(oe,Qf),e(oe,ea),T(Qs,ea,null),e(ea,Lf),e(ea,uc),e(uc,Hf),e(oe,Df),e(oe,Ol),T(Ls,Ol,null),e(oe,Of),e(oe,nt),T(Hs,nt,null),e(nt,Kf),e(nt,gc),e(gc,eu),e(nt,tu),e(nt,Ds),e(Ds,ou),e(Ds,_c),e(_c,au),e(Ds,su),e(nt,nu),T(ta,nt,null),e(oe,ru),e(oe,oa),T(Os,oa,null),e(oa,lu),e(oa,vc),e(vc,iu),e(oe,cu),e(oe,aa),T(Ks,aa,null),e(aa,du),e(aa,bc),e(bc,pu),_(o,zp,g),_(o,fo,g),e(fo,sa),e(sa,yc),T(en,yc,null),e(fo,mu),e(fo,wc),e(wc,hu),_(o,Bp,g),_(o,et,g),T(tn,et,null),e(et,fu),e(et,Tc),e(Tc,uu),e(et,gu),e(et,on),e(on,_u),e(on,Kl),e(Kl,vu),e(on,bu),e(et,yu),e(et,na),T(an,na,null),e(na,wu),e(na,Mc),e(Mc,Tu),_(o,Np,g),_(o,uo,g),e(uo,ra),e(ra,jc),T(sn,jc,null),e(uo,Mu),e(uo,kc),e(kc,ju),_(o,Xp,g),_(o,Q,g),T(nn,Q,null),e(Q,ku),e(Q,Wc),e(Wc,Wu),e(Q,Vu),e(Q,Ye),e(Ye,ei),e(ei,Ju),e(Ye,Fu),e(Ye,ti),e(ti,xu),e(Ye,$u),e(Ye,oi),e(oi,Cu),e(Ye,Uu),e(Ye,rn),e(rn,Vc),e(Vc,Eu),e(rn,Zu),e(Ye,Iu),e(Ye,ai),e(ai,zu),e(Ye,Bu),e(Q,Nu),e(Q,la),T(ln,la,null),e(la,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Qt,Dg),T(ua,Qt,null),e(ae,Og),e(ae,hi),T(Vn,hi,null),e(ae,Kg),e(ae,rt),T(Jn,rt,null),e(rt,e_),e(rt,Nc),e(Nc,t_),e(rt,o_),T(ga,rt,null),e(rt,a_),e(rt,Fn),e(Fn,s_),e(Fn,fi),e(fi,n_),e(Fn,r_),e(ae,l_),e(ae,Lt),T(xn,Lt,null),e(Lt,i_),e(Lt,Xc),e(Xc,c_),e(Lt,d_),T(_a,Lt,null),_(o,Ap,g),_(o,_o,g),e(_o,va),e(va,Gc),T($n,Gc,null),e(_o,p_),e(_o,Rc),e(Rc,m_),_(o,qp,g),_(o,We,g),e(We,h_),e(We,ui),e(ui,f_),e(We,u_),e(We,Ac),e(Ac,g_),e(We,__),e(We,gi),e(gi,v_),e(We,b_),e(We,_i),e(_i,y_),e(We,w_),e(We,qc),e(qc,T_),e(We,M_),_(o,Yp,g),T(Cn,o,g),_(o,Pp,g),_(o,vo,g),e(vo,ba),e(ba,Yc),T(Un,Yc,null),e(vo,j_),e(vo,Pc),e(Pc,k_),_(o,Sp,g),_(o,bo,g),T(En,bo,null),e(bo,W_),e(bo,Zn),e(Zn,V_),e(Zn,Sc),e(Sc,J_),e(Zn,F_),_(o,Qp,g),_(o,yo,g),T(In,yo,null),e(yo,x_),e(yo,Qc),e(Qc,$_),_(o,Lp,g),_(o,wo,g),T(zn,wo,null),e(wo,C_),e(wo,Bn),e(Bn,U_),e(Bn,vi),e(vi,E_),e(Bn,Z_),_(o,Hp,g),_(o,Bt,g),T(Nn,Bt,null),e(Bt,I_),e(Bt,Xn),e(Xn,z_),e(Xn,Lc),e(Lc,B_),e(Xn,N_),e(Bt,X_),e(Bt,ya),T(Gn,ya,null),e(ya,G_),e(ya,Hc),e(Hc,R_),_(o,Dp,g),_(o,Nt,g),T(Rn,Nt,null),e(Nt,A_),e(Nt,An),e(An,q_),e(An,Dc),e(Dc,Y_),e(An,P_),e(Nt,S_),e(Nt,wa),T(qn,wa,null),e(wa,Q_),e(wa,Oc),e(Oc,L_),_(o,Op,g),_(o,To,g),e(To,Ta),e(Ta,Kc),T(Yn,Kc,null),e(To,H_),e(To,ed),e(ed,D_),_(o,Kp,g),_(o,Be,g),T(Pn,Be,null),e(Be,O_),e(Be,Sn),e(Sn,K_),e(Sn,Qn),e(Qn,ev),e(Sn,tv),e(Be,ov),e(Be,Ln),e(Ln,av),e(Ln,bi),e(bi,sv),e(Ln,nv),e(Be,rv),e(Be,Hn),e(Hn,lv),e(Hn,Dn),e(Dn,iv),e(Hn,cv),e(Be,dv),e(Be,lt),T(On,lt,null),e(lt,pv),e(lt,Mo),e(Mo,mv),e(Mo,yi),e(yi,hv),e(Mo,fv),e(Mo,td),e(td,uv),e(Mo,gv),e(lt,_v),T(Ma,lt,null),e(lt,vv),T(ja,lt,null),_(o,em,g),_(o,jo,g),e(jo,ka),e(ka,od),T(Kn,od,null),e(jo,bv),e(jo,ad),e(ad,yv),_(o,tm,g),_(o,ue,g),T(er,ue,null),e(ue,wv),e(ue,ko),e(ko,Tv),e(ko,sd),e(sd,Mv),e(ko,jv),e(ko,tr),e(tr,kv),e(ko,Wv),e(ue,Vv),e(ue,or),e(or,Jv),e(or,wi),e(wi,Fv),e(or,xv),e(ue,$v),e(ue,ar),e(ar,Cv),e(ar,sr),e(sr,Uv),e(ar,Ev),e(ue,Zv),e(ue,it),T(nr,it,null),e(it,Iv),e(it,Wo),e(Wo,zv),e(Wo,Ti),e(Ti,Bv),e(Wo,Nv),e(Wo,nd),e(nd,Xv),e(Wo,Gv),e(it,Rv),T(Wa,it,null),e(it,Av),T(Va,it,null),e(ue,qv),e(ue,ct),T(rr,ct,null),e(ct,Yv),e(ct,rd),e(rd,Pv),e(ct,Sv),T(Ja,ct,null),e(ct,Qv),T(Fa,ct,null),_(o,om,g),_(o,Vo,g),e(Vo,xa),e(xa,ld),T(lr,ld,null),e(Vo,Lv),e(Vo,id),e(id,Hv),_(o,am,g),_(o,ge,g),T(ir,ge,null),e(ge,Dv),e(ge,cd),e(cd,Ov),e(ge,Kv),e(ge,cr),e(cr,e2),e(cr,dr),e(dr,t2),e(cr,o2),e(ge,a2),e(ge,pr),e(pr,s2),e(pr,Mi),e(Mi,n2),e(pr,r2),e(ge,l2),e(ge,mr),e(mr,i2),e(mr,hr),e(hr,c2),e(mr,d2),e(ge,p2),e(ge,dt),T(fr,dt,null),e(dt,m2),e(dt,Jo),e(Jo,h2),e(Jo,ji),e(ji,f2),e(Jo,u2),e(Jo,dd),e(dd,g2),e(Jo,_2),e(dt,v2),T($a,dt,null),e(dt,b2),T(Ca,dt,null),_(o,sm,g),_(o,Fo,g),e(Fo,Ua),e(Ua,pd),T(ur,pd,null),e(Fo,y2),e(Fo,md),e(md,w2),_(o,nm,g),_(o,_e,g),T(gr,_e,null),e(_e,T2),e(_e,hd),e(hd,M2),e(_e,j2),e(_e,_r),e(_r,k2),e(_r,vr),e(vr,W2),e(_r,V2),e(_e,J2),e(_e,br),e(br,F2),e(br,ki),e(ki,x2),e(br,$2),e(_e,C2),e(_e,yr),e(yr,U2),e(yr,wr),e(wr,E2),e(yr,Z2),e(_e,I2),e(_e,pt),T(Tr,pt,null),e(pt,z2),e(pt,xo),e(xo,B2),e(xo,Wi),e(Wi,N2),e(xo,X2),e(xo,fd),e(fd,G2),e(xo,R2),e(pt,A2),T(Ea,pt,null),e(pt,q2),T(Za,pt,null),_(o,rm,g),_(o,$o,g),e($o,Ia),e(Ia,ud),T(Mr,ud,null),e($o,Y2),e($o,gd),e(gd,P2),_(o,lm,g),_(o,ve,g),T(jr,ve,null),e(ve,S2),e(ve,_d),e(_d,Q2),e(ve,L2),e(ve,kr),e(kr,H2),e(kr,Wr),e(Wr,D2),e(kr,O2),e(ve,K2),e(ve,Vr),e(Vr,eb),e(Vr,Vi),e(Vi,tb),e(Vr,ob),e(ve,ab),e(ve,Jr),e(Jr,sb),e(Jr,Fr),e(Fr,nb),e(Jr,rb),e(ve,lb),e(ve,mt),T(xr,mt,null),e(mt,ib),e(mt,Co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(Rt,np),e(np,Cl),e(Cl,wT),e(ie,TT),e(ie,vt),T(Ul,vt,null),e(vt,MT),e(vt,Lo),e(Lo,jT),e(Lo,Ni),e(Ni,kT),e(Lo,WT),e(Lo,rp),e(rp,VT),e(Lo,JT),e(vt,FT),T(ss,vt,null),e(vt,xT),T(ns,vt,null),Tm=!0},p(o,[g]){const El={};g&2&&(El.$$scope={dirty:g,ctx:o}),Oo.$set(El);const lp={};g&2&&(lp.$$scope={dirty:g,ctx:o}),ta.$set(lp);const ip={};g&2&&(ip.$$scope={dirty:g,ctx:o}),ca.$set(ip);const cp={};g&2&&(cp.$$scope={dirty:g,ctx:o}),ua.$set(cp);const Zl={};g&2&&(Zl.$$scope={dirty:g,ctx:o}),ga.$set(Zl);const dp={};g&2&&(dp.$$scope={dirty:g,ctx:o}),_a.$set(dp);const pp={};g&2&&(pp.$$scope={dirty:g,ctx:o}),Ma.$set(pp);const mp={};g&2&&(mp.$$scope={dirty:g,ctx:o}),ja.$set(mp);const Il={};g&2&&(Il.$$scope={dirty:g,ctx:o}),Wa.$set(Il);const hp={};g&2&&(hp.$$scope={dirty:g,ctx:o}),Va.$set(hp);const fp={};g&2&&(fp.$$scope={dirty:g,ctx:o}),Ja.$set(fp);const up={};g&2&&(up.$$scope={dirty:g,ctx:o}),Fa.$set(up);const gp={};g&2&&(gp.$$scope={dirty:g,ctx:o}),$a.$set(gp);const _p={};g&2&&(_p.$$scope={dirty:g,ctx:o}),Ca.$set(_p);const zl={};g&2&&(zl.$$scope={dirty:g,ctx:o}),Ea.$set(zl);const vp={};g&2&&(vp.$$scope={dirty:g,ctx:o}),Za.$set(vp);const Bl={};g&2&&(Bl.$$scope={dirty:g,ctx:o}),za.$set(Bl);const bp={};g&2&&(bp.$$scope={dirty:g,ctx:o}),Ba.$set(bp);const Nl={};g&2&&(Nl.$$scope={dirty:g,ctx:o}),Xa.$set(Nl);const yp={};g&2&&(yp.$$scope={dirty:g,ctx:o}),Ga.$set(yp);const Xl={};g&2&&(Xl.$$scope={dirty:g,ctx:o}),Aa.$set(Xl);const wp={};g&2&&(wp.$$scope={dirty:g,ctx:o}),qa.$set(wp);const Tp={};g&2&&(Tp.$$scope={dirty:g,ctx:o}),Ya.$set(Tp);const Mp={};g&2&&(Mp.$$scope={dirty:g,ctx:o}),Qa.$set(Mp);const jp={};g&2&&(jp.$$scope={dirty:g,ctx:o}),La.$set(jp);const Ho={};g&2&&(Ho.$$scope={dirty:g,ctx:o}),Ha.$set(Ho);const Gl={};g&2&&(Gl.$$scope={dirty:g,ctx:o}),Oa.$set(Gl);const kp={};g&2&&(kp.$$scope={dirty:g,ctx:o}),Ka.$set(kp);const Ht={};g&2&&(Ht.$$scope={dirty:g,ctx:o}),ts.$set(Ht);const Wp={};g&2&&(Wp.$$scope={dirty:g,ctx:o}),os.$set(Wp);const Vp={};g&2&&(Vp.$$scope={dirty:g,ctx:o}),ss.$set(Vp);const Jp={};g&2&&(Jp.$$scope={dirty:g,ctx:o}),ns.$set(Jp)},i(o){Tm||(M(i.$$.fragment,o),M(x.$$.fragment,o),M(A.$$.fragment,o),M(fe.$$.fragment,o),M(Fs.$$.fragment,o),M(Rs.$$.fragment,o),M(As.$$.fragment,o),M(Oo.$$.fragment,o),M(Ys.$$.fragment,o),M(Ps.$$.fragment,o),M(Qs.$$.fragment,o),M(Ls.$$.fragment,o),M(Hs.$$.fragment,o),M(ta.$$.fragment,o),M(Os.$$.fragment,o),M(Ks.$$.fragment,o),M(en.$$.fragment,o),M(tn.$$.fragment,o),M(an.$$.fragment,o),M(sn.$$.fragment,o),M(nn.$$.fragment,o),M(ln.$$.fragment,o),M(pn.$$.fragment,o),M(mn.$$.fragment,o),M(hn.$$.fragment,o),M(ca.$$.fragment,o),M(un.$$.fragment,o),M(_n.$$.fragment,o),M(bn.$$.fragment,o),M(yn.$$.fragment,o),M(wn.$$.fragment,o),M(jn.$$.fragment,o),M(kn.$$.fragment,o),M(ua.$$.fragment,o),M(Vn.$$.fragment,o),M(Jn.$$.fragment,o),M(ga.$$.fragment,o),M(xn.$$.fragment,o),M(_a.$$.fragment,o),M($n.$$.fragment,o),M(Cn.$$.fragment,o),M(Un.$$.fragment,o),M(En.$$.fragment,o),M(In.$$.fragment,o),M(zn.$$.fragment,o),M(Nn.$$.fragment,o),M(Gn.$$.fragment,o),M(Rn.$$.fragment,o),M(qn.$$.fragment,o),M(Yn.$$.fragment,o),M(Pn.$$.fragment,o),M(On.$$.fragment,o),M(Ma.$$.fragment,o),M(ja.$$.fragment,o),M(Kn.$$.fragment,o),M(er.$$.fragment,o),M(nr.$$.fragment,o),M(Wa.$$.fragment,o),M(Va.$$.fragment,o),M(rr.$$.fragment,o),M(Ja.$$.fragment,o),M(Fa.$$.fragment,o),M(lr.$$.fragment,o),M(ir.$$.fragment,o),M(fr.$$.fragment,o),M($a.$$.fragment,o),M(Ca.$$.fragment,o),M(ur.$$.fragment,o),M(gr.$$.fragment,o),M(Tr.$$.fragment,o),M(Ea.$$.fragment,o),M(Za.$$.fragment,o),M(Mr.$$.fragment,o),M(jr.$$.fragment,o),M(xr.$$.fragment,o),M(za.$$.fragment,o),M(Ba.$$.fragment,o),M($r.$$.fragment,o),M(Cr.$$.fragment,o),M(zr.$$.fragment,o),M(Xa.$$.fragment,o),M(Ga.$$.fragment,o),M(Br.$$.fragment,o),M(Nr.$$.fragment,o),M(Aa.$$.fragment,o),M(Ar.$$.fragment,o),M(qa.$$.fragment,o),M(Ya.$$.fragment,o),M(qr.$$.fragment,o),M(Yr.$$.fragment,o),M(Pr.$$.fragment,o),M(Sr.$$.fragment,o),M(Qr.$$.fragment,o),M(Qa.$$.fragment,o),M(Kr.$$.fragment,o),M(La.$$.fragment,o),M(Ha.$$.fragment,o),M(el.$$.fragment,o),M(tl.$$.fragment,o),M(pl.$$.fragment,o),M(Oa.$$.fragment,o),M(Ka.$$.fragment,o),M(ml.$$.fragment,o),M(hl.$$.fragment,o),M(Tl.$$.fragment,o),M(ts.$$.fragment,o),M(os.$$.fragment,o),M(Ml.$$.fragment,o),M(jl.$$.fragment,o),M(Ul.$$.fragment,o),M(ss.$$.fragment,o),M(ns.$$.fragment,o),Tm=!0)},o(o){j(i.$$.fragment,o),j(x.$$.fragment,o),j(A.$$.fragment,o),j(fe.$$.fragment,o),j(Fs.$$.fragment,o),j(Rs.$$.fragment,o),j(As.$$.fragment,o),j(Oo.$$.fragment,o),j(Ys.$$.fragment,o),j(Ps.$$.fragment,o),j(Qs.$$.fragment,o),j(Ls.$$.fragment,o),j(Hs.$$.fragment,o),j(ta.$$.fragment,o),j(Os.$$.fragment,o),j(Ks.$$.fragment,o),j(en.$$.fragment,o),j(tn.$$.fragment,o),j(an.$$.fragment,o),j(sn.$$.fragment,o),j(nn.$$.fragment,o),j(ln.$$.fragment,o),j(pn.$$.fragment,o),j(mn.$$.fragment,o),j(hn.$$.fragment,o),j(ca.$$.fragment,o),j(un.$$.fragment,o),j(_n.$$.fragment,o),j(bn.$$.fragment,o),j(yn.$$.fragment,o),j(wn.$$.fragment,o),j(jn.$$.fragment,o),j(kn.$$.fragment,o),j(ua.$$.fragment,o),j(Vn.$$.fragment,o),j(Jn.$$.fragment,o),j(ga.$$.fragment,o),j(xn.$$.fragment,o),j(_a.$$.fragment,o),j($n.$$.fragment,o),j(Cn.$$.fragment,o),j(Un.$$.fragment,o),j(En.$$.fragment,o),j(In.$$.fragment,o),j(zn.$$.fragment,o),j(Nn.$$.fragment,o),j(Gn.$$.fragment,o),j(Rn.$$.fragment,o),j(qn.$$.fragment,o),j(Yn.$$.fragment,o),j(Pn.$$.fragment,o),j(On.$$.fragment,o),j(Ma.$$.fragment,o),j(ja.$$.fragment,o),j(Kn.$$.fragment,o),j(er.$$.fragment,o),j(nr.$$.fragment,o),j(Wa.$$.fragment,o),j(Va.$$.fragment,o),j(rr.$$.fragment,o),j(Ja.$$.fragment,o),j(Fa.$$.fragment,o),j(lr.$$.fragment,o),j(ir.$$.fragment,o),j(fr.$$.fragment,o),j($a.$$.fragment,o),j(Ca.$$.fragment,o),j(ur.$$.fragment,o),j(gr.$$.fragment,o),j(Tr.$$.fragment,o),j(Ea.$$.fragment,o),j(Za.$$.fragment,o),j(Mr.$$.fragment,o),j(jr.$$.fragment,o),j(xr.$$.fragment,o),j(za.$$.fragment,o),j(Ba.$$.fragment,o),j($r.$$.fragment,o),j(Cr.$$.fragment,o),j(zr.$$.fragment,o),j(Xa.$$.fragment,o),j(Ga.$$.fragment,o),j(Br.$$.fragment,o),j(Nr.$$.fragment,o),j(Aa.$$.fragment,o),j(Ar.$$.fragment,o),j(qa.$$.fragment,o),j(Ya.$$.fragment,o),j(qr.$$.fragment,o),j(Yr.$$.fragment,o),j(Pr.$$.fragment,o),j(Sr.$$.fragment,o),j(Qr.$$.fragment,o),j(Qa.$$.fragment,o),j(Kr.$$.fragment,o),j(La.$$.fragment,o),j(Ha.$$.fragment,o),j(el.$$.fragment,o),j(tl.$$.fragment,o),j(pl.$$.fragment,o),j(Oa.$$.fragment,o),j(Ka.$$.fragment,o),j(ml.$$.fragment,o),j(hl.$$.fragment,o),j(Tl.$$.fragment,o),j(ts.$$.fragment,o),j(os.$$.fragment,o),j(Ml.$$.fragment,o),j(jl.$$.fragment,o),j(Ul.$$.fragment,o),j(ss.$$.fragment,o),j(ns.$$.fragment,o),Tm=!1},d(o){t(m),o&&t(b),o&&t(u),k(i),o&&t(z),o&&t(E),k(x),o&&t(H),o&&t(X),o&&t(S),o&&t(D),o&&t(xe),o&&t(O),o&&t(qe),o&&t(N),o&&t(tt),o&&t(se),o&&t(ot),o&&t(Te),o&&t(at),o&&t(ee),k(A),o&&t(st),o&&t(V),o&&t(qt),k(fe,o),o&&t(Yt),o&&t(je),o&&t(Fp),k(Fs,o),o&&t(xp),o&&t(ke),o&&t($p),o&&t(Pl),o&&t(Cp),o&&t(Sl),o&&t(Up),o&&t(co),k(Rs),o&&t(Ep),o&&t(Ke),k(As),k(Oo),o&&t(Zp),o&&t(ho),k(Ys),o&&t(Ip),o&&t(oe),k(Ps),k(Qs),k(Ls),k(Hs),k(ta),k(Os),k(Ks),o&&t(zp),o&&t(fo),k(en),o&&t(Bp),o&&t(et),k(tn),k(an),o&&t(Np),o&&t(uo),k(sn),o&&t(Xp),o&&t(Q),k(nn),k(ln),k(pn),k(mn),k(hn),k(ca),k(un),k(_n),o&&t(Gp),o&&t(go),k(bn),o&&t(Rp),o&&t(ae),k(yn),k(wn),k(jn),k(kn),k(ua),k(Vn),k(Jn),k(ga),k(xn),k(_a),o&&t(Ap),o&&t(_o),k($n),o&&t(qp),o&&t(We),o&&t(Yp),k(Cn,o),o&&t(Pp),o&&t(vo),k(Un),o&&t(Sp),o&&t(bo),k(En),o&&t(Qp),o&&t(yo),k(In),o&&t(Lp),o&&t(wo),k(zn),o&&t(Hp),o&&t(Bt),k(Nn),k(Gn),o&&t(Dp),o&&t(Nt),k(Rn),k(qn),o&&t(Op),o&&t(To),k(Yn),o&&t(Kp),o&&t(Be),k(Pn),k(On),k(Ma),k(ja),o&&t(em),o&&t(jo),k(Kn),o&&t(tm),o&&t(ue),k(er),k(nr),k(Wa),k(Va),k(rr),k(Ja),k(Fa),o&&t(om),o&&t(Vo),k(lr),o&&t(am),o&&t(ge),k(ir),k(fr),k($a),k(Ca),o&&t(sm),o&&t(Fo),k(ur),o&&t(nm),o&&t(_e),k(gr),k(Tr),k(Ea),k(Za),o&&t(rm),o&&t($o),k(Mr),o&&t(lm),o&&t(ve),k(jr),k(xr),k(za),k(Ba),o&&t(im),o&&t(Uo),k($r),o&&t(cm),o&&t(Ne),k(Cr),k(zr),k(Xa),k(Ga),o&&t(dm),o&&t(Io),k(Br),o&&t(pm),o&&t(be),k(Nr),k(Aa),k(Ar),k(qa),k(Ya),o&&t(mm),o&&t(Bo),k(qr),o&&t(hm),o&&t(No),k(Yr),k(Pr),o&&t(fm),o&&t(Xo),k(Sr),o&&t(um),o&&t(ye),k(Qr),k(Qa),k(Kr),k(La),k(Ha),o&&t(gm),o&&t(Ro),k(el),o&&t(_m),o&&t(re),k(tl),k(pl),k(Oa),k(Ka),o&&t(vm),o&&t(qo),k(ml),o&&t(bm),o&&t(le),k(hl),k(Tl),k(ts),k(os),o&&t(ym),o&&t(So),k(Ml),o&&t(wm),o&&t(ie),k(jl),k(Ul),k(ss),k(ns)}}}const Tk={local:"wav2vec2",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.Wav2Vec2Config",title:"Wav2Vec2Config"},{local:"transformers.Wav2Vec2CTCTokenizer",title:"Wav2Vec2CTCTokenizer"},{local:"transformers.Wav2Vec2FeatureExtractor",title:"Wav2Vec2FeatureExtractor"},{local:"transformers.Wav2Vec2Processor",title:"Wav2Vec2Processor"},{local:"transformers.Wav2Vec2ProcessorWithLM",sections:[{local:"decoding-multiple-audios",title:"Decoding multiple audios"}],title:"Wav2Vec2ProcessorWithLM"},{local:"transformers.models.wav2vec2_with_lm.processing_wav2vec2_with_lm.Wav2Vec2DecoderWithLMOutput",title:"Wav2Vec2 specific outputs"},{local:"transformers.Wav2Vec2Model",title:"Wav2Vec2Model"},{local:"transformers.Wav2Vec2ForCTC",title:"Wav2Vec2ForCTC"},{local:"transformers.Wav2Vec2ForSequenceClassification",title:"Wav2Vec2ForSequenceClassification"},{local:"transformers.Wav2Vec2ForAudioFrameClassification",title:"Wav2Vec2ForAudioFrameClassification"},{local:"transformers.Wav2Vec2ForXVector",title:"Wav2Vec2ForXVector"},{local:"transformers.Wav2Vec2ForPreTraining",title:"Wav2Vec2ForPreTraining"},{local:"transformers.TFWav2Vec2Model",title:"TFWav2Vec2Model"},{local:"transformers.TFWav2Vec2ForSequenceClassification",title:"TFWav2Vec2ForSequenceClassification"},{local:"transformers.TFWav2Vec2ForCTC",title:"TFWav2Vec2ForCTC"},{local:"transformers.FlaxWav2Vec2Model",title:"FlaxWav2Vec2Model"},{local:"transformers.FlaxWav2Vec2ForCTC",title:"FlaxWav2Vec2ForCTC"},{local:"transformers.FlaxWav2Vec2ForPreTraining",title:"FlaxWav2Vec2ForPreTraining"}],title:"Wav2Vec2"};function Mk(W){return R1(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $k extends B1{constructor(m){super();N1(this,m,Mk,wk,X1,{})}}export{$k as default,Tk as metadata};
