import{S as mc,i as fc,s as uc,e as a,k as i,w as _,t as s,M as gc,c as n,d as o,m as d,a as l,x as v,h as r,b as c,G as e,g as h,y as T,q as y,o as b,B as k,v as _c,L as hc}from"../../chunks/vendor-hf-doc-builder.js";import{T as dc}from"../../chunks/Tip-hf-doc-builder.js";import{D as B}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Is}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ue}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as pc}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function vc(L){let f,S,u,g,w;return g=new Is({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=a("p"),S=s("Example:"),u=i(),_(g.$$.fragment)},l(m){f=n(m,"P",{});var x=l(f);S=r(x,"Example:"),x.forEach(o),u=d(m),v(g.$$.fragment,m)},m(m,x){h(m,f,x),e(f,S),h(m,u,x),T(g,m,x),w=!0},p:hc,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 Tc(L){let f,S,u,g,w,m,x,V,W,E,z;return{c(){f=a("p"),S=s(`This class method is simply calling the feature extractor
`),u=a("a"),g=s("from_pretrained()"),w=s(`, image processor
`),m=a("a"),x=s("ImageProcessingMixin"),V=s(` and the tokenizer
`),W=a("code"),E=s("~tokenization_utils_base.PreTrainedTokenizer.from_pretrained"),z=s(` 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=r(U,`This class method is simply calling the feature extractor
`),u=n(U,"A",{href:!0});var Y=l(u);g=r(Y,"from_pretrained()"),Y.forEach(o),w=r(U,`, image processor
`),m=n(U,"A",{href:!0});var bt=l(m);x=r(bt,"ImageProcessingMixin"),bt.forEach(o),V=r(U,` and the tokenizer
`),W=n(U,"CODE",{});var ie=l(W);E=r(ie,"~tokenization_utils_base.PreTrainedTokenizer.from_pretrained"),ie.forEach(o),z=r(U,` methods. Please refer to the docstrings of the
methods above for more information.`),U.forEach(o),this.h()},h(){c(u,"href","/docs/transformers/v4.31.0/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.from_pretrained"),c(m,"href","/docs/transformers/v4.31.0/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 yc(L){let f,S,u,g,w,m,x,V;return{c(){f=a("p"),S=s("This class method is simply calling "),u=a("a"),g=s("save_pretrained()"),w=s(` and
`),m=a("a"),x=s("save_pretrained()"),V=s(`. 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=r(E,"This class method is simply calling "),u=n(E,"A",{href:!0});var z=l(u);g=r(z,"save_pretrained()"),z.forEach(o),w=r(E,` and
`),m=n(E,"A",{href:!0});var J=l(m);x=r(J,"save_pretrained()"),J.forEach(o),V=r(E,`. Please refer to the docstrings of the
methods above for more information.`),E.forEach(o),this.h()},h(){c(u,"href","/docs/transformers/v4.31.0/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.save_pretrained"),c(m,"href","/docs/transformers/v4.31.0/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 bc(L){let f,S,u,g,w;return g=new Is({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=a("p"),S=s("Example:"),u=i(),_(g.$$.fragment)},l(m){f=n(m,"P",{});var x=l(f);S=r(x,"Example:"),x.forEach(o),u=d(m),v(g.$$.fragment,m)},m(m,x){h(m,f,x),e(f,S),h(m,u,x),T(g,m,x),w=!0},p:hc,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 kc(L){let f,S,u,g,w,m,x,V,W,E,z,J,U,Y,bt,ie,Vs,Bo,D,Ns,kt,Ps,Bs,Ce,Gs,As,Go,$,Rs,lo,qs,Xs,co,Ls,Ys,xt,Ds,Qs,wt,Hs,Os,Mt,Ks,er,io,tr,or,Ao,de,sr,Ze,rr,ar,Ro,pe,nr,We,lr,cr,qo,St,ir,Xo,Q,Fe,dr,Ie,pr,hr,mr,Ve,fr,$t,ur,gr,_r,Ne,vr,Pe,Tr,yr,Lo,te,he,po,Be,br,ho,kr,Yo,H,xr,Et,wr,Mr,Jt,Sr,$r,Do,C,Er,jt,Jr,jr,zt,zr,Ur,Ut,Cr,Zr,Ct,Wr,Fr,Zt,Ir,Vr,Qo,Wt,mo,Nr,Ho,Ge,Oo,Ft,Ae,fo,Pr,Br,uo,Gr,Ko,Re,es,me,Ar,qe,Rr,qr,ts,oe,fe,go,Xe,Xr,_o,Lr,os,It,vo,Vt,Yr,ss,se,ue,To,Le,Dr,yo,Qr,rs,N,Ye,Hr,re,Or,Nt,Kr,ea,De,ta,oa,sa,ae,ra,Pt,aa,na,Bt,la,ca,ia,ge,as,ne,_e,bo,Qe,da,ko,pa,ns,j,He,ha,xo,ma,fa,Oe,ua,Gt,ga,_a,va,ve,Ke,Ta,wo,ya,ba,O,et,ka,Mo,xa,wa,tt,Ma,So,Sa,$a,Ea,At,ot,ls,le,Te,$o,st,Ja,Eo,ja,cs,M,rt,za,Jo,Ua,Ca,F,Rt,Za,Wa,qt,Fa,Ia,Xt,Va,Na,at,jo,Pa,Ba,Ga,Lt,Aa,Ra,qa,ye,nt,Xa,R,La,zo,Ya,Da,Uo,Qa,Ha,lt,Co,Oa,Ka,en,tn,K,ct,on,Zo,sn,rn,be,an,ee,it,nn,dt,ln,Yt,cn,dn,pn,ke,hn,xe,pt,mn,ht,fn,Dt,un,gn,_n,we,mt,vn,ft,Tn,Qt,yn,bn,is,ce,Me,Wo,ut,kn,Fo,xn,ds,P,gt,wn,q,Mn,Ht,Sn,$n,Io,En,Jn,Ot,jn,zn,Un,_t,Cn,vt,Zn,Wn,Fn,Se,Tt,In,$e,ps;return m=new Ue({}),Y=new Ue({}),Be=new Ue({}),Ge=new Is({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 Is({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 B({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/v4.31.0/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/v4.31.0/src/transformers/models/speech_to_text_2/configuration_speech_to_text_2.py#L31"}}),ge=new pc({props:{anchor:"transformers.Speech2Text2Config.example",$$slots:{default:[vc]},$$scope:{ctx:L}}}),Qe=new Ue({}),He=new B({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/v4.31.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>`,name:"pad_token"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/speech_to_text_2/tokenization_speech_to_text_2.py#L73"}}),Ke=new B({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/v4.31.0/src/transformers/tokenization_utils_base.py#L3461",returnDescription:`
<p>The list of decoded sentences.</p>
`,returnType:`
<p><code>List[str]</code></p>
`}}),et=new B({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/v4.31.0/src/transformers/tokenization_utils_base.py#L3495",returnDescription:`
<p>The decoded sentence.</p>
`,returnType:`
<p><code>str</code></p>
`}}),ot=new B({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/v4.31.0/src/transformers/models/speech_to_text_2/tokenization_speech_to_text_2.py#L241"}}),st=new Ue({}),rt=new B({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/v4.31.0/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/v4.31.0/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/v4.31.0/src/transformers/models/speech_to_text_2/processing_speech_to_text_2.py#L24"}}),nt=new B({props:{name:"__call__",anchor:"transformers.Speech2Text2Processor.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/speech_to_text_2/processing_speech_to_text_2.py#L46"}}),ct=new B({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/v4.31.0/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.save_pretrained">save_pretrained()</a> method, e.g., <code>./my_model_directory/</code>.</li>
<li>a path or url to a saved feature extractor JSON <em>file</em>, e.g.,
<code>./my_model_directory/preprocessor_config.json</code>.
**kwargs &#x2014;
Additional keyword arguments passed along to both
<a href="/docs/transformers/v4.31.0/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/v4.31.0/src/transformers/processing_utils.py#L155"}}),be=new dc({props:{$$slots:{default:[Tc]},$$scope:{ctx:L}}}),it=new B({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/v4.31.0/en/internal/image_processing_utils#transformers.ImageProcessingMixin.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/processing_utils.py#L93"}}),ke=new dc({props:{$$slots:{default:[yc]},$$scope:{ctx:L}}}),pt=new B({props:{name:"batch_decode",anchor:"transformers.Speech2Text2Processor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/speech_to_text_2/processing_speech_to_text_2.py#L85"}}),mt=new B({props:{name:"decode",anchor:"transformers.Speech2Text2Processor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/speech_to_text_2/processing_speech_to_text_2.py#L92"}}),ut=new Ue({}),gt=new B({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/v4.31.0/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/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/speech_to_text_2/modeling_speech_to_text_2.py#L758"}}),Tt=new B({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/v4.31.0/en/model_doc/speech_to_text_2#transformers.Speech2Text2Tokenizer">Speech2Text2Tokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/speech_to_text_2/modeling_speech_to_text_2.py#L791",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/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/v4.31.0/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/v4.31.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$e=new pc({props:{anchor:"transformers.Speech2Text2ForCausalLM.forward.example",$$slots:{default:[bc]},$$scope:{ctx:L}}}),{c(){f=a("meta"),S=i(),u=a("h1"),g=a("a"),w=a("span"),_(m.$$.fragment),x=i(),V=a("span"),W=s("Speech2Text2"),E=i(),z=a("h2"),J=a("a"),U=a("span"),_(Y.$$.fragment),bt=i(),ie=a("span"),Vs=s("Overview"),Bo=i(),D=a("p"),Ns=s("The Speech2Text2 model is used together with "),kt=a("a"),Ps=s("Wav2Vec2"),Bs=s(` for Speech Translation models proposed in
`),Ce=a("a"),Gs=s("Large-Scale Self- and Semi-Supervised Learning for Speech Translation"),As=s(` by
Changhan Wang, Anne Wu, Juan Pino, Alexei Baevski, Michael Auli, Alexis Conneau.`),Go=i(),$=a("p"),Rs=s("Speech2Text2 is a "),lo=a("em"),qs=s("decoder-only"),Xs=s(" transformer model that can be used with any speech "),co=a("em"),Ls=s("encoder-only"),Ys=s(`, such as
`),xt=a("a"),Ds=s("Wav2Vec2"),Qs=s(" or "),wt=a("a"),Hs=s("HuBERT"),Os=s(` for Speech-to-Text tasks. Please refer to the
`),Mt=a("a"),Ks=s("SpeechEncoderDecoder"),er=s(" class on how to combine Speech2Text2 with any speech "),io=a("em"),tr=s("encoder-only"),or=s(`
model.`),Ao=i(),de=a("p"),sr=s("This model was contributed by "),Ze=a("a"),rr=s("Patrick von Platen"),ar=s("."),Ro=i(),pe=a("p"),nr=s("The original code can be found "),We=a("a"),lr=s("here"),cr=s("."),qo=i(),St=a("p"),ir=s("Tips:"),Xo=i(),Q=a("ul"),Fe=a("li"),dr=s(`Speech2Text2 achieves state-of-the-art results on the CoVoST Speech Translation dataset. For more information, see
the `),Ie=a("a"),pr=s("official models"),hr=s(" ."),mr=i(),Ve=a("li"),fr=s("Speech2Text2 is always used within the "),$t=a("a"),ur=s("SpeechEncoderDecoder"),gr=s(" framework."),_r=i(),Ne=a("li"),vr=s("Speech2Text2\u2019s tokenizer is based on "),Pe=a("a"),Tr=s("fastBPE"),yr=s("."),Lo=i(),te=a("h2"),he=a("a"),po=a("span"),_(Be.$$.fragment),br=i(),ho=a("span"),kr=s("Inference"),Yo=i(),H=a("p"),xr=s("Speech2Text2\u2019s "),Et=a("a"),wr=s("SpeechEncoderDecoderModel"),Mr=s(` model accepts raw waveform input values from speech and
makes use of `),Jt=a("a"),Sr=s("generate()"),$r=s(` to translate the input speech
autoregressively to the target language.`),Do=i(),C=a("p"),Er=s("The "),jt=a("a"),Jr=s("Wav2Vec2FeatureExtractor"),jr=s(` class is responsible for preprocessing the input speech and
`),zt=a("a"),zr=s("Speech2Text2Tokenizer"),Ur=s(` decodes the generated target tokens to the target string. The
`),Ut=a("a"),Cr=s("Speech2Text2Processor"),Zr=s(" wraps "),Ct=a("a"),Wr=s("Wav2Vec2FeatureExtractor"),Fr=s(` and
`),Zt=a("a"),Ir=s("Speech2Text2Tokenizer"),Vr=s(` into a single instance to both extract the input features and decode the
predicted token ids.`),Qo=i(),Wt=a("ul"),mo=a("li"),Nr=s("Step-by-step Speech Translation"),Ho=i(),_(Ge.$$.fragment),Oo=i(),Ft=a("ul"),Ae=a("li"),fo=a("p"),Pr=s("Speech Translation via Pipelines"),Br=i(),uo=a("p"),Gr=s("The automatic speech recognition pipeline can also be used to translate speech in just a couple lines of code"),Ko=i(),_(Re.$$.fragment),es=i(),me=a("p"),Ar=s("See "),qe=a("a"),Rr=s("model hub"),qr=s(" to look for Speech2Text2 checkpoints."),ts=i(),oe=a("h2"),fe=a("a"),go=a("span"),_(Xe.$$.fragment),Xr=i(),_o=a("span"),Lr=s("Documentation resources"),os=i(),It=a("ul"),vo=a("li"),Vt=a("a"),Yr=s("Causal language modeling task guide"),ss=i(),se=a("h2"),ue=a("a"),To=a("span"),_(Le.$$.fragment),Dr=i(),yo=a("span"),Qr=s("Speech2Text2Config"),rs=i(),N=a("div"),_(Ye.$$.fragment),Hr=i(),re=a("p"),Or=s("This is the configuration class to store the configuration of a "),Nt=a("a"),Kr=s("Speech2Text2ForCausalLM"),ea=s(`. 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=a("a"),ta=s("facebook/s2t-wav2vec2-large-en-de"),oa=s(" architecture."),sa=i(),ae=a("p"),ra=s("Configuration objects inherit from "),Pt=a("a"),aa=s("PretrainedConfig"),na=s(` and can be used to control the model outputs. Read the
documentation from `),Bt=a("a"),la=s("PretrainedConfig"),ca=s(" for more information."),ia=i(),_(ge.$$.fragment),as=i(),ne=a("h2"),_e=a("a"),bo=a("span"),_(Qe.$$.fragment),da=i(),ko=a("span"),pa=s("Speech2TextTokenizer"),ns=i(),j=a("div"),_(He.$$.fragment),ha=i(),xo=a("p"),ma=s("Constructs a Speech2Text2Tokenizer."),fa=i(),Oe=a("p"),ua=s("This tokenizer inherits from "),Gt=a("a"),ga=s("PreTrainedTokenizer"),_a=s(` which contains some of the main methods. Users should refer to
the superclass for more information regarding such methods.`),va=i(),ve=a("div"),_(Ke.$$.fragment),Ta=i(),wo=a("p"),ya=s("Convert a list of lists of token ids into a list of strings by calling decode."),ba=i(),O=a("div"),_(et.$$.fragment),ka=i(),Mo=a("p"),xa=s(`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),wa=i(),tt=a("p"),Ma=s("Similar to doing "),So=a("code"),Sa=s("self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),$a=s("."),Ea=i(),At=a("div"),_(ot.$$.fragment),ls=i(),le=a("h2"),Te=a("a"),$o=a("span"),_(st.$$.fragment),Ja=i(),Eo=a("span"),ja=s("Speech2Text2Processor"),cs=i(),M=a("div"),_(rt.$$.fragment),za=i(),Jo=a("p"),Ua=s(`Constructs a Speech2Text2 processor which wraps a Speech2Text2 feature extractor and a Speech2Text2 tokenizer into
a single processor.`),Ca=i(),F=a("p"),Rt=a("a"),Za=s("Speech2Text2Processor"),Wa=s(" offers all the functionalities of "),qt=a("a"),Fa=s("AutoFeatureExtractor"),Ia=s(" and "),Xt=a("a"),Va=s("Speech2Text2Tokenizer"),Na=s(`.
See the `),at=a("a"),jo=a("strong"),Pa=s("call"),Ba=s("()"),Ga=s(" and "),Lt=a("a"),Aa=s("decode()"),Ra=s(" for more information."),qa=i(),ye=a("div"),_(nt.$$.fragment),Xa=i(),R=a("p"),La=s(`When used in normal mode, this method forwards all its arguments to AutoFeatureExtractor\u2019s
`),zo=a("code"),Ya=s("__call__()"),Da=s(` and returns its output. If used in the context
`),Uo=a("code"),Qa=s("as_target_processor()"),Ha=s(` this method forwards all its arguments to
Speech2Text2Tokenizer\u2019s `),lt=a("a"),Co=a("strong"),Oa=s("call"),Ka=s("()"),en=s(`. Please refer to the doctsring of the above two
methods for more information.`),tn=i(),K=a("div"),_(ct.$$.fragment),on=i(),Zo=a("p"),sn=s("Instantiate a processor associated with a pretrained model."),rn=i(),_(be.$$.fragment),an=i(),ee=a("div"),_(it.$$.fragment),nn=i(),dt=a("p"),ln=s(`Saves the attributes of this processor (feature extractor, tokenizer\u2026) in the specified directory so that it
can be reloaded using the `),Yt=a("a"),cn=s("from_pretrained()"),dn=s(" method."),pn=i(),_(ke.$$.fragment),hn=i(),xe=a("div"),_(pt.$$.fragment),mn=i(),ht=a("p"),fn=s("This method forwards all its arguments to Speech2Text2Tokenizer\u2019s "),Dt=a("a"),un=s("batch_decode()"),gn=s(`. Please
refer to the docstring of this method for more information.`),_n=i(),we=a("div"),_(mt.$$.fragment),vn=i(),ft=a("p"),Tn=s("This method forwards all its arguments to Speech2Text2Tokenizer\u2019s "),Qt=a("a"),yn=s("decode()"),bn=s(`. Please refer
to the docstring of this method for more information.`),is=i(),ce=a("h2"),Me=a("a"),Wo=a("span"),_(ut.$$.fragment),kn=i(),Fo=a("span"),xn=s("Speech2Text2ForCausalLM"),ds=i(),P=a("div"),_(gt.$$.fragment),wn=i(),q=a("p"),Mn=s("The Speech2Text2 Decoder with a language modeling head. Can be used as the decoder part of "),Ht=a("a"),Sn=s("EncoderDecoderModel"),$n=s(" and "),Io=a("code"),En=s("SpeechEncoderDecoder"),Jn=s(`.
This model inherits from `),Ot=a("a"),jn=s("PreTrainedModel"),zn=s(`. 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=i(),_t=a("p"),Cn=s("This model is also a PyTorch "),vt=a("a"),Zn=s("torch.nn.Module"),Wn=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Fn=i(),Se=a("div"),_(Tt.$$.fragment),In=i(),_($e.$$.fragment),this.h()},l(t){const p=gc('[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 No=l(w);v(m.$$.fragment,No),No.forEach(o),Vo.forEach(o),x=d(yt),V=n(yt,"SPAN",{});var Po=l(V);W=r(Po,"Speech2Text2"),Po.forEach(o),yt.forEach(o),E=d(t),z=n(t,"H2",{class:!0});var hs=l(z);J=n(hs,"A",{id:!0,class:!0,href:!0});var Pn=l(J);U=n(Pn,"SPAN",{});var Bn=l(U);v(Y.$$.fragment,Bn),Bn.forEach(o),Pn.forEach(o),bt=d(hs),ie=n(hs,"SPAN",{});var Gn=l(ie);Vs=r(Gn,"Overview"),Gn.forEach(o),hs.forEach(o),Bo=d(t),D=n(t,"P",{});var Kt=l(D);Ns=r(Kt,"The Speech2Text2 model is used together with "),kt=n(Kt,"A",{href:!0});var An=l(kt);Ps=r(An,"Wav2Vec2"),An.forEach(o),Bs=r(Kt,` for Speech Translation models proposed in
`),Ce=n(Kt,"A",{href:!0,rel:!0});var Rn=l(Ce);Gs=r(Rn,"Large-Scale Self- and Semi-Supervised Learning for Speech Translation"),Rn.forEach(o),As=r(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($);Rs=r(I,"Speech2Text2 is a "),lo=n(I,"EM",{});var qn=l(lo);qs=r(qn,"decoder-only"),qn.forEach(o),Xs=r(I," transformer model that can be used with any speech "),co=n(I,"EM",{});var Xn=l(co);Ls=r(Xn,"encoder-only"),Xn.forEach(o),Ys=r(I,`, such as
`),xt=n(I,"A",{href:!0});var Ln=l(xt);Ds=r(Ln,"Wav2Vec2"),Ln.forEach(o),Qs=r(I," or "),wt=n(I,"A",{href:!0});var Yn=l(wt);Hs=r(Yn,"HuBERT"),Yn.forEach(o),Os=r(I,` for Speech-to-Text tasks. Please refer to the
`),Mt=n(I,"A",{href:!0});var Dn=l(Mt);Ks=r(Dn,"SpeechEncoderDecoder"),Dn.forEach(o),er=r(I," class on how to combine Speech2Text2 with any speech "),io=n(I,"EM",{});var Qn=l(io);tr=r(Qn,"encoder-only"),Qn.forEach(o),or=r(I,`
model.`),I.forEach(o),Ao=d(t),de=n(t,"P",{});var ms=l(de);sr=r(ms,"This model was contributed by "),Ze=n(ms,"A",{href:!0,rel:!0});var Hn=l(Ze);rr=r(Hn,"Patrick von Platen"),Hn.forEach(o),ar=r(ms,"."),ms.forEach(o),Ro=d(t),pe=n(t,"P",{});var fs=l(pe);nr=r(fs,"The original code can be found "),We=n(fs,"A",{href:!0,rel:!0});var On=l(We);lr=r(On,"here"),On.forEach(o),cr=r(fs,"."),fs.forEach(o),qo=d(t),St=n(t,"P",{});var Kn=l(St);ir=r(Kn,"Tips:"),Kn.forEach(o),Xo=d(t),Q=n(t,"UL",{});var eo=l(Q);Fe=n(eo,"LI",{});var us=l(Fe);dr=r(us,`Speech2Text2 achieves state-of-the-art results on the CoVoST Speech Translation dataset. For more information, see
the `),Ie=n(us,"A",{href:!0,rel:!0});var el=l(Ie);pr=r(el,"official models"),el.forEach(o),hr=r(us," ."),us.forEach(o),mr=d(eo),Ve=n(eo,"LI",{});var gs=l(Ve);fr=r(gs,"Speech2Text2 is always used within the "),$t=n(gs,"A",{href:!0});var tl=l($t);ur=r(tl,"SpeechEncoderDecoder"),tl.forEach(o),gr=r(gs," framework."),gs.forEach(o),_r=d(eo),Ne=n(eo,"LI",{});var _s=l(Ne);vr=r(_s,"Speech2Text2\u2019s tokenizer is based on "),Pe=n(_s,"A",{href:!0,rel:!0});var ol=l(Pe);Tr=r(ol,"fastBPE"),ol.forEach(o),yr=r(_s,"."),_s.forEach(o),eo.forEach(o),Lo=d(t),te=n(t,"H2",{class:!0});var vs=l(te);he=n(vs,"A",{id:!0,class:!0,href:!0});var sl=l(he);po=n(sl,"SPAN",{});var rl=l(po);v(Be.$$.fragment,rl),rl.forEach(o),sl.forEach(o),br=d(vs),ho=n(vs,"SPAN",{});var al=l(ho);kr=r(al,"Inference"),al.forEach(o),vs.forEach(o),Yo=d(t),H=n(t,"P",{});var to=l(H);xr=r(to,"Speech2Text2\u2019s "),Et=n(to,"A",{href:!0});var nl=l(Et);wr=r(nl,"SpeechEncoderDecoderModel"),nl.forEach(o),Mr=r(to,` model accepts raw waveform input values from speech and
makes use of `),Jt=n(to,"A",{href:!0});var ll=l(Jt);Sr=r(ll,"generate()"),ll.forEach(o),$r=r(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);Er=r(G,"The "),jt=n(G,"A",{href:!0});var cl=l(jt);Jr=r(cl,"Wav2Vec2FeatureExtractor"),cl.forEach(o),jr=r(G,` class is responsible for preprocessing the input speech and
`),zt=n(G,"A",{href:!0});var il=l(zt);zr=r(il,"Speech2Text2Tokenizer"),il.forEach(o),Ur=r(G,` decodes the generated target tokens to the target string. The
`),Ut=n(G,"A",{href:!0});var dl=l(Ut);Cr=r(dl,"Speech2Text2Processor"),dl.forEach(o),Zr=r(G," wraps "),Ct=n(G,"A",{href:!0});var pl=l(Ct);Wr=r(pl,"Wav2Vec2FeatureExtractor"),pl.forEach(o),Fr=r(G,` and
`),Zt=n(G,"A",{href:!0});var hl=l(Zt);Ir=r(hl,"Speech2Text2Tokenizer"),hl.forEach(o),Vr=r(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);Nr=r(fl,"Step-by-step Speech Translation"),fl.forEach(o),ml.forEach(o),Ho=d(t),v(Ge.$$.fragment,t),Oo=d(t),Ft=n(t,"UL",{});var ul=l(Ft);Ae=n(ul,"LI",{});var Ts=l(Ae);fo=n(Ts,"P",{});var gl=l(fo);Pr=r(gl,"Speech Translation via Pipelines"),gl.forEach(o),Br=d(Ts),uo=n(Ts,"P",{});var _l=l(uo);Gr=r(_l,"The automatic speech recognition pipeline can also be used to translate speech in just a couple lines of code"),_l.forEach(o),Ts.forEach(o),ul.forEach(o),Ko=d(t),v(Re.$$.fragment,t),es=d(t),me=n(t,"P",{});var ys=l(me);Ar=r(ys,"See "),qe=n(ys,"A",{href:!0,rel:!0});var vl=l(qe);Rr=r(vl,"model hub"),vl.forEach(o),qr=r(ys," to look for Speech2Text2 checkpoints."),ys.forEach(o),ts=d(t),oe=n(t,"H2",{class:!0});var bs=l(oe);fe=n(bs,"A",{id:!0,class:!0,href:!0});var Tl=l(fe);go=n(Tl,"SPAN",{});var yl=l(go);v(Xe.$$.fragment,yl),yl.forEach(o),Tl.forEach(o),Xr=d(bs),_o=n(bs,"SPAN",{});var bl=l(_o);Lr=r(bl,"Documentation resources"),bl.forEach(o),bs.forEach(o),os=d(t),It=n(t,"UL",{});var kl=l(It);vo=n(kl,"LI",{});var xl=l(vo);Vt=n(xl,"A",{href:!0});var wl=l(Vt);Yr=r(wl,"Causal language modeling task guide"),wl.forEach(o),xl.forEach(o),kl.forEach(o),ss=d(t),se=n(t,"H2",{class:!0});var ks=l(se);ue=n(ks,"A",{id:!0,class:!0,href:!0});var Ml=l(ue);To=n(Ml,"SPAN",{});var Sl=l(To);v(Le.$$.fragment,Sl),Sl.forEach(o),Ml.forEach(o),Dr=d(ks),yo=n(ks,"SPAN",{});var $l=l(yo);Qr=r($l,"Speech2Text2Config"),$l.forEach(o),ks.forEach(o),rs=d(t),N=n(t,"DIV",{class:!0});var Ee=l(N);v(Ye.$$.fragment,Ee),Hr=d(Ee),re=n(Ee,"P",{});var oo=l(re);Or=r(oo,"This is the configuration class to store the configuration of a "),Nt=n(oo,"A",{href:!0});var El=l(Nt);Kr=r(El,"Speech2Text2ForCausalLM"),El.forEach(o),ea=r(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);ta=r(Jl,"facebook/s2t-wav2vec2-large-en-de"),Jl.forEach(o),oa=r(oo," architecture."),oo.forEach(o),sa=d(Ee),ae=n(Ee,"P",{});var so=l(ae);ra=r(so,"Configuration objects inherit from "),Pt=n(so,"A",{href:!0});var jl=l(Pt);aa=r(jl,"PretrainedConfig"),jl.forEach(o),na=r(so,` and can be used to control the model outputs. Read the
documentation from `),Bt=n(so,"A",{href:!0});var zl=l(Bt);la=r(zl,"PretrainedConfig"),zl.forEach(o),ca=r(so," for more information."),so.forEach(o),ia=d(Ee),v(ge.$$.fragment,Ee),Ee.forEach(o),as=d(t),ne=n(t,"H2",{class:!0});var xs=l(ne);_e=n(xs,"A",{id:!0,class:!0,href:!0});var Ul=l(_e);bo=n(Ul,"SPAN",{});var Cl=l(bo);v(Qe.$$.fragment,Cl),Cl.forEach(o),Ul.forEach(o),da=d(xs),ko=n(xs,"SPAN",{});var Zl=l(ko);pa=r(Zl,"Speech2TextTokenizer"),Zl.forEach(o),xs.forEach(o),ns=d(t),j=n(t,"DIV",{class:!0});var A=l(j);v(He.$$.fragment,A),ha=d(A),xo=n(A,"P",{});var Wl=l(xo);ma=r(Wl,"Constructs a Speech2Text2Tokenizer."),Wl.forEach(o),fa=d(A),Oe=n(A,"P",{});var ws=l(Oe);ua=r(ws,"This tokenizer inherits from "),Gt=n(ws,"A",{href:!0});var Fl=l(Gt);ga=r(Fl,"PreTrainedTokenizer"),Fl.forEach(o),_a=r(ws,` which contains some of the main methods. Users should refer to
the superclass for more information regarding such methods.`),ws.forEach(o),va=d(A),ve=n(A,"DIV",{class:!0});var Ms=l(ve);v(Ke.$$.fragment,Ms),Ta=d(Ms),wo=n(Ms,"P",{});var Il=l(wo);ya=r(Il,"Convert a list of lists of token ids into a list of strings by calling decode."),Il.forEach(o),Ms.forEach(o),ba=d(A),O=n(A,"DIV",{class:!0});var ro=l(O);v(et.$$.fragment,ro),ka=d(ro),Mo=n(ro,"P",{});var Vl=l(Mo);xa=r(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),wa=d(ro),tt=n(ro,"P",{});var Ss=l(tt);Ma=r(Ss,"Similar to doing "),So=n(Ss,"CODE",{});var Nl=l(So);Sa=r(Nl,"self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),Nl.forEach(o),$a=r(Ss,"."),Ss.forEach(o),ro.forEach(o),Ea=d(A),At=n(A,"DIV",{class:!0});var Pl=l(At);v(ot.$$.fragment,Pl),Pl.forEach(o),A.forEach(o),ls=d(t),le=n(t,"H2",{class:!0});var $s=l(le);Te=n($s,"A",{id:!0,class:!0,href:!0});var Bl=l(Te);$o=n(Bl,"SPAN",{});var Gl=l($o);v(st.$$.fragment,Gl),Gl.forEach(o),Bl.forEach(o),Ja=d($s),Eo=n($s,"SPAN",{});var Al=l(Eo);ja=r(Al,"Speech2Text2Processor"),Al.forEach(o),$s.forEach(o),cs=d(t),M=n(t,"DIV",{class:!0});var Z=l(M);v(rt.$$.fragment,Z),za=d(Z),Jo=n(Z,"P",{});var Rl=l(Jo);Ua=r(Rl,`Constructs a Speech2Text2 processor which wraps a Speech2Text2 feature extractor and a Speech2Text2 tokenizer into
a single processor.`),Rl.forEach(o),Ca=d(Z),F=n(Z,"P",{});var X=l(F);Rt=n(X,"A",{href:!0});var ql=l(Rt);Za=r(ql,"Speech2Text2Processor"),ql.forEach(o),Wa=r(X," offers all the functionalities of "),qt=n(X,"A",{href:!0});var Xl=l(qt);Fa=r(Xl,"AutoFeatureExtractor"),Xl.forEach(o),Ia=r(X," and "),Xt=n(X,"A",{href:!0});var Ll=l(Xt);Va=r(Ll,"Speech2Text2Tokenizer"),Ll.forEach(o),Na=r(X,`.
See the `),at=n(X,"A",{href:!0});var Vn=l(at);jo=n(Vn,"STRONG",{});var Yl=l(jo);Pa=r(Yl,"call"),Yl.forEach(o),Ba=r(Vn,"()"),Vn.forEach(o),Ga=r(X," and "),Lt=n(X,"A",{href:!0});var Dl=l(Lt);Aa=r(Dl,"decode()"),Dl.forEach(o),Ra=r(X," for more information."),X.forEach(o),qa=d(Z),ye=n(Z,"DIV",{class:!0});var Es=l(ye);v(nt.$$.fragment,Es),Xa=d(Es),R=n(Es,"P",{});var Je=l(R);La=r(Je,`When used in normal mode, this method forwards all its arguments to AutoFeatureExtractor\u2019s
`),zo=n(Je,"CODE",{});var Ql=l(zo);Ya=r(Ql,"__call__()"),Ql.forEach(o),Da=r(Je,` and returns its output. If used in the context
`),Uo=n(Je,"CODE",{});var Hl=l(Uo);Qa=r(Hl,"as_target_processor()"),Hl.forEach(o),Ha=r(Je,` this method forwards all its arguments to
Speech2Text2Tokenizer\u2019s `),lt=n(Je,"A",{href:!0});var Nn=l(lt);Co=n(Nn,"STRONG",{});var Ol=l(Co);Oa=r(Ol,"call"),Ol.forEach(o),Ka=r(Nn,"()"),Nn.forEach(o),en=r(Je,`. Please refer to the doctsring of the above two
methods for more information.`),Je.forEach(o),Es.forEach(o),tn=d(Z),K=n(Z,"DIV",{class:!0});var ao=l(K);v(ct.$$.fragment,ao),on=d(ao),Zo=n(ao,"P",{});var Kl=l(Zo);sn=r(Kl,"Instantiate a processor associated with a pretrained model."),Kl.forEach(o),rn=d(ao),v(be.$$.fragment,ao),ao.forEach(o),an=d(Z),ee=n(Z,"DIV",{class:!0});var no=l(ee);v(it.$$.fragment,no),nn=d(no),dt=n(no,"P",{});var Js=l(dt);ln=r(Js,`Saves the attributes of this processor (feature extractor, tokenizer\u2026) in the specified directory so that it
can be reloaded using the `),Yt=n(Js,"A",{href:!0});var ec=l(Yt);cn=r(ec,"from_pretrained()"),ec.forEach(o),dn=r(Js," method."),Js.forEach(o),pn=d(no),v(ke.$$.fragment,no),no.forEach(o),hn=d(Z),xe=n(Z,"DIV",{class:!0});var js=l(xe);v(pt.$$.fragment,js),mn=d(js),ht=n(js,"P",{});var zs=l(ht);fn=r(zs,"This method forwards all its arguments to Speech2Text2Tokenizer\u2019s "),Dt=n(zs,"A",{href:!0});var tc=l(Dt);un=r(tc,"batch_decode()"),tc.forEach(o),gn=r(zs,`. Please
refer to the docstring of this method for more information.`),zs.forEach(o),js.forEach(o),_n=d(Z),we=n(Z,"DIV",{class:!0});var Us=l(we);v(mt.$$.fragment,Us),vn=d(Us),ft=n(Us,"P",{});var Cs=l(ft);Tn=r(Cs,"This method forwards all its arguments to Speech2Text2Tokenizer\u2019s "),Qt=n(Cs,"A",{href:!0});var oc=l(Qt);yn=r(oc,"decode()"),oc.forEach(o),bn=r(Cs,`. Please refer
to the docstring of this method for more information.`),Cs.forEach(o),Us.forEach(o),Z.forEach(o),is=d(t),ce=n(t,"H2",{class:!0});var Zs=l(ce);Me=n(Zs,"A",{id:!0,class:!0,href:!0});var sc=l(Me);Wo=n(sc,"SPAN",{});var rc=l(Wo);v(ut.$$.fragment,rc),rc.forEach(o),sc.forEach(o),kn=d(Zs),Fo=n(Zs,"SPAN",{});var ac=l(Fo);xn=r(ac,"Speech2Text2ForCausalLM"),ac.forEach(o),Zs.forEach(o),ds=d(t),P=n(t,"DIV",{class:!0});var je=l(P);v(gt.$$.fragment,je),wn=d(je),q=n(je,"P",{});var ze=l(q);Mn=r(ze,"The Speech2Text2 Decoder with a language modeling head. Can be used as the decoder part of "),Ht=n(ze,"A",{href:!0});var nc=l(Ht);Sn=r(nc,"EncoderDecoderModel"),nc.forEach(o),$n=r(ze," and "),Io=n(ze,"CODE",{});var lc=l(Io);En=r(lc,"SpeechEncoderDecoder"),lc.forEach(o),Jn=r(ze,`.
This model inherits from `),Ot=n(ze,"A",{href:!0});var cc=l(Ot);jn=r(cc,"PreTrainedModel"),cc.forEach(o),zn=r(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 Ws=l(_t);Cn=r(Ws,"This model is also a PyTorch "),vt=n(Ws,"A",{href:!0,rel:!0});var ic=l(vt);Zn=r(ic,"torch.nn.Module"),ic.forEach(o),Wn=r(Ws,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ws.forEach(o),Fn=d(je),Se=n(je,"DIV",{class:!0});var Fs=l(Se);v(Tt.$$.fragment,Fs),In=d(Fs),v($e.$$.fragment,Fs),Fs.forEach(o),je.forEach(o),this.h()},h(){c(f,"name","hf:doc:metadata"),c(f,"content",JSON.stringify(xc)),c(g,"id","speech2text2"),c(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"),c(g,"href","#speech2text2"),c(u,"class","relative group"),c(J,"id","overview"),c(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"),c(J,"href","#overview"),c(z,"class","relative group"),c(kt,"href","wav2vec2"),c(Ce,"href","https://arxiv.org/abs/2104.06678"),c(Ce,"rel","nofollow"),c(xt,"href","wav2vec2"),c(wt,"href","hubert"),c(Mt,"href","speech-encoder-decoder"),c(Ze,"href","https://huggingface.co/patrickvonplaten"),c(Ze,"rel","nofollow"),c(We,"href","https://github.com/pytorch/fairseq/blob/1f7ef9ed1e1061f8c7f88f8b94c7186834398690/fairseq/models/wav2vec/wav2vec2_asr.py#L266"),c(We,"rel","nofollow"),c(Ie,"href","https://huggingface.co/models?other=speech2text2"),c(Ie,"rel","nofollow"),c($t,"href","speech-encoder-decoder"),c(Pe,"href","https://github.com/glample/fastBPE"),c(Pe,"rel","nofollow"),c(he,"id","inference"),c(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"),c(he,"href","#inference"),c(te,"class","relative group"),c(Et,"href","/docs/transformers/v4.31.0/en/model_doc/speech-encoder-decoder#transformers.SpeechEncoderDecoderModel"),c(Jt,"href","/docs/transformers/v4.31.0/en/main_classes/text_generation#transformers.GenerationMixin.generate"),c(jt,"href","/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor"),c(zt,"href","/docs/transformers/v4.31.0/en/model_doc/speech_to_text_2#transformers.Speech2Text2Tokenizer"),c(Ut,"href","/docs/transformers/v4.31.0/en/model_doc/speech_to_text_2#transformers.Speech2Text2Processor"),c(Ct,"href","/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor"),c(Zt,"href","/docs/transformers/v4.31.0/en/model_doc/speech_to_text_2#transformers.Speech2Text2Tokenizer"),c(qe,"href","https://huggingface.co/models?filter=speech2text2"),c(qe,"rel","nofollow"),c(fe,"id","documentation-resources"),c(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"),c(fe,"href","#documentation-resources"),c(oe,"class","relative group"),c(Vt,"href","../tasks/language_modeling"),c(ue,"id","transformers.Speech2Text2Config"),c(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"),c(ue,"href","#transformers.Speech2Text2Config"),c(se,"class","relative group"),c(Nt,"href","/docs/transformers/v4.31.0/en/model_doc/speech_to_text_2#transformers.Speech2Text2ForCausalLM"),c(De,"href","https://huggingface.co/facebook/s2t-wav2vec2-large-en-de"),c(De,"rel","nofollow"),c(Pt,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Bt,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(_e,"id","transformers.Speech2Text2Tokenizer"),c(_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"),c(_e,"href","#transformers.Speech2Text2Tokenizer"),c(ne,"class","relative group"),c(Gt,"href","/docs/transformers/v4.31.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),c(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(At,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Te,"id","transformers.Speech2Text2Processor"),c(Te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Te,"href","#transformers.Speech2Text2Processor"),c(le,"class","relative group"),c(Rt,"href","/docs/transformers/v4.31.0/en/model_doc/speech_to_text_2#transformers.Speech2Text2Processor"),c(qt,"href","/docs/transformers/v4.31.0/en/model_doc/auto#transformers.AutoFeatureExtractor"),c(Xt,"href","/docs/transformers/v4.31.0/en/model_doc/speech_to_text_2#transformers.Speech2Text2Tokenizer"),c(at,"href","/docs/transformers/v4.31.0/en/model_doc/speech_to_text_2#transformers.Speech2Text2Processor.__call__"),c(Lt,"href","/docs/transformers/v4.31.0/en/model_doc/speech_to_text_2#transformers.Speech2Text2Processor.decode"),c(lt,"href","/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__"),c(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Yt,"href","/docs/transformers/v4.31.0/en/model_doc/trocr#transformers.TrOCRProcessor.from_pretrained"),c(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Dt,"href","/docs/transformers/v4.31.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.batch_decode"),c(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Qt,"href","/docs/transformers/v4.31.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.decode"),c(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Me,"id","transformers.Speech2Text2ForCausalLM"),c(Me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Me,"href","#transformers.Speech2Text2ForCausalLM"),c(ce,"class","relative group"),c(Ht,"href","/docs/transformers/v4.31.0/en/model_doc/encoder-decoder#transformers.EncoderDecoderModel"),c(Ot,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),c(vt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(vt,"rel","nofollow"),c(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(P,"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),T(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),T(Y,U,null),e(z,bt),e(z,ie),e(ie,Vs),h(t,Bo,p),h(t,D,p),e(D,Ns),e(D,kt),e(kt,Ps),e(D,Bs),e(D,Ce),e(Ce,Gs),e(D,As),h(t,Go,p),h(t,$,p),e($,Rs),e($,lo),e(lo,qs),e($,Xs),e($,co),e(co,Ls),e($,Ys),e($,xt),e(xt,Ds),e($,Qs),e($,wt),e(wt,Hs),e($,Os),e($,Mt),e(Mt,Ks),e($,er),e($,io),e(io,tr),e($,or),h(t,Ao,p),h(t,de,p),e(de,sr),e(de,Ze),e(Ze,rr),e(de,ar),h(t,Ro,p),h(t,pe,p),e(pe,nr),e(pe,We),e(We,lr),e(pe,cr),h(t,qo,p),h(t,St,p),e(St,ir),h(t,Xo,p),h(t,Q,p),e(Q,Fe),e(Fe,dr),e(Fe,Ie),e(Ie,pr),e(Fe,hr),e(Q,mr),e(Q,Ve),e(Ve,fr),e(Ve,$t),e($t,ur),e(Ve,gr),e(Q,_r),e(Q,Ne),e(Ne,vr),e(Ne,Pe),e(Pe,Tr),e(Ne,yr),h(t,Lo,p),h(t,te,p),e(te,he),e(he,po),T(Be,po,null),e(te,br),e(te,ho),e(ho,kr),h(t,Yo,p),h(t,H,p),e(H,xr),e(H,Et),e(Et,wr),e(H,Mr),e(H,Jt),e(Jt,Sr),e(H,$r),h(t,Do,p),h(t,C,p),e(C,Er),e(C,jt),e(jt,Jr),e(C,jr),e(C,zt),e(zt,zr),e(C,Ur),e(C,Ut),e(Ut,Cr),e(C,Zr),e(C,Ct),e(Ct,Wr),e(C,Fr),e(C,Zt),e(Zt,Ir),e(C,Vr),h(t,Qo,p),h(t,Wt,p),e(Wt,mo),e(mo,Nr),h(t,Ho,p),T(Ge,t,p),h(t,Oo,p),h(t,Ft,p),e(Ft,Ae),e(Ae,fo),e(fo,Pr),e(Ae,Br),e(Ae,uo),e(uo,Gr),h(t,Ko,p),T(Re,t,p),h(t,es,p),h(t,me,p),e(me,Ar),e(me,qe),e(qe,Rr),e(me,qr),h(t,ts,p),h(t,oe,p),e(oe,fe),e(fe,go),T(Xe,go,null),e(oe,Xr),e(oe,_o),e(_o,Lr),h(t,os,p),h(t,It,p),e(It,vo),e(vo,Vt),e(Vt,Yr),h(t,ss,p),h(t,se,p),e(se,ue),e(ue,To),T(Le,To,null),e(se,Dr),e(se,yo),e(yo,Qr),h(t,rs,p),h(t,N,p),T(Ye,N,null),e(N,Hr),e(N,re),e(re,Or),e(re,Nt),e(Nt,Kr),e(re,ea),e(re,De),e(De,ta),e(re,oa),e(N,sa),e(N,ae),e(ae,ra),e(ae,Pt),e(Pt,aa),e(ae,na),e(ae,Bt),e(Bt,la),e(ae,ca),e(N,ia),T(ge,N,null),h(t,as,p),h(t,ne,p),e(ne,_e),e(_e,bo),T(Qe,bo,null),e(ne,da),e(ne,ko),e(ko,pa),h(t,ns,p),h(t,j,p),T(He,j,null),e(j,ha),e(j,xo),e(xo,ma),e(j,fa),e(j,Oe),e(Oe,ua),e(Oe,Gt),e(Gt,ga),e(Oe,_a),e(j,va),e(j,ve),T(Ke,ve,null),e(ve,Ta),e(ve,wo),e(wo,ya),e(j,ba),e(j,O),T(et,O,null),e(O,ka),e(O,Mo),e(Mo,xa),e(O,wa),e(O,tt),e(tt,Ma),e(tt,So),e(So,Sa),e(tt,$a),e(j,Ea),e(j,At),T(ot,At,null),h(t,ls,p),h(t,le,p),e(le,Te),e(Te,$o),T(st,$o,null),e(le,Ja),e(le,Eo),e(Eo,ja),h(t,cs,p),h(t,M,p),T(rt,M,null),e(M,za),e(M,Jo),e(Jo,Ua),e(M,Ca),e(M,F),e(F,Rt),e(Rt,Za),e(F,Wa),e(F,qt),e(qt,Fa),e(F,Ia),e(F,Xt),e(Xt,Va),e(F,Na),e(F,at),e(at,jo),e(jo,Pa),e(at,Ba),e(F,Ga),e(F,Lt),e(Lt,Aa),e(F,Ra),e(M,qa),e(M,ye),T(nt,ye,null),e(ye,Xa),e(ye,R),e(R,La),e(R,zo),e(zo,Ya),e(R,Da),e(R,Uo),e(Uo,Qa),e(R,Ha),e(R,lt),e(lt,Co),e(Co,Oa),e(lt,Ka),e(R,en),e(M,tn),e(M,K),T(ct,K,null),e(K,on),e(K,Zo),e(Zo,sn),e(K,rn),T(be,K,null),e(M,an),e(M,ee),T(it,ee,null),e(ee,nn),e(ee,dt),e(dt,ln),e(dt,Yt),e(Yt,cn),e(dt,dn),e(ee,pn),T(ke,ee,null),e(M,hn),e(M,xe),T(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),T(mt,we,null),e(we,vn),e(we,ft),e(ft,Tn),e(ft,Qt),e(Qt,yn),e(ft,bn),h(t,is,p),h(t,ce,p),e(ce,Me),e(Me,Wo),T(ut,Wo,null),e(ce,kn),e(ce,Fo),e(Fo,xn),h(t,ds,p),h(t,P,p),T(gt,P,null),e(P,wn),e(P,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(P,Un),e(P,_t),e(_t,Cn),e(_t,vt),e(vt,Zn),e(_t,Wn),e(P,Fn),e(P,Se),T(Tt,Se,null),e(Se,In),T($e,Se,null),ps=!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 No={};p&2&&(No.$$scope={dirty:p,ctx:t}),ke.$set(No);const Po={};p&2&&(Po.$$scope={dirty:p,ctx:t}),$e.$set(Po)},i(t){ps||(y(m.$$.fragment,t),y(Y.$$.fragment,t),y(Be.$$.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(st.$$.fragment,t),y(rt.$$.fragment,t),y(nt.$$.fragment,t),y(ct.$$.fragment,t),y(be.$$.fragment,t),y(it.$$.fragment,t),y(ke.$$.fragment,t),y(pt.$$.fragment,t),y(mt.$$.fragment,t),y(ut.$$.fragment,t),y(gt.$$.fragment,t),y(Tt.$$.fragment,t),y($e.$$.fragment,t),ps=!0)},o(t){b(m.$$.fragment,t),b(Y.$$.fragment,t),b(Be.$$.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(st.$$.fragment,t),b(rt.$$.fragment,t),b(nt.$$.fragment,t),b(ct.$$.fragment,t),b(be.$$.fragment,t),b(it.$$.fragment,t),b(ke.$$.fragment,t),b(pt.$$.fragment,t),b(mt.$$.fragment,t),b(ut.$$.fragment,t),b(gt.$$.fragment,t),b(Tt.$$.fragment,t),b($e.$$.fragment,t),ps=!1},d(t){o(f),t&&o(S),t&&o(u),k(m),t&&o(E),t&&o(z),k(Y),t&&o(Bo),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(Be),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(es),t&&o(me),t&&o(ts),t&&o(oe),k(Xe),t&&o(os),t&&o(It),t&&o(ss),t&&o(se),k(Le),t&&o(rs),t&&o(N),k(Ye),k(ge),t&&o(as),t&&o(ne),k(Qe),t&&o(ns),t&&o(j),k(He),k(Ke),k(et),k(ot),t&&o(ls),t&&o(le),k(st),t&&o(cs),t&&o(M),k(rt),k(nt),k(ct),k(be),k(it),k(ke),k(pt),k(mt),t&&o(is),t&&o(ce),k(ut),t&&o(ds),t&&o(P),k(gt),k(Tt),k($e)}}}const xc={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 wc(L){return _c(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class zc extends mc{constructor(f){super();fc(this,f,wc,kc,uc,{})}}export{zc as default,xc as metadata};
