import{S as Op,i as Gp,s as Up,e as r,k as p,w as y,t as n,M as Wp,c as a,d as t,m as h,a as i,x,h as s,b as l,G as e,g as f,y as k,q as w,o as S,B as $,v as Rp,L as lr}from"../../chunks/vendor-hf-doc-builder.js";import{T as bo}from"../../chunks/Tip-hf-doc-builder.js";import{D as G}from"../../chunks/Docstring-hf-doc-builder.js";import{C as En}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as st}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as dr}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Vp(C){let c,b,_,g,v;return g=new En({props:{code:`from transformers import Speech2TextConfig, Speech2TextModel

# Initializing a Speech2Text s2t_transformer_s style configuration
configuration = Speech2TextConfig()

# Initializing a model (with random weights) from the s2t_transformer_s style configuration
model = Speech2TextModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Speech2TextConfig, Speech2TextModel

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

<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 = Speech2TextModel(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(){c=r("p"),b=n("Example:"),_=p(),y(g.$$.fragment)},l(d){c=a(d,"P",{});var u=i(c);b=s(u,"Example:"),u.forEach(t),_=h(d),x(g.$$.fragment,d)},m(d,u){f(d,c,u),e(c,b),f(d,_,u),k(g,d,u),v=!0},p:lr,i(d){v||(w(g.$$.fragment,d),v=!0)},o(d){S(g.$$.fragment,d),v=!1},d(d){d&&t(c),d&&t(_),$(g,d)}}}function Hp(C){let c,b,_,g,v,d,u,q;return{c(){c=r("p"),b=n(`This class method is simply calling the feature extractor
`),_=r("a"),g=n("from_pretrained()"),v=n(` and the tokenizer
`),d=r("code"),u=n("~tokenization_utils_base.PreTrainedTokenizer.from_pretrained"),q=n(` methods. Please refer to the docstrings of the
methods above for more information.`),this.h()},l(D){c=a(D,"P",{});var j=i(c);b=s(j,`This class method is simply calling the feature extractor
`),_=a(j,"A",{href:!0});var M=i(_);g=s(M,"from_pretrained()"),M.forEach(t),v=s(j,` and the tokenizer
`),d=a(j,"CODE",{});var I=i(d);u=s(I,"~tokenization_utils_base.PreTrainedTokenizer.from_pretrained"),I.forEach(t),q=s(j,` methods. Please refer to the docstrings of the
methods above for more information.`),j.forEach(t),this.h()},h(){l(_,"href","/docs/transformers/pr_19907/en/internal/image_processing_utils#transformers.FeatureExtractionMixin.from_pretrained")},m(D,j){f(D,c,j),e(c,b),e(c,_),e(_,g),e(c,v),e(c,d),e(d,u),e(c,q)},d(D){D&&t(c)}}}function Bp(C){let c,b,_,g,v,d,u,q;return{c(){c=r("p"),b=n("This class method is simply calling "),_=r("a"),g=n("save_pretrained()"),v=n(` and
`),d=r("a"),u=n("save_pretrained()"),q=n(`. Please refer to the docstrings of the
methods above for more information.`),this.h()},l(D){c=a(D,"P",{});var j=i(c);b=s(j,"This class method is simply calling "),_=a(j,"A",{href:!0});var M=i(_);g=s(M,"save_pretrained()"),M.forEach(t),v=s(j,` and
`),d=a(j,"A",{href:!0});var I=i(d);u=s(I,"save_pretrained()"),I.forEach(t),q=s(j,`. Please refer to the docstrings of the
methods above for more information.`),j.forEach(t),this.h()},h(){l(_,"href","/docs/transformers/pr_19907/en/internal/image_processing_utils#transformers.FeatureExtractionMixin.save_pretrained"),l(d,"href","/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.save_pretrained")},m(D,j){f(D,c,j),e(c,b),e(c,_),e(_,g),e(c,v),e(c,d),e(d,u),e(c,q)},d(D){D&&t(c)}}}function Kp(C){let c,b,_,g,v;return{c(){c=r("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),g=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){c=a(d,"P",{});var u=i(c);b=s(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var q=i(_);g=s(q,"Module"),q.forEach(t),v=s(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(d,u){f(d,c,u),e(c,b),e(c,_),e(_,g),e(c,v)},d(d){d&&t(c)}}}function Jp(C){let c,b,_,g,v;return g=new En({props:{code:`import torch
from transformers import Speech2TextModel, Speech2TextFeatureExtractor
from datasets import load_dataset

model = Speech2TextModel.from_pretrained("facebook/s2t-small-librispeech-asr")
feature_extractor = Speech2TextFeatureExtractor.from_pretrained("facebook/s2t-small-librispeech-asr")
ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
inputs = feature_extractor(
    ds[0]["audio"]["array"], sampling_rate=ds[0]["audio"]["sampling_rate"], return_tensors="pt"
)
input_features = inputs.input_features
decoder_input_ids = torch.tensor([[1, 1]]) * model.config.decoder_start_token_id
last_hidden_state = model(input_features, decoder_input_ids=decoder_input_ids).last_hidden_state
list(last_hidden_state.shape)`,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> Speech2TextModel, Speech2TextFeatureExtractor
<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>model = Speech2TextModel.from_pretrained(<span class="hljs-string">&quot;facebook/s2t-small-librispeech-asr&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = Speech2TextFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;facebook/s2t-small-librispeech-asr&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>ds = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_dummy&quot;</span>, <span class="hljs-string">&quot;clean&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>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_features = inputs.input_features
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = torch.tensor([[<span class="hljs-number">1</span>, <span class="hljs-number">1</span>]]) * model.config.decoder_start_token_id
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = model(input_features, decoder_input_ids=decoder_input_ids).last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_state.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">256</span>]`}}),{c(){c=r("p"),b=n("Example:"),_=p(),y(g.$$.fragment)},l(d){c=a(d,"P",{});var u=i(c);b=s(u,"Example:"),u.forEach(t),_=h(d),x(g.$$.fragment,d)},m(d,u){f(d,c,u),e(c,b),f(d,_,u),k(g,d,u),v=!0},p:lr,i(d){v||(w(g.$$.fragment,d),v=!0)},o(d){S(g.$$.fragment,d),v=!1},d(d){d&&t(c),d&&t(_),$(g,d)}}}function Yp(C){let c,b,_,g,v;return{c(){c=r("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),g=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){c=a(d,"P",{});var u=i(c);b=s(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var q=i(_);g=s(q,"Module"),q.forEach(t),v=s(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(d,u){f(d,c,u),e(c,b),e(c,_),e(_,g),e(c,v)},d(d){d&&t(c)}}}function Xp(C){let c,b,_,g,v;return g=new En({props:{code:`import torch
from transformers import Speech2TextProcessor, Speech2TextForConditionalGeneration
from datasets import load_dataset

model = Speech2TextForConditionalGeneration.from_pretrained("facebook/s2t-small-librispeech-asr")
processor = Speech2TextProcessor.from_pretrained("facebook/s2t-small-librispeech-asr")


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

inputs = processor(
    ds[0]["audio"]["array"], sampling_rate=ds[0]["audio"]["sampling_rate"], return_tensors="pt"
)
input_features = inputs.input_features

generated_ids = model.generate(inputs=input_features)

transcription = processor.batch_decode(generated_ids)[0]
transcription`,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> Speech2TextProcessor, Speech2TextForConditionalGeneration
<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>model = Speech2TextForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/s2t-small-librispeech-asr&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = Speech2TextProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/s2t-small-librispeech-asr&quot;</span>)


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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(
<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_features = inputs.input_features

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(inputs=input_features)

<span class="hljs-meta">&gt;&gt;&gt; </span>transcription = processor.batch_decode(generated_ids)[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>transcription
<span class="hljs-string">&#x27;mister quilter is the apostle of the middle classes and we are glad to welcome his gospel&#x27;</span>`}}),{c(){c=r("p"),b=n("Example:"),_=p(),y(g.$$.fragment)},l(d){c=a(d,"P",{});var u=i(c);b=s(u,"Example:"),u.forEach(t),_=h(d),x(g.$$.fragment,d)},m(d,u){f(d,c,u),e(c,b),f(d,_,u),k(g,d,u),v=!0},p:lr,i(d){v||(w(g.$$.fragment,d),v=!0)},o(d){S(g.$$.fragment,d),v=!1},d(d){d&&t(c),d&&t(_),$(g,d)}}}function Qp(C){let c,b,_,g,v,d,u,q,D,j,M,I,ne,E,Ge,Q,Ue,je,A,We,se,re,Re,ae,ie,Ve,de,le,He,ce,Se,N,L,Y,pe,he,Be,ue,fe,Ke,U,Ce,W,ee,$e,K,Je,Ee,Z,Me,H,Ye,me,R,Xe,B,O,Qe;return{c(){c=r("p"),b=n("TensorFlow models and layers in "),_=r("code"),g=n("transformers"),v=n(" accept two formats as input:"),d=p(),u=r("ul"),q=r("li"),D=n("having all inputs as keyword arguments (like PyTorch models), or"),j=p(),M=r("li"),I=n("having all inputs as a list, tuple or dict in the first positional argument."),ne=p(),E=r("p"),Ge=n(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=r("code"),Ue=n("model.fit()"),je=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),A=r("code"),We=n("model.fit()"),se=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),re=r("code"),Re=n("fit()"),ae=n(" and "),ie=r("code"),Ve=n("predict()"),de=n(`, such as when creating your own layers or models with
the Keras `),le=r("code"),He=n("Functional"),ce=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),Se=p(),N=r("ul"),L=r("li"),Y=n("a single Tensor with "),pe=r("code"),he=n("input_ids"),Be=n(" only and nothing else: "),ue=r("code"),fe=n("model(input_ids)"),Ke=p(),U=r("li"),Ce=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=r("code"),ee=n("model([input_ids, attention_mask])"),$e=n(" or "),K=r("code"),Je=n("model([input_ids, attention_mask, token_type_ids])"),Ee=p(),Z=r("li"),Me=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),H=r("code"),Ye=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),me=p(),R=r("p"),Xe=n(`Note that when creating models and layers with
`),B=r("a"),O=n("subclassing"),Qe=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(T){c=a(T,"P",{});var F=i(c);b=s(F,"TensorFlow models and layers in "),_=a(F,"CODE",{});var ht=i(_);g=s(ht,"transformers"),ht.forEach(t),v=s(F," accept two formats as input:"),F.forEach(t),d=h(T),u=a(T,"UL",{});var te=i(u);q=a(te,"LI",{});var ut=i(q);D=s(ut,"having all inputs as keyword arguments (like PyTorch models), or"),ut.forEach(t),j=h(te),M=a(te,"LI",{});var ft=i(M);I=s(ft,"having all inputs as a list, tuple or dict in the first positional argument."),ft.forEach(t),te.forEach(t),ne=h(T),E=a(T,"P",{});var z=i(E);Ge=s(z,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=a(z,"CODE",{});var mt=i(Q);Ue=s(mt,"model.fit()"),mt.forEach(t),je=s(z,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),A=a(z,"CODE",{});var _t=i(A);We=s(_t,"model.fit()"),_t.forEach(t),se=s(z,` supports! If, however, you want to use the second
format outside of Keras methods like `),re=a(z,"CODE",{});var Ae=i(re);Re=s(Ae,"fit()"),Ae.forEach(t),ae=s(z," and "),ie=a(z,"CODE",{});var gt=i(ie);Ve=s(gt,"predict()"),gt.forEach(t),de=s(z,`, such as when creating your own layers or models with
the Keras `),le=a(z,"CODE",{});var Tt=i(le);He=s(Tt,"Functional"),Tt.forEach(t),ce=s(z,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),z.forEach(t),Se=h(T),N=a(T,"UL",{});var X=i(N);L=a(X,"LI",{});var P=i(L);Y=s(P,"a single Tensor with "),pe=a(P,"CODE",{});var vt=i(pe);he=s(vt,"input_ids"),vt.forEach(t),Be=s(P," only and nothing else: "),ue=a(P,"CODE",{});var Ze=i(ue);fe=s(Ze,"model(input_ids)"),Ze.forEach(t),P.forEach(t),Ke=h(X),U=a(X,"LI",{});var _e=i(U);Ce=s(_e,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=a(_e,"CODE",{});var bt=i(W);ee=s(bt,"model([input_ids, attention_mask])"),bt.forEach(t),$e=s(_e," or "),K=a(_e,"CODE",{});var et=i(K);Je=s(et,"model([input_ids, attention_mask, token_type_ids])"),et.forEach(t),_e.forEach(t),Ee=h(X),Z=a(X,"LI",{});var tt=i(Z);Me=s(tt,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),H=a(tt,"CODE",{});var yt=i(H);Ye=s(yt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),yt.forEach(t),tt.forEach(t),X.forEach(t),me=h(T),R=a(T,"P",{});var ge=i(R);Xe=s(ge,`Note that when creating models and layers with
`),B=a(ge,"A",{href:!0,rel:!0});var xt=i(B);O=s(xt,"subclassing"),xt.forEach(t),Qe=s(ge,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),ge.forEach(t),this.h()},h(){l(B,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),l(B,"rel","nofollow")},m(T,F){f(T,c,F),e(c,b),e(c,_),e(_,g),e(c,v),f(T,d,F),f(T,u,F),e(u,q),e(q,D),e(u,j),e(u,M),e(M,I),f(T,ne,F),f(T,E,F),e(E,Ge),e(E,Q),e(Q,Ue),e(E,je),e(E,A),e(A,We),e(E,se),e(E,re),e(re,Re),e(E,ae),e(E,ie),e(ie,Ve),e(E,de),e(E,le),e(le,He),e(E,ce),f(T,Se,F),f(T,N,F),e(N,L),e(L,Y),e(L,pe),e(pe,he),e(L,Be),e(L,ue),e(ue,fe),e(N,Ke),e(N,U),e(U,Ce),e(U,W),e(W,ee),e(U,$e),e(U,K),e(K,Je),e(N,Ee),e(N,Z),e(Z,Me),e(Z,H),e(H,Ye),f(T,me,F),f(T,R,F),e(R,Xe),e(R,B),e(B,O),e(R,Qe)},d(T){T&&t(c),T&&t(d),T&&t(u),T&&t(ne),T&&t(E),T&&t(Se),T&&t(N),T&&t(me),T&&t(R)}}}function Zp(C){let c,b,_,g,v;return{c(){c=r("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),g=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){c=a(d,"P",{});var u=i(c);b=s(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var q=i(_);g=s(q,"Module"),q.forEach(t),v=s(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(d,u){f(d,c,u),e(c,b),e(c,_),e(_,g),e(c,v)},d(d){d&&t(c)}}}function eh(C){let c,b,_,g,v;return g=new En({props:{code:`from transformers import Speech2TextTokenizer, TFSpeech2TextModel
import tensorflow as tf

tokenizer = Speech2TextTokenizer.from_pretrained("facebook/s2t-small-librispeech-asr")
model = TFSpeech2TextModel.from_pretrained("facebook/s2t-small-librispeech-asr")

inputs = tokenizer("Hello, my dog is cute", return_tensors="tf")
outputs = model(inputs)

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Speech2TextTokenizer, TFSpeech2TextModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = Speech2TextTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/s2t-small-librispeech-asr&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFSpeech2TextModel.from_pretrained(<span class="hljs-string">&quot;facebook/s2t-small-librispeech-asr&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){c=r("p"),b=n("Example:"),_=p(),y(g.$$.fragment)},l(d){c=a(d,"P",{});var u=i(c);b=s(u,"Example:"),u.forEach(t),_=h(d),x(g.$$.fragment,d)},m(d,u){f(d,c,u),e(c,b),f(d,_,u),k(g,d,u),v=!0},p:lr,i(d){v||(w(g.$$.fragment,d),v=!0)},o(d){S(g.$$.fragment,d),v=!1},d(d){d&&t(c),d&&t(_),$(g,d)}}}function th(C){let c,b,_,g,v,d,u,q,D,j,M,I,ne,E,Ge,Q,Ue,je,A,We,se,re,Re,ae,ie,Ve,de,le,He,ce,Se,N,L,Y,pe,he,Be,ue,fe,Ke,U,Ce,W,ee,$e,K,Je,Ee,Z,Me,H,Ye,me,R,Xe,B,O,Qe;return{c(){c=r("p"),b=n("TensorFlow models and layers in "),_=r("code"),g=n("transformers"),v=n(" accept two formats as input:"),d=p(),u=r("ul"),q=r("li"),D=n("having all inputs as keyword arguments (like PyTorch models), or"),j=p(),M=r("li"),I=n("having all inputs as a list, tuple or dict in the first positional argument."),ne=p(),E=r("p"),Ge=n(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=r("code"),Ue=n("model.fit()"),je=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),A=r("code"),We=n("model.fit()"),se=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),re=r("code"),Re=n("fit()"),ae=n(" and "),ie=r("code"),Ve=n("predict()"),de=n(`, such as when creating your own layers or models with
the Keras `),le=r("code"),He=n("Functional"),ce=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),Se=p(),N=r("ul"),L=r("li"),Y=n("a single Tensor with "),pe=r("code"),he=n("input_ids"),Be=n(" only and nothing else: "),ue=r("code"),fe=n("model(input_ids)"),Ke=p(),U=r("li"),Ce=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=r("code"),ee=n("model([input_ids, attention_mask])"),$e=n(" or "),K=r("code"),Je=n("model([input_ids, attention_mask, token_type_ids])"),Ee=p(),Z=r("li"),Me=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),H=r("code"),Ye=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),me=p(),R=r("p"),Xe=n(`Note that when creating models and layers with
`),B=r("a"),O=n("subclassing"),Qe=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(T){c=a(T,"P",{});var F=i(c);b=s(F,"TensorFlow models and layers in "),_=a(F,"CODE",{});var ht=i(_);g=s(ht,"transformers"),ht.forEach(t),v=s(F," accept two formats as input:"),F.forEach(t),d=h(T),u=a(T,"UL",{});var te=i(u);q=a(te,"LI",{});var ut=i(q);D=s(ut,"having all inputs as keyword arguments (like PyTorch models), or"),ut.forEach(t),j=h(te),M=a(te,"LI",{});var ft=i(M);I=s(ft,"having all inputs as a list, tuple or dict in the first positional argument."),ft.forEach(t),te.forEach(t),ne=h(T),E=a(T,"P",{});var z=i(E);Ge=s(z,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Q=a(z,"CODE",{});var mt=i(Q);Ue=s(mt,"model.fit()"),mt.forEach(t),je=s(z,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),A=a(z,"CODE",{});var _t=i(A);We=s(_t,"model.fit()"),_t.forEach(t),se=s(z,` supports! If, however, you want to use the second
format outside of Keras methods like `),re=a(z,"CODE",{});var Ae=i(re);Re=s(Ae,"fit()"),Ae.forEach(t),ae=s(z," and "),ie=a(z,"CODE",{});var gt=i(ie);Ve=s(gt,"predict()"),gt.forEach(t),de=s(z,`, such as when creating your own layers or models with
the Keras `),le=a(z,"CODE",{});var Tt=i(le);He=s(Tt,"Functional"),Tt.forEach(t),ce=s(z,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),z.forEach(t),Se=h(T),N=a(T,"UL",{});var X=i(N);L=a(X,"LI",{});var P=i(L);Y=s(P,"a single Tensor with "),pe=a(P,"CODE",{});var vt=i(pe);he=s(vt,"input_ids"),vt.forEach(t),Be=s(P," only and nothing else: "),ue=a(P,"CODE",{});var Ze=i(ue);fe=s(Ze,"model(input_ids)"),Ze.forEach(t),P.forEach(t),Ke=h(X),U=a(X,"LI",{});var _e=i(U);Ce=s(_e,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=a(_e,"CODE",{});var bt=i(W);ee=s(bt,"model([input_ids, attention_mask])"),bt.forEach(t),$e=s(_e," or "),K=a(_e,"CODE",{});var et=i(K);Je=s(et,"model([input_ids, attention_mask, token_type_ids])"),et.forEach(t),_e.forEach(t),Ee=h(X),Z=a(X,"LI",{});var tt=i(Z);Me=s(tt,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),H=a(tt,"CODE",{});var yt=i(H);Ye=s(yt,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),yt.forEach(t),tt.forEach(t),X.forEach(t),me=h(T),R=a(T,"P",{});var ge=i(R);Xe=s(ge,`Note that when creating models and layers with
`),B=a(ge,"A",{href:!0,rel:!0});var xt=i(B);O=s(xt,"subclassing"),xt.forEach(t),Qe=s(ge,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),ge.forEach(t),this.h()},h(){l(B,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),l(B,"rel","nofollow")},m(T,F){f(T,c,F),e(c,b),e(c,_),e(_,g),e(c,v),f(T,d,F),f(T,u,F),e(u,q),e(q,D),e(u,j),e(u,M),e(M,I),f(T,ne,F),f(T,E,F),e(E,Ge),e(E,Q),e(Q,Ue),e(E,je),e(E,A),e(A,We),e(E,se),e(E,re),e(re,Re),e(E,ae),e(E,ie),e(ie,Ve),e(E,de),e(E,le),e(le,He),e(E,ce),f(T,Se,F),f(T,N,F),e(N,L),e(L,Y),e(L,pe),e(pe,he),e(L,Be),e(L,ue),e(ue,fe),e(N,Ke),e(N,U),e(U,Ce),e(U,W),e(W,ee),e(U,$e),e(U,K),e(K,Je),e(N,Ee),e(N,Z),e(Z,Me),e(Z,H),e(H,Ye),f(T,me,F),f(T,R,F),e(R,Xe),e(R,B),e(B,O),e(R,Qe)},d(T){T&&t(c),T&&t(d),T&&t(u),T&&t(ne),T&&t(E),T&&t(Se),T&&t(N),T&&t(me),T&&t(R)}}}function oh(C){let c,b,_,g,v;return{c(){c=r("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),g=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){c=a(d,"P",{});var u=i(c);b=s(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var q=i(_);g=s(q,"Module"),q.forEach(t),v=s(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(d,u){f(d,c,u),e(c,b),e(c,_),e(_,g),e(c,v)},d(d){d&&t(c)}}}function nh(C){let c,b,_,g,v;return g=new En({props:{code:`import tensorflow as tf
from transformers import Speech2TextProcessor, TFSpeech2TextForConditionalGeneration
from datasets import load_dataset
import soundfile as sf

model = TFSpeech2TextForConditionalGeneration.from_pretrained(
    "facebook/s2t-small-librispeech-asr", from_pt=True
)
processor = Speech2TextProcessor.from_pretrained("facebook/s2t-small-librispeech-asr")


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


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

input_features = processor(
    ds["speech"][0], sampling_rate=16000, return_tensors="tf"
).input_features  # Batch size 1
generated_ids = model.generate(input_features)

transcription = processor.batch_decode(generated_ids)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Speech2TextProcessor, TFSpeech2TextForConditionalGeneration
<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 = TFSpeech2TextForConditionalGeneration.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;facebook/s2t-small-librispeech-asr&quot;</span>, from_pt=<span class="hljs-literal">True</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = Speech2TextProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/s2t-small-librispeech-asr&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>ds.set_format(<span class="hljs-built_in">type</span>=<span class="hljs-string">&quot;tf&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_features = processor(
<span class="hljs-meta">... </span>    ds[<span class="hljs-string">&quot;speech&quot;</span>][<span class="hljs-number">0</span>], sampling_rate=<span class="hljs-number">16000</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>
<span class="hljs-meta">... </span>).input_features  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(input_features)

<span class="hljs-meta">&gt;&gt;&gt; </span>transcription = processor.batch_decode(generated_ids)`}}),{c(){c=r("p"),b=n("Example:"),_=p(),y(g.$$.fragment)},l(d){c=a(d,"P",{});var u=i(c);b=s(u,"Example:"),u.forEach(t),_=h(d),x(g.$$.fragment,d)},m(d,u){f(d,c,u),e(c,b),f(d,_,u),k(g,d,u),v=!0},p:lr,i(d){v||(w(g.$$.fragment,d),v=!0)},o(d){S(g.$$.fragment,d),v=!1},d(d){d&&t(c),d&&t(_),$(g,d)}}}function sh(C){let c,b,_,g,v,d,u,q,D,j,M,I,ne,E,Ge,Q,Ue,je,A,We,se,re,Re,ae,ie,Ve,de,le,He,ce,Se,N,L,Y,pe,he,Be,ue,fe,Ke,U,Ce,W,ee,$e,K,Je,Ee,Z,Me,H,Ye,me,R,Xe,B,O,Qe,T,F,ht,te,ut,ft,z,mt,_t,Ae,gt,Tt,X,P,vt,Ze,_e,bt,et,tt,yt,ge,xt,ca,ls,pa,ha,cs,ua,fa,yo,ma,_a,ps,ga,cr,qn,hs,Ta,pr,xo,hr,Fn,ko,us,va,ba,Te,ya,fs,xa,ka,ms,wa,Sa,_s,$a,Ea,gs,qa,Fa,Ts,za,Pa,ur,wo,fr,Dt,ja,So,Ca,Ma,mr,kt,It,vs,$o,Aa,bs,Na,_r,qe,Eo,Da,wt,Ia,zn,La,Oa,qo,Ga,Ua,Wa,St,Ra,Pn,Va,Ha,jn,Ba,Ka,Ja,Lt,gr,$t,Ot,ys,Fo,Ya,xs,Xa,Tr,J,zo,Qa,ks,Za,ei,Po,ti,Cn,oi,ni,si,Gt,jo,ri,ws,ai,ii,Ut,Co,di,Mo,li,Ss,ci,pi,hi,rt,Ao,ui,Mn,fi,An,mi,_i,$s,gi,Ti,Nn,No,vr,Et,Wt,Es,Do,vi,qs,bi,br,ve,Io,yi,Fs,xi,ki,Lo,wi,Dn,Si,$i,Ei,zs,qi,Fi,Rt,Oo,zi,Ps,Pi,yr,qt,Vt,js,Go,ji,Cs,Ci,xr,V,Uo,Mi,Ms,Ai,Ni,ke,In,Di,Ii,Ln,Li,Oi,On,Gi,Ui,Wo,As,Wi,Ri,Vi,Gn,Hi,Bi,Ki,Ht,Ro,Ji,ot,Yi,Vo,Ns,Xi,Qi,Zi,Ds,ed,td,Ho,Is,od,nd,sd,rd,at,Bo,ad,Ls,id,dd,Bt,ld,it,Ko,cd,Jo,pd,Un,hd,ud,fd,Kt,md,Jt,Yo,_d,Xo,gd,Wn,Td,vd,bd,Yt,Qo,yd,Zo,xd,Rn,kd,wd,kr,Ft,Xt,Os,en,Sd,Gs,$d,wr,Fe,tn,Ed,on,qd,Vn,Fd,zd,Pd,nn,jd,sn,Cd,Md,Ad,Ne,rn,Nd,zt,Dd,Hn,Id,Ld,Us,Od,Gd,Ud,Qt,Wd,Zt,Sr,Pt,eo,Ws,an,Rd,Rs,Vd,$r,ze,dn,Hd,ln,Bd,Bn,Kd,Jd,Yd,cn,Xd,pn,Qd,Zd,el,De,hn,tl,jt,ol,Kn,nl,sl,Vs,rl,al,il,to,dl,oo,Er,Ct,no,Hs,un,ll,Bs,cl,qr,be,fn,pl,mn,hl,Jn,ul,fl,ml,_n,_l,gn,gl,Tl,vl,so,bl,Ie,Tn,yl,Mt,xl,Yn,kl,wl,Ks,Sl,$l,El,ro,ql,ao,Fr,At,io,Js,vn,Fl,Ys,zl,zr,ye,bn,Pl,yn,jl,Xn,Cl,Ml,Al,xn,Nl,kn,Dl,Il,Ll,lo,Ol,Le,wn,Gl,Nt,Ul,Qn,Wl,Rl,Xs,Vl,Hl,Bl,co,Kl,po,Pr;return d=new st({}),E=new st({}),K=new st({}),xo=new En({props:{code:`import torch
from transformers import Speech2TextProcessor, Speech2TextForConditionalGeneration
from datasets import load_dataset

model = Speech2TextForConditionalGeneration.from_pretrained("facebook/s2t-small-librispeech-asr")
processor = Speech2TextProcessor.from_pretrained("facebook/s2t-small-librispeech-asr")


ds = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")

inputs = processor(ds[0]["audio"]["array"], sampling_rate=ds[0]["audio"]["sampling_rate"], return_tensors="pt")
generated_ids = model.generate(inputs["input_features"], attention_mask=inputs["attention_mask"])

transcription = processor.batch_decode(generated_ids)
transcription`,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> Speech2TextProcessor, Speech2TextForConditionalGeneration
<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>model = Speech2TextForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/s2t-small-librispeech-asr&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = Speech2TextProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/s2t-small-librispeech-asr&quot;</span>)


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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(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">&gt;&gt;&gt; </span>generated_ids = model.generate(inputs[<span class="hljs-string">&quot;input_features&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)
<span class="hljs-meta">&gt;&gt;&gt; </span>transcription
[<span class="hljs-string">&#x27;mister quilter is the apostle of the middle classes and we are glad to welcome his gospel&#x27;</span>]`}}),wo=new En({props:{code:`import torch
from transformers import Speech2TextProcessor, Speech2TextForConditionalGeneration
from datasets import load_dataset

model = Speech2TextForConditionalGeneration.from_pretrained("facebook/s2t-medium-mustc-multilingual-st")
processor = Speech2TextProcessor.from_pretrained("facebook/s2t-medium-mustc-multilingual-st")

ds = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")

inputs = processor(ds[0]["audio"]["array"], sampling_rate=ds[0]["audio"]["sampling_rate"], return_tensors="pt")
generated_ids = model.generate(
    inputs["input_features"],
    attention_mask=inputs["attention_mask"],
    forced_bos_token_id=processor.tokenizer.lang_code_to_id["fr"],
)

translation = processor.batch_decode(generated_ids)
translation`,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> Speech2TextProcessor, Speech2TextForConditionalGeneration
<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>model = Speech2TextForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/s2t-medium-mustc-multilingual-st&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = Speech2TextProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/s2t-medium-mustc-multilingual-st&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(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">&gt;&gt;&gt; </span>generated_ids = model.generate(
<span class="hljs-meta">... </span>    inputs[<span class="hljs-string">&quot;input_features&quot;</span>],
<span class="hljs-meta">... </span>    attention_mask=inputs[<span class="hljs-string">&quot;attention_mask&quot;</span>],
<span class="hljs-meta">... </span>    forced_bos_token_id=processor.tokenizer.lang_code_to_id[<span class="hljs-string">&quot;fr&quot;</span>],
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>translation = processor.batch_decode(generated_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>translation
[<span class="hljs-string">&quot;&lt;lang:fr&gt; (Vid\xE9o) Si M. Kilder est l&#x27;apossible des classes moyennes, et nous sommes heureux d&#x27;\xEAtre accueillis dans son \xE9vangile.&quot;</span>]`}}),$o=new st({}),Eo=new G({props:{name:"class transformers.Speech2TextConfig",anchor:"transformers.Speech2TextConfig",parameters:[{name:"vocab_size",val:" = 10000"},{name:"encoder_layers",val:" = 12"},{name:"encoder_ffn_dim",val:" = 2048"},{name:"encoder_attention_heads",val:" = 4"},{name:"decoder_layers",val:" = 6"},{name:"decoder_ffn_dim",val:" = 2048"},{name:"decoder_attention_heads",val:" = 4"},{name:"encoder_layerdrop",val:" = 0.0"},{name:"decoder_layerdrop",val:" = 0.0"},{name:"use_cache",val:" = True"},{name:"is_encoder_decoder",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:"classifier_dropout",val:" = 0.0"},{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_source_positions",val:" = 6000"},{name:"max_target_positions",val:" = 1024"},{name:"num_conv_layers",val:" = 2"},{name:"conv_kernel_sizes",val:" = (5, 5)"},{name:"conv_channels",val:" = 1024"},{name:"input_feat_per_channel",val:" = 80"},{name:"input_channels",val:" = 1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Speech2TextConfig.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/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextModel">Speech2TextModel</a>`,name:"vocab_size"},{anchor:"transformers.Speech2TextConfig.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.Speech2TextConfig.encoder_layers",description:`<strong>encoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of encoder layers.`,name:"encoder_layers"},{anchor:"transformers.Speech2TextConfig.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.Speech2TextConfig.encoder_attention_heads",description:`<strong>encoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"encoder_attention_heads"},{anchor:"transformers.Speech2TextConfig.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.Speech2TextConfig.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.Speech2TextConfig.encoder_ffn_dim",description:`<strong>encoder_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:"encoder_ffn_dim"},{anchor:"transformers.Speech2TextConfig.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 encoder and 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.Speech2TextConfig.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, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.Speech2TextConfig.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.Speech2TextConfig.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.Speech2TextConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for classifier.`,name:"classifier_dropout"},{anchor:"transformers.Speech2TextConfig.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.`,name:"init_std"},{anchor:"transformers.Speech2TextConfig.encoder_layerdrop",description:`<strong>encoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the encoder. 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:"encoder_layerdrop"},{anchor:"transformers.Speech2TextConfig.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.Speech2TextConfig.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.Speech2TextConfig.max_source_positions",description:`<strong>max_source_positions</strong> (<code>int</code>, <em>optional</em>, defaults to 6000) &#x2014;
The maximum sequence length of log-mel filter-bank features that this model might ever be used with.`,name:"max_source_positions"},{anchor:"transformers.Speech2TextConfig.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"},{anchor:"transformers.Speech2TextConfig.num_conv_layers",description:`<strong>num_conv_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
Number of 1D convolutional layers in the conv module.`,name:"num_conv_layers"},{anchor:"transformers.Speech2TextConfig.conv_kernel_sizes",description:`<strong>conv_kernel_sizes</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to <code>(5, 5)</code>) &#x2014;
A tuple of integers defining the kernel size of each 1D convolutional layer in the conv module. The length
of <code>conv_kernel_sizes</code> has to match <code>num_conv_layers</code>.`,name:"conv_kernel_sizes"},{anchor:"transformers.Speech2TextConfig.conv_channels",description:`<strong>conv_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
An integer defining the number of output channels of each convolution layers except the final one in the
conv module.`,name:"conv_channels"},{anchor:"transformers.Speech2TextConfig.input_feat_per_channel",description:`<strong>input_feat_per_channel</strong> (<code>int</code>, <em>optional</em>, defaults to 80) &#x2014;
An integer specifying the size of feature vector. This is also the dimensions of log-mel filter-bank
features.`,name:"input_feat_per_channel"},{anchor:"transformers.Speech2TextConfig.input_channels",description:`<strong>input_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
An integer specifying number of input channels of the input feature vector.`,name:"input_channels"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/speech_to_text/configuration_speech_to_text.py#L31"}}),Lt=new dr({props:{anchor:"transformers.Speech2TextConfig.example",$$slots:{default:[Vp]},$$scope:{ctx:C}}}),Fo=new st({}),zo=new G({props:{name:"class transformers.Speech2TextTokenizer",anchor:"transformers.Speech2TextTokenizer",parameters:[{name:"vocab_file",val:""},{name:"spm_file",val:""},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"pad_token",val:" = '<pad>'"},{name:"unk_token",val:" = '<unk>'"},{name:"do_upper_case",val:" = False"},{name:"do_lower_case",val:" = False"},{name:"tgt_lang",val:" = None"},{name:"lang_codes",val:" = None"},{name:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Speech2TextTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.Speech2TextTokenizer.spm_file",description:`<strong>spm_file</strong> (<code>str</code>) &#x2014;
Path to the <a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> model file`,name:"spm_file"},{anchor:"transformers.Speech2TextTokenizer.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.Speech2TextTokenizer.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.Speech2TextTokenizer.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.Speech2TextTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.Speech2TextTokenizer.do_upper_case",description:`<strong>do_upper_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to uppercase the output when decoding.`,name:"do_upper_case"},{anchor:"transformers.Speech2TextTokenizer.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.Speech2TextTokenizer.tgt_lang",description:`<strong>tgt_lang</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A string representing the target language.`,name:"tgt_lang"},{anchor:"transformers.Speech2TextTokenizer.sp_model_kwargs",description:`<strong>sp_model_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Will be passed to the <code>SentencePieceProcessor.__init__()</code> method. The <a href="https://github.com/google/sentencepiece/tree/master/python" rel="nofollow">Python wrapper for
SentencePiece</a> can be used, among other things,
to set:</p>
<ul>
<li>
<p><code>enable_sampling</code>: Enable subword regularization.</p>
</li>
<li>
<p><code>nbest_size</code>: Sampling parameters for unigram. Invalid for BPE-Dropout.</p>
<ul>
<li><code>nbest_size = {0,1}</code>: No sampling is performed.</li>
<li><code>nbest_size &gt; 1</code>: samples from the nbest_size results.</li>
<li><code>nbest_size &lt; 0</code>: assuming that nbest_size is infinite and samples from the all hypothesis (lattice)
using forward-filtering-and-backward-sampling algorithm.</li>
</ul>
</li>
<li>
<p><code>alpha</code>: Smoothing parameter for unigram sampling, and dropout probability of merge operations for
BPE-dropout.</p>
</li>
</ul>
<p>**kwargs &#x2014;
Additional keyword arguments passed along to <a href="/docs/transformers/pr_19907/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>`,name:"sp_model_kwargs"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/speech_to_text/tokenization_speech_to_text.py#L59"}}),jo=new G({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.Speech2TextTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:""},{name:"token_ids_1",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/speech_to_text/tokenization_speech_to_text.py#L199"}}),Co=new G({props:{name:"get_special_tokens_mask",anchor:"transformers.Speech2TextTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.Speech2TextTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.Speech2TextTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.Speech2TextTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/speech_to_text/tokenization_speech_to_text.py#L206",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Ao=new G({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.Speech2TextTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.Speech2TextTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:"<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014; The first tokenized sequence.",name:"token_ids_0"},{anchor:"transformers.Speech2TextTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:"<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014; The second tokenized sequence.",name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/tokenization_utils_base.py#L2987",returnDescription:`
<p>The token type ids.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),No=new G({props:{name:"save_vocabulary",anchor:"transformers.Speech2TextTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/speech_to_text/tokenization_speech_to_text.py#L255"}}),Do=new st({}),Io=new G({props:{name:"class transformers.Speech2TextFeatureExtractor",anchor:"transformers.Speech2TextFeatureExtractor",parameters:[{name:"feature_size",val:" = 80"},{name:"sampling_rate",val:" = 16000"},{name:"num_mel_bins",val:" = 80"},{name:"padding_value",val:" = 0.0"},{name:"do_ceptral_normalize",val:" = True"},{name:"normalize_means",val:" = True"},{name:"normalize_vars",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Speech2TextFeatureExtractor.feature_size",description:`<strong>feature_size</strong> (<code>int</code>, defaults to 80) &#x2014;
The feature dimension of the extracted features.`,name:"feature_size"},{anchor:"transformers.Speech2TextFeatureExtractor.sampling_rate",description:`<strong>sampling_rate</strong> (<code>int</code>, defaults to 16000) &#x2014;
The sampling rate at which the audio files should be digitalized expressed in Hertz per second (Hz).`,name:"sampling_rate"},{anchor:"transformers.Speech2TextFeatureExtractor.num_mel_bins",description:`<strong>num_mel_bins</strong> (<code>int</code>, defaults to 80) &#x2014;
Number of Mel-frequency bins.`,name:"num_mel_bins"},{anchor:"transformers.Speech2TextFeatureExtractor.padding_value",description:`<strong>padding_value</strong> (<code>float</code>, defaults to 0.0) &#x2014;
The value that is used to fill the padding vectors.`,name:"padding_value"},{anchor:"transformers.Speech2TextFeatureExtractor.do_ceptral_normalize",description:`<strong>do_ceptral_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to apply utterance-level cepstral mean and variance normalization to extracted features.`,name:"do_ceptral_normalize"},{anchor:"transformers.Speech2TextFeatureExtractor.normalize_means",description:`<strong>normalize_means</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to zero-mean normalize the extracted features.`,name:"normalize_means"},{anchor:"transformers.Speech2TextFeatureExtractor.normalize_vars",description:`<strong>normalize_vars</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to unit-variance normalize the extracted features.`,name:"normalize_vars"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/speech_to_text/feature_extraction_speech_to_text.py#L33"}}),Oo=new G({props:{name:"__call__",anchor:"transformers.Speech2TextFeatureExtractor.__call__",parameters:[{name:"raw_speech",val:": typing.Union[numpy.ndarray, typing.List[float], typing.List[numpy.ndarray], typing.List[typing.List[float]]]"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"truncation",val:": bool = False"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"sampling_rate",val:": typing.Optional[int] = None"},{name:"return_attention_mask",val:": typing.Optional[bool] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Speech2TextFeatureExtractor.__call__.raw_speech",description:`<strong>raw_speech</strong> (<code>np.ndarray</code>, <code>List[float]</code>, <code>List[np.ndarray]</code>, <code>List[List[float]]</code>) &#x2014;
The sequence or batch of sequences to be padded. Each sequence can be a numpy array, a list of float
values, a list of numpy arrays or a list of list of float values.`,name:"raw_speech"},{anchor:"transformers.Speech2TextFeatureExtractor.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_19907/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Select a strategy to pad the returned sequences (according to the model&#x2019;s padding side and padding
index) among:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.Speech2TextFeatureExtractor.__call__.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Maximum length of the returned list and optionally padding length (see above).`,name:"max_length"},{anchor:"transformers.Speech2TextFeatureExtractor.__call__.truncation",description:`<strong>truncation</strong> (<code>bool</code>) &#x2014;
Activates truncation to cut input sequences longer than <em>max_length</em> to <em>max_length</em>.`,name:"truncation"},{anchor:"transformers.Speech2TextFeatureExtractor.__call__.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If set will pad the sequence to a multiple of the provided value.</p>
<p>This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability</p>
<blockquote>
<p>= 7.5 (Volta), or on TPUs which benefit from having sequence lengths be a multiple of 128.</p>
</blockquote>`,name:"pad_to_multiple_of"},{anchor:"transformers.Speech2TextFeatureExtractor.__call__.return_attention_mask",description:`<strong>return_attention_mask</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to return the attention mask. If left to the default, will return the attention mask according
to the specific feature_extractor&#x2019;s default.</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>For Speech2TextTransoformer models, <code>attention_mask</code> should alwys be passed for batched inference, to
avoid subtle bugs.</p>

					</div>`,name:"return_attention_mask"},{anchor:"transformers.Speech2TextFeatureExtractor.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_19907/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of list of python integers. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return Numpy <code>np.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.Speech2TextFeatureExtractor.__call__.sampling_rate",description:`<strong>sampling_rate</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The sampling rate at which the <code>raw_speech</code> input was sampled. It is strongly recommended to pass
<code>sampling_rate</code> at the forward call to prevent silent errors.`,name:"sampling_rate"},{anchor:"transformers.Speech2TextFeatureExtractor.__call__.padding_value",description:`<strong>padding_value</strong> (<code>float</code>, defaults to 0.0) &#x2014;
The value that is used to fill the padding values / vectors.`,name:"padding_value"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/speech_to_text/feature_extraction_speech_to_text.py#L126"}}),Go=new st({}),Uo=new G({props:{name:"class transformers.Speech2TextProcessor",anchor:"transformers.Speech2TextProcessor",parameters:[{name:"feature_extractor",val:""},{name:"tokenizer",val:""}],parametersDescription:[{anchor:"transformers.Speech2TextProcessor.feature_extractor",description:`<strong>feature_extractor</strong> (<code>Speech2TextFeatureExtractor</code>) &#x2014;
An instance of <a href="/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextFeatureExtractor">Speech2TextFeatureExtractor</a>. The feature extractor is a required input.`,name:"feature_extractor"},{anchor:"transformers.Speech2TextProcessor.tokenizer",description:`<strong>tokenizer</strong> (<code>Speech2TextTokenizer</code>) &#x2014;
An instance of <a href="/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextTokenizer">Speech2TextTokenizer</a>. The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/speech_to_text/processing_speech_to_text.py#L24"}}),Ro=new G({props:{name:"__call__",anchor:"transformers.Speech2TextProcessor.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/speech_to_text/processing_speech_to_text.py#L47"}}),Bo=new G({props:{name:"from_pretrained",anchor:"transformers.Speech2TextProcessor.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Speech2TextProcessor.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/pr_19907/en/internal/image_processing_utils#transformers.FeatureExtractionMixin.save_pretrained">save_pretrained()</a> method, e.g., <code>./my_model_directory/</code>.</li>
<li>a path or url to a saved feature extractor JSON <em>file</em>, e.g.,
<code>./my_model_directory/preprocessor_config.json</code>.
**kwargs &#x2014;
Additional keyword arguments passed along to both
<a href="/docs/transformers/pr_19907/en/internal/image_processing_utils#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/vr_19907/src/transformers/processing_utils.py#L152"}}),Bt=new bo({props:{$$slots:{default:[Hp]},$$scope:{ctx:C}}}),Ko=new G({props:{name:"save_pretrained",anchor:"transformers.Speech2TextProcessor.save_pretrained",parameters:[{name:"save_directory",val:""},{name:"push_to_hub",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Speech2TextProcessor.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.Speech2TextProcessor.save_pretrained.push_to_hub",description:`<strong>push_to_hub</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to push your model to the Hugging Face model hub after saving it. You can specify the
repository you want to push to with <code>repo_id</code> (will default to the name of <code>save_directory</code> in your
namespace).
kwargs &#x2014;
Additional key word arguments passed along to the <a href="/docs/transformers/pr_19907/en/internal/image_processing_utils#transformers.FeatureExtractionMixin.push_to_hub">push_to_hub()</a> method.`,name:"push_to_hub"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/processing_utils.py#L94"}}),Kt=new bo({props:{$$slots:{default:[Bp]},$$scope:{ctx:C}}}),Yo=new G({props:{name:"batch_decode",anchor:"transformers.Speech2TextProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/speech_to_text/processing_speech_to_text.py#L85"}}),Qo=new G({props:{name:"decode",anchor:"transformers.Speech2TextProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/speech_to_text/processing_speech_to_text.py#L92"}}),en=new st({}),tn=new G({props:{name:"class transformers.Speech2TextModel",anchor:"transformers.Speech2TextModel",parameters:[{name:"config",val:": Speech2TextConfig"}],parametersDescription:[{anchor:"transformers.Speech2TextModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextConfig">Speech2TextConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/speech_to_text/modeling_speech_to_text.py#L1121"}}),rn=new G({props:{name:"forward",anchor:"transformers.Speech2TextModel.forward",parameters:[{name:"input_features",val:" = None"},{name:"attention_mask",val:" = None"},{name:"decoder_input_ids",val:" = None"},{name:"decoder_attention_mask",val:" = None"},{name:"head_mask",val:" = None"},{name:"decoder_head_mask",val:" = None"},{name:"cross_attn_head_mask",val:" = None"},{name:"encoder_outputs",val:" = None"},{name:"past_key_values",val:" = None"},{name:"decoder_inputs_embeds",val:" = None"},{name:"use_cache",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],parametersDescription:[{anchor:"transformers.Speech2TextModel.forward.input_features",description:`<strong>input_features</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, feature_size)</code>) &#x2014;
Float values of fbank features extracted from the raw speech waveform. Raw speech waveform can be obtained
by loading a <code>.flac</code> or <code>.wav</code> audio file into an array of type <code>List[float]</code> or a <code>numpy.ndarray</code>, <em>e.g.</em>
via the soundfile library (<code>pip install soundfile</code>). To prepare the array into <code>input_features</code>, the
<a href="/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextFeatureExtractor">Speech2TextFeatureExtractor</a> should be used for extracting the fbank features, padding and conversion
into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextFeatureExtractor.__call__"><strong>call</strong>()</a>`,name:"input_features"},{anchor:"transformers.Speech2TextModel.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 convolution and attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.Speech2TextModel.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <code>SpeechToTextTokenizer</code>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>SpeechToText uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If
<code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).`,name:"decoder_input_ids"},{anchor:"transformers.Speech2TextModel.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should read
<code>modeling_speech_to_text._prepare_decoder_attention_mask</code> and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.Speech2TextModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. 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.Speech2TextModel.forward.decoder_head_mask",description:`<strong>decoder_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 in the decoder. 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:"decoder_head_mask"},{anchor:"transformers.Speech2TextModel.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.Speech2TextModel.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(torch.FloatTensor)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.Speech2TextModel.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>.</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>. decoder_inputs_embeds (<code>torch.FloatTensor</code> of
shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>): Optionally, instead of passing
<code>decoder_input_ids</code> you can choose to directly pass an embedded representation. If <code>past_key_values</code> is
used, optionally only the last <code>decoder_inputs_embeds</code> have to be input (see <code>past_key_values</code>). This is
useful if you want more control over how to convert <code>decoder_input_ids</code> indices into associated vectors
than the model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>decoder_input_ids</code> and <code>decoder_inputs_embeds</code> are both unset, <code>decoder_inputs_embeds</code> takes the value
of <code>inputs_embeds</code>.`,name:"past_key_values"},{anchor:"transformers.Speech2TextModel.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>).`,name:"use_cache"},{anchor:"transformers.Speech2TextModel.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.Speech2TextModel.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.Speech2TextModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/speech_to_text/modeling_speech_to_text.py#L1143",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextConfig"
>Speech2TextConfig</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.</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>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>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>.</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>
</li>
<li>
<p><strong>decoder_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 decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_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 of the decoder, 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>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_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 encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_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 of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_19907/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Qt=new bo({props:{$$slots:{default:[Kp]},$$scope:{ctx:C}}}),Zt=new dr({props:{anchor:"transformers.Speech2TextModel.forward.example",$$slots:{default:[Jp]},$$scope:{ctx:C}}}),an=new st({}),dn=new G({props:{name:"class transformers.Speech2TextForConditionalGeneration",anchor:"transformers.Speech2TextForConditionalGeneration",parameters:[{name:"config",val:": Speech2TextConfig"}],parametersDescription:[{anchor:"transformers.Speech2TextForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextConfig">Speech2TextConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/speech_to_text/modeling_speech_to_text.py#L1252"}}),hn=new G({props:{name:"forward",anchor:"transformers.Speech2TextForConditionalGeneration.forward",parameters:[{name:"input_features",val:" = None"},{name:"attention_mask",val:" = None"},{name:"decoder_input_ids",val:" = None"},{name:"decoder_attention_mask",val:" = None"},{name:"head_mask",val:" = None"},{name:"decoder_head_mask",val:" = None"},{name:"cross_attn_head_mask",val:" = None"},{name:"encoder_outputs",val:" = None"},{name:"past_key_values",val:" = None"},{name:"decoder_inputs_embeds",val:" = None"},{name:"labels",val:" = None"},{name:"use_cache",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],parametersDescription:[{anchor:"transformers.Speech2TextForConditionalGeneration.forward.input_features",description:`<strong>input_features</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, feature_size)</code>) &#x2014;
Float values of fbank features extracted from the raw speech waveform. Raw speech waveform can be obtained
by loading a <code>.flac</code> or <code>.wav</code> audio file into an array of type <code>List[float]</code> or a <code>numpy.ndarray</code>, <em>e.g.</em>
via the soundfile library (<code>pip install soundfile</code>). To prepare the array into <code>input_features</code>, the
<a href="/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextFeatureExtractor">Speech2TextFeatureExtractor</a> should be used for extracting the fbank features, padding and conversion
into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextFeatureExtractor.__call__"><strong>call</strong>()</a>`,name:"input_features"},{anchor:"transformers.Speech2TextForConditionalGeneration.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 convolution and attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.Speech2TextForConditionalGeneration.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <code>SpeechToTextTokenizer</code>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>SpeechToText uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If
<code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).`,name:"decoder_input_ids"},{anchor:"transformers.Speech2TextForConditionalGeneration.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should read
<code>modeling_speech_to_text._prepare_decoder_attention_mask</code> and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.Speech2TextForConditionalGeneration.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. 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.Speech2TextForConditionalGeneration.forward.decoder_head_mask",description:`<strong>decoder_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 in the decoder. 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:"decoder_head_mask"},{anchor:"transformers.Speech2TextForConditionalGeneration.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.Speech2TextForConditionalGeneration.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(torch.FloatTensor)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.Speech2TextForConditionalGeneration.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>.</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>. decoder_inputs_embeds (<code>torch.FloatTensor</code> of
shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>): Optionally, instead of passing
<code>decoder_input_ids</code> you can choose to directly pass an embedded representation. If <code>past_key_values</code> is
used, optionally only the last <code>decoder_inputs_embeds</code> have to be input (see <code>past_key_values</code>). This is
useful if you want more control over how to convert <code>decoder_input_ids</code> indices into associated vectors
than the model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>decoder_input_ids</code> and <code>decoder_inputs_embeds</code> are both unset, <code>decoder_inputs_embeds</code> takes the value
of <code>inputs_embeds</code>.`,name:"past_key_values"},{anchor:"transformers.Speech2TextForConditionalGeneration.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>).`,name:"use_cache"},{anchor:"transformers.Speech2TextForConditionalGeneration.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.Speech2TextForConditionalGeneration.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.Speech2TextForConditionalGeneration.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Speech2TextForConditionalGeneration.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 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"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/speech_to_text/modeling_speech_to_text.py#L1289",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextConfig"
>Speech2TextConfig</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.</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>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>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>.</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>
</li>
<li>
<p><strong>decoder_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 decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_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 of the decoder, 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>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_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 encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_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 of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_19907/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),to=new bo({props:{$$slots:{default:[Yp]},$$scope:{ctx:C}}}),oo=new dr({props:{anchor:"transformers.Speech2TextForConditionalGeneration.forward.example",$$slots:{default:[Xp]},$$scope:{ctx:C}}}),un=new st({}),fn=new G({props:{name:"class transformers.TFSpeech2TextModel",anchor:"transformers.TFSpeech2TextModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFSpeech2TextModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextConfig">Speech2TextConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/speech_to_text/modeling_tf_speech_to_text.py#L1236"}}),so=new bo({props:{$$slots:{default:[Qp]},$$scope:{ctx:C}}}),Tn=new G({props:{name:"call",anchor:"transformers.TFSpeech2TextModel.call",parameters:[{name:"input_features",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_input_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"cross_attn_head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_outputs",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = None"},{name:"decoder_inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = 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"},{name:"training",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFSpeech2TextModel.call.input_features",description:`<strong>input_features</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, feature_size)</code>) &#x2014;
Float values of fbank features extracted from the raw speech waveform. Raw speech waveform can be obtained
by loading a <code>.flac</code> or <code>.wav</code> audio file into an array of type <code>List[float]</code> or a <code>numpy.ndarray</code>, <em>e.g.</em>
via the soundfile library (<code>pip install soundfile</code>). To prepare the array into <code>input_features</code>, the
<a href="/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextFeatureExtractor">Speech2TextFeatureExtractor</a> should be used for extracting the fbank features, padding and conversion
into a tensor of floats. See <a href="/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextFeatureExtractor.__call__"><strong>call</strong>()</a>`,name:"input_features"},{anchor:"transformers.TFSpeech2TextModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFSpeech2TextModel.call.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextTokenizer">Speech2TextTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Bart uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).</p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.TFSpeech2TextModel.call.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
will be made by default and ignore pad tokens. It is not recommended to set this for most use cases.`,name:"decoder_attention_mask"},{anchor:"transformers.TFSpeech2TextModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. 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.TFSpeech2TextModel.call.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. 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:"decoder_head_mask"},{anchor:"transformers.TFSpeech2TextModel.call.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>tf.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.TFSpeech2TextModel.call.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tf.FloatTensor</code>, <em>optional</em>) &#x2014;
hidden states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.
of shape <code>(batch_size, sequence_length, hidden_size)</code> is a sequence of`,name:"encoder_outputs"},{anchor:"transformers.TFSpeech2TextModel.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
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.TFSpeech2TextModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFSpeech2TextModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFSpeech2TextModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFSpeech2TextModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/speech_to_text/modeling_tf_speech_to_text.py#L1248",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqModelOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextConfig"
>Speech2TextConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, 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(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_19907/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqModelOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),ro=new bo({props:{$$slots:{default:[Zp]},$$scope:{ctx:C}}}),ao=new dr({props:{anchor:"transformers.TFSpeech2TextModel.call.example",$$slots:{default:[eh]},$$scope:{ctx:C}}}),vn=new st({}),bn=new G({props:{name:"class transformers.TFSpeech2TextForConditionalGeneration",anchor:"transformers.TFSpeech2TextForConditionalGeneration",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFSpeech2TextForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextConfig">Speech2TextConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/speech_to_text/modeling_tf_speech_to_text.py#L1319"}}),lo=new bo({props:{$$slots:{default:[th]},$$scope:{ctx:C}}}),wn=new G({props:{name:"call",anchor:"transformers.TFSpeech2TextForConditionalGeneration.call",parameters:[{name:"input_features",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[tensorflow.python.keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, tensorflow.python.keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, tensorflow.python.keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_input_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"decoder_head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"cross_attn_head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_outputs",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = None"},{name:"decoder_inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = 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"},{name:"training",val:": typing.Optional[bool] = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFSpeech2TextForConditionalGeneration.call.input_features",description:`<strong>input_features</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, feature_size)</code>) &#x2014;
Float values of fbank features extracted from the raw speech waveform. Raw speech waveform can be obtained
by loading a <code>.flac</code> or <code>.wav</code> audio file into an array of type <code>List[float]</code> or a <code>numpy.ndarray</code>, <em>e.g.</em>
via the soundfile library (<code>pip install soundfile</code>). To prepare the array into <code>input_features</code>, the
<a href="/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextFeatureExtractor">Speech2TextFeatureExtractor</a> should be used for extracting the fbank features, padding and conversion
into a tensor of floats. See <a href="/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextFeatureExtractor.__call__"><strong>call</strong>()</a>`,name:"input_features"},{anchor:"transformers.TFSpeech2TextForConditionalGeneration.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFSpeech2TextForConditionalGeneration.call.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextTokenizer">Speech2TextTokenizer</a>. See <a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Bart uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).</p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.TFSpeech2TextForConditionalGeneration.call.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
will be made by default and ignore pad tokens. It is not recommended to set this for most use cases.`,name:"decoder_attention_mask"},{anchor:"transformers.TFSpeech2TextForConditionalGeneration.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. 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.TFSpeech2TextForConditionalGeneration.call.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. 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:"decoder_head_mask"},{anchor:"transformers.TFSpeech2TextForConditionalGeneration.call.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>tf.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.TFSpeech2TextForConditionalGeneration.call.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tf.FloatTensor</code>, <em>optional</em>) &#x2014;
hidden states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.
of shape <code>(batch_size, sequence_length, hidden_size)</code> is a sequence of`,name:"encoder_outputs"},{anchor:"transformers.TFSpeech2TextForConditionalGeneration.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
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.TFSpeech2TextForConditionalGeneration.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFSpeech2TextForConditionalGeneration.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFSpeech2TextForConditionalGeneration.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_19907/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFSpeech2TextForConditionalGeneration.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFSpeech2TextForConditionalGeneration.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</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"}],source:"https://github.com/huggingface/transformers/blob/vr_19907/src/transformers/models/speech_to_text/modeling_tf_speech_to_text.py#L1343",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_19907/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqLMOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqLMOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextConfig"
>Speech2TextConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Language modeling loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, 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(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_19907/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqLMOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),co=new bo({props:{$$slots:{default:[oh]},$$scope:{ctx:C}}}),po=new dr({props:{anchor:"transformers.TFSpeech2TextForConditionalGeneration.call.example",$$slots:{default:[nh]},$$scope:{ctx:C}}}),{c(){c=r("meta"),b=p(),_=r("h1"),g=r("a"),v=r("span"),y(d.$$.fragment),u=p(),q=r("span"),D=n("Speech2Text"),j=p(),M=r("h2"),I=r("a"),ne=r("span"),y(E.$$.fragment),Ge=p(),Q=r("span"),Ue=n("Overview"),je=p(),A=r("p"),We=n("The Speech2Text model was proposed in "),se=r("a"),re=n("fairseq S2T: Fast Speech-to-Text Modeling with fairseq"),Re=n(` by Changhan Wang, Yun Tang, Xutai Ma, Anne Wu, Dmytro Okhonko, Juan Pino. It\u2019s a
transformer-based seq2seq (encoder-decoder) model designed for end-to-end Automatic Speech Recognition (ASR) and Speech
Translation (ST). It uses a convolutional downsampler to reduce the length of speech inputs by 3/4th before they are
fed into the encoder. The model is trained with standard autoregressive cross-entropy loss and generates the
transcripts/translations autoregressively. Speech2Text has been fine-tuned on several datasets for ASR and ST:
`),ae=r("a"),ie=n("LibriSpeech"),Ve=n(", "),de=r("a"),le=n("CoVoST 2"),He=n(", "),ce=r("a"),Se=n("MuST-C"),N=n("."),L=p(),Y=r("p"),pe=n("This model was contributed by "),he=r("a"),Be=n("valhalla"),ue=n(". The original code can be found "),fe=r("a"),Ke=n("here"),U=n("."),Ce=p(),W=r("h2"),ee=r("a"),$e=r("span"),y(K.$$.fragment),Je=p(),Ee=r("span"),Z=n("Inference"),Me=p(),H=r("p"),Ye=n(`Speech2Text is a speech model that accepts a float tensor of log-mel filter-bank features extracted from the speech
signal. It\u2019s a transformer-based seq2seq model, so the transcripts/translations are generated autoregressively. The
`),me=r("code"),R=n("generate()"),Xe=n(" method can be used for inference."),B=p(),O=r("p"),Qe=n("The "),T=r("a"),F=n("Speech2TextFeatureExtractor"),ht=n(` class is responsible for extracting the log-mel filter-bank
features. The `),te=r("a"),ut=n("Speech2TextProcessor"),ft=n(" wraps "),z=r("a"),mt=n("Speech2TextFeatureExtractor"),_t=n(` and
`),Ae=r("a"),gt=n("Speech2TextTokenizer"),Tt=n(` into a single instance to both extract the input features and decode the
predicted token ids.`),X=p(),P=r("p"),vt=n("The feature extractor depends on "),Ze=r("code"),_e=n("torchaudio"),bt=n(" and the tokenizer depends on "),et=r("code"),tt=n("sentencepiece"),yt=n(` so be sure to
install those packages before running the examples. You could either install those as extra speech dependencies with
`),ge=r("code"),xt=n('pip install transformers"[speech, sentencepiece]"'),ca=n(" or install the packages separately with "),ls=r("code"),pa=n("pip install torchaudio sentencepiece"),ha=n(". Also "),cs=r("code"),ua=n("torchaudio"),fa=n(" requires the development version of the "),yo=r("a"),ma=n("libsndfile"),_a=n(` package which can be installed via a system package manager. On Ubuntu it can
be installed as follows: `),ps=r("code"),ga=n("apt install libsndfile1-dev"),cr=p(),qn=r("ul"),hs=r("li"),Ta=n("ASR and Speech Translation"),pr=p(),y(xo.$$.fragment),hr=p(),Fn=r("ul"),ko=r("li"),us=r("p"),va=n("Multilingual speech translation"),ba=p(),Te=r("p"),ya=n("For multilingual speech translation models, "),fs=r("code"),xa=n("eos_token_id"),ka=n(" is used as the "),ms=r("code"),wa=n("decoder_start_token_id"),Sa=n(` and
the target language id is forced as the first generated token. To force the target language id as the first
generated token, pass the `),_s=r("code"),$a=n("forced_bos_token_id"),Ea=n(" parameter to the "),gs=r("code"),qa=n("generate()"),Fa=n(` method. The following
example shows how to transate English speech to French text using the `),Ts=r("em"),za=n("facebook/s2t-medium-mustc-multilingual-st"),Pa=n(`
checkpoint.`),ur=p(),y(wo.$$.fragment),fr=p(),Dt=r("p"),ja=n("See the "),So=r("a"),Ca=n("model hub"),Ma=n(" to look for Speech2Text checkpoints."),mr=p(),kt=r("h2"),It=r("a"),vs=r("span"),y($o.$$.fragment),Aa=p(),bs=r("span"),Na=n("Speech2TextConfig"),_r=p(),qe=r("div"),y(Eo.$$.fragment),Da=p(),wt=r("p"),Ia=n("This is the configuration class to store the configuration of a "),zn=r("a"),La=n("Speech2TextModel"),Oa=n(`. It is used to instantiate an
Speech2Text 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 Speech2Text
`),qo=r("a"),Ga=n("facebook/s2t-small-librispeech-asr"),Ua=n(" architecture."),Wa=p(),St=r("p"),Ra=n("Configuration objects inherit from "),Pn=r("a"),Va=n("PretrainedConfig"),Ha=n(` and can be used to control the model outputs. Read the
documentation from `),jn=r("a"),Ba=n("PretrainedConfig"),Ka=n(" for more information."),Ja=p(),y(Lt.$$.fragment),gr=p(),$t=r("h2"),Ot=r("a"),ys=r("span"),y(Fo.$$.fragment),Ya=p(),xs=r("span"),Xa=n("Speech2TextTokenizer"),Tr=p(),J=r("div"),y(zo.$$.fragment),Qa=p(),ks=r("p"),Za=n("Construct an Speech2Text tokenizer."),ei=p(),Po=r("p"),ti=n("This tokenizer inherits from "),Cn=r("a"),oi=n("PreTrainedTokenizer"),ni=n(` which contains some of the main methods. Users should refer to
the superclass for more information regarding such methods.`),si=p(),Gt=r("div"),y(jo.$$.fragment),ri=p(),ws=r("p"),ai=n("Build model inputs from a sequence by appending eos_token_id."),ii=p(),Ut=r("div"),y(Co.$$.fragment),di=p(),Mo=r("p"),li=n(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Ss=r("code"),ci=n("prepare_for_model"),pi=n(" method."),hi=p(),rt=r("div"),y(Ao.$$.fragment),ui=p(),Mn=r("p"),fi=n("Create the token type IDs corresponding to the sequences passed. "),An=r("a"),mi=n(`What are token type
IDs?`),_i=p(),$s=r("p"),gi=n("Should be overridden in a subclass if the model has a special way of building those."),Ti=p(),Nn=r("div"),y(No.$$.fragment),vr=p(),Et=r("h2"),Wt=r("a"),Es=r("span"),y(Do.$$.fragment),vi=p(),qs=r("span"),bi=n("Speech2TextFeatureExtractor"),br=p(),ve=r("div"),y(Io.$$.fragment),yi=p(),Fs=r("p"),xi=n("Constructs a Speech2Text feature extractor."),ki=p(),Lo=r("p"),wi=n("This feature extractor inherits from "),Dn=r("a"),Si=n("Speech2TextFeatureExtractor"),$i=n(` which contains most of the main methods. Users
should refer to this superclass for more information regarding those methods.`),Ei=p(),zs=r("p"),qi=n(`This class extracts mel-filter bank features from raw speech using TorchAudio and applies utterance-level cepstral
mean and variance normalization to the extracted features.`),Fi=p(),Rt=r("div"),y(Oo.$$.fragment),zi=p(),Ps=r("p"),Pi=n("Main method to featurize and prepare for the model one or several sequence(s)."),yr=p(),qt=r("h2"),Vt=r("a"),js=r("span"),y(Go.$$.fragment),ji=p(),Cs=r("span"),Ci=n("Speech2TextProcessor"),xr=p(),V=r("div"),y(Uo.$$.fragment),Mi=p(),Ms=r("p"),Ai=n(`Constructs a Speech2Text processor which wraps a Speech2Text feature extractor and a Speech2Text tokenizer into a
single processor.`),Ni=p(),ke=r("p"),In=r("a"),Di=n("Speech2TextProcessor"),Ii=n(" offers all the functionalities of "),Ln=r("a"),Li=n("Speech2TextFeatureExtractor"),Oi=n(` and
`),On=r("a"),Gi=n("Speech2TextTokenizer"),Ui=n(". See the "),Wo=r("a"),As=r("strong"),Wi=n("call"),Ri=n("()"),Vi=n(" and "),Gn=r("a"),Hi=n("decode()"),Bi=n(` for more
information.`),Ki=p(),Ht=r("div"),y(Ro.$$.fragment),Ji=p(),ot=r("p"),Yi=n(`When used in normal mode, this method forwards all its arguments to Speech2TextFeatureExtractor\u2019s
`),Vo=r("a"),Ns=r("strong"),Xi=n("call"),Qi=n("()"),Zi=n(` and returns its output. If used in the context
`),Ds=r("code"),ed=n("as_target_processor()"),td=n(` this method forwards all its arguments to Speech2TextTokenizer\u2019s
`),Ho=r("a"),Is=r("strong"),od=n("call"),nd=n("()"),sd=n(`. Please refer to the doctsring of the above two methods for more
information.`),rd=p(),at=r("div"),y(Bo.$$.fragment),ad=p(),Ls=r("p"),id=n("Instantiate a processor associated with a pretrained model."),dd=p(),y(Bt.$$.fragment),ld=p(),it=r("div"),y(Ko.$$.fragment),cd=p(),Jo=r("p"),pd=n(`Saves the attributes of this processor (feature extractor, tokenizer\u2026) in the specified directory so that it
can be reloaded using the `),Un=r("a"),hd=n("from_pretrained()"),ud=n(" method."),fd=p(),y(Kt.$$.fragment),md=p(),Jt=r("div"),y(Yo.$$.fragment),_d=p(),Xo=r("p"),gd=n("This method forwards all its arguments to Speech2TextTokenizer\u2019s "),Wn=r("a"),Td=n("batch_decode()"),vd=n(`. Please
refer to the docstring of this method for more information.`),bd=p(),Yt=r("div"),y(Qo.$$.fragment),yd=p(),Zo=r("p"),xd=n("This method forwards all its arguments to Speech2TextTokenizer\u2019s "),Rn=r("a"),kd=n("decode()"),wd=n(`. Please refer
to the docstring of this method for more information.`),kr=p(),Ft=r("h2"),Xt=r("a"),Os=r("span"),y(en.$$.fragment),Sd=p(),Gs=r("span"),$d=n("Speech2TextModel"),wr=p(),Fe=r("div"),y(tn.$$.fragment),Ed=p(),on=r("p"),qd=n(`The bare Speech2Text Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Vn=r("a"),Fd=n("PreTrainedModel"),zd=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Pd=p(),nn=r("p"),jd=n("This model is also a PyTorch "),sn=r("a"),Cd=n("torch.nn.Module"),Md=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ad=p(),Ne=r("div"),y(rn.$$.fragment),Nd=p(),zt=r("p"),Dd=n("The "),Hn=r("a"),Id=n("Speech2TextModel"),Ld=n(" forward method, overrides the "),Us=r("code"),Od=n("__call__"),Gd=n(" special method."),Ud=p(),y(Qt.$$.fragment),Wd=p(),y(Zt.$$.fragment),Sr=p(),Pt=r("h2"),eo=r("a"),Ws=r("span"),y(an.$$.fragment),Rd=p(),Rs=r("span"),Vd=n("Speech2TextForConditionalGeneration"),$r=p(),ze=r("div"),y(dn.$$.fragment),Hd=p(),ln=r("p"),Bd=n(`The Speech2Text Model with a language modeling head. Can be used for summarization.
This model inherits from `),Bn=r("a"),Kd=n("PreTrainedModel"),Jd=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Yd=p(),cn=r("p"),Xd=n("This model is also a PyTorch "),pn=r("a"),Qd=n("torch.nn.Module"),Zd=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),el=p(),De=r("div"),y(hn.$$.fragment),tl=p(),jt=r("p"),ol=n("The "),Kn=r("a"),nl=n("Speech2TextForConditionalGeneration"),sl=n(" forward method, overrides the "),Vs=r("code"),rl=n("__call__"),al=n(" special method."),il=p(),y(to.$$.fragment),dl=p(),y(oo.$$.fragment),Er=p(),Ct=r("h2"),no=r("a"),Hs=r("span"),y(un.$$.fragment),ll=p(),Bs=r("span"),cl=n("TFSpeech2TextModel"),qr=p(),be=r("div"),y(fn.$$.fragment),pl=p(),mn=r("p"),hl=n(`The bare Speech2Text Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Jn=r("a"),ul=n("TFPreTrainedModel"),fl=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ml=p(),_n=r("p"),_l=n("This model is also a "),gn=r("a"),gl=n("tf.keras.Model"),Tl=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),vl=p(),y(so.$$.fragment),bl=p(),Ie=r("div"),y(Tn.$$.fragment),yl=p(),Mt=r("p"),xl=n("The "),Yn=r("a"),kl=n("TFSpeech2TextModel"),wl=n(" forward method, overrides the "),Ks=r("code"),Sl=n("__call__"),$l=n(" special method."),El=p(),y(ro.$$.fragment),ql=p(),y(ao.$$.fragment),Fr=p(),At=r("h2"),io=r("a"),Js=r("span"),y(vn.$$.fragment),Fl=p(),Ys=r("span"),zl=n("TFSpeech2TextForConditionalGeneration"),zr=p(),ye=r("div"),y(bn.$$.fragment),Pl=p(),yn=r("p"),jl=n(`The Speech2Text Model with a language modeling head. Can be used for summarization.
This model inherits from `),Xn=r("a"),Cl=n("TFPreTrainedModel"),Ml=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Al=p(),xn=r("p"),Nl=n("This model is also a "),kn=r("a"),Dl=n("tf.keras.Model"),Il=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Ll=p(),y(lo.$$.fragment),Ol=p(),Le=r("div"),y(wn.$$.fragment),Gl=p(),Nt=r("p"),Ul=n("The "),Qn=r("a"),Wl=n("TFSpeech2TextForConditionalGeneration"),Rl=n(" forward method, overrides the "),Xs=r("code"),Vl=n("__call__"),Hl=n(" special method."),Bl=p(),y(co.$$.fragment),Kl=p(),y(po.$$.fragment),this.h()},l(o){const m=Wp('[data-svelte="svelte-1phssyn"]',document.head);c=a(m,"META",{name:!0,content:!0}),m.forEach(t),b=h(o),_=a(o,"H1",{class:!0});var Sn=i(_);g=a(Sn,"A",{id:!0,class:!0,href:!0});var Qs=i(g);v=a(Qs,"SPAN",{});var Zs=i(v);x(d.$$.fragment,Zs),Zs.forEach(t),Qs.forEach(t),u=h(Sn),q=a(Sn,"SPAN",{});var er=i(q);D=s(er,"Speech2Text"),er.forEach(t),Sn.forEach(t),j=h(o),M=a(o,"H2",{class:!0});var $n=i(M);I=a($n,"A",{id:!0,class:!0,href:!0});var tr=i(I);ne=a(tr,"SPAN",{});var or=i(ne);x(E.$$.fragment,or),or.forEach(t),tr.forEach(t),Ge=h($n),Q=a($n,"SPAN",{});var nr=i(Q);Ue=s(nr,"Overview"),nr.forEach(t),$n.forEach(t),je=h(o),A=a(o,"P",{});var Pe=i(A);We=s(Pe,"The Speech2Text model was proposed in "),se=a(Pe,"A",{href:!0,rel:!0});var sr=i(se);re=s(sr,"fairseq S2T: Fast Speech-to-Text Modeling with fairseq"),sr.forEach(t),Re=s(Pe,` by Changhan Wang, Yun Tang, Xutai Ma, Anne Wu, Dmytro Okhonko, Juan Pino. It\u2019s a
transformer-based seq2seq (encoder-decoder) model designed for end-to-end Automatic Speech Recognition (ASR) and Speech
Translation (ST). It uses a convolutional downsampler to reduce the length of speech inputs by 3/4th before they are
fed into the encoder. The model is trained with standard autoregressive cross-entropy loss and generates the
transcripts/translations autoregressively. Speech2Text has been fine-tuned on several datasets for ASR and ST:
`),ae=a(Pe,"A",{href:!0,rel:!0});var rr=i(ae);ie=s(rr,"LibriSpeech"),rr.forEach(t),Ve=s(Pe,", "),de=a(Pe,"A",{href:!0,rel:!0});var ar=i(de);le=s(ar,"CoVoST 2"),ar.forEach(t),He=s(Pe,", "),ce=a(Pe,"A",{href:!0,rel:!0});var ir=i(ce);Se=s(ir,"MuST-C"),ir.forEach(t),N=s(Pe,"."),Pe.forEach(t),L=h(o),Y=a(o,"P",{});var Zn=i(Y);pe=s(Zn,"This model was contributed by "),he=a(Zn,"A",{href:!0,rel:!0});var Zl=i(he);Be=s(Zl,"valhalla"),Zl.forEach(t),ue=s(Zn,". The original code can be found "),fe=a(Zn,"A",{href:!0,rel:!0});var ec=i(fe);Ke=s(ec,"here"),ec.forEach(t),U=s(Zn,"."),Zn.forEach(t),Ce=h(o),W=a(o,"H2",{class:!0});var jr=i(W);ee=a(jr,"A",{id:!0,class:!0,href:!0});var tc=i(ee);$e=a(tc,"SPAN",{});var oc=i($e);x(K.$$.fragment,oc),oc.forEach(t),tc.forEach(t),Je=h(jr),Ee=a(jr,"SPAN",{});var nc=i(Ee);Z=s(nc,"Inference"),nc.forEach(t),jr.forEach(t),Me=h(o),H=a(o,"P",{});var Cr=i(H);Ye=s(Cr,`Speech2Text is a speech model that accepts a float tensor of log-mel filter-bank features extracted from the speech
signal. It\u2019s a transformer-based seq2seq model, so the transcripts/translations are generated autoregressively. The
`),me=a(Cr,"CODE",{});var sc=i(me);R=s(sc,"generate()"),sc.forEach(t),Xe=s(Cr," method can be used for inference."),Cr.forEach(t),B=h(o),O=a(o,"P",{});var dt=i(O);Qe=s(dt,"The "),T=a(dt,"A",{href:!0});var rc=i(T);F=s(rc,"Speech2TextFeatureExtractor"),rc.forEach(t),ht=s(dt,` class is responsible for extracting the log-mel filter-bank
features. The `),te=a(dt,"A",{href:!0});var ac=i(te);ut=s(ac,"Speech2TextProcessor"),ac.forEach(t),ft=s(dt," wraps "),z=a(dt,"A",{href:!0});var ic=i(z);mt=s(ic,"Speech2TextFeatureExtractor"),ic.forEach(t),_t=s(dt,` and
`),Ae=a(dt,"A",{href:!0});var dc=i(Ae);gt=s(dc,"Speech2TextTokenizer"),dc.forEach(t),Tt=s(dt,` into a single instance to both extract the input features and decode the
predicted token ids.`),dt.forEach(t),X=h(o),P=a(o,"P",{});var xe=i(P);vt=s(xe,"The feature extractor depends on "),Ze=a(xe,"CODE",{});var lc=i(Ze);_e=s(lc,"torchaudio"),lc.forEach(t),bt=s(xe," and the tokenizer depends on "),et=a(xe,"CODE",{});var cc=i(et);tt=s(cc,"sentencepiece"),cc.forEach(t),yt=s(xe,` so be sure to
install those packages before running the examples. You could either install those as extra speech dependencies with
`),ge=a(xe,"CODE",{});var pc=i(ge);xt=s(pc,'pip install transformers"[speech, sentencepiece]"'),pc.forEach(t),ca=s(xe," or install the packages separately with "),ls=a(xe,"CODE",{});var hc=i(ls);pa=s(hc,"pip install torchaudio sentencepiece"),hc.forEach(t),ha=s(xe,". Also "),cs=a(xe,"CODE",{});var uc=i(cs);ua=s(uc,"torchaudio"),uc.forEach(t),fa=s(xe," requires the development version of the "),yo=a(xe,"A",{href:!0,rel:!0});var fc=i(yo);ma=s(fc,"libsndfile"),fc.forEach(t),_a=s(xe,` package which can be installed via a system package manager. On Ubuntu it can
be installed as follows: `),ps=a(xe,"CODE",{});var mc=i(ps);ga=s(mc,"apt install libsndfile1-dev"),mc.forEach(t),xe.forEach(t),cr=h(o),qn=a(o,"UL",{});var _c=i(qn);hs=a(_c,"LI",{});var gc=i(hs);Ta=s(gc,"ASR and Speech Translation"),gc.forEach(t),_c.forEach(t),pr=h(o),x(xo.$$.fragment,o),hr=h(o),Fn=a(o,"UL",{});var Tc=i(Fn);ko=a(Tc,"LI",{});var Mr=i(ko);us=a(Mr,"P",{});var vc=i(us);va=s(vc,"Multilingual speech translation"),vc.forEach(t),ba=h(Mr),Te=a(Mr,"P",{});var Oe=i(Te);ya=s(Oe,"For multilingual speech translation models, "),fs=a(Oe,"CODE",{});var bc=i(fs);xa=s(bc,"eos_token_id"),bc.forEach(t),ka=s(Oe," is used as the "),ms=a(Oe,"CODE",{});var yc=i(ms);wa=s(yc,"decoder_start_token_id"),yc.forEach(t),Sa=s(Oe,` and
the target language id is forced as the first generated token. To force the target language id as the first
generated token, pass the `),_s=a(Oe,"CODE",{});var xc=i(_s);$a=s(xc,"forced_bos_token_id"),xc.forEach(t),Ea=s(Oe," parameter to the "),gs=a(Oe,"CODE",{});var kc=i(gs);qa=s(kc,"generate()"),kc.forEach(t),Fa=s(Oe,` method. The following
example shows how to transate English speech to French text using the `),Ts=a(Oe,"EM",{});var wc=i(Ts);za=s(wc,"facebook/s2t-medium-mustc-multilingual-st"),wc.forEach(t),Pa=s(Oe,`
checkpoint.`),Oe.forEach(t),Mr.forEach(t),Tc.forEach(t),ur=h(o),x(wo.$$.fragment,o),fr=h(o),Dt=a(o,"P",{});var Ar=i(Dt);ja=s(Ar,"See the "),So=a(Ar,"A",{href:!0,rel:!0});var Sc=i(So);Ca=s(Sc,"model hub"),Sc.forEach(t),Ma=s(Ar," to look for Speech2Text checkpoints."),Ar.forEach(t),mr=h(o),kt=a(o,"H2",{class:!0});var Nr=i(kt);It=a(Nr,"A",{id:!0,class:!0,href:!0});var $c=i(It);vs=a($c,"SPAN",{});var Ec=i(vs);x($o.$$.fragment,Ec),Ec.forEach(t),$c.forEach(t),Aa=h(Nr),bs=a(Nr,"SPAN",{});var qc=i(bs);Na=s(qc,"Speech2TextConfig"),qc.forEach(t),Nr.forEach(t),_r=h(o),qe=a(o,"DIV",{class:!0});var ho=i(qe);x(Eo.$$.fragment,ho),Da=h(ho),wt=a(ho,"P",{});var es=i(wt);Ia=s(es,"This is the configuration class to store the configuration of a "),zn=a(es,"A",{href:!0});var Fc=i(zn);La=s(Fc,"Speech2TextModel"),Fc.forEach(t),Oa=s(es,`. It is used to instantiate an
Speech2Text 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 Speech2Text
`),qo=a(es,"A",{href:!0,rel:!0});var zc=i(qo);Ga=s(zc,"facebook/s2t-small-librispeech-asr"),zc.forEach(t),Ua=s(es," architecture."),es.forEach(t),Wa=h(ho),St=a(ho,"P",{});var ts=i(St);Ra=s(ts,"Configuration objects inherit from "),Pn=a(ts,"A",{href:!0});var Pc=i(Pn);Va=s(Pc,"PretrainedConfig"),Pc.forEach(t),Ha=s(ts,` and can be used to control the model outputs. Read the
documentation from `),jn=a(ts,"A",{href:!0});var jc=i(jn);Ba=s(jc,"PretrainedConfig"),jc.forEach(t),Ka=s(ts," for more information."),ts.forEach(t),Ja=h(ho),x(Lt.$$.fragment,ho),ho.forEach(t),gr=h(o),$t=a(o,"H2",{class:!0});var Dr=i($t);Ot=a(Dr,"A",{id:!0,class:!0,href:!0});var Cc=i(Ot);ys=a(Cc,"SPAN",{});var Mc=i(ys);x(Fo.$$.fragment,Mc),Mc.forEach(t),Cc.forEach(t),Ya=h(Dr),xs=a(Dr,"SPAN",{});var Ac=i(xs);Xa=s(Ac,"Speech2TextTokenizer"),Ac.forEach(t),Dr.forEach(t),Tr=h(o),J=a(o,"DIV",{class:!0});var we=i(J);x(zo.$$.fragment,we),Qa=h(we),ks=a(we,"P",{});var Nc=i(ks);Za=s(Nc,"Construct an Speech2Text tokenizer."),Nc.forEach(t),ei=h(we),Po=a(we,"P",{});var Ir=i(Po);ti=s(Ir,"This tokenizer inherits from "),Cn=a(Ir,"A",{href:!0});var Dc=i(Cn);oi=s(Dc,"PreTrainedTokenizer"),Dc.forEach(t),ni=s(Ir,` which contains some of the main methods. Users should refer to
the superclass for more information regarding such methods.`),Ir.forEach(t),si=h(we),Gt=a(we,"DIV",{class:!0});var Lr=i(Gt);x(jo.$$.fragment,Lr),ri=h(Lr),ws=a(Lr,"P",{});var Ic=i(ws);ai=s(Ic,"Build model inputs from a sequence by appending eos_token_id."),Ic.forEach(t),Lr.forEach(t),ii=h(we),Ut=a(we,"DIV",{class:!0});var Or=i(Ut);x(Co.$$.fragment,Or),di=h(Or),Mo=a(Or,"P",{});var Gr=i(Mo);li=s(Gr,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Ss=a(Gr,"CODE",{});var Lc=i(Ss);ci=s(Lc,"prepare_for_model"),Lc.forEach(t),pi=s(Gr," method."),Gr.forEach(t),Or.forEach(t),hi=h(we),rt=a(we,"DIV",{class:!0});var os=i(rt);x(Ao.$$.fragment,os),ui=h(os),Mn=a(os,"P",{});var Jl=i(Mn);fi=s(Jl,"Create the token type IDs corresponding to the sequences passed. "),An=a(Jl,"A",{href:!0});var Oc=i(An);mi=s(Oc,`What are token type
IDs?`),Oc.forEach(t),Jl.forEach(t),_i=h(os),$s=a(os,"P",{});var Gc=i($s);gi=s(Gc,"Should be overridden in a subclass if the model has a special way of building those."),Gc.forEach(t),os.forEach(t),Ti=h(we),Nn=a(we,"DIV",{class:!0});var Uc=i(Nn);x(No.$$.fragment,Uc),Uc.forEach(t),we.forEach(t),vr=h(o),Et=a(o,"H2",{class:!0});var Ur=i(Et);Wt=a(Ur,"A",{id:!0,class:!0,href:!0});var Wc=i(Wt);Es=a(Wc,"SPAN",{});var Rc=i(Es);x(Do.$$.fragment,Rc),Rc.forEach(t),Wc.forEach(t),vi=h(Ur),qs=a(Ur,"SPAN",{});var Vc=i(qs);bi=s(Vc,"Speech2TextFeatureExtractor"),Vc.forEach(t),Ur.forEach(t),br=h(o),ve=a(o,"DIV",{class:!0});var lt=i(ve);x(Io.$$.fragment,lt),yi=h(lt),Fs=a(lt,"P",{});var Hc=i(Fs);xi=s(Hc,"Constructs a Speech2Text feature extractor."),Hc.forEach(t),ki=h(lt),Lo=a(lt,"P",{});var Wr=i(Lo);wi=s(Wr,"This feature extractor inherits from "),Dn=a(Wr,"A",{href:!0});var Bc=i(Dn);Si=s(Bc,"Speech2TextFeatureExtractor"),Bc.forEach(t),$i=s(Wr,` which contains most of the main methods. Users
should refer to this superclass for more information regarding those methods.`),Wr.forEach(t),Ei=h(lt),zs=a(lt,"P",{});var Kc=i(zs);qi=s(Kc,`This class extracts mel-filter bank features from raw speech using TorchAudio and applies utterance-level cepstral
mean and variance normalization to the extracted features.`),Kc.forEach(t),Fi=h(lt),Rt=a(lt,"DIV",{class:!0});var Rr=i(Rt);x(Oo.$$.fragment,Rr),zi=h(Rr),Ps=a(Rr,"P",{});var Jc=i(Ps);Pi=s(Jc,"Main method to featurize and prepare for the model one or several sequence(s)."),Jc.forEach(t),Rr.forEach(t),lt.forEach(t),yr=h(o),qt=a(o,"H2",{class:!0});var Vr=i(qt);Vt=a(Vr,"A",{id:!0,class:!0,href:!0});var Yc=i(Vt);js=a(Yc,"SPAN",{});var Xc=i(js);x(Go.$$.fragment,Xc),Xc.forEach(t),Yc.forEach(t),ji=h(Vr),Cs=a(Vr,"SPAN",{});var Qc=i(Cs);Ci=s(Qc,"Speech2TextProcessor"),Qc.forEach(t),Vr.forEach(t),xr=h(o),V=a(o,"DIV",{class:!0});var oe=i(V);x(Uo.$$.fragment,oe),Mi=h(oe),Ms=a(oe,"P",{});var Zc=i(Ms);Ai=s(Zc,`Constructs a Speech2Text processor which wraps a Speech2Text feature extractor and a Speech2Text tokenizer into a
single processor.`),Zc.forEach(t),Ni=h(oe),ke=a(oe,"P",{});var nt=i(ke);In=a(nt,"A",{href:!0});var ep=i(In);Di=s(ep,"Speech2TextProcessor"),ep.forEach(t),Ii=s(nt," offers all the functionalities of "),Ln=a(nt,"A",{href:!0});var tp=i(Ln);Li=s(tp,"Speech2TextFeatureExtractor"),tp.forEach(t),Oi=s(nt,` and
`),On=a(nt,"A",{href:!0});var op=i(On);Gi=s(op,"Speech2TextTokenizer"),op.forEach(t),Ui=s(nt,". See the "),Wo=a(nt,"A",{href:!0});var Yl=i(Wo);As=a(Yl,"STRONG",{});var np=i(As);Wi=s(np,"call"),np.forEach(t),Ri=s(Yl,"()"),Yl.forEach(t),Vi=s(nt," and "),Gn=a(nt,"A",{href:!0});var sp=i(Gn);Hi=s(sp,"decode()"),sp.forEach(t),Bi=s(nt,` for more
information.`),nt.forEach(t),Ki=h(oe),Ht=a(oe,"DIV",{class:!0});var Hr=i(Ht);x(Ro.$$.fragment,Hr),Ji=h(Hr),ot=a(Hr,"P",{});var uo=i(ot);Yi=s(uo,`When used in normal mode, this method forwards all its arguments to Speech2TextFeatureExtractor\u2019s
`),Vo=a(uo,"A",{href:!0});var Xl=i(Vo);Ns=a(Xl,"STRONG",{});var rp=i(Ns);Xi=s(rp,"call"),rp.forEach(t),Qi=s(Xl,"()"),Xl.forEach(t),Zi=s(uo,` and returns its output. If used in the context
`),Ds=a(uo,"CODE",{});var ap=i(Ds);ed=s(ap,"as_target_processor()"),ap.forEach(t),td=s(uo,` this method forwards all its arguments to Speech2TextTokenizer\u2019s
`),Ho=a(uo,"A",{href:!0});var Ql=i(Ho);Is=a(Ql,"STRONG",{});var ip=i(Is);od=s(ip,"call"),ip.forEach(t),nd=s(Ql,"()"),Ql.forEach(t),sd=s(uo,`. Please refer to the doctsring of the above two methods for more
information.`),uo.forEach(t),Hr.forEach(t),rd=h(oe),at=a(oe,"DIV",{class:!0});var ns=i(at);x(Bo.$$.fragment,ns),ad=h(ns),Ls=a(ns,"P",{});var dp=i(Ls);id=s(dp,"Instantiate a processor associated with a pretrained model."),dp.forEach(t),dd=h(ns),x(Bt.$$.fragment,ns),ns.forEach(t),ld=h(oe),it=a(oe,"DIV",{class:!0});var ss=i(it);x(Ko.$$.fragment,ss),cd=h(ss),Jo=a(ss,"P",{});var Br=i(Jo);pd=s(Br,`Saves the attributes of this processor (feature extractor, tokenizer\u2026) in the specified directory so that it
can be reloaded using the `),Un=a(Br,"A",{href:!0});var lp=i(Un);hd=s(lp,"from_pretrained()"),lp.forEach(t),ud=s(Br," method."),Br.forEach(t),fd=h(ss),x(Kt.$$.fragment,ss),ss.forEach(t),md=h(oe),Jt=a(oe,"DIV",{class:!0});var Kr=i(Jt);x(Yo.$$.fragment,Kr),_d=h(Kr),Xo=a(Kr,"P",{});var Jr=i(Xo);gd=s(Jr,"This method forwards all its arguments to Speech2TextTokenizer\u2019s "),Wn=a(Jr,"A",{href:!0});var cp=i(Wn);Td=s(cp,"batch_decode()"),cp.forEach(t),vd=s(Jr,`. Please
refer to the docstring of this method for more information.`),Jr.forEach(t),Kr.forEach(t),bd=h(oe),Yt=a(oe,"DIV",{class:!0});var Yr=i(Yt);x(Qo.$$.fragment,Yr),yd=h(Yr),Zo=a(Yr,"P",{});var Xr=i(Zo);xd=s(Xr,"This method forwards all its arguments to Speech2TextTokenizer\u2019s "),Rn=a(Xr,"A",{href:!0});var pp=i(Rn);kd=s(pp,"decode()"),pp.forEach(t),wd=s(Xr,`. Please refer
to the docstring of this method for more information.`),Xr.forEach(t),Yr.forEach(t),oe.forEach(t),kr=h(o),Ft=a(o,"H2",{class:!0});var Qr=i(Ft);Xt=a(Qr,"A",{id:!0,class:!0,href:!0});var hp=i(Xt);Os=a(hp,"SPAN",{});var up=i(Os);x(en.$$.fragment,up),up.forEach(t),hp.forEach(t),Sd=h(Qr),Gs=a(Qr,"SPAN",{});var fp=i(Gs);$d=s(fp,"Speech2TextModel"),fp.forEach(t),Qr.forEach(t),wr=h(o),Fe=a(o,"DIV",{class:!0});var fo=i(Fe);x(tn.$$.fragment,fo),Ed=h(fo),on=a(fo,"P",{});var Zr=i(on);qd=s(Zr,`The bare Speech2Text Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Vn=a(Zr,"A",{href:!0});var mp=i(Vn);Fd=s(mp,"PreTrainedModel"),mp.forEach(t),zd=s(Zr,`. 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.)`),Zr.forEach(t),Pd=h(fo),nn=a(fo,"P",{});var ea=i(nn);jd=s(ea,"This model is also a PyTorch "),sn=a(ea,"A",{href:!0,rel:!0});var _p=i(sn);Cd=s(_p,"torch.nn.Module"),_p.forEach(t),Md=s(ea,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ea.forEach(t),Ad=h(fo),Ne=a(fo,"DIV",{class:!0});var mo=i(Ne);x(rn.$$.fragment,mo),Nd=h(mo),zt=a(mo,"P",{});var rs=i(zt);Dd=s(rs,"The "),Hn=a(rs,"A",{href:!0});var gp=i(Hn);Id=s(gp,"Speech2TextModel"),gp.forEach(t),Ld=s(rs," forward method, overrides the "),Us=a(rs,"CODE",{});var Tp=i(Us);Od=s(Tp,"__call__"),Tp.forEach(t),Gd=s(rs," special method."),rs.forEach(t),Ud=h(mo),x(Qt.$$.fragment,mo),Wd=h(mo),x(Zt.$$.fragment,mo),mo.forEach(t),fo.forEach(t),Sr=h(o),Pt=a(o,"H2",{class:!0});var ta=i(Pt);eo=a(ta,"A",{id:!0,class:!0,href:!0});var vp=i(eo);Ws=a(vp,"SPAN",{});var bp=i(Ws);x(an.$$.fragment,bp),bp.forEach(t),vp.forEach(t),Rd=h(ta),Rs=a(ta,"SPAN",{});var yp=i(Rs);Vd=s(yp,"Speech2TextForConditionalGeneration"),yp.forEach(t),ta.forEach(t),$r=h(o),ze=a(o,"DIV",{class:!0});var _o=i(ze);x(dn.$$.fragment,_o),Hd=h(_o),ln=a(_o,"P",{});var oa=i(ln);Bd=s(oa,`The Speech2Text Model with a language modeling head. Can be used for summarization.
This model inherits from `),Bn=a(oa,"A",{href:!0});var xp=i(Bn);Kd=s(xp,"PreTrainedModel"),xp.forEach(t),Jd=s(oa,`. 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.)`),oa.forEach(t),Yd=h(_o),cn=a(_o,"P",{});var na=i(cn);Xd=s(na,"This model is also a PyTorch "),pn=a(na,"A",{href:!0,rel:!0});var kp=i(pn);Qd=s(kp,"torch.nn.Module"),kp.forEach(t),Zd=s(na,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),na.forEach(t),el=h(_o),De=a(_o,"DIV",{class:!0});var go=i(De);x(hn.$$.fragment,go),tl=h(go),jt=a(go,"P",{});var as=i(jt);ol=s(as,"The "),Kn=a(as,"A",{href:!0});var wp=i(Kn);nl=s(wp,"Speech2TextForConditionalGeneration"),wp.forEach(t),sl=s(as," forward method, overrides the "),Vs=a(as,"CODE",{});var Sp=i(Vs);rl=s(Sp,"__call__"),Sp.forEach(t),al=s(as," special method."),as.forEach(t),il=h(go),x(to.$$.fragment,go),dl=h(go),x(oo.$$.fragment,go),go.forEach(t),_o.forEach(t),Er=h(o),Ct=a(o,"H2",{class:!0});var sa=i(Ct);no=a(sa,"A",{id:!0,class:!0,href:!0});var $p=i(no);Hs=a($p,"SPAN",{});var Ep=i(Hs);x(un.$$.fragment,Ep),Ep.forEach(t),$p.forEach(t),ll=h(sa),Bs=a(sa,"SPAN",{});var qp=i(Bs);cl=s(qp,"TFSpeech2TextModel"),qp.forEach(t),sa.forEach(t),qr=h(o),be=a(o,"DIV",{class:!0});var ct=i(be);x(fn.$$.fragment,ct),pl=h(ct),mn=a(ct,"P",{});var ra=i(mn);hl=s(ra,`The bare Speech2Text Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Jn=a(ra,"A",{href:!0});var Fp=i(Jn);ul=s(Fp,"TFPreTrainedModel"),Fp.forEach(t),fl=s(ra,`. 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.)`),ra.forEach(t),ml=h(ct),_n=a(ct,"P",{});var aa=i(_n);_l=s(aa,"This model is also a "),gn=a(aa,"A",{href:!0,rel:!0});var zp=i(gn);gl=s(zp,"tf.keras.Model"),zp.forEach(t),Tl=s(aa,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),aa.forEach(t),vl=h(ct),x(so.$$.fragment,ct),bl=h(ct),Ie=a(ct,"DIV",{class:!0});var To=i(Ie);x(Tn.$$.fragment,To),yl=h(To),Mt=a(To,"P",{});var is=i(Mt);xl=s(is,"The "),Yn=a(is,"A",{href:!0});var Pp=i(Yn);kl=s(Pp,"TFSpeech2TextModel"),Pp.forEach(t),wl=s(is," forward method, overrides the "),Ks=a(is,"CODE",{});var jp=i(Ks);Sl=s(jp,"__call__"),jp.forEach(t),$l=s(is," special method."),is.forEach(t),El=h(To),x(ro.$$.fragment,To),ql=h(To),x(ao.$$.fragment,To),To.forEach(t),ct.forEach(t),Fr=h(o),At=a(o,"H2",{class:!0});var ia=i(At);io=a(ia,"A",{id:!0,class:!0,href:!0});var Cp=i(io);Js=a(Cp,"SPAN",{});var Mp=i(Js);x(vn.$$.fragment,Mp),Mp.forEach(t),Cp.forEach(t),Fl=h(ia),Ys=a(ia,"SPAN",{});var Ap=i(Ys);zl=s(Ap,"TFSpeech2TextForConditionalGeneration"),Ap.forEach(t),ia.forEach(t),zr=h(o),ye=a(o,"DIV",{class:!0});var pt=i(ye);x(bn.$$.fragment,pt),Pl=h(pt),yn=a(pt,"P",{});var da=i(yn);jl=s(da,`The Speech2Text Model with a language modeling head. Can be used for summarization.
This model inherits from `),Xn=a(da,"A",{href:!0});var Np=i(Xn);Cl=s(Np,"TFPreTrainedModel"),Np.forEach(t),Ml=s(da,`. 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.)`),da.forEach(t),Al=h(pt),xn=a(pt,"P",{});var la=i(xn);Nl=s(la,"This model is also a "),kn=a(la,"A",{href:!0,rel:!0});var Dp=i(kn);Dl=s(Dp,"tf.keras.Model"),Dp.forEach(t),Il=s(la,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),la.forEach(t),Ll=h(pt),x(lo.$$.fragment,pt),Ol=h(pt),Le=a(pt,"DIV",{class:!0});var vo=i(Le);x(wn.$$.fragment,vo),Gl=h(vo),Nt=a(vo,"P",{});var ds=i(Nt);Ul=s(ds,"The "),Qn=a(ds,"A",{href:!0});var Ip=i(Qn);Wl=s(Ip,"TFSpeech2TextForConditionalGeneration"),Ip.forEach(t),Rl=s(ds," forward method, overrides the "),Xs=a(ds,"CODE",{});var Lp=i(Xs);Vl=s(Lp,"__call__"),Lp.forEach(t),Hl=s(ds," special method."),ds.forEach(t),Bl=h(vo),x(co.$$.fragment,vo),Kl=h(vo),x(po.$$.fragment,vo),vo.forEach(t),pt.forEach(t),this.h()},h(){l(c,"name","hf:doc:metadata"),l(c,"content",JSON.stringify(rh)),l(g,"id","speech2text"),l(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"),l(g,"href","#speech2text"),l(_,"class","relative group"),l(I,"id","overview"),l(I,"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"),l(I,"href","#overview"),l(M,"class","relative group"),l(se,"href","https://arxiv.org/abs/2010.05171"),l(se,"rel","nofollow"),l(ae,"href","http://www.openslr.org/12"),l(ae,"rel","nofollow"),l(de,"href","https://github.com/facebookresearch/covost"),l(de,"rel","nofollow"),l(ce,"href","https://ict.fbk.eu/must-c/"),l(ce,"rel","nofollow"),l(he,"href","https://huggingface.co/valhalla"),l(he,"rel","nofollow"),l(fe,"href","https://github.com/pytorch/fairseq/tree/master/examples/speech_to_text"),l(fe,"rel","nofollow"),l(ee,"id","inference"),l(ee,"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"),l(ee,"href","#inference"),l(W,"class","relative group"),l(T,"href","/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextFeatureExtractor"),l(te,"href","/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextProcessor"),l(z,"href","/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextFeatureExtractor"),l(Ae,"href","/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextTokenizer"),l(yo,"href","http://www.mega-nerd.com/libsndfile/"),l(yo,"rel","nofollow"),l(So,"href","https://huggingface.co/models?filter=speech_to_text"),l(So,"rel","nofollow"),l(It,"id","transformers.Speech2TextConfig"),l(It,"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"),l(It,"href","#transformers.Speech2TextConfig"),l(kt,"class","relative group"),l(zn,"href","/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextModel"),l(qo,"href","https://huggingface.co/facebook/s2t-small-librispeech-asr"),l(qo,"rel","nofollow"),l(Pn,"href","/docs/transformers/pr_19907/en/main_classes/configuration#transformers.PretrainedConfig"),l(jn,"href","/docs/transformers/pr_19907/en/main_classes/configuration#transformers.PretrainedConfig"),l(qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ot,"id","transformers.Speech2TextTokenizer"),l(Ot,"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"),l(Ot,"href","#transformers.Speech2TextTokenizer"),l($t,"class","relative group"),l(Cn,"href","/docs/transformers/pr_19907/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),l(Gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(An,"href","../glossary#token-type-ids"),l(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Nn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Wt,"id","transformers.Speech2TextFeatureExtractor"),l(Wt,"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"),l(Wt,"href","#transformers.Speech2TextFeatureExtractor"),l(Et,"class","relative group"),l(Dn,"href","/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextFeatureExtractor"),l(Rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Vt,"id","transformers.Speech2TextProcessor"),l(Vt,"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"),l(Vt,"href","#transformers.Speech2TextProcessor"),l(qt,"class","relative group"),l(In,"href","/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextProcessor"),l(Ln,"href","/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextFeatureExtractor"),l(On,"href","/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextTokenizer"),l(Wo,"href","/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextProcessor.__call__"),l(Gn,"href","/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextProcessor.decode"),l(Vo,"href","/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextFeatureExtractor.__call__"),l(Ho,"href","/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"),l(Ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Un,"href","/docs/transformers/pr_19907/en/main_classes/processors#transformers.ProcessorMixin.from_pretrained"),l(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Wn,"href","/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode"),l(Jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Rn,"href","/docs/transformers/pr_19907/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode"),l(Yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Xt,"id","transformers.Speech2TextModel"),l(Xt,"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"),l(Xt,"href","#transformers.Speech2TextModel"),l(Ft,"class","relative group"),l(Vn,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.PreTrainedModel"),l(sn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(sn,"rel","nofollow"),l(Hn,"href","/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextModel"),l(Ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(eo,"id","transformers.Speech2TextForConditionalGeneration"),l(eo,"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"),l(eo,"href","#transformers.Speech2TextForConditionalGeneration"),l(Pt,"class","relative group"),l(Bn,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.PreTrainedModel"),l(pn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(pn,"rel","nofollow"),l(Kn,"href","/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.Speech2TextForConditionalGeneration"),l(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(no,"id","transformers.TFSpeech2TextModel"),l(no,"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"),l(no,"href","#transformers.TFSpeech2TextModel"),l(Ct,"class","relative group"),l(Jn,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel"),l(gn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),l(gn,"rel","nofollow"),l(Yn,"href","/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.TFSpeech2TextModel"),l(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(io,"id","transformers.TFSpeech2TextForConditionalGeneration"),l(io,"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"),l(io,"href","#transformers.TFSpeech2TextForConditionalGeneration"),l(At,"class","relative group"),l(Xn,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.TFPreTrainedModel"),l(kn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),l(kn,"rel","nofollow"),l(Qn,"href","/docs/transformers/pr_19907/en/model_doc/speech_to_text#transformers.TFSpeech2TextForConditionalGeneration"),l(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,m){e(document.head,c),f(o,b,m),f(o,_,m),e(_,g),e(g,v),k(d,v,null),e(_,u),e(_,q),e(q,D),f(o,j,m),f(o,M,m),e(M,I),e(I,ne),k(E,ne,null),e(M,Ge),e(M,Q),e(Q,Ue),f(o,je,m),f(o,A,m),e(A,We),e(A,se),e(se,re),e(A,Re),e(A,ae),e(ae,ie),e(A,Ve),e(A,de),e(de,le),e(A,He),e(A,ce),e(ce,Se),e(A,N),f(o,L,m),f(o,Y,m),e(Y,pe),e(Y,he),e(he,Be),e(Y,ue),e(Y,fe),e(fe,Ke),e(Y,U),f(o,Ce,m),f(o,W,m),e(W,ee),e(ee,$e),k(K,$e,null),e(W,Je),e(W,Ee),e(Ee,Z),f(o,Me,m),f(o,H,m),e(H,Ye),e(H,me),e(me,R),e(H,Xe),f(o,B,m),f(o,O,m),e(O,Qe),e(O,T),e(T,F),e(O,ht),e(O,te),e(te,ut),e(O,ft),e(O,z),e(z,mt),e(O,_t),e(O,Ae),e(Ae,gt),e(O,Tt),f(o,X,m),f(o,P,m),e(P,vt),e(P,Ze),e(Ze,_e),e(P,bt),e(P,et),e(et,tt),e(P,yt),e(P,ge),e(ge,xt),e(P,ca),e(P,ls),e(ls,pa),e(P,ha),e(P,cs),e(cs,ua),e(P,fa),e(P,yo),e(yo,ma),e(P,_a),e(P,ps),e(ps,ga),f(o,cr,m),f(o,qn,m),e(qn,hs),e(hs,Ta),f(o,pr,m),k(xo,o,m),f(o,hr,m),f(o,Fn,m),e(Fn,ko),e(ko,us),e(us,va),e(ko,ba),e(ko,Te),e(Te,ya),e(Te,fs),e(fs,xa),e(Te,ka),e(Te,ms),e(ms,wa),e(Te,Sa),e(Te,_s),e(_s,$a),e(Te,Ea),e(Te,gs),e(gs,qa),e(Te,Fa),e(Te,Ts),e(Ts,za),e(Te,Pa),f(o,ur,m),k(wo,o,m),f(o,fr,m),f(o,Dt,m),e(Dt,ja),e(Dt,So),e(So,Ca),e(Dt,Ma),f(o,mr,m),f(o,kt,m),e(kt,It),e(It,vs),k($o,vs,null),e(kt,Aa),e(kt,bs),e(bs,Na),f(o,_r,m),f(o,qe,m),k(Eo,qe,null),e(qe,Da),e(qe,wt),e(wt,Ia),e(wt,zn),e(zn,La),e(wt,Oa),e(wt,qo),e(qo,Ga),e(wt,Ua),e(qe,Wa),e(qe,St),e(St,Ra),e(St,Pn),e(Pn,Va),e(St,Ha),e(St,jn),e(jn,Ba),e(St,Ka),e(qe,Ja),k(Lt,qe,null),f(o,gr,m),f(o,$t,m),e($t,Ot),e(Ot,ys),k(Fo,ys,null),e($t,Ya),e($t,xs),e(xs,Xa),f(o,Tr,m),f(o,J,m),k(zo,J,null),e(J,Qa),e(J,ks),e(ks,Za),e(J,ei),e(J,Po),e(Po,ti),e(Po,Cn),e(Cn,oi),e(Po,ni),e(J,si),e(J,Gt),k(jo,Gt,null),e(Gt,ri),e(Gt,ws),e(ws,ai),e(J,ii),e(J,Ut),k(Co,Ut,null),e(Ut,di),e(Ut,Mo),e(Mo,li),e(Mo,Ss),e(Ss,ci),e(Mo,pi),e(J,hi),e(J,rt),k(Ao,rt,null),e(rt,ui),e(rt,Mn),e(Mn,fi),e(Mn,An),e(An,mi),e(rt,_i),e(rt,$s),e($s,gi),e(J,Ti),e(J,Nn),k(No,Nn,null),f(o,vr,m),f(o,Et,m),e(Et,Wt),e(Wt,Es),k(Do,Es,null),e(Et,vi),e(Et,qs),e(qs,bi),f(o,br,m),f(o,ve,m),k(Io,ve,null),e(ve,yi),e(ve,Fs),e(Fs,xi),e(ve,ki),e(ve,Lo),e(Lo,wi),e(Lo,Dn),e(Dn,Si),e(Lo,$i),e(ve,Ei),e(ve,zs),e(zs,qi),e(ve,Fi),e(ve,Rt),k(Oo,Rt,null),e(Rt,zi),e(Rt,Ps),e(Ps,Pi),f(o,yr,m),f(o,qt,m),e(qt,Vt),e(Vt,js),k(Go,js,null),e(qt,ji),e(qt,Cs),e(Cs,Ci),f(o,xr,m),f(o,V,m),k(Uo,V,null),e(V,Mi),e(V,Ms),e(Ms,Ai),e(V,Ni),e(V,ke),e(ke,In),e(In,Di),e(ke,Ii),e(ke,Ln),e(Ln,Li),e(ke,Oi),e(ke,On),e(On,Gi),e(ke,Ui),e(ke,Wo),e(Wo,As),e(As,Wi),e(Wo,Ri),e(ke,Vi),e(ke,Gn),e(Gn,Hi),e(ke,Bi),e(V,Ki),e(V,Ht),k(Ro,Ht,null),e(Ht,Ji),e(Ht,ot),e(ot,Yi),e(ot,Vo),e(Vo,Ns),e(Ns,Xi),e(Vo,Qi),e(ot,Zi),e(ot,Ds),e(Ds,ed),e(ot,td),e(ot,Ho),e(Ho,Is),e(Is,od),e(Ho,nd),e(ot,sd),e(V,rd),e(V,at),k(Bo,at,null),e(at,ad),e(at,Ls),e(Ls,id),e(at,dd),k(Bt,at,null),e(V,ld),e(V,it),k(Ko,it,null),e(it,cd),e(it,Jo),e(Jo,pd),e(Jo,Un),e(Un,hd),e(Jo,ud),e(it,fd),k(Kt,it,null),e(V,md),e(V,Jt),k(Yo,Jt,null),e(Jt,_d),e(Jt,Xo),e(Xo,gd),e(Xo,Wn),e(Wn,Td),e(Xo,vd),e(V,bd),e(V,Yt),k(Qo,Yt,null),e(Yt,yd),e(Yt,Zo),e(Zo,xd),e(Zo,Rn),e(Rn,kd),e(Zo,wd),f(o,kr,m),f(o,Ft,m),e(Ft,Xt),e(Xt,Os),k(en,Os,null),e(Ft,Sd),e(Ft,Gs),e(Gs,$d),f(o,wr,m),f(o,Fe,m),k(tn,Fe,null),e(Fe,Ed),e(Fe,on),e(on,qd),e(on,Vn),e(Vn,Fd),e(on,zd),e(Fe,Pd),e(Fe,nn),e(nn,jd),e(nn,sn),e(sn,Cd),e(nn,Md),e(Fe,Ad),e(Fe,Ne),k(rn,Ne,null),e(Ne,Nd),e(Ne,zt),e(zt,Dd),e(zt,Hn),e(Hn,Id),e(zt,Ld),e(zt,Us),e(Us,Od),e(zt,Gd),e(Ne,Ud),k(Qt,Ne,null),e(Ne,Wd),k(Zt,Ne,null),f(o,Sr,m),f(o,Pt,m),e(Pt,eo),e(eo,Ws),k(an,Ws,null),e(Pt,Rd),e(Pt,Rs),e(Rs,Vd),f(o,$r,m),f(o,ze,m),k(dn,ze,null),e(ze,Hd),e(ze,ln),e(ln,Bd),e(ln,Bn),e(Bn,Kd),e(ln,Jd),e(ze,Yd),e(ze,cn),e(cn,Xd),e(cn,pn),e(pn,Qd),e(cn,Zd),e(ze,el),e(ze,De),k(hn,De,null),e(De,tl),e(De,jt),e(jt,ol),e(jt,Kn),e(Kn,nl),e(jt,sl),e(jt,Vs),e(Vs,rl),e(jt,al),e(De,il),k(to,De,null),e(De,dl),k(oo,De,null),f(o,Er,m),f(o,Ct,m),e(Ct,no),e(no,Hs),k(un,Hs,null),e(Ct,ll),e(Ct,Bs),e(Bs,cl),f(o,qr,m),f(o,be,m),k(fn,be,null),e(be,pl),e(be,mn),e(mn,hl),e(mn,Jn),e(Jn,ul),e(mn,fl),e(be,ml),e(be,_n),e(_n,_l),e(_n,gn),e(gn,gl),e(_n,Tl),e(be,vl),k(so,be,null),e(be,bl),e(be,Ie),k(Tn,Ie,null),e(Ie,yl),e(Ie,Mt),e(Mt,xl),e(Mt,Yn),e(Yn,kl),e(Mt,wl),e(Mt,Ks),e(Ks,Sl),e(Mt,$l),e(Ie,El),k(ro,Ie,null),e(Ie,ql),k(ao,Ie,null),f(o,Fr,m),f(o,At,m),e(At,io),e(io,Js),k(vn,Js,null),e(At,Fl),e(At,Ys),e(Ys,zl),f(o,zr,m),f(o,ye,m),k(bn,ye,null),e(ye,Pl),e(ye,yn),e(yn,jl),e(yn,Xn),e(Xn,Cl),e(yn,Ml),e(ye,Al),e(ye,xn),e(xn,Nl),e(xn,kn),e(kn,Dl),e(xn,Il),e(ye,Ll),k(lo,ye,null),e(ye,Ol),e(ye,Le),k(wn,Le,null),e(Le,Gl),e(Le,Nt),e(Nt,Ul),e(Nt,Qn),e(Qn,Wl),e(Nt,Rl),e(Nt,Xs),e(Xs,Vl),e(Nt,Hl),e(Le,Bl),k(co,Le,null),e(Le,Kl),k(po,Le,null),Pr=!0},p(o,[m]){const Sn={};m&2&&(Sn.$$scope={dirty:m,ctx:o}),Lt.$set(Sn);const Qs={};m&2&&(Qs.$$scope={dirty:m,ctx:o}),Bt.$set(Qs);const Zs={};m&2&&(Zs.$$scope={dirty:m,ctx:o}),Kt.$set(Zs);const er={};m&2&&(er.$$scope={dirty:m,ctx:o}),Qt.$set(er);const $n={};m&2&&($n.$$scope={dirty:m,ctx:o}),Zt.$set($n);const tr={};m&2&&(tr.$$scope={dirty:m,ctx:o}),to.$set(tr);const or={};m&2&&(or.$$scope={dirty:m,ctx:o}),oo.$set(or);const nr={};m&2&&(nr.$$scope={dirty:m,ctx:o}),so.$set(nr);const Pe={};m&2&&(Pe.$$scope={dirty:m,ctx:o}),ro.$set(Pe);const sr={};m&2&&(sr.$$scope={dirty:m,ctx:o}),ao.$set(sr);const rr={};m&2&&(rr.$$scope={dirty:m,ctx:o}),lo.$set(rr);const ar={};m&2&&(ar.$$scope={dirty:m,ctx:o}),co.$set(ar);const ir={};m&2&&(ir.$$scope={dirty:m,ctx:o}),po.$set(ir)},i(o){Pr||(w(d.$$.fragment,o),w(E.$$.fragment,o),w(K.$$.fragment,o),w(xo.$$.fragment,o),w(wo.$$.fragment,o),w($o.$$.fragment,o),w(Eo.$$.fragment,o),w(Lt.$$.fragment,o),w(Fo.$$.fragment,o),w(zo.$$.fragment,o),w(jo.$$.fragment,o),w(Co.$$.fragment,o),w(Ao.$$.fragment,o),w(No.$$.fragment,o),w(Do.$$.fragment,o),w(Io.$$.fragment,o),w(Oo.$$.fragment,o),w(Go.$$.fragment,o),w(Uo.$$.fragment,o),w(Ro.$$.fragment,o),w(Bo.$$.fragment,o),w(Bt.$$.fragment,o),w(Ko.$$.fragment,o),w(Kt.$$.fragment,o),w(Yo.$$.fragment,o),w(Qo.$$.fragment,o),w(en.$$.fragment,o),w(tn.$$.fragment,o),w(rn.$$.fragment,o),w(Qt.$$.fragment,o),w(Zt.$$.fragment,o),w(an.$$.fragment,o),w(dn.$$.fragment,o),w(hn.$$.fragment,o),w(to.$$.fragment,o),w(oo.$$.fragment,o),w(un.$$.fragment,o),w(fn.$$.fragment,o),w(so.$$.fragment,o),w(Tn.$$.fragment,o),w(ro.$$.fragment,o),w(ao.$$.fragment,o),w(vn.$$.fragment,o),w(bn.$$.fragment,o),w(lo.$$.fragment,o),w(wn.$$.fragment,o),w(co.$$.fragment,o),w(po.$$.fragment,o),Pr=!0)},o(o){S(d.$$.fragment,o),S(E.$$.fragment,o),S(K.$$.fragment,o),S(xo.$$.fragment,o),S(wo.$$.fragment,o),S($o.$$.fragment,o),S(Eo.$$.fragment,o),S(Lt.$$.fragment,o),S(Fo.$$.fragment,o),S(zo.$$.fragment,o),S(jo.$$.fragment,o),S(Co.$$.fragment,o),S(Ao.$$.fragment,o),S(No.$$.fragment,o),S(Do.$$.fragment,o),S(Io.$$.fragment,o),S(Oo.$$.fragment,o),S(Go.$$.fragment,o),S(Uo.$$.fragment,o),S(Ro.$$.fragment,o),S(Bo.$$.fragment,o),S(Bt.$$.fragment,o),S(Ko.$$.fragment,o),S(Kt.$$.fragment,o),S(Yo.$$.fragment,o),S(Qo.$$.fragment,o),S(en.$$.fragment,o),S(tn.$$.fragment,o),S(rn.$$.fragment,o),S(Qt.$$.fragment,o),S(Zt.$$.fragment,o),S(an.$$.fragment,o),S(dn.$$.fragment,o),S(hn.$$.fragment,o),S(to.$$.fragment,o),S(oo.$$.fragment,o),S(un.$$.fragment,o),S(fn.$$.fragment,o),S(so.$$.fragment,o),S(Tn.$$.fragment,o),S(ro.$$.fragment,o),S(ao.$$.fragment,o),S(vn.$$.fragment,o),S(bn.$$.fragment,o),S(lo.$$.fragment,o),S(wn.$$.fragment,o),S(co.$$.fragment,o),S(po.$$.fragment,o),Pr=!1},d(o){t(c),o&&t(b),o&&t(_),$(d),o&&t(j),o&&t(M),$(E),o&&t(je),o&&t(A),o&&t(L),o&&t(Y),o&&t(Ce),o&&t(W),$(K),o&&t(Me),o&&t(H),o&&t(B),o&&t(O),o&&t(X),o&&t(P),o&&t(cr),o&&t(qn),o&&t(pr),$(xo,o),o&&t(hr),o&&t(Fn),o&&t(ur),$(wo,o),o&&t(fr),o&&t(Dt),o&&t(mr),o&&t(kt),$($o),o&&t(_r),o&&t(qe),$(Eo),$(Lt),o&&t(gr),o&&t($t),$(Fo),o&&t(Tr),o&&t(J),$(zo),$(jo),$(Co),$(Ao),$(No),o&&t(vr),o&&t(Et),$(Do),o&&t(br),o&&t(ve),$(Io),$(Oo),o&&t(yr),o&&t(qt),$(Go),o&&t(xr),o&&t(V),$(Uo),$(Ro),$(Bo),$(Bt),$(Ko),$(Kt),$(Yo),$(Qo),o&&t(kr),o&&t(Ft),$(en),o&&t(wr),o&&t(Fe),$(tn),$(rn),$(Qt),$(Zt),o&&t(Sr),o&&t(Pt),$(an),o&&t($r),o&&t(ze),$(dn),$(hn),$(to),$(oo),o&&t(Er),o&&t(Ct),$(un),o&&t(qr),o&&t(be),$(fn),$(so),$(Tn),$(ro),$(ao),o&&t(Fr),o&&t(At),$(vn),o&&t(zr),o&&t(ye),$(bn),$(lo),$(wn),$(co),$(po)}}}const rh={local:"speech2text",sections:[{local:"overview",title:"Overview"},{local:"inference",title:"Inference"},{local:"transformers.Speech2TextConfig",title:"Speech2TextConfig"},{local:"transformers.Speech2TextTokenizer",title:"Speech2TextTokenizer"},{local:"transformers.Speech2TextFeatureExtractor",title:"Speech2TextFeatureExtractor"},{local:"transformers.Speech2TextProcessor",title:"Speech2TextProcessor"},{local:"transformers.Speech2TextModel",title:"Speech2TextModel"},{local:"transformers.Speech2TextForConditionalGeneration",title:"Speech2TextForConditionalGeneration"},{local:"transformers.TFSpeech2TextModel",title:"TFSpeech2TextModel"},{local:"transformers.TFSpeech2TextForConditionalGeneration",title:"TFSpeech2TextForConditionalGeneration"}],title:"Speech2Text"};function ah(C){return Rp(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class uh extends Op{constructor(c){super();Gp(this,c,ah,sh,Up,{})}}export{uh as default,rh as metadata};
