import{S as QT,i as YT,s as ex,e as n,k as d,w,t as a,M as tx,c as r,d as t,m as p,a as i,x as y,h as s,b as c,G as e,g as _,y as k,q as T,o as x,B as $,v as ox,L as Ge}from"../../chunks/vendor-hf-doc-builder.js";import{T as je}from"../../chunks/Tip-hf-doc-builder.js";import{D as F}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Oe}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as oe}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Xe}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as ZT}from"../../chunks/PipelineTag-hf-doc-builder.js";function ax(W){let m,b,f,u,v;return u=new Oe({props:{code:`from transformers import Wav2Vec2Config, Wav2Vec2Model

# Initializing a Wav2Vec2 facebook/wav2vec2-base-960h style configuration
configuration = Wav2Vec2Config()

# Initializing a model (with random weights) from the facebook/wav2vec2-base-960h style configuration
model = Wav2Vec2Model(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> 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=n("p"),b=a("Example:"),f=d(),w(u.$$.fragment)},l(l){m=r(l,"P",{});var h=i(m);b=s(h,"Example:"),h.forEach(t),f=p(l),y(u.$$.fragment,l)},m(l,h){_(l,m,h),e(m,b),_(l,f,h),k(u,l,h),v=!0},p:Ge,i(l){v||(T(u.$$.fragment,l),v=!0)},o(l){x(u.$$.fragment,l),v=!1},d(l){l&&t(m),l&&t(f),$(u,l)}}}function sx(W){let m,b,f,u,v;return u=new Oe({props:{code:`# Let's see how to retrieve time steps for a model
from transformers import AutoTokenizer, AutoFeatureExtractor, AutoModelForCTC
from datasets import load_dataset
import datasets
import torch

# import model, feature extractor, tokenizer
model = AutoModelForCTC.from_pretrained("facebook/wav2vec2-base-960h")
tokenizer = AutoTokenizer.from_pretrained("facebook/wav2vec2-base-960h")
feature_extractor = AutoFeatureExtractor.from_pretrained("facebook/wav2vec2-base-960h")

# load first sample of English common_voice
dataset = load_dataset("common_voice", "en", split="train", streaming=True)
dataset = dataset.cast_column("audio", datasets.Audio(sampling_rate=16_000))
dataset_iter = iter(dataset)
sample = next(dataset_iter)

# forward sample through model to get greedily predicted transcription ids
input_values = feature_extractor(sample["audio"]["array"], return_tensors="pt").input_values
logits = model(input_values).logits[0]
pred_ids = torch.argmax(logits, axis=-1)

# retrieve word stamps (analogous commands for \`output_char_offsets\`)
outputs = tokenizer.decode(pred_ids, output_word_offsets=True)
# compute \`time_offset\` in seconds as product of downsampling ratio and sampling_rate
time_offset = model.config.inputs_to_logits_ratio / feature_extractor.sampling_rate

word_offsets = [
    {
        "word": d["word"],
        "start_time": round(d["start_offset"] * time_offset, 2),
        "end_time": round(d["end_offset"] * time_offset, 2),
    }
    for d in outputs.word_offsets
]
# compare word offsets with audio \`common_voice_en_100038.mp3\` online on the dataset viewer:
# https://huggingface.co/datasets/common_voice/viewer/en/train
word_offsets[:3]`,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=n("p"),b=a("Example:"),f=d(),w(u.$$.fragment)},l(l){m=r(l,"P",{});var h=i(m);b=s(h,"Example:"),h.forEach(t),f=p(l),y(u.$$.fragment,l)},m(l,h){_(l,m,h),e(m,b),_(l,f,h),k(u,l,h),v=!0},p:Ge,i(l){v||(T(u.$$.fragment,l),v=!0)},o(l){x(u.$$.fragment,l),v=!1},d(l){l&&t(m),l&&t(f),$(u,l)}}}function nx(W){let m,b,f,u,v,l,h,V;return{c(){m=n("p"),b=a("This class method is simply calling "),f=n("a"),u=a("save_pretrained()"),v=a(` and
`),l=n("a"),h=a("save_pretrained()"),V=a(`. Please refer to the docstrings of the
methods above for more information.`),this.h()},l(M){m=r(M,"P",{});var L=i(m);b=s(L,"This class method is simply calling "),f=r(L,"A",{href:!0});var A=i(f);u=s(A,"save_pretrained()"),A.forEach(t),v=s(L,` and
`),l=r(L,"A",{href:!0});var z=i(l);h=s(z,"save_pretrained()"),z.forEach(t),V=s(L,`. Please refer to the docstrings of the
methods above for more information.`),L.forEach(t),this.h()},h(){c(f,"href","/docs/transformers/v4.27.1/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.save_pretrained"),c(l,"href","/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.save_pretrained")},m(M,L){_(M,m,L),e(m,b),e(m,f),e(f,u),e(m,v),e(m,l),e(l,h),e(m,V)},d(M){M&&t(m)}}}function rx(W){let m,b,f,u,v,l,h,V,M,L,A,z,N,E;return{c(){m=n("p"),b=a(`This class method is simply calling Wav2Vec2FeatureExtractor\u2019s
`),f=n("a"),u=a("from_pretrained()"),v=a(`, Wav2Vec2CTCTokenizer\u2019s
`),l=n("a"),h=a("from_pretrained()"),V=a(`, and
`),M=n("code"),L=a("pyctcdecode.BeamSearchDecoderCTC.load_from_hf_hub"),A=a("."),z=d(),N=n("p"),E=a("Please refer to the docstrings of the methods above for more information."),this.h()},l(O){m=r(O,"P",{});var C=i(m);b=s(C,`This class method is simply calling Wav2Vec2FeatureExtractor\u2019s
`),f=r(C,"A",{href:!0});var ce=i(f);u=s(ce,"from_pretrained()"),ce.forEach(t),v=s(C,`, Wav2Vec2CTCTokenizer\u2019s
`),l=r(C,"A",{href:!0});var K=i(l);h=s(K,"from_pretrained()"),K.forEach(t),V=s(C,`, and
`),M=r(C,"CODE",{});var S=i(M);L=s(S,"pyctcdecode.BeamSearchDecoderCTC.load_from_hf_hub"),S.forEach(t),A=s(C,"."),C.forEach(t),z=p(O),N=r(O,"P",{});var de=i(N);E=s(de,"Please refer to the docstrings of the methods above for more information."),de.forEach(t),this.h()},h(){c(f,"href","/docs/transformers/v4.27.1/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.from_pretrained"),c(l,"href","/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.from_pretrained")},m(O,C){_(O,m,C),e(m,b),e(m,f),e(f,u),e(m,v),e(m,l),e(l,h),e(m,V),e(m,M),e(M,L),e(m,A),_(O,z,C),_(O,N,C),e(N,E)},d(O){O&&t(m),O&&t(z),O&&t(N)}}}function ix(W){let m,b,f,u,v,l,h,V,M,L,A,z,N,E,O,C,ce,K,S,de;return{c(){m=n("p"),b=a(`This function makes use of Python\u2019s multiprocessing. Currently, multiprocessing is available only on Unix
systems (see this `),f=n("a"),u=a("issue"),v=a(")."),l=d(),h=n("p"),V=a("If you are decoding multiple batches, consider creating a "),M=n("code"),L=a("Pool"),A=a(" and passing it to "),z=n("code"),N=a("batch_decode"),E=a(`. Otherwise,
`),O=n("code"),C=a("batch_decode"),ce=a(" will be very slow since it will create a fresh "),K=n("code"),S=a("Pool"),de=a(" for each call. See usage example below."),this.h()},l(I){m=r(I,"P",{});var R=i(m);b=s(R,`This function makes use of Python\u2019s multiprocessing. Currently, multiprocessing is available only on Unix
systems (see this `),f=r(R,"A",{href:!0,rel:!0});var De=i(f);u=s(De,"issue"),De.forEach(t),v=s(R,")."),R.forEach(t),l=p(I),h=r(I,"P",{});var X=i(h);V=s(X,"If you are decoding multiple batches, consider creating a "),M=r(X,"CODE",{});var J=i(M);L=s(J,"Pool"),J.forEach(t),A=s(X," and passing it to "),z=r(X,"CODE",{});var Se=i(z);N=s(Se,"batch_decode"),Se.forEach(t),E=s(X,`. Otherwise,
`),O=r(X,"CODE",{});var We=i(O);C=s(We,"batch_decode"),We.forEach(t),ce=s(X," will be very slow since it will create a fresh "),K=r(X,"CODE",{});var Z=i(K);S=s(Z,"Pool"),Z.forEach(t),de=s(X," for each call. See usage example below."),X.forEach(t),this.h()},h(){c(f,"href","https://github.com/kensho-technologies/pyctcdecode/issues/65"),c(f,"rel","nofollow")},m(I,R){_(I,m,R),e(m,b),e(m,f),e(f,u),e(m,v),_(I,l,R),_(I,h,R),e(h,V),e(h,M),e(M,L),e(h,A),e(h,z),e(z,N),e(h,E),e(h,O),e(O,C),e(h,ce),e(h,K),e(K,S),e(h,de)},d(I){I&&t(m),I&&t(l),I&&t(h)}}}function lx(W){let m,b,f,u,v;return u=new Oe({props:{code:`# Let's see how to retrieve time steps for a model
from transformers import AutoTokenizer, AutoProcessor, AutoModelForCTC
from datasets import load_dataset
import datasets
import torch

# import model, feature extractor, tokenizer
model = AutoModelForCTC.from_pretrained("patrickvonplaten/wav2vec2-base-100h-with-lm")
processor = AutoProcessor.from_pretrained("patrickvonplaten/wav2vec2-base-100h-with-lm")

# load first sample of English common_voice
dataset = load_dataset("common_voice", "en", split="train", streaming=True)
dataset = dataset.cast_column("audio", datasets.Audio(sampling_rate=16_000))
dataset_iter = iter(dataset)
sample = next(dataset_iter)

# forward sample through model to get greedily predicted transcription ids
input_values = processor(sample["audio"]["array"], return_tensors="pt").input_values
with torch.no_grad():
    logits = model(input_values).logits[0].cpu().numpy()

# retrieve word stamps (analogous commands for \`output_char_offsets\`)
outputs = processor.decode(logits, output_word_offsets=True)
# compute \`time_offset\` in seconds as product of downsampling ratio and sampling_rate
time_offset = model.config.inputs_to_logits_ratio / processor.feature_extractor.sampling_rate

word_offsets = [
    {
        "word": d["word"],
        "start_time": round(d["start_offset"] * time_offset, 2),
        "end_time": round(d["end_offset"] * time_offset, 2),
    }
    for d in outputs.word_offsets
]
# compare word offsets with audio \`common_voice_en_100038.mp3\` online on the dataset viewer:
# https://huggingface.co/datasets/common_voice/viewer/en/train
word_offsets[:4]`,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.64</span>, <span class="hljs-string">&#x27;end_time&#x27;</span>: <span class="hljs-number">1.88</span>}, {<span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;A&#x27;</span>, <span class="hljs-string">&#x27;start_time&#x27;</span>: <span class="hljs-number">2.12</span>, <span class="hljs-string">&#x27;end_time&#x27;</span>: <span class="hljs-number">2.14</span>}, {<span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;MILE&#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.46</span>}]`}}),{c(){m=n("p"),b=a("Example:"),f=d(),w(u.$$.fragment)},l(l){m=r(l,"P",{});var h=i(m);b=s(h,"Example:"),h.forEach(t),f=p(l),y(u.$$.fragment,l)},m(l,h){_(l,m,h),e(m,b),_(l,f,h),k(u,l,h),v=!0},p:Ge,i(l){v||(T(u.$$.fragment,l),v=!0)},o(l){x(u.$$.fragment,l),v=!1},d(l){l&&t(m),l&&t(f),$(u,l)}}}function cx(W){let m,b,f,u,v;return{c(){m=n("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),u=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){m=r(l,"P",{});var h=i(m);b=s(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(h,"CODE",{});var V=i(f);u=s(V,"Module"),V.forEach(t),v=s(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(l,h){_(l,m,h),e(m,b),e(m,f),e(f,u),e(m,v)},d(l){l&&t(m)}}}function dx(W){let m,b,f,u,v;return u=new Oe({props:{code:`from transformers import AutoProcessor, Wav2Vec2Model
import torch
from datasets import load_dataset

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

processor = AutoProcessor.from_pretrained("facebook/wav2vec2-base-960h")
model = Wav2Vec2Model.from_pretrained("facebook/wav2vec2-base-960h")

# audio file is decoded on the fly
inputs = processor(dataset[0]["audio"]["array"], sampling_rate=sampling_rate, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, 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=n("p"),b=a("Example:"),f=d(),w(u.$$.fragment)},l(l){m=r(l,"P",{});var h=i(m);b=s(h,"Example:"),h.forEach(t),f=p(l),y(u.$$.fragment,l)},m(l,h){_(l,m,h),e(m,b),_(l,f,h),k(u,l,h),v=!0},p:Ge,i(l){v||(T(u.$$.fragment,l),v=!0)},o(l){x(u.$$.fragment,l),v=!1},d(l){l&&t(m),l&&t(f),$(u,l)}}}function px(W){let m,b,f,u,v;return{c(){m=n("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),u=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){m=r(l,"P",{});var h=i(m);b=s(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(h,"CODE",{});var V=i(f);u=s(V,"Module"),V.forEach(t),v=s(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(l,h){_(l,m,h),e(m,b),e(m,f),e(f,u),e(m,v)},d(l){l&&t(m)}}}function mx(W){let m,b,f,u,v;return u=new Oe({props:{code:`from transformers import AutoProcessor, Wav2Vec2ForCTC
from datasets import load_dataset
import torch

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

processor = AutoProcessor.from_pretrained("facebook/wav2vec2-base-960h")
model = Wav2Vec2ForCTC.from_pretrained("facebook/wav2vec2-base-960h")

# audio file is decoded on the fly
inputs = processor(dataset[0]["audio"]["array"], sampling_rate=sampling_rate, return_tensors="pt")
with torch.no_grad():
    logits = model(**inputs).logits
predicted_ids = torch.argmax(logits, dim=-1)

# transcribe speech
transcription = processor.batch_decode(predicted_ids)
transcription[0]

inputs["labels"] = processor(text=dataset[0]["text"], return_tensors="pt").input_ids

# compute loss
loss = model(**inputs).loss
round(loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, 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=n("p"),b=a("Example:"),f=d(),w(u.$$.fragment)},l(l){m=r(l,"P",{});var h=i(m);b=s(h,"Example:"),h.forEach(t),f=p(l),y(u.$$.fragment,l)},m(l,h){_(l,m,h),e(m,b),_(l,f,h),k(u,l,h),v=!0},p:Ge,i(l){v||(T(u.$$.fragment,l),v=!0)},o(l){x(u.$$.fragment,l),v=!1},d(l){l&&t(m),l&&t(f),$(u,l)}}}function hx(W){let m,b,f,u,v;return{c(){m=n("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),u=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){m=r(l,"P",{});var h=i(m);b=s(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(h,"CODE",{});var V=i(f);u=s(V,"Module"),V.forEach(t),v=s(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(l,h){_(l,m,h),e(m,b),e(m,f),e(f,u),e(m,v)},d(l){l&&t(m)}}}function ux(W){let m,b,f,u,v;return u=new Oe({props:{code:`from transformers import AutoFeatureExtractor, Wav2Vec2ForSequenceClassification
from datasets import load_dataset
import torch

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

feature_extractor = AutoFeatureExtractor.from_pretrained("superb/wav2vec2-base-superb-ks")
model = Wav2Vec2ForSequenceClassification.from_pretrained("superb/wav2vec2-base-superb-ks")

# audio file is decoded on the fly
inputs = feature_extractor(dataset[0]["audio"]["array"], sampling_rate=sampling_rate, return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_ids = torch.argmax(logits, dim=-1).item()
predicted_label = model.config.id2label[predicted_class_ids]
predicted_label

# compute loss - target_label is e.g. "down"
target_label = model.config.id2label[0]
inputs["labels"] = torch.tensor([model.config.label2id[target_label]])
loss = model(**inputs).loss
round(loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, 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=n("p"),b=a("Example:"),f=d(),w(u.$$.fragment)},l(l){m=r(l,"P",{});var h=i(m);b=s(h,"Example:"),h.forEach(t),f=p(l),y(u.$$.fragment,l)},m(l,h){_(l,m,h),e(m,b),_(l,f,h),k(u,l,h),v=!0},p:Ge,i(l){v||(T(u.$$.fragment,l),v=!0)},o(l){x(u.$$.fragment,l),v=!1},d(l){l&&t(m),l&&t(f),$(u,l)}}}function fx(W){let m,b,f,u,v;return{c(){m=n("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),u=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){m=r(l,"P",{});var h=i(m);b=s(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(h,"CODE",{});var V=i(f);u=s(V,"Module"),V.forEach(t),v=s(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(l,h){_(l,m,h),e(m,b),e(m,f),e(f,u),e(m,v)},d(l){l&&t(m)}}}function gx(W){let m,b,f,u,v;return u=new Oe({props:{code:`from transformers import AutoFeatureExtractor, Wav2Vec2ForAudioFrameClassification
from datasets import load_dataset
import torch

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

feature_extractor = AutoFeatureExtractor.from_pretrained("anton-l/wav2vec2-base-superb-sd")
model = Wav2Vec2ForAudioFrameClassification.from_pretrained("anton-l/wav2vec2-base-superb-sd")

# audio file is decoded on the fly
inputs = feature_extractor(dataset[0]["audio"]["array"], return_tensors="pt", sampling_rate=sampling_rate)
with torch.no_grad():
    logits = model(**inputs).logits

probabilities = torch.sigmoid(logits[0])
# labels is a one-hot array of shape (num_frames, num_speakers)
labels = (probabilities > 0.5).long()
labels[0].tolist()`,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=n("p"),b=a("Example:"),f=d(),w(u.$$.fragment)},l(l){m=r(l,"P",{});var h=i(m);b=s(h,"Example:"),h.forEach(t),f=p(l),y(u.$$.fragment,l)},m(l,h){_(l,m,h),e(m,b),_(l,f,h),k(u,l,h),v=!0},p:Ge,i(l){v||(T(u.$$.fragment,l),v=!0)},o(l){x(u.$$.fragment,l),v=!1},d(l){l&&t(m),l&&t(f),$(u,l)}}}function _x(W){let m,b,f,u,v;return{c(){m=n("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),u=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){m=r(l,"P",{});var h=i(m);b=s(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(h,"CODE",{});var V=i(f);u=s(V,"Module"),V.forEach(t),v=s(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(l,h){_(l,m,h),e(m,b),e(m,f),e(f,u),e(m,v)},d(l){l&&t(m)}}}function vx(W){let m,b,f,u,v;return u=new Oe({props:{code:`from transformers import AutoFeatureExtractor, Wav2Vec2ForXVector
from datasets import load_dataset
import torch

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

feature_extractor = AutoFeatureExtractor.from_pretrained("anton-l/wav2vec2-base-superb-sv")
model = Wav2Vec2ForXVector.from_pretrained("anton-l/wav2vec2-base-superb-sv")

# audio file is decoded on the fly
inputs = feature_extractor(
    [d["array"] for d in dataset[:2]["audio"]], sampling_rate=sampling_rate, return_tensors="pt", padding=True
)
with torch.no_grad():
    embeddings = model(**inputs).embeddings

embeddings = torch.nn.functional.normalize(embeddings, dim=-1).cpu()

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

feature_extractor = AutoFeatureExtractor.from_pretrained("facebook/wav2vec2-base")
model = Wav2Vec2ForPreTraining.from_pretrained("facebook/wav2vec2-base")

ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
input_values = feature_extractor(ds[0]["audio"]["array"], return_tensors="pt").input_values  # Batch size 1

# compute masked indices
batch_size, raw_sequence_length = input_values.shape
sequence_length = model._get_feat_extract_output_lengths(raw_sequence_length).item()
mask_time_indices = _compute_mask_indices(
    shape=(batch_size, sequence_length), mask_prob=0.2, mask_length=2
)
sampled_negative_indices = _sample_negative_indices(
    features_shape=(batch_size, sequence_length),
    num_negatives=model.config.num_negatives,
    mask_time_indices=mask_time_indices,
)
mask_time_indices = torch.tensor(data=mask_time_indices, device=input_values.device, dtype=torch.long)
sampled_negative_indices = torch.tensor(
    data=sampled_negative_indices, device=input_values.device, dtype=torch.long
)

with torch.no_grad():
    outputs = model(input_values, mask_time_indices=mask_time_indices)

# compute cosine similarity between predicted (=projected_states) and target (=projected_quantized_states)
cosine_sim = torch.cosine_similarity(outputs.projected_states, outputs.projected_quantized_states, dim=-1)

# show that cosine similarity is much higher than random
cosine_sim[mask_time_indices.to(torch.bool)].mean() > 0.5

# for contrastive loss training model should be put into train mode
model = model.train()
loss = model(
    input_values, mask_time_indices=mask_time_indices, sampled_negative_indices=sampled_negative_indices
).loss`,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=n("p"),b=a("Example:"),f=d(),w(u.$$.fragment)},l(l){m=r(l,"P",{});var h=i(m);b=s(h,"Example:"),h.forEach(t),f=p(l),y(u.$$.fragment,l)},m(l,h){_(l,m,h),e(m,b),_(l,f,h),k(u,l,h),v=!0},p:Ge,i(l){v||(T(u.$$.fragment,l),v=!0)},o(l){x(u.$$.fragment,l),v=!1},d(l){l&&t(m),l&&t(f),$(u,l)}}}function yx(W){let m,b,f,u,v,l,h,V,M,L,A,z,N,E,O,C,ce,K,S,de,I,R,De,X,J,Se,We,Z,Ke,$t,Ie,D,Q,tt,ae,Je,jt,Ve,Fe,Wt,U,Vt,Ee,ot,we,Ce,Pe,Ft,he,at,Y,ye,qe,B,Et,ee,Ct,st;return{c(){m=n("p"),b=a("TensorFlow models and layers in "),f=n("code"),u=a("transformers"),v=a(" accept two formats as input:"),l=d(),h=n("ul"),V=n("li"),M=a("having all inputs as keyword arguments (like PyTorch models), or"),L=d(),A=n("li"),z=a("having all inputs as a list, tuple or dict in the first positional argument."),N=d(),E=n("p"),O=a(`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 `),C=n("code"),ce=a("model.fit()"),K=a(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),S=n("code"),de=a("model.fit()"),I=a(` supports! If, however, you want to use the second
format outside of Keras methods like `),R=n("code"),De=a("fit()"),X=a(" and "),J=n("code"),Se=a("predict()"),We=a(`, such as when creating your own layers or models with
the Keras `),Z=n("code"),Ke=a("Functional"),$t=a(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),Ie=d(),D=n("ul"),Q=n("li"),tt=a("a single Tensor with "),ae=n("code"),Je=a("input_values"),jt=a(" only and nothing else: "),Ve=n("code"),Fe=a("model(input_values)"),Wt=d(),U=n("li"),Vt=a(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Ee=n("code"),ot=a("model([input_values, attention_mask])"),we=a(" or "),Ce=n("code"),Pe=a("model([input_values, attention_mask, token_type_ids])"),Ft=d(),he=n("li"),at=a(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),Y=n("code"),ye=a('model({"input_values": input_values, "token_type_ids": token_type_ids})'),qe=d(),B=n("p"),Et=a(`Note that when creating models and layers with
`),ee=n("a"),Ct=a("subclassing"),st=a(` 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(j){m=r(j,"P",{});var P=i(m);b=s(P,"TensorFlow models and layers in "),f=r(P,"CODE",{});var Nt=i(f);u=s(Nt,"transformers"),Nt.forEach(t),v=s(P," accept two formats as input:"),P.forEach(t),l=p(j),h=r(j,"UL",{});var ue=i(h);V=r(ue,"LI",{});var Bt=i(V);M=s(Bt,"having all inputs as keyword arguments (like PyTorch models), or"),Bt.forEach(t),L=p(ue),A=r(ue,"LI",{});var ke=i(A);z=s(ke,"having all inputs as a list, tuple or dict in the first positional argument."),ke.forEach(t),ue.forEach(t),N=p(j),E=r(j,"P",{});var q=i(E);O=s(q,`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 `),C=r(q,"CODE",{});var Qt=i(C);ce=s(Qt,"model.fit()"),Qt.forEach(t),K=s(q,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),S=r(q,"CODE",{});var Ze=i(S);de=s(Ze,"model.fit()"),Ze.forEach(t),I=s(q,` supports! If, however, you want to use the second
format outside of Keras methods like `),R=r(q,"CODE",{});var Yt=i(R);De=s(Yt,"fit()"),Yt.forEach(t),X=s(q," and "),J=r(q,"CODE",{});var eo=i(J);Se=s(eo,"predict()"),eo.forEach(t),We=s(q,`, such as when creating your own layers or models with
the Keras `),Z=r(q,"CODE",{});var to=i(Z);Ke=s(to,"Functional"),to.forEach(t),$t=s(q,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),q.forEach(t),Ie=p(j),D=r(j,"UL",{});var H=i(D);Q=r(H,"LI",{});var pe=i(Q);tt=s(pe,"a single Tensor with "),ae=r(pe,"CODE",{});var oo=i(ae);Je=s(oo,"input_values"),oo.forEach(t),jt=s(pe," only and nothing else: "),Ve=r(pe,"CODE",{});var ao=i(Ve);Fe=s(ao,"model(input_values)"),ao.forEach(t),pe.forEach(t),Wt=p(H),U=r(H,"LI",{});var se=i(U);Vt=s(se,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Ee=r(se,"CODE",{});var so=i(Ee);ot=s(so,"model([input_values, attention_mask])"),so.forEach(t),we=s(se," or "),Ce=r(se,"CODE",{});var no=i(Ce);Pe=s(no,"model([input_values, attention_mask, token_type_ids])"),no.forEach(t),se.forEach(t),Ft=p(H),he=r(H,"LI",{});var Ae=i(he);at=s(Ae,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),Y=r(Ae,"CODE",{});var ro=i(Y);ye=s(ro,'model({"input_values": input_values, "token_type_ids": token_type_ids})'),ro.forEach(t),Ae.forEach(t),H.forEach(t),qe=p(j),B=r(j,"P",{});var Qe=i(B);Et=s(Qe,`Note that when creating models and layers with
`),ee=r(Qe,"A",{href:!0,rel:!0});var io=i(ee);Ct=s(io,"subclassing"),io.forEach(t),st=s(Qe,` 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!`),Qe.forEach(t),this.h()},h(){c(ee,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),c(ee,"rel","nofollow")},m(j,P){_(j,m,P),e(m,b),e(m,f),e(f,u),e(m,v),_(j,l,P),_(j,h,P),e(h,V),e(V,M),e(h,L),e(h,A),e(A,z),_(j,N,P),_(j,E,P),e(E,O),e(E,C),e(C,ce),e(E,K),e(E,S),e(S,de),e(E,I),e(E,R),e(R,De),e(E,X),e(E,J),e(J,Se),e(E,We),e(E,Z),e(Z,Ke),e(E,$t),_(j,Ie,P),_(j,D,P),e(D,Q),e(Q,tt),e(Q,ae),e(ae,Je),e(Q,jt),e(Q,Ve),e(Ve,Fe),e(D,Wt),e(D,U),e(U,Vt),e(U,Ee),e(Ee,ot),e(U,we),e(U,Ce),e(Ce,Pe),e(D,Ft),e(D,he),e(he,at),e(he,Y),e(Y,ye),_(j,qe,P),_(j,B,P),e(B,Et),e(B,ee),e(ee,Ct),e(B,st)},d(j){j&&t(m),j&&t(l),j&&t(h),j&&t(N),j&&t(E),j&&t(Ie),j&&t(D),j&&t(qe),j&&t(B)}}}function kx(W){let m,b,f,u,v;return{c(){m=n("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),u=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){m=r(l,"P",{});var h=i(m);b=s(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(h,"CODE",{});var V=i(f);u=s(V,"Module"),V.forEach(t),v=s(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(l,h){_(l,m,h),e(m,b),e(m,f),e(f,u),e(m,v)},d(l){l&&t(m)}}}function Tx(W){let m,b,f,u,v;return u=new Oe({props:{code:`from transformers import AutoProcessor, TFWav2Vec2Model
from datasets import load_dataset
import soundfile as sf

processor = AutoProcessor.from_pretrained("facebook/wav2vec2-base-960h")
model = TFWav2Vec2Model.from_pretrained("facebook/wav2vec2-base-960h")


def map_to_array(batch):
    speech, _ = sf.read(batch["file"])
    batch["speech"] = speech
    return batch


ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
ds = ds.map(map_to_array)

input_values = processor(ds["speech"][0], return_tensors="tf").input_values  # Batch size 1
hidden_states = model(input_values).last_hidden_state`,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=n("p"),b=a("Example:"),f=d(),w(u.$$.fragment)},l(l){m=r(l,"P",{});var h=i(m);b=s(h,"Example:"),h.forEach(t),f=p(l),y(u.$$.fragment,l)},m(l,h){_(l,m,h),e(m,b),_(l,f,h),k(u,l,h),v=!0},p:Ge,i(l){v||(T(u.$$.fragment,l),v=!0)},o(l){x(u.$$.fragment,l),v=!1},d(l){l&&t(m),l&&t(f),$(u,l)}}}function xx(W){let m,b,f,u,v,l,h,V,M,L,A,z,N,E,O,C,ce,K,S,de,I,R,De,X,J,Se,We,Z,Ke,$t,Ie,D,Q,tt,ae,Je,jt,Ve,Fe,Wt,U,Vt,Ee,ot,we,Ce,Pe,Ft,he,at,Y,ye,qe,B,Et,ee,Ct,st;return{c(){m=n("p"),b=a("TensorFlow models and layers in "),f=n("code"),u=a("transformers"),v=a(" accept two formats as input:"),l=d(),h=n("ul"),V=n("li"),M=a("having all inputs as keyword arguments (like PyTorch models), or"),L=d(),A=n("li"),z=a("having all inputs as a list, tuple or dict in the first positional argument."),N=d(),E=n("p"),O=a(`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 `),C=n("code"),ce=a("model.fit()"),K=a(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),S=n("code"),de=a("model.fit()"),I=a(` supports! If, however, you want to use the second
format outside of Keras methods like `),R=n("code"),De=a("fit()"),X=a(" and "),J=n("code"),Se=a("predict()"),We=a(`, such as when creating your own layers or models with
the Keras `),Z=n("code"),Ke=a("Functional"),$t=a(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),Ie=d(),D=n("ul"),Q=n("li"),tt=a("a single Tensor with "),ae=n("code"),Je=a("input_values"),jt=a(" only and nothing else: "),Ve=n("code"),Fe=a("model(input_values)"),Wt=d(),U=n("li"),Vt=a(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Ee=n("code"),ot=a("model([input_values, attention_mask])"),we=a(" or "),Ce=n("code"),Pe=a("model([input_values, attention_mask, token_type_ids])"),Ft=d(),he=n("li"),at=a(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),Y=n("code"),ye=a('model({"input_values": input_values, "token_type_ids": token_type_ids})'),qe=d(),B=n("p"),Et=a(`Note that when creating models and layers with
`),ee=n("a"),Ct=a("subclassing"),st=a(` 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(j){m=r(j,"P",{});var P=i(m);b=s(P,"TensorFlow models and layers in "),f=r(P,"CODE",{});var Nt=i(f);u=s(Nt,"transformers"),Nt.forEach(t),v=s(P," accept two formats as input:"),P.forEach(t),l=p(j),h=r(j,"UL",{});var ue=i(h);V=r(ue,"LI",{});var Bt=i(V);M=s(Bt,"having all inputs as keyword arguments (like PyTorch models), or"),Bt.forEach(t),L=p(ue),A=r(ue,"LI",{});var ke=i(A);z=s(ke,"having all inputs as a list, tuple or dict in the first positional argument."),ke.forEach(t),ue.forEach(t),N=p(j),E=r(j,"P",{});var q=i(E);O=s(q,`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 `),C=r(q,"CODE",{});var Qt=i(C);ce=s(Qt,"model.fit()"),Qt.forEach(t),K=s(q,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),S=r(q,"CODE",{});var Ze=i(S);de=s(Ze,"model.fit()"),Ze.forEach(t),I=s(q,` supports! If, however, you want to use the second
format outside of Keras methods like `),R=r(q,"CODE",{});var Yt=i(R);De=s(Yt,"fit()"),Yt.forEach(t),X=s(q," and "),J=r(q,"CODE",{});var eo=i(J);Se=s(eo,"predict()"),eo.forEach(t),We=s(q,`, such as when creating your own layers or models with
the Keras `),Z=r(q,"CODE",{});var to=i(Z);Ke=s(to,"Functional"),to.forEach(t),$t=s(q,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),q.forEach(t),Ie=p(j),D=r(j,"UL",{});var H=i(D);Q=r(H,"LI",{});var pe=i(Q);tt=s(pe,"a single Tensor with "),ae=r(pe,"CODE",{});var oo=i(ae);Je=s(oo,"input_values"),oo.forEach(t),jt=s(pe," only and nothing else: "),Ve=r(pe,"CODE",{});var ao=i(Ve);Fe=s(ao,"model(input_values)"),ao.forEach(t),pe.forEach(t),Wt=p(H),U=r(H,"LI",{});var se=i(U);Vt=s(se,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Ee=r(se,"CODE",{});var so=i(Ee);ot=s(so,"model([input_values, attention_mask])"),so.forEach(t),we=s(se," or "),Ce=r(se,"CODE",{});var no=i(Ce);Pe=s(no,"model([input_values, attention_mask, token_type_ids])"),no.forEach(t),se.forEach(t),Ft=p(H),he=r(H,"LI",{});var Ae=i(he);at=s(Ae,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),Y=r(Ae,"CODE",{});var ro=i(Y);ye=s(ro,'model({"input_values": input_values, "token_type_ids": token_type_ids})'),ro.forEach(t),Ae.forEach(t),H.forEach(t),qe=p(j),B=r(j,"P",{});var Qe=i(B);Et=s(Qe,`Note that when creating models and layers with
`),ee=r(Qe,"A",{href:!0,rel:!0});var io=i(ee);Ct=s(io,"subclassing"),io.forEach(t),st=s(Qe,` 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!`),Qe.forEach(t),this.h()},h(){c(ee,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),c(ee,"rel","nofollow")},m(j,P){_(j,m,P),e(m,b),e(m,f),e(f,u),e(m,v),_(j,l,P),_(j,h,P),e(h,V),e(V,M),e(h,L),e(h,A),e(A,z),_(j,N,P),_(j,E,P),e(E,O),e(E,C),e(C,ce),e(E,K),e(E,S),e(S,de),e(E,I),e(E,R),e(R,De),e(E,X),e(E,J),e(J,Se),e(E,We),e(E,Z),e(Z,Ke),e(E,$t),_(j,Ie,P),_(j,D,P),e(D,Q),e(Q,tt),e(Q,ae),e(ae,Je),e(Q,jt),e(Q,Ve),e(Ve,Fe),e(D,Wt),e(D,U),e(U,Vt),e(U,Ee),e(Ee,ot),e(U,we),e(U,Ce),e(Ce,Pe),e(D,Ft),e(D,he),e(he,at),e(he,Y),e(Y,ye),_(j,qe,P),_(j,B,P),e(B,Et),e(B,ee),e(ee,Ct),e(B,st)},d(j){j&&t(m),j&&t(l),j&&t(h),j&&t(N),j&&t(E),j&&t(Ie),j&&t(D),j&&t(qe),j&&t(B)}}}function $x(W){let m,b,f,u,v;return{c(){m=n("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=n("code"),u=a("Module"),v=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){m=r(l,"P",{});var h=i(m);b=s(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(h,"CODE",{});var V=i(f);u=s(V,"Module"),V.forEach(t),v=s(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(l,h){_(l,m,h),e(m,b),e(m,f),e(f,u),e(m,v)},d(l){l&&t(m)}}}function jx(W){let m,b,f,u,v;return u=new Oe({props:{code:`import tensorflow as tf
from transformers import AutoProcessor, TFWav2Vec2ForCTC
from datasets import load_dataset
import soundfile as sf

processor = AutoProcessor.from_pretrained("facebook/wav2vec2-base-960h")
model = TFWav2Vec2ForCTC.from_pretrained("facebook/wav2vec2-base-960h")


def map_to_array(batch):
    speech, _ = sf.read(batch["file"])
    batch["speech"] = speech
    return batch


ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
ds = ds.map(map_to_array)

input_values = processor(ds["speech"][0], return_tensors="tf").input_values  # Batch size 1
logits = model(input_values).logits
predicted_ids = tf.argmax(logits, axis=-1)

transcription = processor.decode(predicted_ids[0])

# compute loss
target_transcription = "A MAN SAID TO THE UNIVERSE SIR I EXIST"

# Pass transcription as \`text\` to encode labels
labels = processor(text=transcription, return_tensors="tf").input_ids

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

processor = AutoProcessor.from_pretrained("facebook/wav2vec2-large-lv60")
model = FlaxWav2Vec2Model.from_pretrained("facebook/wav2vec2-large-lv60")


def map_to_array(batch):
    speech, _ = sf.read(batch["file"])
    batch["speech"] = speech
    return batch


ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
ds = ds.map(map_to_array)

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

processor = AutoProcessor.from_pretrained("facebook/wav2vec2-large-960h-lv60")
model = FlaxWav2Vec2ForCTC.from_pretrained("facebook/wav2vec2-large-960h-lv60")


def map_to_array(batch):
    speech, _ = sf.read(batch["file"])
    batch["speech"] = speech
    return batch


ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
ds = ds.map(map_to_array)

input_values = processor(
    ds["speech"][0], sampling_rate=16_000, return_tensors="np"
).input_values  # Batch size 1
logits = model(input_values).logits
predicted_ids = jnp.argmax(logits, axis=-1)

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

feature_extractor = AutoFeatureExtractor.from_pretrained("facebook/wav2vec2-large-lv60")
model = FlaxWav2Vec2ForPreTraining.from_pretrained("facebook/wav2vec2-large-lv60")


def map_to_array(batch):
    speech, _ = sf.read(batch["file"])
    batch["speech"] = speech
    return batch


ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
ds = ds.map(map_to_array)

input_values = feature_extractor(ds["speech"][0], return_tensors="np").input_values  # Batch size 1

# compute masked indices
batch_size, raw_sequence_length = input_values.shape
sequence_length = model._get_feat_extract_output_lengths(raw_sequence_length)
mask_time_indices = _compute_mask_indices((batch_size, sequence_length), mask_prob=0.2, mask_length=2)

outputs = model(input_values, mask_time_indices=mask_time_indices)

# compute cosine similarity between predicted (=projected_states) and target (=projected_quantized_states)
cosine_sim = optax.cosine_similarity(outputs.projected_states, outputs.projected_quantized_states)

# show that cosine similarity is much higher than random
assert np.asarray(cosine_sim)[mask_time_indices].mean() > 0.5`,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>`}}),{c(){m=n("p"),b=a("Example:"),f=d(),w(u.$$.fragment)},l(l){m=r(l,"P",{});var h=i(m);b=s(h,"Example:"),h.forEach(t),f=p(l),y(u.$$.fragment,l)},m(l,h){_(l,m,h),e(m,b),_(l,f,h),k(u,l,h),v=!0},p:Ge,i(l){v||(T(u.$$.fragment,l),v=!0)},o(l){x(u.$$.fragment,l),v=!1},d(l){l&&t(m),l&&t(f),$(u,l)}}}function qx(W){let m,b,f,u,v,l,h,V,M,L,A,z,N,E,O,C,ce,K,S,de,I,R,De,X,J,Se,We,Z,Ke,$t,Ie,D,Q,tt,ae,Je,jt,Ve,Fe,Wt,U,Vt,Ee,ot,we,Ce,Pe,Ft,he,at,Y,ye,qe,B,Et,ee,Ct,st,j,P,Nt,ue,Bt,ke,q,Qt,Ze,Yt,eo,to,H,pe,oo,ao,se,so,no,Ae,ro,Qe,io,Gl,Ei,xh,cp,ys,dp,Te,ks,$h,Ts,jh,Wh,Vh,xs,Fh,$s,Eh,Ch,Ph,js,qh,Ws,Ah,zh,Mh,Vs,Lh,Fs,Oh,Dh,Sh,Rt,Ci,Ih,Nh,Es,Bh,Rh,Cs,Uh,Hh,Xh,Kl,Pi,Gh,pp,qi,Kh,mp,Ai,Ps,Jh,qs,Zh,Qh,hp,lo,Go,Jl,As,Yh,Zl,eu,up,Ye,zs,tu,co,ou,zi,au,su,Ms,nu,ru,iu,po,lu,Mi,cu,du,Li,pu,mu,hu,Ko,fp,mo,Jo,Ql,Ls,uu,Yl,fu,gp,ne,Os,gu,ec,_u,vu,Ds,bu,Oi,wu,yu,ku,Zo,Ss,Tu,tc,xu,$u,Di,Is,ju,nt,Ns,Wu,oc,Vu,Fu,Bs,Eu,ac,Cu,Pu,qu,Qo,Au,Yo,Rs,zu,sc,Mu,_p,ho,ea,nc,Us,Lu,rc,Ou,vp,et,Hs,Du,ic,Su,Iu,Xs,Nu,Si,Bu,Ru,Uu,ta,Gs,Hu,lc,Xu,bp,uo,oa,cc,Ks,Gu,dc,Ku,wp,G,Js,Ju,pc,Zu,Qu,Ne,Ii,Yu,ef,Ni,tf,of,Bi,af,sf,Zs,mc,nf,rf,lf,Ri,cf,df,pf,aa,Qs,mf,Pt,hf,Ys,hc,uf,ff,gf,uc,_f,vf,en,fc,bf,wf,yf,kf,sa,tn,Tf,qt,xf,Ui,$f,jf,gc,Wf,Vf,Hi,Ff,Ef,Cf,Xi,on,Pf,Ut,an,qf,sn,Af,Gi,zf,Mf,Lf,na,Of,ra,nn,Df,rn,Sf,Ki,If,Nf,Bf,ia,ln,Rf,cn,Uf,Ji,Hf,Xf,yp,fo,la,_c,dn,Gf,vc,Kf,kp,te,pn,Jf,bc,Zf,Qf,ca,mn,Yf,At,eg,hn,wc,tg,og,ag,yc,sg,ng,un,kc,rg,ig,lg,cg,da,fn,dg,zt,pg,Zi,mg,hg,Tc,ug,fg,Qi,gg,_g,vg,Ht,gn,bg,_n,wg,Yi,yg,kg,Tg,pa,xg,el,vn,$g,rt,bn,jg,xc,Wg,Vg,ma,Fg,wn,Eg,tl,Cg,Pg,qg,Xt,yn,Ag,$c,zg,Mg,ha,Tp,go,ua,jc,kn,Lg,Wc,Og,xp,xe,Dg,ol,Sg,Ig,Vc,Ng,Bg,al,Rg,Ug,sl,Hg,Xg,Fc,Gg,Kg,$p,Tn,jp,_o,fa,Ec,xn,Jg,Cc,Zg,Wp,vo,$n,Qg,jn,Yg,Pc,e_,t_,Vp,bo,Wn,o_,qc,a_,Fp,wo,Vn,s_,Fn,n_,nl,r_,i_,Ep,Mt,En,l_,Cn,c_,Ac,d_,p_,m_,ga,Pn,h_,zc,u_,Cp,Lt,qn,f_,An,g_,Mc,__,v_,b_,_a,zn,w_,Lc,y_,Pp,yo,va,Oc,Mn,k_,Dc,T_,qp,ze,Ln,x_,On,$_,Dn,j_,W_,V_,Sn,F_,rl,E_,C_,P_,In,q_,Nn,A_,z_,M_,it,Bn,L_,ko,O_,il,D_,S_,Sc,I_,N_,B_,ba,R_,wa,Ap,To,ya,Ic,Rn,U_,Nc,H_,zp,Me,Un,X_,xo,G_,Bc,K_,J_,Hn,Z_,Q_,Y_,Xn,ev,ll,tv,ov,av,Gn,sv,Kn,nv,rv,iv,lt,Jn,lv,$o,cv,cl,dv,pv,Rc,mv,hv,uv,ka,fv,Ta,Mp,jo,xa,Uc,Zn,gv,Hc,_v,Lp,fe,Qn,vv,Xc,bv,wv,Yn,yv,er,kv,Tv,xv,tr,$v,dl,jv,Wv,Vv,or,Fv,ar,Ev,Cv,Pv,ct,sr,qv,Wo,Av,pl,zv,Mv,Gc,Lv,Ov,Dv,$a,Sv,ja,Op,Vo,Wa,Kc,nr,Iv,Jc,Nv,Dp,ge,rr,Bv,Zc,Rv,Uv,ir,Hv,lr,Xv,Gv,Kv,cr,Jv,ml,Zv,Qv,Yv,dr,e2,pr,t2,o2,a2,dt,mr,s2,Fo,n2,hl,r2,i2,Qc,l2,c2,d2,Va,p2,Fa,Sp,Eo,Ea,Yc,hr,m2,ed,h2,Ip,_e,ur,u2,td,f2,g2,fr,_2,gr,v2,b2,w2,_r,y2,ul,k2,T2,x2,vr,$2,br,j2,W2,V2,pt,wr,F2,Co,E2,fl,C2,P2,od,q2,A2,z2,Ca,M2,Pa,Np,Po,qa,ad,yr,L2,sd,O2,Bp,Le,kr,D2,qo,S2,nd,I2,N2,Tr,B2,R2,U2,xr,H2,gl,X2,G2,K2,$r,J2,jr,Z2,Q2,Y2,mt,Wr,eb,Ao,tb,_l,ob,ab,rd,sb,nb,rb,Aa,ib,za,Rp,zo,Ma,id,Vr,lb,ld,cb,Up,ve,Fr,db,cd,pb,mb,Er,hb,vl,ub,fb,gb,Cr,_b,Pr,vb,bb,wb,La,yb,ht,qr,kb,Mo,Tb,bl,xb,$b,dd,jb,Wb,Vb,Oa,Fb,Da,Hp,Lo,Sa,pd,Ar,Eb,md,Cb,Xp,be,zr,Pb,Mr,qb,hd,Ab,zb,Mb,Lr,Lb,wl,Ob,Db,Sb,Or,Ib,Dr,Nb,Bb,Rb,Ia,Ub,ut,Sr,Hb,Oo,Xb,yl,Gb,Kb,ud,Jb,Zb,Qb,Na,Yb,Ba,Gp,Do,Ra,fd,Ir,ew,gd,tw,Kp,re,Nr,ow,Br,aw,Rr,sw,nw,rw,Ur,iw,kl,lw,cw,dw,Hr,pw,Xr,mw,hw,uw,_d,fw,gw,Ot,vd,Gr,_w,vw,bd,Kr,bw,ww,wd,Jr,yw,kw,yd,Zr,Tw,xw,ft,Qr,$w,So,jw,kd,Ww,Vw,Td,Fw,Ew,Cw,Ua,Pw,Ha,Jp,Io,Xa,xd,Yr,qw,$d,Aw,Zp,ie,ei,zw,No,Mw,jd,Lw,Ow,ti,Dw,Sw,Iw,oi,Nw,Tl,Bw,Rw,Uw,ai,Hw,si,Xw,Gw,Kw,Wd,Jw,Zw,Dt,Vd,ni,Qw,Yw,Fd,ri,e1,t1,Ed,ii,o1,a1,Cd,li,s1,n1,gt,ci,r1,Bo,i1,Pd,l1,c1,qd,d1,p1,m1,Ga,h1,Ka,Qp,Ro,Ja,Ad,di,u1,zd,f1,Yp,le,pi,g1,Uo,_1,Md,v1,b1,mi,w1,y1,k1,hi,T1,xl,x1,$1,j1,ui,W1,fi,V1,F1,E1,Ld,C1,P1,St,Od,gi,q1,A1,Dd,_i,z1,M1,Sd,vi,L1,O1,Id,bi,D1,S1,_t,wi,I1,Ho,N1,$l,B1,R1,Nd,U1,H1,X1,Za,G1,Qa,em;return l=new oe({}),E=new oe({}),B=new oe({}),ue=new ZT({props:{pipeline:"audio-classification"}}),ys=new ZT({props:{pipeline:"automatic-speech-recognition"}}),As=new oe({}),zs=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:"**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.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Model">Wav2Vec2Model</a> or <a href="/docs/transformers/v4.27.1/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.27.1/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.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC">Wav2Vec2ForCTC</a>.`,name:"final_dropout"},{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.27.1/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.27.1/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.27.1/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.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.27.1/src/transformers/models/wav2vec2/configuration_wav2vec2.py#L32"}}),Ko=new Xe({props:{anchor:"transformers.Wav2Vec2Config.example",$$slots:{default:[ax]},$$scope:{ctx:W}}}),Ls=new oe({}),Os=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:"**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.</p>
<p>**kwargs &#x2014;
Additional keyword arguments passed along to <a href="/docs/transformers/v4.27.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>`,name:"do_lower_case"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2/tokenization_wav2vec2.py#L127"}}),Ss=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.27.1/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.27.1/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. 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.27.1/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.27.1/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.27.1/src/transformers/tokenization_utils_base.py#L2456",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/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.27.1/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),Is=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.27.1/src/transformers/models/wav2vec2/tokenization_wav2vec2.py#L595"}}),Ns=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 = True"},{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>, defaults to <code>True</code>) &#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.27.1/src/transformers/models/wav2vec2/tokenization_wav2vec2.py#L490",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>
`}}),Qo=new Xe({props:{anchor:"transformers.Wav2Vec2CTCTokenizer.decode.example",$$slots:{default:[sx]},$$scope:{ctx:W}}}),Rs=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 = True"},{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>, defaults to <code>True</code>) &#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.27.1/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.27.1/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.27.1/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.27.1/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.27.1/src/transformers/models/wav2vec2/tokenization_wav2vec2.py#L420",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>
`}}),Us=new oe({}),Hs=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.27.1/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.27.1/src/transformers/models/wav2vec2/feature_extraction_wav2vec2.py#L31"}}),Gs=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.`,name:"raw_speech"},{anchor:"transformers.Wav2Vec2FeatureExtractor.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.27.1/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.27.1/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.27.1/src/transformers/models/wav2vec2/feature_extraction_wav2vec2.py#L102"}}),Ks=new oe({}),Js=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.27.1/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.27.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
An instance of <a href="/docs/transformers/v4.27.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2/processing_wav2vec2.py#L26"}}),Qs=new F({props:{name:"__call__",anchor:"transformers.Wav2Vec2Processor.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2/processing_wav2vec2.py#L67"}}),tn=new F({props:{name:"pad",anchor:"transformers.Wav2Vec2Processor.pad",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2/processing_wav2vec2.py#L105"}}),on=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.27.1/src/transformers/models/wav2vec2/processing_wav2vec2.py#L48"}}),an=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).
kwargs &#x2014;
Additional key word arguments passed along to the <a href="/docs/transformers/v4.27.1/en/internal/image_processing_utils#transformers.ImageProcessingMixin.push_to_hub">push_to_hub()</a> method.`,name:"push_to_hub"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/processing_utils.py#L91"}}),na=new je({props:{$$slots:{default:[nx]},$$scope:{ctx:W}}}),nn=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.27.1/src/transformers/models/wav2vec2/processing_wav2vec2.py#L135"}}),ln=new F({props:{name:"decode",anchor:"transformers.Wav2Vec2Processor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2/processing_wav2vec2.py#L142"}}),dn=new oe({}),pn=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.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor">Wav2Vec2FeatureExtractor</a>) &#x2014;
An instance of <a href="/docs/transformers/v4.27.1/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.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer">Wav2Vec2CTCTokenizer</a>) &#x2014;
An instance of <a href="/docs/transformers/v4.27.1/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.27.1/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L67"}}),mn=new F({props:{name:"__call__",anchor:"transformers.Wav2Vec2ProcessorWithLM.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L214"}}),fn=new F({props:{name:"pad",anchor:"transformers.Wav2Vec2ProcessorWithLM.pad",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L253"}}),gn=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.27.1/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.27.1/en/main_classes/feature_extractor#transformers.SequenceFeatureExtractor">SequenceFeatureExtractor</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a></li>
</ul>`,name:"pretrained_model_name_or_path"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L112"}}),pa=new je({props:{$$slots:{default:[rx]},$$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.27.1/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L108"}}),bn=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 0x7f75c58043a0>>, 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"}],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.</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.27.1/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.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2ProcessorWithLM.batch_decode">batch_decode()</a> works the same way with
batched output.</p>

					</div>`,name:"output_word_offsets"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L284",returnDescription:`
<p><code>~models.wav2vec2.Wav2Vec2DecoderWithLMOutput</code>.</p>
`}}),ma=new je({props:{$$slots:{default:[ix]},$$scope:{ctx:W}}}),yn=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"}],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.</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"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L440",returnDescription:`
<p><code>~models.wav2vec2.Wav2Vec2DecoderWithLMOutput</code>.</p>
`}}),ha=new Xe({props:{anchor:"transformers.Wav2Vec2ProcessorWithLM.decode.example",$$slots:{default:[lx]},$$scope:{ctx:W}}}),kn=new oe({}),Tn=new Oe({props:{code:`# Let's see how to use a user-managed pool for batch decoding multiple audios
from multiprocessing import get_context
from transformers import AutoTokenizer, AutoProcessor, AutoModelForCTC
from datasets import load_dataset
import datasets
import torch

# import model, feature extractor, tokenizer
model = AutoModelForCTC.from_pretrained("patrickvonplaten/wav2vec2-base-100h-with-lm").to("cuda")
processor = AutoProcessor.from_pretrained("patrickvonplaten/wav2vec2-base-100h-with-lm")

# load example dataset
dataset = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
dataset = dataset.cast_column("audio", datasets.Audio(sampling_rate=16_000))


def map_to_array(batch):
    batch["speech"] = batch["audio"]["array"]
    return batch


# prepare speech data for batch inference
dataset = dataset.map(map_to_array, remove_columns=["audio"])


def map_to_pred(batch, pool):
    inputs = processor(batch["speech"], sampling_rate=16_000, padding=True, return_tensors="pt")
    inputs = {k: v.to("cuda") for k, v in inputs.items()}

    with torch.no_grad():
        logits = model(**inputs).logits

    transcription = processor.batch_decode(logits.cpu().numpy(), pool).text
    batch["transcription"] = transcription
    return batch


# note: pool should be instantiated *after* \`Wav2Vec2ProcessorWithLM\`.
#       otherwise, the LM won't be available to the pool's sub-processes
# select number of processes and batch_size based on number of CPU cores available and on dataset size
with get_context("fork").Pool(processes=2) as pool:
    result = dataset.map(
        map_to_pred, batched=True, batch_size=2, fn_kwargs={"pool": pool}, remove_columns=["speech"]
    )

result["transcription"][:2]`,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>]`}}),xn=new oe({}),$n=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[str], str]"},{name:"logit_score",val:": typing.Union[typing.List[float], float] = None"},{name:"lm_score",val:": typing.Union[typing.List[float], float] = None"},{name:"word_offsets",val:": typing.Union[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 beam 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 beam 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.27.1/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L45"}}),Wn=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.27.1/src/transformers/modeling_outputs.py#L1285"}}),Vn=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.27.1/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L92"}}),En=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:": ndarray = None"},{name:"extract_features",val:": ndarray = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[jax._src.numpy.ndarray.ndarray]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[jax._src.numpy.ndarray.ndarray]] = 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.27.1/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L45"}}),Pn=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.27.1/src/flax/struct.py#L108"}}),qn=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:": ndarray = None"},{name:"projected_quantized_states",val:": ndarray = None"},{name:"codevector_perplexity",val:": ndarray = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[jax._src.numpy.ndarray.ndarray]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[jax._src.numpy.ndarray.ndarray]] = 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.27.1/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L75"}}),zn=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.27.1/src/flax/struct.py#L108"}}),Mn=new oe({}),Ln=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.27.1/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.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L1198"}}),Bn=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.27.1/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L1284",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#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.27.1/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.27.1/en/main_classes/output#transformers.modeling_outputs.Wav2Vec2BaseModelOutput"
>transformers.modeling_outputs.Wav2Vec2BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ba=new je({props:{$$slots:{default:[cx]},$$scope:{ctx:W}}}),wa=new Xe({props:{anchor:"transformers.Wav2Vec2Model.forward.example",$$slots:{default:[dx]},$$scope:{ctx:W}}}),Rn=new oe({}),Un=new F({props:{name:"class transformers.Wav2Vec2ForCTC",anchor:"transformers.Wav2Vec2ForCTC",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2ForCTC.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/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.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L1617"}}),Jn=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.27.1/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.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.27.1/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.27.1/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L1658",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.CausalLMOutput"
>transformers.modeling_outputs.CausalLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/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.27.1/en/main_classes/output#transformers.modeling_outputs.CausalLMOutput"
>transformers.modeling_outputs.CausalLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ka=new je({props:{$$slots:{default:[px]},$$scope:{ctx:W}}}),Ta=new Xe({props:{anchor:"transformers.Wav2Vec2ForCTC.forward.example",$$slots:{default:[mx]},$$scope:{ctx:W}}}),Zn=new oe({}),Qn=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.27.1/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.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L1745"}}),sr=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.27.1/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.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.27.1/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.27.1/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L1790",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/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.27.1/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$a=new je({props:{$$slots:{default:[hx]},$$scope:{ctx:W}}}),ja=new Xe({props:{anchor:"transformers.Wav2Vec2ForSequenceClassification.forward.example",$$slots:{default:[ux]},$$scope:{ctx:W}}}),nr=new oe({}),rr=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.27.1/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.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L1867"}}),mr=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.27.1/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.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.27.1/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.27.1/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L1911",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/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.27.1/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.27.1/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Va=new je({props:{$$slots:{default:[fx]},$$scope:{ctx:W}}}),Fa=new Xe({props:{anchor:"transformers.Wav2Vec2ForAudioFrameClassification.forward.example",$$slots:{default:[gx]},$$scope:{ctx:W}}}),hr=new oe({}),ur=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.27.1/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.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L2028"}}),wr=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.27.1/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.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.27.1/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.27.1/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L2090",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/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.27.1/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.27.1/en/main_classes/output#transformers.modeling_outputs.XVectorOutput"
>transformers.modeling_outputs.XVectorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ca=new je({props:{$$slots:{default:[_x]},$$scope:{ctx:W}}}),Pa=new Xe({props:{anchor:"transformers.Wav2Vec2ForXVector.forward.example",$$slots:{default:[vx]},$$scope:{ctx:W}}}),yr=new oe({}),kr=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.27.1/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.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L1346"}}),Wr=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.27.1/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.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.27.1/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.27.1/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L1406",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/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.27.1/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.27.1/en/model_doc/wav2vec2#transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForPreTrainingOutput"
>transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Aa=new je({props:{$$slots:{default:[bx]},$$scope:{ctx:W}}}),za=new Xe({props:{anchor:"transformers.Wav2Vec2ForPreTraining.forward.example",$$slots:{default:[wx]},$$scope:{ctx:W}}}),Vr=new oe({}),Fr=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.27.1/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.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py#L1318"}}),La=new je({props:{$$slots:{default:[yx]},$$scope:{ctx:W}}}),qr=new F({props:{name:"call",anchor:"transformers.TFWav2Vec2Model.call",parameters:[{name:"input_values",val:": Tensor"},{name:"attention_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"position_ids",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"head_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[tensorflow.python.framework.ops.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:"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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.27.1/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.27.1/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.27.1/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py#L1324",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/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.27.1/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.27.1/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutput"
>transformers.modeling_tf_outputs.TFBaseModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Oa=new je({props:{$$slots:{default:[kx]},$$scope:{ctx:W}}}),Da=new Xe({props:{anchor:"transformers.TFWav2Vec2Model.call.example",$$slots:{default:[Tx]},$$scope:{ctx:W}}}),Ar=new oe({}),zr=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.27.1/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.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py#L1403"}}),Ia=new je({props:{$$slots:{default:[xx]},$$scope:{ctx:W}}}),Sr=new F({props:{name:"call",anchor:"transformers.TFWav2Vec2ForCTC.call",parameters:[{name:"input_values",val:": Tensor"},{name:"attention_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"position_ids",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"head_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": typing.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.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.27.1/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.27.1/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.27.1/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py#L1430",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/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.27.1/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.27.1/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutput"
>transformers.modeling_tf_outputs.TFCausalLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Na=new je({props:{$$slots:{default:[$x]},$$scope:{ctx:W}}}),Ba=new Xe({props:{anchor:"transformers.TFWav2Vec2ForCTC.call.example",$$slots:{default:[jx]},$$scope:{ctx:W}}}),Ir=new oe({}),Nr=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.27.1/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.27.1/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.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L1055"}}),Qr=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.27.1/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.27.1/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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L888",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/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.27.1/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>
`}}),Ua=new je({props:{$$slots:{default:[Wx]},$$scope:{ctx:W}}}),Ha=new Xe({props:{anchor:"transformers.FlaxWav2Vec2Model.__call__.example",$$slots:{default:[Vx]},$$scope:{ctx:W}}}),Yr=new oe({}),ei=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.27.1/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.27.1/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.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L1173"}}),ci=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.27.1/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.27.1/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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L888",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/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.27.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ga=new je({props:{$$slots:{default:[Fx]},$$scope:{ctx:W}}}),Ka=new Xe({props:{anchor:"transformers.FlaxWav2Vec2ForCTC.__call__.example",$$slots:{default:[Ex]},$$scope:{ctx:W}}}),di=new oe({}),pi=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.27.1/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.27.1/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.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L1319"}}),wi=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.27.1/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.27.1/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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L1322",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/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.27.1/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>
`}}),Za=new je({props:{$$slots:{default:[Cx]},$$scope:{ctx:W}}}),Qa=new Xe({props:{anchor:"transformers.FlaxWav2Vec2ForPreTraining.__call__.example",$$slots:{default:[Px]},$$scope:{ctx:W}}}),{c(){m=n("meta"),b=d(),f=n("h1"),u=n("a"),v=n("span"),w(l.$$.fragment),h=d(),V=n("span"),M=a("Wav2Vec2"),L=d(),A=n("h2"),z=n("a"),N=n("span"),w(E.$$.fragment),O=d(),C=n("span"),ce=a("Overview"),K=d(),S=n("p"),de=a("The Wav2Vec2 model was proposed in "),I=n("a"),R=a("wav2vec 2.0: A Framework for Self-Supervised Learning of Speech Representations"),De=a(" by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael Auli."),X=d(),J=n("p"),Se=a("The abstract from the paper is the following:"),We=d(),Z=n("p"),Ke=n("em"),$t=a(`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.`),Ie=d(),D=n("p"),Q=a("Tips:"),tt=d(),ae=n("ul"),Je=n("li"),jt=a("Wav2Vec2 is a speech model that accepts a float array corresponding to the raw waveform of the speech signal."),Ve=d(),Fe=n("li"),Wt=a(`Wav2Vec2 model was trained using connectionist temporal classification (CTC) so the model output has to be decoded
using `),U=n("a"),Vt=a("Wav2Vec2CTCTokenizer"),Ee=a("."),ot=d(),we=n("p"),Ce=a("This model was contributed by "),Pe=n("a"),Ft=a("patrickvonplaten"),he=a("."),at=d(),Y=n("h2"),ye=n("a"),qe=n("span"),w(B.$$.fragment),Et=d(),ee=n("span"),Ct=a("Resources"),st=d(),j=n("p"),P=a("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."),Nt=d(),w(ue.$$.fragment),Bt=d(),ke=n("ul"),q=n("li"),Qt=a("A notebook on how to "),Ze=n("a"),Yt=a("leverage a pretrained Wav2Vec2 model for emotion classification"),eo=a(". \u{1F30E}"),to=d(),H=n("li"),pe=n("a"),oo=a("Wav2Vec2ForCTC"),ao=a(" is supported by this "),se=n("a"),so=a("example script"),no=a(" and "),Ae=n("a"),ro=a("notebook"),Qe=a("."),io=d(),Gl=n("li"),Ei=n("a"),xh=a("Audio classification task guide"),cp=d(),w(ys.$$.fragment),dp=d(),Te=n("ul"),ks=n("li"),$h=a("A blog post on "),Ts=n("a"),jh=a("boosting Wav2Vec2 with n-grams in \u{1F917} Transformers"),Wh=a("."),Vh=d(),xs=n("li"),Fh=a("A blog post on how to "),$s=n("a"),Eh=a("finetune Wav2Vec2 for English ASR with \u{1F917} Transformers"),Ch=a("."),Ph=d(),js=n("li"),qh=a("A blog post on "),Ws=n("a"),Ah=a("finetuning XLS-R for Multi-Lingual ASR with \u{1F917} Transformers"),zh=a("."),Mh=d(),Vs=n("li"),Lh=a("A notebook on how to "),Fs=n("a"),Oh=a("create YouTube captions from any video by transcribing audio with Wav2Vec2"),Dh=a(". \u{1F30E}"),Sh=d(),Rt=n("li"),Ci=n("a"),Ih=a("Wav2Vec2ForCTC"),Nh=a(" is supported by a notebook on "),Es=n("a"),Bh=a("how to finetune a speech recognition model in English"),Rh=a(", and "),Cs=n("a"),Uh=a("how to finetune a speech recognition model in any language"),Hh=a("."),Xh=d(),Kl=n("li"),Pi=n("a"),Gh=a("Automatic speech recognition task guide"),pp=d(),qi=n("p"),Kh=a("\u{1F680} Deploy"),mp=d(),Ai=n("ul"),Ps=n("li"),Jh=a("A blog post on how to deploy Wav2Vec2 for "),qs=n("a"),Zh=a("Automatic Speech Recogntion with Hugging Face\u2019s Transformers & Amazon SageMaker"),Qh=a("."),hp=d(),lo=n("h2"),Go=n("a"),Jl=n("span"),w(As.$$.fragment),Yh=d(),Zl=n("span"),eu=a("Wav2Vec2Config"),up=d(),Ye=n("div"),w(zs.$$.fragment),tu=d(),co=n("p"),ou=a("This is the configuration class to store the configuration of a "),zi=n("a"),au=a("Wav2Vec2Model"),su=a(`. 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
`),Ms=n("a"),nu=a("facebook/wav2vec2-base-960h"),ru=a(" architecture."),iu=d(),po=n("p"),lu=a("Configuration objects inherit from "),Mi=n("a"),cu=a("PretrainedConfig"),du=a(` and can be used to control the model outputs. Read the
documentation from `),Li=n("a"),pu=a("PretrainedConfig"),mu=a(" for more information."),hu=d(),w(Ko.$$.fragment),fp=d(),mo=n("h2"),Jo=n("a"),Ql=n("span"),w(Ls.$$.fragment),uu=d(),Yl=n("span"),fu=a("Wav2Vec2CTCTokenizer"),gp=d(),ne=n("div"),w(Os.$$.fragment),gu=d(),ec=n("p"),_u=a("Constructs a Wav2Vec2CTC tokenizer."),vu=d(),Ds=n("p"),bu=a("This tokenizer inherits from "),Oi=n("a"),wu=a("PreTrainedTokenizer"),yu=a(` which contains some of the main methods. Users should refer to
the superclass for more information regarding such methods.`),ku=d(),Zo=n("div"),w(Ss.$$.fragment),Tu=d(),tc=n("p"),xu=a(`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),$u=d(),Di=n("div"),w(Is.$$.fragment),ju=d(),nt=n("div"),w(Ns.$$.fragment),Wu=d(),oc=n("p"),Vu=a(`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),Fu=d(),Bs=n("p"),Eu=a("Similar to doing "),ac=n("code"),Cu=a("self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),Pu=a("."),qu=d(),w(Qo.$$.fragment),Au=d(),Yo=n("div"),w(Rs.$$.fragment),zu=d(),sc=n("p"),Mu=a("Convert a list of lists of token ids into a list of strings by calling decode."),_p=d(),ho=n("h2"),ea=n("a"),nc=n("span"),w(Us.$$.fragment),Lu=d(),rc=n("span"),Ou=a("Wav2Vec2FeatureExtractor"),vp=d(),et=n("div"),w(Hs.$$.fragment),Du=d(),ic=n("p"),Su=a("Constructs a Wav2Vec2 feature extractor."),Iu=d(),Xs=n("p"),Nu=a("This feature extractor inherits from "),Si=n("a"),Bu=a("SequenceFeatureExtractor"),Ru=a(` which contains
most of the main methods. Users should refer to this superclass for more information regarding those methods.`),Uu=d(),ta=n("div"),w(Gs.$$.fragment),Hu=d(),lc=n("p"),Xu=a("Main method to featurize and prepare for the model one or several sequence(s)."),bp=d(),uo=n("h2"),oa=n("a"),cc=n("span"),w(Ks.$$.fragment),Gu=d(),dc=n("span"),Ku=a("Wav2Vec2Processor"),wp=d(),G=n("div"),w(Js.$$.fragment),Ju=d(),pc=n("p"),Zu=a(`Constructs a Wav2Vec2 processor which wraps a Wav2Vec2 feature extractor and a Wav2Vec2 CTC tokenizer into a single
processor.`),Qu=d(),Ne=n("p"),Ii=n("a"),Yu=a("Wav2Vec2Processor"),ef=a(" offers all the functionalities of "),Ni=n("a"),tf=a("Wav2Vec2FeatureExtractor"),of=a(" and "),Bi=n("a"),af=a("PreTrainedTokenizer"),sf=a(`.
See the docstring of `),Zs=n("a"),mc=n("strong"),nf=a("call"),rf=a("()"),lf=a(" and "),Ri=n("a"),cf=a("decode()"),df=a(" for more information."),pf=d(),aa=n("div"),w(Qs.$$.fragment),mf=d(),Pt=n("p"),hf=a(`When used in normal mode, this method forwards all its arguments to Wav2Vec2FeatureExtractor\u2019s
`),Ys=n("a"),hc=n("strong"),uf=a("call"),ff=a("()"),gf=a(` and returns its output. If used in the context
`),uc=n("code"),_f=a("as_target_processor()"),vf=a(` this method forwards all its arguments to PreTrainedTokenizer\u2019s
`),en=n("a"),fc=n("strong"),bf=a("call"),wf=a("()"),yf=a(". Please refer to the docstring of the above two methods for more information."),kf=d(),sa=n("div"),w(tn.$$.fragment),Tf=d(),qt=n("p"),xf=a(`When used in normal mode, this method forwards all its arguments to Wav2Vec2FeatureExtractor\u2019s
`),Ui=n("a"),$f=a("pad()"),jf=a(` and returns its output. If used in the context
`),gc=n("code"),Wf=a("as_target_processor()"),Vf=a(` this method forwards all its arguments to PreTrainedTokenizer\u2019s
`),Hi=n("a"),Ff=a("pad()"),Ef=a(". Please refer to the docstring of the above two methods for more information."),Cf=d(),Xi=n("div"),w(on.$$.fragment),Pf=d(),Ut=n("div"),w(an.$$.fragment),qf=d(),sn=n("p"),Af=a(`Saves the attributes of this processor (feature extractor, tokenizer\u2026) in the specified directory so that it
can be reloaded using the `),Gi=n("a"),zf=a("from_pretrained()"),Mf=a(" method."),Lf=d(),w(na.$$.fragment),Of=d(),ra=n("div"),w(nn.$$.fragment),Df=d(),rn=n("p"),Sf=a("This method forwards all its arguments to PreTrainedTokenizer\u2019s "),Ki=n("a"),If=a("batch_decode()"),Nf=a(`. Please
refer to the docstring of this method for more information.`),Bf=d(),ia=n("div"),w(ln.$$.fragment),Rf=d(),cn=n("p"),Uf=a("This method forwards all its arguments to PreTrainedTokenizer\u2019s "),Ji=n("a"),Hf=a("decode()"),Xf=a(`. Please refer
to the docstring of this method for more information.`),yp=d(),fo=n("h2"),la=n("a"),_c=n("span"),w(dn.$$.fragment),Gf=d(),vc=n("span"),Kf=a("Wav2Vec2ProcessorWithLM"),kp=d(),te=n("div"),w(pn.$$.fragment),Jf=d(),bc=n("p"),Zf=a(`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.`),Qf=d(),ca=n("div"),w(mn.$$.fragment),Yf=d(),At=n("p"),eg=a(`When used in normal mode, this method forwards all its arguments to Wav2Vec2FeatureExtractor\u2019s
`),hn=n("a"),wc=n("strong"),tg=a("call"),og=a("()"),ag=a(` and returns its output. If used in the context
`),yc=n("code"),sg=a("as_target_processor()"),ng=a(` this method forwards all its arguments to
Wav2Vec2CTCTokenizer\u2019s `),un=n("a"),kc=n("strong"),rg=a("call"),ig=a("()"),lg=a(`. Please refer to the docstring of the above two
methods for more information.`),cg=d(),da=n("div"),w(fn.$$.fragment),dg=d(),zt=n("p"),pg=a(`When used in normal mode, this method forwards all its arguments to Wav2Vec2FeatureExtractor\u2019s
`),Zi=n("a"),mg=a("pad()"),hg=a(` and returns its output. If used in the context
`),Tc=n("code"),ug=a("as_target_processor()"),fg=a(` this method forwards all its arguments to
Wav2Vec2CTCTokenizer\u2019s `),Qi=n("a"),gg=a("pad()"),_g=a(`. Please refer to the docstring of the above two methods
for more information.`),vg=d(),Ht=n("div"),w(gn.$$.fragment),bg=d(),_n=n("p"),wg=a("Instantiate a "),Yi=n("a"),yg=a("Wav2Vec2ProcessorWithLM"),kg=a(" from a pretrained Wav2Vec2 processor."),Tg=d(),w(pa.$$.fragment),xg=d(),el=n("div"),w(vn.$$.fragment),$g=d(),rt=n("div"),w(bn.$$.fragment),jg=d(),xc=n("p"),Wg=a("Batch decode output logits to audio transcription with language model support."),Vg=d(),w(ma.$$.fragment),Fg=d(),wn=n("p"),Eg=a(`Example:
See `),tl=n("a"),Cg=a("Decoding multiple audios"),Pg=a("."),qg=d(),Xt=n("div"),w(yn.$$.fragment),Ag=d(),$c=n("p"),zg=a("Decode output logits to audio transcription with language model support."),Mg=d(),w(ha.$$.fragment),Tp=d(),go=n("h3"),ua=n("a"),jc=n("span"),w(kn.$$.fragment),Lg=d(),Wc=n("span"),Og=a("Decoding multiple audios"),xp=d(),xe=n("p"),Dg=a("If you are planning to decode multiple batches of audios, you should consider using "),ol=n("a"),Sg=a("batch_decode()"),Ig=a(" and passing an instantiated "),Vc=n("code"),Ng=a("multiprocessing.Pool"),Bg=a(`.
Otherwise, `),al=n("a"),Rg=a("batch_decode()"),Ug=a(" performance will be slower than calling "),sl=n("a"),Hg=a("decode()"),Xg=a(" for each audio individually, as it internally instantiates a new "),Fc=n("code"),Gg=a("Pool"),Kg=a(" for every call. See the example below:"),$p=d(),w(Tn.$$.fragment),jp=d(),_o=n("h2"),fa=n("a"),Ec=n("span"),w(xn.$$.fragment),Jg=d(),Cc=n("span"),Zg=a("Wav2Vec2 specific outputs"),Wp=d(),vo=n("div"),w($n.$$.fragment),Qg=d(),jn=n("p"),Yg=a("Output type of "),Pc=n("code"),e_=a("Wav2Vec2DecoderWithLM"),t_=a(", with transcription."),Vp=d(),bo=n("div"),w(Wn.$$.fragment),o_=d(),qc=n("p"),a_=a("Base class for models that have been trained with the Wav2Vec2 loss objective."),Fp=d(),wo=n("div"),w(Vn.$$.fragment),s_=d(),Fn=n("p"),n_=a("Output type of "),nl=n("a"),r_=a("Wav2Vec2ForPreTraining"),i_=a(", with potential hidden states and attentions."),Ep=d(),Mt=n("div"),w(En.$$.fragment),l_=d(),Cn=n("p"),c_=a("Output type of "),Ac=n("code"),d_=a("FlaxWav2Vec2BaseModelOutput"),p_=a(", with potential hidden states and attentions."),m_=d(),ga=n("div"),w(Pn.$$.fragment),h_=d(),zc=n("p"),u_=a("\u201CReturns a new object replacing the specified fields with new values."),Cp=d(),Lt=n("div"),w(qn.$$.fragment),f_=d(),An=n("p"),g_=a("Output type of "),Mc=n("code"),__=a("FlaxWav2Vec2ForPreTrainingOutput"),v_=a(", with potential hidden states and attentions."),b_=d(),_a=n("div"),w(zn.$$.fragment),w_=d(),Lc=n("p"),y_=a("\u201CReturns a new object replacing the specified fields with new values."),Pp=d(),yo=n("h2"),va=n("a"),Oc=n("span"),w(Mn.$$.fragment),k_=d(),Dc=n("span"),T_=a("Wav2Vec2Model"),qp=d(),ze=n("div"),w(Ln.$$.fragment),x_=d(),On=n("p"),$_=a(`The bare Wav2Vec2 Model transformer outputting raw hidden-states without any specific head on top.
Wav2Vec2 was proposed in `),Dn=n("a"),j_=a(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),W_=a(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),V_=d(),Sn=n("p"),F_=a("This model inherits from "),rl=n("a"),E_=a("PreTrainedModel"),C_=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),P_=d(),In=n("p"),q_=a("This model is a PyTorch "),Nn=n("a"),A_=a("torch.nn.Module"),z_=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),M_=d(),it=n("div"),w(Bn.$$.fragment),L_=d(),ko=n("p"),O_=a("The "),il=n("a"),D_=a("Wav2Vec2Model"),S_=a(" forward method, overrides the "),Sc=n("code"),I_=a("__call__"),N_=a(" special method."),B_=d(),w(ba.$$.fragment),R_=d(),w(wa.$$.fragment),Ap=d(),To=n("h2"),ya=n("a"),Ic=n("span"),w(Rn.$$.fragment),U_=d(),Nc=n("span"),H_=a("Wav2Vec2ForCTC"),zp=d(),Me=n("div"),w(Un.$$.fragment),X_=d(),xo=n("p"),G_=a("Wav2Vec2 Model with a "),Bc=n("code"),K_=a("language modeling"),J_=a(` head on top for Connectionist Temporal Classification (CTC).
Wav2Vec2 was proposed in `),Hn=n("a"),Z_=a(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),Q_=a(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Y_=d(),Xn=n("p"),ev=a("This model inherits from "),ll=n("a"),tv=a("PreTrainedModel"),ov=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),av=d(),Gn=n("p"),sv=a("This model is a PyTorch "),Kn=n("a"),nv=a("torch.nn.Module"),rv=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),iv=d(),lt=n("div"),w(Jn.$$.fragment),lv=d(),$o=n("p"),cv=a("The "),cl=n("a"),dv=a("Wav2Vec2ForCTC"),pv=a(" forward method, overrides the "),Rc=n("code"),mv=a("__call__"),hv=a(" special method."),uv=d(),w(ka.$$.fragment),fv=d(),w(Ta.$$.fragment),Mp=d(),jo=n("h2"),xa=n("a"),Uc=n("span"),w(Zn.$$.fragment),gv=d(),Hc=n("span"),_v=a("Wav2Vec2ForSequenceClassification"),Lp=d(),fe=n("div"),w(Qn.$$.fragment),vv=d(),Xc=n("p"),bv=a(`Wav2Vec2 Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like
SUPERB Keyword Spotting.`),wv=d(),Yn=n("p"),yv=a("Wav2Vec2 was proposed in "),er=n("a"),kv=a(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),Tv=a(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),xv=d(),tr=n("p"),$v=a("This model inherits from "),dl=n("a"),jv=a("PreTrainedModel"),Wv=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Vv=d(),or=n("p"),Fv=a("This model is a PyTorch "),ar=n("a"),Ev=a("torch.nn.Module"),Cv=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Pv=d(),ct=n("div"),w(sr.$$.fragment),qv=d(),Wo=n("p"),Av=a("The "),pl=n("a"),zv=a("Wav2Vec2ForSequenceClassification"),Mv=a(" forward method, overrides the "),Gc=n("code"),Lv=a("__call__"),Ov=a(" special method."),Dv=d(),w($a.$$.fragment),Sv=d(),w(ja.$$.fragment),Op=d(),Vo=n("h2"),Wa=n("a"),Kc=n("span"),w(nr.$$.fragment),Iv=d(),Jc=n("span"),Nv=a("Wav2Vec2ForAudioFrameClassification"),Dp=d(),ge=n("div"),w(rr.$$.fragment),Bv=d(),Zc=n("p"),Rv=a("Wav2Vec2 Model with a frame classification head on top for tasks like Speaker Diarization."),Uv=d(),ir=n("p"),Hv=a("Wav2Vec2 was proposed in "),lr=n("a"),Xv=a(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),Gv=a(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Kv=d(),cr=n("p"),Jv=a("This model inherits from "),ml=n("a"),Zv=a("PreTrainedModel"),Qv=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Yv=d(),dr=n("p"),e2=a("This model is a PyTorch "),pr=n("a"),t2=a("torch.nn.Module"),o2=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),a2=d(),dt=n("div"),w(mr.$$.fragment),s2=d(),Fo=n("p"),n2=a("The "),hl=n("a"),r2=a("Wav2Vec2ForAudioFrameClassification"),i2=a(" forward method, overrides the "),Qc=n("code"),l2=a("__call__"),c2=a(" special method."),d2=d(),w(Va.$$.fragment),p2=d(),w(Fa.$$.fragment),Sp=d(),Eo=n("h2"),Ea=n("a"),Yc=n("span"),w(hr.$$.fragment),m2=d(),ed=n("span"),h2=a("Wav2Vec2ForXVector"),Ip=d(),_e=n("div"),w(ur.$$.fragment),u2=d(),td=n("p"),f2=a("Wav2Vec2 Model with an XVector feature extraction head on top for tasks like Speaker Verification."),g2=d(),fr=n("p"),_2=a("Wav2Vec2 was proposed in "),gr=n("a"),v2=a(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),b2=a(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),w2=d(),_r=n("p"),y2=a("This model inherits from "),ul=n("a"),k2=a("PreTrainedModel"),T2=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),x2=d(),vr=n("p"),$2=a("This model is a PyTorch "),br=n("a"),j2=a("torch.nn.Module"),W2=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),V2=d(),pt=n("div"),w(wr.$$.fragment),F2=d(),Co=n("p"),E2=a("The "),fl=n("a"),C2=a("Wav2Vec2ForXVector"),P2=a(" forward method, overrides the "),od=n("code"),q2=a("__call__"),A2=a(" special method."),z2=d(),w(Ca.$$.fragment),M2=d(),w(Pa.$$.fragment),Np=d(),Po=n("h2"),qa=n("a"),ad=n("span"),w(yr.$$.fragment),L2=d(),sd=n("span"),O2=a("Wav2Vec2ForPreTraining"),Bp=d(),Le=n("div"),w(kr.$$.fragment),D2=d(),qo=n("p"),S2=a("Wav2Vec2 Model with a quantizer and "),nd=n("code"),I2=a("VQ"),N2=a(` head on top.
Wav2Vec2 was proposed in `),Tr=n("a"),B2=a(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),R2=a(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),U2=d(),xr=n("p"),H2=a("This model inherits from "),gl=n("a"),X2=a("PreTrainedModel"),G2=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),K2=d(),$r=n("p"),J2=a("This model is a PyTorch "),jr=n("a"),Z2=a("torch.nn.Module"),Q2=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Y2=d(),mt=n("div"),w(Wr.$$.fragment),eb=d(),Ao=n("p"),tb=a("The "),_l=n("a"),ob=a("Wav2Vec2ForPreTraining"),ab=a(" forward method, overrides the "),rd=n("code"),sb=a("__call__"),nb=a(" special method."),rb=d(),w(Aa.$$.fragment),ib=d(),w(za.$$.fragment),Rp=d(),zo=n("h2"),Ma=n("a"),id=n("span"),w(Vr.$$.fragment),lb=d(),ld=n("span"),cb=a("TFWav2Vec2Model"),Up=d(),ve=n("div"),w(Fr.$$.fragment),db=d(),cd=n("p"),pb=a("The bare TFWav2Vec2 Model transformer outputing raw hidden-states without any specific head on top."),mb=d(),Er=n("p"),hb=a("This model inherits from "),vl=n("a"),ub=a("TFPreTrainedModel"),fb=a(`. 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.)`),gb=d(),Cr=n("p"),_b=a("This model is also a "),Pr=n("a"),vb=a("tf.keras.Model"),bb=a(` 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.`),wb=d(),w(La.$$.fragment),yb=d(),ht=n("div"),w(qr.$$.fragment),kb=d(),Mo=n("p"),Tb=a("The "),bl=n("a"),xb=a("TFWav2Vec2Model"),$b=a(" forward method, overrides the "),dd=n("code"),jb=a("__call__"),Wb=a(" special method."),Vb=d(),w(Oa.$$.fragment),Fb=d(),w(Da.$$.fragment),Hp=d(),Lo=n("h2"),Sa=n("a"),pd=n("span"),w(Ar.$$.fragment),Eb=d(),md=n("span"),Cb=a("TFWav2Vec2ForCTC"),Xp=d(),be=n("div"),w(zr.$$.fragment),Pb=d(),Mr=n("p"),qb=a("TFWav2Vec2 Model with a "),hd=n("code"),Ab=a("language modeling"),zb=a(" head on top for Connectionist Temporal Classification (CTC)."),Mb=d(),Lr=n("p"),Lb=a("This model inherits from "),wl=n("a"),Ob=a("TFPreTrainedModel"),Db=a(`. 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.)`),Sb=d(),Or=n("p"),Ib=a("This model is also a "),Dr=n("a"),Nb=a("tf.keras.Model"),Bb=a(` 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.`),Rb=d(),w(Ia.$$.fragment),Ub=d(),ut=n("div"),w(Sr.$$.fragment),Hb=d(),Oo=n("p"),Xb=a("The "),yl=n("a"),Gb=a("TFWav2Vec2ForCTC"),Kb=a(" forward method, overrides the "),ud=n("code"),Jb=a("__call__"),Zb=a(" special method."),Qb=d(),w(Na.$$.fragment),Yb=d(),w(Ba.$$.fragment),Gp=d(),Do=n("h2"),Ra=n("a"),fd=n("span"),w(Ir.$$.fragment),ew=d(),gd=n("span"),tw=a("FlaxWav2Vec2Model"),Kp=d(),re=n("div"),w(Nr.$$.fragment),ow=d(),Br=n("p"),aw=a(`The bare Wav2Vec2 Model transformer outputting raw hidden-states without any specific head on top.
Wav2Vec2 was proposed in `),Rr=n("a"),sw=a(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),nw=a(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),rw=d(),Ur=n("p"),iw=a("This model inherits from "),kl=n("a"),lw=a("FlaxPreTrainedModel"),cw=a(`. 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.)`),dw=d(),Hr=n("p"),pw=a(`This model is also a Flax Linen
`),Xr=n("a"),mw=a("flax.nn.Module"),hw=a(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),uw=d(),_d=n("p"),fw=a("Finally, this model supports inherent JAX features such as:"),gw=d(),Ot=n("ul"),vd=n("li"),Gr=n("a"),_w=a("Just-In-Time (JIT) compilation"),vw=d(),bd=n("li"),Kr=n("a"),bw=a("Automatic Differentiation"),ww=d(),wd=n("li"),Jr=n("a"),yw=a("Vectorization"),kw=d(),yd=n("li"),Zr=n("a"),Tw=a("Parallelization"),xw=d(),ft=n("div"),w(Qr.$$.fragment),$w=d(),So=n("p"),jw=a("The "),kd=n("code"),Ww=a("FlaxWav2Vec2PreTrainedModel"),Vw=a(" forward method, overrides the "),Td=n("code"),Fw=a("__call__"),Ew=a(" special method."),Cw=d(),w(Ua.$$.fragment),Pw=d(),w(Ha.$$.fragment),Jp=d(),Io=n("h2"),Xa=n("a"),xd=n("span"),w(Yr.$$.fragment),qw=d(),$d=n("span"),Aw=a("FlaxWav2Vec2ForCTC"),Zp=d(),ie=n("div"),w(ei.$$.fragment),zw=d(),No=n("p"),Mw=a("Wav2Vec2 Model with a "),jd=n("code"),Lw=a("language modeling"),Ow=a(` head on top for Connectionist Temporal Classification (CTC).
Wav2Vec2 was proposed in `),ti=n("a"),Dw=a(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),Sw=a(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Iw=d(),oi=n("p"),Nw=a("This model inherits from "),Tl=n("a"),Bw=a("FlaxPreTrainedModel"),Rw=a(`. 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.)`),Uw=d(),ai=n("p"),Hw=a(`This model is also a Flax Linen
`),si=n("a"),Xw=a("flax.nn.Module"),Gw=a(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Kw=d(),Wd=n("p"),Jw=a("Finally, this model supports inherent JAX features such as:"),Zw=d(),Dt=n("ul"),Vd=n("li"),ni=n("a"),Qw=a("Just-In-Time (JIT) compilation"),Yw=d(),Fd=n("li"),ri=n("a"),e1=a("Automatic Differentiation"),t1=d(),Ed=n("li"),ii=n("a"),o1=a("Vectorization"),a1=d(),Cd=n("li"),li=n("a"),s1=a("Parallelization"),n1=d(),gt=n("div"),w(ci.$$.fragment),r1=d(),Bo=n("p"),i1=a("The "),Pd=n("code"),l1=a("FlaxWav2Vec2PreTrainedModel"),c1=a(" forward method, overrides the "),qd=n("code"),d1=a("__call__"),p1=a(" special method."),m1=d(),w(Ga.$$.fragment),h1=d(),w(Ka.$$.fragment),Qp=d(),Ro=n("h2"),Ja=n("a"),Ad=n("span"),w(di.$$.fragment),u1=d(),zd=n("span"),f1=a("FlaxWav2Vec2ForPreTraining"),Yp=d(),le=n("div"),w(pi.$$.fragment),g1=d(),Uo=n("p"),_1=a("Wav2Vec2 Model with a quantizer and "),Md=n("code"),v1=a("VQ"),b1=a(` head on top.
Wav2Vec2 was proposed in `),mi=n("a"),w1=a(`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),y1=a(` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),k1=d(),hi=n("p"),T1=a("This model inherits from "),xl=n("a"),x1=a("FlaxPreTrainedModel"),$1=a(`. 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.)`),j1=d(),ui=n("p"),W1=a(`This model is also a Flax Linen
`),fi=n("a"),V1=a("flax.nn.Module"),F1=a(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),E1=d(),Ld=n("p"),C1=a("Finally, this model supports inherent JAX features such as:"),P1=d(),St=n("ul"),Od=n("li"),gi=n("a"),q1=a("Just-In-Time (JIT) compilation"),A1=d(),Dd=n("li"),_i=n("a"),z1=a("Automatic Differentiation"),M1=d(),Sd=n("li"),vi=n("a"),L1=a("Vectorization"),O1=d(),Id=n("li"),bi=n("a"),D1=a("Parallelization"),S1=d(),_t=n("div"),w(wi.$$.fragment),I1=d(),Ho=n("p"),N1=a("The "),$l=n("a"),B1=a("FlaxWav2Vec2ForPreTraining"),R1=a(" forward method, overrides the "),Nd=n("code"),U1=a("__call__"),H1=a(" special method."),X1=d(),w(Za.$$.fragment),G1=d(),w(Qa.$$.fragment),this.h()},l(o){const g=tx('[data-svelte="svelte-1phssyn"]',document.head);m=r(g,"META",{name:!0,content:!0}),g.forEach(t),b=p(o),f=r(o,"H1",{class:!0});var yi=i(f);u=r(yi,"A",{id:!0,class:!0,href:!0});var Bd=i(u);v=r(Bd,"SPAN",{});var Rd=i(v);y(l.$$.fragment,Rd),Rd.forEach(t),Bd.forEach(t),h=p(yi),V=r(yi,"SPAN",{});var Ud=i(V);M=s(Ud,"Wav2Vec2"),Ud.forEach(t),yi.forEach(t),L=p(o),A=r(o,"H2",{class:!0});var ki=i(A);z=r(ki,"A",{id:!0,class:!0,href:!0});var Hd=i(z);N=r(Hd,"SPAN",{});var Xd=i(N);y(E.$$.fragment,Xd),Xd.forEach(t),Hd.forEach(t),O=p(ki),C=r(ki,"SPAN",{});var Gd=i(C);ce=s(Gd,"Overview"),Gd.forEach(t),ki.forEach(t),K=p(o),S=r(o,"P",{});var Ti=i(S);de=s(Ti,"The Wav2Vec2 model was proposed in "),I=r(Ti,"A",{href:!0,rel:!0});var Kd=i(I);R=s(Kd,"wav2vec 2.0: A Framework for Self-Supervised Learning of Speech Representations"),Kd.forEach(t),De=s(Ti," by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael Auli."),Ti.forEach(t),X=p(o),J=r(o,"P",{});var Jd=i(J);Se=s(Jd,"The abstract from the paper is the following:"),Jd.forEach(t),We=p(o),Z=r(o,"P",{});var Zd=i(Z);Ke=r(Zd,"EM",{});var Qd=i(Ke);$t=s(Qd,`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.`),Qd.forEach(t),Zd.forEach(t),Ie=p(o),D=r(o,"P",{});var Yd=i(D);Q=s(Yd,"Tips:"),Yd.forEach(t),tt=p(o),ae=r(o,"UL",{});var xi=i(ae);Je=r(xi,"LI",{});var ep=i(Je);jt=s(ep,"Wav2Vec2 is a speech model that accepts a float array corresponding to the raw waveform of the speech signal."),ep.forEach(t),Ve=p(xi),Fe=r(xi,"LI",{});var $i=i(Fe);Wt=s($i,`Wav2Vec2 model was trained using connectionist temporal classification (CTC) so the model output has to be decoded
using `),U=r($i,"A",{href:!0});var tp=i(U);Vt=s(tp,"Wav2Vec2CTCTokenizer"),tp.forEach(t),Ee=s($i,"."),$i.forEach(t),xi.forEach(t),ot=p(o),we=r(o,"P",{});var ji=i(we);Ce=s(ji,"This model was contributed by "),Pe=r(ji,"A",{href:!0,rel:!0});var op=i(Pe);Ft=s(op,"patrickvonplaten"),op.forEach(t),he=s(ji,"."),ji.forEach(t),at=p(o),Y=r(o,"H2",{class:!0});var Wi=i(Y);ye=r(Wi,"A",{id:!0,class:!0,href:!0});var ap=i(ye);qe=r(ap,"SPAN",{});var sp=i(qe);y(B.$$.fragment,sp),sp.forEach(t),ap.forEach(t),Et=p(Wi),ee=r(Wi,"SPAN",{});var np=i(ee);Ct=s(np,"Resources"),np.forEach(t),Wi.forEach(t),st=p(o),j=r(o,"P",{});var rp=i(j);P=s(rp,"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."),rp.forEach(t),Nt=p(o),y(ue.$$.fragment,o),Bt=p(o),ke=r(o,"UL",{});var Xo=i(ke);q=r(Xo,"LI",{});var Vi=i(q);Qt=s(Vi,"A notebook on how to "),Ze=r(Vi,"A",{href:!0,rel:!0});var ip=i(Ze);Yt=s(ip,"leverage a pretrained Wav2Vec2 model for emotion classification"),ip.forEach(t),eo=s(Vi,". \u{1F30E}"),Vi.forEach(t),to=p(Xo),H=r(Xo,"LI",{});var Gt=i(H);pe=r(Gt,"A",{href:!0});var lp=i(pe);oo=s(lp,"Wav2Vec2ForCTC"),lp.forEach(t),ao=s(Gt," is supported by this "),se=r(Gt,"A",{href:!0,rel:!0});var ey=i(se);so=s(ey,"example script"),ey.forEach(t),no=s(Gt," and "),Ae=r(Gt,"A",{href:!0,rel:!0});var ty=i(Ae);ro=s(ty,"notebook"),ty.forEach(t),Qe=s(Gt,"."),Gt.forEach(t),io=p(Xo),Gl=r(Xo,"LI",{});var oy=i(Gl);Ei=r(oy,"A",{href:!0});var ay=i(Ei);xh=s(ay,"Audio classification task guide"),ay.forEach(t),oy.forEach(t),Xo.forEach(t),cp=p(o),y(ys.$$.fragment,o),dp=p(o),Te=r(o,"UL",{});var vt=i(Te);ks=r(vt,"LI",{});var tm=i(ks);$h=s(tm,"A blog post on "),Ts=r(tm,"A",{href:!0,rel:!0});var sy=i(Ts);jh=s(sy,"boosting Wav2Vec2 with n-grams in \u{1F917} Transformers"),sy.forEach(t),Wh=s(tm,"."),tm.forEach(t),Vh=p(vt),xs=r(vt,"LI",{});var om=i(xs);Fh=s(om,"A blog post on how to "),$s=r(om,"A",{href:!0,rel:!0});var ny=i($s);Eh=s(ny,"finetune Wav2Vec2 for English ASR with \u{1F917} Transformers"),ny.forEach(t),Ch=s(om,"."),om.forEach(t),Ph=p(vt),js=r(vt,"LI",{});var am=i(js);qh=s(am,"A blog post on "),Ws=r(am,"A",{href:!0,rel:!0});var ry=i(Ws);Ah=s(ry,"finetuning XLS-R for Multi-Lingual ASR with \u{1F917} Transformers"),ry.forEach(t),zh=s(am,"."),am.forEach(t),Mh=p(vt),Vs=r(vt,"LI",{});var sm=i(Vs);Lh=s(sm,"A notebook on how to "),Fs=r(sm,"A",{href:!0,rel:!0});var iy=i(Fs);Oh=s(iy,"create YouTube captions from any video by transcribing audio with Wav2Vec2"),iy.forEach(t),Dh=s(sm,". \u{1F30E}"),sm.forEach(t),Sh=p(vt),Rt=r(vt,"LI",{});var Fi=i(Rt);Ci=r(Fi,"A",{href:!0});var ly=i(Ci);Ih=s(ly,"Wav2Vec2ForCTC"),ly.forEach(t),Nh=s(Fi," is supported by a notebook on "),Es=r(Fi,"A",{href:!0,rel:!0});var cy=i(Es);Bh=s(cy,"how to finetune a speech recognition model in English"),cy.forEach(t),Rh=s(Fi,", and "),Cs=r(Fi,"A",{href:!0,rel:!0});var dy=i(Cs);Uh=s(dy,"how to finetune a speech recognition model in any language"),dy.forEach(t),Hh=s(Fi,"."),Fi.forEach(t),Xh=p(vt),Kl=r(vt,"LI",{});var py=i(Kl);Pi=r(py,"A",{href:!0});var my=i(Pi);Gh=s(my,"Automatic speech recognition task guide"),my.forEach(t),py.forEach(t),vt.forEach(t),pp=p(o),qi=r(o,"P",{});var hy=i(qi);Kh=s(hy,"\u{1F680} Deploy"),hy.forEach(t),mp=p(o),Ai=r(o,"UL",{});var uy=i(Ai);Ps=r(uy,"LI",{});var nm=i(Ps);Jh=s(nm,"A blog post on how to deploy Wav2Vec2 for "),qs=r(nm,"A",{href:!0,rel:!0});var fy=i(qs);Zh=s(fy,"Automatic Speech Recogntion with Hugging Face\u2019s Transformers & Amazon SageMaker"),fy.forEach(t),Qh=s(nm,"."),nm.forEach(t),uy.forEach(t),hp=p(o),lo=r(o,"H2",{class:!0});var rm=i(lo);Go=r(rm,"A",{id:!0,class:!0,href:!0});var gy=i(Go);Jl=r(gy,"SPAN",{});var _y=i(Jl);y(As.$$.fragment,_y),_y.forEach(t),gy.forEach(t),Yh=p(rm),Zl=r(rm,"SPAN",{});var vy=i(Zl);eu=s(vy,"Wav2Vec2Config"),vy.forEach(t),rm.forEach(t),up=p(o),Ye=r(o,"DIV",{class:!0});var Ya=i(Ye);y(zs.$$.fragment,Ya),tu=p(Ya),co=r(Ya,"P",{});var jl=i(co);ou=s(jl,"This is the configuration class to store the configuration of a "),zi=r(jl,"A",{href:!0});var by=i(zi);au=s(by,"Wav2Vec2Model"),by.forEach(t),su=s(jl,`. 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
`),Ms=r(jl,"A",{href:!0,rel:!0});var wy=i(Ms);nu=s(wy,"facebook/wav2vec2-base-960h"),wy.forEach(t),ru=s(jl," architecture."),jl.forEach(t),iu=p(Ya),po=r(Ya,"P",{});var Wl=i(po);lu=s(Wl,"Configuration objects inherit from "),Mi=r(Wl,"A",{href:!0});var yy=i(Mi);cu=s(yy,"PretrainedConfig"),yy.forEach(t),du=s(Wl,` and can be used to control the model outputs. Read the
documentation from `),Li=r(Wl,"A",{href:!0});var ky=i(Li);pu=s(ky,"PretrainedConfig"),ky.forEach(t),mu=s(Wl," for more information."),Wl.forEach(t),hu=p(Ya),y(Ko.$$.fragment,Ya),Ya.forEach(t),fp=p(o),mo=r(o,"H2",{class:!0});var im=i(mo);Jo=r(im,"A",{id:!0,class:!0,href:!0});var Ty=i(Jo);Ql=r(Ty,"SPAN",{});var xy=i(Ql);y(Ls.$$.fragment,xy),xy.forEach(t),Ty.forEach(t),uu=p(im),Yl=r(im,"SPAN",{});var $y=i(Yl);fu=s($y,"Wav2Vec2CTCTokenizer"),$y.forEach(t),im.forEach(t),gp=p(o),ne=r(o,"DIV",{class:!0});var Be=i(ne);y(Os.$$.fragment,Be),gu=p(Be),ec=r(Be,"P",{});var jy=i(ec);_u=s(jy,"Constructs a Wav2Vec2CTC tokenizer."),jy.forEach(t),vu=p(Be),Ds=r(Be,"P",{});var lm=i(Ds);bu=s(lm,"This tokenizer inherits from "),Oi=r(lm,"A",{href:!0});var Wy=i(Oi);wu=s(Wy,"PreTrainedTokenizer"),Wy.forEach(t),yu=s(lm,` which contains some of the main methods. Users should refer to
the superclass for more information regarding such methods.`),lm.forEach(t),ku=p(Be),Zo=r(Be,"DIV",{class:!0});var cm=i(Zo);y(Ss.$$.fragment,cm),Tu=p(cm),tc=r(cm,"P",{});var Vy=i(tc);xu=s(Vy,`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),Vy.forEach(t),cm.forEach(t),$u=p(Be),Di=r(Be,"DIV",{class:!0});var Fy=i(Di);y(Is.$$.fragment,Fy),Fy.forEach(t),ju=p(Be),nt=r(Be,"DIV",{class:!0});var es=i(nt);y(Ns.$$.fragment,es),Wu=p(es),oc=r(es,"P",{});var Ey=i(oc);Vu=s(Ey,`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),Ey.forEach(t),Fu=p(es),Bs=r(es,"P",{});var dm=i(Bs);Eu=s(dm,"Similar to doing "),ac=r(dm,"CODE",{});var Cy=i(ac);Cu=s(Cy,"self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),Cy.forEach(t),Pu=s(dm,"."),dm.forEach(t),qu=p(es),y(Qo.$$.fragment,es),es.forEach(t),Au=p(Be),Yo=r(Be,"DIV",{class:!0});var pm=i(Yo);y(Rs.$$.fragment,pm),zu=p(pm),sc=r(pm,"P",{});var Py=i(sc);Mu=s(Py,"Convert a list of lists of token ids into a list of strings by calling decode."),Py.forEach(t),pm.forEach(t),Be.forEach(t),_p=p(o),ho=r(o,"H2",{class:!0});var mm=i(ho);ea=r(mm,"A",{id:!0,class:!0,href:!0});var qy=i(ea);nc=r(qy,"SPAN",{});var Ay=i(nc);y(Us.$$.fragment,Ay),Ay.forEach(t),qy.forEach(t),Lu=p(mm),rc=r(mm,"SPAN",{});var zy=i(rc);Ou=s(zy,"Wav2Vec2FeatureExtractor"),zy.forEach(t),mm.forEach(t),vp=p(o),et=r(o,"DIV",{class:!0});var ts=i(et);y(Hs.$$.fragment,ts),Du=p(ts),ic=r(ts,"P",{});var My=i(ic);Su=s(My,"Constructs a Wav2Vec2 feature extractor."),My.forEach(t),Iu=p(ts),Xs=r(ts,"P",{});var hm=i(Xs);Nu=s(hm,"This feature extractor inherits from "),Si=r(hm,"A",{href:!0});var Ly=i(Si);Bu=s(Ly,"SequenceFeatureExtractor"),Ly.forEach(t),Ru=s(hm,` which contains
most of the main methods. Users should refer to this superclass for more information regarding those methods.`),hm.forEach(t),Uu=p(ts),ta=r(ts,"DIV",{class:!0});var um=i(ta);y(Gs.$$.fragment,um),Hu=p(um),lc=r(um,"P",{});var Oy=i(lc);Xu=s(Oy,"Main method to featurize and prepare for the model one or several sequence(s)."),Oy.forEach(t),um.forEach(t),ts.forEach(t),bp=p(o),uo=r(o,"H2",{class:!0});var fm=i(uo);oa=r(fm,"A",{id:!0,class:!0,href:!0});var Dy=i(oa);cc=r(Dy,"SPAN",{});var Sy=i(cc);y(Ks.$$.fragment,Sy),Sy.forEach(t),Dy.forEach(t),Gu=p(fm),dc=r(fm,"SPAN",{});var Iy=i(dc);Ku=s(Iy,"Wav2Vec2Processor"),Iy.forEach(t),fm.forEach(t),wp=p(o),G=r(o,"DIV",{class:!0});var me=i(G);y(Js.$$.fragment,me),Ju=p(me),pc=r(me,"P",{});var Ny=i(pc);Zu=s(Ny,`Constructs a Wav2Vec2 processor which wraps a Wav2Vec2 feature extractor and a Wav2Vec2 CTC tokenizer into a single
processor.`),Ny.forEach(t),Qu=p(me),Ne=r(me,"P",{});var It=i(Ne);Ii=r(It,"A",{href:!0});var By=i(Ii);Yu=s(By,"Wav2Vec2Processor"),By.forEach(t),ef=s(It," offers all the functionalities of "),Ni=r(It,"A",{href:!0});var Ry=i(Ni);tf=s(Ry,"Wav2Vec2FeatureExtractor"),Ry.forEach(t),of=s(It," and "),Bi=r(It,"A",{href:!0});var Uy=i(Bi);af=s(Uy,"PreTrainedTokenizer"),Uy.forEach(t),sf=s(It,`.
See the docstring of `),Zs=r(It,"A",{href:!0});var K1=i(Zs);mc=r(K1,"STRONG",{});var Hy=i(mc);nf=s(Hy,"call"),Hy.forEach(t),rf=s(K1,"()"),K1.forEach(t),lf=s(It," and "),Ri=r(It,"A",{href:!0});var Xy=i(Ri);cf=s(Xy,"decode()"),Xy.forEach(t),df=s(It," for more information."),It.forEach(t),pf=p(me),aa=r(me,"DIV",{class:!0});var gm=i(aa);y(Qs.$$.fragment,gm),mf=p(gm),Pt=r(gm,"P",{});var os=i(Pt);hf=s(os,`When used in normal mode, this method forwards all its arguments to Wav2Vec2FeatureExtractor\u2019s
`),Ys=r(os,"A",{href:!0});var J1=i(Ys);hc=r(J1,"STRONG",{});var Gy=i(hc);uf=s(Gy,"call"),Gy.forEach(t),ff=s(J1,"()"),J1.forEach(t),gf=s(os,` and returns its output. If used in the context
`),uc=r(os,"CODE",{});var Ky=i(uc);_f=s(Ky,"as_target_processor()"),Ky.forEach(t),vf=s(os,` this method forwards all its arguments to PreTrainedTokenizer\u2019s
`),en=r(os,"A",{href:!0});var Z1=i(en);fc=r(Z1,"STRONG",{});var Jy=i(fc);bf=s(Jy,"call"),Jy.forEach(t),wf=s(Z1,"()"),Z1.forEach(t),yf=s(os,". Please refer to the docstring of the above two methods for more information."),os.forEach(t),gm.forEach(t),kf=p(me),sa=r(me,"DIV",{class:!0});var _m=i(sa);y(tn.$$.fragment,_m),Tf=p(_m),qt=r(_m,"P",{});var as=i(qt);xf=s(as,`When used in normal mode, this method forwards all its arguments to Wav2Vec2FeatureExtractor\u2019s
`),Ui=r(as,"A",{href:!0});var Zy=i(Ui);$f=s(Zy,"pad()"),Zy.forEach(t),jf=s(as,` and returns its output. If used in the context
`),gc=r(as,"CODE",{});var Qy=i(gc);Wf=s(Qy,"as_target_processor()"),Qy.forEach(t),Vf=s(as,` this method forwards all its arguments to PreTrainedTokenizer\u2019s
`),Hi=r(as,"A",{href:!0});var Yy=i(Hi);Ff=s(Yy,"pad()"),Yy.forEach(t),Ef=s(as,". Please refer to the docstring of the above two methods for more information."),as.forEach(t),_m.forEach(t),Cf=p(me),Xi=r(me,"DIV",{class:!0});var ek=i(Xi);y(on.$$.fragment,ek),ek.forEach(t),Pf=p(me),Ut=r(me,"DIV",{class:!0});var Vl=i(Ut);y(an.$$.fragment,Vl),qf=p(Vl),sn=r(Vl,"P",{});var vm=i(sn);Af=s(vm,`Saves the attributes of this processor (feature extractor, tokenizer\u2026) in the specified directory so that it
can be reloaded using the `),Gi=r(vm,"A",{href:!0});var tk=i(Gi);zf=s(tk,"from_pretrained()"),tk.forEach(t),Mf=s(vm," method."),vm.forEach(t),Lf=p(Vl),y(na.$$.fragment,Vl),Vl.forEach(t),Of=p(me),ra=r(me,"DIV",{class:!0});var bm=i(ra);y(nn.$$.fragment,bm),Df=p(bm),rn=r(bm,"P",{});var wm=i(rn);Sf=s(wm,"This method forwards all its arguments to PreTrainedTokenizer\u2019s "),Ki=r(wm,"A",{href:!0});var ok=i(Ki);If=s(ok,"batch_decode()"),ok.forEach(t),Nf=s(wm,`. Please
refer to the docstring of this method for more information.`),wm.forEach(t),bm.forEach(t),Bf=p(me),ia=r(me,"DIV",{class:!0});var ym=i(ia);y(ln.$$.fragment,ym),Rf=p(ym),cn=r(ym,"P",{});var km=i(cn);Uf=s(km,"This method forwards all its arguments to PreTrainedTokenizer\u2019s "),Ji=r(km,"A",{href:!0});var ak=i(Ji);Hf=s(ak,"decode()"),ak.forEach(t),Xf=s(km,`. Please refer
to the docstring of this method for more information.`),km.forEach(t),ym.forEach(t),me.forEach(t),yp=p(o),fo=r(o,"H2",{class:!0});var Tm=i(fo);la=r(Tm,"A",{id:!0,class:!0,href:!0});var sk=i(la);_c=r(sk,"SPAN",{});var nk=i(_c);y(dn.$$.fragment,nk),nk.forEach(t),sk.forEach(t),Gf=p(Tm),vc=r(Tm,"SPAN",{});var rk=i(vc);Kf=s(rk,"Wav2Vec2ProcessorWithLM"),rk.forEach(t),Tm.forEach(t),kp=p(o),te=r(o,"DIV",{class:!0});var $e=i(te);y(pn.$$.fragment,$e),Jf=p($e),bc=r($e,"P",{});var ik=i(bc);Zf=s(ik,`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.`),ik.forEach(t),Qf=p($e),ca=r($e,"DIV",{class:!0});var xm=i(ca);y(mn.$$.fragment,xm),Yf=p(xm),At=r(xm,"P",{});var ss=i(At);eg=s(ss,`When used in normal mode, this method forwards all its arguments to Wav2Vec2FeatureExtractor\u2019s
`),hn=r(ss,"A",{href:!0});var Q1=i(hn);wc=r(Q1,"STRONG",{});var lk=i(wc);tg=s(lk,"call"),lk.forEach(t),og=s(Q1,"()"),Q1.forEach(t),ag=s(ss,` and returns its output. If used in the context
`),yc=r(ss,"CODE",{});var ck=i(yc);sg=s(ck,"as_target_processor()"),ck.forEach(t),ng=s(ss,` this method forwards all its arguments to
Wav2Vec2CTCTokenizer\u2019s `),un=r(ss,"A",{href:!0});var Y1=i(un);kc=r(Y1,"STRONG",{});var dk=i(kc);rg=s(dk,"call"),dk.forEach(t),ig=s(Y1,"()"),Y1.forEach(t),lg=s(ss,`. Please refer to the docstring of the above two
methods for more information.`),ss.forEach(t),xm.forEach(t),cg=p($e),da=r($e,"DIV",{class:!0});var $m=i(da);y(fn.$$.fragment,$m),dg=p($m),zt=r($m,"P",{});var ns=i(zt);pg=s(ns,`When used in normal mode, this method forwards all its arguments to Wav2Vec2FeatureExtractor\u2019s
`),Zi=r(ns,"A",{href:!0});var pk=i(Zi);mg=s(pk,"pad()"),pk.forEach(t),hg=s(ns,` and returns its output. If used in the context
`),Tc=r(ns,"CODE",{});var mk=i(Tc);ug=s(mk,"as_target_processor()"),mk.forEach(t),fg=s(ns,` this method forwards all its arguments to
Wav2Vec2CTCTokenizer\u2019s `),Qi=r(ns,"A",{href:!0});var hk=i(Qi);gg=s(hk,"pad()"),hk.forEach(t),_g=s(ns,`. Please refer to the docstring of the above two methods
for more information.`),ns.forEach(t),$m.forEach(t),vg=p($e),Ht=r($e,"DIV",{class:!0});var Fl=i(Ht);y(gn.$$.fragment,Fl),bg=p(Fl),_n=r(Fl,"P",{});var jm=i(_n);wg=s(jm,"Instantiate a "),Yi=r(jm,"A",{href:!0});var uk=i(Yi);yg=s(uk,"Wav2Vec2ProcessorWithLM"),uk.forEach(t),kg=s(jm," from a pretrained Wav2Vec2 processor."),jm.forEach(t),Tg=p(Fl),y(pa.$$.fragment,Fl),Fl.forEach(t),xg=p($e),el=r($e,"DIV",{class:!0});var fk=i(el);y(vn.$$.fragment,fk),fk.forEach(t),$g=p($e),rt=r($e,"DIV",{class:!0});var rs=i(rt);y(bn.$$.fragment,rs),jg=p(rs),xc=r(rs,"P",{});var gk=i(xc);Wg=s(gk,"Batch decode output logits to audio transcription with language model support."),gk.forEach(t),Vg=p(rs),y(ma.$$.fragment,rs),Fg=p(rs),wn=r(rs,"P",{});var Wm=i(wn);Eg=s(Wm,`Example:
See `),tl=r(Wm,"A",{href:!0});var _k=i(tl);Cg=s(_k,"Decoding multiple audios"),_k.forEach(t),Pg=s(Wm,"."),Wm.forEach(t),rs.forEach(t),qg=p($e),Xt=r($e,"DIV",{class:!0});var El=i(Xt);y(yn.$$.fragment,El),Ag=p(El),$c=r(El,"P",{});var vk=i($c);zg=s(vk,"Decode output logits to audio transcription with language model support."),vk.forEach(t),Mg=p(El),y(ha.$$.fragment,El),El.forEach(t),$e.forEach(t),Tp=p(o),go=r(o,"H3",{class:!0});var Vm=i(go);ua=r(Vm,"A",{id:!0,class:!0,href:!0});var bk=i(ua);jc=r(bk,"SPAN",{});var wk=i(jc);y(kn.$$.fragment,wk),wk.forEach(t),bk.forEach(t),Lg=p(Vm),Wc=r(Vm,"SPAN",{});var yk=i(Wc);Og=s(yk,"Decoding multiple audios"),yk.forEach(t),Vm.forEach(t),xp=p(o),xe=r(o,"P",{});var bt=i(xe);Dg=s(bt,"If you are planning to decode multiple batches of audios, you should consider using "),ol=r(bt,"A",{href:!0});var kk=i(ol);Sg=s(kk,"batch_decode()"),kk.forEach(t),Ig=s(bt," and passing an instantiated "),Vc=r(bt,"CODE",{});var Tk=i(Vc);Ng=s(Tk,"multiprocessing.Pool"),Tk.forEach(t),Bg=s(bt,`.
Otherwise, `),al=r(bt,"A",{href:!0});var xk=i(al);Rg=s(xk,"batch_decode()"),xk.forEach(t),Ug=s(bt," performance will be slower than calling "),sl=r(bt,"A",{href:!0});var $k=i(sl);Hg=s($k,"decode()"),$k.forEach(t),Xg=s(bt," for each audio individually, as it internally instantiates a new "),Fc=r(bt,"CODE",{});var jk=i(Fc);Gg=s(jk,"Pool"),jk.forEach(t),Kg=s(bt," for every call. See the example below:"),bt.forEach(t),$p=p(o),y(Tn.$$.fragment,o),jp=p(o),_o=r(o,"H2",{class:!0});var Fm=i(_o);fa=r(Fm,"A",{id:!0,class:!0,href:!0});var Wk=i(fa);Ec=r(Wk,"SPAN",{});var Vk=i(Ec);y(xn.$$.fragment,Vk),Vk.forEach(t),Wk.forEach(t),Jg=p(Fm),Cc=r(Fm,"SPAN",{});var Fk=i(Cc);Zg=s(Fk,"Wav2Vec2 specific outputs"),Fk.forEach(t),Fm.forEach(t),Wp=p(o),vo=r(o,"DIV",{class:!0});var Em=i(vo);y($n.$$.fragment,Em),Qg=p(Em),jn=r(Em,"P",{});var Cm=i(jn);Yg=s(Cm,"Output type of "),Pc=r(Cm,"CODE",{});var Ek=i(Pc);e_=s(Ek,"Wav2Vec2DecoderWithLM"),Ek.forEach(t),t_=s(Cm,", with transcription."),Cm.forEach(t),Em.forEach(t),Vp=p(o),bo=r(o,"DIV",{class:!0});var Pm=i(bo);y(Wn.$$.fragment,Pm),o_=p(Pm),qc=r(Pm,"P",{});var Ck=i(qc);a_=s(Ck,"Base class for models that have been trained with the Wav2Vec2 loss objective."),Ck.forEach(t),Pm.forEach(t),Fp=p(o),wo=r(o,"DIV",{class:!0});var qm=i(wo);y(Vn.$$.fragment,qm),s_=p(qm),Fn=r(qm,"P",{});var Am=i(Fn);n_=s(Am,"Output type of "),nl=r(Am,"A",{href:!0});var Pk=i(nl);r_=s(Pk,"Wav2Vec2ForPreTraining"),Pk.forEach(t),i_=s(Am,", with potential hidden states and attentions."),Am.forEach(t),qm.forEach(t),Ep=p(o),Mt=r(o,"DIV",{class:!0});var Cl=i(Mt);y(En.$$.fragment,Cl),l_=p(Cl),Cn=r(Cl,"P",{});var zm=i(Cn);c_=s(zm,"Output type of "),Ac=r(zm,"CODE",{});var qk=i(Ac);d_=s(qk,"FlaxWav2Vec2BaseModelOutput"),qk.forEach(t),p_=s(zm,", with potential hidden states and attentions."),zm.forEach(t),m_=p(Cl),ga=r(Cl,"DIV",{class:!0});var Mm=i(ga);y(Pn.$$.fragment,Mm),h_=p(Mm),zc=r(Mm,"P",{});var Ak=i(zc);u_=s(Ak,"\u201CReturns a new object replacing the specified fields with new values."),Ak.forEach(t),Mm.forEach(t),Cl.forEach(t),Cp=p(o),Lt=r(o,"DIV",{class:!0});var Pl=i(Lt);y(qn.$$.fragment,Pl),f_=p(Pl),An=r(Pl,"P",{});var Lm=i(An);g_=s(Lm,"Output type of "),Mc=r(Lm,"CODE",{});var zk=i(Mc);__=s(zk,"FlaxWav2Vec2ForPreTrainingOutput"),zk.forEach(t),v_=s(Lm,", with potential hidden states and attentions."),Lm.forEach(t),b_=p(Pl),_a=r(Pl,"DIV",{class:!0});var Om=i(_a);y(zn.$$.fragment,Om),w_=p(Om),Lc=r(Om,"P",{});var Mk=i(Lc);y_=s(Mk,"\u201CReturns a new object replacing the specified fields with new values."),Mk.forEach(t),Om.forEach(t),Pl.forEach(t),Pp=p(o),yo=r(o,"H2",{class:!0});var Dm=i(yo);va=r(Dm,"A",{id:!0,class:!0,href:!0});var Lk=i(va);Oc=r(Lk,"SPAN",{});var Ok=i(Oc);y(Mn.$$.fragment,Ok),Ok.forEach(t),Lk.forEach(t),k_=p(Dm),Dc=r(Dm,"SPAN",{});var Dk=i(Dc);T_=s(Dk,"Wav2Vec2Model"),Dk.forEach(t),Dm.forEach(t),qp=p(o),ze=r(o,"DIV",{class:!0});var Kt=i(ze);y(Ln.$$.fragment,Kt),x_=p(Kt),On=r(Kt,"P",{});var Sm=i(On);$_=s(Sm,`The bare Wav2Vec2 Model transformer outputting raw hidden-states without any specific head on top.
Wav2Vec2 was proposed in `),Dn=r(Sm,"A",{href:!0,rel:!0});var Sk=i(Dn);j_=s(Sk,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),Sk.forEach(t),W_=s(Sm,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Sm.forEach(t),V_=p(Kt),Sn=r(Kt,"P",{});var Im=i(Sn);F_=s(Im,"This model inherits from "),rl=r(Im,"A",{href:!0});var Ik=i(rl);E_=s(Ik,"PreTrainedModel"),Ik.forEach(t),C_=s(Im,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Im.forEach(t),P_=p(Kt),In=r(Kt,"P",{});var Nm=i(In);q_=s(Nm,"This model is a PyTorch "),Nn=r(Nm,"A",{href:!0,rel:!0});var Nk=i(Nn);A_=s(Nk,"torch.nn.Module"),Nk.forEach(t),z_=s(Nm,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Nm.forEach(t),M_=p(Kt),it=r(Kt,"DIV",{class:!0});var is=i(it);y(Bn.$$.fragment,is),L_=p(is),ko=r(is,"P",{});var ql=i(ko);O_=s(ql,"The "),il=r(ql,"A",{href:!0});var Bk=i(il);D_=s(Bk,"Wav2Vec2Model"),Bk.forEach(t),S_=s(ql," forward method, overrides the "),Sc=r(ql,"CODE",{});var Rk=i(Sc);I_=s(Rk,"__call__"),Rk.forEach(t),N_=s(ql," special method."),ql.forEach(t),B_=p(is),y(ba.$$.fragment,is),R_=p(is),y(wa.$$.fragment,is),is.forEach(t),Kt.forEach(t),Ap=p(o),To=r(o,"H2",{class:!0});var Bm=i(To);ya=r(Bm,"A",{id:!0,class:!0,href:!0});var Uk=i(ya);Ic=r(Uk,"SPAN",{});var Hk=i(Ic);y(Rn.$$.fragment,Hk),Hk.forEach(t),Uk.forEach(t),U_=p(Bm),Nc=r(Bm,"SPAN",{});var Xk=i(Nc);H_=s(Xk,"Wav2Vec2ForCTC"),Xk.forEach(t),Bm.forEach(t),zp=p(o),Me=r(o,"DIV",{class:!0});var Jt=i(Me);y(Un.$$.fragment,Jt),X_=p(Jt),xo=r(Jt,"P",{});var Al=i(xo);G_=s(Al,"Wav2Vec2 Model with a "),Bc=r(Al,"CODE",{});var Gk=i(Bc);K_=s(Gk,"language modeling"),Gk.forEach(t),J_=s(Al,` head on top for Connectionist Temporal Classification (CTC).
Wav2Vec2 was proposed in `),Hn=r(Al,"A",{href:!0,rel:!0});var Kk=i(Hn);Z_=s(Kk,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),Kk.forEach(t),Q_=s(Al,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Al.forEach(t),Y_=p(Jt),Xn=r(Jt,"P",{});var Rm=i(Xn);ev=s(Rm,"This model inherits from "),ll=r(Rm,"A",{href:!0});var Jk=i(ll);tv=s(Jk,"PreTrainedModel"),Jk.forEach(t),ov=s(Rm,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Rm.forEach(t),av=p(Jt),Gn=r(Jt,"P",{});var Um=i(Gn);sv=s(Um,"This model is a PyTorch "),Kn=r(Um,"A",{href:!0,rel:!0});var Zk=i(Kn);nv=s(Zk,"torch.nn.Module"),Zk.forEach(t),rv=s(Um,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Um.forEach(t),iv=p(Jt),lt=r(Jt,"DIV",{class:!0});var ls=i(lt);y(Jn.$$.fragment,ls),lv=p(ls),$o=r(ls,"P",{});var zl=i($o);cv=s(zl,"The "),cl=r(zl,"A",{href:!0});var Qk=i(cl);dv=s(Qk,"Wav2Vec2ForCTC"),Qk.forEach(t),pv=s(zl," forward method, overrides the "),Rc=r(zl,"CODE",{});var Yk=i(Rc);mv=s(Yk,"__call__"),Yk.forEach(t),hv=s(zl," special method."),zl.forEach(t),uv=p(ls),y(ka.$$.fragment,ls),fv=p(ls),y(Ta.$$.fragment,ls),ls.forEach(t),Jt.forEach(t),Mp=p(o),jo=r(o,"H2",{class:!0});var Hm=i(jo);xa=r(Hm,"A",{id:!0,class:!0,href:!0});var e0=i(xa);Uc=r(e0,"SPAN",{});var t0=i(Uc);y(Zn.$$.fragment,t0),t0.forEach(t),e0.forEach(t),gv=p(Hm),Hc=r(Hm,"SPAN",{});var o0=i(Hc);_v=s(o0,"Wav2Vec2ForSequenceClassification"),o0.forEach(t),Hm.forEach(t),Lp=p(o),fe=r(o,"DIV",{class:!0});var wt=i(fe);y(Qn.$$.fragment,wt),vv=p(wt),Xc=r(wt,"P",{});var a0=i(Xc);bv=s(a0,`Wav2Vec2 Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like
SUPERB Keyword Spotting.`),a0.forEach(t),wv=p(wt),Yn=r(wt,"P",{});var Xm=i(Yn);yv=s(Xm,"Wav2Vec2 was proposed in "),er=r(Xm,"A",{href:!0,rel:!0});var s0=i(er);kv=s(s0,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),s0.forEach(t),Tv=s(Xm,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Xm.forEach(t),xv=p(wt),tr=r(wt,"P",{});var Gm=i(tr);$v=s(Gm,"This model inherits from "),dl=r(Gm,"A",{href:!0});var n0=i(dl);jv=s(n0,"PreTrainedModel"),n0.forEach(t),Wv=s(Gm,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Gm.forEach(t),Vv=p(wt),or=r(wt,"P",{});var Km=i(or);Fv=s(Km,"This model is a PyTorch "),ar=r(Km,"A",{href:!0,rel:!0});var r0=i(ar);Ev=s(r0,"torch.nn.Module"),r0.forEach(t),Cv=s(Km,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Km.forEach(t),Pv=p(wt),ct=r(wt,"DIV",{class:!0});var cs=i(ct);y(sr.$$.fragment,cs),qv=p(cs),Wo=r(cs,"P",{});var Ml=i(Wo);Av=s(Ml,"The "),pl=r(Ml,"A",{href:!0});var i0=i(pl);zv=s(i0,"Wav2Vec2ForSequenceClassification"),i0.forEach(t),Mv=s(Ml," forward method, overrides the "),Gc=r(Ml,"CODE",{});var l0=i(Gc);Lv=s(l0,"__call__"),l0.forEach(t),Ov=s(Ml," special method."),Ml.forEach(t),Dv=p(cs),y($a.$$.fragment,cs),Sv=p(cs),y(ja.$$.fragment,cs),cs.forEach(t),wt.forEach(t),Op=p(o),Vo=r(o,"H2",{class:!0});var Jm=i(Vo);Wa=r(Jm,"A",{id:!0,class:!0,href:!0});var c0=i(Wa);Kc=r(c0,"SPAN",{});var d0=i(Kc);y(nr.$$.fragment,d0),d0.forEach(t),c0.forEach(t),Iv=p(Jm),Jc=r(Jm,"SPAN",{});var p0=i(Jc);Nv=s(p0,"Wav2Vec2ForAudioFrameClassification"),p0.forEach(t),Jm.forEach(t),Dp=p(o),ge=r(o,"DIV",{class:!0});var yt=i(ge);y(rr.$$.fragment,yt),Bv=p(yt),Zc=r(yt,"P",{});var m0=i(Zc);Rv=s(m0,"Wav2Vec2 Model with a frame classification head on top for tasks like Speaker Diarization."),m0.forEach(t),Uv=p(yt),ir=r(yt,"P",{});var Zm=i(ir);Hv=s(Zm,"Wav2Vec2 was proposed in "),lr=r(Zm,"A",{href:!0,rel:!0});var h0=i(lr);Xv=s(h0,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),h0.forEach(t),Gv=s(Zm,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Zm.forEach(t),Kv=p(yt),cr=r(yt,"P",{});var Qm=i(cr);Jv=s(Qm,"This model inherits from "),ml=r(Qm,"A",{href:!0});var u0=i(ml);Zv=s(u0,"PreTrainedModel"),u0.forEach(t),Qv=s(Qm,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Qm.forEach(t),Yv=p(yt),dr=r(yt,"P",{});var Ym=i(dr);e2=s(Ym,"This model is a PyTorch "),pr=r(Ym,"A",{href:!0,rel:!0});var f0=i(pr);t2=s(f0,"torch.nn.Module"),f0.forEach(t),o2=s(Ym,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ym.forEach(t),a2=p(yt),dt=r(yt,"DIV",{class:!0});var ds=i(dt);y(mr.$$.fragment,ds),s2=p(ds),Fo=r(ds,"P",{});var Ll=i(Fo);n2=s(Ll,"The "),hl=r(Ll,"A",{href:!0});var g0=i(hl);r2=s(g0,"Wav2Vec2ForAudioFrameClassification"),g0.forEach(t),i2=s(Ll," forward method, overrides the "),Qc=r(Ll,"CODE",{});var _0=i(Qc);l2=s(_0,"__call__"),_0.forEach(t),c2=s(Ll," special method."),Ll.forEach(t),d2=p(ds),y(Va.$$.fragment,ds),p2=p(ds),y(Fa.$$.fragment,ds),ds.forEach(t),yt.forEach(t),Sp=p(o),Eo=r(o,"H2",{class:!0});var eh=i(Eo);Ea=r(eh,"A",{id:!0,class:!0,href:!0});var v0=i(Ea);Yc=r(v0,"SPAN",{});var b0=i(Yc);y(hr.$$.fragment,b0),b0.forEach(t),v0.forEach(t),m2=p(eh),ed=r(eh,"SPAN",{});var w0=i(ed);h2=s(w0,"Wav2Vec2ForXVector"),w0.forEach(t),eh.forEach(t),Ip=p(o),_e=r(o,"DIV",{class:!0});var kt=i(_e);y(ur.$$.fragment,kt),u2=p(kt),td=r(kt,"P",{});var y0=i(td);f2=s(y0,"Wav2Vec2 Model with an XVector feature extraction head on top for tasks like Speaker Verification."),y0.forEach(t),g2=p(kt),fr=r(kt,"P",{});var th=i(fr);_2=s(th,"Wav2Vec2 was proposed in "),gr=r(th,"A",{href:!0,rel:!0});var k0=i(gr);v2=s(k0,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),k0.forEach(t),b2=s(th,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),th.forEach(t),w2=p(kt),_r=r(kt,"P",{});var oh=i(_r);y2=s(oh,"This model inherits from "),ul=r(oh,"A",{href:!0});var T0=i(ul);k2=s(T0,"PreTrainedModel"),T0.forEach(t),T2=s(oh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),oh.forEach(t),x2=p(kt),vr=r(kt,"P",{});var ah=i(vr);$2=s(ah,"This model is a PyTorch "),br=r(ah,"A",{href:!0,rel:!0});var x0=i(br);j2=s(x0,"torch.nn.Module"),x0.forEach(t),W2=s(ah,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ah.forEach(t),V2=p(kt),pt=r(kt,"DIV",{class:!0});var ps=i(pt);y(wr.$$.fragment,ps),F2=p(ps),Co=r(ps,"P",{});var Ol=i(Co);E2=s(Ol,"The "),fl=r(Ol,"A",{href:!0});var $0=i(fl);C2=s($0,"Wav2Vec2ForXVector"),$0.forEach(t),P2=s(Ol," forward method, overrides the "),od=r(Ol,"CODE",{});var j0=i(od);q2=s(j0,"__call__"),j0.forEach(t),A2=s(Ol," special method."),Ol.forEach(t),z2=p(ps),y(Ca.$$.fragment,ps),M2=p(ps),y(Pa.$$.fragment,ps),ps.forEach(t),kt.forEach(t),Np=p(o),Po=r(o,"H2",{class:!0});var sh=i(Po);qa=r(sh,"A",{id:!0,class:!0,href:!0});var W0=i(qa);ad=r(W0,"SPAN",{});var V0=i(ad);y(yr.$$.fragment,V0),V0.forEach(t),W0.forEach(t),L2=p(sh),sd=r(sh,"SPAN",{});var F0=i(sd);O2=s(F0,"Wav2Vec2ForPreTraining"),F0.forEach(t),sh.forEach(t),Bp=p(o),Le=r(o,"DIV",{class:!0});var Zt=i(Le);y(kr.$$.fragment,Zt),D2=p(Zt),qo=r(Zt,"P",{});var Dl=i(qo);S2=s(Dl,"Wav2Vec2 Model with a quantizer and "),nd=r(Dl,"CODE",{});var E0=i(nd);I2=s(E0,"VQ"),E0.forEach(t),N2=s(Dl,` head on top.
Wav2Vec2 was proposed in `),Tr=r(Dl,"A",{href:!0,rel:!0});var C0=i(Tr);B2=s(C0,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),C0.forEach(t),R2=s(Dl,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Dl.forEach(t),U2=p(Zt),xr=r(Zt,"P",{});var nh=i(xr);H2=s(nh,"This model inherits from "),gl=r(nh,"A",{href:!0});var P0=i(gl);X2=s(P0,"PreTrainedModel"),P0.forEach(t),G2=s(nh,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),nh.forEach(t),K2=p(Zt),$r=r(Zt,"P",{});var rh=i($r);J2=s(rh,"This model is a PyTorch "),jr=r(rh,"A",{href:!0,rel:!0});var q0=i(jr);Z2=s(q0,"torch.nn.Module"),q0.forEach(t),Q2=s(rh,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),rh.forEach(t),Y2=p(Zt),mt=r(Zt,"DIV",{class:!0});var ms=i(mt);y(Wr.$$.fragment,ms),eb=p(ms),Ao=r(ms,"P",{});var Sl=i(Ao);tb=s(Sl,"The "),_l=r(Sl,"A",{href:!0});var A0=i(_l);ob=s(A0,"Wav2Vec2ForPreTraining"),A0.forEach(t),ab=s(Sl," forward method, overrides the "),rd=r(Sl,"CODE",{});var z0=i(rd);sb=s(z0,"__call__"),z0.forEach(t),nb=s(Sl," special method."),Sl.forEach(t),rb=p(ms),y(Aa.$$.fragment,ms),ib=p(ms),y(za.$$.fragment,ms),ms.forEach(t),Zt.forEach(t),Rp=p(o),zo=r(o,"H2",{class:!0});var ih=i(zo);Ma=r(ih,"A",{id:!0,class:!0,href:!0});var M0=i(Ma);id=r(M0,"SPAN",{});var L0=i(id);y(Vr.$$.fragment,L0),L0.forEach(t),M0.forEach(t),lb=p(ih),ld=r(ih,"SPAN",{});var O0=i(ld);cb=s(O0,"TFWav2Vec2Model"),O0.forEach(t),ih.forEach(t),Up=p(o),ve=r(o,"DIV",{class:!0});var Tt=i(ve);y(Fr.$$.fragment,Tt),db=p(Tt),cd=r(Tt,"P",{});var D0=i(cd);pb=s(D0,"The bare TFWav2Vec2 Model transformer outputing raw hidden-states without any specific head on top."),D0.forEach(t),mb=p(Tt),Er=r(Tt,"P",{});var lh=i(Er);hb=s(lh,"This model inherits from "),vl=r(lh,"A",{href:!0});var S0=i(vl);ub=s(S0,"TFPreTrainedModel"),S0.forEach(t),fb=s(lh,`. 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.)`),lh.forEach(t),gb=p(Tt),Cr=r(Tt,"P",{});var ch=i(Cr);_b=s(ch,"This model is also a "),Pr=r(ch,"A",{href:!0,rel:!0});var I0=i(Pr);vb=s(I0,"tf.keras.Model"),I0.forEach(t),bb=s(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),wb=p(Tt),y(La.$$.fragment,Tt),yb=p(Tt),ht=r(Tt,"DIV",{class:!0});var hs=i(ht);y(qr.$$.fragment,hs),kb=p(hs),Mo=r(hs,"P",{});var Il=i(Mo);Tb=s(Il,"The "),bl=r(Il,"A",{href:!0});var N0=i(bl);xb=s(N0,"TFWav2Vec2Model"),N0.forEach(t),$b=s(Il," forward method, overrides the "),dd=r(Il,"CODE",{});var B0=i(dd);jb=s(B0,"__call__"),B0.forEach(t),Wb=s(Il," special method."),Il.forEach(t),Vb=p(hs),y(Oa.$$.fragment,hs),Fb=p(hs),y(Da.$$.fragment,hs),hs.forEach(t),Tt.forEach(t),Hp=p(o),Lo=r(o,"H2",{class:!0});var dh=i(Lo);Sa=r(dh,"A",{id:!0,class:!0,href:!0});var R0=i(Sa);pd=r(R0,"SPAN",{});var U0=i(pd);y(Ar.$$.fragment,U0),U0.forEach(t),R0.forEach(t),Eb=p(dh),md=r(dh,"SPAN",{});var H0=i(md);Cb=s(H0,"TFWav2Vec2ForCTC"),H0.forEach(t),dh.forEach(t),Xp=p(o),be=r(o,"DIV",{class:!0});var xt=i(be);y(zr.$$.fragment,xt),Pb=p(xt),Mr=r(xt,"P",{});var ph=i(Mr);qb=s(ph,"TFWav2Vec2 Model with a "),hd=r(ph,"CODE",{});var X0=i(hd);Ab=s(X0,"language modeling"),X0.forEach(t),zb=s(ph," head on top for Connectionist Temporal Classification (CTC)."),ph.forEach(t),Mb=p(xt),Lr=r(xt,"P",{});var mh=i(Lr);Lb=s(mh,"This model inherits from "),wl=r(mh,"A",{href:!0});var G0=i(wl);Ob=s(G0,"TFPreTrainedModel"),G0.forEach(t),Db=s(mh,`. 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.)`),mh.forEach(t),Sb=p(xt),Or=r(xt,"P",{});var hh=i(Or);Ib=s(hh,"This model is also a "),Dr=r(hh,"A",{href:!0,rel:!0});var K0=i(Dr);Nb=s(K0,"tf.keras.Model"),K0.forEach(t),Bb=s(hh,` 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.`),hh.forEach(t),Rb=p(xt),y(Ia.$$.fragment,xt),Ub=p(xt),ut=r(xt,"DIV",{class:!0});var us=i(ut);y(Sr.$$.fragment,us),Hb=p(us),Oo=r(us,"P",{});var Nl=i(Oo);Xb=s(Nl,"The "),yl=r(Nl,"A",{href:!0});var J0=i(yl);Gb=s(J0,"TFWav2Vec2ForCTC"),J0.forEach(t),Kb=s(Nl," forward method, overrides the "),ud=r(Nl,"CODE",{});var Z0=i(ud);Jb=s(Z0,"__call__"),Z0.forEach(t),Zb=s(Nl," special method."),Nl.forEach(t),Qb=p(us),y(Na.$$.fragment,us),Yb=p(us),y(Ba.$$.fragment,us),us.forEach(t),xt.forEach(t),Gp=p(o),Do=r(o,"H2",{class:!0});var uh=i(Do);Ra=r(uh,"A",{id:!0,class:!0,href:!0});var Q0=i(Ra);fd=r(Q0,"SPAN",{});var Y0=i(fd);y(Ir.$$.fragment,Y0),Y0.forEach(t),Q0.forEach(t),ew=p(uh),gd=r(uh,"SPAN",{});var eT=i(gd);tw=s(eT,"FlaxWav2Vec2Model"),eT.forEach(t),uh.forEach(t),Kp=p(o),re=r(o,"DIV",{class:!0});var Re=i(re);y(Nr.$$.fragment,Re),ow=p(Re),Br=r(Re,"P",{});var fh=i(Br);aw=s(fh,`The bare Wav2Vec2 Model transformer outputting raw hidden-states without any specific head on top.
Wav2Vec2 was proposed in `),Rr=r(fh,"A",{href:!0,rel:!0});var tT=i(Rr);sw=s(tT,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),tT.forEach(t),nw=s(fh,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),fh.forEach(t),rw=p(Re),Ur=r(Re,"P",{});var gh=i(Ur);iw=s(gh,"This model inherits from "),kl=r(gh,"A",{href:!0});var oT=i(kl);lw=s(oT,"FlaxPreTrainedModel"),oT.forEach(t),cw=s(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),dw=p(Re),Hr=r(Re,"P",{});var _h=i(Hr);pw=s(_h,`This model is also a Flax Linen
`),Xr=r(_h,"A",{href:!0,rel:!0});var aT=i(Xr);mw=s(aT,"flax.nn.Module"),aT.forEach(t),hw=s(_h,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),_h.forEach(t),uw=p(Re),_d=r(Re,"P",{});var sT=i(_d);fw=s(sT,"Finally, this model supports inherent JAX features such as:"),sT.forEach(t),gw=p(Re),Ot=r(Re,"UL",{});var fs=i(Ot);vd=r(fs,"LI",{});var nT=i(vd);Gr=r(nT,"A",{href:!0,rel:!0});var rT=i(Gr);_w=s(rT,"Just-In-Time (JIT) compilation"),rT.forEach(t),nT.forEach(t),vw=p(fs),bd=r(fs,"LI",{});var iT=i(bd);Kr=r(iT,"A",{href:!0,rel:!0});var lT=i(Kr);bw=s(lT,"Automatic Differentiation"),lT.forEach(t),iT.forEach(t),ww=p(fs),wd=r(fs,"LI",{});var cT=i(wd);Jr=r(cT,"A",{href:!0,rel:!0});var dT=i(Jr);yw=s(dT,"Vectorization"),dT.forEach(t),cT.forEach(t),kw=p(fs),yd=r(fs,"LI",{});var pT=i(yd);Zr=r(pT,"A",{href:!0,rel:!0});var mT=i(Zr);Tw=s(mT,"Parallelization"),mT.forEach(t),pT.forEach(t),fs.forEach(t),xw=p(Re),ft=r(Re,"DIV",{class:!0});var gs=i(ft);y(Qr.$$.fragment,gs),$w=p(gs),So=r(gs,"P",{});var Bl=i(So);jw=s(Bl,"The "),kd=r(Bl,"CODE",{});var hT=i(kd);Ww=s(hT,"FlaxWav2Vec2PreTrainedModel"),hT.forEach(t),Vw=s(Bl," forward method, overrides the "),Td=r(Bl,"CODE",{});var uT=i(Td);Fw=s(uT,"__call__"),uT.forEach(t),Ew=s(Bl," special method."),Bl.forEach(t),Cw=p(gs),y(Ua.$$.fragment,gs),Pw=p(gs),y(Ha.$$.fragment,gs),gs.forEach(t),Re.forEach(t),Jp=p(o),Io=r(o,"H2",{class:!0});var vh=i(Io);Xa=r(vh,"A",{id:!0,class:!0,href:!0});var fT=i(Xa);xd=r(fT,"SPAN",{});var gT=i(xd);y(Yr.$$.fragment,gT),gT.forEach(t),fT.forEach(t),qw=p(vh),$d=r(vh,"SPAN",{});var _T=i($d);Aw=s(_T,"FlaxWav2Vec2ForCTC"),_T.forEach(t),vh.forEach(t),Zp=p(o),ie=r(o,"DIV",{class:!0});var Ue=i(ie);y(ei.$$.fragment,Ue),zw=p(Ue),No=r(Ue,"P",{});var Rl=i(No);Mw=s(Rl,"Wav2Vec2 Model with a "),jd=r(Rl,"CODE",{});var vT=i(jd);Lw=s(vT,"language modeling"),vT.forEach(t),Ow=s(Rl,` head on top for Connectionist Temporal Classification (CTC).
Wav2Vec2 was proposed in `),ti=r(Rl,"A",{href:!0,rel:!0});var bT=i(ti);Dw=s(bT,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),bT.forEach(t),Sw=s(Rl,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Rl.forEach(t),Iw=p(Ue),oi=r(Ue,"P",{});var bh=i(oi);Nw=s(bh,"This model inherits from "),Tl=r(bh,"A",{href:!0});var wT=i(Tl);Bw=s(wT,"FlaxPreTrainedModel"),wT.forEach(t),Rw=s(bh,`. 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.)`),bh.forEach(t),Uw=p(Ue),ai=r(Ue,"P",{});var wh=i(ai);Hw=s(wh,`This model is also a Flax Linen
`),si=r(wh,"A",{href:!0,rel:!0});var yT=i(si);Xw=s(yT,"flax.nn.Module"),yT.forEach(t),Gw=s(wh,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),wh.forEach(t),Kw=p(Ue),Wd=r(Ue,"P",{});var kT=i(Wd);Jw=s(kT,"Finally, this model supports inherent JAX features such as:"),kT.forEach(t),Zw=p(Ue),Dt=r(Ue,"UL",{});var _s=i(Dt);Vd=r(_s,"LI",{});var TT=i(Vd);ni=r(TT,"A",{href:!0,rel:!0});var xT=i(ni);Qw=s(xT,"Just-In-Time (JIT) compilation"),xT.forEach(t),TT.forEach(t),Yw=p(_s),Fd=r(_s,"LI",{});var $T=i(Fd);ri=r($T,"A",{href:!0,rel:!0});var jT=i(ri);e1=s(jT,"Automatic Differentiation"),jT.forEach(t),$T.forEach(t),t1=p(_s),Ed=r(_s,"LI",{});var WT=i(Ed);ii=r(WT,"A",{href:!0,rel:!0});var VT=i(ii);o1=s(VT,"Vectorization"),VT.forEach(t),WT.forEach(t),a1=p(_s),Cd=r(_s,"LI",{});var FT=i(Cd);li=r(FT,"A",{href:!0,rel:!0});var ET=i(li);s1=s(ET,"Parallelization"),ET.forEach(t),FT.forEach(t),_s.forEach(t),n1=p(Ue),gt=r(Ue,"DIV",{class:!0});var vs=i(gt);y(ci.$$.fragment,vs),r1=p(vs),Bo=r(vs,"P",{});var Ul=i(Bo);i1=s(Ul,"The "),Pd=r(Ul,"CODE",{});var CT=i(Pd);l1=s(CT,"FlaxWav2Vec2PreTrainedModel"),CT.forEach(t),c1=s(Ul," forward method, overrides the "),qd=r(Ul,"CODE",{});var PT=i(qd);d1=s(PT,"__call__"),PT.forEach(t),p1=s(Ul," special method."),Ul.forEach(t),m1=p(vs),y(Ga.$$.fragment,vs),h1=p(vs),y(Ka.$$.fragment,vs),vs.forEach(t),Ue.forEach(t),Qp=p(o),Ro=r(o,"H2",{class:!0});var yh=i(Ro);Ja=r(yh,"A",{id:!0,class:!0,href:!0});var qT=i(Ja);Ad=r(qT,"SPAN",{});var AT=i(Ad);y(di.$$.fragment,AT),AT.forEach(t),qT.forEach(t),u1=p(yh),zd=r(yh,"SPAN",{});var zT=i(zd);f1=s(zT,"FlaxWav2Vec2ForPreTraining"),zT.forEach(t),yh.forEach(t),Yp=p(o),le=r(o,"DIV",{class:!0});var He=i(le);y(pi.$$.fragment,He),g1=p(He),Uo=r(He,"P",{});var Hl=i(Uo);_1=s(Hl,"Wav2Vec2 Model with a quantizer and "),Md=r(Hl,"CODE",{});var MT=i(Md);v1=s(MT,"VQ"),MT.forEach(t),b1=s(Hl,` head on top.
Wav2Vec2 was proposed in `),mi=r(Hl,"A",{href:!0,rel:!0});var LT=i(mi);w1=s(LT,`wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations`),LT.forEach(t),y1=s(Hl,` by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`),Hl.forEach(t),k1=p(He),hi=r(He,"P",{});var kh=i(hi);T1=s(kh,"This model inherits from "),xl=r(kh,"A",{href:!0});var OT=i(xl);x1=s(OT,"FlaxPreTrainedModel"),OT.forEach(t),$1=s(kh,`. 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.)`),kh.forEach(t),j1=p(He),ui=r(He,"P",{});var Th=i(ui);W1=s(Th,`This model is also a Flax Linen
`),fi=r(Th,"A",{href:!0,rel:!0});var DT=i(fi);V1=s(DT,"flax.nn.Module"),DT.forEach(t),F1=s(Th,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Th.forEach(t),E1=p(He),Ld=r(He,"P",{});var ST=i(Ld);C1=s(ST,"Finally, this model supports inherent JAX features such as:"),ST.forEach(t),P1=p(He),St=r(He,"UL",{});var bs=i(St);Od=r(bs,"LI",{});var IT=i(Od);gi=r(IT,"A",{href:!0,rel:!0});var NT=i(gi);q1=s(NT,"Just-In-Time (JIT) compilation"),NT.forEach(t),IT.forEach(t),A1=p(bs),Dd=r(bs,"LI",{});var BT=i(Dd);_i=r(BT,"A",{href:!0,rel:!0});var RT=i(_i);z1=s(RT,"Automatic Differentiation"),RT.forEach(t),BT.forEach(t),M1=p(bs),Sd=r(bs,"LI",{});var UT=i(Sd);vi=r(UT,"A",{href:!0,rel:!0});var HT=i(vi);L1=s(HT,"Vectorization"),HT.forEach(t),UT.forEach(t),O1=p(bs),Id=r(bs,"LI",{});var XT=i(Id);bi=r(XT,"A",{href:!0,rel:!0});var GT=i(bi);D1=s(GT,"Parallelization"),GT.forEach(t),XT.forEach(t),bs.forEach(t),S1=p(He),_t=r(He,"DIV",{class:!0});var ws=i(_t);y(wi.$$.fragment,ws),I1=p(ws),Ho=r(ws,"P",{});var Xl=i(Ho);N1=s(Xl,"The "),$l=r(Xl,"A",{href:!0});var KT=i($l);B1=s(KT,"FlaxWav2Vec2ForPreTraining"),KT.forEach(t),R1=s(Xl," forward method, overrides the "),Nd=r(Xl,"CODE",{});var JT=i(Nd);U1=s(JT,"__call__"),JT.forEach(t),H1=s(Xl," special method."),Xl.forEach(t),X1=p(ws),y(Za.$$.fragment,ws),G1=p(ws),y(Qa.$$.fragment,ws),ws.forEach(t),He.forEach(t),this.h()},h(){c(m,"name","hf:doc:metadata"),c(m,"content",JSON.stringify(Ax)),c(u,"id","wav2vec2"),c(u,"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(u,"href","#wav2vec2"),c(f,"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(A,"class","relative group"),c(I,"href","https://arxiv.org/abs/2006.11477"),c(I,"rel","nofollow"),c(U,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer"),c(Pe,"href","https://huggingface.co/patrickvonplaten"),c(Pe,"rel","nofollow"),c(ye,"id","resources"),c(ye,"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(ye,"href","#resources"),c(Y,"class","relative group"),c(Ze,"href","https://colab.research.google.com/github/m3hrdadfi/soxan/blob/main/notebooks/Emotion_recognition_in_Greek_speech_using_Wav2Vec2.ipynb"),c(Ze,"rel","nofollow"),c(pe,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC"),c(se,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/audio-classification"),c(se,"rel","nofollow"),c(Ae,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/audio_classification.ipynb"),c(Ae,"rel","nofollow"),c(Ei,"href","./tasks/audio_classification"),c(Ts,"href","https://huggingface.co/blog/wav2vec2-with-ngram"),c(Ts,"rel","nofollow"),c($s,"href","https://huggingface.co/blog/fine-tune-wav2vec2-english"),c($s,"rel","nofollow"),c(Ws,"href","https://huggingface.co/blog/fine-tune-xlsr-wav2vec2"),c(Ws,"rel","nofollow"),c(Fs,"href","https://colab.research.google.com/github/Muennighoff/ytclipcc/blob/main/wav2vec_youtube_captions.ipynb"),c(Fs,"rel","nofollow"),c(Ci,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC"),c(Es,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/speech_recognition.ipynb"),c(Es,"rel","nofollow"),c(Cs,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multi_lingual_speech_recognition.ipynb"),c(Cs,"rel","nofollow"),c(Pi,"href","./tasks/asr"),c(qs,"href","https://www.philschmid.de/automatic-speech-recognition-sagemaker"),c(qs,"rel","nofollow"),c(Go,"id","transformers.Wav2Vec2Config"),c(Go,"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(Go,"href","#transformers.Wav2Vec2Config"),c(lo,"class","relative group"),c(zi,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Model"),c(Ms,"href","https://huggingface.co/facebook/wav2vec2-base-960h"),c(Ms,"rel","nofollow"),c(Mi,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(Li,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),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(Jo,"id","transformers.Wav2Vec2CTCTokenizer"),c(Jo,"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(Jo,"href","#transformers.Wav2Vec2CTCTokenizer"),c(mo,"class","relative group"),c(Oi,"href","/docs/transformers/v4.27.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),c(Zo,"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,"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(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(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(ea,"id","transformers.Wav2Vec2FeatureExtractor"),c(ea,"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(ea,"href","#transformers.Wav2Vec2FeatureExtractor"),c(ho,"class","relative group"),c(Si,"href","/docs/transformers/v4.27.1/en/main_classes/feature_extractor#transformers.SequenceFeatureExtractor"),c(ta,"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(oa,"id","transformers.Wav2Vec2Processor"),c(oa,"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(oa,"href","#transformers.Wav2Vec2Processor"),c(uo,"class","relative group"),c(Ii,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor"),c(Ni,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor"),c(Bi,"href","/docs/transformers/v4.27.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),c(Zs,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__"),c(Ri,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.decode"),c(Ys,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor.__call__"),c(en,"href","/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"),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(Ui,"href","/docs/transformers/v4.27.1/en/main_classes/feature_extractor#transformers.SequenceFeatureExtractor.pad"),c(Hi,"href","/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.pad"),c(sa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Xi,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Gi,"href","/docs/transformers/v4.27.1/en/main_classes/processors#transformers.ProcessorMixin.from_pretrained"),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(Ki,"href","/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode"),c(ra,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ji,"href","/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode"),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(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(la,"id","transformers.Wav2Vec2ProcessorWithLM"),c(la,"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(la,"href","#transformers.Wav2Vec2ProcessorWithLM"),c(fo,"class","relative group"),c(hn,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor.__call__"),c(un,"href","/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"),c(ca,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Zi,"href","/docs/transformers/v4.27.1/en/main_classes/feature_extractor#transformers.SequenceFeatureExtractor.pad"),c(Qi,"href","/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.pad"),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(Yi,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2ProcessorWithLM"),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(el,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(tl,"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(Xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(te,"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","decoding-multiple-audios"),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","#decoding-multiple-audios"),c(go,"class","relative group"),c(ol,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2ProcessorWithLM.batch_decode"),c(al,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2ProcessorWithLM.batch_decode"),c(sl,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2ProcessorWithLM.decode"),c(fa,"id","transformers.models.wav2vec2_with_lm.processing_wav2vec2_with_lm.Wav2Vec2DecoderWithLMOutput"),c(fa,"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(fa,"href","#transformers.models.wav2vec2_with_lm.processing_wav2vec2_with_lm.Wav2Vec2DecoderWithLMOutput"),c(_o,"class","relative group"),c(vo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(nl,"href","/docs/transformers/v4.27.1/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(ga,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(_a,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(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(va,"id","transformers.Wav2Vec2Model"),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","#transformers.Wav2Vec2Model"),c(yo,"class","relative group"),c(Dn,"href","https://arxiv.org/abs/2006.11477"),c(Dn,"rel","nofollow"),c(rl,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(Nn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Nn,"rel","nofollow"),c(il,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Model"),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(ze,"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,"id","transformers.Wav2Vec2ForCTC"),c(ya,"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(ya,"href","#transformers.Wav2Vec2ForCTC"),c(To,"class","relative group"),c(Hn,"href","https://arxiv.org/abs/2006.11477"),c(Hn,"rel","nofollow"),c(ll,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(Kn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Kn,"rel","nofollow"),c(cl,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC"),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(Me,"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(jo,"class","relative group"),c(er,"href","https://arxiv.org/abs/2006.11477"),c(er,"rel","nofollow"),c(dl,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(ar,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(ar,"rel","nofollow"),c(pl,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2ForSequenceClassification"),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(fe,"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,"id","transformers.Wav2Vec2ForAudioFrameClassification"),c(Wa,"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(Wa,"href","#transformers.Wav2Vec2ForAudioFrameClassification"),c(Vo,"class","relative group"),c(lr,"href","https://arxiv.org/abs/2006.11477"),c(lr,"rel","nofollow"),c(ml,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(pr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(pr,"rel","nofollow"),c(hl,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2ForAudioFrameClassification"),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(Ea,"id","transformers.Wav2Vec2ForXVector"),c(Ea,"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(Ea,"href","#transformers.Wav2Vec2ForXVector"),c(Eo,"class","relative group"),c(gr,"href","https://arxiv.org/abs/2006.11477"),c(gr,"rel","nofollow"),c(ul,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(br,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(br,"rel","nofollow"),c(fl,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2ForXVector"),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(qa,"id","transformers.Wav2Vec2ForPreTraining"),c(qa,"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(qa,"href","#transformers.Wav2Vec2ForPreTraining"),c(Po,"class","relative group"),c(Tr,"href","https://arxiv.org/abs/2006.11477"),c(Tr,"rel","nofollow"),c(gl,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(jr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(jr,"rel","nofollow"),c(_l,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.Wav2Vec2ForPreTraining"),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(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(Ma,"id","transformers.TFWav2Vec2Model"),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.TFWav2Vec2Model"),c(zo,"class","relative group"),c(vl,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel"),c(Pr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),c(Pr,"rel","nofollow"),c(bl,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.TFWav2Vec2Model"),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(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(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(Lo,"class","relative group"),c(wl,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.TFPreTrainedModel"),c(Dr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),c(Dr,"rel","nofollow"),c(yl,"href","/docs/transformers/v4.27.1/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(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(Ra,"id","transformers.FlaxWav2Vec2Model"),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.FlaxWav2Vec2Model"),c(Do,"class","relative group"),c(Rr,"href","https://arxiv.org/abs/2006.11477"),c(Rr,"rel","nofollow"),c(kl,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel"),c(Xr,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),c(Xr,"rel","nofollow"),c(Gr,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),c(Gr,"rel","nofollow"),c(Kr,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),c(Kr,"rel","nofollow"),c(Jr,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),c(Jr,"rel","nofollow"),c(Zr,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),c(Zr,"rel","nofollow"),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(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(Xa,"id","transformers.FlaxWav2Vec2ForCTC"),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.FlaxWav2Vec2ForCTC"),c(Io,"class","relative group"),c(ti,"href","https://arxiv.org/abs/2006.11477"),c(ti,"rel","nofollow"),c(Tl,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel"),c(si,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),c(si,"rel","nofollow"),c(ni,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),c(ni,"rel","nofollow"),c(ri,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),c(ri,"rel","nofollow"),c(ii,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),c(ii,"rel","nofollow"),c(li,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),c(li,"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(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ja,"id","transformers.FlaxWav2Vec2ForPreTraining"),c(Ja,"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(Ja,"href","#transformers.FlaxWav2Vec2ForPreTraining"),c(Ro,"class","relative group"),c(mi,"href","https://arxiv.org/abs/2006.11477"),c(mi,"rel","nofollow"),c(xl,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.FlaxPreTrainedModel"),c(fi,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),c(fi,"rel","nofollow"),c(gi,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),c(gi,"rel","nofollow"),c(_i,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),c(_i,"rel","nofollow"),c(vi,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),c(vi,"rel","nofollow"),c(bi,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),c(bi,"rel","nofollow"),c($l,"href","/docs/transformers/v4.27.1/en/model_doc/wav2vec2#transformers.FlaxWav2Vec2ForPreTraining"),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")},m(o,g){e(document.head,m),_(o,b,g),_(o,f,g),e(f,u),e(u,v),k(l,v,null),e(f,h),e(f,V),e(V,M),_(o,L,g),_(o,A,g),e(A,z),e(z,N),k(E,N,null),e(A,O),e(A,C),e(C,ce),_(o,K,g),_(o,S,g),e(S,de),e(S,I),e(I,R),e(S,De),_(o,X,g),_(o,J,g),e(J,Se),_(o,We,g),_(o,Z,g),e(Z,Ke),e(Ke,$t),_(o,Ie,g),_(o,D,g),e(D,Q),_(o,tt,g),_(o,ae,g),e(ae,Je),e(Je,jt),e(ae,Ve),e(ae,Fe),e(Fe,Wt),e(Fe,U),e(U,Vt),e(Fe,Ee),_(o,ot,g),_(o,we,g),e(we,Ce),e(we,Pe),e(Pe,Ft),e(we,he),_(o,at,g),_(o,Y,g),e(Y,ye),e(ye,qe),k(B,qe,null),e(Y,Et),e(Y,ee),e(ee,Ct),_(o,st,g),_(o,j,g),e(j,P),_(o,Nt,g),k(ue,o,g),_(o,Bt,g),_(o,ke,g),e(ke,q),e(q,Qt),e(q,Ze),e(Ze,Yt),e(q,eo),e(ke,to),e(ke,H),e(H,pe),e(pe,oo),e(H,ao),e(H,se),e(se,so),e(H,no),e(H,Ae),e(Ae,ro),e(H,Qe),e(ke,io),e(ke,Gl),e(Gl,Ei),e(Ei,xh),_(o,cp,g),k(ys,o,g),_(o,dp,g),_(o,Te,g),e(Te,ks),e(ks,$h),e(ks,Ts),e(Ts,jh),e(ks,Wh),e(Te,Vh),e(Te,xs),e(xs,Fh),e(xs,$s),e($s,Eh),e(xs,Ch),e(Te,Ph),e(Te,js),e(js,qh),e(js,Ws),e(Ws,Ah),e(js,zh),e(Te,Mh),e(Te,Vs),e(Vs,Lh),e(Vs,Fs),e(Fs,Oh),e(Vs,Dh),e(Te,Sh),e(Te,Rt),e(Rt,Ci),e(Ci,Ih),e(Rt,Nh),e(Rt,Es),e(Es,Bh),e(Rt,Rh),e(Rt,Cs),e(Cs,Uh),e(Rt,Hh),e(Te,Xh),e(Te,Kl),e(Kl,Pi),e(Pi,Gh),_(o,pp,g),_(o,qi,g),e(qi,Kh),_(o,mp,g),_(o,Ai,g),e(Ai,Ps),e(Ps,Jh),e(Ps,qs),e(qs,Zh),e(Ps,Qh),_(o,hp,g),_(o,lo,g),e(lo,Go),e(Go,Jl),k(As,Jl,null),e(lo,Yh),e(lo,Zl),e(Zl,eu),_(o,up,g),_(o,Ye,g),k(zs,Ye,null),e(Ye,tu),e(Ye,co),e(co,ou),e(co,zi),e(zi,au),e(co,su),e(co,Ms),e(Ms,nu),e(co,ru),e(Ye,iu),e(Ye,po),e(po,lu),e(po,Mi),e(Mi,cu),e(po,du),e(po,Li),e(Li,pu),e(po,mu),e(Ye,hu),k(Ko,Ye,null),_(o,fp,g),_(o,mo,g),e(mo,Jo),e(Jo,Ql),k(Ls,Ql,null),e(mo,uu),e(mo,Yl),e(Yl,fu),_(o,gp,g),_(o,ne,g),k(Os,ne,null),e(ne,gu),e(ne,ec),e(ec,_u),e(ne,vu),e(ne,Ds),e(Ds,bu),e(Ds,Oi),e(Oi,wu),e(Ds,yu),e(ne,ku),e(ne,Zo),k(Ss,Zo,null),e(Zo,Tu),e(Zo,tc),e(tc,xu),e(ne,$u),e(ne,Di),k(Is,Di,null),e(ne,ju),e(ne,nt),k(Ns,nt,null),e(nt,Wu),e(nt,oc),e(oc,Vu),e(nt,Fu),e(nt,Bs),e(Bs,Eu),e(Bs,ac),e(ac,Cu),e(Bs,Pu),e(nt,qu),k(Qo,nt,null),e(ne,Au),e(ne,Yo),k(Rs,Yo,null),e(Yo,zu),e(Yo,sc),e(sc,Mu),_(o,_p,g),_(o,ho,g),e(ho,ea),e(ea,nc),k(Us,nc,null),e(ho,Lu),e(ho,rc),e(rc,Ou),_(o,vp,g),_(o,et,g),k(Hs,et,null),e(et,Du),e(et,ic),e(ic,Su),e(et,Iu),e(et,Xs),e(Xs,Nu),e(Xs,Si),e(Si,Bu),e(Xs,Ru),e(et,Uu),e(et,ta),k(Gs,ta,null),e(ta,Hu),e(ta,lc),e(lc,Xu),_(o,bp,g),_(o,uo,g),e(uo,oa),e(oa,cc),k(Ks,cc,null),e(uo,Gu),e(uo,dc),e(dc,Ku),_(o,wp,g),_(o,G,g),k(Js,G,null),e(G,Ju),e(G,pc),e(pc,Zu),e(G,Qu),e(G,Ne),e(Ne,Ii),e(Ii,Yu),e(Ne,ef),e(Ne,Ni),e(Ni,tf),e(Ne,of),e(Ne,Bi),e(Bi,af),e(Ne,sf),e(Ne,Zs),e(Zs,mc),e(mc,nf),e(Zs,rf),e(Ne,lf),e(Ne,Ri),e(Ri,cf),e(Ne,df),e(G,pf),e(G,aa),k(Qs,aa,null),e(aa,mf),e(aa,Pt),e(Pt,hf),e(Pt,Ys),e(Ys,hc),e(hc,uf),e(Ys,ff),e(Pt,gf),e(Pt,uc),e(uc,_f),e(Pt,vf),e(Pt,en),e(en,fc),e(fc,bf),e(en,wf),e(Pt,yf),e(G,kf),e(G,sa),k(tn,sa,null),e(sa,Tf),e(sa,qt),e(qt,xf),e(qt,Ui),e(Ui,$f),e(qt,jf),e(qt,gc),e(gc,Wf),e(qt,Vf),e(qt,Hi),e(Hi,Ff),e(qt,Ef),e(G,Cf),e(G,Xi),k(on,Xi,null),e(G,Pf),e(G,Ut),k(an,Ut,null),e(Ut,qf),e(Ut,sn),e(sn,Af),e(sn,Gi),e(Gi,zf),e(sn,Mf),e(Ut,Lf),k(na,Ut,null),e(G,Of),e(G,ra),k(nn,ra,null),e(ra,Df),e(ra,rn),e(rn,Sf),e(rn,Ki),e(Ki,If),e(rn,Nf),e(G,Bf),e(G,ia),k(ln,ia,null),e(ia,Rf),e(ia,cn),e(cn,Uf),e(cn,Ji),e(Ji,Hf),e(cn,Xf),_(o,yp,g),_(o,fo,g),e(fo,la),e(la,_c),k(dn,_c,null),e(fo,Gf),e(fo,vc),e(vc,Kf),_(o,kp,g),_(o,te,g),k(pn,te,null),e(te,Jf),e(te,bc),e(bc,Zf),e(te,Qf),e(te,ca),k(mn,ca,null),e(ca,Yf),e(ca,At),e(At,eg),e(At,hn),e(hn,wc),e(wc,tg),e(hn,og),e(At,ag),e(At,yc),e(yc,sg),e(At,ng),e(At,un),e(un,kc),e(kc,rg),e(un,ig),e(At,lg),e(te,cg),e(te,da),k(fn,da,null),e(da,dg),e(da,zt),e(zt,pg),e(zt,Zi),e(Zi,mg),e(zt,hg),e(zt,Tc),e(Tc,ug),e(zt,fg),e(zt,Qi),e(Qi,gg),e(zt,_g),e(te,vg),e(te,Ht),k(gn,Ht,null),e(Ht,bg),e(Ht,_n),e(_n,wg),e(_n,Yi),e(Yi,yg),e(_n,kg),e(Ht,Tg),k(pa,Ht,null),e(te,xg),e(te,el),k(vn,el,null),e(te,$g),e(te,rt),k(bn,rt,null),e(rt,jg),e(rt,xc),e(xc,Wg),e(rt,Vg),k(ma,rt,null),e(rt,Fg),e(rt,wn),e(wn,Eg),e(wn,tl),e(tl,Cg),e(wn,Pg),e(te,qg),e(te,Xt),k(yn,Xt,null),e(Xt,Ag),e(Xt,$c),e($c,zg),e(Xt,Mg),k(ha,Xt,null),_(o,Tp,g),_(o,go,g),e(go,ua),e(ua,jc),k(kn,jc,null),e(go,Lg),e(go,Wc),e(Wc,Og),_(o,xp,g),_(o,xe,g),e(xe,Dg),e(xe,ol),e(ol,Sg),e(xe,Ig),e(xe,Vc),e(Vc,Ng),e(xe,Bg),e(xe,al),e(al,Rg),e(xe,Ug),e(xe,sl),e(sl,Hg),e(xe,Xg),e(xe,Fc),e(Fc,Gg),e(xe,Kg),_(o,$p,g),k(Tn,o,g),_(o,jp,g),_(o,_o,g),e(_o,fa),e(fa,Ec),k(xn,Ec,null),e(_o,Jg),e(_o,Cc),e(Cc,Zg),_(o,Wp,g),_(o,vo,g),k($n,vo,null),e(vo,Qg),e(vo,jn),e(jn,Yg),e(jn,Pc),e(Pc,e_),e(jn,t_),_(o,Vp,g),_(o,bo,g),k(Wn,bo,null),e(bo,o_),e(bo,qc),e(qc,a_),_(o,Fp,g),_(o,wo,g),k(Vn,wo,null),e(wo,s_),e(wo,Fn),e(Fn,n_),e(Fn,nl),e(nl,r_),e(Fn,i_),_(o,Ep,g),_(o,Mt,g),k(En,Mt,null),e(Mt,l_),e(Mt,Cn),e(Cn,c_),e(Cn,Ac),e(Ac,d_),e(Cn,p_),e(Mt,m_),e(Mt,ga),k(Pn,ga,null),e(ga,h_),e(ga,zc),e(zc,u_),_(o,Cp,g),_(o,Lt,g),k(qn,Lt,null),e(Lt,f_),e(Lt,An),e(An,g_),e(An,Mc),e(Mc,__),e(An,v_),e(Lt,b_),e(Lt,_a),k(zn,_a,null),e(_a,w_),e(_a,Lc),e(Lc,y_),_(o,Pp,g),_(o,yo,g),e(yo,va),e(va,Oc),k(Mn,Oc,null),e(yo,k_),e(yo,Dc),e(Dc,T_),_(o,qp,g),_(o,ze,g),k(Ln,ze,null),e(ze,x_),e(ze,On),e(On,$_),e(On,Dn),e(Dn,j_),e(On,W_),e(ze,V_),e(ze,Sn),e(Sn,F_),e(Sn,rl),e(rl,E_),e(Sn,C_),e(ze,P_),e(ze,In),e(In,q_),e(In,Nn),e(Nn,A_),e(In,z_),e(ze,M_),e(ze,it),k(Bn,it,null),e(it,L_),e(it,ko),e(ko,O_),e(ko,il),e(il,D_),e(ko,S_),e(ko,Sc),e(Sc,I_),e(ko,N_),e(it,B_),k(ba,it,null),e(it,R_),k(wa,it,null),_(o,Ap,g),_(o,To,g),e(To,ya),e(ya,Ic),k(Rn,Ic,null),e(To,U_),e(To,Nc),e(Nc,H_),_(o,zp,g),_(o,Me,g),k(Un,Me,null),e(Me,X_),e(Me,xo),e(xo,G_),e(xo,Bc),e(Bc,K_),e(xo,J_),e(xo,Hn),e(Hn,Z_),e(xo,Q_),e(Me,Y_),e(Me,Xn),e(Xn,ev),e(Xn,ll),e(ll,tv),e(Xn,ov),e(Me,av),e(Me,Gn),e(Gn,sv),e(Gn,Kn),e(Kn,nv),e(Gn,rv),e(Me,iv),e(Me,lt),k(Jn,lt,null),e(lt,lv),e(lt,$o),e($o,cv),e($o,cl),e(cl,dv),e($o,pv),e($o,Rc),e(Rc,mv),e($o,hv),e(lt,uv),k(ka,lt,null),e(lt,fv),k(Ta,lt,null),_(o,Mp,g),_(o,jo,g),e(jo,xa),e(xa,Uc),k(Zn,Uc,null),e(jo,gv),e(jo,Hc),e(Hc,_v),_(o,Lp,g),_(o,fe,g),k(Qn,fe,null),e(fe,vv),e(fe,Xc),e(Xc,bv),e(fe,wv),e(fe,Yn),e(Yn,yv),e(Yn,er),e(er,kv),e(Yn,Tv),e(fe,xv),e(fe,tr),e(tr,$v),e(tr,dl),e(dl,jv),e(tr,Wv),e(fe,Vv),e(fe,or),e(or,Fv),e(or,ar),e(ar,Ev),e(or,Cv),e(fe,Pv),e(fe,ct),k(sr,ct,null),e(ct,qv),e(ct,Wo),e(Wo,Av),e(Wo,pl),e(pl,zv),e(Wo,Mv),e(Wo,Gc),e(Gc,Lv),e(Wo,Ov),e(ct,Dv),k($a,ct,null),e(ct,Sv),k(ja,ct,null),_(o,Op,g),_(o,Vo,g),e(Vo,Wa),e(Wa,Kc),k(nr,Kc,null),e(Vo,Iv),e(Vo,Jc),e(Jc,Nv),_(o,Dp,g),_(o,ge,g),k(rr,ge,null),e(ge,Bv),e(ge,Zc),e(Zc,Rv),e(ge,Uv),e(ge,ir),e(ir,Hv),e(ir,lr),e(lr,Xv),e(ir,Gv),e(ge,Kv),e(ge,cr),e(cr,Jv),e(cr,ml),e(ml,Zv),e(cr,Qv),e(ge,Yv),e(ge,dr),e(dr,e2),e(dr,pr),e(pr,t2),e(dr,o2),e(ge,a2),e(ge,dt),k(mr,dt,null),e(dt,s2),e(dt,Fo),e(Fo,n2),e(Fo,hl),e(hl,r2),e(Fo,i2),e(Fo,Qc),e(Qc,l2),e(Fo,c2),e(dt,d2),k(Va,dt,null),e(dt,p2),k(Fa,dt,null),_(o,Sp,g),_(o,Eo,g),e(Eo,Ea),e(Ea,Yc),k(hr,Yc,null),e(Eo,m2),e(Eo,ed),e(ed,h2),_(o,Ip,g),_(o,_e,g),k(ur,_e,null),e(_e,u2),e(_e,td),e(td,f2),e(_e,g2),e(_e,fr),e(fr,_2),e(fr,gr),e(gr,v2),e(fr,b2),e(_e,w2),e(_e,_r),e(_r,y2),e(_r,ul),e(ul,k2),e(_r,T2),e(_e,x2),e(_e,vr),e(vr,$2),e(vr,br),e(br,j2),e(vr,W2),e(_e,V2),e(_e,pt),k(wr,pt,null),e(pt,F2),e(pt,Co),e(Co,E2),e(Co,fl),e(fl,C2),e(Co,P2),e(Co,od),e(od,q2),e(Co,A2),e(pt,z2),k(Ca,pt,null),e(pt,M2),k(Pa,pt,null),_(o,Np,g),_(o,Po,g),e(Po,qa),e(qa,ad),k(yr,ad,null),e(Po,L2),e(Po,sd),e(sd,O2),_(o,Bp,g),_(o,Le,g),k(kr,Le,null),e(Le,D2),e(Le,qo),e(qo,S2),e(qo,nd),e(nd,I2),e(qo,N2),e(qo,Tr),e(Tr,B2),e(qo,R2),e(Le,U2),e(Le,xr),e(xr,H2),e(xr,gl),e(gl,X2),e(xr,G2),e(Le,K2),e(Le,$r),e($r,J2),e($r,jr),e(jr,Z2),e($r,Q2),e(Le,Y2),e(Le,mt),k(Wr,mt,null),e(mt,eb),e(mt,Ao),e(Ao,tb),e(Ao,_l),e(_l,ob),e(Ao,ab),e(Ao,rd),e(rd,sb),e(Ao,nb),e(mt,rb),k(Aa,mt,null),e(mt,ib),k(za,mt,null),_(o,Rp,g),_(o,zo,g),e(zo,Ma),e(Ma,id),k(Vr,id,null),e(zo,lb),e(zo,ld),e(ld,cb),_(o,Up,g),_(o,ve,g),k(Fr,ve,null),e(ve,db),e(ve,cd),e(cd,pb),e(ve,mb),e(ve,Er),e(Er,hb),e(Er,vl),e(vl,ub),e(Er,fb),e(ve,gb),e(ve,Cr),e(Cr,_b),e(Cr,Pr),e(Pr,vb),e(Cr,bb),e(ve,wb),k(La,ve,null),e(ve,yb),e(ve,ht),k(qr,ht,null),e(ht,kb),e(ht,Mo),e(Mo,Tb),e(Mo,bl),e(bl,xb),e(Mo,$b),e(Mo,dd),e(dd,jb),e(Mo,Wb),e(ht,Vb),k(Oa,ht,null),e(ht,Fb),k(Da,ht,null),_(o,Hp,g),_(o,Lo,g),e(Lo,Sa),e(Sa,pd),k(Ar,pd,null),e(Lo,Eb),e(Lo,md),e(md,Cb),_(o,Xp,g),_(o,be,g),k(zr,be,null),e(be,Pb),e(be,Mr),e(Mr,qb),e(Mr,hd),e(hd,Ab),e(Mr,zb),e(be,Mb),e(be,Lr),e(Lr,Lb),e(Lr,wl),e(wl,Ob),e(Lr,Db),e(be,Sb),e(be,Or),e(Or,Ib),e(Or,Dr),e(Dr,Nb),e(Or,Bb),e(be,Rb),k(Ia,be,null),e(be,Ub),e(be,ut),k(Sr,ut,null),e(ut,Hb),e(ut,Oo),e(Oo,Xb),e(Oo,yl),e(yl,Gb),e(Oo,Kb),e(Oo,ud),e(ud,Jb),e(Oo,Zb),e(ut,Qb),k(Na,ut,null),e(ut,Yb),k(Ba,ut,null),_(o,Gp,g),_(o,Do,g),e(Do,Ra),e(Ra,fd),k(Ir,fd,null),e(Do,ew),e(Do,gd),e(gd,tw),_(o,Kp,g),_(o,re,g),k(Nr,re,null),e(re,ow),e(re,Br),e(Br,aw),e(Br,Rr),e(Rr,sw),e(Br,nw),e(re,rw),e(re,Ur),e(Ur,iw),e(Ur,kl),e(kl,lw),e(Ur,cw),e(re,dw),e(re,Hr),e(Hr,pw),e(Hr,Xr),e(Xr,mw),e(Hr,hw),e(re,uw),e(re,_d),e(_d,fw),e(re,gw),e(re,Ot),e(Ot,vd),e(vd,Gr),e(Gr,_w),e(Ot,vw),e(Ot,bd),e(bd,Kr),e(Kr,bw),e(Ot,ww),e(Ot,wd),e(wd,Jr),e(Jr,yw),e(Ot,kw),e(Ot,yd),e(yd,Zr),e(Zr,Tw),e(re,xw),e(re,ft),k(Qr,ft,null),e(ft,$w),e(ft,So),e(So,jw),e(So,kd),e(kd,Ww),e(So,Vw),e(So,Td),e(Td,Fw),e(So,Ew),e(ft,Cw),k(Ua,ft,null),e(ft,Pw),k(Ha,ft,null),_(o,Jp,g),_(o,Io,g),e(Io,Xa),e(Xa,xd),k(Yr,xd,null),e(Io,qw),e(Io,$d),e($d,Aw),_(o,Zp,g),_(o,ie,g),k(ei,ie,null),e(ie,zw),e(ie,No),e(No,Mw),e(No,jd),e(jd,Lw),e(No,Ow),e(No,ti),e(ti,Dw),e(No,Sw),e(ie,Iw),e(ie,oi),e(oi,Nw),e(oi,Tl),e(Tl,Bw),e(oi,Rw),e(ie,Uw),e(ie,ai),e(ai,Hw),e(ai,si),e(si,Xw),e(ai,Gw),e(ie,Kw),e(ie,Wd),e(Wd,Jw),e(ie,Zw),e(ie,Dt),e(Dt,Vd),e(Vd,ni),e(ni,Qw),e(Dt,Yw),e(Dt,Fd),e(Fd,ri),e(ri,e1),e(Dt,t1),e(Dt,Ed),e(Ed,ii),e(ii,o1),e(Dt,a1),e(Dt,Cd),e(Cd,li),e(li,s1),e(ie,n1),e(ie,gt),k(ci,gt,null),e(gt,r1),e(gt,Bo),e(Bo,i1),e(Bo,Pd),e(Pd,l1),e(Bo,c1),e(Bo,qd),e(qd,d1),e(Bo,p1),e(gt,m1),k(Ga,gt,null),e(gt,h1),k(Ka,gt,null),_(o,Qp,g),_(o,Ro,g),e(Ro,Ja),e(Ja,Ad),k(di,Ad,null),e(Ro,u1),e(Ro,zd),e(zd,f1),_(o,Yp,g),_(o,le,g),k(pi,le,null),e(le,g1),e(le,Uo),e(Uo,_1),e(Uo,Md),e(Md,v1),e(Uo,b1),e(Uo,mi),e(mi,w1),e(Uo,y1),e(le,k1),e(le,hi),e(hi,T1),e(hi,xl),e(xl,x1),e(hi,$1),e(le,j1),e(le,ui),e(ui,W1),e(ui,fi),e(fi,V1),e(ui,F1),e(le,E1),e(le,Ld),e(Ld,C1),e(le,P1),e(le,St),e(St,Od),e(Od,gi),e(gi,q1),e(St,A1),e(St,Dd),e(Dd,_i),e(_i,z1),e(St,M1),e(St,Sd),e(Sd,vi),e(vi,L1),e(St,O1),e(St,Id),e(Id,bi),e(bi,D1),e(le,S1),e(le,_t),k(wi,_t,null),e(_t,I1),e(_t,Ho),e(Ho,N1),e(Ho,$l),e($l,B1),e(Ho,R1),e(Ho,Nd),e(Nd,U1),e(Ho,H1),e(_t,X1),k(Za,_t,null),e(_t,G1),k(Qa,_t,null),em=!0},p(o,[g]){const yi={};g&2&&(yi.$$scope={dirty:g,ctx:o}),Ko.$set(yi);const Bd={};g&2&&(Bd.$$scope={dirty:g,ctx:o}),Qo.$set(Bd);const Rd={};g&2&&(Rd.$$scope={dirty:g,ctx:o}),na.$set(Rd);const Ud={};g&2&&(Ud.$$scope={dirty:g,ctx:o}),pa.$set(Ud);const ki={};g&2&&(ki.$$scope={dirty:g,ctx:o}),ma.$set(ki);const Hd={};g&2&&(Hd.$$scope={dirty:g,ctx:o}),ha.$set(Hd);const Xd={};g&2&&(Xd.$$scope={dirty:g,ctx:o}),ba.$set(Xd);const Gd={};g&2&&(Gd.$$scope={dirty:g,ctx:o}),wa.$set(Gd);const Ti={};g&2&&(Ti.$$scope={dirty:g,ctx:o}),ka.$set(Ti);const Kd={};g&2&&(Kd.$$scope={dirty:g,ctx:o}),Ta.$set(Kd);const Jd={};g&2&&(Jd.$$scope={dirty:g,ctx:o}),$a.$set(Jd);const Zd={};g&2&&(Zd.$$scope={dirty:g,ctx:o}),ja.$set(Zd);const Qd={};g&2&&(Qd.$$scope={dirty:g,ctx:o}),Va.$set(Qd);const Yd={};g&2&&(Yd.$$scope={dirty:g,ctx:o}),Fa.$set(Yd);const xi={};g&2&&(xi.$$scope={dirty:g,ctx:o}),Ca.$set(xi);const ep={};g&2&&(ep.$$scope={dirty:g,ctx:o}),Pa.$set(ep);const $i={};g&2&&($i.$$scope={dirty:g,ctx:o}),Aa.$set($i);const tp={};g&2&&(tp.$$scope={dirty:g,ctx:o}),za.$set(tp);const ji={};g&2&&(ji.$$scope={dirty:g,ctx:o}),La.$set(ji);const op={};g&2&&(op.$$scope={dirty:g,ctx:o}),Oa.$set(op);const Wi={};g&2&&(Wi.$$scope={dirty:g,ctx:o}),Da.$set(Wi);const ap={};g&2&&(ap.$$scope={dirty:g,ctx:o}),Ia.$set(ap);const sp={};g&2&&(sp.$$scope={dirty:g,ctx:o}),Na.$set(sp);const np={};g&2&&(np.$$scope={dirty:g,ctx:o}),Ba.$set(np);const rp={};g&2&&(rp.$$scope={dirty:g,ctx:o}),Ua.$set(rp);const Xo={};g&2&&(Xo.$$scope={dirty:g,ctx:o}),Ha.$set(Xo);const Vi={};g&2&&(Vi.$$scope={dirty:g,ctx:o}),Ga.$set(Vi);const ip={};g&2&&(ip.$$scope={dirty:g,ctx:o}),Ka.$set(ip);const Gt={};g&2&&(Gt.$$scope={dirty:g,ctx:o}),Za.$set(Gt);const lp={};g&2&&(lp.$$scope={dirty:g,ctx:o}),Qa.$set(lp)},i(o){em||(T(l.$$.fragment,o),T(E.$$.fragment,o),T(B.$$.fragment,o),T(ue.$$.fragment,o),T(ys.$$.fragment,o),T(As.$$.fragment,o),T(zs.$$.fragment,o),T(Ko.$$.fragment,o),T(Ls.$$.fragment,o),T(Os.$$.fragment,o),T(Ss.$$.fragment,o),T(Is.$$.fragment,o),T(Ns.$$.fragment,o),T(Qo.$$.fragment,o),T(Rs.$$.fragment,o),T(Us.$$.fragment,o),T(Hs.$$.fragment,o),T(Gs.$$.fragment,o),T(Ks.$$.fragment,o),T(Js.$$.fragment,o),T(Qs.$$.fragment,o),T(tn.$$.fragment,o),T(on.$$.fragment,o),T(an.$$.fragment,o),T(na.$$.fragment,o),T(nn.$$.fragment,o),T(ln.$$.fragment,o),T(dn.$$.fragment,o),T(pn.$$.fragment,o),T(mn.$$.fragment,o),T(fn.$$.fragment,o),T(gn.$$.fragment,o),T(pa.$$.fragment,o),T(vn.$$.fragment,o),T(bn.$$.fragment,o),T(ma.$$.fragment,o),T(yn.$$.fragment,o),T(ha.$$.fragment,o),T(kn.$$.fragment,o),T(Tn.$$.fragment,o),T(xn.$$.fragment,o),T($n.$$.fragment,o),T(Wn.$$.fragment,o),T(Vn.$$.fragment,o),T(En.$$.fragment,o),T(Pn.$$.fragment,o),T(qn.$$.fragment,o),T(zn.$$.fragment,o),T(Mn.$$.fragment,o),T(Ln.$$.fragment,o),T(Bn.$$.fragment,o),T(ba.$$.fragment,o),T(wa.$$.fragment,o),T(Rn.$$.fragment,o),T(Un.$$.fragment,o),T(Jn.$$.fragment,o),T(ka.$$.fragment,o),T(Ta.$$.fragment,o),T(Zn.$$.fragment,o),T(Qn.$$.fragment,o),T(sr.$$.fragment,o),T($a.$$.fragment,o),T(ja.$$.fragment,o),T(nr.$$.fragment,o),T(rr.$$.fragment,o),T(mr.$$.fragment,o),T(Va.$$.fragment,o),T(Fa.$$.fragment,o),T(hr.$$.fragment,o),T(ur.$$.fragment,o),T(wr.$$.fragment,o),T(Ca.$$.fragment,o),T(Pa.$$.fragment,o),T(yr.$$.fragment,o),T(kr.$$.fragment,o),T(Wr.$$.fragment,o),T(Aa.$$.fragment,o),T(za.$$.fragment,o),T(Vr.$$.fragment,o),T(Fr.$$.fragment,o),T(La.$$.fragment,o),T(qr.$$.fragment,o),T(Oa.$$.fragment,o),T(Da.$$.fragment,o),T(Ar.$$.fragment,o),T(zr.$$.fragment,o),T(Ia.$$.fragment,o),T(Sr.$$.fragment,o),T(Na.$$.fragment,o),T(Ba.$$.fragment,o),T(Ir.$$.fragment,o),T(Nr.$$.fragment,o),T(Qr.$$.fragment,o),T(Ua.$$.fragment,o),T(Ha.$$.fragment,o),T(Yr.$$.fragment,o),T(ei.$$.fragment,o),T(ci.$$.fragment,o),T(Ga.$$.fragment,o),T(Ka.$$.fragment,o),T(di.$$.fragment,o),T(pi.$$.fragment,o),T(wi.$$.fragment,o),T(Za.$$.fragment,o),T(Qa.$$.fragment,o),em=!0)},o(o){x(l.$$.fragment,o),x(E.$$.fragment,o),x(B.$$.fragment,o),x(ue.$$.fragment,o),x(ys.$$.fragment,o),x(As.$$.fragment,o),x(zs.$$.fragment,o),x(Ko.$$.fragment,o),x(Ls.$$.fragment,o),x(Os.$$.fragment,o),x(Ss.$$.fragment,o),x(Is.$$.fragment,o),x(Ns.$$.fragment,o),x(Qo.$$.fragment,o),x(Rs.$$.fragment,o),x(Us.$$.fragment,o),x(Hs.$$.fragment,o),x(Gs.$$.fragment,o),x(Ks.$$.fragment,o),x(Js.$$.fragment,o),x(Qs.$$.fragment,o),x(tn.$$.fragment,o),x(on.$$.fragment,o),x(an.$$.fragment,o),x(na.$$.fragment,o),x(nn.$$.fragment,o),x(ln.$$.fragment,o),x(dn.$$.fragment,o),x(pn.$$.fragment,o),x(mn.$$.fragment,o),x(fn.$$.fragment,o),x(gn.$$.fragment,o),x(pa.$$.fragment,o),x(vn.$$.fragment,o),x(bn.$$.fragment,o),x(ma.$$.fragment,o),x(yn.$$.fragment,o),x(ha.$$.fragment,o),x(kn.$$.fragment,o),x(Tn.$$.fragment,o),x(xn.$$.fragment,o),x($n.$$.fragment,o),x(Wn.$$.fragment,o),x(Vn.$$.fragment,o),x(En.$$.fragment,o),x(Pn.$$.fragment,o),x(qn.$$.fragment,o),x(zn.$$.fragment,o),x(Mn.$$.fragment,o),x(Ln.$$.fragment,o),x(Bn.$$.fragment,o),x(ba.$$.fragment,o),x(wa.$$.fragment,o),x(Rn.$$.fragment,o),x(Un.$$.fragment,o),x(Jn.$$.fragment,o),x(ka.$$.fragment,o),x(Ta.$$.fragment,o),x(Zn.$$.fragment,o),x(Qn.$$.fragment,o),x(sr.$$.fragment,o),x($a.$$.fragment,o),x(ja.$$.fragment,o),x(nr.$$.fragment,o),x(rr.$$.fragment,o),x(mr.$$.fragment,o),x(Va.$$.fragment,o),x(Fa.$$.fragment,o),x(hr.$$.fragment,o),x(ur.$$.fragment,o),x(wr.$$.fragment,o),x(Ca.$$.fragment,o),x(Pa.$$.fragment,o),x(yr.$$.fragment,o),x(kr.$$.fragment,o),x(Wr.$$.fragment,o),x(Aa.$$.fragment,o),x(za.$$.fragment,o),x(Vr.$$.fragment,o),x(Fr.$$.fragment,o),x(La.$$.fragment,o),x(qr.$$.fragment,o),x(Oa.$$.fragment,o),x(Da.$$.fragment,o),x(Ar.$$.fragment,o),x(zr.$$.fragment,o),x(Ia.$$.fragment,o),x(Sr.$$.fragment,o),x(Na.$$.fragment,o),x(Ba.$$.fragment,o),x(Ir.$$.fragment,o),x(Nr.$$.fragment,o),x(Qr.$$.fragment,o),x(Ua.$$.fragment,o),x(Ha.$$.fragment,o),x(Yr.$$.fragment,o),x(ei.$$.fragment,o),x(ci.$$.fragment,o),x(Ga.$$.fragment,o),x(Ka.$$.fragment,o),x(di.$$.fragment,o),x(pi.$$.fragment,o),x(wi.$$.fragment,o),x(Za.$$.fragment,o),x(Qa.$$.fragment,o),em=!1},d(o){t(m),o&&t(b),o&&t(f),$(l),o&&t(L),o&&t(A),$(E),o&&t(K),o&&t(S),o&&t(X),o&&t(J),o&&t(We),o&&t(Z),o&&t(Ie),o&&t(D),o&&t(tt),o&&t(ae),o&&t(ot),o&&t(we),o&&t(at),o&&t(Y),$(B),o&&t(st),o&&t(j),o&&t(Nt),$(ue,o),o&&t(Bt),o&&t(ke),o&&t(cp),$(ys,o),o&&t(dp),o&&t(Te),o&&t(pp),o&&t(qi),o&&t(mp),o&&t(Ai),o&&t(hp),o&&t(lo),$(As),o&&t(up),o&&t(Ye),$(zs),$(Ko),o&&t(fp),o&&t(mo),$(Ls),o&&t(gp),o&&t(ne),$(Os),$(Ss),$(Is),$(Ns),$(Qo),$(Rs),o&&t(_p),o&&t(ho),$(Us),o&&t(vp),o&&t(et),$(Hs),$(Gs),o&&t(bp),o&&t(uo),$(Ks),o&&t(wp),o&&t(G),$(Js),$(Qs),$(tn),$(on),$(an),$(na),$(nn),$(ln),o&&t(yp),o&&t(fo),$(dn),o&&t(kp),o&&t(te),$(pn),$(mn),$(fn),$(gn),$(pa),$(vn),$(bn),$(ma),$(yn),$(ha),o&&t(Tp),o&&t(go),$(kn),o&&t(xp),o&&t(xe),o&&t($p),$(Tn,o),o&&t(jp),o&&t(_o),$(xn),o&&t(Wp),o&&t(vo),$($n),o&&t(Vp),o&&t(bo),$(Wn),o&&t(Fp),o&&t(wo),$(Vn),o&&t(Ep),o&&t(Mt),$(En),$(Pn),o&&t(Cp),o&&t(Lt),$(qn),$(zn),o&&t(Pp),o&&t(yo),$(Mn),o&&t(qp),o&&t(ze),$(Ln),$(Bn),$(ba),$(wa),o&&t(Ap),o&&t(To),$(Rn),o&&t(zp),o&&t(Me),$(Un),$(Jn),$(ka),$(Ta),o&&t(Mp),o&&t(jo),$(Zn),o&&t(Lp),o&&t(fe),$(Qn),$(sr),$($a),$(ja),o&&t(Op),o&&t(Vo),$(nr),o&&t(Dp),o&&t(ge),$(rr),$(mr),$(Va),$(Fa),o&&t(Sp),o&&t(Eo),$(hr),o&&t(Ip),o&&t(_e),$(ur),$(wr),$(Ca),$(Pa),o&&t(Np),o&&t(Po),$(yr),o&&t(Bp),o&&t(Le),$(kr),$(Wr),$(Aa),$(za),o&&t(Rp),o&&t(zo),$(Vr),o&&t(Up),o&&t(ve),$(Fr),$(La),$(qr),$(Oa),$(Da),o&&t(Hp),o&&t(Lo),$(Ar),o&&t(Xp),o&&t(be),$(zr),$(Ia),$(Sr),$(Na),$(Ba),o&&t(Gp),o&&t(Do),$(Ir),o&&t(Kp),o&&t(re),$(Nr),$(Qr),$(Ua),$(Ha),o&&t(Jp),o&&t(Io),$(Yr),o&&t(Zp),o&&t(ie),$(ei),$(ci),$(Ga),$(Ka),o&&t(Qp),o&&t(Ro),$(di),o&&t(Yp),o&&t(le),$(pi),$(wi),$(Za),$(Qa)}}}const Ax={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.TFWav2Vec2ForCTC",title:"TFWav2Vec2ForCTC"},{local:"transformers.FlaxWav2Vec2Model",title:"FlaxWav2Vec2Model"},{local:"transformers.FlaxWav2Vec2ForCTC",title:"FlaxWav2Vec2ForCTC"},{local:"transformers.FlaxWav2Vec2ForPreTraining",title:"FlaxWav2Vec2ForPreTraining"}],title:"Wav2Vec2"};function zx(W){return ox(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Bx extends QT{constructor(m){super();YT(this,m,zx,qx,ex,{})}}export{Bx as default,Ax as metadata};
