import{S as Fr,i as Sr,s as $r,e as n,k as c,w as v,t as r,M as Er,c as s,d as t,m as h,a,x as k,h as i,b as l,G as e,g as _,y,q as M,o as w,B as F,v as Cr,L as Vt}from"../../chunks/vendor-hf-doc-builder.js";import{T as wr}from"../../chunks/Tip-hf-doc-builder.js";import{D as O}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Bt}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as oo}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ot}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function zr(z){let p,b,g,u,T;return u=new Bt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZTTVRDb25maWclMkMlMjBGU01UTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwRlNNVCUyMGZhY2Vib29rJTJGd210MTktZW4tcnUlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWclMjAlM0QlMjBGU01UQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMEZTTVRNb2RlbChjb25maWcpJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> FSMTConfig, FSMTModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a FSMT facebook/wmt19-en-ru style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>config = FSMTConfig()

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

<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(){p=n("p"),b=r("Examples:"),g=c(),v(u.$$.fragment)},l(d){p=s(d,"P",{});var f=a(p);b=i(f,"Examples:"),f.forEach(t),g=h(d),k(u.$$.fragment,d)},m(d,f){_(d,p,f),e(p,b),_(d,g,f),y(u,d,f),T=!0},p:Vt,i(d){T||(M(u.$$.fragment,d),T=!0)},o(d){w(u.$$.fragment,d),T=!1},d(d){d&&t(p),d&&t(g),F(u,d)}}}function xr(z){let p,b,g,u,T;return u=new Bt({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){p=n("p"),b=r("Transformer sequence pair mask has the following format:"),g=c(),v(u.$$.fragment)},l(d){p=s(d,"P",{});var f=a(p);b=i(f,"Transformer sequence pair mask has the following format:"),f.forEach(t),g=h(d),k(u.$$.fragment,d)},m(d,f){_(d,p,f),e(p,b),_(d,g,f),y(u,d,f),T=!0},p:Vt,i(d){T||(M(u.$$.fragment,d),T=!0)},o(d){w(u.$$.fragment,d),T=!1},d(d){d&&t(p),d&&t(g),F(u,d)}}}function qr(z){let p,b,g,u,T;return{c(){p=n("p"),b=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),u=r("Module"),T=r(`
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){p=s(d,"P",{});var f=a(p);b=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(f,"CODE",{});var j=a(g);u=i(j,"Module"),j.forEach(t),T=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(d,f){_(d,p,f),e(p,b),e(p,g),e(g,u),e(p,T)},d(d){d&&t(p)}}}function Ir(z){let p,b,g,u,T;return u=new Bt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGU01UTW9kZWwlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGd210MTktcnUtZW4lMjIpJTBBbW9kZWwlMjAlM0QlMjBGU01UTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGd210MTktcnUtZW4lMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FSMTModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/wmt19-ru-en&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FSMTModel.from_pretrained(<span class="hljs-string">&quot;facebook/wmt19-ru-en&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;pt&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(){p=n("p"),b=r("Example:"),g=c(),v(u.$$.fragment)},l(d){p=s(d,"P",{});var f=a(p);b=i(f,"Example:"),f.forEach(t),g=h(d),k(u.$$.fragment,d)},m(d,f){_(d,p,f),e(p,b),_(d,g,f),y(u,d,f),T=!0},p:Vt,i(d){T||(M(u.$$.fragment,d),T=!0)},o(d){w(u.$$.fragment,d),T=!1},d(d){d&&t(p),d&&t(g),F(u,d)}}}function Ar(z){let p,b,g,u,T;return{c(){p=n("p"),b=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),u=r("Module"),T=r(`
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){p=s(d,"P",{});var f=a(p);b=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(f,"CODE",{});var j=a(g);u=i(j,"Module"),j.forEach(t),T=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(t)},m(d,f){_(d,p,f),e(p,b),e(p,g),e(g,u),e(p,T)},d(d){d&&t(p)}}}function jr(z){let p,b,g,u,T;return u=new Bt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGU01URm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uJTBBJTBBbW5hbWUlMjAlM0QlMjAlMjJmYWNlYm9vayUyRndtdDE5LXJ1LWVuJTIyJTBBbW9kZWwlMjAlM0QlMjBGU01URm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZChtbmFtZSklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZChtbmFtZSklMEElMEFzcmNfdGV4dCUyMCUzRCUyMCUyMiVEMCU5QyVEMCVCMCVEMSU4OCVEMCVCOCVEMCVCRCVEMCVCRCVEMCVCRSVEMCVCNSUyMCVEMCVCRSVEMCVCMSVEMSU4MyVEMSU4NyVEMCVCNSVEMCVCRCVEMCVCOCVEMCVCNSUyMC0lMjAlRDElOEQlRDElODIlRDAlQkUlMjAlRDAlQjclRDAlQjQlRDAlQkUlRDElODAlRDAlQkUlRDAlQjIlRDAlQkUlMkMlMjAlRDAlQkQlRDAlQjUlMjAlRDElODIlRDAlQjAlRDAlQkElMjAlRDAlQkIlRDAlQjglM0YlMjIlMEFpbnB1dF9pZHMlMjAlM0QlMjB0b2tlbml6ZXIoc3JjX3RleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5pbnB1dF9pZHMlMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRfaWRzJTJDJTIwbnVtX2JlYW1zJTNENSUyQyUyMG51bV9yZXR1cm5fc2VxdWVuY2VzJTNEMyklMEF0b2tlbml6ZXIuZGVjb2RlKG91dHB1dHMlNUIwJTVEJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FSMTForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>mname = <span class="hljs-string">&quot;facebook/wmt19-ru-en&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FSMTForConditionalGeneration.from_pretrained(mname)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(mname)

<span class="hljs-meta">&gt;&gt;&gt; </span>src_text = <span class="hljs-string">&quot;\u041C\u0430\u0448\u0438\u043D\u043D\u043E\u0435 \u043E\u0431\u0443\u0447\u0435\u043D\u0438\u0435 - \u044D\u0442\u043E \u0437\u0434\u043E\u0440\u043E\u0432\u043E, \u043D\u0435 \u0442\u0430\u043A \u043B\u0438?&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(src_text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(input_ids, num_beams=<span class="hljs-number">5</span>, num_return_sequences=<span class="hljs-number">3</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(outputs[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>)
<span class="hljs-string">&quot;Machine learning is great, isn&#x27;t it?&quot;</span>`}}),{c(){p=n("p"),b=r("Translation example::"),g=c(),v(u.$$.fragment)},l(d){p=s(d,"P",{});var f=a(p);b=i(f,"Translation example::"),f.forEach(t),g=h(d),k(u.$$.fragment,d)},m(d,f){_(d,p,f),e(p,b),_(d,g,f),y(u,d,f),T=!0},p:Vt,i(d){T||(M(u.$$.fragment,d),T=!0)},o(d){w(u.$$.fragment,d),T=!1},d(d){d&&t(p),d&&t(g),F(u,d)}}}function Nr(z){let p,b,g,u,T,d,f,j,Jt,ct,V,$o,Lt,Zt,Me,Qt,Xt,ht,B,ne,Eo,we,Ht,Co,Yt,pt,se,Kt,Fe,en,on,mt,to,tn,ut,no,zo,nn,ft,D,sn,Se,an,rn,$e,dn,ln,_t,J,ae,xo,Ee,cn,qo,hn,gt,so,L,pn,ao,mn,un,ro,fn,_n,Tt,Z,re,Io,Ce,gn,Ao,Tn,bt,q,ze,bn,Q,vn,io,kn,yn,xe,Mn,wn,Fn,X,Sn,lo,$n,En,co,Cn,zn,xn,ie,vt,H,de,jo,qe,qn,No,In,kt,S,Ie,An,Uo,jn,Nn,N,Do,Un,Dn,Po,Pn,Rn,U,Wn,Ro,Gn,On,Wo,Vn,Bn,Go,Jn,Ln,Zn,Ae,Qn,Oo,Xn,Hn,Yn,je,Kn,ho,es,os,ts,P,Ne,ns,Vo,ss,as,Ue,po,rs,Bo,is,ds,mo,ls,Jo,cs,hs,le,De,ps,Pe,ms,Lo,us,fs,_s,x,Re,gs,Zo,Ts,bs,ce,vs,Y,ks,Qo,ys,Ms,Xo,ws,Fs,Ss,Ho,$s,Es,uo,We,yt,K,he,Yo,Ge,Cs,Ko,zs,Mt,E,Oe,xs,et,qs,Is,Ve,As,fo,js,Ns,Us,Be,Ds,Je,Ps,Rs,Ws,I,Le,Gs,ee,Os,_o,Vs,Bs,ot,Js,Ls,Zs,pe,Qs,me,wt,oe,ue,tt,Ze,Xs,nt,Hs,Ft,C,Qe,Ys,st,Ks,ea,Xe,oa,go,ta,na,sa,He,aa,Ye,ra,ia,da,A,Ke,la,te,ca,To,ha,pa,at,ma,ua,fa,fe,_a,_e,St;return d=new oo({}),we=new oo({}),Ee=new oo({}),Ce=new oo({}),ze=new O({props:{name:"class transformers.FSMTConfig",anchor:"transformers.FSMTConfig",parameters:[{name:"langs",val:" = ['en', 'de']"},{name:"src_vocab_size",val:" = 42024"},{name:"tgt_vocab_size",val:" = 42024"},{name:"activation_function",val:" = 'relu'"},{name:"d_model",val:" = 1024"},{name:"max_length",val:" = 200"},{name:"max_position_embeddings",val:" = 1024"},{name:"encoder_ffn_dim",val:" = 4096"},{name:"encoder_layers",val:" = 12"},{name:"encoder_attention_heads",val:" = 16"},{name:"encoder_layerdrop",val:" = 0.0"},{name:"decoder_ffn_dim",val:" = 4096"},{name:"decoder_layers",val:" = 12"},{name:"decoder_attention_heads",val:" = 16"},{name:"decoder_layerdrop",val:" = 0.0"},{name:"attention_dropout",val:" = 0.0"},{name:"dropout",val:" = 0.1"},{name:"activation_dropout",val:" = 0.0"},{name:"init_std",val:" = 0.02"},{name:"decoder_start_token_id",val:" = 2"},{name:"is_encoder_decoder",val:" = True"},{name:"scale_embedding",val:" = True"},{name:"tie_word_embeddings",val:" = False"},{name:"num_beams",val:" = 5"},{name:"length_penalty",val:" = 1.0"},{name:"early_stopping",val:" = False"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"forced_eos_token_id",val:" = 2"},{name:"**common_kwargs",val:""}],parametersDescription:[{anchor:"transformers.FSMTConfig.langs",description:`<strong>langs</strong> (<code>List[str]</code>) &#x2014;
A list with source language and target_language (e.g., [&#x2018;en&#x2019;, &#x2018;ru&#x2019;]).`,name:"langs"},{anchor:"transformers.FSMTConfig.src_vocab_size",description:`<strong>src_vocab_size</strong> (<code>int</code>) &#x2014;
Vocabulary size of the encoder. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed to the forward method in the encoder.`,name:"src_vocab_size"},{anchor:"transformers.FSMTConfig.tgt_vocab_size",description:`<strong>tgt_vocab_size</strong> (<code>int</code>) &#x2014;
Vocabulary size of the decoder. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed to the forward method in the decoder.`,name:"tgt_vocab_size"},{anchor:"transformers.FSMTConfig.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.FSMTConfig.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.FSMTConfig.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.FSMTConfig.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.FSMTConfig.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.FSMTConfig.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.FSMTConfig.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.FSMTConfig.activation_function",description:`<strong>activation_function</strong> (<code>str</code> or <code>Callable</code>, <em>optional</em>, defaults to <code>&quot;relu&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.FSMTConfig.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.FSMTConfig.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.FSMTConfig.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.FSMTConfig.max_position_embeddings",description:`<strong>max_position_embeddings</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_position_embeddings"},{anchor:"transformers.FSMTConfig.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.FSMTConfig.scale_embedding",description:`<strong>scale_embedding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Scale embeddings by diving by sqrt(d_model).`,name:"scale_embedding"},{anchor:"transformers.FSMTConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Beginning of stream token id.`,name:"bos_token_id"},{anchor:"transformers.FSMTConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Padding token id.`,name:"pad_token_id"},{anchor:"transformers.FSMTConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
End of stream token id.`,name:"eos_token_id"},{anchor:"transformers.FSMTConfig.decoder_start_token_id",description:`<strong>decoder_start_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
This model starts decoding with <code>eos_token_id</code>`,name:"decoder_start_token_id"},{anchor:"transformers.FSMTConfig.encoder_layerdrop",description:`<strong>encoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Google &#x201C;layerdrop arxiv&#x201D;, as its not explainable in one line.`,name:"encoder_layerdrop"},{anchor:"transformers.FSMTConfig.decoder_layerdrop",description:`<strong>decoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Google &#x201C;layerdrop arxiv&#x201D;, as its not explainable in one line.`,name:"decoder_layerdrop"},{anchor:"transformers.FSMTConfig.is_encoder_decoder",description:`<strong>is_encoder_decoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether this is an encoder/decoder model.`,name:"is_encoder_decoder"},{anchor:"transformers.FSMTConfig.tie_word_embeddings",description:`<strong>tie_word_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to tie input and output embeddings.`,name:"tie_word_embeddings"},{anchor:"transformers.FSMTConfig.num_beams",description:`<strong>num_beams</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
Number of beams for beam search that will be used by default in the <code>generate</code> method of the model. 1 means
no beam search.`,name:"num_beams"},{anchor:"transformers.FSMTConfig.length_penalty",description:`<strong>length_penalty</strong> (<code>float</code>, <em>optional</em>, defaults to 1) &#x2014;
Exponential penalty to the length that is used with beam-based generation. It is applied as an exponent to
the sequence length, which in turn is used to divide the score of the sequence. Since the score is the log
likelihood of the sequence (i.e. negative), <code>length_penalty</code> &gt; 0.0 promotes longer sequences, while
<code>length_penalty</code> &lt; 0.0 encourages shorter sequences.`,name:"length_penalty"},{anchor:"transformers.FSMTConfig.early_stopping",description:`<strong>early_stopping</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag that will be used by default in the <code>generate</code> method of the model. Whether to stop the beam search
when at least <code>num_beams</code> sentences are finished per batch or not.`,name:"early_stopping"},{anchor:"transformers.FSMTConfig.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.FSMTConfig.forced_eos_token_id",description:`<strong>forced_eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The id of the token to force as the last generated token when <code>max_length</code> is reached. Usually set to
<code>eos_token_id</code>.`,name:"forced_eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/fsmt/configuration_fsmt.py#L39"}}),ie=new Ot({props:{anchor:"transformers.FSMTConfig.example",$$slots:{default:[zr]},$$scope:{ctx:z}}}),qe=new oo({}),Ie=new O({props:{name:"class transformers.FSMTTokenizer",anchor:"transformers.FSMTTokenizer",parameters:[{name:"langs",val:" = None"},{name:"src_vocab_file",val:" = None"},{name:"tgt_vocab_file",val:" = None"},{name:"merges_file",val:" = None"},{name:"do_lower_case",val:" = False"},{name:"unk_token",val:" = '<unk>'"},{name:"bos_token",val:" = '<s>'"},{name:"sep_token",val:" = '</s>'"},{name:"pad_token",val:" = '<pad>'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FSMTTokenizer.langs",description:`<strong>langs</strong> (<code>List[str]</code>) &#x2014;
A list of two languages to translate from and to, for instance <code>[&quot;en&quot;, &quot;ru&quot;]</code>.`,name:"langs"},{anchor:"transformers.FSMTTokenizer.src_vocab_file",description:`<strong>src_vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary for the source language.`,name:"src_vocab_file"},{anchor:"transformers.FSMTTokenizer.tgt_vocab_file",description:`<strong>tgt_vocab_file</strong> (<code>st</code>) &#x2014;
File containing the vocabulary for the target language.`,name:"tgt_vocab_file"},{anchor:"transformers.FSMTTokenizer.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
File containing the merges.`,name:"merges_file"},{anchor:"transformers.FSMTTokenizer.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.FSMTTokenizer.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.FSMTTokenizer.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 sequence token that was used during pretraining. Can be used a sequence classifier token.</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>When building a sequence using special tokens, this is not the token that is used for the beginning of
sequence. The token used is the <code>cls_token</code>.</p>

					</div>`,name:"bos_token"},{anchor:"transformers.FSMTTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.FSMTTokenizer.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"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/fsmt/tokenization_fsmt.py#L135"}}),Ne=new O({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.FSMTTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.FSMTTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.FSMTTokenizer.build_inputs_with_special_tokens.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"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/fsmt/tokenization_fsmt.py#L404",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),De=new O({props:{name:"get_special_tokens_mask",anchor:"transformers.FSMTTokenizer.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.FSMTTokenizer.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.FSMTTokenizer.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.FSMTTokenizer.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/v4.32.0/src/transformers/models/fsmt/tokenization_fsmt.py#L430",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>
`}}),Re=new O({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.FSMTTokenizer.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.FSMTTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.FSMTTokenizer.create_token_type_ids_from_sequences.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"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/fsmt/tokenization_fsmt.py#L458",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),ce=new Ot({props:{anchor:"transformers.FSMTTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[xr]},$$scope:{ctx:z}}}),We=new O({props:{name:"save_vocabulary",anchor:"transformers.FSMTTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/fsmt/tokenization_fsmt.py#L491"}}),Ge=new oo({}),Oe=new O({props:{name:"class transformers.FSMTModel",anchor:"transformers.FSMTModel",parameters:[{name:"config",val:": FSMTConfig"}],parametersDescription:[{anchor:"transformers.FSMTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/fsmt#transformers.FSMTConfig">FSMTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/fsmt/modeling_fsmt.py#L1036"}}),Le=new O({props:{name:"forward",anchor:"transformers.FSMTModel.forward",parameters:[{name:"input_ids",val:": LongTensor"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.BoolTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = 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:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FSMTModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <code>FSTMTokenizer</code>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FSMTModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FSMTModel.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 <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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>FSMT 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.FSMTModel.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.BoolTensor</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.`,name:"decoder_attention_mask"},{anchor:"transformers.FSMTModel.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.FSMTModel.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.FSMTModel.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 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:"cross_attn_head_mask"},{anchor:"transformers.FSMTModel.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>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> 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.FSMTModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</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.FSMTModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.FSMTModel.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
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:"decoder_inputs_embeds"},{anchor:"transformers.FSMTModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#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.FSMTModel.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.FSMTModel.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.FSMTModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/fsmt/modeling_fsmt.py#L1058",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/fsmt#transformers.FSMTConfig"
>FSMTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the 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>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 optional 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 optional 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/v4.32.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),pe=new wr({props:{$$slots:{default:[qr]},$$scope:{ctx:z}}}),me=new Ot({props:{anchor:"transformers.FSMTModel.forward.example",$$slots:{default:[Ir]},$$scope:{ctx:z}}}),Ze=new oo({}),Qe=new O({props:{name:"class transformers.FSMTForConditionalGeneration",anchor:"transformers.FSMTForConditionalGeneration",parameters:[{name:"config",val:": FSMTConfig"}],parametersDescription:[{anchor:"transformers.FSMTForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/fsmt#transformers.FSMTConfig">FSMTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/fsmt/modeling_fsmt.py#L1172"}}),Ke=new O({props:{name:"forward",anchor:"transformers.FSMTForConditionalGeneration.forward",parameters:[{name:"input_ids",val:": LongTensor"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.BoolTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FSMTForConditionalGeneration.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <code>FSTMTokenizer</code>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FSMTForConditionalGeneration.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FSMTForConditionalGeneration.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 <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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>FSMT 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.FSMTForConditionalGeneration.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.BoolTensor</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.`,name:"decoder_attention_mask"},{anchor:"transformers.FSMTForConditionalGeneration.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.FSMTForConditionalGeneration.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.FSMTForConditionalGeneration.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 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:"cross_attn_head_mask"},{anchor:"transformers.FSMTForConditionalGeneration.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>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> 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.FSMTForConditionalGeneration.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</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.FSMTForConditionalGeneration.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.FSMTForConditionalGeneration.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
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:"decoder_inputs_embeds"},{anchor:"transformers.FSMTForConditionalGeneration.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#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.FSMTForConditionalGeneration.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.FSMTForConditionalGeneration.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.FSMTForConditionalGeneration.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.FSMTForConditionalGeneration.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/fsmt/modeling_fsmt.py#L1184",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/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/v4.32.0/en/model_doc/fsmt#transformers.FSMTConfig"
>FSMTConfig</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/v4.32.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),fe=new wr({props:{$$slots:{default:[Ar]},$$scope:{ctx:z}}}),_e=new Ot({props:{anchor:"transformers.FSMTForConditionalGeneration.forward.example",$$slots:{default:[jr]},$$scope:{ctx:z}}}),{c(){p=n("meta"),b=c(),g=n("h1"),u=n("a"),T=n("span"),v(d.$$.fragment),f=c(),j=n("span"),Jt=r("FSMT"),ct=c(),V=n("p"),$o=n("strong"),Lt=r("DISCLAIMER:"),Zt=r(" If you see something strange, file a "),Me=n("a"),Qt=r("Github Issue"),Xt=r(` and assign
@stas00.`),ht=c(),B=n("h2"),ne=n("a"),Eo=n("span"),v(we.$$.fragment),Ht=c(),Co=n("span"),Yt=r("Overview"),pt=c(),se=n("p"),Kt=r("FSMT (FairSeq MachineTranslation) models were introduced in "),Fe=n("a"),en=r("Facebook FAIR\u2019s WMT19 News Translation Task Submission"),on=r(" by Nathan Ng, Kyra Yee, Alexei Baevski, Myle Ott, Michael Auli, Sergey Edunov."),mt=c(),to=n("p"),tn=r("The abstract of the paper is the following:"),ut=c(),no=n("p"),zo=n("em"),nn=r(`This paper describes Facebook FAIR\u2019s submission to the WMT19 shared news translation task. We participate in two
language pairs and four language directions, English <-> German and English <-> Russian. Following our submission from
last year, our baseline systems are large BPE-based transformer models trained with the Fairseq sequence modeling
toolkit which rely on sampled back-translations. This year we experiment with different bitext data filtering schemes,
as well as with adding filtered back-translated data. We also ensemble and fine-tune our models on domain-specific
data, then decode using noisy channel model reranking. Our submissions are ranked first in all four directions of the
human evaluation campaign. On En->De, our system significantly outperforms other systems as well as human translations.
This system improves upon our WMT\u201918 submission by 4.5 BLEU points.`),ft=c(),D=n("p"),sn=r("This model was contributed by "),Se=n("a"),an=r("stas"),rn=r(`. The original code can be found
`),$e=n("a"),dn=r("here"),ln=r("."),_t=c(),J=n("h2"),ae=n("a"),xo=n("span"),v(Ee.$$.fragment),cn=c(),qo=n("span"),hn=r("Implementation Notes"),gt=c(),so=n("ul"),L=n("li"),pn=r(`FSMT uses source and target vocabulary pairs that aren\u2019t combined into one. It doesn\u2019t share embeddings tokens
either. Its tokenizer is very similar to `),ao=n("a"),mn=r("XLMTokenizer"),un=r(` and the main model is derived from
`),ro=n("a"),fn=r("BartModel"),_n=r("."),Tt=c(),Z=n("h2"),re=n("a"),Io=n("span"),v(Ce.$$.fragment),gn=c(),Ao=n("span"),Tn=r("FSMTConfig"),bt=c(),q=n("div"),v(ze.$$.fragment),bn=c(),Q=n("p"),vn=r("This is the configuration class to store the configuration of a "),io=n("a"),kn=r("FSMTModel"),yn=r(`. It is used to instantiate a FSMT
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 FSMT
`),xe=n("a"),Mn=r("facebook/wmt19-en-ru"),wn=r(" architecture."),Fn=c(),X=n("p"),Sn=r("Configuration objects inherit from "),lo=n("a"),$n=r("PretrainedConfig"),En=r(` and can be used to control the model outputs. Read the
documentation from `),co=n("a"),Cn=r("PretrainedConfig"),zn=r(" for more information."),xn=c(),v(ie.$$.fragment),vt=c(),H=n("h2"),de=n("a"),jo=n("span"),v(qe.$$.fragment),qn=c(),No=n("span"),In=r("FSMTTokenizer"),kt=c(),S=n("div"),v(Ie.$$.fragment),An=c(),Uo=n("p"),jn=r("Construct an FAIRSEQ Transformer tokenizer. Based on Byte-Pair Encoding. The tokenization process is the following:"),Nn=c(),N=n("ul"),Do=n("li"),Un=r("Moses preprocessing and tokenization."),Dn=c(),Po=n("li"),Pn=r("Normalizing all inputs text."),Rn=c(),U=n("li"),Wn=r("The arguments "),Ro=n("code"),Gn=r("special_tokens"),On=r(" and the function "),Wo=n("code"),Vn=r("set_special_tokens"),Bn=r(`, can be used to add additional symbols (like
\u201D`),Go=n("strong"),Jn=r("classify"),Ln=r("\u201D) to a vocabulary."),Zn=c(),Ae=n("li"),Qn=r("The argument "),Oo=n("code"),Xn=r("langs"),Hn=r(" defines a pair of languages."),Yn=c(),je=n("p"),Kn=r("This tokenizer inherits from "),ho=n("a"),es=r("PreTrainedTokenizer"),os=r(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),ts=c(),P=n("div"),v(Ne.$$.fragment),ns=c(),Vo=n("p"),ss=r(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A FAIRSEQ Transformer sequence has the following format:`),as=c(),Ue=n("ul"),po=n("li"),rs=r("single sequence: "),Bo=n("code"),is=r("<s> X </s>"),ds=c(),mo=n("li"),ls=r("pair of sequences: "),Jo=n("code"),cs=r("<s> A </s> B </s>"),hs=c(),le=n("div"),v(De.$$.fragment),ps=c(),Pe=n("p"),ms=r(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Lo=n("code"),us=r("prepare_for_model"),fs=r(" method."),_s=c(),x=n("div"),v(Re.$$.fragment),gs=c(),Zo=n("p"),Ts=r("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A FAIRSEQ"),bs=c(),v(ce.$$.fragment),vs=c(),Y=n("p"),ks=r("If "),Qo=n("code"),ys=r("token_ids_1"),Ms=r(" is "),Xo=n("code"),ws=r("None"),Fs=r(", this method only returns the first portion of the mask (0s)."),Ss=c(),Ho=n("p"),$s=r(`Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An
FAIRSEQ_TRANSFORMER sequence pair mask has the following format:`),Es=c(),uo=n("div"),v(We.$$.fragment),yt=c(),K=n("h2"),he=n("a"),Yo=n("span"),v(Ge.$$.fragment),Cs=c(),Ko=n("span"),zs=r("FSMTModel"),Mt=c(),E=n("div"),v(Oe.$$.fragment),xs=c(),et=n("p"),qs=r("The bare FSMT Model outputting raw hidden-states without any specific head on top."),Is=c(),Ve=n("p"),As=r("This model inherits from "),fo=n("a"),js=r("PreTrainedModel"),Ns=r(`. 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.)`),Us=c(),Be=n("p"),Ds=r("This model is also a PyTorch "),Je=n("a"),Ps=r("torch.nn.Module"),Rs=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ws=c(),I=n("div"),v(Le.$$.fragment),Gs=c(),ee=n("p"),Os=r("The "),_o=n("a"),Vs=r("FSMTModel"),Bs=r(" forward method, overrides the "),ot=n("code"),Js=r("__call__"),Ls=r(" special method."),Zs=c(),v(pe.$$.fragment),Qs=c(),v(me.$$.fragment),wt=c(),oe=n("h2"),ue=n("a"),tt=n("span"),v(Ze.$$.fragment),Xs=c(),nt=n("span"),Hs=r("FSMTForConditionalGeneration"),Ft=c(),C=n("div"),v(Qe.$$.fragment),Ys=c(),st=n("p"),Ks=r("The FSMT Model with a language modeling head. Can be used for summarization."),ea=c(),Xe=n("p"),oa=r("This model inherits from "),go=n("a"),ta=r("PreTrainedModel"),na=r(`. 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.)`),sa=c(),He=n("p"),aa=r("This model is also a PyTorch "),Ye=n("a"),ra=r("torch.nn.Module"),ia=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),da=c(),A=n("div"),v(Ke.$$.fragment),la=c(),te=n("p"),ca=r("The "),To=n("a"),ha=r("FSMTForConditionalGeneration"),pa=r(" forward method, overrides the "),at=n("code"),ma=r("__call__"),ua=r(" special method."),fa=c(),v(fe.$$.fragment),_a=c(),v(_e.$$.fragment),this.h()},l(o){const m=Er('[data-svelte="svelte-1phssyn"]',document.head);p=s(m,"META",{name:!0,content:!0}),m.forEach(t),b=h(o),g=s(o,"H1",{class:!0});var eo=a(g);u=s(eo,"A",{id:!0,class:!0,href:!0});var rt=a(u);T=s(rt,"SPAN",{});var it=a(T);k(d.$$.fragment,it),it.forEach(t),rt.forEach(t),f=h(eo),j=s(eo,"SPAN",{});var dt=a(j);Jt=i(dt,"FSMT"),dt.forEach(t),eo.forEach(t),ct=h(o),V=s(o,"P",{});var ge=a(V);$o=s(ge,"STRONG",{});var lt=a($o);Lt=i(lt,"DISCLAIMER:"),lt.forEach(t),Zt=i(ge," If you see something strange, file a "),Me=s(ge,"A",{href:!0,rel:!0});var ba=a(Me);Qt=i(ba,"Github Issue"),ba.forEach(t),Xt=i(ge,` and assign
@stas00.`),ge.forEach(t),ht=h(o),B=s(o,"H2",{class:!0});var $t=a(B);ne=s($t,"A",{id:!0,class:!0,href:!0});var va=a(ne);Eo=s(va,"SPAN",{});var ka=a(Eo);k(we.$$.fragment,ka),ka.forEach(t),va.forEach(t),Ht=h($t),Co=s($t,"SPAN",{});var ya=a(Co);Yt=i(ya,"Overview"),ya.forEach(t),$t.forEach(t),pt=h(o),se=s(o,"P",{});var Et=a(se);Kt=i(Et,"FSMT (FairSeq MachineTranslation) models were introduced in "),Fe=s(Et,"A",{href:!0,rel:!0});var Ma=a(Fe);en=i(Ma,"Facebook FAIR\u2019s WMT19 News Translation Task Submission"),Ma.forEach(t),on=i(Et," by Nathan Ng, Kyra Yee, Alexei Baevski, Myle Ott, Michael Auli, Sergey Edunov."),Et.forEach(t),mt=h(o),to=s(o,"P",{});var wa=a(to);tn=i(wa,"The abstract of the paper is the following:"),wa.forEach(t),ut=h(o),no=s(o,"P",{});var Fa=a(no);zo=s(Fa,"EM",{});var Sa=a(zo);nn=i(Sa,`This paper describes Facebook FAIR\u2019s submission to the WMT19 shared news translation task. We participate in two
language pairs and four language directions, English <-> German and English <-> Russian. Following our submission from
last year, our baseline systems are large BPE-based transformer models trained with the Fairseq sequence modeling
toolkit which rely on sampled back-translations. This year we experiment with different bitext data filtering schemes,
as well as with adding filtered back-translated data. We also ensemble and fine-tune our models on domain-specific
data, then decode using noisy channel model reranking. Our submissions are ranked first in all four directions of the
human evaluation campaign. On En->De, our system significantly outperforms other systems as well as human translations.
This system improves upon our WMT\u201918 submission by 4.5 BLEU points.`),Sa.forEach(t),Fa.forEach(t),ft=h(o),D=s(o,"P",{});var bo=a(D);sn=i(bo,"This model was contributed by "),Se=s(bo,"A",{href:!0,rel:!0});var $a=a(Se);an=i($a,"stas"),$a.forEach(t),rn=i(bo,`. The original code can be found
`),$e=s(bo,"A",{href:!0,rel:!0});var Ea=a($e);dn=i(Ea,"here"),Ea.forEach(t),ln=i(bo,"."),bo.forEach(t),_t=h(o),J=s(o,"H2",{class:!0});var Ct=a(J);ae=s(Ct,"A",{id:!0,class:!0,href:!0});var Ca=a(ae);xo=s(Ca,"SPAN",{});var za=a(xo);k(Ee.$$.fragment,za),za.forEach(t),Ca.forEach(t),cn=h(Ct),qo=s(Ct,"SPAN",{});var xa=a(qo);hn=i(xa,"Implementation Notes"),xa.forEach(t),Ct.forEach(t),gt=h(o),so=s(o,"UL",{});var qa=a(so);L=s(qa,"LI",{});var vo=a(L);pn=i(vo,`FSMT uses source and target vocabulary pairs that aren\u2019t combined into one. It doesn\u2019t share embeddings tokens
either. Its tokenizer is very similar to `),ao=s(vo,"A",{href:!0});var Ia=a(ao);mn=i(Ia,"XLMTokenizer"),Ia.forEach(t),un=i(vo,` and the main model is derived from
`),ro=s(vo,"A",{href:!0});var Aa=a(ro);fn=i(Aa,"BartModel"),Aa.forEach(t),_n=i(vo,"."),vo.forEach(t),qa.forEach(t),Tt=h(o),Z=s(o,"H2",{class:!0});var zt=a(Z);re=s(zt,"A",{id:!0,class:!0,href:!0});var ja=a(re);Io=s(ja,"SPAN",{});var Na=a(Io);k(Ce.$$.fragment,Na),Na.forEach(t),ja.forEach(t),gn=h(zt),Ao=s(zt,"SPAN",{});var Ua=a(Ao);Tn=i(Ua,"FSMTConfig"),Ua.forEach(t),zt.forEach(t),bt=h(o),q=s(o,"DIV",{class:!0});var Te=a(q);k(ze.$$.fragment,Te),bn=h(Te),Q=s(Te,"P",{});var ko=a(Q);vn=i(ko,"This is the configuration class to store the configuration of a "),io=s(ko,"A",{href:!0});var Da=a(io);kn=i(Da,"FSMTModel"),Da.forEach(t),yn=i(ko,`. It is used to instantiate a FSMT
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 FSMT
`),xe=s(ko,"A",{href:!0,rel:!0});var Pa=a(xe);Mn=i(Pa,"facebook/wmt19-en-ru"),Pa.forEach(t),wn=i(ko," architecture."),ko.forEach(t),Fn=h(Te),X=s(Te,"P",{});var yo=a(X);Sn=i(yo,"Configuration objects inherit from "),lo=s(yo,"A",{href:!0});var Ra=a(lo);$n=i(Ra,"PretrainedConfig"),Ra.forEach(t),En=i(yo,` and can be used to control the model outputs. Read the
documentation from `),co=s(yo,"A",{href:!0});var Wa=a(co);Cn=i(Wa,"PretrainedConfig"),Wa.forEach(t),zn=i(yo," for more information."),yo.forEach(t),xn=h(Te),k(ie.$$.fragment,Te),Te.forEach(t),vt=h(o),H=s(o,"H2",{class:!0});var xt=a(H);de=s(xt,"A",{id:!0,class:!0,href:!0});var Ga=a(de);jo=s(Ga,"SPAN",{});var Oa=a(jo);k(qe.$$.fragment,Oa),Oa.forEach(t),Ga.forEach(t),qn=h(xt),No=s(xt,"SPAN",{});var Va=a(No);In=i(Va,"FSMTTokenizer"),Va.forEach(t),xt.forEach(t),kt=h(o),S=s(o,"DIV",{class:!0});var $=a(S);k(Ie.$$.fragment,$),An=h($),Uo=s($,"P",{});var Ba=a(Uo);jn=i(Ba,"Construct an FAIRSEQ Transformer tokenizer. Based on Byte-Pair Encoding. The tokenization process is the following:"),Ba.forEach(t),Nn=h($),N=s($,"UL",{});var be=a(N);Do=s(be,"LI",{});var Ja=a(Do);Un=i(Ja,"Moses preprocessing and tokenization."),Ja.forEach(t),Dn=h(be),Po=s(be,"LI",{});var La=a(Po);Pn=i(La,"Normalizing all inputs text."),La.forEach(t),Rn=h(be),U=s(be,"LI",{});var ve=a(U);Wn=i(ve,"The arguments "),Ro=s(ve,"CODE",{});var Za=a(Ro);Gn=i(Za,"special_tokens"),Za.forEach(t),On=i(ve," and the function "),Wo=s(ve,"CODE",{});var Qa=a(Wo);Vn=i(Qa,"set_special_tokens"),Qa.forEach(t),Bn=i(ve,`, can be used to add additional symbols (like
\u201D`),Go=s(ve,"STRONG",{});var Xa=a(Go);Jn=i(Xa,"classify"),Xa.forEach(t),Ln=i(ve,"\u201D) to a vocabulary."),ve.forEach(t),Zn=h(be),Ae=s(be,"LI",{});var qt=a(Ae);Qn=i(qt,"The argument "),Oo=s(qt,"CODE",{});var Ha=a(Oo);Xn=i(Ha,"langs"),Ha.forEach(t),Hn=i(qt," defines a pair of languages."),qt.forEach(t),be.forEach(t),Yn=h($),je=s($,"P",{});var It=a(je);Kn=i(It,"This tokenizer inherits from "),ho=s(It,"A",{href:!0});var Ya=a(ho);es=i(Ya,"PreTrainedTokenizer"),Ya.forEach(t),os=i(It,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),It.forEach(t),ts=h($),P=s($,"DIV",{class:!0});var Mo=a(P);k(Ne.$$.fragment,Mo),ns=h(Mo),Vo=s(Mo,"P",{});var Ka=a(Vo);ss=i(Ka,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A FAIRSEQ Transformer sequence has the following format:`),Ka.forEach(t),as=h(Mo),Ue=s(Mo,"UL",{});var At=a(Ue);po=s(At,"LI",{});var ga=a(po);rs=i(ga,"single sequence: "),Bo=s(ga,"CODE",{});var er=a(Bo);is=i(er,"<s> X </s>"),er.forEach(t),ga.forEach(t),ds=h(At),mo=s(At,"LI",{});var Ta=a(mo);ls=i(Ta,"pair of sequences: "),Jo=s(Ta,"CODE",{});var or=a(Jo);cs=i(or,"<s> A </s> B </s>"),or.forEach(t),Ta.forEach(t),At.forEach(t),Mo.forEach(t),hs=h($),le=s($,"DIV",{class:!0});var jt=a(le);k(De.$$.fragment,jt),ps=h(jt),Pe=s(jt,"P",{});var Nt=a(Pe);ms=i(Nt,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Lo=s(Nt,"CODE",{});var tr=a(Lo);us=i(tr,"prepare_for_model"),tr.forEach(t),fs=i(Nt," method."),Nt.forEach(t),jt.forEach(t),_s=h($),x=s($,"DIV",{class:!0});var R=a(x);k(Re.$$.fragment,R),gs=h(R),Zo=s(R,"P",{});var nr=a(Zo);Ts=i(nr,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A FAIRSEQ"),nr.forEach(t),bs=h(R),k(ce.$$.fragment,R),vs=h(R),Y=s(R,"P",{});var wo=a(Y);ks=i(wo,"If "),Qo=s(wo,"CODE",{});var sr=a(Qo);ys=i(sr,"token_ids_1"),sr.forEach(t),Ms=i(wo," is "),Xo=s(wo,"CODE",{});var ar=a(Xo);ws=i(ar,"None"),ar.forEach(t),Fs=i(wo,", this method only returns the first portion of the mask (0s)."),wo.forEach(t),Ss=h(R),Ho=s(R,"P",{});var rr=a(Ho);$s=i(rr,`Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An
FAIRSEQ_TRANSFORMER sequence pair mask has the following format:`),rr.forEach(t),R.forEach(t),Es=h($),uo=s($,"DIV",{class:!0});var ir=a(uo);k(We.$$.fragment,ir),ir.forEach(t),$.forEach(t),yt=h(o),K=s(o,"H2",{class:!0});var Ut=a(K);he=s(Ut,"A",{id:!0,class:!0,href:!0});var dr=a(he);Yo=s(dr,"SPAN",{});var lr=a(Yo);k(Ge.$$.fragment,lr),lr.forEach(t),dr.forEach(t),Cs=h(Ut),Ko=s(Ut,"SPAN",{});var cr=a(Ko);zs=i(cr,"FSMTModel"),cr.forEach(t),Ut.forEach(t),Mt=h(o),E=s(o,"DIV",{class:!0});var W=a(E);k(Oe.$$.fragment,W),xs=h(W),et=s(W,"P",{});var hr=a(et);qs=i(hr,"The bare FSMT Model outputting raw hidden-states without any specific head on top."),hr.forEach(t),Is=h(W),Ve=s(W,"P",{});var Dt=a(Ve);As=i(Dt,"This model inherits from "),fo=s(Dt,"A",{href:!0});var pr=a(fo);js=i(pr,"PreTrainedModel"),pr.forEach(t),Ns=i(Dt,`. 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.)`),Dt.forEach(t),Us=h(W),Be=s(W,"P",{});var Pt=a(Be);Ds=i(Pt,"This model is also a PyTorch "),Je=s(Pt,"A",{href:!0,rel:!0});var mr=a(Je);Ps=i(mr,"torch.nn.Module"),mr.forEach(t),Rs=i(Pt,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Pt.forEach(t),Ws=h(W),I=s(W,"DIV",{class:!0});var ke=a(I);k(Le.$$.fragment,ke),Gs=h(ke),ee=s(ke,"P",{});var Fo=a(ee);Os=i(Fo,"The "),_o=s(Fo,"A",{href:!0});var ur=a(_o);Vs=i(ur,"FSMTModel"),ur.forEach(t),Bs=i(Fo," forward method, overrides the "),ot=s(Fo,"CODE",{});var fr=a(ot);Js=i(fr,"__call__"),fr.forEach(t),Ls=i(Fo," special method."),Fo.forEach(t),Zs=h(ke),k(pe.$$.fragment,ke),Qs=h(ke),k(me.$$.fragment,ke),ke.forEach(t),W.forEach(t),wt=h(o),oe=s(o,"H2",{class:!0});var Rt=a(oe);ue=s(Rt,"A",{id:!0,class:!0,href:!0});var _r=a(ue);tt=s(_r,"SPAN",{});var gr=a(tt);k(Ze.$$.fragment,gr),gr.forEach(t),_r.forEach(t),Xs=h(Rt),nt=s(Rt,"SPAN",{});var Tr=a(nt);Hs=i(Tr,"FSMTForConditionalGeneration"),Tr.forEach(t),Rt.forEach(t),Ft=h(o),C=s(o,"DIV",{class:!0});var G=a(C);k(Qe.$$.fragment,G),Ys=h(G),st=s(G,"P",{});var br=a(st);Ks=i(br,"The FSMT Model with a language modeling head. Can be used for summarization."),br.forEach(t),ea=h(G),Xe=s(G,"P",{});var Wt=a(Xe);oa=i(Wt,"This model inherits from "),go=s(Wt,"A",{href:!0});var vr=a(go);ta=i(vr,"PreTrainedModel"),vr.forEach(t),na=i(Wt,`. 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.)`),Wt.forEach(t),sa=h(G),He=s(G,"P",{});var Gt=a(He);aa=i(Gt,"This model is also a PyTorch "),Ye=s(Gt,"A",{href:!0,rel:!0});var kr=a(Ye);ra=i(kr,"torch.nn.Module"),kr.forEach(t),ia=i(Gt,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Gt.forEach(t),da=h(G),A=s(G,"DIV",{class:!0});var ye=a(A);k(Ke.$$.fragment,ye),la=h(ye),te=s(ye,"P",{});var So=a(te);ca=i(So,"The "),To=s(So,"A",{href:!0});var yr=a(To);ha=i(yr,"FSMTForConditionalGeneration"),yr.forEach(t),pa=i(So," forward method, overrides the "),at=s(So,"CODE",{});var Mr=a(at);ma=i(Mr,"__call__"),Mr.forEach(t),ua=i(So," special method."),So.forEach(t),fa=h(ye),k(fe.$$.fragment,ye),_a=h(ye),k(_e.$$.fragment,ye),ye.forEach(t),G.forEach(t),this.h()},h(){l(p,"name","hf:doc:metadata"),l(p,"content",JSON.stringify(Ur)),l(u,"id","fsmt"),l(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(u,"href","#fsmt"),l(g,"class","relative group"),l(Me,"href","https://github.com/huggingface/transformers/issues/new?assignees=&labels=&template=bug-report.md&title"),l(Me,"rel","nofollow"),l(ne,"id","overview"),l(ne,"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(ne,"href","#overview"),l(B,"class","relative group"),l(Fe,"href","https://arxiv.org/abs/1907.06616"),l(Fe,"rel","nofollow"),l(Se,"href","https://huggingface.co/stas"),l(Se,"rel","nofollow"),l($e,"href","https://github.com/pytorch/fairseq/tree/master/examples/wmt19"),l($e,"rel","nofollow"),l(ae,"id","implementation-notes"),l(ae,"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(ae,"href","#implementation-notes"),l(J,"class","relative group"),l(ao,"href","/docs/transformers/v4.32.0/en/model_doc/xlm#transformers.XLMTokenizer"),l(ro,"href","/docs/transformers/v4.32.0/en/model_doc/bart#transformers.BartModel"),l(re,"id","transformers.FSMTConfig"),l(re,"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(re,"href","#transformers.FSMTConfig"),l(Z,"class","relative group"),l(io,"href","/docs/transformers/v4.32.0/en/model_doc/fsmt#transformers.FSMTModel"),l(xe,"href","https://huggingface.co/facebook/wmt19-en-ru"),l(xe,"rel","nofollow"),l(lo,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(co,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(de,"id","transformers.FSMTTokenizer"),l(de,"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(de,"href","#transformers.FSMTTokenizer"),l(H,"class","relative group"),l(ho,"href","/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),l(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(uo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(he,"id","transformers.FSMTModel"),l(he,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(he,"href","#transformers.FSMTModel"),l(K,"class","relative group"),l(fo,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),l(Je,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Je,"rel","nofollow"),l(_o,"href","/docs/transformers/v4.32.0/en/model_doc/fsmt#transformers.FSMTModel"),l(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ue,"id","transformers.FSMTForConditionalGeneration"),l(ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ue,"href","#transformers.FSMTForConditionalGeneration"),l(oe,"class","relative group"),l(go,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),l(Ye,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Ye,"rel","nofollow"),l(To,"href","/docs/transformers/v4.32.0/en/model_doc/fsmt#transformers.FSMTForConditionalGeneration"),l(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(C,"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,p),_(o,b,m),_(o,g,m),e(g,u),e(u,T),y(d,T,null),e(g,f),e(g,j),e(j,Jt),_(o,ct,m),_(o,V,m),e(V,$o),e($o,Lt),e(V,Zt),e(V,Me),e(Me,Qt),e(V,Xt),_(o,ht,m),_(o,B,m),e(B,ne),e(ne,Eo),y(we,Eo,null),e(B,Ht),e(B,Co),e(Co,Yt),_(o,pt,m),_(o,se,m),e(se,Kt),e(se,Fe),e(Fe,en),e(se,on),_(o,mt,m),_(o,to,m),e(to,tn),_(o,ut,m),_(o,no,m),e(no,zo),e(zo,nn),_(o,ft,m),_(o,D,m),e(D,sn),e(D,Se),e(Se,an),e(D,rn),e(D,$e),e($e,dn),e(D,ln),_(o,_t,m),_(o,J,m),e(J,ae),e(ae,xo),y(Ee,xo,null),e(J,cn),e(J,qo),e(qo,hn),_(o,gt,m),_(o,so,m),e(so,L),e(L,pn),e(L,ao),e(ao,mn),e(L,un),e(L,ro),e(ro,fn),e(L,_n),_(o,Tt,m),_(o,Z,m),e(Z,re),e(re,Io),y(Ce,Io,null),e(Z,gn),e(Z,Ao),e(Ao,Tn),_(o,bt,m),_(o,q,m),y(ze,q,null),e(q,bn),e(q,Q),e(Q,vn),e(Q,io),e(io,kn),e(Q,yn),e(Q,xe),e(xe,Mn),e(Q,wn),e(q,Fn),e(q,X),e(X,Sn),e(X,lo),e(lo,$n),e(X,En),e(X,co),e(co,Cn),e(X,zn),e(q,xn),y(ie,q,null),_(o,vt,m),_(o,H,m),e(H,de),e(de,jo),y(qe,jo,null),e(H,qn),e(H,No),e(No,In),_(o,kt,m),_(o,S,m),y(Ie,S,null),e(S,An),e(S,Uo),e(Uo,jn),e(S,Nn),e(S,N),e(N,Do),e(Do,Un),e(N,Dn),e(N,Po),e(Po,Pn),e(N,Rn),e(N,U),e(U,Wn),e(U,Ro),e(Ro,Gn),e(U,On),e(U,Wo),e(Wo,Vn),e(U,Bn),e(U,Go),e(Go,Jn),e(U,Ln),e(N,Zn),e(N,Ae),e(Ae,Qn),e(Ae,Oo),e(Oo,Xn),e(Ae,Hn),e(S,Yn),e(S,je),e(je,Kn),e(je,ho),e(ho,es),e(je,os),e(S,ts),e(S,P),y(Ne,P,null),e(P,ns),e(P,Vo),e(Vo,ss),e(P,as),e(P,Ue),e(Ue,po),e(po,rs),e(po,Bo),e(Bo,is),e(Ue,ds),e(Ue,mo),e(mo,ls),e(mo,Jo),e(Jo,cs),e(S,hs),e(S,le),y(De,le,null),e(le,ps),e(le,Pe),e(Pe,ms),e(Pe,Lo),e(Lo,us),e(Pe,fs),e(S,_s),e(S,x),y(Re,x,null),e(x,gs),e(x,Zo),e(Zo,Ts),e(x,bs),y(ce,x,null),e(x,vs),e(x,Y),e(Y,ks),e(Y,Qo),e(Qo,ys),e(Y,Ms),e(Y,Xo),e(Xo,ws),e(Y,Fs),e(x,Ss),e(x,Ho),e(Ho,$s),e(S,Es),e(S,uo),y(We,uo,null),_(o,yt,m),_(o,K,m),e(K,he),e(he,Yo),y(Ge,Yo,null),e(K,Cs),e(K,Ko),e(Ko,zs),_(o,Mt,m),_(o,E,m),y(Oe,E,null),e(E,xs),e(E,et),e(et,qs),e(E,Is),e(E,Ve),e(Ve,As),e(Ve,fo),e(fo,js),e(Ve,Ns),e(E,Us),e(E,Be),e(Be,Ds),e(Be,Je),e(Je,Ps),e(Be,Rs),e(E,Ws),e(E,I),y(Le,I,null),e(I,Gs),e(I,ee),e(ee,Os),e(ee,_o),e(_o,Vs),e(ee,Bs),e(ee,ot),e(ot,Js),e(ee,Ls),e(I,Zs),y(pe,I,null),e(I,Qs),y(me,I,null),_(o,wt,m),_(o,oe,m),e(oe,ue),e(ue,tt),y(Ze,tt,null),e(oe,Xs),e(oe,nt),e(nt,Hs),_(o,Ft,m),_(o,C,m),y(Qe,C,null),e(C,Ys),e(C,st),e(st,Ks),e(C,ea),e(C,Xe),e(Xe,oa),e(Xe,go),e(go,ta),e(Xe,na),e(C,sa),e(C,He),e(He,aa),e(He,Ye),e(Ye,ra),e(He,ia),e(C,da),e(C,A),y(Ke,A,null),e(A,la),e(A,te),e(te,ca),e(te,To),e(To,ha),e(te,pa),e(te,at),e(at,ma),e(te,ua),e(A,fa),y(fe,A,null),e(A,_a),y(_e,A,null),St=!0},p(o,[m]){const eo={};m&2&&(eo.$$scope={dirty:m,ctx:o}),ie.$set(eo);const rt={};m&2&&(rt.$$scope={dirty:m,ctx:o}),ce.$set(rt);const it={};m&2&&(it.$$scope={dirty:m,ctx:o}),pe.$set(it);const dt={};m&2&&(dt.$$scope={dirty:m,ctx:o}),me.$set(dt);const ge={};m&2&&(ge.$$scope={dirty:m,ctx:o}),fe.$set(ge);const lt={};m&2&&(lt.$$scope={dirty:m,ctx:o}),_e.$set(lt)},i(o){St||(M(d.$$.fragment,o),M(we.$$.fragment,o),M(Ee.$$.fragment,o),M(Ce.$$.fragment,o),M(ze.$$.fragment,o),M(ie.$$.fragment,o),M(qe.$$.fragment,o),M(Ie.$$.fragment,o),M(Ne.$$.fragment,o),M(De.$$.fragment,o),M(Re.$$.fragment,o),M(ce.$$.fragment,o),M(We.$$.fragment,o),M(Ge.$$.fragment,o),M(Oe.$$.fragment,o),M(Le.$$.fragment,o),M(pe.$$.fragment,o),M(me.$$.fragment,o),M(Ze.$$.fragment,o),M(Qe.$$.fragment,o),M(Ke.$$.fragment,o),M(fe.$$.fragment,o),M(_e.$$.fragment,o),St=!0)},o(o){w(d.$$.fragment,o),w(we.$$.fragment,o),w(Ee.$$.fragment,o),w(Ce.$$.fragment,o),w(ze.$$.fragment,o),w(ie.$$.fragment,o),w(qe.$$.fragment,o),w(Ie.$$.fragment,o),w(Ne.$$.fragment,o),w(De.$$.fragment,o),w(Re.$$.fragment,o),w(ce.$$.fragment,o),w(We.$$.fragment,o),w(Ge.$$.fragment,o),w(Oe.$$.fragment,o),w(Le.$$.fragment,o),w(pe.$$.fragment,o),w(me.$$.fragment,o),w(Ze.$$.fragment,o),w(Qe.$$.fragment,o),w(Ke.$$.fragment,o),w(fe.$$.fragment,o),w(_e.$$.fragment,o),St=!1},d(o){t(p),o&&t(b),o&&t(g),F(d),o&&t(ct),o&&t(V),o&&t(ht),o&&t(B),F(we),o&&t(pt),o&&t(se),o&&t(mt),o&&t(to),o&&t(ut),o&&t(no),o&&t(ft),o&&t(D),o&&t(_t),o&&t(J),F(Ee),o&&t(gt),o&&t(so),o&&t(Tt),o&&t(Z),F(Ce),o&&t(bt),o&&t(q),F(ze),F(ie),o&&t(vt),o&&t(H),F(qe),o&&t(kt),o&&t(S),F(Ie),F(Ne),F(De),F(Re),F(ce),F(We),o&&t(yt),o&&t(K),F(Ge),o&&t(Mt),o&&t(E),F(Oe),F(Le),F(pe),F(me),o&&t(wt),o&&t(oe),F(Ze),o&&t(Ft),o&&t(C),F(Qe),F(Ke),F(fe),F(_e)}}}const Ur={local:"fsmt",sections:[{local:"overview",title:"Overview"},{local:"implementation-notes",title:"Implementation Notes"},{local:"transformers.FSMTConfig",title:"FSMTConfig"},{local:"transformers.FSMTTokenizer",title:"FSMTTokenizer"},{local:"transformers.FSMTModel",title:"FSMTModel"},{local:"transformers.FSMTForConditionalGeneration",title:"FSMTForConditionalGeneration"}],title:"FSMT"};function Dr(z){return Cr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Br extends Fr{constructor(p){super();Sr(this,p,Dr,Nr,$r,{})}}export{Br as default,Ur as metadata};
