import{S as mi,i as fi,s as ui,e as r,k as c,w as _,t as a,M as gi,c as n,d as o,m as d,a as l,x as T,h as s,b as i,G as e,g as h,y as v,q as y,o as b,B as k,v as _i,L as hi}from"../../chunks/vendor-hf-doc-builder.js";import{T as di}from"../../chunks/Tip-hf-doc-builder.js";import{D as N}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ia}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ue}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as pi}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ti(L){let f,S,u,g,w;return g=new Ia({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFNwZWVjaDJUZXh0MkNvbmZpZyUyQyUyMFNwZWVjaDJUZXh0MkZvckNhdXNhbExNJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMFNwZWVjaDJUZXh0MiUyMHMydF90cmFuc2Zvcm1lcl9zJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMFNwZWVjaDJUZXh0MkNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBzMnRfdHJhbnNmb3JtZXJfcyUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwU3BlZWNoMlRleHQyRm9yQ2F1c2FsTE0oY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Speech2Text2Config, Speech2Text2ForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Speech2Text2 s2t_transformer_s style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Speech2Text2Config()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the s2t_transformer_s style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Speech2Text2ForCausalLM(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){f=r("p"),S=a("Example:"),u=c(),_(g.$$.fragment)},l(m){f=n(m,"P",{});var x=l(f);S=s(x,"Example:"),x.forEach(o),u=d(m),T(g.$$.fragment,m)},m(m,x){h(m,f,x),e(f,S),h(m,u,x),v(g,m,x),w=!0},p:hi,i(m){w||(y(g.$$.fragment,m),w=!0)},o(m){b(g.$$.fragment,m),w=!1},d(m){m&&o(f),m&&o(u),k(g,m)}}}function vi(L){let f,S,u,g,w,m,x,V,W,E,z;return{c(){f=r("p"),S=a(`This class method is simply calling the feature extractor
`),u=r("a"),g=a("from_pretrained()"),w=a(`, image processor
`),m=r("a"),x=a("ImageProcessingMixin"),V=a(` and the tokenizer
`),W=r("code"),E=a("~tokenization_utils_base.PreTrainedTokenizer.from_pretrained"),z=a(` methods. Please refer to the docstrings of the
methods above for more information.`),this.h()},l(J){f=n(J,"P",{});var U=l(f);S=s(U,`This class method is simply calling the feature extractor
`),u=n(U,"A",{href:!0});var Y=l(u);g=s(Y,"from_pretrained()"),Y.forEach(o),w=s(U,`, image processor
`),m=n(U,"A",{href:!0});var bt=l(m);x=s(bt,"ImageProcessingMixin"),bt.forEach(o),V=s(U,` and the tokenizer
`),W=n(U,"CODE",{});var ce=l(W);E=s(ce,"~tokenization_utils_base.PreTrainedTokenizer.from_pretrained"),ce.forEach(o),z=s(U,` methods. Please refer to the docstrings of the
methods above for more information.`),U.forEach(o),this.h()},h(){i(u,"href","/docs/transformers/main/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.from_pretrained"),i(m,"href","/docs/transformers/main/en/internal/image_processing_utils#transformers.ImageProcessingMixin")},m(J,U){h(J,f,U),e(f,S),e(f,u),e(u,g),e(f,w),e(f,m),e(m,x),e(f,V),e(f,W),e(W,E),e(f,z)},d(J){J&&o(f)}}}function yi(L){let f,S,u,g,w,m,x,V;return{c(){f=r("p"),S=a("This class method is simply calling "),u=r("a"),g=a("save_pretrained()"),w=a(` and
`),m=r("a"),x=a("save_pretrained()"),V=a(`. Please refer to the docstrings of the
methods above for more information.`),this.h()},l(W){f=n(W,"P",{});var E=l(f);S=s(E,"This class method is simply calling "),u=n(E,"A",{href:!0});var z=l(u);g=s(z,"save_pretrained()"),z.forEach(o),w=s(E,` and
`),m=n(E,"A",{href:!0});var J=l(m);x=s(J,"save_pretrained()"),J.forEach(o),V=s(E,`. Please refer to the docstrings of the
methods above for more information.`),E.forEach(o),this.h()},h(){i(u,"href","/docs/transformers/main/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.save_pretrained"),i(m,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.save_pretrained")},m(W,E){h(W,f,E),e(f,S),e(f,u),e(u,g),e(f,w),e(f,m),e(m,x),e(f,V)},d(W){W&&o(f)}}}function bi(L){let f,S,u,g,w;return g=new Ia({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMCglMEElMjAlMjAlMjAlMjBTcGVlY2hFbmNvZGVyRGVjb2Rlck1vZGVsJTJDJTBBJTIwJTIwJTIwJTIwU3BlZWNoMlRleHQyRm9yQ2F1c2FsTE0lMkMlMEElMjAlMjAlMjAlMjBXYXYyVmVjMk1vZGVsJTJDJTBBJTIwJTIwJTIwJTIwU3BlZWNoMlRleHQyQ29uZmlnJTJDJTBBJTIwJTIwJTIwJTIwV2F2MlZlYzJDb25maWclMkMlMEElMjAlMjAlMjAlMjBXYXYyVmVjMkZlYXR1cmVFeHRyYWN0b3IlMkMlMEElMjAlMjAlMjAlMjBTcGVlY2gyVGV4dDJUb2tlbml6ZXIlMkMlMEEpJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZmVhdHVyZV9leHRyYWN0b3IlMjAlM0QlMjBXYXYyVmVjMkZlYXR1cmVFeHRyYWN0b3IoKSUwQXRva2VuaXplciUyMCUzRCUyMFNwZWVjaDJUZXh0MlRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZzMnQtd2F2MnZlYzItbGFyZ2UtZW4tZGUlMjIpJTBBJTBBZW5jb2RlciUyMCUzRCUyMFdhdjJWZWMyTW9kZWwoV2F2MlZlYzJDb25maWcoKSklMEFkZWNvZGVyJTIwJTNEJTIwU3BlZWNoMlRleHQyRm9yQ2F1c2FsTE0oU3BlZWNoMlRleHQyQ29uZmlnKCkpJTBBJTIzJTIwaW5pdCUyMHJhbmRvbSUyMHNwZWVjaDJ0ZXh0JTIwbW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMFNwZWVjaEVuY29kZXJEZWNvZGVyTW9kZWwoZW5jb2RlciUzRGVuY29kZXIlMkMlMjBkZWNvZGVyJTNEZGVjb2RlciklMEFtb2RlbC5jb25maWcucGFkX3Rva2VuX2lkJTIwJTNEJTIwdG9rZW5pemVyLnBhZF90b2tlbl9pZCUwQW1vZGVsLmNvbmZpZy5kZWNvZGVyX3N0YXJ0X3Rva2VuX2lkJTIwJTNEJTIwdG9rZW5pemVyLmJvc190b2tlbl9pZCUwQSUyMyUyMHByZS1wcm9jZXNzJTIwaW5wdXRzJTIwYW5kJTIwbGFiZWxzJTBBJTBBZHMlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaGYtaW50ZXJuYWwtdGVzdGluZyUyRmxpYnJpc3BlZWNoX2Fzcl9kdW1teSUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWlucHV0cyUyMCUzRCUyMGZlYXR1cmVfZXh0cmFjdG9yKCUwQSUyMCUyMCUyMCUyMGRzJTVCMCU1RCU1QiUyMmF1ZGlvJTIyJTVEJTVCJTIyYXJyYXklMjIlNUQlMkMlMjBzYW1wbGluZ19yYXRlJTNEZHMlNUIwJTVEJTVCJTIyYXVkaW8lMjIlNUQlNUIlMjJzYW1wbGluZ19yYXRlJTIyJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUwQSklMEFpbnB1dF92YWx1ZXMlMjAlM0QlMjBpbnB1dHMuaW5wdXRfdmFsdWVzJTBBZGVjb2Rlcl9pbnB1dF9pZHMlMjAlM0QlMjB0b2tlbml6ZXIoZHMlNUIwJTVEJTVCJTIydGV4dCUyMiU1RCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLmlucHV0X2lkcyUwQSUyMyUyMGNvbXB1dGUlMjBsb3NzJTBBJTBBbG9zcyUyMCUzRCUyMG1vZGVsKGlucHV0cyUzRGlucHV0X3ZhbHVlcyUyQyUyMGxhYmVscyUzRGRlY29kZXJfaW5wdXRfaWRzKS5sb3NzJTBBJTIzJTIwYmFja3Byb3AlMjBsb3NzJTBBJTBBbG9zcy5iYWNrd2FyZCgp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> (
<span class="hljs-meta">... </span>    SpeechEncoderDecoderModel,
<span class="hljs-meta">... </span>    Speech2Text2ForCausalLM,
<span class="hljs-meta">... </span>    Wav2Vec2Model,
<span class="hljs-meta">... </span>    Speech2Text2Config,
<span class="hljs-meta">... </span>    Wav2Vec2Config,
<span class="hljs-meta">... </span>    Wav2Vec2FeatureExtractor,
<span class="hljs-meta">... </span>    Speech2Text2Tokenizer,
<span class="hljs-meta">... </span>)
<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 = Wav2Vec2FeatureExtractor()
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = Speech2Text2Tokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/s2t-wav2vec2-large-en-de&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>encoder = Wav2Vec2Model(Wav2Vec2Config())
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder = Speech2Text2ForCausalLM(Speech2Text2Config())
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># init random speech2text model</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>model = SpeechEncoderDecoderModel(encoder=encoder, decoder=decoder)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.pad_token_id = tokenizer.pad_token_id
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.decoder_start_token_id = tokenizer.bos_token_id
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># pre-process inputs and labels</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>inputs = feature_extractor(
<span class="hljs-meta">... </span>    ds[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>], sampling_rate=ds[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;sampling_rate&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>input_values = inputs.input_values
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = tokenizer(ds[<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=input_values, labels=decoder_input_ids).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># backprop loss</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>loss.backward()`}}),{c(){f=r("p"),S=a("Example:"),u=c(),_(g.$$.fragment)},l(m){f=n(m,"P",{});var x=l(f);S=s(x,"Example:"),x.forEach(o),u=d(m),T(g.$$.fragment,m)},m(m,x){h(m,f,x),e(f,S),h(m,u,x),v(g,m,x),w=!0},p:hi,i(m){w||(y(g.$$.fragment,m),w=!0)},o(m){b(g.$$.fragment,m),w=!1},d(m){m&&o(f),m&&o(u),k(g,m)}}}function ki(L){let f,S,u,g,w,m,x,V,W,E,z,J,U,Y,bt,ce,Va,No,D,Pa,kt,Ba,Na,Ce,Ga,Aa,Go,$,Ra,lo,qa,Xa,io,La,Ya,xt,Da,Qa,wt,Ha,Oa,Mt,Ka,es,co,ts,os,Ao,de,as,Ze,ss,rs,Ro,pe,ns,We,ls,is,qo,St,cs,Xo,Q,Fe,ds,Ie,ps,hs,ms,Ve,fs,$t,us,gs,_s,Pe,Ts,Be,vs,ys,Lo,te,he,po,Ne,bs,ho,ks,Yo,H,xs,Et,ws,Ms,Jt,Ss,$s,Do,C,Es,jt,Js,js,zt,zs,Us,Ut,Cs,Zs,Ct,Ws,Fs,Zt,Is,Vs,Qo,Wt,mo,Ps,Ho,Ge,Oo,Ft,Ae,fo,Bs,Ns,uo,Gs,Ko,Re,ea,me,As,qe,Rs,qs,ta,oe,fe,go,Xe,Xs,_o,Ls,oa,It,To,Vt,Ys,aa,ae,ue,vo,Le,Ds,yo,Qs,sa,P,Ye,Hs,se,Os,Pt,Ks,er,De,tr,or,ar,re,sr,Bt,rr,nr,Nt,lr,ir,cr,ge,ra,ne,_e,bo,Qe,dr,ko,pr,na,j,He,hr,xo,mr,fr,Oe,ur,Gt,gr,_r,Tr,Te,Ke,vr,wo,yr,br,O,et,kr,Mo,xr,wr,tt,Mr,So,Sr,$r,Er,At,ot,la,le,ve,$o,at,Jr,Eo,jr,ia,M,st,zr,Jo,Ur,Cr,F,Rt,Zr,Wr,qt,Fr,Ir,Xt,Vr,Pr,rt,jo,Br,Nr,Gr,Lt,Ar,Rr,qr,ye,nt,Xr,R,Lr,zo,Yr,Dr,Uo,Qr,Hr,lt,Co,Or,Kr,en,tn,K,it,on,Zo,an,sn,be,rn,ee,ct,nn,dt,ln,Yt,cn,dn,pn,ke,hn,xe,pt,mn,ht,fn,Dt,un,gn,_n,we,mt,Tn,ft,vn,Qt,yn,bn,ca,ie,Me,Wo,ut,kn,Fo,xn,da,B,gt,wn,q,Mn,Ht,Sn,$n,Io,En,Jn,Ot,jn,zn,Un,_t,Cn,Tt,Zn,Wn,Fn,Se,vt,In,$e,pa;return m=new Ue({}),Y=new Ue({}),Ne=new Ue({}),Ge=new Ia({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwU3BlZWNoMlRleHQyUHJvY2Vzc29yJTJDJTIwU3BlZWNoRW5jb2RlckRlY29kZXJNb2RlbCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQWltcG9ydCUyMHNvdW5kZmlsZSUyMGFzJTIwc2YlMEElMEFtb2RlbCUyMCUzRCUyMFNwZWVjaEVuY29kZXJEZWNvZGVyTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGczJ0LXdhdjJ2ZWMyLWxhcmdlLWVuLWRlJTIyKSUwQXByb2Nlc3NvciUyMCUzRCUyMFNwZWVjaDJUZXh0MlByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZzMnQtd2F2MnZlYzItbGFyZ2UtZW4tZGUlMjIpJTBBJTBBJTBBZGVmJTIwbWFwX3RvX2FycmF5KGJhdGNoKSUzQSUwQSUyMCUyMCUyMCUyMHNwZWVjaCUyQyUyMF8lMjAlM0QlMjBzZi5yZWFkKGJhdGNoJTVCJTIyZmlsZSUyMiU1RCklMEElMjAlMjAlMjAlMjBiYXRjaCU1QiUyMnNwZWVjaCUyMiU1RCUyMCUzRCUyMHNwZWVjaCUwQSUyMCUyMCUyMCUyMHJldHVybiUyMGJhdGNoJTBBJTBBJTBBZHMlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaGYtaW50ZXJuYWwtdGVzdGluZyUyRmxpYnJpc3BlZWNoX2Fzcl9kdW1teSUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWRzJTIwJTNEJTIwZHMubWFwKG1hcF90b19hcnJheSklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoZHMlNUIlMjJzcGVlY2glMjIlNUQlNUIwJTVEJTJDJTIwc2FtcGxpbmdfcmF0ZSUzRDE2XzAwMCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBZ2VuZXJhdGVkX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cyUzRGlucHV0cyU1QiUyMmlucHV0X3ZhbHVlcyUyMiU1RCUyQyUyMGF0dGVudGlvbl9tYXNrJTNEaW5wdXRzJTVCJTIyYXR0ZW50aW9uX21hc2slMjIlNUQpJTBBJTBBdHJhbnNjcmlwdGlvbiUyMCUzRCUyMHByb2Nlc3Nvci5iYXRjaF9kZWNvZGUoZ2VuZXJhdGVkX2lkcyk=",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> Speech2Text2Processor, SpeechEncoderDecoderModel
<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>model = SpeechEncoderDecoderModel.from_pretrained(<span class="hljs-string">&quot;facebook/s2t-wav2vec2-large-en-de&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = Speech2Text2Processor.from_pretrained(<span class="hljs-string">&quot;facebook/s2t-wav2vec2-large-en-de&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>inputs = processor(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;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(inputs=inputs[<span class="hljs-string">&quot;input_values&quot;</span>], attention_mask=inputs[<span class="hljs-string">&quot;attention_mask&quot;</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>transcription = processor.batch_decode(generated_ids)`}}),Re=new Ia({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBbGlicmlzcGVlY2hfZW4lMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaGYtaW50ZXJuYWwtdGVzdGluZyUyRmxpYnJpc3BlZWNoX2Fzcl9kdW1teSUyMiUyQyUyMCUyMmNsZWFuJTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQWFzciUyMCUzRCUyMHBpcGVsaW5lKCUwQSUyMCUyMCUyMCUyMCUyMmF1dG9tYXRpYy1zcGVlY2gtcmVjb2duaXRpb24lMjIlMkMlMEElMjAlMjAlMjAlMjBtb2RlbCUzRCUyMmZhY2Vib29rJTJGczJ0LXdhdjJ2ZWMyLWxhcmdlLWVuLWRlJTIyJTJDJTBBJTIwJTIwJTIwJTIwZmVhdHVyZV9leHRyYWN0b3IlM0QlMjJmYWNlYm9vayUyRnMydC13YXYydmVjMi1sYXJnZS1lbi1kZSUyMiUyQyUwQSklMEElMEF0cmFuc2xhdGlvbl9kZSUyMCUzRCUyMGFzcihsaWJyaXNwZWVjaF9lbiU1QjAlNUQlNUIlMjJmaWxlJTIyJTVEKQ==",highlighted:`<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">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>librispeech_en = 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>asr = pipeline(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;automatic-speech-recognition&quot;</span>,
<span class="hljs-meta">... </span>    model=<span class="hljs-string">&quot;facebook/s2t-wav2vec2-large-en-de&quot;</span>,
<span class="hljs-meta">... </span>    feature_extractor=<span class="hljs-string">&quot;facebook/s2t-wav2vec2-large-en-de&quot;</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>translation_de = asr(librispeech_en[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;file&quot;</span>])`}}),Xe=new Ue({}),Le=new Ue({}),Ye=new N({props:{name:"class transformers.Speech2Text2Config",anchor:"transformers.Speech2Text2Config",parameters:[{name:"vocab_size",val:" = 10000"},{name:"decoder_layers",val:" = 6"},{name:"decoder_ffn_dim",val:" = 2048"},{name:"decoder_attention_heads",val:" = 4"},{name:"decoder_layerdrop",val:" = 0.0"},{name:"use_cache",val:" = True"},{name:"activation_function",val:" = 'relu'"},{name:"d_model",val:" = 256"},{name:"dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.0"},{name:"activation_dropout",val:" = 0.0"},{name:"init_std",val:" = 0.02"},{name:"decoder_start_token_id",val:" = 2"},{name:"scale_embedding",val:" = True"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"max_target_positions",val:" = 1024"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Speech2Text2Config.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50265) &#x2014;
Vocabulary size of the Speech2Text model. Defines the number of different tokens that can be represented by
the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/speech_to_text#transformers.Speech2TextModel">Speech2TextModel</a>`,name:"vocab_size"},{anchor:"transformers.Speech2Text2Config.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the layers and the pooler layer.`,name:"d_model"},{anchor:"transformers.Speech2Text2Config.decoder_layers",description:`<strong>decoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of decoder layers.`,name:"decoder_layers"},{anchor:"transformers.Speech2Text2Config.decoder_attention_heads",description:`<strong>decoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"decoder_attention_heads"},{anchor:"transformers.Speech2Text2Config.decoder_ffn_dim",description:`<strong>decoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"decoder_ffn_dim"},{anchor:"transformers.Speech2Text2Config.activation_function",description:`<strong>activation_function</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 pooler. If string, <code>&quot;gelu&quot;</code>, <code>&quot;relu&quot;</code>,
<code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"activation_function"},{anchor:"transformers.Speech2Text2Config.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, and pooler.`,name:"dropout"},{anchor:"transformers.Speech2Text2Config.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.Speech2Text2Config.activation_dropout",description:`<strong>activation_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for activations inside the fully connected layer.`,name:"activation_dropout"},{anchor:"transformers.Speech2Text2Config.init_std",description:`<strong>init_std</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.
<a href="https://arxiv.org/abs/1909.11556%3E%60" rel="nofollow">https://arxiv.org/abs/1909.11556&gt;\`</a>__ for more details.`,name:"init_std"},{anchor:"transformers.Speech2Text2Config.decoder_layerdrop",description:`<strong>decoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the decoder. 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:"decoder_layerdrop"},{anchor:"transformers.Speech2Text2Config.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models).`,name:"use_cache"},{anchor:"transformers.Speech2Text2Config.max_target_positions",description:`<strong>max_target_positions</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_target_positions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/speech_to_text_2/configuration_speech_to_text_2.py#L31"}}),ge=new pi({props:{anchor:"transformers.Speech2Text2Config.example",$$slots:{default:[Ti]},$$scope:{ctx:L}}}),Qe=new Ue({}),He=new N({props:{name:"class transformers.Speech2Text2Tokenizer",anchor:"transformers.Speech2Text2Tokenizer",parameters:[{name:"vocab_file",val:""},{name:"bos_token",val:" = '<s>'"},{name:"pad_token",val:" = '<pad>'"},{name:"eos_token",val:" = '</s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"do_lower_case",val:" = False"},{name:"merges_file",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Speech2Text2Tokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.Speech2Text2Tokenizer.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.Speech2Text2Tokenizer.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.Speech2Text2Tokenizer.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.Speech2Text2Tokenizer.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.</p>
<p>**kwargs &#x2014;
Additional keyword arguments passed along to <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>`,name:"pad_token"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/speech_to_text_2/tokenization_speech_to_text_2.py#L73"}}),Ke=new N({props:{name:"batch_decode",anchor:"transformers.Speech2Text2Tokenizer.batch_decode",parameters:[{name:"sequences",val:": typing.Union[typing.List[int], typing.List[typing.List[int]], ForwardRef('np.ndarray'), ForwardRef('torch.Tensor'), ForwardRef('tf.Tensor')]"},{name:"skip_special_tokens",val:": bool = False"},{name:"clean_up_tokenization_spaces",val:": bool = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Speech2Text2Tokenizer.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.Speech2Text2Tokenizer.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.Speech2Text2Tokenizer.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. If <code>None</code>, will default to
<code>self.clean_up_tokenization_spaces</code>.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.Speech2Text2Tokenizer.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/main/src/transformers/tokenization_utils_base.py#L3486",returnDescription:`
<p>The list of decoded sentences.</p>
`,returnType:`
<p><code>List[str]</code></p>
`}}),et=new N({props:{name:"decode",anchor:"transformers.Speech2Text2Tokenizer.decode",parameters:[{name:"token_ids",val:": typing.Union[int, typing.List[int], ForwardRef('np.ndarray'), ForwardRef('torch.Tensor'), ForwardRef('tf.Tensor')]"},{name:"skip_special_tokens",val:": bool = False"},{name:"clean_up_tokenization_spaces",val:": bool = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Speech2Text2Tokenizer.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.Speech2Text2Tokenizer.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.Speech2Text2Tokenizer.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. If <code>None</code>, will default to
<code>self.clean_up_tokenization_spaces</code>.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.Speech2Text2Tokenizer.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/main/src/transformers/tokenization_utils_base.py#L3520",returnDescription:`
<p>The decoded sentence.</p>
`,returnType:`
<p><code>str</code></p>
`}}),ot=new N({props:{name:"save_vocabulary",anchor:"transformers.Speech2Text2Tokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/speech_to_text_2/tokenization_speech_to_text_2.py#L241"}}),at=new Ue({}),st=new N({props:{name:"class transformers.Speech2Text2Processor",anchor:"transformers.Speech2Text2Processor",parameters:[{name:"feature_extractor",val:""},{name:"tokenizer",val:""}],parametersDescription:[{anchor:"transformers.Speech2Text2Processor.feature_extractor",description:`<strong>feature_extractor</strong> (<code>AutoFeatureExtractor</code>) &#x2014;
An instance of <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoFeatureExtractor">AutoFeatureExtractor</a>. The feature extractor is a required input.`,name:"feature_extractor"},{anchor:"transformers.Speech2Text2Processor.tokenizer",description:`<strong>tokenizer</strong> (<code>Speech2Text2Tokenizer</code>) &#x2014;
An instance of <a href="/docs/transformers/main/en/model_doc/speech_to_text_2#transformers.Speech2Text2Tokenizer">Speech2Text2Tokenizer</a>. The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/speech_to_text_2/processing_speech_to_text_2.py#L24"}}),nt=new N({props:{name:"__call__",anchor:"transformers.Speech2Text2Processor.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/speech_to_text_2/processing_speech_to_text_2.py#L46"}}),it=new N({props:{name:"from_pretrained",anchor:"transformers.Speech2Text2Processor.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike]"},{name:"cache_dir",val:": typing.Union[str, os.PathLike, NoneType] = None"},{name:"force_download",val:": bool = False"},{name:"local_files_only",val:": bool = False"},{name:"token",val:": typing.Union[bool, str, NoneType] = None"},{name:"revision",val:": str = 'main'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Speech2Text2Processor.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
This can be either:</p>
<ul>
<li>a string, the <em>model id</em> of a pretrained feature_extractor hosted inside a model repo on
huggingface.co. Valid model ids can be located at the root-level, like <code>bert-base-uncased</code>, or
namespaced under a user or organization name, like <code>dbmdz/bert-base-german-cased</code>.</li>
<li>a path to a <em>directory</em> containing a feature extractor file saved using the
<a href="/docs/transformers/main/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/main/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.from_pretrained">from_pretrained()</a> and
<code>~tokenization_utils_base.PreTrainedTokenizer.from_pretrained</code>.</li>
</ul>`,name:"pretrained_model_name_or_path"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/processing_utils.py#L167"}}),be=new di({props:{$$slots:{default:[vi]},$$scope:{ctx:L}}}),ct=new N({props:{name:"save_pretrained",anchor:"transformers.Speech2Text2Processor.save_pretrained",parameters:[{name:"save_directory",val:""},{name:"push_to_hub",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Speech2Text2Processor.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.Speech2Text2Processor.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.Speech2Text2Processor.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/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/processing_utils.py#L93"}}),ke=new di({props:{$$slots:{default:[yi]},$$scope:{ctx:L}}}),pt=new N({props:{name:"batch_decode",anchor:"transformers.Speech2Text2Processor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/speech_to_text_2/processing_speech_to_text_2.py#L85"}}),mt=new N({props:{name:"decode",anchor:"transformers.Speech2Text2Processor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/speech_to_text_2/processing_speech_to_text_2.py#L92"}}),ut=new Ue({}),gt=new N({props:{name:"class transformers.Speech2Text2ForCausalLM",anchor:"transformers.Speech2Text2ForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Speech2Text2ForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/speech_to_text_2#transformers.Speech2Text2Config">Speech2Text2Config</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/speech_to_text_2/modeling_speech_to_text_2.py#L758"}}),vt=new N({props:{name:"forward",anchor:"transformers.Speech2Text2ForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Speech2Text2ForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you
provide it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/speech_to_text_2#transformers.Speech2Text2Tokenizer">Speech2Text2Tokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Speech2Text2ForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</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.Speech2Text2ForCausalLM.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention
if the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.Speech2Text2ForCausalLM.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used
in the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:`,name:"encoder_attention_mask"},{anchor:"transformers.Speech2Text2ForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the 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.Speech2Text2ForCausalLM.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-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:"cross_attn_head_mask"},{anchor:"transformers.Speech2Text2ForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of
shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>. The two additional
tensors are only required when the model is used as a decoder in a Sequence to Sequence model.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the
cross-attention blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those
that don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of
all <code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.Speech2Text2ForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</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"},{anchor:"transformers.Speech2Text2ForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding
(see <code>past_key_values</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>`,name:"use_cache"},{anchor:"transformers.Speech2Text2ForCausalLM.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.Speech2Text2ForCausalLM.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.Speech2Text2ForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/speech_to_text_2/modeling_speech_to_text_2.py#L791",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/speech_to_text_2#transformers.Speech2Text2Config"
>Speech2Text2Config</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$e=new pi({props:{anchor:"transformers.Speech2Text2ForCausalLM.forward.example",$$slots:{default:[bi]},$$scope:{ctx:L}}}),{c(){f=r("meta"),S=c(),u=r("h1"),g=r("a"),w=r("span"),_(m.$$.fragment),x=c(),V=r("span"),W=a("Speech2Text2"),E=c(),z=r("h2"),J=r("a"),U=r("span"),_(Y.$$.fragment),bt=c(),ce=r("span"),Va=a("Overview"),No=c(),D=r("p"),Pa=a("The Speech2Text2 model is used together with "),kt=r("a"),Ba=a("Wav2Vec2"),Na=a(` for Speech Translation models proposed in
`),Ce=r("a"),Ga=a("Large-Scale Self- and Semi-Supervised Learning for Speech Translation"),Aa=a(` by
Changhan Wang, Anne Wu, Juan Pino, Alexei Baevski, Michael Auli, Alexis Conneau.`),Go=c(),$=r("p"),Ra=a("Speech2Text2 is a "),lo=r("em"),qa=a("decoder-only"),Xa=a(" transformer model that can be used with any speech "),io=r("em"),La=a("encoder-only"),Ya=a(`, such as
`),xt=r("a"),Da=a("Wav2Vec2"),Qa=a(" or "),wt=r("a"),Ha=a("HuBERT"),Oa=a(` for Speech-to-Text tasks. Please refer to the
`),Mt=r("a"),Ka=a("SpeechEncoderDecoder"),es=a(" class on how to combine Speech2Text2 with any speech "),co=r("em"),ts=a("encoder-only"),os=a(`
model.`),Ao=c(),de=r("p"),as=a("This model was contributed by "),Ze=r("a"),ss=a("Patrick von Platen"),rs=a("."),Ro=c(),pe=r("p"),ns=a("The original code can be found "),We=r("a"),ls=a("here"),is=a("."),qo=c(),St=r("p"),cs=a("Tips:"),Xo=c(),Q=r("ul"),Fe=r("li"),ds=a(`Speech2Text2 achieves state-of-the-art results on the CoVoST Speech Translation dataset. For more information, see
the `),Ie=r("a"),ps=a("official models"),hs=a(" ."),ms=c(),Ve=r("li"),fs=a("Speech2Text2 is always used within the "),$t=r("a"),us=a("SpeechEncoderDecoder"),gs=a(" framework."),_s=c(),Pe=r("li"),Ts=a("Speech2Text2\u2019s tokenizer is based on "),Be=r("a"),vs=a("fastBPE"),ys=a("."),Lo=c(),te=r("h2"),he=r("a"),po=r("span"),_(Ne.$$.fragment),bs=c(),ho=r("span"),ks=a("Inference"),Yo=c(),H=r("p"),xs=a("Speech2Text2\u2019s "),Et=r("a"),ws=a("SpeechEncoderDecoderModel"),Ms=a(` model accepts raw waveform input values from speech and
makes use of `),Jt=r("a"),Ss=a("generate()"),$s=a(` to translate the input speech
autoregressively to the target language.`),Do=c(),C=r("p"),Es=a("The "),jt=r("a"),Js=a("Wav2Vec2FeatureExtractor"),js=a(` class is responsible for preprocessing the input speech and
`),zt=r("a"),zs=a("Speech2Text2Tokenizer"),Us=a(` decodes the generated target tokens to the target string. The
`),Ut=r("a"),Cs=a("Speech2Text2Processor"),Zs=a(" wraps "),Ct=r("a"),Ws=a("Wav2Vec2FeatureExtractor"),Fs=a(` and
`),Zt=r("a"),Is=a("Speech2Text2Tokenizer"),Vs=a(` into a single instance to both extract the input features and decode the
predicted token ids.`),Qo=c(),Wt=r("ul"),mo=r("li"),Ps=a("Step-by-step Speech Translation"),Ho=c(),_(Ge.$$.fragment),Oo=c(),Ft=r("ul"),Ae=r("li"),fo=r("p"),Bs=a("Speech Translation via Pipelines"),Ns=c(),uo=r("p"),Gs=a("The automatic speech recognition pipeline can also be used to translate speech in just a couple lines of code"),Ko=c(),_(Re.$$.fragment),ea=c(),me=r("p"),As=a("See "),qe=r("a"),Rs=a("model hub"),qs=a(" to look for Speech2Text2 checkpoints."),ta=c(),oe=r("h2"),fe=r("a"),go=r("span"),_(Xe.$$.fragment),Xs=c(),_o=r("span"),Ls=a("Documentation resources"),oa=c(),It=r("ul"),To=r("li"),Vt=r("a"),Ys=a("Causal language modeling task guide"),aa=c(),ae=r("h2"),ue=r("a"),vo=r("span"),_(Le.$$.fragment),Ds=c(),yo=r("span"),Qs=a("Speech2Text2Config"),sa=c(),P=r("div"),_(Ye.$$.fragment),Hs=c(),se=r("p"),Os=a("This is the configuration class to store the configuration of a "),Pt=r("a"),Ks=a("Speech2Text2ForCausalLM"),er=a(`. It is used to
instantiate an Speech2Text2 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 Speech2Text2
`),De=r("a"),tr=a("facebook/s2t-wav2vec2-large-en-de"),or=a(" architecture."),ar=c(),re=r("p"),sr=a("Configuration objects inherit from "),Bt=r("a"),rr=a("PretrainedConfig"),nr=a(` and can be used to control the model outputs. Read the
documentation from `),Nt=r("a"),lr=a("PretrainedConfig"),ir=a(" for more information."),cr=c(),_(ge.$$.fragment),ra=c(),ne=r("h2"),_e=r("a"),bo=r("span"),_(Qe.$$.fragment),dr=c(),ko=r("span"),pr=a("Speech2TextTokenizer"),na=c(),j=r("div"),_(He.$$.fragment),hr=c(),xo=r("p"),mr=a("Constructs a Speech2Text2Tokenizer."),fr=c(),Oe=r("p"),ur=a("This tokenizer inherits from "),Gt=r("a"),gr=a("PreTrainedTokenizer"),_r=a(` which contains some of the main methods. Users should refer to
the superclass for more information regarding such methods.`),Tr=c(),Te=r("div"),_(Ke.$$.fragment),vr=c(),wo=r("p"),yr=a("Convert a list of lists of token ids into a list of strings by calling decode."),br=c(),O=r("div"),_(et.$$.fragment),kr=c(),Mo=r("p"),xr=a(`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),wr=c(),tt=r("p"),Mr=a("Similar to doing "),So=r("code"),Sr=a("self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),$r=a("."),Er=c(),At=r("div"),_(ot.$$.fragment),la=c(),le=r("h2"),ve=r("a"),$o=r("span"),_(at.$$.fragment),Jr=c(),Eo=r("span"),jr=a("Speech2Text2Processor"),ia=c(),M=r("div"),_(st.$$.fragment),zr=c(),Jo=r("p"),Ur=a(`Constructs a Speech2Text2 processor which wraps a Speech2Text2 feature extractor and a Speech2Text2 tokenizer into
a single processor.`),Cr=c(),F=r("p"),Rt=r("a"),Zr=a("Speech2Text2Processor"),Wr=a(" offers all the functionalities of "),qt=r("a"),Fr=a("AutoFeatureExtractor"),Ir=a(" and "),Xt=r("a"),Vr=a("Speech2Text2Tokenizer"),Pr=a(`.
See the `),rt=r("a"),jo=r("strong"),Br=a("call"),Nr=a("()"),Gr=a(" and "),Lt=r("a"),Ar=a("decode()"),Rr=a(" for more information."),qr=c(),ye=r("div"),_(nt.$$.fragment),Xr=c(),R=r("p"),Lr=a(`When used in normal mode, this method forwards all its arguments to AutoFeatureExtractor\u2019s
`),zo=r("code"),Yr=a("__call__()"),Dr=a(` and returns its output. If used in the context
`),Uo=r("code"),Qr=a("as_target_processor()"),Hr=a(` this method forwards all its arguments to
Speech2Text2Tokenizer\u2019s `),lt=r("a"),Co=r("strong"),Or=a("call"),Kr=a("()"),en=a(`. Please refer to the doctsring of the above two
methods for more information.`),tn=c(),K=r("div"),_(it.$$.fragment),on=c(),Zo=r("p"),an=a("Instantiate a processor associated with a pretrained model."),sn=c(),_(be.$$.fragment),rn=c(),ee=r("div"),_(ct.$$.fragment),nn=c(),dt=r("p"),ln=a(`Saves the attributes of this processor (feature extractor, tokenizer\u2026) in the specified directory so that it
can be reloaded using the `),Yt=r("a"),cn=a("from_pretrained()"),dn=a(" method."),pn=c(),_(ke.$$.fragment),hn=c(),xe=r("div"),_(pt.$$.fragment),mn=c(),ht=r("p"),fn=a("This method forwards all its arguments to Speech2Text2Tokenizer\u2019s "),Dt=r("a"),un=a("batch_decode()"),gn=a(`. Please
refer to the docstring of this method for more information.`),_n=c(),we=r("div"),_(mt.$$.fragment),Tn=c(),ft=r("p"),vn=a("This method forwards all its arguments to Speech2Text2Tokenizer\u2019s "),Qt=r("a"),yn=a("decode()"),bn=a(`. Please refer
to the docstring of this method for more information.`),ca=c(),ie=r("h2"),Me=r("a"),Wo=r("span"),_(ut.$$.fragment),kn=c(),Fo=r("span"),xn=a("Speech2Text2ForCausalLM"),da=c(),B=r("div"),_(gt.$$.fragment),wn=c(),q=r("p"),Mn=a("The Speech2Text2 Decoder with a language modeling head. Can be used as the decoder part of "),Ht=r("a"),Sn=a("EncoderDecoderModel"),$n=a(" and "),Io=r("code"),En=a("SpeechEncoderDecoder"),Jn=a(`.
This model inherits from `),Ot=r("a"),jn=a("PreTrainedModel"),zn=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.)`),Un=c(),_t=r("p"),Cn=a("This model is also a PyTorch "),Tt=r("a"),Zn=a("torch.nn.Module"),Wn=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Fn=c(),Se=r("div"),_(vt.$$.fragment),In=c(),_($e.$$.fragment),this.h()},l(t){const p=gi('[data-svelte="svelte-1phssyn"]',document.head);f=n(p,"META",{name:!0,content:!0}),p.forEach(o),S=d(t),u=n(t,"H1",{class:!0});var yt=l(u);g=n(yt,"A",{id:!0,class:!0,href:!0});var Vo=l(g);w=n(Vo,"SPAN",{});var Po=l(w);T(m.$$.fragment,Po),Po.forEach(o),Vo.forEach(o),x=d(yt),V=n(yt,"SPAN",{});var Bo=l(V);W=s(Bo,"Speech2Text2"),Bo.forEach(o),yt.forEach(o),E=d(t),z=n(t,"H2",{class:!0});var ha=l(z);J=n(ha,"A",{id:!0,class:!0,href:!0});var Bn=l(J);U=n(Bn,"SPAN",{});var Nn=l(U);T(Y.$$.fragment,Nn),Nn.forEach(o),Bn.forEach(o),bt=d(ha),ce=n(ha,"SPAN",{});var Gn=l(ce);Va=s(Gn,"Overview"),Gn.forEach(o),ha.forEach(o),No=d(t),D=n(t,"P",{});var Kt=l(D);Pa=s(Kt,"The Speech2Text2 model is used together with "),kt=n(Kt,"A",{href:!0});var An=l(kt);Ba=s(An,"Wav2Vec2"),An.forEach(o),Na=s(Kt,` for Speech Translation models proposed in
`),Ce=n(Kt,"A",{href:!0,rel:!0});var Rn=l(Ce);Ga=s(Rn,"Large-Scale Self- and Semi-Supervised Learning for Speech Translation"),Rn.forEach(o),Aa=s(Kt,` by
Changhan Wang, Anne Wu, Juan Pino, Alexei Baevski, Michael Auli, Alexis Conneau.`),Kt.forEach(o),Go=d(t),$=n(t,"P",{});var I=l($);Ra=s(I,"Speech2Text2 is a "),lo=n(I,"EM",{});var qn=l(lo);qa=s(qn,"decoder-only"),qn.forEach(o),Xa=s(I," transformer model that can be used with any speech "),io=n(I,"EM",{});var Xn=l(io);La=s(Xn,"encoder-only"),Xn.forEach(o),Ya=s(I,`, such as
`),xt=n(I,"A",{href:!0});var Ln=l(xt);Da=s(Ln,"Wav2Vec2"),Ln.forEach(o),Qa=s(I," or "),wt=n(I,"A",{href:!0});var Yn=l(wt);Ha=s(Yn,"HuBERT"),Yn.forEach(o),Oa=s(I,` for Speech-to-Text tasks. Please refer to the
`),Mt=n(I,"A",{href:!0});var Dn=l(Mt);Ka=s(Dn,"SpeechEncoderDecoder"),Dn.forEach(o),es=s(I," class on how to combine Speech2Text2 with any speech "),co=n(I,"EM",{});var Qn=l(co);ts=s(Qn,"encoder-only"),Qn.forEach(o),os=s(I,`
model.`),I.forEach(o),Ao=d(t),de=n(t,"P",{});var ma=l(de);as=s(ma,"This model was contributed by "),Ze=n(ma,"A",{href:!0,rel:!0});var Hn=l(Ze);ss=s(Hn,"Patrick von Platen"),Hn.forEach(o),rs=s(ma,"."),ma.forEach(o),Ro=d(t),pe=n(t,"P",{});var fa=l(pe);ns=s(fa,"The original code can be found "),We=n(fa,"A",{href:!0,rel:!0});var On=l(We);ls=s(On,"here"),On.forEach(o),is=s(fa,"."),fa.forEach(o),qo=d(t),St=n(t,"P",{});var Kn=l(St);cs=s(Kn,"Tips:"),Kn.forEach(o),Xo=d(t),Q=n(t,"UL",{});var eo=l(Q);Fe=n(eo,"LI",{});var ua=l(Fe);ds=s(ua,`Speech2Text2 achieves state-of-the-art results on the CoVoST Speech Translation dataset. For more information, see
the `),Ie=n(ua,"A",{href:!0,rel:!0});var el=l(Ie);ps=s(el,"official models"),el.forEach(o),hs=s(ua," ."),ua.forEach(o),ms=d(eo),Ve=n(eo,"LI",{});var ga=l(Ve);fs=s(ga,"Speech2Text2 is always used within the "),$t=n(ga,"A",{href:!0});var tl=l($t);us=s(tl,"SpeechEncoderDecoder"),tl.forEach(o),gs=s(ga," framework."),ga.forEach(o),_s=d(eo),Pe=n(eo,"LI",{});var _a=l(Pe);Ts=s(_a,"Speech2Text2\u2019s tokenizer is based on "),Be=n(_a,"A",{href:!0,rel:!0});var ol=l(Be);vs=s(ol,"fastBPE"),ol.forEach(o),ys=s(_a,"."),_a.forEach(o),eo.forEach(o),Lo=d(t),te=n(t,"H2",{class:!0});var Ta=l(te);he=n(Ta,"A",{id:!0,class:!0,href:!0});var al=l(he);po=n(al,"SPAN",{});var sl=l(po);T(Ne.$$.fragment,sl),sl.forEach(o),al.forEach(o),bs=d(Ta),ho=n(Ta,"SPAN",{});var rl=l(ho);ks=s(rl,"Inference"),rl.forEach(o),Ta.forEach(o),Yo=d(t),H=n(t,"P",{});var to=l(H);xs=s(to,"Speech2Text2\u2019s "),Et=n(to,"A",{href:!0});var nl=l(Et);ws=s(nl,"SpeechEncoderDecoderModel"),nl.forEach(o),Ms=s(to,` model accepts raw waveform input values from speech and
makes use of `),Jt=n(to,"A",{href:!0});var ll=l(Jt);Ss=s(ll,"generate()"),ll.forEach(o),$s=s(to,` to translate the input speech
autoregressively to the target language.`),to.forEach(o),Do=d(t),C=n(t,"P",{});var G=l(C);Es=s(G,"The "),jt=n(G,"A",{href:!0});var il=l(jt);Js=s(il,"Wav2Vec2FeatureExtractor"),il.forEach(o),js=s(G,` class is responsible for preprocessing the input speech and
`),zt=n(G,"A",{href:!0});var cl=l(zt);zs=s(cl,"Speech2Text2Tokenizer"),cl.forEach(o),Us=s(G,` decodes the generated target tokens to the target string. The
`),Ut=n(G,"A",{href:!0});var dl=l(Ut);Cs=s(dl,"Speech2Text2Processor"),dl.forEach(o),Zs=s(G," wraps "),Ct=n(G,"A",{href:!0});var pl=l(Ct);Ws=s(pl,"Wav2Vec2FeatureExtractor"),pl.forEach(o),Fs=s(G,` and
`),Zt=n(G,"A",{href:!0});var hl=l(Zt);Is=s(hl,"Speech2Text2Tokenizer"),hl.forEach(o),Vs=s(G,` into a single instance to both extract the input features and decode the
predicted token ids.`),G.forEach(o),Qo=d(t),Wt=n(t,"UL",{});var ml=l(Wt);mo=n(ml,"LI",{});var fl=l(mo);Ps=s(fl,"Step-by-step Speech Translation"),fl.forEach(o),ml.forEach(o),Ho=d(t),T(Ge.$$.fragment,t),Oo=d(t),Ft=n(t,"UL",{});var ul=l(Ft);Ae=n(ul,"LI",{});var va=l(Ae);fo=n(va,"P",{});var gl=l(fo);Bs=s(gl,"Speech Translation via Pipelines"),gl.forEach(o),Ns=d(va),uo=n(va,"P",{});var _l=l(uo);Gs=s(_l,"The automatic speech recognition pipeline can also be used to translate speech in just a couple lines of code"),_l.forEach(o),va.forEach(o),ul.forEach(o),Ko=d(t),T(Re.$$.fragment,t),ea=d(t),me=n(t,"P",{});var ya=l(me);As=s(ya,"See "),qe=n(ya,"A",{href:!0,rel:!0});var Tl=l(qe);Rs=s(Tl,"model hub"),Tl.forEach(o),qs=s(ya," to look for Speech2Text2 checkpoints."),ya.forEach(o),ta=d(t),oe=n(t,"H2",{class:!0});var ba=l(oe);fe=n(ba,"A",{id:!0,class:!0,href:!0});var vl=l(fe);go=n(vl,"SPAN",{});var yl=l(go);T(Xe.$$.fragment,yl),yl.forEach(o),vl.forEach(o),Xs=d(ba),_o=n(ba,"SPAN",{});var bl=l(_o);Ls=s(bl,"Documentation resources"),bl.forEach(o),ba.forEach(o),oa=d(t),It=n(t,"UL",{});var kl=l(It);To=n(kl,"LI",{});var xl=l(To);Vt=n(xl,"A",{href:!0});var wl=l(Vt);Ys=s(wl,"Causal language modeling task guide"),wl.forEach(o),xl.forEach(o),kl.forEach(o),aa=d(t),ae=n(t,"H2",{class:!0});var ka=l(ae);ue=n(ka,"A",{id:!0,class:!0,href:!0});var Ml=l(ue);vo=n(Ml,"SPAN",{});var Sl=l(vo);T(Le.$$.fragment,Sl),Sl.forEach(o),Ml.forEach(o),Ds=d(ka),yo=n(ka,"SPAN",{});var $l=l(yo);Qs=s($l,"Speech2Text2Config"),$l.forEach(o),ka.forEach(o),sa=d(t),P=n(t,"DIV",{class:!0});var Ee=l(P);T(Ye.$$.fragment,Ee),Hs=d(Ee),se=n(Ee,"P",{});var oo=l(se);Os=s(oo,"This is the configuration class to store the configuration of a "),Pt=n(oo,"A",{href:!0});var El=l(Pt);Ks=s(El,"Speech2Text2ForCausalLM"),El.forEach(o),er=s(oo,`. It is used to
instantiate an Speech2Text2 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 Speech2Text2
`),De=n(oo,"A",{href:!0,rel:!0});var Jl=l(De);tr=s(Jl,"facebook/s2t-wav2vec2-large-en-de"),Jl.forEach(o),or=s(oo," architecture."),oo.forEach(o),ar=d(Ee),re=n(Ee,"P",{});var ao=l(re);sr=s(ao,"Configuration objects inherit from "),Bt=n(ao,"A",{href:!0});var jl=l(Bt);rr=s(jl,"PretrainedConfig"),jl.forEach(o),nr=s(ao,` and can be used to control the model outputs. Read the
documentation from `),Nt=n(ao,"A",{href:!0});var zl=l(Nt);lr=s(zl,"PretrainedConfig"),zl.forEach(o),ir=s(ao," for more information."),ao.forEach(o),cr=d(Ee),T(ge.$$.fragment,Ee),Ee.forEach(o),ra=d(t),ne=n(t,"H2",{class:!0});var xa=l(ne);_e=n(xa,"A",{id:!0,class:!0,href:!0});var Ul=l(_e);bo=n(Ul,"SPAN",{});var Cl=l(bo);T(Qe.$$.fragment,Cl),Cl.forEach(o),Ul.forEach(o),dr=d(xa),ko=n(xa,"SPAN",{});var Zl=l(ko);pr=s(Zl,"Speech2TextTokenizer"),Zl.forEach(o),xa.forEach(o),na=d(t),j=n(t,"DIV",{class:!0});var A=l(j);T(He.$$.fragment,A),hr=d(A),xo=n(A,"P",{});var Wl=l(xo);mr=s(Wl,"Constructs a Speech2Text2Tokenizer."),Wl.forEach(o),fr=d(A),Oe=n(A,"P",{});var wa=l(Oe);ur=s(wa,"This tokenizer inherits from "),Gt=n(wa,"A",{href:!0});var Fl=l(Gt);gr=s(Fl,"PreTrainedTokenizer"),Fl.forEach(o),_r=s(wa,` which contains some of the main methods. Users should refer to
the superclass for more information regarding such methods.`),wa.forEach(o),Tr=d(A),Te=n(A,"DIV",{class:!0});var Ma=l(Te);T(Ke.$$.fragment,Ma),vr=d(Ma),wo=n(Ma,"P",{});var Il=l(wo);yr=s(Il,"Convert a list of lists of token ids into a list of strings by calling decode."),Il.forEach(o),Ma.forEach(o),br=d(A),O=n(A,"DIV",{class:!0});var so=l(O);T(et.$$.fragment,so),kr=d(so),Mo=n(so,"P",{});var Vl=l(Mo);xr=s(Vl,`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),Vl.forEach(o),wr=d(so),tt=n(so,"P",{});var Sa=l(tt);Mr=s(Sa,"Similar to doing "),So=n(Sa,"CODE",{});var Pl=l(So);Sr=s(Pl,"self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),Pl.forEach(o),$r=s(Sa,"."),Sa.forEach(o),so.forEach(o),Er=d(A),At=n(A,"DIV",{class:!0});var Bl=l(At);T(ot.$$.fragment,Bl),Bl.forEach(o),A.forEach(o),la=d(t),le=n(t,"H2",{class:!0});var $a=l(le);ve=n($a,"A",{id:!0,class:!0,href:!0});var Nl=l(ve);$o=n(Nl,"SPAN",{});var Gl=l($o);T(at.$$.fragment,Gl),Gl.forEach(o),Nl.forEach(o),Jr=d($a),Eo=n($a,"SPAN",{});var Al=l(Eo);jr=s(Al,"Speech2Text2Processor"),Al.forEach(o),$a.forEach(o),ia=d(t),M=n(t,"DIV",{class:!0});var Z=l(M);T(st.$$.fragment,Z),zr=d(Z),Jo=n(Z,"P",{});var Rl=l(Jo);Ur=s(Rl,`Constructs a Speech2Text2 processor which wraps a Speech2Text2 feature extractor and a Speech2Text2 tokenizer into
a single processor.`),Rl.forEach(o),Cr=d(Z),F=n(Z,"P",{});var X=l(F);Rt=n(X,"A",{href:!0});var ql=l(Rt);Zr=s(ql,"Speech2Text2Processor"),ql.forEach(o),Wr=s(X," offers all the functionalities of "),qt=n(X,"A",{href:!0});var Xl=l(qt);Fr=s(Xl,"AutoFeatureExtractor"),Xl.forEach(o),Ir=s(X," and "),Xt=n(X,"A",{href:!0});var Ll=l(Xt);Vr=s(Ll,"Speech2Text2Tokenizer"),Ll.forEach(o),Pr=s(X,`.
See the `),rt=n(X,"A",{href:!0});var Vn=l(rt);jo=n(Vn,"STRONG",{});var Yl=l(jo);Br=s(Yl,"call"),Yl.forEach(o),Nr=s(Vn,"()"),Vn.forEach(o),Gr=s(X," and "),Lt=n(X,"A",{href:!0});var Dl=l(Lt);Ar=s(Dl,"decode()"),Dl.forEach(o),Rr=s(X," for more information."),X.forEach(o),qr=d(Z),ye=n(Z,"DIV",{class:!0});var Ea=l(ye);T(nt.$$.fragment,Ea),Xr=d(Ea),R=n(Ea,"P",{});var Je=l(R);Lr=s(Je,`When used in normal mode, this method forwards all its arguments to AutoFeatureExtractor\u2019s
`),zo=n(Je,"CODE",{});var Ql=l(zo);Yr=s(Ql,"__call__()"),Ql.forEach(o),Dr=s(Je,` and returns its output. If used in the context
`),Uo=n(Je,"CODE",{});var Hl=l(Uo);Qr=s(Hl,"as_target_processor()"),Hl.forEach(o),Hr=s(Je,` this method forwards all its arguments to
Speech2Text2Tokenizer\u2019s `),lt=n(Je,"A",{href:!0});var Pn=l(lt);Co=n(Pn,"STRONG",{});var Ol=l(Co);Or=s(Ol,"call"),Ol.forEach(o),Kr=s(Pn,"()"),Pn.forEach(o),en=s(Je,`. Please refer to the doctsring of the above two
methods for more information.`),Je.forEach(o),Ea.forEach(o),tn=d(Z),K=n(Z,"DIV",{class:!0});var ro=l(K);T(it.$$.fragment,ro),on=d(ro),Zo=n(ro,"P",{});var Kl=l(Zo);an=s(Kl,"Instantiate a processor associated with a pretrained model."),Kl.forEach(o),sn=d(ro),T(be.$$.fragment,ro),ro.forEach(o),rn=d(Z),ee=n(Z,"DIV",{class:!0});var no=l(ee);T(ct.$$.fragment,no),nn=d(no),dt=n(no,"P",{});var Ja=l(dt);ln=s(Ja,`Saves the attributes of this processor (feature extractor, tokenizer\u2026) in the specified directory so that it
can be reloaded using the `),Yt=n(Ja,"A",{href:!0});var ei=l(Yt);cn=s(ei,"from_pretrained()"),ei.forEach(o),dn=s(Ja," method."),Ja.forEach(o),pn=d(no),T(ke.$$.fragment,no),no.forEach(o),hn=d(Z),xe=n(Z,"DIV",{class:!0});var ja=l(xe);T(pt.$$.fragment,ja),mn=d(ja),ht=n(ja,"P",{});var za=l(ht);fn=s(za,"This method forwards all its arguments to Speech2Text2Tokenizer\u2019s "),Dt=n(za,"A",{href:!0});var ti=l(Dt);un=s(ti,"batch_decode()"),ti.forEach(o),gn=s(za,`. Please
refer to the docstring of this method for more information.`),za.forEach(o),ja.forEach(o),_n=d(Z),we=n(Z,"DIV",{class:!0});var Ua=l(we);T(mt.$$.fragment,Ua),Tn=d(Ua),ft=n(Ua,"P",{});var Ca=l(ft);vn=s(Ca,"This method forwards all its arguments to Speech2Text2Tokenizer\u2019s "),Qt=n(Ca,"A",{href:!0});var oi=l(Qt);yn=s(oi,"decode()"),oi.forEach(o),bn=s(Ca,`. Please refer
to the docstring of this method for more information.`),Ca.forEach(o),Ua.forEach(o),Z.forEach(o),ca=d(t),ie=n(t,"H2",{class:!0});var Za=l(ie);Me=n(Za,"A",{id:!0,class:!0,href:!0});var ai=l(Me);Wo=n(ai,"SPAN",{});var si=l(Wo);T(ut.$$.fragment,si),si.forEach(o),ai.forEach(o),kn=d(Za),Fo=n(Za,"SPAN",{});var ri=l(Fo);xn=s(ri,"Speech2Text2ForCausalLM"),ri.forEach(o),Za.forEach(o),da=d(t),B=n(t,"DIV",{class:!0});var je=l(B);T(gt.$$.fragment,je),wn=d(je),q=n(je,"P",{});var ze=l(q);Mn=s(ze,"The Speech2Text2 Decoder with a language modeling head. Can be used as the decoder part of "),Ht=n(ze,"A",{href:!0});var ni=l(Ht);Sn=s(ni,"EncoderDecoderModel"),ni.forEach(o),$n=s(ze," and "),Io=n(ze,"CODE",{});var li=l(Io);En=s(li,"SpeechEncoderDecoder"),li.forEach(o),Jn=s(ze,`.
This model inherits from `),Ot=n(ze,"A",{href:!0});var ii=l(Ot);jn=s(ii,"PreTrainedModel"),ii.forEach(o),zn=s(ze,`. 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.)`),ze.forEach(o),Un=d(je),_t=n(je,"P",{});var Wa=l(_t);Cn=s(Wa,"This model is also a PyTorch "),Tt=n(Wa,"A",{href:!0,rel:!0});var ci=l(Tt);Zn=s(ci,"torch.nn.Module"),ci.forEach(o),Wn=s(Wa,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Wa.forEach(o),Fn=d(je),Se=n(je,"DIV",{class:!0});var Fa=l(Se);T(vt.$$.fragment,Fa),In=d(Fa),T($e.$$.fragment,Fa),Fa.forEach(o),je.forEach(o),this.h()},h(){i(f,"name","hf:doc:metadata"),i(f,"content",JSON.stringify(xi)),i(g,"id","speech2text2"),i(g,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(g,"href","#speech2text2"),i(u,"class","relative group"),i(J,"id","overview"),i(J,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(J,"href","#overview"),i(z,"class","relative group"),i(kt,"href","wav2vec2"),i(Ce,"href","https://arxiv.org/abs/2104.06678"),i(Ce,"rel","nofollow"),i(xt,"href","wav2vec2"),i(wt,"href","hubert"),i(Mt,"href","speech-encoder-decoder"),i(Ze,"href","https://huggingface.co/patrickvonplaten"),i(Ze,"rel","nofollow"),i(We,"href","https://github.com/pytorch/fairseq/blob/1f7ef9ed1e1061f8c7f88f8b94c7186834398690/fairseq/models/wav2vec/wav2vec2_asr.py#L266"),i(We,"rel","nofollow"),i(Ie,"href","https://huggingface.co/models?other=speech2text2"),i(Ie,"rel","nofollow"),i($t,"href","speech-encoder-decoder"),i(Be,"href","https://github.com/glample/fastBPE"),i(Be,"rel","nofollow"),i(he,"id","inference"),i(he,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(he,"href","#inference"),i(te,"class","relative group"),i(Et,"href","/docs/transformers/main/en/model_doc/speech-encoder-decoder#transformers.SpeechEncoderDecoderModel"),i(Jt,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.generate"),i(jt,"href","/docs/transformers/main/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor"),i(zt,"href","/docs/transformers/main/en/model_doc/speech_to_text_2#transformers.Speech2Text2Tokenizer"),i(Ut,"href","/docs/transformers/main/en/model_doc/speech_to_text_2#transformers.Speech2Text2Processor"),i(Ct,"href","/docs/transformers/main/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor"),i(Zt,"href","/docs/transformers/main/en/model_doc/speech_to_text_2#transformers.Speech2Text2Tokenizer"),i(qe,"href","https://huggingface.co/models?filter=speech2text2"),i(qe,"rel","nofollow"),i(fe,"id","documentation-resources"),i(fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(fe,"href","#documentation-resources"),i(oe,"class","relative group"),i(Vt,"href","../tasks/language_modeling"),i(ue,"id","transformers.Speech2Text2Config"),i(ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(ue,"href","#transformers.Speech2Text2Config"),i(ae,"class","relative group"),i(Pt,"href","/docs/transformers/main/en/model_doc/speech_to_text_2#transformers.Speech2Text2ForCausalLM"),i(De,"href","https://huggingface.co/facebook/s2t-wav2vec2-large-en-de"),i(De,"rel","nofollow"),i(Bt,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),i(Nt,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),i(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(_e,"id","transformers.Speech2Text2Tokenizer"),i(_e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(_e,"href","#transformers.Speech2Text2Tokenizer"),i(ne,"class","relative group"),i(Gt,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),i(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(At,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(ve,"id","transformers.Speech2Text2Processor"),i(ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(ve,"href","#transformers.Speech2Text2Processor"),i(le,"class","relative group"),i(Rt,"href","/docs/transformers/main/en/model_doc/speech_to_text_2#transformers.Speech2Text2Processor"),i(qt,"href","/docs/transformers/main/en/model_doc/auto#transformers.AutoFeatureExtractor"),i(Xt,"href","/docs/transformers/main/en/model_doc/speech_to_text_2#transformers.Speech2Text2Tokenizer"),i(rt,"href","/docs/transformers/main/en/model_doc/speech_to_text_2#transformers.Speech2Text2Processor.__call__"),i(Lt,"href","/docs/transformers/main/en/model_doc/speech_to_text_2#transformers.Speech2Text2Processor.decode"),i(lt,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"),i(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Yt,"href","/docs/transformers/main/en/model_doc/donut#transformers.DonutProcessor.from_pretrained"),i(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Dt,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode"),i(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Qt,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode"),i(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Me,"id","transformers.Speech2Text2ForCausalLM"),i(Me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(Me,"href","#transformers.Speech2Text2ForCausalLM"),i(ie,"class","relative group"),i(Ht,"href","/docs/transformers/main/en/model_doc/encoder-decoder#transformers.EncoderDecoderModel"),i(Ot,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),i(Tt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),i(Tt,"rel","nofollow"),i(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,p){e(document.head,f),h(t,S,p),h(t,u,p),e(u,g),e(g,w),v(m,w,null),e(u,x),e(u,V),e(V,W),h(t,E,p),h(t,z,p),e(z,J),e(J,U),v(Y,U,null),e(z,bt),e(z,ce),e(ce,Va),h(t,No,p),h(t,D,p),e(D,Pa),e(D,kt),e(kt,Ba),e(D,Na),e(D,Ce),e(Ce,Ga),e(D,Aa),h(t,Go,p),h(t,$,p),e($,Ra),e($,lo),e(lo,qa),e($,Xa),e($,io),e(io,La),e($,Ya),e($,xt),e(xt,Da),e($,Qa),e($,wt),e(wt,Ha),e($,Oa),e($,Mt),e(Mt,Ka),e($,es),e($,co),e(co,ts),e($,os),h(t,Ao,p),h(t,de,p),e(de,as),e(de,Ze),e(Ze,ss),e(de,rs),h(t,Ro,p),h(t,pe,p),e(pe,ns),e(pe,We),e(We,ls),e(pe,is),h(t,qo,p),h(t,St,p),e(St,cs),h(t,Xo,p),h(t,Q,p),e(Q,Fe),e(Fe,ds),e(Fe,Ie),e(Ie,ps),e(Fe,hs),e(Q,ms),e(Q,Ve),e(Ve,fs),e(Ve,$t),e($t,us),e(Ve,gs),e(Q,_s),e(Q,Pe),e(Pe,Ts),e(Pe,Be),e(Be,vs),e(Pe,ys),h(t,Lo,p),h(t,te,p),e(te,he),e(he,po),v(Ne,po,null),e(te,bs),e(te,ho),e(ho,ks),h(t,Yo,p),h(t,H,p),e(H,xs),e(H,Et),e(Et,ws),e(H,Ms),e(H,Jt),e(Jt,Ss),e(H,$s),h(t,Do,p),h(t,C,p),e(C,Es),e(C,jt),e(jt,Js),e(C,js),e(C,zt),e(zt,zs),e(C,Us),e(C,Ut),e(Ut,Cs),e(C,Zs),e(C,Ct),e(Ct,Ws),e(C,Fs),e(C,Zt),e(Zt,Is),e(C,Vs),h(t,Qo,p),h(t,Wt,p),e(Wt,mo),e(mo,Ps),h(t,Ho,p),v(Ge,t,p),h(t,Oo,p),h(t,Ft,p),e(Ft,Ae),e(Ae,fo),e(fo,Bs),e(Ae,Ns),e(Ae,uo),e(uo,Gs),h(t,Ko,p),v(Re,t,p),h(t,ea,p),h(t,me,p),e(me,As),e(me,qe),e(qe,Rs),e(me,qs),h(t,ta,p),h(t,oe,p),e(oe,fe),e(fe,go),v(Xe,go,null),e(oe,Xs),e(oe,_o),e(_o,Ls),h(t,oa,p),h(t,It,p),e(It,To),e(To,Vt),e(Vt,Ys),h(t,aa,p),h(t,ae,p),e(ae,ue),e(ue,vo),v(Le,vo,null),e(ae,Ds),e(ae,yo),e(yo,Qs),h(t,sa,p),h(t,P,p),v(Ye,P,null),e(P,Hs),e(P,se),e(se,Os),e(se,Pt),e(Pt,Ks),e(se,er),e(se,De),e(De,tr),e(se,or),e(P,ar),e(P,re),e(re,sr),e(re,Bt),e(Bt,rr),e(re,nr),e(re,Nt),e(Nt,lr),e(re,ir),e(P,cr),v(ge,P,null),h(t,ra,p),h(t,ne,p),e(ne,_e),e(_e,bo),v(Qe,bo,null),e(ne,dr),e(ne,ko),e(ko,pr),h(t,na,p),h(t,j,p),v(He,j,null),e(j,hr),e(j,xo),e(xo,mr),e(j,fr),e(j,Oe),e(Oe,ur),e(Oe,Gt),e(Gt,gr),e(Oe,_r),e(j,Tr),e(j,Te),v(Ke,Te,null),e(Te,vr),e(Te,wo),e(wo,yr),e(j,br),e(j,O),v(et,O,null),e(O,kr),e(O,Mo),e(Mo,xr),e(O,wr),e(O,tt),e(tt,Mr),e(tt,So),e(So,Sr),e(tt,$r),e(j,Er),e(j,At),v(ot,At,null),h(t,la,p),h(t,le,p),e(le,ve),e(ve,$o),v(at,$o,null),e(le,Jr),e(le,Eo),e(Eo,jr),h(t,ia,p),h(t,M,p),v(st,M,null),e(M,zr),e(M,Jo),e(Jo,Ur),e(M,Cr),e(M,F),e(F,Rt),e(Rt,Zr),e(F,Wr),e(F,qt),e(qt,Fr),e(F,Ir),e(F,Xt),e(Xt,Vr),e(F,Pr),e(F,rt),e(rt,jo),e(jo,Br),e(rt,Nr),e(F,Gr),e(F,Lt),e(Lt,Ar),e(F,Rr),e(M,qr),e(M,ye),v(nt,ye,null),e(ye,Xr),e(ye,R),e(R,Lr),e(R,zo),e(zo,Yr),e(R,Dr),e(R,Uo),e(Uo,Qr),e(R,Hr),e(R,lt),e(lt,Co),e(Co,Or),e(lt,Kr),e(R,en),e(M,tn),e(M,K),v(it,K,null),e(K,on),e(K,Zo),e(Zo,an),e(K,sn),v(be,K,null),e(M,rn),e(M,ee),v(ct,ee,null),e(ee,nn),e(ee,dt),e(dt,ln),e(dt,Yt),e(Yt,cn),e(dt,dn),e(ee,pn),v(ke,ee,null),e(M,hn),e(M,xe),v(pt,xe,null),e(xe,mn),e(xe,ht),e(ht,fn),e(ht,Dt),e(Dt,un),e(ht,gn),e(M,_n),e(M,we),v(mt,we,null),e(we,Tn),e(we,ft),e(ft,vn),e(ft,Qt),e(Qt,yn),e(ft,bn),h(t,ca,p),h(t,ie,p),e(ie,Me),e(Me,Wo),v(ut,Wo,null),e(ie,kn),e(ie,Fo),e(Fo,xn),h(t,da,p),h(t,B,p),v(gt,B,null),e(B,wn),e(B,q),e(q,Mn),e(q,Ht),e(Ht,Sn),e(q,$n),e(q,Io),e(Io,En),e(q,Jn),e(q,Ot),e(Ot,jn),e(q,zn),e(B,Un),e(B,_t),e(_t,Cn),e(_t,Tt),e(Tt,Zn),e(_t,Wn),e(B,Fn),e(B,Se),v(vt,Se,null),e(Se,In),v($e,Se,null),pa=!0},p(t,[p]){const yt={};p&2&&(yt.$$scope={dirty:p,ctx:t}),ge.$set(yt);const Vo={};p&2&&(Vo.$$scope={dirty:p,ctx:t}),be.$set(Vo);const Po={};p&2&&(Po.$$scope={dirty:p,ctx:t}),ke.$set(Po);const Bo={};p&2&&(Bo.$$scope={dirty:p,ctx:t}),$e.$set(Bo)},i(t){pa||(y(m.$$.fragment,t),y(Y.$$.fragment,t),y(Ne.$$.fragment,t),y(Ge.$$.fragment,t),y(Re.$$.fragment,t),y(Xe.$$.fragment,t),y(Le.$$.fragment,t),y(Ye.$$.fragment,t),y(ge.$$.fragment,t),y(Qe.$$.fragment,t),y(He.$$.fragment,t),y(Ke.$$.fragment,t),y(et.$$.fragment,t),y(ot.$$.fragment,t),y(at.$$.fragment,t),y(st.$$.fragment,t),y(nt.$$.fragment,t),y(it.$$.fragment,t),y(be.$$.fragment,t),y(ct.$$.fragment,t),y(ke.$$.fragment,t),y(pt.$$.fragment,t),y(mt.$$.fragment,t),y(ut.$$.fragment,t),y(gt.$$.fragment,t),y(vt.$$.fragment,t),y($e.$$.fragment,t),pa=!0)},o(t){b(m.$$.fragment,t),b(Y.$$.fragment,t),b(Ne.$$.fragment,t),b(Ge.$$.fragment,t),b(Re.$$.fragment,t),b(Xe.$$.fragment,t),b(Le.$$.fragment,t),b(Ye.$$.fragment,t),b(ge.$$.fragment,t),b(Qe.$$.fragment,t),b(He.$$.fragment,t),b(Ke.$$.fragment,t),b(et.$$.fragment,t),b(ot.$$.fragment,t),b(at.$$.fragment,t),b(st.$$.fragment,t),b(nt.$$.fragment,t),b(it.$$.fragment,t),b(be.$$.fragment,t),b(ct.$$.fragment,t),b(ke.$$.fragment,t),b(pt.$$.fragment,t),b(mt.$$.fragment,t),b(ut.$$.fragment,t),b(gt.$$.fragment,t),b(vt.$$.fragment,t),b($e.$$.fragment,t),pa=!1},d(t){o(f),t&&o(S),t&&o(u),k(m),t&&o(E),t&&o(z),k(Y),t&&o(No),t&&o(D),t&&o(Go),t&&o($),t&&o(Ao),t&&o(de),t&&o(Ro),t&&o(pe),t&&o(qo),t&&o(St),t&&o(Xo),t&&o(Q),t&&o(Lo),t&&o(te),k(Ne),t&&o(Yo),t&&o(H),t&&o(Do),t&&o(C),t&&o(Qo),t&&o(Wt),t&&o(Ho),k(Ge,t),t&&o(Oo),t&&o(Ft),t&&o(Ko),k(Re,t),t&&o(ea),t&&o(me),t&&o(ta),t&&o(oe),k(Xe),t&&o(oa),t&&o(It),t&&o(aa),t&&o(ae),k(Le),t&&o(sa),t&&o(P),k(Ye),k(ge),t&&o(ra),t&&o(ne),k(Qe),t&&o(na),t&&o(j),k(He),k(Ke),k(et),k(ot),t&&o(la),t&&o(le),k(at),t&&o(ia),t&&o(M),k(st),k(nt),k(it),k(be),k(ct),k(ke),k(pt),k(mt),t&&o(ca),t&&o(ie),k(ut),t&&o(da),t&&o(B),k(gt),k(vt),k($e)}}}const xi={local:"speech2text2",sections:[{local:"overview",title:"Overview"},{local:"inference",title:"Inference"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.Speech2Text2Config",title:"Speech2Text2Config"},{local:"transformers.Speech2Text2Tokenizer",title:"Speech2TextTokenizer"},{local:"transformers.Speech2Text2Processor",title:"Speech2Text2Processor"},{local:"transformers.Speech2Text2ForCausalLM",title:"Speech2Text2ForCausalLM"}],title:"Speech2Text2"};function wi(L){return _i(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class zi extends mi{constructor(f){super();fi(this,f,wi,ki,ui,{})}}export{zi as default,xi as metadata};
