import{s as Es,o as Ps,n as L}from"../chunks/scheduler.25b97de1.js";import{S as Qs,i as Ss,g as c,s as r,r as u,A as As,h as d,f as s,c as l,j as C,u as f,x as m,k as $,l as Ds,y as a,a as p,v as g,d as _,t as v,w as b}from"../chunks/index.d9030fc9.js";import{T as pt}from"../chunks/Tip.baa67368.js";import{D as F}from"../chunks/Docstring.e257edda.js";import{C as at}from"../chunks/CodeBlock.e6cd0d95.js";import{F as Os,M as ws}from"../chunks/Markdown.7217f838.js";import{E as Zt}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{P as Ls}from"../chunks/PipelineTag.5f100392.js";import{H as dt,E as Ks}from"../chunks/EditOnGithub.91d95064.js";function er(W){let t,y="Example:",n,i,M;return i=new at({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFdhdjJWZWMyQ29uZmlnJTJDJTIwV2F2MlZlYzJNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBXYXYyVmVjMiUyMGZhY2Vib29rJTJGd2F2MnZlYzItYmFzZS05NjBoJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMFdhdjJWZWMyQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMGZhY2Vib29rJTJGd2F2MnZlYzItYmFzZS05NjBoJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBXYXYyVmVjMk1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2Config, Wav2Vec2Model

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the facebook/wav2vec2-base-960h style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2Model(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){t=c("p"),t.textContent=y,n=r(),u(i.$$.fragment)},l(o){t=d(o,"P",{"data-svelte-h":!0}),m(t)!=="svelte-11lpom8"&&(t.textContent=y),n=l(o),f(i.$$.fragment,o)},m(o,T){p(o,t,T),p(o,n,T),g(i,o,T),M=!0},p:L,i(o){M||(_(i.$$.fragment,o),M=!0)},o(o){v(i.$$.fragment,o),M=!1},d(o){o&&(s(t),s(n)),b(i,o)}}}function tr(W){let t,y="Example:",n,i,M;return i=new at({props:{code:"JTIzJTIwTGV0J3MlMjBzZWUlMjBob3clMjB0byUyMHJldHJpZXZlJTIwdGltZSUyMHN0ZXBzJTIwZm9yJTIwYSUyMG1vZGVsJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvRmVhdHVyZUV4dHJhY3RvciUyQyUyMEF1dG9Nb2RlbEZvckNUQyUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQWltcG9ydCUyMGRhdGFzZXRzJTBBaW1wb3J0JTIwdG9yY2glMEElMEElMjMlMjBpbXBvcnQlMjBtb2RlbCUyQyUyMGZlYXR1cmUlMjBleHRyYWN0b3IlMkMlMjB0b2tlbml6ZXIlMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNUQy5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3YXYydmVjMi1iYXNlLTk2MGglMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3YXYydmVjMi1iYXNlLTk2MGglMjIpJTBBZmVhdHVyZV9leHRyYWN0b3IlMjAlM0QlMjBBdXRvRmVhdHVyZUV4dHJhY3Rvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3YXYydmVjMi1iYXNlLTk2MGglMjIpJTBBJTBBJTIzJTIwbG9hZCUyMGZpcnN0JTIwc2FtcGxlJTIwb2YlMjBFbmdsaXNoJTIwY29tbW9uX3ZvaWNlJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJtb3ppbGxhLWZvdW5kYXRpb24lMkZjb21tb25fdm9pY2VfMTFfMCUyMiUyQyUyMCUyMmVuJTIyJTJDJTIwc3BsaXQlM0QlMjJ0cmFpbiUyMiUyQyUyMHN0cmVhbWluZyUzRFRydWUpJTBBZGF0YXNldCUyMCUzRCUyMGRhdGFzZXQuY2FzdF9jb2x1bW4oJTIyYXVkaW8lMjIlMkMlMjBkYXRhc2V0cy5BdWRpbyhzYW1wbGluZ19yYXRlJTNEMTZfMDAwKSklMEFkYXRhc2V0X2l0ZXIlMjAlM0QlMjBpdGVyKGRhdGFzZXQpJTBBc2FtcGxlJTIwJTNEJTIwbmV4dChkYXRhc2V0X2l0ZXIpJTBBJTBBJTIzJTIwZm9yd2FyZCUyMHNhbXBsZSUyMHRocm91Z2glMjBtb2RlbCUyMHRvJTIwZ2V0JTIwZ3JlZWRpbHklMjBwcmVkaWN0ZWQlMjB0cmFuc2NyaXB0aW9uJTIwaWRzJTBBaW5wdXRfdmFsdWVzJTIwJTNEJTIwZmVhdHVyZV9leHRyYWN0b3Ioc2FtcGxlJTVCJTIyYXVkaW8lMjIlNUQlNUIlMjJhcnJheSUyMiU1RCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLmlucHV0X3ZhbHVlcyUwQWxvZ2l0cyUyMCUzRCUyMG1vZGVsKGlucHV0X3ZhbHVlcykubG9naXRzJTVCMCU1RCUwQXByZWRfaWRzJTIwJTNEJTIwdG9yY2guYXJnbWF4KGxvZ2l0cyUyQyUyMGF4aXMlM0QtMSklMEElMEElMjMlMjByZXRyaWV2ZSUyMHdvcmQlMjBzdGFtcHMlMjAoYW5hbG9nb3VzJTIwY29tbWFuZHMlMjBmb3IlMjAlNjBvdXRwdXRfY2hhcl9vZmZzZXRzJTYwKSUwQW91dHB1dHMlMjAlM0QlMjB0b2tlbml6ZXIuZGVjb2RlKHByZWRfaWRzJTJDJTIwb3V0cHV0X3dvcmRfb2Zmc2V0cyUzRFRydWUpJTBBJTIzJTIwY29tcHV0ZSUyMCU2MHRpbWVfb2Zmc2V0JTYwJTIwaW4lMjBzZWNvbmRzJTIwYXMlMjBwcm9kdWN0JTIwb2YlMjBkb3duc2FtcGxpbmclMjByYXRpbyUyMGFuZCUyMHNhbXBsaW5nX3JhdGUlMEF0aW1lX29mZnNldCUyMCUzRCUyMG1vZGVsLmNvbmZpZy5pbnB1dHNfdG9fbG9naXRzX3JhdGlvJTIwJTJGJTIwZmVhdHVyZV9leHRyYWN0b3Iuc2FtcGxpbmdfcmF0ZSUwQSUwQXdvcmRfb2Zmc2V0cyUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMndvcmQlMjIlM0ElMjBkJTVCJTIyd29yZCUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnN0YXJ0X3RpbWUlMjIlM0ElMjByb3VuZChkJTVCJTIyc3RhcnRfb2Zmc2V0JTIyJTVEJTIwKiUyMHRpbWVfb2Zmc2V0JTJDJTIwMiklMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJlbmRfdGltZSUyMiUzQSUyMHJvdW5kKGQlNUIlMjJlbmRfb2Zmc2V0JTIyJTVEJTIwKiUyMHRpbWVfb2Zmc2V0JTJDJTIwMiklMkMlMEElMjAlMjAlMjAlMjAlN0QlMEElMjAlMjAlMjAlMjBmb3IlMjBkJTIwaW4lMjBvdXRwdXRzLndvcmRfb2Zmc2V0cyUwQSU1RCUwQSUyMyUyMGNvbXBhcmUlMjB3b3JkJTIwb2Zmc2V0cyUyMHdpdGglMjBhdWRpbyUyMCU2MGVuX3RyYWluXzAlMkZjb21tb25fdm9pY2VfZW5fMTkxMjE1NTMubXAzJTYwJTIwb25saW5lJTIwb24lMjB0aGUlMjBkYXRhc2V0JTIwdmlld2VyJTNBJTBBJTIzJTIwaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGbW96aWxsYS1mb3VuZGF0aW9uJTJGY29tbW9uX3ZvaWNlXzExXzAlMkZ2aWV3ZXIlMkZlbiUwQXdvcmRfb2Zmc2V0cyU1QiUzQTMlNUQ=",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;mozilla-foundation/common_voice_11_0&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 \`en_train_0/common_voice_en_19121553.mp3\` online on the dataset viewer:</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># https://huggingface.co/datasets/mozilla-foundation/common_voice_11_0/viewer/en</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;THE&#x27;</span>, <span class="hljs-string">&#x27;start_time&#x27;</span>: <span class="hljs-number">0.7</span>, <span class="hljs-string">&#x27;end_time&#x27;</span>: <span class="hljs-number">0.78</span>}, {<span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;TRICK&#x27;</span>, <span class="hljs-string">&#x27;start_time&#x27;</span>: <span class="hljs-number">0.88</span>, <span class="hljs-string">&#x27;end_time&#x27;</span>: <span class="hljs-number">1.08</span>}, {<span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;APPEARS&#x27;</span>, <span class="hljs-string">&#x27;start_time&#x27;</span>: <span class="hljs-number">1.2</span>, <span class="hljs-string">&#x27;end_time&#x27;</span>: <span class="hljs-number">1.64</span>}]`,wrap:!1}}),{c(){t=c("p"),t.textContent=y,n=r(),u(i.$$.fragment)},l(o){t=d(o,"P",{"data-svelte-h":!0}),m(t)!=="svelte-11lpom8"&&(t.textContent=y),n=l(o),f(i.$$.fragment,o)},m(o,T){p(o,t,T),p(o,n,T),g(i,o,T),M=!0},p:L,i(o){M||(_(i.$$.fragment,o),M=!0)},o(o){v(i.$$.fragment,o),M=!1},d(o){o&&(s(t),s(n)),b(i,o)}}}function or(W){let t,y=`This class method is simply calling <a href="/docs/transformers/pr_30674/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.save_pretrained">save_pretrained()</a> and
<a href="/docs/transformers/pr_30674/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.save_pretrained">save_pretrained()</a>. Please refer to the docstrings of the
methods above for more information.`;return{c(){t=c("p"),t.innerHTML=y},l(n){t=d(n,"P",{"data-svelte-h":!0}),m(t)!=="svelte-1nsavru"&&(t.innerHTML=y)},m(n,i){p(n,t,i)},p:L,d(n){n&&s(t)}}}function ar(W){let t,y=`This class method is simply calling the feature extractor’s
<a href="/docs/transformers/pr_30674/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.from_pretrained">from_pretrained()</a>, Wav2Vec2CTCTokenizer’s
<a href="/docs/transformers/pr_30674/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.from_pretrained">from_pretrained()</a>, and
<code>pyctcdecode.BeamSearchDecoderCTC.load_from_hf_hub</code>.`,n,i,M="Please refer to the docstrings of the methods above for more information.";return{c(){t=c("p"),t.innerHTML=y,n=r(),i=c("p"),i.textContent=M},l(o){t=d(o,"P",{"data-svelte-h":!0}),m(t)!=="svelte-1y6fcse"&&(t.innerHTML=y),n=l(o),i=d(o,"P",{"data-svelte-h":!0}),m(i)!=="svelte-1v5a8ev"&&(i.textContent=M)},m(o,T){p(o,t,T),p(o,n,T),p(o,i,T)},p:L,d(o){o&&(s(t),s(n),s(i))}}}function nr(W){let t,y=`This function makes use of Python’s multiprocessing. Currently, multiprocessing is available only on Unix
systems (see this <a href="https://github.com/kensho-technologies/pyctcdecode/issues/65" rel="nofollow">issue</a>).`,n,i,M=`If you are decoding multiple batches, consider creating a <code>Pool</code> and passing it to <code>batch_decode</code>. Otherwise,
<code>batch_decode</code> will be very slow since it will create a fresh <code>Pool</code> for each call. See usage example below.`;return{c(){t=c("p"),t.innerHTML=y,n=r(),i=c("p"),i.innerHTML=M},l(o){t=d(o,"P",{"data-svelte-h":!0}),m(t)!=="svelte-mir1wd"&&(t.innerHTML=y),n=l(o),i=d(o,"P",{"data-svelte-h":!0}),m(i)!=="svelte-4v42s1"&&(i.innerHTML=M)},m(o,T){p(o,t,T),p(o,n,T),p(o,i,T)},p:L,d(o){o&&(s(t),s(n),s(i))}}}function sr(W){let t,y="Example:",n,i,M;return i=new at({props:{code:"JTIzJTIwTGV0J3MlMjBzZWUlMjBob3clMjB0byUyMHJldHJpZXZlJTIwdGltZSUyMHN0ZXBzJTIwZm9yJTIwYSUyMG1vZGVsJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvUHJvY2Vzc29yJTJDJTIwQXV0b01vZGVsRm9yQ1RDJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBaW1wb3J0JTIwZGF0YXNldHMlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQSUyMyUyMGltcG9ydCUyMG1vZGVsJTJDJTIwZmVhdHVyZSUyMGV4dHJhY3RvciUyQyUyMHRva2VuaXplciUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ1RDLmZyb21fcHJldHJhaW5lZCglMjJwYXRyaWNrdm9ucGxhdGVuJTJGd2F2MnZlYzItYmFzZS0xMDBoLXdpdGgtbG0lMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIycGF0cmlja3ZvbnBsYXRlbiUyRndhdjJ2ZWMyLWJhc2UtMTAwaC13aXRoLWxtJTIyKSUwQSUwQSUyMyUyMGxvYWQlMjBmaXJzdCUyMHNhbXBsZSUyMG9mJTIwRW5nbGlzaCUyMGNvbW1vbl92b2ljZSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIybW96aWxsYS1mb3VuZGF0aW9uJTJGY29tbW9uX3ZvaWNlXzExXzAlMjIlMkMlMjAlMjJlbiUyMiUyQyUyMHNwbGl0JTNEJTIydHJhaW4lMjIlMkMlMjBzdHJlYW1pbmclM0RUcnVlKSUwQWRhdGFzZXQlMjAlM0QlMjBkYXRhc2V0LmNhc3RfY29sdW1uKCUyMmF1ZGlvJTIyJTJDJTIwZGF0YXNldHMuQXVkaW8oc2FtcGxpbmdfcmF0ZSUzRDE2XzAwMCkpJTBBZGF0YXNldF9pdGVyJTIwJTNEJTIwaXRlcihkYXRhc2V0KSUwQXNhbXBsZSUyMCUzRCUyMG5leHQoZGF0YXNldF9pdGVyKSUwQSUwQSUyMyUyMGZvcndhcmQlMjBzYW1wbGUlMjB0aHJvdWdoJTIwbW9kZWwlMjB0byUyMGdldCUyMGdyZWVkaWx5JTIwcHJlZGljdGVkJTIwdHJhbnNjcmlwdGlvbiUyMGlkcyUwQWlucHV0X3ZhbHVlcyUyMCUzRCUyMHByb2Nlc3NvcihzYW1wbGUlNUIlMjJhdWRpbyUyMiU1RCU1QiUyMmFycmF5JTIyJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikuaW5wdXRfdmFsdWVzJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKGlucHV0X3ZhbHVlcykubG9naXRzJTVCMCU1RC5jcHUoKS5udW1weSgpJTBBJTBBJTIzJTIwcmV0cmlldmUlMjB3b3JkJTIwc3RhbXBzJTIwKGFuYWxvZ291cyUyMGNvbW1hbmRzJTIwZm9yJTIwJTYwb3V0cHV0X2NoYXJfb2Zmc2V0cyU2MCklMEFvdXRwdXRzJTIwJTNEJTIwcHJvY2Vzc29yLmRlY29kZShsb2dpdHMlMkMlMjBvdXRwdXRfd29yZF9vZmZzZXRzJTNEVHJ1ZSklMEElMjMlMjBjb21wdXRlJTIwJTYwdGltZV9vZmZzZXQlNjAlMjBpbiUyMHNlY29uZHMlMjBhcyUyMHByb2R1Y3QlMjBvZiUyMGRvd25zYW1wbGluZyUyMHJhdGlvJTIwYW5kJTIwc2FtcGxpbmdfcmF0ZSUwQXRpbWVfb2Zmc2V0JTIwJTNEJTIwbW9kZWwuY29uZmlnLmlucHV0c190b19sb2dpdHNfcmF0aW8lMjAlMkYlMjBwcm9jZXNzb3IuZmVhdHVyZV9leHRyYWN0b3Iuc2FtcGxpbmdfcmF0ZSUwQSUwQXdvcmRfb2Zmc2V0cyUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMndvcmQlMjIlM0ElMjBkJTVCJTIyd29yZCUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnN0YXJ0X3RpbWUlMjIlM0ElMjByb3VuZChkJTVCJTIyc3RhcnRfb2Zmc2V0JTIyJTVEJTIwKiUyMHRpbWVfb2Zmc2V0JTJDJTIwMiklMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJlbmRfdGltZSUyMiUzQSUyMHJvdW5kKGQlNUIlMjJlbmRfb2Zmc2V0JTIyJTVEJTIwKiUyMHRpbWVfb2Zmc2V0JTJDJTIwMiklMkMlMEElMjAlMjAlMjAlMjAlN0QlMEElMjAlMjAlMjAlMjBmb3IlMjBkJTIwaW4lMjBvdXRwdXRzLndvcmRfb2Zmc2V0cyUwQSU1RCUwQSUyMyUyMGNvbXBhcmUlMjB3b3JkJTIwb2Zmc2V0cyUyMHdpdGglMjBhdWRpbyUyMCU2MGVuX3RyYWluXzAlMkZjb21tb25fdm9pY2VfZW5fMTkxMjE1NTMubXAzJTYwJTIwb25saW5lJTIwb24lMjB0aGUlMjBkYXRhc2V0JTIwdmlld2VyJTNBJTBBJTIzJTIwaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGbW96aWxsYS1mb3VuZGF0aW9uJTJGY29tbW9uX3ZvaWNlXzExXzAlMkZ2aWV3ZXIlMkZlbiUwQXdvcmRfb2Zmc2V0cyU1QiUzQTQlNUQ=",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;mozilla-foundation/common_voice_11_0&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 \`en_train_0/common_voice_en_19121553.mp3\` online on the dataset viewer:</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># https://huggingface.co/datasets/mozilla-foundation/common_voice_11_0/viewer/en</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;THE&#x27;</span>, <span class="hljs-string">&#x27;start_time&#x27;</span>: <span class="hljs-number">0.68</span>, <span class="hljs-string">&#x27;end_time&#x27;</span>: <span class="hljs-number">0.78</span>}, {<span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;TRACK&#x27;</span>, <span class="hljs-string">&#x27;start_time&#x27;</span>: <span class="hljs-number">0.88</span>, <span class="hljs-string">&#x27;end_time&#x27;</span>: <span class="hljs-number">1.1</span>}, {<span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;APPEARS&#x27;</span>, <span class="hljs-string">&#x27;start_time&#x27;</span>: <span class="hljs-number">1.18</span>, <span class="hljs-string">&#x27;end_time&#x27;</span>: <span class="hljs-number">1.66</span>}, {<span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;ON&#x27;</span>, <span class="hljs-string">&#x27;start_time&#x27;</span>: <span class="hljs-number">1.86</span>, <span class="hljs-string">&#x27;end_time&#x27;</span>: <span class="hljs-number">1.92</span>}]`,wrap:!1}}),{c(){t=c("p"),t.textContent=y,n=r(),u(i.$$.fragment)},l(o){t=d(o,"P",{"data-svelte-h":!0}),m(t)!=="svelte-11lpom8"&&(t.textContent=y),n=l(o),f(i.$$.fragment,o)},m(o,T){p(o,t,T),p(o,n,T),g(i,o,T),M=!0},p:L,i(o){M||(_(i.$$.fragment,o),M=!0)},o(o){v(i.$$.fragment,o),M=!1},d(o){o&&(s(t),s(n)),b(i,o)}}}function rr(W){let t,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=c("p"),t.innerHTML=y},l(n){t=d(n,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(n,i){p(n,t,i)},p:L,d(n){n&&s(t)}}}function lr(W){let t,y="Example:",n,i,M;return i=new at({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBXYXYyVmVjMk1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmhmLWludGVybmFsLXRlc3RpbmclMkZsaWJyaXNwZWVjaF9hc3JfZGVtbyUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWRhdGFzZXQlMjAlM0QlMjBkYXRhc2V0LnNvcnQoJTIyaWQlMjIpJTBBc2FtcGxpbmdfcmF0ZSUyMCUzRCUyMGRhdGFzZXQuZmVhdHVyZXMlNUIlMjJhdWRpbyUyMiU1RC5zYW1wbGluZ19yYXRlJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3YXYydmVjMi1iYXNlLTk2MGglMjIpJTBBbW9kZWwlMjAlM0QlMjBXYXYyVmVjMk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRndhdjJ2ZWMyLWJhc2UtOTYwaCUyMiklMEElMEElMjMlMjBhdWRpbyUyMGZpbGUlMjBpcyUyMGRlY29kZWQlMjBvbiUyMHRoZSUyMGZseSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihkYXRhc2V0JTVCMCU1RCU1QiUyMmF1ZGlvJTIyJTVEJTVCJTIyYXJyYXklMjIlNUQlMkMlMjBzYW1wbGluZ19yYXRlJTNEc2FtcGxpbmdfcmF0ZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBbGlzdChsYXN0X2hpZGRlbl9zdGF0ZXMuc2hhcGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, Wav2Vec2Model
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">292</span>, <span class="hljs-number">768</span>]`,wrap:!1}}),{c(){t=c("p"),t.textContent=y,n=r(),u(i.$$.fragment)},l(o){t=d(o,"P",{"data-svelte-h":!0}),m(t)!=="svelte-11lpom8"&&(t.textContent=y),n=l(o),f(i.$$.fragment,o)},m(o,T){p(o,t,T),p(o,n,T),g(i,o,T),M=!0},p:L,i(o){M||(_(i.$$.fragment,o),M=!0)},o(o){v(i.$$.fragment,o),M=!1},d(o){o&&(s(t),s(n)),b(i,o)}}}function ir(W){let t,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=c("p"),t.innerHTML=y},l(n){t=d(n,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(n,i){p(n,t,i)},p:L,d(n){n&&s(t)}}}function cr(W){let t,y="Example:",n,i,M;return i=new at({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBXYXYyVmVjMkZvckNUQyUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJoZi1pbnRlcm5hbC10ZXN0aW5nJTJGbGlicmlzcGVlY2hfYXNyX2RlbW8lMjIlMkMlMjAlMjJjbGVhbiUyMiUyQyUyMHNwbGl0JTNEJTIydmFsaWRhdGlvbiUyMiklMEFkYXRhc2V0JTIwJTNEJTIwZGF0YXNldC5zb3J0KCUyMmlkJTIyKSUwQXNhbXBsaW5nX3JhdGUlMjAlM0QlMjBkYXRhc2V0LmZlYXR1cmVzJTVCJTIyYXVkaW8lMjIlNUQuc2FtcGxpbmdfcmF0ZSUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGd2F2MnZlYzItYmFzZS05NjBoJTIyKSUwQW1vZGVsJTIwJTNEJTIwV2F2MlZlYzJGb3JDVEMuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGd2F2MnZlYzItYmFzZS05NjBoJTIyKSUwQSUwQSUyMyUyMGF1ZGlvJTIwZmlsZSUyMGlzJTIwZGVjb2RlZCUyMG9uJTIwdGhlJTIwZmx5JTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGRhdGFzZXQlNUIwJTVEJTVCJTIyYXVkaW8lMjIlNUQlNUIlMjJhcnJheSUyMiU1RCUyQyUyMHNhbXBsaW5nX3JhdGUlM0RzYW1wbGluZ19yYXRlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQXByZWRpY3RlZF9pZHMlMjAlM0QlMjB0b3JjaC5hcmdtYXgobG9naXRzJTJDJTIwZGltJTNELTEpJTBBJTBBJTIzJTIwdHJhbnNjcmliZSUyMHNwZWVjaCUwQXRyYW5zY3JpcHRpb24lMjAlM0QlMjBwcm9jZXNzb3IuYmF0Y2hfZGVjb2RlKHByZWRpY3RlZF9pZHMpJTBBdHJhbnNjcmlwdGlvbiU1QjAlNUQlMEElMEFpbnB1dHMlNUIlMjJsYWJlbHMlMjIlNUQlMjAlM0QlMjBwcm9jZXNzb3IodGV4dCUzRGRhdGFzZXQlNUIwJTVEJTVCJTIydGV4dCUyMiU1RCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLmlucHV0X2lkcyUwQSUwQSUyMyUyMGNvbXB1dGUlMjBsb3NzJTBBbG9zcyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb3NzJTBBcm91bmQobG9zcy5pdGVtKCklMkMlMjAyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, Wav2Vec2ForCTC
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute loss</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">53.48</span>`,wrap:!1}}),{c(){t=c("p"),t.textContent=y,n=r(),u(i.$$.fragment)},l(o){t=d(o,"P",{"data-svelte-h":!0}),m(t)!=="svelte-11lpom8"&&(t.textContent=y),n=l(o),f(i.$$.fragment,o)},m(o,T){p(o,t,T),p(o,n,T),g(i,o,T),M=!0},p:L,i(o){M||(_(i.$$.fragment,o),M=!0)},o(o){v(i.$$.fragment,o),M=!1},d(o){o&&(s(t),s(n)),b(i,o)}}}function dr(W){let t,y=`Activate the special <a href="https://huggingface.co/transformers/installation.html#offline-mode" rel="nofollow">“offline-mode”</a> to
use this method in a firewalled environment.`;return{c(){t=c("p"),t.innerHTML=y},l(n){t=d(n,"P",{"data-svelte-h":!0}),m(t)!=="svelte-13hahdn"&&(t.innerHTML=y)},m(n,i){p(n,t,i)},p:L,d(n){n&&s(t)}}}function pr(W){let t,y="Examples:",n,i,M;return i=new at({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFdhdjJWZWMyRm9yQ1RDJTJDJTIwQXV0b1Byb2Nlc3NvciUwQSUwQWNrcHQlMjAlM0QlMjAlMjJmYWNlYm9vayUyRm1tcy0xYi1hbGwlMjIlMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZChja3B0KSUwQW1vZGVsJTIwJTNEJTIwV2F2MlZlYzJGb3JDVEMuZnJvbV9wcmV0cmFpbmVkKGNrcHQlMkMlMjB0YXJnZXRfbGFuZyUzRCUyMmVuZyUyMiklMEElMjMlMjBzZXQlMjBzcGVjaWZpYyUyMGxhbmd1YWdlJTBBcHJvY2Vzc29yLnRva2VuaXplci5zZXRfdGFyZ2V0X2xhbmcoJTIyc3BhJTIyKSUwQW1vZGVsLmxvYWRfYWRhcHRlciglMjJzcGElMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2ForCTC, AutoProcessor

<span class="hljs-meta">&gt;&gt;&gt; </span>ckpt = <span class="hljs-string">&quot;facebook/mms-1b-all&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(ckpt)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Wav2Vec2ForCTC.from_pretrained(ckpt, target_lang=<span class="hljs-string">&quot;eng&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># set specific language</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>processor.tokenizer.set_target_lang(<span class="hljs-string">&quot;spa&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.load_adapter(<span class="hljs-string">&quot;spa&quot;</span>)`,wrap:!1}}),{c(){t=c("p"),t.textContent=y,n=r(),u(i.$$.fragment)},l(o){t=d(o,"P",{"data-svelte-h":!0}),m(t)!=="svelte-kvfsh7"&&(t.textContent=y),n=l(o),f(i.$$.fragment,o)},m(o,T){p(o,t,T),p(o,n,T),g(i,o,T),M=!0},p:L,i(o){M||(_(i.$$.fragment,o),M=!0)},o(o){v(i.$$.fragment,o),M=!1},d(o){o&&(s(t),s(n)),b(i,o)}}}function mr(W){let t,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=c("p"),t.innerHTML=y},l(n){t=d(n,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(n,i){p(n,t,i)},p:L,d(n){n&&s(t)}}}function hr(W){let t,y="Example:",n,i,M;return i=new at({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yJTJDJTIwV2F2MlZlYzJGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBaW1wb3J0JTIwdG9yY2glMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmhmLWludGVybmFsLXRlc3RpbmclMkZsaWJyaXNwZWVjaF9hc3JfZGVtbyUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWRhdGFzZXQlMjAlM0QlMjBkYXRhc2V0LnNvcnQoJTIyaWQlMjIpJTBBc2FtcGxpbmdfcmF0ZSUyMCUzRCUyMGRhdGFzZXQuZmVhdHVyZXMlNUIlMjJhdWRpbyUyMiU1RC5zYW1wbGluZ19yYXRlJTBBJTBBZmVhdHVyZV9leHRyYWN0b3IlMjAlM0QlMjBBdXRvRmVhdHVyZUV4dHJhY3Rvci5mcm9tX3ByZXRyYWluZWQoJTIyc3VwZXJiJTJGd2F2MnZlYzItYmFzZS1zdXBlcmIta3MlMjIpJTBBbW9kZWwlMjAlM0QlMjBXYXYyVmVjMkZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMnN1cGVyYiUyRndhdjJ2ZWMyLWJhc2Utc3VwZXJiLWtzJTIyKSUwQSUwQSUyMyUyMGF1ZGlvJTIwZmlsZSUyMGlzJTIwZGVjb2RlZCUyMG9uJTIwdGhlJTIwZmx5JTBBaW5wdXRzJTIwJTNEJTIwZmVhdHVyZV9leHRyYWN0b3IoZGF0YXNldCU1QjAlNUQlNUIlMjJhdWRpbyUyMiU1RCU1QiUyMmFycmF5JTIyJTVEJTJDJTIwc2FtcGxpbmdfcmF0ZSUzRHNhbXBsaW5nX3JhdGUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX2NsYXNzX2lkcyUyMCUzRCUyMHRvcmNoLmFyZ21heChsb2dpdHMlMkMlMjBkaW0lM0QtMSkuaXRlbSgpJTBBcHJlZGljdGVkX2xhYmVsJTIwJTNEJTIwbW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2NsYXNzX2lkcyU1RCUwQXByZWRpY3RlZF9sYWJlbCUwQSUwQSUyMyUyMGNvbXB1dGUlMjBsb3NzJTIwLSUyMHRhcmdldF9sYWJlbCUyMGlzJTIwZS5nLiUyMCUyMmRvd24lMjIlMEF0YXJnZXRfbGFiZWwlMjAlM0QlMjBtb2RlbC5jb25maWcuaWQybGFiZWwlNUIwJTVEJTBBaW5wdXRzJTVCJTIybGFiZWxzJTIyJTVEJTIwJTNEJTIwdG9yY2gudGVuc29yKCU1Qm1vZGVsLmNvbmZpZy5sYWJlbDJpZCU1QnRhcmdldF9sYWJlbCU1RCU1RCklMEFsb3NzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvc3MlMEFyb3VuZChsb3NzLml0ZW0oKSUyQyUyMDIp",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>`,wrap:!1}}),{c(){t=c("p"),t.textContent=y,n=r(),u(i.$$.fragment)},l(o){t=d(o,"P",{"data-svelte-h":!0}),m(t)!=="svelte-11lpom8"&&(t.textContent=y),n=l(o),f(i.$$.fragment,o)},m(o,T){p(o,t,T),p(o,n,T),g(i,o,T),M=!0},p:L,i(o){M||(_(i.$$.fragment,o),M=!0)},o(o){v(i.$$.fragment,o),M=!1},d(o){o&&(s(t),s(n)),b(i,o)}}}function ur(W){let t,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=c("p"),t.innerHTML=y},l(n){t=d(n,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(n,i){p(n,t,i)},p:L,d(n){n&&s(t)}}}function fr(W){let t,y="Example:",n,i,M;return i=new at({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yJTJDJTIwV2F2MlZlYzJGb3JBdWRpb0ZyYW1lQ2xhc3NpZmljYXRpb24lMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaGYtaW50ZXJuYWwtdGVzdGluZyUyRmxpYnJpc3BlZWNoX2Fzcl9kZW1vJTIyJTJDJTIwJTIyY2xlYW4lMjIlMkMlMjBzcGxpdCUzRCUyMnZhbGlkYXRpb24lMjIpJTBBZGF0YXNldCUyMCUzRCUyMGRhdGFzZXQuc29ydCglMjJpZCUyMiklMEFzYW1wbGluZ19yYXRlJTIwJTNEJTIwZGF0YXNldC5mZWF0dXJlcyU1QiUyMmF1ZGlvJTIyJTVELnNhbXBsaW5nX3JhdGUlMEElMEFmZWF0dXJlX2V4dHJhY3RvciUyMCUzRCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yLmZyb21fcHJldHJhaW5lZCglMjJhbnRvbi1sJTJGd2F2MnZlYzItYmFzZS1zdXBlcmItc2QlMjIpJTBBbW9kZWwlMjAlM0QlMjBXYXYyVmVjMkZvckF1ZGlvRnJhbWVDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyYW50b24tbCUyRndhdjJ2ZWMyLWJhc2Utc3VwZXJiLXNkJTIyKSUwQSUwQSUyMyUyMGF1ZGlvJTIwZmlsZSUyMGlzJTIwZGVjb2RlZCUyMG9uJTIwdGhlJTIwZmx5JTBBaW5wdXRzJTIwJTNEJTIwZmVhdHVyZV9leHRyYWN0b3IoZGF0YXNldCU1QjAlNUQlNUIlMjJhdWRpbyUyMiU1RCU1QiUyMmFycmF5JTIyJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUyQyUyMHNhbXBsaW5nX3JhdGUlM0RzYW1wbGluZ19yYXRlKSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJvYmFiaWxpdGllcyUyMCUzRCUyMHRvcmNoLnNpZ21vaWQobG9naXRzJTVCMCU1RCklMEElMjMlMjBsYWJlbHMlMjBpcyUyMGElMjBvbmUtaG90JTIwYXJyYXklMjBvZiUyMHNoYXBlJTIwKG51bV9mcmFtZXMlMkMlMjBudW1fc3BlYWtlcnMpJTBBbGFiZWxzJTIwJTNEJTIwKHByb2JhYmlsaXRpZXMlMjAlM0UlMjAwLjUpLmxvbmcoKSUwQWxhYmVscyU1QjAlNUQudG9saXN0KCk=",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>]`,wrap:!1}}),{c(){t=c("p"),t.textContent=y,n=r(),u(i.$$.fragment)},l(o){t=d(o,"P",{"data-svelte-h":!0}),m(t)!=="svelte-11lpom8"&&(t.textContent=y),n=l(o),f(i.$$.fragment,o)},m(o,T){p(o,t,T),p(o,n,T),g(i,o,T),M=!0},p:L,i(o){M||(_(i.$$.fragment,o),M=!0)},o(o){v(i.$$.fragment,o),M=!1},d(o){o&&(s(t),s(n)),b(i,o)}}}function gr(W){let t,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=c("p"),t.innerHTML=y},l(n){t=d(n,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(n,i){p(n,t,i)},p:L,d(n){n&&s(t)}}}function _r(W){let t,y="Example:",n,i,M;return i=new at({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yJTJDJTIwV2F2MlZlYzJGb3JYVmVjdG9yJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBaW1wb3J0JTIwdG9yY2glMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmhmLWludGVybmFsLXRlc3RpbmclMkZsaWJyaXNwZWVjaF9hc3JfZGVtbyUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWRhdGFzZXQlMjAlM0QlMjBkYXRhc2V0LnNvcnQoJTIyaWQlMjIpJTBBc2FtcGxpbmdfcmF0ZSUyMCUzRCUyMGRhdGFzZXQuZmVhdHVyZXMlNUIlMjJhdWRpbyUyMiU1RC5zYW1wbGluZ19yYXRlJTBBJTBBZmVhdHVyZV9leHRyYWN0b3IlMjAlM0QlMjBBdXRvRmVhdHVyZUV4dHJhY3Rvci5mcm9tX3ByZXRyYWluZWQoJTIyYW50b24tbCUyRndhdjJ2ZWMyLWJhc2Utc3VwZXJiLXN2JTIyKSUwQW1vZGVsJTIwJTNEJTIwV2F2MlZlYzJGb3JYVmVjdG9yLmZyb21fcHJldHJhaW5lZCglMjJhbnRvbi1sJTJGd2F2MnZlYzItYmFzZS1zdXBlcmItc3YlMjIpJTBBJTBBJTIzJTIwYXVkaW8lMjBmaWxlJTIwaXMlMjBkZWNvZGVkJTIwb24lMjB0aGUlMjBmbHklMEFpbnB1dHMlMjAlM0QlMjBmZWF0dXJlX2V4dHJhY3RvciglMEElMjAlMjAlMjAlMjAlNUJkJTVCJTIyYXJyYXklMjIlNUQlMjBmb3IlMjBkJTIwaW4lMjBkYXRhc2V0JTVCJTNBMiU1RCU1QiUyMmF1ZGlvJTIyJTVEJTVEJTJDJTIwc2FtcGxpbmdfcmF0ZSUzRHNhbXBsaW5nX3JhdGUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTIwcGFkZGluZyUzRFRydWUlMEEpJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGVtYmVkZGluZ3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykuZW1iZWRkaW5ncyUwQSUwQWVtYmVkZGluZ3MlMjAlM0QlMjB0b3JjaC5ubi5mdW5jdGlvbmFsLm5vcm1hbGl6ZShlbWJlZGRpbmdzJTJDJTIwZGltJTNELTEpLmNwdSgpJTBBJTBBJTIzJTIwdGhlJTIwcmVzdWx0aW5nJTIwZW1iZWRkaW5ncyUyMGNhbiUyMGJlJTIwdXNlZCUyMGZvciUyMGNvc2luZSUyMHNpbWlsYXJpdHktYmFzZWQlMjByZXRyaWV2YWwlMEFjb3NpbmVfc2ltJTIwJTNEJTIwdG9yY2gubm4uQ29zaW5lU2ltaWxhcml0eShkaW0lM0QtMSklMEFzaW1pbGFyaXR5JTIwJTNEJTIwY29zaW5lX3NpbShlbWJlZGRpbmdzJTVCMCU1RCUyQyUyMGVtYmVkZGluZ3MlNUIxJTVEKSUwQXRocmVzaG9sZCUyMCUzRCUyMDAuNyUyMCUyMCUyMyUyMHRoZSUyMG9wdGltYWwlMjB0aHJlc2hvbGQlMjBpcyUyMGRhdGFzZXQtZGVwZW5kZW50JTBBaWYlMjBzaW1pbGFyaXR5JTIwJTNDJTIwdGhyZXNob2xkJTNBJTBBJTIwJTIwJTIwJTIwcHJpbnQoJTIyU3BlYWtlcnMlMjBhcmUlMjBub3QlMjB0aGUlMjBzYW1lISUyMiklMEFyb3VuZChzaW1pbGFyaXR5Lml0ZW0oKSUyQyUyMDIp",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>`,wrap:!1}}),{c(){t=c("p"),t.textContent=y,n=r(),u(i.$$.fragment)},l(o){t=d(o,"P",{"data-svelte-h":!0}),m(t)!=="svelte-11lpom8"&&(t.textContent=y),n=l(o),f(i.$$.fragment,o)},m(o,T){p(o,t,T),p(o,n,T),g(i,o,T),M=!0},p:L,i(o){M||(_(i.$$.fragment,o),M=!0)},o(o){v(i.$$.fragment,o),M=!1},d(o){o&&(s(t),s(n)),b(i,o)}}}function vr(W){let t,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=c("p"),t.innerHTML=y},l(n){t=d(n,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(n,i){p(n,t,i)},p:L,d(n){n&&s(t)}}}function br(W){let t,y="Example:",n,i,M;return i=new at({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b0ZlYXR1cmVFeHRyYWN0b3IlMkMlMjBXYXYyVmVjMkZvclByZVRyYWluaW5nJTBBZnJvbSUyMHRyYW5zZm9ybWVycy5tb2RlbHMud2F2MnZlYzIubW9kZWxpbmdfd2F2MnZlYzIlMjBpbXBvcnQlMjBfY29tcHV0ZV9tYXNrX2luZGljZXMlMkMlMjBfc2FtcGxlX25lZ2F0aXZlX2luZGljZXMlMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFmZWF0dXJlX2V4dHJhY3RvciUyMCUzRCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRndhdjJ2ZWMyLWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBXYXYyVmVjMkZvclByZVRyYWluaW5nLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRndhdjJ2ZWMyLWJhc2UlMjIpJTBBJTBBZHMlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaGYtaW50ZXJuYWwtdGVzdGluZyUyRmxpYnJpc3BlZWNoX2Fzcl9kdW1teSUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWlucHV0X3ZhbHVlcyUyMCUzRCUyMGZlYXR1cmVfZXh0cmFjdG9yKGRzJTVCMCU1RCU1QiUyMmF1ZGlvJTIyJTVEJTVCJTIyYXJyYXklMjIlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5pbnB1dF92YWx1ZXMlMjAlMjAlMjMlMjBCYXRjaCUyMHNpemUlMjAxJTBBJTBBJTIzJTIwY29tcHV0ZSUyMG1hc2tlZCUyMGluZGljZXMlMEFiYXRjaF9zaXplJTJDJTIwcmF3X3NlcXVlbmNlX2xlbmd0aCUyMCUzRCUyMGlucHV0X3ZhbHVlcy5zaGFwZSUwQXNlcXVlbmNlX2xlbmd0aCUyMCUzRCUyMG1vZGVsLl9nZXRfZmVhdF9leHRyYWN0X291dHB1dF9sZW5ndGhzKHJhd19zZXF1ZW5jZV9sZW5ndGgpLml0ZW0oKSUwQW1hc2tfdGltZV9pbmRpY2VzJTIwJTNEJTIwX2NvbXB1dGVfbWFza19pbmRpY2VzKCUwQSUyMCUyMCUyMCUyMHNoYXBlJTNEKGJhdGNoX3NpemUlMkMlMjBzZXF1ZW5jZV9sZW5ndGgpJTJDJTIwbWFza19wcm9iJTNEMC4yJTJDJTIwbWFza19sZW5ndGglM0QyJTBBKSUwQXNhbXBsZWRfbmVnYXRpdmVfaW5kaWNlcyUyMCUzRCUyMF9zYW1wbGVfbmVnYXRpdmVfaW5kaWNlcyglMEElMjAlMjAlMjAlMjBmZWF0dXJlc19zaGFwZSUzRChiYXRjaF9zaXplJTJDJTIwc2VxdWVuY2VfbGVuZ3RoKSUyQyUwQSUyMCUyMCUyMCUyMG51bV9uZWdhdGl2ZXMlM0Rtb2RlbC5jb25maWcubnVtX25lZ2F0aXZlcyUyQyUwQSUyMCUyMCUyMCUyMG1hc2tfdGltZV9pbmRpY2VzJTNEbWFza190aW1lX2luZGljZXMlMkMlMEEpJTBBbWFza190aW1lX2luZGljZXMlMjAlM0QlMjB0b3JjaC50ZW5zb3IoZGF0YSUzRG1hc2tfdGltZV9pbmRpY2VzJTJDJTIwZGV2aWNlJTNEaW5wdXRfdmFsdWVzLmRldmljZSUyQyUyMGR0eXBlJTNEdG9yY2gubG9uZyklMEFzYW1wbGVkX25lZ2F0aXZlX2luZGljZXMlMjAlM0QlMjB0b3JjaC50ZW5zb3IoJTBBJTIwJTIwJTIwJTIwZGF0YSUzRHNhbXBsZWRfbmVnYXRpdmVfaW5kaWNlcyUyQyUyMGRldmljZSUzRGlucHV0X3ZhbHVlcy5kZXZpY2UlMkMlMjBkdHlwZSUzRHRvcmNoLmxvbmclMEEpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbChpbnB1dF92YWx1ZXMlMkMlMjBtYXNrX3RpbWVfaW5kaWNlcyUzRG1hc2tfdGltZV9pbmRpY2VzKSUwQSUwQSUyMyUyMGNvbXB1dGUlMjBjb3NpbmUlMjBzaW1pbGFyaXR5JTIwYmV0d2VlbiUyMHByZWRpY3RlZCUyMCglM0Rwcm9qZWN0ZWRfc3RhdGVzKSUyMGFuZCUyMHRhcmdldCUyMCglM0Rwcm9qZWN0ZWRfcXVhbnRpemVkX3N0YXRlcyklMEFjb3NpbmVfc2ltJTIwJTNEJTIwdG9yY2guY29zaW5lX3NpbWlsYXJpdHkob3V0cHV0cy5wcm9qZWN0ZWRfc3RhdGVzJTJDJTIwb3V0cHV0cy5wcm9qZWN0ZWRfcXVhbnRpemVkX3N0YXRlcyUyQyUyMGRpbSUzRC0xKSUwQSUwQSUyMyUyMHNob3clMjB0aGF0JTIwY29zaW5lJTIwc2ltaWxhcml0eSUyMGlzJTIwbXVjaCUyMGhpZ2hlciUyMHRoYW4lMjByYW5kb20lMEFjb3NpbmVfc2ltJTVCbWFza190aW1lX2luZGljZXMudG8odG9yY2guYm9vbCklNUQubWVhbigpJTIwJTNFJTIwMC41JTBBJTBBJTIzJTIwZm9yJTIwY29udHJhc3RpdmUlMjBsb3NzJTIwdHJhaW5pbmclMjBtb2RlbCUyMHNob3VsZCUyMGJlJTIwcHV0JTIwaW50byUyMHRyYWluJTIwbW9kZSUwQW1vZGVsJTIwJTNEJTIwbW9kZWwudHJhaW4oKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCglMEElMjAlMjAlMjAlMjBpbnB1dF92YWx1ZXMlMkMlMjBtYXNrX3RpbWVfaW5kaWNlcyUzRG1hc2tfdGltZV9pbmRpY2VzJTJDJTIwc2FtcGxlZF9uZWdhdGl2ZV9pbmRpY2VzJTNEc2FtcGxlZF9uZWdhdGl2ZV9pbmRpY2VzJTBBKS5sb3Nz",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`,wrap:!1}}),{c(){t=c("p"),t.textContent=y,n=r(),u(i.$$.fragment)},l(o){t=d(o,"P",{"data-svelte-h":!0}),m(t)!=="svelte-11lpom8"&&(t.textContent=y),n=l(o),f(i.$$.fragment,o)},m(o,T){p(o,t,T),p(o,n,T),g(i,o,T),M=!0},p:L,i(o){M||(_(i.$$.fragment,o),M=!0)},o(o){v(i.$$.fragment,o),M=!1},d(o){o&&(s(t),s(n)),b(i,o)}}}function yr(W){let t,y="## Wav2Vec2Model[[transformers.Wav2Vec2Model]]",n,i,M,o,T,Ce=`The bare Wav2Vec2 Model transformer outputting raw hidden-states without any specific head on top.
Wav2Vec2 was proposed in <a href="https://arxiv.org/abs/2006.11477" rel="nofollow">wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations</a> by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`,X,E,$e=`This model inherits from <a href="/docs/transformers/pr_30674/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`,G,P,Fe=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</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.`,V,z,Q,se,mt,Se='The <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2Model">Wav2Vec2Model</a> forward method, overrides the <code>__call__</code> special method.',K,_e,Ue,ee,Ze,de,Me="## Wav2Vec2ForCTC[[transformers.Wav2Vec2ForCTC]]",ht,B,te,oe,Ae,N=`Wav2Vec2 Model with a <code>language modeling</code> head on top for Connectionist Temporal Classification (CTC).
Wav2Vec2 was proposed in <a href="https://arxiv.org/abs/2006.11477" rel="nofollow">wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations</a> by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`,ae,Xe,ie=`This model inherits from <a href="/docs/transformers/pr_30674/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`,St,Ge,R=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</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.`,nt,ce,S,zt,Te,ze='The <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC">Wav2Vec2ForCTC</a> forward method, overrides the <code>__call__</code> special method.',st,Ye,je,ke,ut,I,pe,D,me,It="Load a language adapter model from a pre-trained adapter model.",ve,be,ft,q,De,H,rt,j,J,he,A,Bt=`Wav2Vec2 Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like
SUPERB Keyword Spotting.`,O,Y,Yt=`Wav2Vec2 was proposed in <a href="https://arxiv.org/abs/2006.11477" rel="nofollow">wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations</a> by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`,yt,gt,_o=`This model inherits from <a href="/docs/transformers/pr_30674/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`,wt,_t,vo=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</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.`,Mt,We,Tt,jt,ue,fe='The <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2ForSequenceClassification">Wav2Vec2ForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',kt,He,Ht,Wt,lt,Oe,vt,re,k,U,le,ye="Wav2Vec2 Model with a frame classification head on top for tasks like Speaker Diarization.",Re,Z,xe=`Wav2Vec2 was proposed in <a href="https://arxiv.org/abs/2006.11477" rel="nofollow">wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations</a> by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`,bo,Lt,pn=`This model inherits from <a href="/docs/transformers/pr_30674/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`,Oo,Et,mn=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</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.`,Ko,Ie,xt,ea,Pt,hn='The <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2ForAudioFrameClassification">Wav2Vec2ForAudioFrameClassification</a> forward method, overrides the <code>__call__</code> special method.',ta,Vt,ao,At,it,Jt,Bo,ge,yo,oa,Qt,un="Wav2Vec2 Model with an XVector feature extraction head on top for tasks like Speaker Verification.",aa,Ct,Za=`Wav2Vec2 was proposed in <a href="https://arxiv.org/abs/2006.11477" rel="nofollow">wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations</a> by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`,Dt,Xt,za=`This model inherits from <a href="/docs/transformers/pr_30674/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`,wo,Co,Ia=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</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.`,Ot,Ne,no,Mo,$o,na='The <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2ForXVector">Wav2Vec2ForXVector</a> forward method, overrides the <code>__call__</code> special method.',so,ro,Xo,Ve,Kt,lo,io,Ke,co,To,Fo,Ba=`Wav2Vec2 Model with a quantizer and <code>VQ</code> head on top.
Wav2Vec2 was proposed in <a href="https://arxiv.org/abs/2006.11477" rel="nofollow">wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations</a> by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`,eo,Gt,Xa=`This model inherits from <a href="/docs/transformers/pr_30674/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`,jo,Uo,sa=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</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.`,po,$t,to,ne,Rt,Ga='The <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2ForPreTraining">Wav2Vec2ForPreTraining</a> forward method, overrides the <code>__call__</code> special method.',ko,mo,ra,Ft,la;return M=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/pr_30674/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/pr_30674/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/vr_30674/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L1803"}}),Q=new F({props:{name:"forward",anchor:"transformers.Wav2Vec2Model.forward",parameters:[{name:"input_values",val:": Optional"},{name:"attention_mask",val:": Optional = None"},{name:"mask_time_indices",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/pr_30674/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/pr_30674/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/pr_30674/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L1893",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.modeling_outputs.Wav2Vec2BaseModelOutput"
>transformers.modeling_outputs.Wav2Vec2BaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_30674/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>) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.modeling_outputs.Wav2Vec2BaseModelOutput"
>transformers.modeling_outputs.Wav2Vec2BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),_e=new pt({props:{$$slots:{default:[rr]},$$scope:{ctx:W}}}),ee=new Zt({props:{anchor:"transformers.Wav2Vec2Model.forward.example",$$slots:{default:[lr]},$$scope:{ctx:W}}}),te=new F({props:{name:"class transformers.Wav2Vec2ForCTC",anchor:"transformers.Wav2Vec2ForCTC",parameters:[{name:"config",val:""},{name:"target_lang",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.Wav2Vec2ForCTC.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_30674/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/pr_30674/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.Wav2Vec2ForCTC.target_lang",description:`<strong>target_lang</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Language id of adapter weights. Adapter weights are stored in the format adapter.<lang>.safetensors or
adapter.<lang>.bin. Only relevant when using an instance of <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC">Wav2Vec2ForCTC</a> with adapters. Uses &#x2018;eng&#x2019; by
default.</lang></lang>`,name:"target_lang"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L2224"}}),S=new F({props:{name:"forward",anchor:"transformers.Wav2Vec2ForCTC.forward",parameters:[{name:"input_values",val:": Optional"},{name:"attention_mask",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"labels",val:": Optional = 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/pr_30674/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/pr_30674/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/pr_30674/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/vr_30674/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L2306",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30674/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/pr_30674/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) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


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

					</div>`,name:"revision"},{anchor:"transformers.Wav2Vec2ForCTC.load_adapter.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to accelerate downloads in China. If you are from China and have an accessibility
problem, you can set this option to resolve it. Note that we do not guarantee the timeliness or safety.
Please refer to the mirror site for more information.`,name:"mirror"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L1554"}}),be=new pt({props:{$$slots:{default:[dr]},$$scope:{ctx:W}}}),q=new Zt({props:{anchor:"transformers.Wav2Vec2ForCTC.load_adapter.example",$$slots:{default:[pr]},$$scope:{ctx:W}}}),H=new dt({props:{title:"Wav2Vec2ForSequenceClassification",local:"transformers.Wav2Vec2ForSequenceClassification",headingTag:"h2"}}),J=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/pr_30674/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/pr_30674/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/vr_30674/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L2385"}}),Tt=new F({props:{name:"forward",anchor:"transformers.Wav2Vec2ForSequenceClassification.forward",parameters:[{name:"input_values",val:": Optional"},{name:"attention_mask",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"labels",val:": Optional = 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/pr_30674/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/pr_30674/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/pr_30674/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/vr_30674/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L2437",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30674/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/pr_30674/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) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_30674/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),He=new pt({props:{$$slots:{default:[mr]},$$scope:{ctx:W}}}),Wt=new Zt({props:{anchor:"transformers.Wav2Vec2ForSequenceClassification.forward.example",$$slots:{default:[hr]},$$scope:{ctx:W}}}),Oe=new dt({props:{title:"Wav2Vec2ForAudioFrameClassification",local:"transformers.Wav2Vec2ForAudioFrameClassification",headingTag:"h2"}}),k=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/pr_30674/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/pr_30674/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/vr_30674/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L2508"}}),xt=new F({props:{name:"forward",anchor:"transformers.Wav2Vec2ForAudioFrameClassification.forward",parameters:[{name:"input_values",val:": Optional"},{name:"attention_mask",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/pr_30674/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/pr_30674/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/pr_30674/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/vr_30674/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L2558",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30674/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/pr_30674/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)  — Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_30674/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Vt=new pt({props:{$$slots:{default:[ur]},$$scope:{ctx:W}}}),At=new Zt({props:{anchor:"transformers.Wav2Vec2ForAudioFrameClassification.forward.example",$$slots:{default:[fr]},$$scope:{ctx:W}}}),Jt=new dt({props:{title:"Wav2Vec2ForXVector",local:"transformers.Wav2Vec2ForXVector",headingTag:"h2"}}),yo=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/pr_30674/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/pr_30674/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/vr_30674/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L2674"}}),no=new F({props:{name:"forward",anchor:"transformers.Wav2Vec2ForXVector.forward",parameters:[{name:"input_values",val:": Optional"},{name:"attention_mask",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"labels",val:": Optional = 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/pr_30674/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/pr_30674/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/pr_30674/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/vr_30674/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L2742",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30674/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/pr_30674/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) — Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.xvector_output_dim)</code>) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_30674/en/main_classes/output#transformers.modeling_outputs.XVectorOutput"
>transformers.modeling_outputs.XVectorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ro=new pt({props:{$$slots:{default:[gr]},$$scope:{ctx:W}}}),Ve=new Zt({props:{anchor:"transformers.Wav2Vec2ForXVector.forward.example",$$slots:{default:[_r]},$$scope:{ctx:W}}}),lo=new dt({props:{title:"Wav2Vec2ForPreTraining",local:"transformers.Wav2Vec2ForPreTraining",headingTag:"h2"}}),co=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/pr_30674/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/pr_30674/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/vr_30674/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L1954"}}),to=new F({props:{name:"forward",anchor:"transformers.Wav2Vec2ForPreTraining.forward",parameters:[{name:"input_values",val:": Optional"},{name:"attention_mask",val:": Optional = None"},{name:"mask_time_indices",val:": Optional = None"},{name:"sampled_negative_indices",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/pr_30674/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/pr_30674/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/pr_30674/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/vr_30674/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L2015",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30674/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/pr_30674/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>) — 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>) — 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>) — 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>) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForPreTrainingOutput"
>transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),mo=new pt({props:{$$slots:{default:[vr]},$$scope:{ctx:W}}}),Ft=new Zt({props:{anchor:"transformers.Wav2Vec2ForPreTraining.forward.example",$$slots:{default:[br]},$$scope:{ctx:W}}}),{c(){t=c("p"),t.textContent=y,n=r(),i=c("div"),u(M.$$.fragment),o=r(),T=c("p"),T.innerHTML=Ce,X=r(),E=c("p"),E.innerHTML=$e,G=r(),P=c("p"),P.innerHTML=Fe,V=r(),z=c("div"),u(Q.$$.fragment),se=r(),mt=c("p"),mt.innerHTML=Se,K=r(),u(_e.$$.fragment),Ue=r(),u(ee.$$.fragment),Ze=r(),de=c("p"),de.textContent=Me,ht=r(),B=c("div"),u(te.$$.fragment),oe=r(),Ae=c("p"),Ae.innerHTML=N,ae=r(),Xe=c("p"),Xe.innerHTML=ie,St=r(),Ge=c("p"),Ge.innerHTML=R,nt=r(),ce=c("div"),u(S.$$.fragment),zt=r(),Te=c("p"),Te.innerHTML=ze,st=r(),u(Ye.$$.fragment),je=r(),u(ke.$$.fragment),ut=r(),I=c("div"),u(pe.$$.fragment),D=r(),me=c("p"),me.textContent=It,ve=r(),u(be.$$.fragment),ft=r(),u(q.$$.fragment),De=r(),u(H.$$.fragment),rt=r(),j=c("div"),u(J.$$.fragment),he=r(),A=c("p"),A.textContent=Bt,O=r(),Y=c("p"),Y.innerHTML=Yt,yt=r(),gt=c("p"),gt.innerHTML=_o,wt=r(),_t=c("p"),_t.innerHTML=vo,Mt=r(),We=c("div"),u(Tt.$$.fragment),jt=r(),ue=c("p"),ue.innerHTML=fe,kt=r(),u(He.$$.fragment),Ht=r(),u(Wt.$$.fragment),lt=r(),u(Oe.$$.fragment),vt=r(),re=c("div"),u(k.$$.fragment),U=r(),le=c("p"),le.textContent=ye,Re=r(),Z=c("p"),Z.innerHTML=xe,bo=r(),Lt=c("p"),Lt.innerHTML=pn,Oo=r(),Et=c("p"),Et.innerHTML=mn,Ko=r(),Ie=c("div"),u(xt.$$.fragment),ea=r(),Pt=c("p"),Pt.innerHTML=hn,ta=r(),u(Vt.$$.fragment),ao=r(),u(At.$$.fragment),it=r(),u(Jt.$$.fragment),Bo=r(),ge=c("div"),u(yo.$$.fragment),oa=r(),Qt=c("p"),Qt.textContent=un,aa=r(),Ct=c("p"),Ct.innerHTML=Za,Dt=r(),Xt=c("p"),Xt.innerHTML=za,wo=r(),Co=c("p"),Co.innerHTML=Ia,Ot=r(),Ne=c("div"),u(no.$$.fragment),Mo=r(),$o=c("p"),$o.innerHTML=na,so=r(),u(ro.$$.fragment),Xo=r(),u(Ve.$$.fragment),Kt=r(),u(lo.$$.fragment),io=r(),Ke=c("div"),u(co.$$.fragment),To=r(),Fo=c("p"),Fo.innerHTML=Ba,eo=r(),Gt=c("p"),Gt.innerHTML=Xa,jo=r(),Uo=c("p"),Uo.innerHTML=sa,po=r(),$t=c("div"),u(to.$$.fragment),ne=r(),Rt=c("p"),Rt.innerHTML=Ga,ko=r(),u(mo.$$.fragment),ra=r(),u(Ft.$$.fragment),this.h()},l(h){t=d(h,"P",{"data-svelte-h":!0}),m(t)!=="svelte-1a08bfs"&&(t.textContent=y),n=l(h),i=d(h,"DIV",{class:!0});var x=C(i);f(M.$$.fragment,x),o=l(x),T=d(x,"P",{"data-svelte-h":!0}),m(T)!=="svelte-te9mu1"&&(T.innerHTML=Ce),X=l(x),E=d(x,"P",{"data-svelte-h":!0}),m(E)!=="svelte-r9dmfs"&&(E.innerHTML=$e),G=l(x),P=d(x,"P",{"data-svelte-h":!0}),m(P)!=="svelte-1ytzpa1"&&(P.innerHTML=Fe),V=l(x),z=d(x,"DIV",{class:!0});var Le=C(z);f(Q.$$.fragment,Le),se=l(Le),mt=d(Le,"P",{"data-svelte-h":!0}),m(mt)!=="svelte-p7hzst"&&(mt.innerHTML=Se),K=l(Le),f(_e.$$.fragment,Le),Ue=l(Le),f(ee.$$.fragment,Le),Le.forEach(s),x.forEach(s),Ze=l(h),de=d(h,"P",{"data-svelte-h":!0}),m(de)!=="svelte-1c0vcc6"&&(de.textContent=Me),ht=l(h),B=d(h,"DIV",{class:!0});var Ee=C(B);f(te.$$.fragment,Ee),oe=l(Ee),Ae=d(Ee,"P",{"data-svelte-h":!0}),m(Ae)!=="svelte-1p0g25y"&&(Ae.innerHTML=N),ae=l(Ee),Xe=d(Ee,"P",{"data-svelte-h":!0}),m(Xe)!=="svelte-r9dmfs"&&(Xe.innerHTML=ie),St=l(Ee),Ge=d(Ee,"P",{"data-svelte-h":!0}),m(Ge)!=="svelte-1ytzpa1"&&(Ge.innerHTML=R),nt=l(Ee),ce=d(Ee,"DIV",{class:!0});var et=C(ce);f(S.$$.fragment,et),zt=l(et),Te=d(et,"P",{"data-svelte-h":!0}),m(Te)!=="svelte-1nhman7"&&(Te.innerHTML=ze),st=l(et),f(Ye.$$.fragment,et),je=l(et),f(ke.$$.fragment,et),et.forEach(s),ut=l(Ee),I=d(Ee,"DIV",{class:!0});var Nt=C(I);f(pe.$$.fragment,Nt),D=l(Nt),me=d(Nt,"P",{"data-svelte-h":!0}),m(me)!=="svelte-1uzynjt"&&(me.textContent=It),ve=l(Nt),f(be.$$.fragment,Nt),ft=l(Nt),f(q.$$.fragment,Nt),Nt.forEach(s),Ee.forEach(s),De=l(h),f(H.$$.fragment,h),rt=l(h),j=d(h,"DIV",{class:!0});var Pe=C(j);f(J.$$.fragment,Pe),he=l(Pe),A=d(Pe,"P",{"data-svelte-h":!0}),m(A)!=="svelte-dzph96"&&(A.textContent=Bt),O=l(Pe),Y=d(Pe,"P",{"data-svelte-h":!0}),m(Y)!=="svelte-q3avhg"&&(Y.innerHTML=Yt),yt=l(Pe),gt=d(Pe,"P",{"data-svelte-h":!0}),m(gt)!=="svelte-hhllhm"&&(gt.innerHTML=_o),wt=l(Pe),_t=d(Pe,"P",{"data-svelte-h":!0}),m(_t)!=="svelte-68lg8f"&&(_t.innerHTML=vo),Mt=l(Pe),We=d(Pe,"DIV",{class:!0});var qe=C(We);f(Tt.$$.fragment,qe),jt=l(qe),ue=d(qe,"P",{"data-svelte-h":!0}),m(ue)!=="svelte-168dnv"&&(ue.innerHTML=fe),kt=l(qe),f(He.$$.fragment,qe),Ht=l(qe),f(Wt.$$.fragment,qe),qe.forEach(s),Pe.forEach(s),lt=l(h),f(Oe.$$.fragment,h),vt=l(h),re=d(h,"DIV",{class:!0});var we=C(re);f(k.$$.fragment,we),U=l(we),le=d(we,"P",{"data-svelte-h":!0}),m(le)!=="svelte-1jplo9i"&&(le.textContent=ye),Re=l(we),Z=d(we,"P",{"data-svelte-h":!0}),m(Z)!=="svelte-q3avhg"&&(Z.innerHTML=xe),bo=l(we),Lt=d(we,"P",{"data-svelte-h":!0}),m(Lt)!=="svelte-hhllhm"&&(Lt.innerHTML=pn),Oo=l(we),Et=d(we,"P",{"data-svelte-h":!0}),m(Et)!=="svelte-68lg8f"&&(Et.innerHTML=mn),Ko=l(we),Ie=d(we,"DIV",{class:!0});var Ut=C(Ie);f(xt.$$.fragment,Ut),ea=l(Ut),Pt=d(Ut,"P",{"data-svelte-h":!0}),m(Pt)!=="svelte-v4wy8n"&&(Pt.innerHTML=hn),ta=l(Ut),f(Vt.$$.fragment,Ut),ao=l(Ut),f(At.$$.fragment,Ut),Ut.forEach(s),we.forEach(s),it=l(h),f(Jt.$$.fragment,h),Bo=l(h),ge=d(h,"DIV",{class:!0});var Je=C(ge);f(yo.$$.fragment,Je),oa=l(Je),Qt=d(Je,"P",{"data-svelte-h":!0}),m(Qt)!=="svelte-nregqm"&&(Qt.textContent=un),aa=l(Je),Ct=d(Je,"P",{"data-svelte-h":!0}),m(Ct)!=="svelte-q3avhg"&&(Ct.innerHTML=Za),Dt=l(Je),Xt=d(Je,"P",{"data-svelte-h":!0}),m(Xt)!=="svelte-hhllhm"&&(Xt.innerHTML=za),wo=l(Je),Co=d(Je,"P",{"data-svelte-h":!0}),m(Co)!=="svelte-68lg8f"&&(Co.innerHTML=Ia),Ot=l(Je),Ne=d(Je,"DIV",{class:!0});var qt=C(Ne);f(no.$$.fragment,qt),Mo=l(qt),$o=d(qt,"P",{"data-svelte-h":!0}),m($o)!=="svelte-1um1a4j"&&($o.innerHTML=na),so=l(qt),f(ro.$$.fragment,qt),Xo=l(qt),f(Ve.$$.fragment,qt),qt.forEach(s),Je.forEach(s),Kt=l(h),f(lo.$$.fragment,h),io=l(h),Ke=d(h,"DIV",{class:!0});var ct=C(Ke);f(co.$$.fragment,ct),To=l(ct),Fo=d(ct,"P",{"data-svelte-h":!0}),m(Fo)!=="svelte-wn7jg8"&&(Fo.innerHTML=Ba),eo=l(ct),Gt=d(ct,"P",{"data-svelte-h":!0}),m(Gt)!=="svelte-hhllhm"&&(Gt.innerHTML=Xa),jo=l(ct),Uo=d(ct,"P",{"data-svelte-h":!0}),m(Uo)!=="svelte-68lg8f"&&(Uo.innerHTML=sa),po=l(ct),$t=d(ct,"DIV",{class:!0});var tt=C($t);f(to.$$.fragment,tt),ne=l(tt),Rt=d(tt,"P",{"data-svelte-h":!0}),m(Rt)!=="svelte-18qrmlb"&&(Rt.innerHTML=Ga),ko=l(tt),f(mo.$$.fragment,tt),ra=l(tt),f(Ft.$$.fragment,tt),tt.forEach(s),ct.forEach(s),this.h()},h(){$(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(i,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$($t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(h,x){p(h,t,x),p(h,n,x),p(h,i,x),g(M,i,null),a(i,o),a(i,T),a(i,X),a(i,E),a(i,G),a(i,P),a(i,V),a(i,z),g(Q,z,null),a(z,se),a(z,mt),a(z,K),g(_e,z,null),a(z,Ue),g(ee,z,null),p(h,Ze,x),p(h,de,x),p(h,ht,x),p(h,B,x),g(te,B,null),a(B,oe),a(B,Ae),a(B,ae),a(B,Xe),a(B,St),a(B,Ge),a(B,nt),a(B,ce),g(S,ce,null),a(ce,zt),a(ce,Te),a(ce,st),g(Ye,ce,null),a(ce,je),g(ke,ce,null),a(B,ut),a(B,I),g(pe,I,null),a(I,D),a(I,me),a(I,ve),g(be,I,null),a(I,ft),g(q,I,null),p(h,De,x),g(H,h,x),p(h,rt,x),p(h,j,x),g(J,j,null),a(j,he),a(j,A),a(j,O),a(j,Y),a(j,yt),a(j,gt),a(j,wt),a(j,_t),a(j,Mt),a(j,We),g(Tt,We,null),a(We,jt),a(We,ue),a(We,kt),g(He,We,null),a(We,Ht),g(Wt,We,null),p(h,lt,x),g(Oe,h,x),p(h,vt,x),p(h,re,x),g(k,re,null),a(re,U),a(re,le),a(re,Re),a(re,Z),a(re,bo),a(re,Lt),a(re,Oo),a(re,Et),a(re,Ko),a(re,Ie),g(xt,Ie,null),a(Ie,ea),a(Ie,Pt),a(Ie,ta),g(Vt,Ie,null),a(Ie,ao),g(At,Ie,null),p(h,it,x),g(Jt,h,x),p(h,Bo,x),p(h,ge,x),g(yo,ge,null),a(ge,oa),a(ge,Qt),a(ge,aa),a(ge,Ct),a(ge,Dt),a(ge,Xt),a(ge,wo),a(ge,Co),a(ge,Ot),a(ge,Ne),g(no,Ne,null),a(Ne,Mo),a(Ne,$o),a(Ne,so),g(ro,Ne,null),a(Ne,Xo),g(Ve,Ne,null),p(h,Kt,x),g(lo,h,x),p(h,io,x),p(h,Ke,x),g(co,Ke,null),a(Ke,To),a(Ke,Fo),a(Ke,eo),a(Ke,Gt),a(Ke,jo),a(Ke,Uo),a(Ke,po),a(Ke,$t),g(to,$t,null),a($t,ne),a($t,Rt),a($t,ko),g(mo,$t,null),a($t,ra),g(Ft,$t,null),la=!0},p(h,x){const Le={};x&2&&(Le.$$scope={dirty:x,ctx:h}),_e.$set(Le);const Ee={};x&2&&(Ee.$$scope={dirty:x,ctx:h}),ee.$set(Ee);const et={};x&2&&(et.$$scope={dirty:x,ctx:h}),Ye.$set(et);const Nt={};x&2&&(Nt.$$scope={dirty:x,ctx:h}),ke.$set(Nt);const Pe={};x&2&&(Pe.$$scope={dirty:x,ctx:h}),be.$set(Pe);const qe={};x&2&&(qe.$$scope={dirty:x,ctx:h}),q.$set(qe);const we={};x&2&&(we.$$scope={dirty:x,ctx:h}),He.$set(we);const Ut={};x&2&&(Ut.$$scope={dirty:x,ctx:h}),Wt.$set(Ut);const Je={};x&2&&(Je.$$scope={dirty:x,ctx:h}),Vt.$set(Je);const qt={};x&2&&(qt.$$scope={dirty:x,ctx:h}),At.$set(qt);const ct={};x&2&&(ct.$$scope={dirty:x,ctx:h}),ro.$set(ct);const tt={};x&2&&(tt.$$scope={dirty:x,ctx:h}),Ve.$set(tt);const Wo={};x&2&&(Wo.$$scope={dirty:x,ctx:h}),mo.$set(Wo);const Ra={};x&2&&(Ra.$$scope={dirty:x,ctx:h}),Ft.$set(Ra)},i(h){la||(_(M.$$.fragment,h),_(Q.$$.fragment,h),_(_e.$$.fragment,h),_(ee.$$.fragment,h),_(te.$$.fragment,h),_(S.$$.fragment,h),_(Ye.$$.fragment,h),_(ke.$$.fragment,h),_(pe.$$.fragment,h),_(be.$$.fragment,h),_(q.$$.fragment,h),_(H.$$.fragment,h),_(J.$$.fragment,h),_(Tt.$$.fragment,h),_(He.$$.fragment,h),_(Wt.$$.fragment,h),_(Oe.$$.fragment,h),_(k.$$.fragment,h),_(xt.$$.fragment,h),_(Vt.$$.fragment,h),_(At.$$.fragment,h),_(Jt.$$.fragment,h),_(yo.$$.fragment,h),_(no.$$.fragment,h),_(ro.$$.fragment,h),_(Ve.$$.fragment,h),_(lo.$$.fragment,h),_(co.$$.fragment,h),_(to.$$.fragment,h),_(mo.$$.fragment,h),_(Ft.$$.fragment,h),la=!0)},o(h){v(M.$$.fragment,h),v(Q.$$.fragment,h),v(_e.$$.fragment,h),v(ee.$$.fragment,h),v(te.$$.fragment,h),v(S.$$.fragment,h),v(Ye.$$.fragment,h),v(ke.$$.fragment,h),v(pe.$$.fragment,h),v(be.$$.fragment,h),v(q.$$.fragment,h),v(H.$$.fragment,h),v(J.$$.fragment,h),v(Tt.$$.fragment,h),v(He.$$.fragment,h),v(Wt.$$.fragment,h),v(Oe.$$.fragment,h),v(k.$$.fragment,h),v(xt.$$.fragment,h),v(Vt.$$.fragment,h),v(At.$$.fragment,h),v(Jt.$$.fragment,h),v(yo.$$.fragment,h),v(no.$$.fragment,h),v(ro.$$.fragment,h),v(Ve.$$.fragment,h),v(lo.$$.fragment,h),v(co.$$.fragment,h),v(to.$$.fragment,h),v(mo.$$.fragment,h),v(Ft.$$.fragment,h),la=!1},d(h){h&&(s(t),s(n),s(i),s(Ze),s(de),s(ht),s(B),s(De),s(rt),s(j),s(lt),s(vt),s(re),s(it),s(Bo),s(ge),s(Kt),s(io),s(Ke)),b(M),b(Q),b(_e),b(ee),b(te),b(S),b(Ye),b(ke),b(pe),b(be),b(q),b(H,h),b(J),b(Tt),b(He),b(Wt),b(Oe,h),b(k),b(xt),b(Vt),b(At),b(Jt,h),b(yo),b(no),b(ro),b(Ve),b(lo,h),b(co),b(to),b(mo),b(Ft)}}}function wr(W){let t,y;return t=new ws({props:{$$slots:{default:[yr]},$$scope:{ctx:W}}}),{c(){u(t.$$.fragment)},l(n){f(t.$$.fragment,n)},m(n,i){g(t,n,i),y=!0},p(n,i){const M={};i&2&&(M.$$scope={dirty:i,ctx:n}),t.$set(M)},i(n){y||(_(t.$$.fragment,n),y=!0)},o(n){v(t.$$.fragment,n),y=!1},d(n){b(t,n)}}}function Mr(W){let t,y="TensorFlow models and layers in <code>transformers</code> accept two formats as input:",n,i,M="<li>having all inputs as keyword arguments (like PyTorch models), or</li> <li>having all inputs as a list, tuple or dict in the first positional argument.</li>",o,T,Ce=`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 <code>model.fit()</code> things should “just work” for you - just
pass your inputs and labels in any format that <code>model.fit()</code> supports! If, however, you want to use the second
format outside of Keras methods like <code>fit()</code> and <code>predict()</code>, such as when creating your own layers or models with
the Keras <code>Functional</code> API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`,X,E,$e=`<li>a single Tensor with <code>input_values</code> only and nothing else: <code>model(input_values)</code></li> <li>a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
<code>model([input_values, attention_mask])</code> or <code>model([input_values, attention_mask, token_type_ids])</code></li> <li>a dictionary with one or several input Tensors associated to the input names given in the docstring:
<code>model({&quot;input_values&quot;: input_values, &quot;token_type_ids&quot;: token_type_ids})</code></li>`,G,P,Fe=`Note that when creating models and layers with
<a href="https://keras.io/guides/making_new_layers_and_models_via_subclassing/" rel="nofollow">subclassing</a> then you don’t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`;return{c(){t=c("p"),t.innerHTML=y,n=r(),i=c("ul"),i.innerHTML=M,o=r(),T=c("p"),T.innerHTML=Ce,X=r(),E=c("ul"),E.innerHTML=$e,G=r(),P=c("p"),P.innerHTML=Fe},l(V){t=d(V,"P",{"data-svelte-h":!0}),m(t)!=="svelte-1ajbfxg"&&(t.innerHTML=y),n=l(V),i=d(V,"UL",{"data-svelte-h":!0}),m(i)!=="svelte-qm1t26"&&(i.innerHTML=M),o=l(V),T=d(V,"P",{"data-svelte-h":!0}),m(T)!=="svelte-1v9qsc5"&&(T.innerHTML=Ce),X=l(V),E=d(V,"UL",{"data-svelte-h":!0}),m(E)!=="svelte-1x9eg56"&&(E.innerHTML=$e),G=l(V),P=d(V,"P",{"data-svelte-h":!0}),m(P)!=="svelte-1an3odd"&&(P.innerHTML=Fe)},m(V,z){p(V,t,z),p(V,n,z),p(V,i,z),p(V,o,z),p(V,T,z),p(V,X,z),p(V,E,z),p(V,G,z),p(V,P,z)},p:L,d(V){V&&(s(t),s(n),s(i),s(o),s(T),s(X),s(E),s(G),s(P))}}}function Tr(W){let t,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=c("p"),t.innerHTML=y},l(n){t=d(n,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(n,i){p(n,t,i)},p:L,d(n){n&&s(t)}}}function jr(W){let t,y="Example:",n,i,M;return i=new at({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBURldhdjJWZWMyTW9kZWwlMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEFpbXBvcnQlMjBzb3VuZGZpbGUlMjBhcyUyMHNmJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3YXYydmVjMi1iYXNlLTk2MGglMjIpJTBBbW9kZWwlMjAlM0QlMjBURldhdjJWZWMyTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGd2F2MnZlYzItYmFzZS05NjBoJTIyKSUwQSUwQSUwQWRlZiUyMG1hcF90b19hcnJheShiYXRjaCklM0ElMEElMjAlMjAlMjAlMjBzcGVlY2glMkMlMjBfJTIwJTNEJTIwc2YucmVhZChiYXRjaCU1QiUyMmZpbGUlMjIlNUQpJTBBJTIwJTIwJTIwJTIwYmF0Y2glNUIlMjJzcGVlY2glMjIlNUQlMjAlM0QlMjBzcGVlY2glMEElMjAlMjAlMjAlMjByZXR1cm4lMjBiYXRjaCUwQSUwQSUwQWRzJTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmhmLWludGVybmFsLXRlc3RpbmclMkZsaWJyaXNwZWVjaF9hc3JfZHVtbXklMjIlMkMlMjAlMjJjbGVhbiUyMiUyQyUyMHNwbGl0JTNEJTIydmFsaWRhdGlvbiUyMiklMEFkcyUyMCUzRCUyMGRzLm1hcChtYXBfdG9fYXJyYXkpJTBBJTBBaW5wdXRfdmFsdWVzJTIwJTNEJTIwcHJvY2Vzc29yKGRzJTVCJTIyc3BlZWNoJTIyJTVEJTVCMCU1RCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpLmlucHV0X3ZhbHVlcyUyMCUyMCUyMyUyMEJhdGNoJTIwc2l6ZSUyMDElMEFoaWRkZW5fc3RhdGVzJTIwJTNEJTIwbW9kZWwoaW5wdXRfdmFsdWVzKS5sYXN0X2hpZGRlbl9zdGF0ZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, TFWav2Vec2Model
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> soundfile <span class="hljs-keyword">as</span> sf

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


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


<span class="hljs-meta">&gt;&gt;&gt; </span>ds = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_dummy&quot;</span>, <span class="hljs-string">&quot;clean&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>ds = ds.<span class="hljs-built_in">map</span>(map_to_array)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_values = processor(ds[<span class="hljs-string">&quot;speech&quot;</span>][<span class="hljs-number">0</span>], return_tensors=<span class="hljs-string">&quot;tf&quot;</span>).input_values  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>hidden_states = model(input_values).last_hidden_state`,wrap:!1}}),{c(){t=c("p"),t.textContent=y,n=r(),u(i.$$.fragment)},l(o){t=d(o,"P",{"data-svelte-h":!0}),m(t)!=="svelte-11lpom8"&&(t.textContent=y),n=l(o),f(i.$$.fragment,o)},m(o,T){p(o,t,T),p(o,n,T),g(i,o,T),M=!0},p:L,i(o){M||(_(i.$$.fragment,o),M=!0)},o(o){v(i.$$.fragment,o),M=!1},d(o){o&&(s(t),s(n)),b(i,o)}}}function kr(W){let t,y="TensorFlow models and layers in <code>transformers</code> accept two formats as input:",n,i,M="<li>having all inputs as keyword arguments (like PyTorch models), or</li> <li>having all inputs as a list, tuple or dict in the first positional argument.</li>",o,T,Ce=`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 <code>model.fit()</code> things should “just work” for you - just
pass your inputs and labels in any format that <code>model.fit()</code> supports! If, however, you want to use the second
format outside of Keras methods like <code>fit()</code> and <code>predict()</code>, such as when creating your own layers or models with
the Keras <code>Functional</code> API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`,X,E,$e=`<li>a single Tensor with <code>input_values</code> only and nothing else: <code>model(input_values)</code></li> <li>a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
<code>model([input_values, attention_mask])</code> or <code>model([input_values, attention_mask, token_type_ids])</code></li> <li>a dictionary with one or several input Tensors associated to the input names given in the docstring:
<code>model({&quot;input_values&quot;: input_values, &quot;token_type_ids&quot;: token_type_ids})</code></li>`,G,P,Fe=`Note that when creating models and layers with
<a href="https://keras.io/guides/making_new_layers_and_models_via_subclassing/" rel="nofollow">subclassing</a> then you don’t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`;return{c(){t=c("p"),t.innerHTML=y,n=r(),i=c("ul"),i.innerHTML=M,o=r(),T=c("p"),T.innerHTML=Ce,X=r(),E=c("ul"),E.innerHTML=$e,G=r(),P=c("p"),P.innerHTML=Fe},l(V){t=d(V,"P",{"data-svelte-h":!0}),m(t)!=="svelte-1ajbfxg"&&(t.innerHTML=y),n=l(V),i=d(V,"UL",{"data-svelte-h":!0}),m(i)!=="svelte-qm1t26"&&(i.innerHTML=M),o=l(V),T=d(V,"P",{"data-svelte-h":!0}),m(T)!=="svelte-1v9qsc5"&&(T.innerHTML=Ce),X=l(V),E=d(V,"UL",{"data-svelte-h":!0}),m(E)!=="svelte-1x9eg56"&&(E.innerHTML=$e),G=l(V),P=d(V,"P",{"data-svelte-h":!0}),m(P)!=="svelte-1an3odd"&&(P.innerHTML=Fe)},m(V,z){p(V,t,z),p(V,n,z),p(V,i,z),p(V,o,z),p(V,T,z),p(V,X,z),p(V,E,z),p(V,G,z),p(V,P,z)},p:L,d(V){V&&(s(t),s(n),s(i),s(o),s(T),s(X),s(E),s(G),s(P))}}}function Wr(W){let t,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=c("p"),t.innerHTML=y},l(n){t=d(n,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(n,i){p(n,t,i)},p:L,d(n){n&&s(t)}}}function xr(W){let t,y="Example:",n,i,M;return i=new at({props:{code:"aW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMFRGV2F2MlZlYzJGb3JDVEMlMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEFpbXBvcnQlMjBzb3VuZGZpbGUlMjBhcyUyMHNmJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3YXYydmVjMi1iYXNlLTk2MGglMjIpJTBBbW9kZWwlMjAlM0QlMjBURldhdjJWZWMyRm9yQ1RDLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRndhdjJ2ZWMyLWJhc2UtOTYwaCUyMiklMEElMEElMEFkZWYlMjBtYXBfdG9fYXJyYXkoYmF0Y2gpJTNBJTBBJTIwJTIwJTIwJTIwc3BlZWNoJTJDJTIwXyUyMCUzRCUyMHNmLnJlYWQoYmF0Y2glNUIlMjJmaWxlJTIyJTVEKSUwQSUyMCUyMCUyMCUyMGJhdGNoJTVCJTIyc3BlZWNoJTIyJTVEJTIwJTNEJTIwc3BlZWNoJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwYmF0Y2glMEElMEElMEFkcyUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJoZi1pbnRlcm5hbC10ZXN0aW5nJTJGbGlicmlzcGVlY2hfYXNyX2R1bW15JTIyJTJDJTIwJTIyY2xlYW4lMjIlMkMlMjBzcGxpdCUzRCUyMnZhbGlkYXRpb24lMjIpJTBBZHMlMjAlM0QlMjBkcy5tYXAobWFwX3RvX2FycmF5KSUwQSUwQWlucHV0X3ZhbHVlcyUyMCUzRCUyMHByb2Nlc3NvcihkcyU1QiUyMnNwZWVjaCUyMiU1RCU1QjAlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKS5pbnB1dF92YWx1ZXMlMjAlMjAlMjMlMjBCYXRjaCUyMHNpemUlMjAxJTBBbG9naXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRfdmFsdWVzKS5sb2dpdHMlMEFwcmVkaWN0ZWRfaWRzJTIwJTNEJTIwdGYuYXJnbWF4KGxvZ2l0cyUyQyUyMGF4aXMlM0QtMSklMEElMEF0cmFuc2NyaXB0aW9uJTIwJTNEJTIwcHJvY2Vzc29yLmRlY29kZShwcmVkaWN0ZWRfaWRzJTVCMCU1RCklMEElMEElMjMlMjBjb21wdXRlJTIwbG9zcyUwQXRhcmdldF90cmFuc2NyaXB0aW9uJTIwJTNEJTIwJTIyQSUyME1BTiUyMFNBSUQlMjBUTyUyMFRIRSUyMFVOSVZFUlNFJTIwU0lSJTIwSSUyMEVYSVNUJTIyJTBBJTBBJTIzJTIwUGFzcyUyMHRyYW5zY3JpcHRpb24lMjBhcyUyMCU2MHRleHQlNjAlMjB0byUyMGVuY29kZSUyMGxhYmVscyUwQWxhYmVscyUyMCUzRCUyMHByb2Nlc3Nvcih0ZXh0JTNEdHJhbnNjcmlwdGlvbiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpLmlucHV0X2lkcyUwQSUwQWxvc3MlMjAlM0QlMjBtb2RlbChpbnB1dF92YWx1ZXMlMkMlMjBsYWJlbHMlM0RsYWJlbHMpLmxvc3M=",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`,wrap:!1}}),{c(){t=c("p"),t.textContent=y,n=r(),u(i.$$.fragment)},l(o){t=d(o,"P",{"data-svelte-h":!0}),m(t)!=="svelte-11lpom8"&&(t.textContent=y),n=l(o),f(i.$$.fragment,o)},m(o,T){p(o,t,T),p(o,n,T),g(i,o,T),M=!0},p:L,i(o){M||(_(i.$$.fragment,o),M=!0)},o(o){v(i.$$.fragment,o),M=!1},d(o){o&&(s(t),s(n)),b(i,o)}}}function Vr(W){let t,y,n,i,M,o,T="The bare TFWav2Vec2 Model transformer outputing raw hidden-states without any specific head on top.",Ce,X,E=`This model inherits from <a href="/docs/transformers/pr_30674/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</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.)`,$e,G,P=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">keras.Model</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.`,Fe,V,z,Q,se,mt,Se,K='The <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.TFWav2Vec2Model">TFWav2Vec2Model</a> forward method, overrides the <code>__call__</code> special method.',_e,Ue,ee,Ze,de,Me,ht="## TFWav2Vec2ForSequenceClassification[[transformers.TFWav2Vec2ForSequenceClassification]]",B,te,oe,Ae,N,ae,Xe,ie,St="## TFWav2Vec2ForCTC[[transformers.TFWav2Vec2ForCTC]]",Ge,R,nt,ce,S,zt="TFWav2Vec2 Model with a <code>language modeling</code> head on top for Connectionist Temporal Classification (CTC).",Te,ze,st=`This model inherits from <a href="/docs/transformers/pr_30674/en/main_classes/model#transformers.TFPreTrainedModel">TFPreTrainedModel</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.)`,Ye,je,ke=`This model is also a <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow">keras.Model</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.`,ut,I,pe,D,me,It,ve,be='The <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.TFWav2Vec2ForCTC">TFWav2Vec2ForCTC</a> forward method, overrides the <code>__call__</code> special method.',ft,q,De,H,rt;return t=new dt({props:{title:"TFWav2Vec2Model",local:"transformers.TFWav2Vec2Model",headingTag:"h2"}}),i=new F({props:{name:"class transformers.TFWav2Vec2Model",anchor:"transformers.TFWav2Vec2Model",parameters:[{name:"config",val:": Wav2Vec2Config"},{name:"*inputs",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFWav2Vec2Model.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_30674/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/pr_30674/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/vr_30674/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py#L1498"}}),V=new pt({props:{$$slots:{default:[Mr]},$$scope:{ctx:W}}}),se=new F({props:{name:"call",anchor:"transformers.TFWav2Vec2Model.call",parameters:[{name:"input_values",val:": tf.Tensor"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"token_type_ids",val:": tf.Tensor | None = None"},{name:"position_ids",val:": tf.Tensor | None = None"},{name:"head_mask",val:": tf.Tensor | None = None"},{name:"inputs_embeds",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFWav2Vec2Model.call.input_values",description:`<strong>input_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> <code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_30674/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_30674/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_30674/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/pr_30674/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/vr_30674/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py#L1508",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30674/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/pr_30674/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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_30674/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutput"
>transformers.modeling_tf_outputs.TFBaseModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Ue=new pt({props:{$$slots:{default:[Tr]},$$scope:{ctx:W}}}),Ze=new Zt({props:{anchor:"transformers.TFWav2Vec2Model.call.example",$$slots:{default:[jr]},$$scope:{ctx:W}}}),oe=new F({props:{name:"class transformers.TFWav2Vec2ForSequenceClassification",anchor:"transformers.TFWav2Vec2ForSequenceClassification",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py#L1746"}}),ae=new F({props:{name:"call",anchor:"transformers.TFWav2Vec2ForSequenceClassification.call",parameters:[{name:"input_values",val:": tf.Tensor"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": bool | None = None"},{name:"output_hidden_states",val:": bool | None = None"},{name:"return_dict",val:": bool | None = None"},{name:"labels",val:": tf.Tensor | None = None"},{name:"training",val:": bool = False"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py#L1787"}}),nt=new F({props:{name:"class transformers.TFWav2Vec2ForCTC",anchor:"transformers.TFWav2Vec2ForCTC",parameters:[{name:"config",val:": Wav2Vec2Config"},{name:"*inputs",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFWav2Vec2ForCTC.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_30674/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/pr_30674/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/vr_30674/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py#L1580"}}),I=new pt({props:{$$slots:{default:[kr]},$$scope:{ctx:W}}}),me=new F({props:{name:"call",anchor:"transformers.TFWav2Vec2ForCTC.call",parameters:[{name:"input_values",val:": tf.Tensor"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"token_type_ids",val:": tf.Tensor | None = None"},{name:"position_ids",val:": tf.Tensor | None = None"},{name:"head_mask",val:": tf.Tensor | None = None"},{name:"inputs_embeds",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"labels",val:": tf.Tensor | None = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFWav2Vec2ForCTC.call.input_values",description:`<strong>input_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> <code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_30674/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_30674/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/pr_30674/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/pr_30674/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/vr_30674/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py#L1614",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30674/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/pr_30674/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) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_30674/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutput"
>transformers.modeling_tf_outputs.TFCausalLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),q=new pt({props:{$$slots:{default:[Wr]},$$scope:{ctx:W}}}),H=new Zt({props:{anchor:"transformers.TFWav2Vec2ForCTC.call.example",$$slots:{default:[xr]},$$scope:{ctx:W}}}),{c(){u(t.$$.fragment),y=r(),n=c("div"),u(i.$$.fragment),M=r(),o=c("p"),o.textContent=T,Ce=r(),X=c("p"),X.innerHTML=E,$e=r(),G=c("p"),G.innerHTML=P,Fe=r(),u(V.$$.fragment),z=r(),Q=c("div"),u(se.$$.fragment),mt=r(),Se=c("p"),Se.innerHTML=K,_e=r(),u(Ue.$$.fragment),ee=r(),u(Ze.$$.fragment),de=r(),Me=c("p"),Me.textContent=ht,B=r(),te=c("div"),u(oe.$$.fragment),Ae=r(),N=c("div"),u(ae.$$.fragment),Xe=r(),ie=c("p"),ie.textContent=St,Ge=r(),R=c("div"),u(nt.$$.fragment),ce=r(),S=c("p"),S.innerHTML=zt,Te=r(),ze=c("p"),ze.innerHTML=st,Ye=r(),je=c("p"),je.innerHTML=ke,ut=r(),u(I.$$.fragment),pe=r(),D=c("div"),u(me.$$.fragment),It=r(),ve=c("p"),ve.innerHTML=be,ft=r(),u(q.$$.fragment),De=r(),u(H.$$.fragment),this.h()},l(j){f(t.$$.fragment,j),y=l(j),n=d(j,"DIV",{class:!0});var J=C(n);f(i.$$.fragment,J),M=l(J),o=d(J,"P",{"data-svelte-h":!0}),m(o)!=="svelte-7z1r57"&&(o.textContent=T),Ce=l(J),X=d(J,"P",{"data-svelte-h":!0}),m(X)!=="svelte-1sctibs"&&(X.innerHTML=E),$e=l(J),G=d(J,"P",{"data-svelte-h":!0}),m(G)!=="svelte-1be7e3c"&&(G.innerHTML=P),Fe=l(J),f(V.$$.fragment,J),z=l(J),Q=d(J,"DIV",{class:!0});var he=C(Q);f(se.$$.fragment,he),mt=l(he),Se=d(he,"P",{"data-svelte-h":!0}),m(Se)!=="svelte-ucapdd"&&(Se.innerHTML=K),_e=l(he),f(Ue.$$.fragment,he),ee=l(he),f(Ze.$$.fragment,he),he.forEach(s),J.forEach(s),de=l(j),Me=d(j,"P",{"data-svelte-h":!0}),m(Me)!=="svelte-aahscw"&&(Me.textContent=ht),B=l(j),te=d(j,"DIV",{class:!0});var A=C(te);f(oe.$$.fragment,A),Ae=l(A),N=d(A,"DIV",{class:!0});var Bt=C(N);f(ae.$$.fragment,Bt),Bt.forEach(s),A.forEach(s),Xe=l(j),ie=d(j,"P",{"data-svelte-h":!0}),m(ie)!=="svelte-njvvzu"&&(ie.textContent=St),Ge=l(j),R=d(j,"DIV",{class:!0});var O=C(R);f(nt.$$.fragment,O),ce=l(O),S=d(O,"P",{"data-svelte-h":!0}),m(S)!=="svelte-uqrpa"&&(S.innerHTML=zt),Te=l(O),ze=d(O,"P",{"data-svelte-h":!0}),m(ze)!=="svelte-1c4rgoe"&&(ze.innerHTML=st),Ye=l(O),je=d(O,"P",{"data-svelte-h":!0}),m(je)!=="svelte-1be7e3c"&&(je.innerHTML=ke),ut=l(O),f(I.$$.fragment,O),pe=l(O),D=d(O,"DIV",{class:!0});var Y=C(D);f(me.$$.fragment,Y),It=l(Y),ve=d(Y,"P",{"data-svelte-h":!0}),m(ve)!=="svelte-1pdykjd"&&(ve.innerHTML=be),ft=l(Y),f(q.$$.fragment,Y),De=l(Y),f(H.$$.fragment,Y),Y.forEach(s),O.forEach(s),this.h()},h(){$(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(n,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(j,J){g(t,j,J),p(j,y,J),p(j,n,J),g(i,n,null),a(n,M),a(n,o),a(n,Ce),a(n,X),a(n,$e),a(n,G),a(n,Fe),g(V,n,null),a(n,z),a(n,Q),g(se,Q,null),a(Q,mt),a(Q,Se),a(Q,_e),g(Ue,Q,null),a(Q,ee),g(Ze,Q,null),p(j,de,J),p(j,Me,J),p(j,B,J),p(j,te,J),g(oe,te,null),a(te,Ae),a(te,N),g(ae,N,null),p(j,Xe,J),p(j,ie,J),p(j,Ge,J),p(j,R,J),g(nt,R,null),a(R,ce),a(R,S),a(R,Te),a(R,ze),a(R,Ye),a(R,je),a(R,ut),g(I,R,null),a(R,pe),a(R,D),g(me,D,null),a(D,It),a(D,ve),a(D,ft),g(q,D,null),a(D,De),g(H,D,null),rt=!0},p(j,J){const he={};J&2&&(he.$$scope={dirty:J,ctx:j}),V.$set(he);const A={};J&2&&(A.$$scope={dirty:J,ctx:j}),Ue.$set(A);const Bt={};J&2&&(Bt.$$scope={dirty:J,ctx:j}),Ze.$set(Bt);const O={};J&2&&(O.$$scope={dirty:J,ctx:j}),I.$set(O);const Y={};J&2&&(Y.$$scope={dirty:J,ctx:j}),q.$set(Y);const Yt={};J&2&&(Yt.$$scope={dirty:J,ctx:j}),H.$set(Yt)},i(j){rt||(_(t.$$.fragment,j),_(i.$$.fragment,j),_(V.$$.fragment,j),_(se.$$.fragment,j),_(Ue.$$.fragment,j),_(Ze.$$.fragment,j),_(oe.$$.fragment,j),_(ae.$$.fragment,j),_(nt.$$.fragment,j),_(I.$$.fragment,j),_(me.$$.fragment,j),_(q.$$.fragment,j),_(H.$$.fragment,j),rt=!0)},o(j){v(t.$$.fragment,j),v(i.$$.fragment,j),v(V.$$.fragment,j),v(se.$$.fragment,j),v(Ue.$$.fragment,j),v(Ze.$$.fragment,j),v(oe.$$.fragment,j),v(ae.$$.fragment,j),v(nt.$$.fragment,j),v(I.$$.fragment,j),v(me.$$.fragment,j),v(q.$$.fragment,j),v(H.$$.fragment,j),rt=!1},d(j){j&&(s(y),s(n),s(de),s(Me),s(B),s(te),s(Xe),s(ie),s(Ge),s(R)),b(t,j),b(i),b(V),b(se),b(Ue),b(Ze),b(oe),b(ae),b(nt),b(I),b(me),b(q),b(H)}}}function Jr(W){let t,y;return t=new ws({props:{$$slots:{default:[Vr]},$$scope:{ctx:W}}}),{c(){u(t.$$.fragment)},l(n){f(t.$$.fragment,n)},m(n,i){g(t,n,i),y=!0},p(n,i){const M={};i&2&&(M.$$scope={dirty:i,ctx:n}),t.$set(M)},i(n){y||(_(t.$$.fragment,n),y=!0)},o(n){v(t.$$.fragment,n),y=!1},d(n){b(t,n)}}}function Cr(W){let t,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=c("p"),t.innerHTML=y},l(n){t=d(n,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(n,i){p(n,t,i)},p:L,d(n){n&&s(t)}}}function $r(W){let t,y="Example:",n,i,M;return i=new at({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBGbGF4V2F2MlZlYzJNb2RlbCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQWltcG9ydCUyMHNvdW5kZmlsZSUyMGFzJTIwc2YlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRndhdjJ2ZWMyLWxhcmdlLWx2NjAlMjIpJTBBbW9kZWwlMjAlM0QlMjBGbGF4V2F2MlZlYzJNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3YXYydmVjMi1sYXJnZS1sdjYwJTIyKSUwQSUwQSUwQWRlZiUyMG1hcF90b19hcnJheShiYXRjaCklM0ElMEElMjAlMjAlMjAlMjBzcGVlY2glMkMlMjBfJTIwJTNEJTIwc2YucmVhZChiYXRjaCU1QiUyMmZpbGUlMjIlNUQpJTBBJTIwJTIwJTIwJTIwYmF0Y2glNUIlMjJzcGVlY2glMjIlNUQlMjAlM0QlMjBzcGVlY2glMEElMjAlMjAlMjAlMjByZXR1cm4lMjBiYXRjaCUwQSUwQSUwQWRzJTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmhmLWludGVybmFsLXRlc3RpbmclMkZsaWJyaXNwZWVjaF9hc3JfZHVtbXklMjIlMkMlMjAlMjJjbGVhbiUyMiUyQyUyMHNwbGl0JTNEJTIydmFsaWRhdGlvbiUyMiklMEFkcyUyMCUzRCUyMGRzLm1hcChtYXBfdG9fYXJyYXkpJTBBJTBBaW5wdXRfdmFsdWVzJTIwJTNEJTIwcHJvY2Vzc29yKCUwQSUyMCUyMCUyMCUyMGRzJTVCJTIyc3BlZWNoJTIyJTVEJTVCMCU1RCUyQyUyMHNhbXBsaW5nX3JhdGUlM0QxNl8wMDAlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMm5wJTIyJTBBKS5pbnB1dF92YWx1ZXMlMjAlMjAlMjMlMjBCYXRjaCUyMHNpemUlMjAxJTBBaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG1vZGVsKGlucHV0X3ZhbHVlcykubGFzdF9oaWRkZW5fc3RhdGU=",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`,wrap:!1}}),{c(){t=c("p"),t.textContent=y,n=r(),u(i.$$.fragment)},l(o){t=d(o,"P",{"data-svelte-h":!0}),m(t)!=="svelte-11lpom8"&&(t.textContent=y),n=l(o),f(i.$$.fragment,o)},m(o,T){p(o,t,T),p(o,n,T),g(i,o,T),M=!0},p:L,i(o){M||(_(i.$$.fragment,o),M=!0)},o(o){v(i.$$.fragment,o),M=!1},d(o){o&&(s(t),s(n)),b(i,o)}}}function Fr(W){let t,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=c("p"),t.innerHTML=y},l(n){t=d(n,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(n,i){p(n,t,i)},p:L,d(n){n&&s(t)}}}function Ur(W){let t,y="Example:",n,i,M;return i=new at({props:{code:"aW1wb3J0JTIwamF4Lm51bXB5JTIwYXMlMjBqbnAlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEZsYXhXYXYyVmVjMkZvckNUQyUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQWltcG9ydCUyMHNvdW5kZmlsZSUyMGFzJTIwc2YlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRndhdjJ2ZWMyLWxhcmdlLTk2MGgtbHY2MCUyMiklMEFtb2RlbCUyMCUzRCUyMEZsYXhXYXYyVmVjMkZvckNUQy5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3YXYydmVjMi1sYXJnZS05NjBoLWx2NjAlMjIpJTBBJTBBJTBBZGVmJTIwbWFwX3RvX2FycmF5KGJhdGNoKSUzQSUwQSUyMCUyMCUyMCUyMHNwZWVjaCUyQyUyMF8lMjAlM0QlMjBzZi5yZWFkKGJhdGNoJTVCJTIyZmlsZSUyMiU1RCklMEElMjAlMjAlMjAlMjBiYXRjaCU1QiUyMnNwZWVjaCUyMiU1RCUyMCUzRCUyMHNwZWVjaCUwQSUyMCUyMCUyMCUyMHJldHVybiUyMGJhdGNoJTBBJTBBJTBBZHMlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaGYtaW50ZXJuYWwtdGVzdGluZyUyRmxpYnJpc3BlZWNoX2Fzcl9kdW1teSUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWRzJTIwJTNEJTIwZHMubWFwKG1hcF90b19hcnJheSklMEElMEFpbnB1dF92YWx1ZXMlMjAlM0QlMjBwcm9jZXNzb3IoJTBBJTIwJTIwJTIwJTIwZHMlNUIlMjJzcGVlY2glMjIlNUQlNUIwJTVEJTJDJTIwc2FtcGxpbmdfcmF0ZSUzRDE2XzAwMCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIybnAlMjIlMEEpLmlucHV0X3ZhbHVlcyUyMCUyMCUyMyUyMEJhdGNoJTIwc2l6ZSUyMDElMEFsb2dpdHMlMjAlM0QlMjBtb2RlbChpbnB1dF92YWx1ZXMpLmxvZ2l0cyUwQXByZWRpY3RlZF9pZHMlMjAlM0QlMjBqbnAuYXJnbWF4KGxvZ2l0cyUyQyUyMGF4aXMlM0QtMSklMEElMEF0cmFuc2NyaXB0aW9uJTIwJTNEJTIwcHJvY2Vzc29yLmRlY29kZShwcmVkaWN0ZWRfaWRzJTVCMCU1RCklMEElMjMlMjBzaG91bGQlMjBnaXZlJTNBJTIwJTIwJTIyQSUyME1BTiUyMFNBSUQlMjBUTyUyMFRIRSUyMFVOSVZFUlNFJTIwU0lSJTIwSSUyMEVYSVNUJTIy",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>`,wrap:!1}}),{c(){t=c("p"),t.textContent=y,n=r(),u(i.$$.fragment)},l(o){t=d(o,"P",{"data-svelte-h":!0}),m(t)!=="svelte-11lpom8"&&(t.textContent=y),n=l(o),f(i.$$.fragment,o)},m(o,T){p(o,t,T),p(o,n,T),g(i,o,T),M=!0},p:L,i(o){M||(_(i.$$.fragment,o),M=!0)},o(o){v(i.$$.fragment,o),M=!1},d(o){o&&(s(t),s(n)),b(i,o)}}}function Zr(W){let t,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=c("p"),t.innerHTML=y},l(n){t=d(n,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(n,i){p(n,t,i)},p:L,d(n){n&&s(t)}}}function zr(W){let t,y="Example:",n,i,M;return i=new at({props:{code:"aW1wb3J0JTIwb3B0YXglMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEFpbXBvcnQlMjBqYXgubnVtcHklMjBhcyUyMGpucCUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBBdXRvRmVhdHVyZUV4dHJhY3RvciUyQyUyMEZsYXhXYXYyVmVjMkZvclByZVRyYWluaW5nJTBBZnJvbSUyMHRyYW5zZm9ybWVycy5tb2RlbHMud2F2MnZlYzIubW9kZWxpbmdfZmxheF93YXYydmVjMiUyMGltcG9ydCUyMF9jb21wdXRlX21hc2tfaW5kaWNlcyUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQWltcG9ydCUyMHNvdW5kZmlsZSUyMGFzJTIwc2YlMEElMEFmZWF0dXJlX2V4dHJhY3RvciUyMCUzRCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRndhdjJ2ZWMyLWxhcmdlLWx2NjAlMjIpJTBBbW9kZWwlMjAlM0QlMjBGbGF4V2F2MlZlYzJGb3JQcmVUcmFpbmluZy5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3YXYydmVjMi1sYXJnZS1sdjYwJTIyKSUwQSUwQSUwQWRlZiUyMG1hcF90b19hcnJheShiYXRjaCklM0ElMEElMjAlMjAlMjAlMjBzcGVlY2glMkMlMjBfJTIwJTNEJTIwc2YucmVhZChiYXRjaCU1QiUyMmZpbGUlMjIlNUQpJTBBJTIwJTIwJTIwJTIwYmF0Y2glNUIlMjJzcGVlY2glMjIlNUQlMjAlM0QlMjBzcGVlY2glMEElMjAlMjAlMjAlMjByZXR1cm4lMjBiYXRjaCUwQSUwQSUwQWRzJTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmhmLWludGVybmFsLXRlc3RpbmclMkZsaWJyaXNwZWVjaF9hc3JfZHVtbXklMjIlMkMlMjAlMjJjbGVhbiUyMiUyQyUyMHNwbGl0JTNEJTIydmFsaWRhdGlvbiUyMiklMEFkcyUyMCUzRCUyMGRzLm1hcChtYXBfdG9fYXJyYXkpJTBBJTBBaW5wdXRfdmFsdWVzJTIwJTNEJTIwZmVhdHVyZV9leHRyYWN0b3IoZHMlNUIlMjJzcGVlY2glMjIlNUQlNUIwJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMikuaW5wdXRfdmFsdWVzJTIwJTIwJTIzJTIwQmF0Y2glMjBzaXplJTIwMSUwQSUwQSUyMyUyMGNvbXB1dGUlMjBtYXNrZWQlMjBpbmRpY2VzJTBBYmF0Y2hfc2l6ZSUyQyUyMHJhd19zZXF1ZW5jZV9sZW5ndGglMjAlM0QlMjBpbnB1dF92YWx1ZXMuc2hhcGUlMEFzZXF1ZW5jZV9sZW5ndGglMjAlM0QlMjBtb2RlbC5fZ2V0X2ZlYXRfZXh0cmFjdF9vdXRwdXRfbGVuZ3RocyhyYXdfc2VxdWVuY2VfbGVuZ3RoKSUwQW1hc2tfdGltZV9pbmRpY2VzJTIwJTNEJTIwX2NvbXB1dGVfbWFza19pbmRpY2VzKChiYXRjaF9zaXplJTJDJTIwc2VxdWVuY2VfbGVuZ3RoKSUyQyUyMG1hc2tfcHJvYiUzRDAuMiUyQyUyMG1hc2tfbGVuZ3RoJTNEMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRfdmFsdWVzJTJDJTIwbWFza190aW1lX2luZGljZXMlM0RtYXNrX3RpbWVfaW5kaWNlcyklMEElMEElMjMlMjBjb21wdXRlJTIwY29zaW5lJTIwc2ltaWxhcml0eSUyMGJldHdlZW4lMjBwcmVkaWN0ZWQlMjAoJTNEcHJvamVjdGVkX3N0YXRlcyklMjBhbmQlMjB0YXJnZXQlMjAoJTNEcHJvamVjdGVkX3F1YW50aXplZF9zdGF0ZXMpJTBBY29zaW5lX3NpbSUyMCUzRCUyMG9wdGF4LmNvc2luZV9zaW1pbGFyaXR5KG91dHB1dHMucHJvamVjdGVkX3N0YXRlcyUyQyUyMG91dHB1dHMucHJvamVjdGVkX3F1YW50aXplZF9zdGF0ZXMpJTBBJTBBJTIzJTIwc2hvdyUyMHRoYXQlMjBjb3NpbmUlMjBzaW1pbGFyaXR5JTIwaXMlMjBtdWNoJTIwaGlnaGVyJTIwdGhhbiUyMHJhbmRvbSUwQWFzc2VydCUyMG5wLmFzYXJyYXkoY29zaW5lX3NpbSklNUJtYXNrX3RpbWVfaW5kaWNlcyU1RC5tZWFuKCklMjAlM0UlMjAwLjU=",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>`,wrap:!1}}),{c(){t=c("p"),t.textContent=y,n=r(),u(i.$$.fragment)},l(o){t=d(o,"P",{"data-svelte-h":!0}),m(t)!=="svelte-11lpom8"&&(t.textContent=y),n=l(o),f(i.$$.fragment,o)},m(o,T){p(o,t,T),p(o,n,T),g(i,o,T),M=!0},p:L,i(o){M||(_(i.$$.fragment,o),M=!0)},o(o){v(i.$$.fragment,o),M=!1},d(o){o&&(s(t),s(n)),b(i,o)}}}function Ir(W){let t,y,n,i,M,o,T=`The bare Wav2Vec2 Model transformer outputting raw hidden-states without any specific head on top.
Wav2Vec2 was proposed in <a href="https://arxiv.org/abs/2006.11477" rel="nofollow">wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations</a> by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`,Ce,X,E=`This model inherits from <a href="/docs/transformers/pr_30674/en/main_classes/model#transformers.FlaxPreTrainedModel">FlaxPreTrainedModel</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.)`,$e,G,P=`This model is also a Flax Linen
<a href="https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html" rel="nofollow">flax.nn.Module</a> subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`,Fe,V,z="Finally, this model supports inherent JAX features such as:",Q,se,mt='<li><a href="https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit" rel="nofollow">Just-In-Time (JIT) compilation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation" rel="nofollow">Automatic Differentiation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap" rel="nofollow">Vectorization</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap" rel="nofollow">Parallelization</a></li>',Se,K,_e,Ue,ee,Ze="The <code>FlaxWav2Vec2PreTrainedModel</code> forward method, overrides the <code>__call__</code> special method.",de,Me,ht,B,te,oe,Ae,N,ae,Xe,ie,St=`Wav2Vec2 Model with a <code>language modeling</code> head on top for Connectionist Temporal Classification (CTC).
Wav2Vec2 was proposed in <a href="https://arxiv.org/abs/2006.11477" rel="nofollow">wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations</a> by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`,Ge,R,nt=`This model inherits from <a href="/docs/transformers/pr_30674/en/main_classes/model#transformers.FlaxPreTrainedModel">FlaxPreTrainedModel</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.)`,ce,S,zt=`This model is also a Flax Linen
<a href="https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html" rel="nofollow">flax.nn.Module</a> subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`,Te,ze,st="Finally, this model supports inherent JAX features such as:",Ye,je,ke='<li><a href="https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit" rel="nofollow">Just-In-Time (JIT) compilation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation" rel="nofollow">Automatic Differentiation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap" rel="nofollow">Vectorization</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap" rel="nofollow">Parallelization</a></li>',ut,I,pe,D,me,It="The <code>FlaxWav2Vec2PreTrainedModel</code> forward method, overrides the <code>__call__</code> special method.",ve,be,ft,q,De,H,rt,j,J,he,A,Bt=`Wav2Vec2 Model with a quantizer and <code>VQ</code> head on top.
Wav2Vec2 was proposed in <a href="https://arxiv.org/abs/2006.11477" rel="nofollow">wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
Representations</a> by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael
Auli.`,O,Y,Yt=`This model inherits from <a href="/docs/transformers/pr_30674/en/main_classes/model#transformers.FlaxPreTrainedModel">FlaxPreTrainedModel</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.)`,yt,gt,_o=`This model is also a Flax Linen
<a href="https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html" rel="nofollow">flax.nn.Module</a> subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`,wt,_t,vo="Finally, this model supports inherent JAX features such as:",Mt,We,Tt='<li><a href="https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit" rel="nofollow">Just-In-Time (JIT) compilation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation" rel="nofollow">Automatic Differentiation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap" rel="nofollow">Vectorization</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap" rel="nofollow">Parallelization</a></li>',jt,ue,fe,kt,He,Ht='The <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.FlaxWav2Vec2ForPreTraining">FlaxWav2Vec2ForPreTraining</a> forward method, overrides the <code>__call__</code> special method.',Wt,lt,Oe,vt,re;return t=new dt({props:{title:"FlaxWav2Vec2Model",local:"transformers.FlaxWav2Vec2Model",headingTag:"h2"}}),i=new F({props:{name:"class transformers.FlaxWav2Vec2Model",anchor:"transformers.FlaxWav2Vec2Model",parameters:[{name:"config",val:": Wav2Vec2Config"},{name:"input_shape",val:": 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/pr_30674/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/pr_30674/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/pr_30674/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_30674/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L1051"}}),_e=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:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"freeze_feature_encoder",val:": bool = False"},{name:"return_dict",val:": Optional = 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/pr_30674/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/pr_30674/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/pr_30674/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L888",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30674/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>) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_30674/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>
`}}),Me=new pt({props:{$$slots:{default:[Cr]},$$scope:{ctx:W}}}),B=new Zt({props:{anchor:"transformers.FlaxWav2Vec2Model.__call__.example",$$slots:{default:[$r]},$$scope:{ctx:W}}}),oe=new dt({props:{title:"FlaxWav2Vec2ForCTC",local:"transformers.FlaxWav2Vec2ForCTC",headingTag:"h2"}}),ae=new F({props:{name:"class transformers.FlaxWav2Vec2ForCTC",anchor:"transformers.FlaxWav2Vec2ForCTC",parameters:[{name:"config",val:": Wav2Vec2Config"},{name:"input_shape",val:": 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/pr_30674/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/pr_30674/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/pr_30674/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_30674/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L1169"}}),pe=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:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"freeze_feature_encoder",val:": bool = False"},{name:"return_dict",val:": Optional = 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/pr_30674/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/pr_30674/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/pr_30674/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L888",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30674/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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_30674/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),be=new pt({props:{$$slots:{default:[Fr]},$$scope:{ctx:W}}}),q=new Zt({props:{anchor:"transformers.FlaxWav2Vec2ForCTC.__call__.example",$$slots:{default:[Ur]},$$scope:{ctx:W}}}),H=new dt({props:{title:"FlaxWav2Vec2ForPreTraining",local:"transformers.FlaxWav2Vec2ForPreTraining",headingTag:"h2"}}),J=new F({props:{name:"class transformers.FlaxWav2Vec2ForPreTraining",anchor:"transformers.FlaxWav2Vec2ForPreTraining",parameters:[{name:"config",val:": Wav2Vec2Config"},{name:"input_shape",val:": 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/pr_30674/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/pr_30674/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/pr_30674/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_30674/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L1318"}}),fe=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:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"freeze_feature_encoder",val:": bool = False"},{name:"return_dict",val:": Optional = 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/pr_30674/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/pr_30674/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/pr_30674/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L1322",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30674/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>) — 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>) — 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>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_30674/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>
`}}),lt=new pt({props:{$$slots:{default:[Zr]},$$scope:{ctx:W}}}),vt=new Zt({props:{anchor:"transformers.FlaxWav2Vec2ForPreTraining.__call__.example",$$slots:{default:[zr]},$$scope:{ctx:W}}}),{c(){u(t.$$.fragment),y=r(),n=c("div"),u(i.$$.fragment),M=r(),o=c("p"),o.innerHTML=T,Ce=r(),X=c("p"),X.innerHTML=E,$e=r(),G=c("p"),G.innerHTML=P,Fe=r(),V=c("p"),V.textContent=z,Q=r(),se=c("ul"),se.innerHTML=mt,Se=r(),K=c("div"),u(_e.$$.fragment),Ue=r(),ee=c("p"),ee.innerHTML=Ze,de=r(),u(Me.$$.fragment),ht=r(),u(B.$$.fragment),te=r(),u(oe.$$.fragment),Ae=r(),N=c("div"),u(ae.$$.fragment),Xe=r(),ie=c("p"),ie.innerHTML=St,Ge=r(),R=c("p"),R.innerHTML=nt,ce=r(),S=c("p"),S.innerHTML=zt,Te=r(),ze=c("p"),ze.textContent=st,Ye=r(),je=c("ul"),je.innerHTML=ke,ut=r(),I=c("div"),u(pe.$$.fragment),D=r(),me=c("p"),me.innerHTML=It,ve=r(),u(be.$$.fragment),ft=r(),u(q.$$.fragment),De=r(),u(H.$$.fragment),rt=r(),j=c("div"),u(J.$$.fragment),he=r(),A=c("p"),A.innerHTML=Bt,O=r(),Y=c("p"),Y.innerHTML=Yt,yt=r(),gt=c("p"),gt.innerHTML=_o,wt=r(),_t=c("p"),_t.textContent=vo,Mt=r(),We=c("ul"),We.innerHTML=Tt,jt=r(),ue=c("div"),u(fe.$$.fragment),kt=r(),He=c("p"),He.innerHTML=Ht,Wt=r(),u(lt.$$.fragment),Oe=r(),u(vt.$$.fragment),this.h()},l(k){f(t.$$.fragment,k),y=l(k),n=d(k,"DIV",{class:!0});var U=C(n);f(i.$$.fragment,U),M=l(U),o=d(U,"P",{"data-svelte-h":!0}),m(o)!=="svelte-te9mu1"&&(o.innerHTML=T),Ce=l(U),X=d(U,"P",{"data-svelte-h":!0}),m(X)!=="svelte-1o66w7w"&&(X.innerHTML=E),$e=l(U),G=d(U,"P",{"data-svelte-h":!0}),m(G)!=="svelte-idybz1"&&(G.innerHTML=P),Fe=l(U),V=d(U,"P",{"data-svelte-h":!0}),m(V)!=="svelte-1pplc4a"&&(V.textContent=z),Q=l(U),se=d(U,"UL",{"data-svelte-h":!0}),m(se)!=="svelte-1w7z84m"&&(se.innerHTML=mt),Se=l(U),K=d(U,"DIV",{class:!0});var le=C(K);f(_e.$$.fragment,le),Ue=l(le),ee=d(le,"P",{"data-svelte-h":!0}),m(ee)!=="svelte-dpjknz"&&(ee.innerHTML=Ze),de=l(le),f(Me.$$.fragment,le),ht=l(le),f(B.$$.fragment,le),le.forEach(s),U.forEach(s),te=l(k),f(oe.$$.fragment,k),Ae=l(k),N=d(k,"DIV",{class:!0});var ye=C(N);f(ae.$$.fragment,ye),Xe=l(ye),ie=d(ye,"P",{"data-svelte-h":!0}),m(ie)!=="svelte-1p0g25y"&&(ie.innerHTML=St),Ge=l(ye),R=d(ye,"P",{"data-svelte-h":!0}),m(R)!=="svelte-1o66w7w"&&(R.innerHTML=nt),ce=l(ye),S=d(ye,"P",{"data-svelte-h":!0}),m(S)!=="svelte-idybz1"&&(S.innerHTML=zt),Te=l(ye),ze=d(ye,"P",{"data-svelte-h":!0}),m(ze)!=="svelte-1pplc4a"&&(ze.textContent=st),Ye=l(ye),je=d(ye,"UL",{"data-svelte-h":!0}),m(je)!=="svelte-1w7z84m"&&(je.innerHTML=ke),ut=l(ye),I=d(ye,"DIV",{class:!0});var Re=C(I);f(pe.$$.fragment,Re),D=l(Re),me=d(Re,"P",{"data-svelte-h":!0}),m(me)!=="svelte-dpjknz"&&(me.innerHTML=It),ve=l(Re),f(be.$$.fragment,Re),ft=l(Re),f(q.$$.fragment,Re),Re.forEach(s),ye.forEach(s),De=l(k),f(H.$$.fragment,k),rt=l(k),j=d(k,"DIV",{class:!0});var Z=C(j);f(J.$$.fragment,Z),he=l(Z),A=d(Z,"P",{"data-svelte-h":!0}),m(A)!=="svelte-wn7jg8"&&(A.innerHTML=Bt),O=l(Z),Y=d(Z,"P",{"data-svelte-h":!0}),m(Y)!=="svelte-1o66w7w"&&(Y.innerHTML=Yt),yt=l(Z),gt=d(Z,"P",{"data-svelte-h":!0}),m(gt)!=="svelte-idybz1"&&(gt.innerHTML=_o),wt=l(Z),_t=d(Z,"P",{"data-svelte-h":!0}),m(_t)!=="svelte-1pplc4a"&&(_t.textContent=vo),Mt=l(Z),We=d(Z,"UL",{"data-svelte-h":!0}),m(We)!=="svelte-1w7z84m"&&(We.innerHTML=Tt),jt=l(Z),ue=d(Z,"DIV",{class:!0});var xe=C(ue);f(fe.$$.fragment,xe),kt=l(xe),He=d(xe,"P",{"data-svelte-h":!0}),m(He)!=="svelte-1n0ocn9"&&(He.innerHTML=Ht),Wt=l(xe),f(lt.$$.fragment,xe),Oe=l(xe),f(vt.$$.fragment,xe),xe.forEach(s),Z.forEach(s),this.h()},h(){$(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(n,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(k,U){g(t,k,U),p(k,y,U),p(k,n,U),g(i,n,null),a(n,M),a(n,o),a(n,Ce),a(n,X),a(n,$e),a(n,G),a(n,Fe),a(n,V),a(n,Q),a(n,se),a(n,Se),a(n,K),g(_e,K,null),a(K,Ue),a(K,ee),a(K,de),g(Me,K,null),a(K,ht),g(B,K,null),p(k,te,U),g(oe,k,U),p(k,Ae,U),p(k,N,U),g(ae,N,null),a(N,Xe),a(N,ie),a(N,Ge),a(N,R),a(N,ce),a(N,S),a(N,Te),a(N,ze),a(N,Ye),a(N,je),a(N,ut),a(N,I),g(pe,I,null),a(I,D),a(I,me),a(I,ve),g(be,I,null),a(I,ft),g(q,I,null),p(k,De,U),g(H,k,U),p(k,rt,U),p(k,j,U),g(J,j,null),a(j,he),a(j,A),a(j,O),a(j,Y),a(j,yt),a(j,gt),a(j,wt),a(j,_t),a(j,Mt),a(j,We),a(j,jt),a(j,ue),g(fe,ue,null),a(ue,kt),a(ue,He),a(ue,Wt),g(lt,ue,null),a(ue,Oe),g(vt,ue,null),re=!0},p(k,U){const le={};U&2&&(le.$$scope={dirty:U,ctx:k}),Me.$set(le);const ye={};U&2&&(ye.$$scope={dirty:U,ctx:k}),B.$set(ye);const Re={};U&2&&(Re.$$scope={dirty:U,ctx:k}),be.$set(Re);const Z={};U&2&&(Z.$$scope={dirty:U,ctx:k}),q.$set(Z);const xe={};U&2&&(xe.$$scope={dirty:U,ctx:k}),lt.$set(xe);const bo={};U&2&&(bo.$$scope={dirty:U,ctx:k}),vt.$set(bo)},i(k){re||(_(t.$$.fragment,k),_(i.$$.fragment,k),_(_e.$$.fragment,k),_(Me.$$.fragment,k),_(B.$$.fragment,k),_(oe.$$.fragment,k),_(ae.$$.fragment,k),_(pe.$$.fragment,k),_(be.$$.fragment,k),_(q.$$.fragment,k),_(H.$$.fragment,k),_(J.$$.fragment,k),_(fe.$$.fragment,k),_(lt.$$.fragment,k),_(vt.$$.fragment,k),re=!0)},o(k){v(t.$$.fragment,k),v(i.$$.fragment,k),v(_e.$$.fragment,k),v(Me.$$.fragment,k),v(B.$$.fragment,k),v(oe.$$.fragment,k),v(ae.$$.fragment,k),v(pe.$$.fragment,k),v(be.$$.fragment,k),v(q.$$.fragment,k),v(H.$$.fragment,k),v(J.$$.fragment,k),v(fe.$$.fragment,k),v(lt.$$.fragment,k),v(vt.$$.fragment,k),re=!1},d(k){k&&(s(y),s(n),s(te),s(Ae),s(N),s(De),s(rt),s(j)),b(t,k),b(i),b(_e),b(Me),b(B),b(oe,k),b(ae),b(pe),b(be),b(q),b(H,k),b(J),b(fe),b(lt),b(vt)}}}function Br(W){let t,y;return t=new ws({props:{$$slots:{default:[Ir]},$$scope:{ctx:W}}}),{c(){u(t.$$.fragment)},l(n){f(t.$$.fragment,n)},m(n,i){g(t,n,i),y=!0},p(n,i){const M={};i&2&&(M.$$scope={dirty:i,ctx:n}),t.$set(M)},i(n){y||(_(t.$$.fragment,n),y=!0)},o(n){v(t.$$.fragment,n),y=!1},d(n){b(t,n)}}}function Xr(W){let t,y,n,i,M,o,T,Ce,X,E='The Wav2Vec2 model was proposed in <a href="https://arxiv.org/abs/2006.11477" rel="nofollow">wav2vec 2.0: A Framework for Self-Supervised Learning of Speech Representations</a> by Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael Auli.',$e,G,P="The abstract from the paper is the following:",Fe,V,z=`<em>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.</em>`,Q,se,mt='This model was contributed by <a href="https://huggingface.co/patrickvonplaten" rel="nofollow">patrickvonplaten</a>.',Se,K,_e='Note: Meta (FAIR) released a new version of <a href="https://huggingface.co/docs/transformers/en/model_doc/wav2vec2-bert" rel="nofollow">Wav2Vec2-BERT 2.0</a> - it’s pretrained on 4.5M hours of audio. We especially recommend using it for fine-tuning tasks, e.g. as per <a href="https://huggingface.co/blog/fine-tune-w2v2-bert" rel="nofollow">this guide</a>.',Ue,ee,Ze,de,Me=`<li>Wav2Vec2 is a speech model that accepts a float array corresponding to the raw waveform of the speech signal.</li> <li>Wav2Vec2 model was trained using connectionist temporal classification (CTC) so the model output has to be decoded
using <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer">Wav2Vec2CTCTokenizer</a>.</li>`,ht,B,te,oe,Ae="Flash Attention 2 is an faster, optimized version of the model.",N,ae,Xe,ie,St='First, check whether your hardware is compatible with Flash Attention 2. The latest list of compatible hardware can be found in the <a href="https://github.com/Dao-AILab/flash-attention#installation-and-features" rel="nofollow">official documentation</a>. If your hardware is not compatible with Flash Attention 2, you can still benefit from attention kernel optimisations through Better Transformer support covered <a href="https://huggingface.co/docs/transformers/main/en/model_doc/bark#using-better-transformer" rel="nofollow">above</a>.',Ge,R,nt='Next, <a href="https://github.com/Dao-AILab/flash-attention#installation-and-features" rel="nofollow">install</a> the latest version of Flash Attention 2:',ce,S,zt,Te,ze,st,Ye='To load a model using Flash Attention 2, we can pass the argument <code>attn_implementation=&quot;flash_attention_2&quot;</code> to <a href="https://huggingface.co/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained" rel="nofollow"><code>.from_pretrained</code></a>. We’ll also load the model in half-precision (e.g. <code>torch.float16</code>), since it results in almost no degradation to audio quality but significantly lower memory usage and faster inference:',je,ke,ut,I,pe,D,me="Below is an expected speedup diagram comparing the pure inference time between the native implementation in transformers of the <code>facebook/wav2vec2-large-960h-lv60-self</code> model and the flash-attention-2 and sdpa (scale-dot-product-attention) versions. . We show the average speedup obtained on the <code>librispeech_asr</code> <code>clean</code> validation split:",It,ve,be='<img src="https://huggingface.co/datasets/kamilakesbi/transformers_image_doc/resolve/main/data/Wav2Vec2_speedup.png"/>',ft,q,De,H,rt="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with Wav2Vec2. If you’re interested in submitting a resource to be included here, please feel free to open a Pull Request and we’ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.",j,J,he,A,Bt='<li>A notebook on how to <a href="https://colab.research.google.com/github/m3hrdadfi/soxan/blob/main/notebooks/Emotion_recognition_in_Greek_speech_using_Wav2Vec2.ipynb" rel="nofollow">leverage a pretrained Wav2Vec2 model for emotion classification</a>. 🌎</li> <li><a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC">Wav2Vec2ForCTC</a> is supported by this <a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/audio-classification" rel="nofollow">example script</a> and <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/audio_classification.ipynb" rel="nofollow">notebook</a>.</li> <li><a href="../tasks/audio_classification">Audio classification task guide</a></li>',O,Y,Yt,yt,gt='<li>A blog post on <a href="https://huggingface.co/blog/wav2vec2-with-ngram" rel="nofollow">boosting Wav2Vec2 with n-grams in 🤗 Transformers</a>.</li> <li>A blog post on how to <a href="https://huggingface.co/blog/fine-tune-wav2vec2-english" rel="nofollow">finetune Wav2Vec2 for English ASR with 🤗 Transformers</a>.</li> <li>A blog post on <a href="https://huggingface.co/blog/fine-tune-xlsr-wav2vec2" rel="nofollow">finetuning XLS-R for Multi-Lingual ASR with 🤗 Transformers</a>.</li> <li>A notebook on how to <a href="https://colab.research.google.com/github/Muennighoff/ytclipcc/blob/main/wav2vec_youtube_captions.ipynb" rel="nofollow">create YouTube captions from any video by transcribing audio with Wav2Vec2</a>. 🌎</li> <li><a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC">Wav2Vec2ForCTC</a> is supported by a notebook on <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/speech_recognition.ipynb" rel="nofollow">how to finetune a speech recognition model in English</a>, and <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multi_lingual_speech_recognition.ipynb" rel="nofollow">how to finetune a speech recognition model in any language</a>.</li> <li><a href="../tasks/asr">Automatic speech recognition task guide</a></li>',_o,wt,_t="🚀 Deploy",vo,Mt,We='<li>A blog post on how to deploy Wav2Vec2 for <a href="https://www.philschmid.de/automatic-speech-recognition-sagemaker" rel="nofollow">Automatic Speech Recognition with Hugging Face’s Transformers &amp; Amazon SageMaker</a>.</li>',Tt,jt,ue,fe,kt,He,Ht,Wt=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2Model">Wav2Vec2Model</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
<a href="https://huggingface.co/facebook/wav2vec2-base-960h" rel="nofollow">facebook/wav2vec2-base-960h</a> architecture.`,lt,Oe,vt=`Configuration objects inherit from <a href="/docs/transformers/pr_30674/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_30674/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,re,k,U,le,ye="## Wav2Vec2CTCTokenizer[[transformers.Wav2Vec2CTCTokenizer]]",Re,Z,xe,bo,Lt,pn="Constructs a Wav2Vec2CTC tokenizer.",Oo,Et,mn=`This tokenizer inherits from <a href="/docs/transformers/pr_30674/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a> which contains some of the main methods. Users should refer to
the superclass for more information regarding such methods.`,Ko,Ie,xt,ea,Pt,hn=`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`,ta,Vt,ao,At,it,Jt,Bo,ge,yo=`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`,oa,Qt,un="Similar to doing <code>self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))</code>.",aa,Ct,Za,Dt,Xt,za,wo,Co="Convert a list of lists of token ids into a list of strings by calling decode.",Ia,Ot,Ne,no,Mo,$o="Set the target language of a nested multi-lingual dictionary",na,so,ro="## Wav2Vec2FeatureExtractor[[transformers.Wav2Vec2FeatureExtractor]]",Xo,Ve,Kt,lo,io,Ke="Constructs a Wav2Vec2 feature extractor.",co,To,Fo=`This feature extractor inherits from <a href="/docs/transformers/pr_30674/en/main_classes/feature_extractor#transformers.SequenceFeatureExtractor">SequenceFeatureExtractor</a> which contains
most of the main methods. Users should refer to this superclass for more information regarding those methods.`,Ba,eo,Gt,Xa,jo,Uo="Main method to featurize and prepare for the model one or several sequence(s).",sa,po,$t="## Wav2Vec2Processor[[transformers.Wav2Vec2Processor]]",to,ne,Rt,Ga,ko,mo=`Constructs a Wav2Vec2 processor which wraps a Wav2Vec2 feature extractor and a Wav2Vec2 CTC tokenizer into a single
processor.`,ra,Ft,la=`<a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor">Wav2Vec2Processor</a> offers all the functionalities of <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor">Wav2Vec2FeatureExtractor</a> and <a href="/docs/transformers/pr_30674/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.
See the docstring of <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__"><strong>call</strong>()</a> and <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.decode">decode()</a> for more information.`,h,x,Le,Ee,et,Nt=`When used in normal mode, this method forwards all its arguments to Wav2Vec2FeatureExtractor’s
<a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor.__call__"><strong>call</strong>()</a> and returns its output. If used in the context
<code>as_target_processor()</code> this method forwards all its arguments to PreTrainedTokenizer’s
<a href="/docs/transformers/pr_30674/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"><strong>call</strong>()</a>. Please refer to the docstring of the above two methods for more information.`,Pe,qe,we,Ut,Je,qt=`When used in normal mode, this method forwards all its arguments to Wav2Vec2FeatureExtractor’s
<a href="/docs/transformers/pr_30674/en/main_classes/feature_extractor#transformers.SequenceFeatureExtractor.pad">pad()</a> and returns its output. If used in the context
<code>as_target_processor()</code> this method forwards all its arguments to PreTrainedTokenizer’s
<a href="/docs/transformers/pr_30674/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.pad">pad()</a>. Please refer to the docstring of the above two methods for more information.`,ct,tt,Wo,Ra,xo,ia,Hn,Na,Ms=`Saves the attributes of this processor (feature extractor, tokenizer…) in the specified directory so that it
can be reloaded using the <a href="/docs/transformers/pr_30674/en/main_classes/processors#transformers.ProcessorMixin.from_pretrained">from_pretrained()</a> method.`,Ln,Go,En,Ro,ca,Pn,qa,Ts=`This method forwards all its arguments to PreTrainedTokenizer’s <a href="/docs/transformers/pr_30674/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,Qn,No,da,Sn,Ya,js=`This method forwards all its arguments to PreTrainedTokenizer’s <a href="/docs/transformers/pr_30674/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode">decode()</a>. Please refer
to the docstring of this method for more information.`,_n,pa,ks="## Wav2Vec2ProcessorWithLM[[transformers.Wav2Vec2ProcessorWithLM]]",vn,Be,ma,An,Ha,Ws=`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.`,Dn,qo,ha,On,La,xs=`When used in normal mode, this method forwards all its arguments to the feature extractor’s
<code>__call__()</code> and returns its output. If used in the context
<code>as_target_processor()</code> this method forwards all its arguments to
Wav2Vec2CTCTokenizer’s <a href="/docs/transformers/pr_30674/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"><strong>call</strong>()</a>. Please refer to the docstring of the above two
methods for more information.`,Kn,Yo,ua,es,Ea,Vs=`When used in normal mode, this method forwards all its arguments to the feature extractor’s
<code>~FeatureExtractionMixin.pad</code> and returns its output. If used in the context
<code>as_target_processor()</code> this method forwards all its arguments to
Wav2Vec2CTCTokenizer’s <a href="/docs/transformers/pr_30674/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.pad">pad()</a>. Please refer to the docstring of the above two methods
for more information.`,ts,Vo,fa,os,Pa,Js='Instantiate a <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2ProcessorWithLM">Wav2Vec2ProcessorWithLM</a> from a pretrained Wav2Vec2 processor.',as,Ho,ns,Qa,ga,ss,oo,_a,rs,Sa,Cs="Batch decode output logits to audio transcription with language model support.",ls,Lo,is,Aa,$s=`Example:
See <a href="#decoding-multiple-audios">Decoding multiple audios</a>.`,cs,Jo,va,ds,Da,Fs="Decode output logits to audio transcription with language model support.",ps,Eo,bn,ba,Us="### Decoding multiple audios",yn,ya,Zs=`If you are planning to decode multiple batches of audios, you should consider using <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2ProcessorWithLM.batch_decode">batch_decode()</a> and passing an instantiated <code>multiprocessing.Pool</code>.
Otherwise, <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2ProcessorWithLM.batch_decode">batch_decode()</a> performance will be slower than calling <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2ProcessorWithLM.decode">decode()</a> for each audio individually, as it internally instantiates a new <code>Pool</code> for every call. See the example below:`,wn,wa,Mn,Ma,zs="## Wav2Vec2 specific outputs[[transformers.models.wav2vec2_with_lm.processing_wav2vec2_with_lm.Wav2Vec2DecoderWithLMOutput]]",Tn,Zo,Ta,ms,Oa,Is="Output type of <code>Wav2Vec2DecoderWithLM</code>, with transcription.",jn,zo,ja,hs,Ka,Bs="Base class for models that have been trained with the Wav2Vec2 loss objective.",kn,Io,ka,us,en,Xs='Output type of <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2ForPreTraining">Wav2Vec2ForPreTraining</a>, with potential hidden states and attentions.',Wn,ho,Wa,fs,tn,Gs="Output type of <code>FlaxWav2Vec2BaseModelOutput</code>, with potential hidden states and attentions.",gs,Po,xa,_s,on,Rs="“Returns a new object replacing the specified fields with new values.",xn,uo,Va,vs,an,Ns="Output type of <code>FlaxWav2Vec2ForPreTrainingOutput</code>, with potential hidden states and attentions.",bs,Qo,Ja,ys,nn,qs="“Returns a new object replacing the specified fields with new values.",Vn,So,Jn,Ca,Cn,fn,$n;return M=new dt({props:{title:"Wav2Vec2",local:"wav2vec2",headingTag:"h1"}}),T=new dt({props:{title:"Overview",local:"overview",headingTag:"h2"}}),ee=new dt({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),B=new dt({props:{title:"Using Flash Attention 2",local:"using-flash-attention-2",headingTag:"h2"}}),ae=new dt({props:{title:"Installation",local:"installation",headingTag:"h3"}}),S=new at({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1VJTIwZmxhc2gtYXR0biUyMC0tbm8tYnVpbGQtaXNvbGF0aW9u",highlighted:"pip install -U flash-attn --no-build-isolation",wrap:!1}}),Te=new dt({props:{title:"Usage",local:"usage",headingTag:"h3"}}),ke=new at({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFdhdjJWZWMyTW9kZWwlMEE=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2Model

model = Wav2Vec2Model.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-large-960h-lv60-self&quot;</span>, torch_dtype=torch.float16, attn_implementation=<span class="hljs-string">&quot;flash_attention_2&quot;</span>).to(device)
...`,wrap:!1}}),I=new dt({props:{title:"Expected speedups",local:"expected-speedups",headingTag:"h3"}}),q=new dt({props:{title:"Resources",local:"resources",headingTag:"h2"}}),J=new Ls({props:{pipeline:"audio-classification"}}),Y=new Ls({props:{pipeline:"automatic-speech-recognition"}}),jt=new dt({props:{title:"Wav2Vec2Config",local:"transformers.Wav2Vec2Config",headingTag:"h2"}}),kt=new F({props:{name:"class transformers.Wav2Vec2Config",anchor:"transformers.Wav2Vec2Config",parameters:[{name:"vocab_size",val:" = 32"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout",val:" = 0.1"},{name:"activation_dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.1"},{name:"feat_proj_dropout",val:" = 0.0"},{name:"feat_quantizer_dropout",val:" = 0.0"},{name:"final_dropout",val:" = 0.1"},{name:"layerdrop",val:" = 0.1"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"feat_extract_norm",val:" = 'group'"},{name:"feat_extract_activation",val:" = 'gelu'"},{name:"conv_dim",val:" = (512, 512, 512, 512, 512, 512, 512)"},{name:"conv_stride",val:" = (5, 2, 2, 2, 2, 2, 2)"},{name:"conv_kernel",val:" = (10, 3, 3, 3, 3, 2, 2)"},{name:"conv_bias",val:" = False"},{name:"num_conv_pos_embeddings",val:" = 128"},{name:"num_conv_pos_embedding_groups",val:" = 16"},{name:"do_stable_layer_norm",val:" = False"},{name:"apply_spec_augment",val:" = True"},{name:"mask_time_prob",val:" = 0.05"},{name:"mask_time_length",val:" = 10"},{name:"mask_time_min_masks",val:" = 2"},{name:"mask_feature_prob",val:" = 0.0"},{name:"mask_feature_length",val:" = 10"},{name:"mask_feature_min_masks",val:" = 0"},{name:"num_codevectors_per_group",val:" = 320"},{name:"num_codevector_groups",val:" = 2"},{name:"contrastive_logits_temperature",val:" = 0.1"},{name:"num_negatives",val:" = 100"},{name:"codevector_dim",val:" = 256"},{name:"proj_codevector_dim",val:" = 256"},{name:"diversity_loss_weight",val:" = 0.1"},{name:"ctc_loss_reduction",val:" = 'sum'"},{name:"ctc_zero_infinity",val:" = False"},{name:"use_weighted_layer_sum",val:" = False"},{name:"classifier_proj_size",val:" = 256"},{name:"tdnn_dim",val:" = (512, 512, 512, 512, 1500)"},{name:"tdnn_kernel",val:" = (5, 3, 3, 1, 1)"},{name:"tdnn_dilation",val:" = (1, 2, 3, 1, 1)"},{name:"xvector_output_dim",val:" = 512"},{name:"pad_token_id",val:" = 0"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"add_adapter",val:" = False"},{name:"adapter_kernel_size",val:" = 3"},{name:"adapter_stride",val:" = 2"},{name:"num_adapter_layers",val:" = 3"},{name:"output_hidden_size",val:" = None"},{name:"adapter_attn_dim",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2Config.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Vocabulary size of the Wav2Vec2 model. Defines the number of different tokens that can be represented by
the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2Model">Wav2Vec2Model</a> or <a href="/docs/transformers/pr_30674/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/pr_30674/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.activation_dropout",description:`<strong>activation_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for activations inside the fully connected layer.`,name:"activation_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/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC">Wav2Vec2ForCTC</a>.`,name:"final_dropout"},{anchor:"transformers.Wav2Vec2Config.layerdrop",description:`<strong>layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The LayerDrop probability. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>) for more
details.`,name:"layerdrop"},{anchor:"transformers.Wav2Vec2Config.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.Wav2Vec2Config.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.Wav2Vec2Config.feat_extract_norm",description:`<strong>feat_extract_norm</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;group&quot;</code>) &#x2014;
The norm to be applied to 1D convolutional layers in feature encoder. One of <code>&quot;group&quot;</code> for group
normalization of only the first 1D convolutional layer or <code>&quot;layer&quot;</code> for layer normalization of all 1D
convolutional layers.`,name:"feat_extract_norm"},{anchor:"transformers.Wav2Vec2Config.feat_proj_dropout",description:`<strong>feat_proj_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for output of the feature encoder.`,name:"feat_proj_dropout"},{anchor:"transformers.Wav2Vec2Config.feat_extract_activation",description:"<strong>feat_extract_activation</strong> (<code>str, </code>optional<code>, defaults to </code>&#x201C;gelu&#x201D;<code>) -- The non-linear activation function (function or string) in the 1D convolutional layers of the feature extractor. If string, </code>&#x201C;gelu&#x201D;<code>, </code>&#x201C;relu&#x201D;<code>, </code>&#x201C;selu&#x201D;<code>and</code>&#x201C;gelu_new&#x201D;` are supported.",name:"feat_extract_activation"},{anchor:"transformers.Wav2Vec2Config.feat_quantizer_dropout",description:`<strong>feat_quantizer_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability 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 probability 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/pr_30674/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/pr_30674/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/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2ForSequenceClassification">Wav2Vec2ForSequenceClassification</a>.`,name:"use_weighted_layer_sum"},{anchor:"transformers.Wav2Vec2Config.classifier_proj_size",description:`<strong>classifier_proj_size</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Dimensionality of the projection before token mean-pooling for classification.`,name:"classifier_proj_size"},{anchor:"transformers.Wav2Vec2Config.tdnn_dim",description:`<strong>tdnn_dim</strong> (<code>Tuple[int]</code> or <code>List[int]</code>, <em>optional</em>, defaults to <code>(512, 512, 512, 512, 1500)</code>) &#x2014;
A tuple of integers defining the number of output channels of each 1D convolutional layer in the <em>TDNN</em>
module of the <em>XVector</em> model. The length of <em>tdnn_dim</em> defines the number of <em>TDNN</em> layers.`,name:"tdnn_dim"},{anchor:"transformers.Wav2Vec2Config.tdnn_kernel",description:`<strong>tdnn_kernel</strong> (<code>Tuple[int]</code> or <code>List[int]</code>, <em>optional</em>, defaults to <code>(5, 3, 3, 1, 1)</code>) &#x2014;
A tuple of integers defining the kernel size of each 1D convolutional layer in the <em>TDNN</em> module of the
<em>XVector</em> model. The length of <em>tdnn_kernel</em> has to match the length of <em>tdnn_dim</em>.`,name:"tdnn_kernel"},{anchor:"transformers.Wav2Vec2Config.tdnn_dilation",description:`<strong>tdnn_dilation</strong> (<code>Tuple[int]</code> or <code>List[int]</code>, <em>optional</em>, defaults to <code>(1, 2, 3, 1, 1)</code>) &#x2014;
A tuple of integers defining the dilation factor of each 1D convolutional layer in <em>TDNN</em> module of the
<em>XVector</em> model. The length of <em>tdnn_dilation</em> has to match the length of <em>tdnn_dim</em>.`,name:"tdnn_dilation"},{anchor:"transformers.Wav2Vec2Config.xvector_output_dim",description:`<strong>xvector_output_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of the <em>XVector</em> embedding vectors.`,name:"xvector_output_dim"},{anchor:"transformers.Wav2Vec2Config.add_adapter",description:`<strong>add_adapter</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether a convolutional network should be stacked on top of the Wav2Vec2 Encoder. Can be very useful for
warm-starting Wav2Vec2 for SpeechEncoderDecoder models.`,name:"add_adapter"},{anchor:"transformers.Wav2Vec2Config.adapter_kernel_size",description:`<strong>adapter_kernel_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Kernel size of the convolutional layers in the adapter network. Only relevant if <code>add_adapter is True</code>.`,name:"adapter_kernel_size"},{anchor:"transformers.Wav2Vec2Config.adapter_stride",description:`<strong>adapter_stride</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
Stride of the convolutional layers in the adapter network. Only relevant if <code>add_adapter is True</code>.`,name:"adapter_stride"},{anchor:"transformers.Wav2Vec2Config.num_adapter_layers",description:`<strong>num_adapter_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Number of convolutional layers that should be used in the adapter network. Only relevant if <code>add_adapter is True</code>.`,name:"num_adapter_layers"},{anchor:"transformers.Wav2Vec2Config.adapter_attn_dim",description:`<strong>adapter_attn_dim</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Dimension of the attention adapter weights to be used in each attention block. An example of a model using
attention adapters is <a href="https://huggingface.co/facebook/mms-1b-all" rel="nofollow">facebook/mms-1b-all</a>.`,name:"adapter_attn_dim"},{anchor:"transformers.Wav2Vec2Config.output_hidden_size",description:`<strong>output_hidden_size</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Dimensionality of the encoder output layer. If not defined, this defaults to <em>hidden-size</em>. Only relevant
if <code>add_adapter is True</code>.`,name:"output_hidden_size"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2/configuration_wav2vec2.py#L27"}}),k=new Zt({props:{anchor:"transformers.Wav2Vec2Config.example",$$slots:{default:[er]},$$scope:{ctx:W}}}),xe=new F({props:{name:"class transformers.Wav2Vec2CTCTokenizer",anchor:"transformers.Wav2Vec2CTCTokenizer",parameters:[{name:"vocab_file",val:""},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"word_delimiter_token",val:" = '|'"},{name:"replace_word_delimiter_char",val:" = ' '"},{name:"do_lower_case",val:" = False"},{name:"target_lang",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2CTCTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.Wav2Vec2CTCTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sentence token.`,name:"bos_token"},{anchor:"transformers.Wav2Vec2CTCTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sentence token.`,name:"eos_token"},{anchor:"transformers.Wav2Vec2CTCTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.Wav2Vec2CTCTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.Wav2Vec2CTCTokenizer.word_delimiter_token",description:`<strong>word_delimiter_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;|&quot;</code>) &#x2014;
The token used for defining the end of a word.`,name:"word_delimiter_token"},{anchor:"transformers.Wav2Vec2CTCTokenizer.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to accept lowercase input and lowercase the output when decoding.`,name:"do_lower_case"},{anchor:"transformers.Wav2Vec2CTCTokenizer.target_lang",description:`<strong>target_lang</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A target language the tokenizer should set by default. <code>target_lang</code> has to be defined for multi-lingual,
nested vocabulary such as <a href="https://huggingface.co/facebook/mms-1b-all" rel="nofollow">facebook/mms-1b-all</a>.</p>
<p>**kwargs &#x2014;
Additional keyword arguments passed along to <a href="/docs/transformers/pr_30674/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>`,name:"target_lang"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2/tokenization_wav2vec2.py#L115"}}),xt=new F({props:{name:"__call__",anchor:"transformers.Wav2Vec2CTCTokenizer.__call__",parameters:[{name:"text",val:": Union = None"},{name:"text_pair",val:": Union = None"},{name:"text_target",val:": Union = None"},{name:"text_pair_target",val:": Union = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": Union = False"},{name:"truncation",val:": Union = None"},{name:"max_length",val:": Optional = None"},{name:"stride",val:": int = 0"},{name:"is_split_into_words",val:": bool = False"},{name:"pad_to_multiple_of",val:": Optional = None"},{name:"return_tensors",val:": Union = None"},{name:"return_token_type_ids",val:": Optional = None"},{name:"return_attention_mask",val:": Optional = 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 add special tokens when encoding the sequences. This will use the underlying
<code>PretrainedTokenizerBase.build_inputs_with_special_tokens</code> function, which defines which tokens are
automatically added to the input ids. This is usefull if you want to add <code>bos</code> or <code>eos</code> tokens
automatically.`,name:"add_special_tokens"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_30674/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/pr_30674/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls truncation. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or
to the maximum acceptable input length for the model if that argument is not provided. This will
truncate token by token, removing a token from the longest sequence in the pair if a pair of
sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the first sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_second&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>False</code> or <code>&apos;do_not_truncate&apos;</code> (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).</li>
</ul>`,name:"truncation"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Controls the maximum length to use by one of the truncation/padding parameters.</p>
<p>If left unset or set to <code>None</code>, this will use the predefined model maximum length if a maximum length
is required by one of the truncation/padding parameters. If the model has no specific maximum input
length (like XLNet) truncation/padding to a maximum length will be deactivated.`,name:"max_length"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.stride",description:`<strong>stride</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If set to a number along with <code>max_length</code>, the overflowing tokens returned when
<code>return_overflowing_tokens=True</code> will contain some tokens from the end of the truncated sequence
returned to provide some overlap between truncated and overflowing sequences. The value of this
argument defines the number of overlapping tokens.`,name:"stride"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.is_split_into_words",description:`<strong>is_split_into_words</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the input is already pre-tokenized (e.g., split into words). If set to <code>True</code>, the
tokenizer assumes the input is already split into words (for instance, by splitting it on whitespace)
which it will tokenize. This is useful for NER or token classification.`,name:"is_split_into_words"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If set will pad the sequence to a multiple of the provided value. Requires <code>padding</code> to be activated.
This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability
<code>&gt;= 7.5</code> (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.Wav2Vec2CTCTokenizer.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_30674/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/pr_30674/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/vr_30674/src/transformers/tokenization_utils_base.py#L2859",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30674/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a> with the following fields:</p>
<ul>
<li>
<p><strong>input_ids</strong> — 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> — List of token type ids to be fed to a model (when <code>return_token_type_ids=True</code> or
if <em>“token_type_ids”</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> — List of indices specifying which tokens should be attended to by the model (when
<code>return_attention_mask=True</code> or if <em>“attention_mask”</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> — 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> — 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> — 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> — The length of the inputs (when <code>return_length=True</code>)</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_30674/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),ao=new F({props:{name:"save_vocabulary",anchor:"transformers.Wav2Vec2CTCTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": Optional = None"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2/tokenization_wav2vec2.py#L633"}}),Jt=new F({props:{name:"decode",anchor:"transformers.Wav2Vec2CTCTokenizer.decode",parameters:[{name:"token_ids",val:": Union"},{name:"skip_special_tokens",val:": bool = False"},{name:"clean_up_tokenization_spaces",val:": bool = None"},{name:"output_char_offsets",val:": bool = False"},{name:"output_word_offsets",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2CTCTokenizer.decode.token_ids",description:`<strong>token_ids</strong> (<code>Union[int, List[int], np.ndarray, torch.Tensor, tf.Tensor]</code>) &#x2014;
List of tokenized input ids. Can be obtained using the <code>__call__</code> method.`,name:"token_ids"},{anchor:"transformers.Wav2Vec2CTCTokenizer.decode.skip_special_tokens",description:`<strong>skip_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to remove special tokens in the decoding.`,name:"skip_special_tokens"},{anchor:"transformers.Wav2Vec2CTCTokenizer.decode.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to clean up the tokenization spaces.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.Wav2Vec2CTCTokenizer.decode.output_char_offsets",description:`<strong>output_char_offsets</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to output character offsets. Character offsets can be used in combination with the
sampling rate and model downsampling rate to compute the time-stamps of transcribed characters.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>Please take a look at the example below to better understand how to make use of <code>output_char_offsets</code>.</p>

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

					</div>`,name:"output_word_offsets"},{anchor:"transformers.Wav2Vec2CTCTokenizer.decode.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Will be passed to the underlying model specific decode method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2/tokenization_wav2vec2.py#L528",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>str</code> or <code>Wav2Vec2CTCTokenizerOutput</code></p>
`}}),Ct=new Zt({props:{anchor:"transformers.Wav2Vec2CTCTokenizer.decode.example",$$slots:{default:[tr]},$$scope:{ctx:W}}}),Xt=new F({props:{name:"batch_decode",anchor:"transformers.Wav2Vec2CTCTokenizer.batch_decode",parameters:[{name:"sequences",val:": Union"},{name:"skip_special_tokens",val:": bool = False"},{name:"clean_up_tokenization_spaces",val:": bool = None"},{name:"output_char_offsets",val:": bool = False"},{name:"output_word_offsets",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2CTCTokenizer.batch_decode.sequences",description:`<strong>sequences</strong> (<code>Union[List[int], List[List[int]], np.ndarray, torch.Tensor, tf.Tensor]</code>) &#x2014;
List of tokenized input ids. Can be obtained using the <code>__call__</code> method.`,name:"sequences"},{anchor:"transformers.Wav2Vec2CTCTokenizer.batch_decode.skip_special_tokens",description:`<strong>skip_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to remove special tokens in the decoding.`,name:"skip_special_tokens"},{anchor:"transformers.Wav2Vec2CTCTokenizer.batch_decode.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to clean up the tokenization spaces.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.Wav2Vec2CTCTokenizer.batch_decode.output_char_offsets",description:`<strong>output_char_offsets</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to output character offsets. Character offsets can be used in combination with the
sampling rate and model downsampling rate to compute the time-stamps of transcribed characters.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>Please take a look at the Example of <a href="/docs/transformers/pr_30674/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/pr_30674/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/pr_30674/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/pr_30674/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/vr_30674/src/transformers/models/wav2vec2/tokenization_wav2vec2.py#L458",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[str]</code> or <code>Wav2Vec2CTCTokenizerOutput</code></p>
`}}),Ne=new F({props:{name:"set_target_lang",anchor:"transformers.Wav2Vec2CTCTokenizer.set_target_lang",parameters:[{name:"target_lang",val:": str"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2/tokenization_wav2vec2.py#L198"}}),Kt=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/pr_30674/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/vr_30674/src/transformers/models/wav2vec2/feature_extraction_wav2vec2.py#L31"}}),Gt=new F({props:{name:"__call__",anchor:"transformers.Wav2Vec2FeatureExtractor.__call__",parameters:[{name:"raw_speech",val:": Union"},{name:"padding",val:": Union = False"},{name:"max_length",val:": Optional = None"},{name:"truncation",val:": bool = False"},{name:"pad_to_multiple_of",val:": Optional = None"},{name:"return_attention_mask",val:": Optional = None"},{name:"return_tensors",val:": Union = None"},{name:"sampling_rate",val:": Optional = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2FeatureExtractor.__call__.raw_speech",description:`<strong>raw_speech</strong> (<code>np.ndarray</code>, <code>List[float]</code>, <code>List[np.ndarray]</code>, <code>List[List[float]]</code>) &#x2014;
The sequence or batch of sequences to be padded. Each sequence can be a numpy array, a list of float
values, a list of numpy arrays or a list of list of float values. Must be mono channel audio, not
stereo, i.e. single float per timestep.`,name:"raw_speech"},{anchor:"transformers.Wav2Vec2FeatureExtractor.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_30674/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/pr_30674/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/vr_30674/src/transformers/models/wav2vec2/feature_extraction_wav2vec2.py#L102"}}),Rt=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/pr_30674/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/pr_30674/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
An instance of <a href="/docs/transformers/pr_30674/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2/processing_wav2vec2.py#L27"}}),Le=new F({props:{name:"__call__",anchor:"transformers.Wav2Vec2Processor.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2/processing_wav2vec2.py#L69"}}),we=new F({props:{name:"pad",anchor:"transformers.Wav2Vec2Processor.pad",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2/processing_wav2vec2.py#L107"}}),Wo=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/vr_30674/src/transformers/models/wav2vec2/processing_wav2vec2.py#L50"}}),ia=new F({props:{name:"save_pretrained",anchor:"transformers.Wav2Vec2Processor.save_pretrained",parameters:[{name:"save_directory",val:""},{name:"push_to_hub",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2Processor.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory where the feature extractor JSON file and the tokenizer files will be saved (directory will
be created if it does not exist).`,name:"save_directory"},{anchor:"transformers.Wav2Vec2Processor.save_pretrained.push_to_hub",description:`<strong>push_to_hub</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to push your model to the Hugging Face model hub after saving it. You can specify the
repository you want to push to with <code>repo_id</code> (will default to the name of <code>save_directory</code> in your
namespace).`,name:"push_to_hub"},{anchor:"transformers.Wav2Vec2Processor.save_pretrained.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional key word arguments passed along to the <a href="/docs/transformers/pr_30674/en/main_classes/model#transformers.utils.PushToHubMixin.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/processing_utils.py#L168"}}),Go=new pt({props:{$$slots:{default:[or]},$$scope:{ctx:W}}}),ca=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/vr_30674/src/transformers/models/wav2vec2/processing_wav2vec2.py#L137"}}),da=new F({props:{name:"decode",anchor:"transformers.Wav2Vec2Processor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2/processing_wav2vec2.py#L144"}}),ma=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/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor">Wav2Vec2FeatureExtractor</a> or <a href="/docs/transformers/pr_30674/en/model_doc/seamless_m4t#transformers.SeamlessM4TFeatureExtractor">SeamlessM4TFeatureExtractor</a>) &#x2014;
An instance of <a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor">Wav2Vec2FeatureExtractor</a> or <a href="/docs/transformers/pr_30674/en/model_doc/seamless_m4t#transformers.SeamlessM4TFeatureExtractor">SeamlessM4TFeatureExtractor</a>. The feature extractor is a required input.`,name:"feature_extractor"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/pr_30674/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer">Wav2Vec2CTCTokenizer</a>) &#x2014;
An instance of <a href="/docs/transformers/pr_30674/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/vr_30674/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L68"}}),ha=new F({props:{name:"__call__",anchor:"transformers.Wav2Vec2ProcessorWithLM.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L221"}}),ua=new F({props:{name:"pad",anchor:"transformers.Wav2Vec2ProcessorWithLM.pad",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L260"}}),fa=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.</li>
<li>a path to a <em>directory</em> containing a feature extractor file saved using the
<a href="/docs/transformers/pr_30674/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/pr_30674/en/main_classes/feature_extractor#transformers.SequenceFeatureExtractor">SequenceFeatureExtractor</a> and
<a href="/docs/transformers/pr_30674/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a></li>
</ul>`,name:"pretrained_model_name_or_path"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L119"}}),Ho=new pt({props:{$$slots:{default:[ar]},$$scope:{ctx:W}}}),ga=new F({props:{name:"save_pretrained",anchor:"transformers.Wav2Vec2ProcessorWithLM.save_pretrained",parameters:[{name:"save_directory",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L115"}}),_a=new F({props:{name:"batch_decode",anchor:"transformers.Wav2Vec2ProcessorWithLM.batch_decode",parameters:[{name:"logits",val:": ndarray"},{name:"pool",val:": Optional = None"},{name:"num_processes",val:": Optional = None"},{name:"beam_width",val:": Optional = None"},{name:"beam_prune_logp",val:": Optional = None"},{name:"token_min_logp",val:": Optional = None"},{name:"hotwords",val:": Optional = None"},{name:"hotword_weight",val:": Optional = None"},{name:"alpha",val:": Optional = None"},{name:"beta",val:": Optional = None"},{name:"unk_score_offset",val:": Optional = None"},{name:"lm_score_boundary",val:": Optional = None"},{name:"output_word_offsets",val:": bool = False"},{name:"n_best",val:": int = 1"}],parametersDescription:[{anchor:"transformers.Wav2Vec2ProcessorWithLM.batch_decode.logits",description:`<strong>logits</strong> (<code>np.ndarray</code>) &#x2014;
The logits output vector of the model representing the log probabilities for each token.`,name:"logits"},{anchor:"transformers.Wav2Vec2ProcessorWithLM.batch_decode.pool",description:`<strong>pool</strong> (<code>multiprocessing.Pool</code>, <em>optional</em>) &#x2014;
An optional user-managed pool. If not set, one will be automatically created and closed. The pool
should be instantiated <em>after</em> <code>Wav2Vec2ProcessorWithLM</code>. Otherwise, the LM won&#x2019;t be available to the
pool&#x2019;s sub-processes.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>Currently, only pools created with a &#x2018;fork&#x2019; context can be used. If a &#x2018;spawn&#x2019; pool is passed, it will
be ignored and sequential decoding will be used instead.</p>

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

					</div>`,name:"n_best"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L291",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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

					</div>`,name:"n_best"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L476",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>~models.wav2vec2.Wav2Vec2DecoderWithLMOutput</code>.</p>
`}}),Eo=new Zt({props:{anchor:"transformers.Wav2Vec2ProcessorWithLM.decode.example",$$slots:{default:[sr]},$$scope:{ctx:W}}}),wa=new at({props:{code:"JTIzJTIwTGV0J3MlMjBzZWUlMjBob3clMjB0byUyMHVzZSUyMGElMjB1c2VyLW1hbmFnZWQlMjBwb29sJTIwZm9yJTIwYmF0Y2glMjBkZWNvZGluZyUyMG11bHRpcGxlJTIwYXVkaW9zJTBBZnJvbSUyMG11bHRpcHJvY2Vzc2luZyUyMGltcG9ydCUyMGdldF9jb250ZXh0JTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvUHJvY2Vzc29yJTJDJTIwQXV0b01vZGVsRm9yQ1RDJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBaW1wb3J0JTIwZGF0YXNldHMlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQSUyMyUyMGltcG9ydCUyMG1vZGVsJTJDJTIwZmVhdHVyZSUyMGV4dHJhY3RvciUyQyUyMHRva2VuaXplciUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ1RDLmZyb21fcHJldHJhaW5lZCglMjJwYXRyaWNrdm9ucGxhdGVuJTJGd2F2MnZlYzItYmFzZS0xMDBoLXdpdGgtbG0lMjIpLnRvKCUyMmN1ZGElMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIycGF0cmlja3ZvbnBsYXRlbiUyRndhdjJ2ZWMyLWJhc2UtMTAwaC13aXRoLWxtJTIyKSUwQSUwQSUyMyUyMGxvYWQlMjBleGFtcGxlJTIwZGF0YXNldCUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaGYtaW50ZXJuYWwtdGVzdGluZyUyRmxpYnJpc3BlZWNoX2Fzcl9kdW1teSUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWRhdGFzZXQlMjAlM0QlMjBkYXRhc2V0LmNhc3RfY29sdW1uKCUyMmF1ZGlvJTIyJTJDJTIwZGF0YXNldHMuQXVkaW8oc2FtcGxpbmdfcmF0ZSUzRDE2XzAwMCkpJTBBJTBBJTBBZGVmJTIwbWFwX3RvX2FycmF5KGJhdGNoKSUzQSUwQSUyMCUyMCUyMCUyMGJhdGNoJTVCJTIyc3BlZWNoJTIyJTVEJTIwJTNEJTIwYmF0Y2glNUIlMjJhdWRpbyUyMiU1RCU1QiUyMmFycmF5JTIyJTVEJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwYmF0Y2glMEElMEElMEElMjMlMjBwcmVwYXJlJTIwc3BlZWNoJTIwZGF0YSUyMGZvciUyMGJhdGNoJTIwaW5mZXJlbmNlJTBBZGF0YXNldCUyMCUzRCUyMGRhdGFzZXQubWFwKG1hcF90b19hcnJheSUyQyUyMHJlbW92ZV9jb2x1bW5zJTNEJTVCJTIyYXVkaW8lMjIlNUQpJTBBJTBBJTBBZGVmJTIwbWFwX3RvX3ByZWQoYmF0Y2glMkMlMjBwb29sKSUzQSUwQSUyMCUyMCUyMCUyMGlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihiYXRjaCU1QiUyMnNwZWVjaCUyMiU1RCUyQyUyMHNhbXBsaW5nX3JhdGUlM0QxNl8wMDAlMkMlMjBwYWRkaW5nJTNEVHJ1ZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTIwJTIwJTIwJTIwaW5wdXRzJTIwJTNEJTIwJTdCayUzQSUyMHYudG8oJTIyY3VkYSUyMiklMjBmb3IlMjBrJTJDJTIwdiUyMGluJTIwaW5wdXRzLml0ZW1zKCklN0QlMEElMEElMjAlMjAlMjAlMjB3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMCUyMCUyMCUyMHRyYW5zY3JpcHRpb24lMjAlM0QlMjBwcm9jZXNzb3IuYmF0Y2hfZGVjb2RlKGxvZ2l0cy5jcHUoKS5udW1weSgpJTJDJTIwcG9vbCkudGV4dCUwQSUyMCUyMCUyMCUyMGJhdGNoJTVCJTIydHJhbnNjcmlwdGlvbiUyMiU1RCUyMCUzRCUyMHRyYW5zY3JpcHRpb24lMEElMjAlMjAlMjAlMjByZXR1cm4lMjBiYXRjaCUwQSUwQSUwQSUyMyUyMG5vdGUlM0ElMjBwb29sJTIwc2hvdWxkJTIwYmUlMjBpbnN0YW50aWF0ZWQlMjAqYWZ0ZXIqJTIwJTYwV2F2MlZlYzJQcm9jZXNzb3JXaXRoTE0lNjAuJTBBJTIzJTIwJTIwJTIwJTIwJTIwJTIwJTIwb3RoZXJ3aXNlJTJDJTIwdGhlJTIwTE0lMjB3b24ndCUyMGJlJTIwYXZhaWxhYmxlJTIwdG8lMjB0aGUlMjBwb29sJ3MlMjBzdWItcHJvY2Vzc2VzJTBBJTIzJTIwc2VsZWN0JTIwbnVtYmVyJTIwb2YlMjBwcm9jZXNzZXMlMjBhbmQlMjBiYXRjaF9zaXplJTIwYmFzZWQlMjBvbiUyMG51bWJlciUyMG9mJTIwQ1BVJTIwY29yZXMlMjBhdmFpbGFibGUlMjBhbmQlMjBvbiUyMGRhdGFzZXQlMjBzaXplJTBBd2l0aCUyMGdldF9jb250ZXh0KCUyMmZvcmslMjIpLlBvb2wocHJvY2Vzc2VzJTNEMiklMjBhcyUyMHBvb2wlM0ElMEElMjAlMjAlMjAlMjByZXN1bHQlMjAlM0QlMjBkYXRhc2V0Lm1hcCglMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBtYXBfdG9fcHJlZCUyQyUyMGJhdGNoZWQlM0RUcnVlJTJDJTIwYmF0Y2hfc2l6ZSUzRDIlMkMlMjBmbl9rd2FyZ3MlM0QlN0IlMjJwb29sJTIyJTNBJTIwcG9vbCU3RCUyQyUyMHJlbW92ZV9jb2x1bW5zJTNEJTVCJTIyc3BlZWNoJTIyJTVEJTBBJTIwJTIwJTIwJTIwKSUwQSUwQXJlc3VsdCU1QiUyMnRyYW5zY3JpcHRpb24lMjIlNUQlNUIlM0EyJTVE",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>]`,wrap:!1}}),Ta=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:": Union"},{name:"logit_score",val:": Union = None"},{name:"lm_score",val:": Union = None"},{name:"word_offsets",val:": Union = None"}],parametersDescription:[{anchor:"transformers.models.wav2vec2_with_lm.processing_wav2vec2_with_lm.Wav2Vec2DecoderWithLMOutput.text",description:`<strong>text</strong> (list of <code>str</code> or <code>str</code>) &#x2014;
Decoded logits in text from. Usually the speech transcription.`,name:"text"},{anchor:"transformers.models.wav2vec2_with_lm.processing_wav2vec2_with_lm.Wav2Vec2DecoderWithLMOutput.logit_score",description:`<strong>logit_score</strong> (list of <code>float</code> or <code>float</code>) &#x2014;
Total logit score of the beams associated with produced text.`,name:"logit_score"},{anchor:"transformers.models.wav2vec2_with_lm.processing_wav2vec2_with_lm.Wav2Vec2DecoderWithLMOutput.lm_score",description:`<strong>lm_score</strong> (list of <code>float</code>) &#x2014;
Fused lm_score of the beams associated with produced text.`,name:"lm_score"},{anchor:"transformers.models.wav2vec2_with_lm.processing_wav2vec2_with_lm.Wav2Vec2DecoderWithLMOutput.word_offsets",description:`<strong>word_offsets</strong> (list of <code>List[Dict[str, Union[int, str]]]</code> or <code>List[Dict[str, Union[int, str]]]</code>) &#x2014;
Offsets of the decoded words. In combination with sampling rate and model downsampling rate word offsets
can be used to compute time stamps for each word.`,name:"word_offsets"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py#L45"}}),ja=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:": Optional = None"},{name:"attentions",val:": Optional = 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/vr_30674/src/transformers/modeling_outputs.py#L1376"}}),ka=new F({props:{name:"class transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForPreTrainingOutput",anchor:"transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForPreTrainingOutput",parameters:[{name:"loss",val:": Optional = None"},{name:"projected_states",val:": FloatTensor = None"},{name:"projected_quantized_states",val:": FloatTensor = None"},{name:"codevector_perplexity",val:": FloatTensor = None"},{name:"hidden_states",val:": Optional = None"},{name:"attentions",val:": Optional = None"},{name:"contrastive_loss",val:": Optional = None"},{name:"diversity_loss",val:": Optional = 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/vr_30674/src/transformers/models/wav2vec2/modeling_wav2vec2.py#L112"}}),Wa=new F({props:{name:"class transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2BaseModelOutput",anchor:"transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2BaseModelOutput",parameters:[{name:"last_hidden_state",val:": Array = None"},{name:"extract_features",val:": Array = None"},{name:"hidden_states",val:": Optional = None"},{name:"attentions",val:": Optional = 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/vr_30674/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L44"}}),xa=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/vr_30674/src/flax/struct.py#L111"}}),Va=new F({props:{name:"class transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2ForPreTrainingOutput",anchor:"transformers.models.wav2vec2.modeling_flax_wav2vec2.FlaxWav2Vec2ForPreTrainingOutput",parameters:[{name:"projected_states",val:": Array = None"},{name:"projected_quantized_states",val:": Array = None"},{name:"codevector_perplexity",val:": Array = None"},{name:"hidden_states",val:": Optional = None"},{name:"attentions",val:": Optional = 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/vr_30674/src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py#L74"}}),Ja=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/vr_30674/src/flax/struct.py#L111"}}),So=new Os({props:{pytorch:!0,tensorflow:!0,jax:!0,$$slots:{jax:[Br],tensorflow:[Jr],pytorch:[wr]},$$scope:{ctx:W}}}),Ca=new Ks({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/wav2vec2.md"}}),{c(){t=c("meta"),y=r(),n=c("p"),i=r(),u(M.$$.fragment),o=r(),u(T.$$.fragment),Ce=r(),X=c("p"),X.innerHTML=E,$e=r(),G=c("p"),G.textContent=P,Fe=r(),V=c("p"),V.innerHTML=z,Q=r(),se=c("p"),se.innerHTML=mt,Se=r(),K=c("p"),K.innerHTML=_e,Ue=r(),u(ee.$$.fragment),Ze=r(),de=c("ul"),de.innerHTML=Me,ht=r(),u(B.$$.fragment),te=r(),oe=c("p"),oe.textContent=Ae,N=r(),u(ae.$$.fragment),Xe=r(),ie=c("p"),ie.innerHTML=St,Ge=r(),R=c("p"),R.innerHTML=nt,ce=r(),u(S.$$.fragment),zt=r(),u(Te.$$.fragment),ze=r(),st=c("p"),st.innerHTML=Ye,je=r(),u(ke.$$.fragment),ut=r(),u(I.$$.fragment),pe=r(),D=c("p"),D.innerHTML=me,It=r(),ve=c("div"),ve.innerHTML=be,ft=r(),u(q.$$.fragment),De=r(),H=c("p"),H.textContent=rt,j=r(),u(J.$$.fragment),he=r(),A=c("ul"),A.innerHTML=Bt,O=r(),u(Y.$$.fragment),Yt=r(),yt=c("ul"),yt.innerHTML=gt,_o=r(),wt=c("p"),wt.textContent=_t,vo=r(),Mt=c("ul"),Mt.innerHTML=We,Tt=r(),u(jt.$$.fragment),ue=r(),fe=c("div"),u(kt.$$.fragment),He=r(),Ht=c("p"),Ht.innerHTML=Wt,lt=r(),Oe=c("p"),Oe.innerHTML=vt,re=r(),u(k.$$.fragment),U=r(),le=c("p"),le.textContent=ye,Re=r(),Z=c("div"),u(xe.$$.fragment),bo=r(),Lt=c("p"),Lt.textContent=pn,Oo=r(),Et=c("p"),Et.innerHTML=mn,Ko=r(),Ie=c("div"),u(xt.$$.fragment),ea=r(),Pt=c("p"),Pt.textContent=hn,ta=r(),Vt=c("div"),u(ao.$$.fragment),At=r(),it=c("div"),u(Jt.$$.fragment),Bo=r(),ge=c("p"),ge.textContent=yo,oa=r(),Qt=c("p"),Qt.innerHTML=un,aa=r(),u(Ct.$$.fragment),Za=r(),Dt=c("div"),u(Xt.$$.fragment),za=r(),wo=c("p"),wo.textContent=Co,Ia=r(),Ot=c("div"),u(Ne.$$.fragment),no=r(),Mo=c("p"),Mo.textContent=$o,na=r(),so=c("p"),so.textContent=ro,Xo=r(),Ve=c("div"),u(Kt.$$.fragment),lo=r(),io=c("p"),io.textContent=Ke,co=r(),To=c("p"),To.innerHTML=Fo,Ba=r(),eo=c("div"),u(Gt.$$.fragment),Xa=r(),jo=c("p"),jo.textContent=Uo,sa=r(),po=c("p"),po.textContent=$t,to=r(),ne=c("div"),u(Rt.$$.fragment),Ga=r(),ko=c("p"),ko.textContent=mo,ra=r(),Ft=c("p"),Ft.innerHTML=la,h=r(),x=c("div"),u(Le.$$.fragment),Ee=r(),et=c("p"),et.innerHTML=Nt,Pe=r(),qe=c("div"),u(we.$$.fragment),Ut=r(),Je=c("p"),Je.innerHTML=qt,ct=r(),tt=c("div"),u(Wo.$$.fragment),Ra=r(),xo=c("div"),u(ia.$$.fragment),Hn=r(),Na=c("p"),Na.innerHTML=Ms,Ln=r(),u(Go.$$.fragment),En=r(),Ro=c("div"),u(ca.$$.fragment),Pn=r(),qa=c("p"),qa.innerHTML=Ts,Qn=r(),No=c("div"),u(da.$$.fragment),Sn=r(),Ya=c("p"),Ya.innerHTML=js,_n=r(),pa=c("p"),pa.textContent=ks,vn=r(),Be=c("div"),u(ma.$$.fragment),An=r(),Ha=c("p"),Ha.textContent=Ws,Dn=r(),qo=c("div"),u(ha.$$.fragment),On=r(),La=c("p"),La.innerHTML=xs,Kn=r(),Yo=c("div"),u(ua.$$.fragment),es=r(),Ea=c("p"),Ea.innerHTML=Vs,ts=r(),Vo=c("div"),u(fa.$$.fragment),os=r(),Pa=c("p"),Pa.innerHTML=Js,as=r(),u(Ho.$$.fragment),ns=r(),Qa=c("div"),u(ga.$$.fragment),ss=r(),oo=c("div"),u(_a.$$.fragment),rs=r(),Sa=c("p"),Sa.textContent=Cs,ls=r(),u(Lo.$$.fragment),is=r(),Aa=c("p"),Aa.innerHTML=$s,cs=r(),Jo=c("div"),u(va.$$.fragment),ds=r(),Da=c("p"),Da.textContent=Fs,ps=r(),u(Eo.$$.fragment),bn=r(),ba=c("p"),ba.textContent=Us,yn=r(),ya=c("p"),ya.innerHTML=Zs,wn=r(),u(wa.$$.fragment),Mn=r(),Ma=c("p"),Ma.textContent=zs,Tn=r(),Zo=c("div"),u(Ta.$$.fragment),ms=r(),Oa=c("p"),Oa.innerHTML=Is,jn=r(),zo=c("div"),u(ja.$$.fragment),hs=r(),Ka=c("p"),Ka.textContent=Bs,kn=r(),Io=c("div"),u(ka.$$.fragment),us=r(),en=c("p"),en.innerHTML=Xs,Wn=r(),ho=c("div"),u(Wa.$$.fragment),fs=r(),tn=c("p"),tn.innerHTML=Gs,gs=r(),Po=c("div"),u(xa.$$.fragment),_s=r(),on=c("p"),on.textContent=Rs,xn=r(),uo=c("div"),u(Va.$$.fragment),vs=r(),an=c("p"),an.innerHTML=Ns,bs=r(),Qo=c("div"),u(Ja.$$.fragment),ys=r(),nn=c("p"),nn.textContent=qs,Vn=r(),u(So.$$.fragment),Jn=r(),u(Ca.$$.fragment),Cn=r(),fn=c("p"),this.h()},l(e){const w=As("svelte-u9bgzb",document.head);t=d(w,"META",{name:!0,content:!0}),w.forEach(s),y=l(e),n=d(e,"P",{}),C(n).forEach(s),i=l(e),f(M.$$.fragment,e),o=l(e),f(T.$$.fragment,e),Ce=l(e),X=d(e,"P",{"data-svelte-h":!0}),m(X)!=="svelte-1an18c0"&&(X.innerHTML=E),$e=l(e),G=d(e,"P",{"data-svelte-h":!0}),m(G)!=="svelte-vfdo9a"&&(G.textContent=P),Fe=l(e),V=d(e,"P",{"data-svelte-h":!0}),m(V)!=="svelte-11lu23i"&&(V.innerHTML=z),Q=l(e),se=d(e,"P",{"data-svelte-h":!0}),m(se)!=="svelte-1t6iyb9"&&(se.innerHTML=mt),Se=l(e),K=d(e,"P",{"data-svelte-h":!0}),m(K)!=="svelte-1bqdtpc"&&(K.innerHTML=_e),Ue=l(e),f(ee.$$.fragment,e),Ze=l(e),de=d(e,"UL",{"data-svelte-h":!0}),m(de)!=="svelte-1ypirdg"&&(de.innerHTML=Me),ht=l(e),f(B.$$.fragment,e),te=l(e),oe=d(e,"P",{"data-svelte-h":!0}),m(oe)!=="svelte-1r79v6g"&&(oe.textContent=Ae),N=l(e),f(ae.$$.fragment,e),Xe=l(e),ie=d(e,"P",{"data-svelte-h":!0}),m(ie)!=="svelte-ib5l43"&&(ie.innerHTML=St),Ge=l(e),R=d(e,"P",{"data-svelte-h":!0}),m(R)!=="svelte-1pp3dkd"&&(R.innerHTML=nt),ce=l(e),f(S.$$.fragment,e),zt=l(e),f(Te.$$.fragment,e),ze=l(e),st=d(e,"P",{"data-svelte-h":!0}),m(st)!=="svelte-10jrnsm"&&(st.innerHTML=Ye),je=l(e),f(ke.$$.fragment,e),ut=l(e),f(I.$$.fragment,e),pe=l(e),D=d(e,"P",{"data-svelte-h":!0}),m(D)!=="svelte-bjpb70"&&(D.innerHTML=me),It=l(e),ve=d(e,"DIV",{style:!0,"data-svelte-h":!0}),m(ve)!=="svelte-1xf428k"&&(ve.innerHTML=be),ft=l(e),f(q.$$.fragment,e),De=l(e),H=d(e,"P",{"data-svelte-h":!0}),m(H)!=="svelte-x9q80l"&&(H.textContent=rt),j=l(e),f(J.$$.fragment,e),he=l(e),A=d(e,"UL",{"data-svelte-h":!0}),m(A)!=="svelte-1o49ddd"&&(A.innerHTML=Bt),O=l(e),f(Y.$$.fragment,e),Yt=l(e),yt=d(e,"UL",{"data-svelte-h":!0}),m(yt)!=="svelte-d6eewz"&&(yt.innerHTML=gt),_o=l(e),wt=d(e,"P",{"data-svelte-h":!0}),m(wt)!=="svelte-lk14e4"&&(wt.textContent=_t),vo=l(e),Mt=d(e,"UL",{"data-svelte-h":!0}),m(Mt)!=="svelte-wbd9h3"&&(Mt.innerHTML=We),Tt=l(e),f(jt.$$.fragment,e),ue=l(e),fe=d(e,"DIV",{class:!0});var fo=C(fe);f(kt.$$.fragment,fo),He=l(fo),Ht=d(fo,"P",{"data-svelte-h":!0}),m(Ht)!=="svelte-h1g697"&&(Ht.innerHTML=Wt),lt=l(fo),Oe=d(fo,"P",{"data-svelte-h":!0}),m(Oe)!=="svelte-ffp72b"&&(Oe.innerHTML=vt),re=l(fo),f(k.$$.fragment,fo),fo.forEach(s),U=l(e),le=d(e,"P",{"data-svelte-h":!0}),m(le)!=="svelte-125lyc2"&&(le.textContent=ye),Re=l(e),Z=d(e,"DIV",{class:!0});var Qe=C(Z);f(xe.$$.fragment,Qe),bo=l(Qe),Lt=d(Qe,"P",{"data-svelte-h":!0}),m(Lt)!=="svelte-gxvlja"&&(Lt.textContent=pn),Oo=l(Qe),Et=d(Qe,"P",{"data-svelte-h":!0}),m(Et)!=="svelte-z7avt0"&&(Et.innerHTML=mn),Ko=l(Qe),Ie=d(Qe,"DIV",{class:!0});var $a=C(Ie);f(xt.$$.fragment,$a),ea=l($a),Pt=d($a,"P",{"data-svelte-h":!0}),m(Pt)!=="svelte-kpxj0c"&&(Pt.textContent=hn),$a.forEach(s),ta=l(Qe),Vt=d(Qe,"DIV",{class:!0});var gn=C(Vt);f(ao.$$.fragment,gn),gn.forEach(s),At=l(Qe),it=d(Qe,"DIV",{class:!0});var go=C(it);f(Jt.$$.fragment,go),Bo=l(go),ge=d(go,"P",{"data-svelte-h":!0}),m(ge)!=="svelte-vbfkpu"&&(ge.textContent=yo),oa=l(go),Qt=d(go,"P",{"data-svelte-h":!0}),m(Qt)!=="svelte-125uxon"&&(Qt.innerHTML=un),aa=l(go),f(Ct.$$.fragment,go),go.forEach(s),Za=l(Qe),Dt=d(Qe,"DIV",{class:!0});var Fa=C(Dt);f(Xt.$$.fragment,Fa),za=l(Fa),wo=d(Fa,"P",{"data-svelte-h":!0}),m(wo)!=="svelte-1deng2j"&&(wo.textContent=Co),Fa.forEach(s),Ia=l(Qe),Ot=d(Qe,"DIV",{class:!0});var Ua=C(Ot);f(Ne.$$.fragment,Ua),no=l(Ua),Mo=d(Ua,"P",{"data-svelte-h":!0}),m(Mo)!=="svelte-1cp5sz1"&&(Mo.textContent=$o),Ua.forEach(s),Qe.forEach(s),na=l(e),so=d(e,"P",{"data-svelte-h":!0}),m(so)!=="svelte-19ri0xg"&&(so.textContent=ro),Xo=l(e),Ve=d(e,"DIV",{class:!0});var Ao=C(Ve);f(Kt.$$.fragment,Ao),lo=l(Ao),io=d(Ao,"P",{"data-svelte-h":!0}),m(io)!=="svelte-10lmbzj"&&(io.textContent=Ke),co=l(Ao),To=d(Ao,"P",{"data-svelte-h":!0}),m(To)!=="svelte-1iwxjrj"&&(To.innerHTML=Fo),Ba=l(Ao),eo=d(Ao,"DIV",{class:!0});var Fn=C(eo);f(Gt.$$.fragment,Fn),Xa=l(Fn),jo=d(Fn,"P",{"data-svelte-h":!0}),m(jo)!=="svelte-1a6wgfx"&&(jo.textContent=Uo),Fn.forEach(s),Ao.forEach(s),sa=l(e),po=d(e,"P",{"data-svelte-h":!0}),m(po)!=="svelte-13rse9s"&&(po.textContent=$t),to=l(e),ne=d(e,"DIV",{class:!0});var ot=C(ne);f(Rt.$$.fragment,ot),Ga=l(ot),ko=d(ot,"P",{"data-svelte-h":!0}),m(ko)!=="svelte-2ag3qy"&&(ko.textContent=mo),ra=l(ot),Ft=d(ot,"P",{"data-svelte-h":!0}),m(Ft)!=="svelte-6y2of4"&&(Ft.innerHTML=la),h=l(ot),x=d(ot,"DIV",{class:!0});var Un=C(x);f(Le.$$.fragment,Un),Ee=l(Un),et=d(Un,"P",{"data-svelte-h":!0}),m(et)!=="svelte-1b6yaj0"&&(et.innerHTML=Nt),Un.forEach(s),Pe=l(ot),qe=d(ot,"DIV",{class:!0});var Zn=C(qe);f(we.$$.fragment,Zn),Ut=l(Zn),Je=d(Zn,"P",{"data-svelte-h":!0}),m(Je)!=="svelte-ojf6i2"&&(Je.innerHTML=qt),Zn.forEach(s),ct=l(ot),tt=d(ot,"DIV",{class:!0});var Ys=C(tt);f(Wo.$$.fragment,Ys),Ys.forEach(s),Ra=l(ot),xo=d(ot,"DIV",{class:!0});var sn=C(xo);f(ia.$$.fragment,sn),Hn=l(sn),Na=d(sn,"P",{"data-svelte-h":!0}),m(Na)!=="svelte-wwm3j5"&&(Na.innerHTML=Ms),Ln=l(sn),f(Go.$$.fragment,sn),sn.forEach(s),En=l(ot),Ro=d(ot,"DIV",{class:!0});var zn=C(Ro);f(ca.$$.fragment,zn),Pn=l(zn),qa=d(zn,"P",{"data-svelte-h":!0}),m(qa)!=="svelte-19nx4pz"&&(qa.innerHTML=Ts),zn.forEach(s),Qn=l(ot),No=d(ot,"DIV",{class:!0});var In=C(No);f(da.$$.fragment,In),Sn=l(In),Ya=d(In,"P",{"data-svelte-h":!0}),m(Ya)!=="svelte-ka28il"&&(Ya.innerHTML=js),In.forEach(s),ot.forEach(s),_n=l(e),pa=d(e,"P",{"data-svelte-h":!0}),m(pa)!=="svelte-1obhais"&&(pa.textContent=ks),vn=l(e),Be=d(e,"DIV",{class:!0});var bt=C(Be);f(ma.$$.fragment,bt),An=l(bt),Ha=d(bt,"P",{"data-svelte-h":!0}),m(Ha)!=="svelte-tn9a17"&&(Ha.textContent=Ws),Dn=l(bt),qo=d(bt,"DIV",{class:!0});var Bn=C(qo);f(ha.$$.fragment,Bn),On=l(Bn),La=d(Bn,"P",{"data-svelte-h":!0}),m(La)!=="svelte-16cieho"&&(La.innerHTML=xs),Bn.forEach(s),Kn=l(bt),Yo=d(bt,"DIV",{class:!0});var Xn=C(Yo);f(ua.$$.fragment,Xn),es=l(Xn),Ea=d(Xn,"P",{"data-svelte-h":!0}),m(Ea)!=="svelte-2ax72n"&&(Ea.innerHTML=Vs),Xn.forEach(s),ts=l(bt),Vo=d(bt,"DIV",{class:!0});var rn=C(Vo);f(fa.$$.fragment,rn),os=l(rn),Pa=d(rn,"P",{"data-svelte-h":!0}),m(Pa)!=="svelte-j7jybd"&&(Pa.innerHTML=Js),as=l(rn),f(Ho.$$.fragment,rn),rn.forEach(s),ns=l(bt),Qa=d(bt,"DIV",{class:!0});var Hs=C(Qa);f(ga.$$.fragment,Hs),Hs.forEach(s),ss=l(bt),oo=d(bt,"DIV",{class:!0});var Do=C(oo);f(_a.$$.fragment,Do),rs=l(Do),Sa=d(Do,"P",{"data-svelte-h":!0}),m(Sa)!=="svelte-1xixice"&&(Sa.textContent=Cs),ls=l(Do),f(Lo.$$.fragment,Do),is=l(Do),Aa=d(Do,"P",{"data-svelte-h":!0}),m(Aa)!=="svelte-1x97l7z"&&(Aa.innerHTML=$s),Do.forEach(s),cs=l(bt),Jo=d(bt,"DIV",{class:!0});var ln=C(Jo);f(va.$$.fragment,ln),ds=l(ln),Da=d(ln,"P",{"data-svelte-h":!0}),m(Da)!=="svelte-1e03u9y"&&(Da.textContent=Fs),ps=l(ln),f(Eo.$$.fragment,ln),ln.forEach(s),bt.forEach(s),bn=l(e),ba=d(e,"P",{"data-svelte-h":!0}),m(ba)!=="svelte-8vesun"&&(ba.textContent=Us),yn=l(e),ya=d(e,"P",{"data-svelte-h":!0}),m(ya)!=="svelte-1m2vxsz"&&(ya.innerHTML=Zs),wn=l(e),f(wa.$$.fragment,e),Mn=l(e),Ma=d(e,"P",{"data-svelte-h":!0}),m(Ma)!=="svelte-uayp84"&&(Ma.textContent=zs),Tn=l(e),Zo=d(e,"DIV",{class:!0});var Gn=C(Zo);f(Ta.$$.fragment,Gn),ms=l(Gn),Oa=d(Gn,"P",{"data-svelte-h":!0}),m(Oa)!=="svelte-amzs60"&&(Oa.innerHTML=Is),Gn.forEach(s),jn=l(e),zo=d(e,"DIV",{class:!0});var Rn=C(zo);f(ja.$$.fragment,Rn),hs=l(Rn),Ka=d(Rn,"P",{"data-svelte-h":!0}),m(Ka)!=="svelte-1tmia4b"&&(Ka.textContent=Bs),Rn.forEach(s),kn=l(e),Io=d(e,"DIV",{class:!0});var Nn=C(Io);f(ka.$$.fragment,Nn),us=l(Nn),en=d(Nn,"P",{"data-svelte-h":!0}),m(en)!=="svelte-zd742x"&&(en.innerHTML=Xs),Nn.forEach(s),Wn=l(e),ho=d(e,"DIV",{class:!0});var cn=C(ho);f(Wa.$$.fragment,cn),fs=l(cn),tn=d(cn,"P",{"data-svelte-h":!0}),m(tn)!=="svelte-11w6tdr"&&(tn.innerHTML=Gs),gs=l(cn),Po=d(cn,"DIV",{class:!0});var qn=C(Po);f(xa.$$.fragment,qn),_s=l(qn),on=d(qn,"P",{"data-svelte-h":!0}),m(on)!=="svelte-5ihtpa"&&(on.textContent=Rs),qn.forEach(s),cn.forEach(s),xn=l(e),uo=d(e,"DIV",{class:!0});var dn=C(uo);f(Va.$$.fragment,dn),vs=l(dn),an=d(dn,"P",{"data-svelte-h":!0}),m(an)!=="svelte-ldrfqp"&&(an.innerHTML=Ns),bs=l(dn),Qo=d(dn,"DIV",{class:!0});var Yn=C(Qo);f(Ja.$$.fragment,Yn),ys=l(Yn),nn=d(Yn,"P",{"data-svelte-h":!0}),m(nn)!=="svelte-5ihtpa"&&(nn.textContent=qs),Yn.forEach(s),dn.forEach(s),Vn=l(e),f(So.$$.fragment,e),Jn=l(e),f(Ca.$$.fragment,e),Cn=l(e),fn=d(e,"P",{}),C(fn).forEach(s),this.h()},h(){$(t,"name","hf:doc:metadata"),$(t,"content",Gr),Ds(ve,"text-align","center"),$(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(eo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(xo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Ro,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(No,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(qo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Yo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Vo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Qa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(oo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Jo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Zo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(zo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Io,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Po,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(ho,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Qo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(uo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,w){a(document.head,t),p(e,y,w),p(e,n,w),p(e,i,w),g(M,e,w),p(e,o,w),g(T,e,w),p(e,Ce,w),p(e,X,w),p(e,$e,w),p(e,G,w),p(e,Fe,w),p(e,V,w),p(e,Q,w),p(e,se,w),p(e,Se,w),p(e,K,w),p(e,Ue,w),g(ee,e,w),p(e,Ze,w),p(e,de,w),p(e,ht,w),g(B,e,w),p(e,te,w),p(e,oe,w),p(e,N,w),g(ae,e,w),p(e,Xe,w),p(e,ie,w),p(e,Ge,w),p(e,R,w),p(e,ce,w),g(S,e,w),p(e,zt,w),g(Te,e,w),p(e,ze,w),p(e,st,w),p(e,je,w),g(ke,e,w),p(e,ut,w),g(I,e,w),p(e,pe,w),p(e,D,w),p(e,It,w),p(e,ve,w),p(e,ft,w),g(q,e,w),p(e,De,w),p(e,H,w),p(e,j,w),g(J,e,w),p(e,he,w),p(e,A,w),p(e,O,w),g(Y,e,w),p(e,Yt,w),p(e,yt,w),p(e,_o,w),p(e,wt,w),p(e,vo,w),p(e,Mt,w),p(e,Tt,w),g(jt,e,w),p(e,ue,w),p(e,fe,w),g(kt,fe,null),a(fe,He),a(fe,Ht),a(fe,lt),a(fe,Oe),a(fe,re),g(k,fe,null),p(e,U,w),p(e,le,w),p(e,Re,w),p(e,Z,w),g(xe,Z,null),a(Z,bo),a(Z,Lt),a(Z,Oo),a(Z,Et),a(Z,Ko),a(Z,Ie),g(xt,Ie,null),a(Ie,ea),a(Ie,Pt),a(Z,ta),a(Z,Vt),g(ao,Vt,null),a(Z,At),a(Z,it),g(Jt,it,null),a(it,Bo),a(it,ge),a(it,oa),a(it,Qt),a(it,aa),g(Ct,it,null),a(Z,Za),a(Z,Dt),g(Xt,Dt,null),a(Dt,za),a(Dt,wo),a(Z,Ia),a(Z,Ot),g(Ne,Ot,null),a(Ot,no),a(Ot,Mo),p(e,na,w),p(e,so,w),p(e,Xo,w),p(e,Ve,w),g(Kt,Ve,null),a(Ve,lo),a(Ve,io),a(Ve,co),a(Ve,To),a(Ve,Ba),a(Ve,eo),g(Gt,eo,null),a(eo,Xa),a(eo,jo),p(e,sa,w),p(e,po,w),p(e,to,w),p(e,ne,w),g(Rt,ne,null),a(ne,Ga),a(ne,ko),a(ne,ra),a(ne,Ft),a(ne,h),a(ne,x),g(Le,x,null),a(x,Ee),a(x,et),a(ne,Pe),a(ne,qe),g(we,qe,null),a(qe,Ut),a(qe,Je),a(ne,ct),a(ne,tt),g(Wo,tt,null),a(ne,Ra),a(ne,xo),g(ia,xo,null),a(xo,Hn),a(xo,Na),a(xo,Ln),g(Go,xo,null),a(ne,En),a(ne,Ro),g(ca,Ro,null),a(Ro,Pn),a(Ro,qa),a(ne,Qn),a(ne,No),g(da,No,null),a(No,Sn),a(No,Ya),p(e,_n,w),p(e,pa,w),p(e,vn,w),p(e,Be,w),g(ma,Be,null),a(Be,An),a(Be,Ha),a(Be,Dn),a(Be,qo),g(ha,qo,null),a(qo,On),a(qo,La),a(Be,Kn),a(Be,Yo),g(ua,Yo,null),a(Yo,es),a(Yo,Ea),a(Be,ts),a(Be,Vo),g(fa,Vo,null),a(Vo,os),a(Vo,Pa),a(Vo,as),g(Ho,Vo,null),a(Be,ns),a(Be,Qa),g(ga,Qa,null),a(Be,ss),a(Be,oo),g(_a,oo,null),a(oo,rs),a(oo,Sa),a(oo,ls),g(Lo,oo,null),a(oo,is),a(oo,Aa),a(Be,cs),a(Be,Jo),g(va,Jo,null),a(Jo,ds),a(Jo,Da),a(Jo,ps),g(Eo,Jo,null),p(e,bn,w),p(e,ba,w),p(e,yn,w),p(e,ya,w),p(e,wn,w),g(wa,e,w),p(e,Mn,w),p(e,Ma,w),p(e,Tn,w),p(e,Zo,w),g(Ta,Zo,null),a(Zo,ms),a(Zo,Oa),p(e,jn,w),p(e,zo,w),g(ja,zo,null),a(zo,hs),a(zo,Ka),p(e,kn,w),p(e,Io,w),g(ka,Io,null),a(Io,us),a(Io,en),p(e,Wn,w),p(e,ho,w),g(Wa,ho,null),a(ho,fs),a(ho,tn),a(ho,gs),a(ho,Po),g(xa,Po,null),a(Po,_s),a(Po,on),p(e,xn,w),p(e,uo,w),g(Va,uo,null),a(uo,vs),a(uo,an),a(uo,bs),a(uo,Qo),g(Ja,Qo,null),a(Qo,ys),a(Qo,nn),p(e,Vn,w),g(So,e,w),p(e,Jn,w),g(Ca,e,w),p(e,Cn,w),p(e,fn,w),$n=!0},p(e,[w]){const fo={};w&2&&(fo.$$scope={dirty:w,ctx:e}),k.$set(fo);const Qe={};w&2&&(Qe.$$scope={dirty:w,ctx:e}),Ct.$set(Qe);const $a={};w&2&&($a.$$scope={dirty:w,ctx:e}),Go.$set($a);const gn={};w&2&&(gn.$$scope={dirty:w,ctx:e}),Ho.$set(gn);const go={};w&2&&(go.$$scope={dirty:w,ctx:e}),Lo.$set(go);const Fa={};w&2&&(Fa.$$scope={dirty:w,ctx:e}),Eo.$set(Fa);const Ua={};w&2&&(Ua.$$scope={dirty:w,ctx:e}),So.$set(Ua)},i(e){$n||(_(M.$$.fragment,e),_(T.$$.fragment,e),_(ee.$$.fragment,e),_(B.$$.fragment,e),_(ae.$$.fragment,e),_(S.$$.fragment,e),_(Te.$$.fragment,e),_(ke.$$.fragment,e),_(I.$$.fragment,e),_(q.$$.fragment,e),_(J.$$.fragment,e),_(Y.$$.fragment,e),_(jt.$$.fragment,e),_(kt.$$.fragment,e),_(k.$$.fragment,e),_(xe.$$.fragment,e),_(xt.$$.fragment,e),_(ao.$$.fragment,e),_(Jt.$$.fragment,e),_(Ct.$$.fragment,e),_(Xt.$$.fragment,e),_(Ne.$$.fragment,e),_(Kt.$$.fragment,e),_(Gt.$$.fragment,e),_(Rt.$$.fragment,e),_(Le.$$.fragment,e),_(we.$$.fragment,e),_(Wo.$$.fragment,e),_(ia.$$.fragment,e),_(Go.$$.fragment,e),_(ca.$$.fragment,e),_(da.$$.fragment,e),_(ma.$$.fragment,e),_(ha.$$.fragment,e),_(ua.$$.fragment,e),_(fa.$$.fragment,e),_(Ho.$$.fragment,e),_(ga.$$.fragment,e),_(_a.$$.fragment,e),_(Lo.$$.fragment,e),_(va.$$.fragment,e),_(Eo.$$.fragment,e),_(wa.$$.fragment,e),_(Ta.$$.fragment,e),_(ja.$$.fragment,e),_(ka.$$.fragment,e),_(Wa.$$.fragment,e),_(xa.$$.fragment,e),_(Va.$$.fragment,e),_(Ja.$$.fragment,e),_(So.$$.fragment,e),_(Ca.$$.fragment,e),$n=!0)},o(e){v(M.$$.fragment,e),v(T.$$.fragment,e),v(ee.$$.fragment,e),v(B.$$.fragment,e),v(ae.$$.fragment,e),v(S.$$.fragment,e),v(Te.$$.fragment,e),v(ke.$$.fragment,e),v(I.$$.fragment,e),v(q.$$.fragment,e),v(J.$$.fragment,e),v(Y.$$.fragment,e),v(jt.$$.fragment,e),v(kt.$$.fragment,e),v(k.$$.fragment,e),v(xe.$$.fragment,e),v(xt.$$.fragment,e),v(ao.$$.fragment,e),v(Jt.$$.fragment,e),v(Ct.$$.fragment,e),v(Xt.$$.fragment,e),v(Ne.$$.fragment,e),v(Kt.$$.fragment,e),v(Gt.$$.fragment,e),v(Rt.$$.fragment,e),v(Le.$$.fragment,e),v(we.$$.fragment,e),v(Wo.$$.fragment,e),v(ia.$$.fragment,e),v(Go.$$.fragment,e),v(ca.$$.fragment,e),v(da.$$.fragment,e),v(ma.$$.fragment,e),v(ha.$$.fragment,e),v(ua.$$.fragment,e),v(fa.$$.fragment,e),v(Ho.$$.fragment,e),v(ga.$$.fragment,e),v(_a.$$.fragment,e),v(Lo.$$.fragment,e),v(va.$$.fragment,e),v(Eo.$$.fragment,e),v(wa.$$.fragment,e),v(Ta.$$.fragment,e),v(ja.$$.fragment,e),v(ka.$$.fragment,e),v(Wa.$$.fragment,e),v(xa.$$.fragment,e),v(Va.$$.fragment,e),v(Ja.$$.fragment,e),v(So.$$.fragment,e),v(Ca.$$.fragment,e),$n=!1},d(e){e&&(s(y),s(n),s(i),s(o),s(Ce),s(X),s($e),s(G),s(Fe),s(V),s(Q),s(se),s(Se),s(K),s(Ue),s(Ze),s(de),s(ht),s(te),s(oe),s(N),s(Xe),s(ie),s(Ge),s(R),s(ce),s(zt),s(ze),s(st),s(je),s(ut),s(pe),s(D),s(It),s(ve),s(ft),s(De),s(H),s(j),s(he),s(A),s(O),s(Yt),s(yt),s(_o),s(wt),s(vo),s(Mt),s(Tt),s(ue),s(fe),s(U),s(le),s(Re),s(Z),s(na),s(so),s(Xo),s(Ve),s(sa),s(po),s(to),s(ne),s(_n),s(pa),s(vn),s(Be),s(bn),s(ba),s(yn),s(ya),s(wn),s(Mn),s(Ma),s(Tn),s(Zo),s(jn),s(zo),s(kn),s(Io),s(Wn),s(ho),s(xn),s(uo),s(Vn),s(Jn),s(Cn),s(fn)),s(t),b(M,e),b(T,e),b(ee,e),b(B,e),b(ae,e),b(S,e),b(Te,e),b(ke,e),b(I,e),b(q,e),b(J,e),b(Y,e),b(jt,e),b(kt),b(k),b(xe),b(xt),b(ao),b(Jt),b(Ct),b(Xt),b(Ne),b(Kt),b(Gt),b(Rt),b(Le),b(we),b(Wo),b(ia),b(Go),b(ca),b(da),b(ma),b(ha),b(ua),b(fa),b(Ho),b(ga),b(_a),b(Lo),b(va),b(Eo),b(wa,e),b(Ta),b(ja),b(ka),b(Wa),b(xa),b(Va),b(Ja),b(So,e),b(Ca,e)}}}const Gr='{"title":"Wav2Vec2","local":"wav2vec2","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Using Flash Attention 2","local":"using-flash-attention-2","sections":[{"title":"Installation","local":"installation","sections":[],"depth":3},{"title":"Usage","local":"usage","sections":[],"depth":3},{"title":"Expected speedups","local":"expected-speedups","sections":[],"depth":3}],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"Wav2Vec2Config","local":"transformers.Wav2Vec2Config","sections":[],"depth":2},{"title":"Wav2Vec2ForSequenceClassification","local":"transformers.Wav2Vec2ForSequenceClassification","sections":[],"depth":2},{"title":"Wav2Vec2ForAudioFrameClassification","local":"transformers.Wav2Vec2ForAudioFrameClassification","sections":[],"depth":2},{"title":"Wav2Vec2ForXVector","local":"transformers.Wav2Vec2ForXVector","sections":[],"depth":2},{"title":"Wav2Vec2ForPreTraining","local":"transformers.Wav2Vec2ForPreTraining","sections":[],"depth":2},{"title":"TFWav2Vec2Model","local":"transformers.TFWav2Vec2Model","sections":[],"depth":2},{"title":"FlaxWav2Vec2Model","local":"transformers.FlaxWav2Vec2Model","sections":[],"depth":2},{"title":"FlaxWav2Vec2ForCTC","local":"transformers.FlaxWav2Vec2ForCTC","sections":[],"depth":2},{"title":"FlaxWav2Vec2ForPreTraining","local":"transformers.FlaxWav2Vec2ForPreTraining","sections":[],"depth":2}],"depth":1}';function Rr(W){return Ps(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ar extends Qs{constructor(t){super(),Ss(this,t,Rr,Xr,Es,{})}}export{Ar as component};
