import{S as Wr,i as Or,s as Gr,e as n,k as c,w as v,t as r,M as Vr,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 Jr,L as Ht}from"../../chunks/vendor-hf-doc-builder.js";import{T as Rr}from"../../chunks/Tip-hf-doc-builder.js";import{D as U}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Yt}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as so}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Xt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Br(x){let p,T,g,f,b;return f=new Yt({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"),T=r("Examples:"),g=c(),v(f.$$.fragment)},l(d){p=s(d,"P",{});var u=a(p);T=i(u,"Examples:"),u.forEach(t),g=h(d),k(f.$$.fragment,d)},m(d,u){_(d,p,u),e(p,T),_(d,g,u),y(f,d,u),b=!0},p:Ht,i(d){b||(M(f.$$.fragment,d),b=!0)},o(d){w(f.$$.fragment,d),b=!1},d(d){d&&t(p),d&&t(g),F(f,d)}}}function Lr(x){let p,T,g,f,b;return f=new Yt({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"),T=r("Transformer sequence pair mask has the following format:"),g=c(),v(f.$$.fragment)},l(d){p=s(d,"P",{});var u=a(p);T=i(u,"Transformer sequence pair mask has the following format:"),u.forEach(t),g=h(d),k(f.$$.fragment,d)},m(d,u){_(d,p,u),e(p,T),_(d,g,u),y(f,d,u),b=!0},p:Ht,i(d){b||(M(f.$$.fragment,d),b=!0)},o(d){w(f.$$.fragment,d),b=!1},d(d){d&&t(p),d&&t(g),F(f,d)}}}function Zr(x){let p,T,g,f,b;return{c(){p=n("p"),T=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),f=r("Module"),b=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 u=a(p);T=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(u,"CODE",{});var j=a(g);f=i(j,"Module"),j.forEach(t),b=i(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){_(d,p,u),e(p,T),e(p,g),e(g,f),e(p,b)},d(d){d&&t(p)}}}function Qr(x){let p,T,g,f,b;return f=new Yt({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"),T=r("Example:"),g=c(),v(f.$$.fragment)},l(d){p=s(d,"P",{});var u=a(p);T=i(u,"Example:"),u.forEach(t),g=h(d),k(f.$$.fragment,d)},m(d,u){_(d,p,u),e(p,T),_(d,g,u),y(f,d,u),b=!0},p:Ht,i(d){b||(M(f.$$.fragment,d),b=!0)},o(d){w(f.$$.fragment,d),b=!1},d(d){d&&t(p),d&&t(g),F(f,d)}}}function Xr(x){let p,T,g,f,b;return{c(){p=n("p"),T=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),f=r("Module"),b=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 u=a(p);T=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(u,"CODE",{});var j=a(g);f=i(j,"Module"),j.forEach(t),b=i(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){_(d,p,u),e(p,T),e(p,g),e(g,f),e(p,b)},d(d){d&&t(p)}}}function Hr(x){let p,T,g,f,b;return f=new Yt({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"),T=r("Translation example::"),g=c(),v(f.$$.fragment)},l(d){p=s(d,"P",{});var u=a(p);T=i(u,"Translation example::"),u.forEach(t),g=h(d),k(f.$$.fragment,d)},m(d,u){_(d,p,u),e(p,T),_(d,g,u),y(f,d,u),b=!0},p:Ht,i(d){b||(M(f.$$.fragment,d),b=!0)},o(d){w(f.$$.fragment,d),b=!1},d(d){d&&t(p),d&&t(g),F(f,d)}}}function Yr(x){let p,T,g,f,b,d,u,j,Kt,_t,J,xo,en,on,Fe,tn,nn,gt,B,ae,qo,Se,sn,Io,an,bt,re,rn,$e,dn,ln,Tt,ao,cn,vt,ro,Ao,hn,kt,P,pn,Ee,mn,fn,Ce,un,_n,yt,L,ie,jo,ze,gn,Do,bn,Mt,io,Z,Tn,lo,vn,kn,co,yn,Mn,wt,Q,de,No,xe,wn,Uo,Fn,Ft,E,qe,Sn,X,$n,ho,En,Cn,Ie,zn,xn,qn,H,In,po,An,jn,mo,Dn,Nn,Un,le,Pn,ce,Ae,Rn,Y,Wn,Po,On,Gn,Ro,Vn,Jn,St,K,he,Wo,je,Bn,Oo,Ln,$t,S,De,Zn,Go,Qn,Xn,D,Vo,Hn,Yn,Jo,Kn,es,N,os,Bo,ts,ns,Lo,ss,as,Zo,rs,is,ds,Ne,ls,Qo,cs,hs,ps,Ue,ms,fo,fs,us,_s,R,Pe,gs,Xo,bs,Ts,Re,uo,vs,Ho,ks,ys,_o,Ms,Yo,ws,Fs,pe,We,Ss,Oe,$s,Ko,Es,Cs,zs,q,Ge,xs,et,qs,Is,me,As,ee,js,ot,Ds,Ns,tt,Us,Ps,Rs,nt,Ws,Os,go,Ve,Et,oe,fe,st,Je,Gs,at,Vs,Ct,C,Be,Js,rt,Bs,Ls,Le,Zs,bo,Qs,Xs,Hs,Ze,Ys,Qe,Ks,ea,oa,I,Xe,ta,te,na,To,sa,aa,it,ra,ia,da,ue,la,_e,zt,ne,ge,dt,He,ca,lt,ha,xt,z,Ye,pa,ct,ma,fa,Ke,ua,vo,_a,ga,ba,eo,Ta,oo,va,ka,ya,A,to,Ma,se,wa,ko,Fa,Sa,ht,$a,Ea,Ca,be,za,Te,qt;return d=new so({}),Se=new so({}),ze=new so({}),xe=new so({}),qe=new U({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.30.0/src/transformers/models/fsmt/configuration_fsmt.py#L41"}}),le=new Xt({props:{anchor:"transformers.FSMTConfig.example",$$slots:{default:[Br]},$$scope:{ctx:x}}}),Ae=new U({props:{name:"to_dict",anchor:"transformers.FSMTConfig.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/fsmt/configuration_fsmt.py#L220",returnDescription:`
<p>Dictionary of all the attributes that make up this configuration instance,</p>
`,returnType:`
<p><code>Dict[str, any]</code></p>
`}}),je=new so({}),De=new U({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.30.0/src/transformers/models/fsmt/tokenization_fsmt.py#L135"}}),Pe=new U({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.30.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>
`}}),We=new U({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.30.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>
`}}),Ge=new U({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.30.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>
`}}),me=new Xt({props:{anchor:"transformers.FSMTTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[Lr]},$$scope:{ctx:x}}}),Ve=new U({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.30.0/src/transformers/models/fsmt/tokenization_fsmt.py#L491"}}),Je=new so({}),Be=new U({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.30.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.30.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.30.0/src/transformers/models/fsmt/modeling_fsmt.py#L1036"}}),Xe=new U({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.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.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.30.0/src/transformers/models/fsmt/modeling_fsmt.py#L1058",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.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.30.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.30.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ue=new Rr({props:{$$slots:{default:[Zr]},$$scope:{ctx:x}}}),_e=new Xt({props:{anchor:"transformers.FSMTModel.forward.example",$$slots:{default:[Qr]},$$scope:{ctx:x}}}),He=new so({}),Ye=new U({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.30.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.30.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.30.0/src/transformers/models/fsmt/modeling_fsmt.py#L1172"}}),to=new U({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.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.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.30.0/src/transformers/models/fsmt/modeling_fsmt.py#L1192",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.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.30.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.30.0/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),be=new Rr({props:{$$slots:{default:[Xr]},$$scope:{ctx:x}}}),Te=new Xt({props:{anchor:"transformers.FSMTForConditionalGeneration.forward.example",$$slots:{default:[Hr]},$$scope:{ctx:x}}}),{c(){p=n("meta"),T=c(),g=n("h1"),f=n("a"),b=n("span"),v(d.$$.fragment),u=c(),j=n("span"),Kt=r("FSMT"),_t=c(),J=n("p"),xo=n("strong"),en=r("DISCLAIMER:"),on=r(" If you see something strange, file a "),Fe=n("a"),tn=r("Github Issue"),nn=r(` and assign
@stas00.`),gt=c(),B=n("h2"),ae=n("a"),qo=n("span"),v(Se.$$.fragment),sn=c(),Io=n("span"),an=r("Overview"),bt=c(),re=n("p"),rn=r("FSMT (FairSeq MachineTranslation) models were introduced in "),$e=n("a"),dn=r("Facebook FAIR\u2019s WMT19 News Translation Task Submission"),ln=r(" by Nathan Ng, Kyra Yee, Alexei Baevski, Myle Ott, Michael Auli, Sergey Edunov."),Tt=c(),ao=n("p"),cn=r("The abstract of the paper is the following:"),vt=c(),ro=n("p"),Ao=n("em"),hn=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.`),kt=c(),P=n("p"),pn=r("This model was contributed by "),Ee=n("a"),mn=r("stas"),fn=r(`. The original code can be found
`),Ce=n("a"),un=r("here"),_n=r("."),yt=c(),L=n("h2"),ie=n("a"),jo=n("span"),v(ze.$$.fragment),gn=c(),Do=n("span"),bn=r("Implementation Notes"),Mt=c(),io=n("ul"),Z=n("li"),Tn=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 `),lo=n("a"),vn=r("XLMTokenizer"),kn=r(` and the main model is derived from
`),co=n("a"),yn=r("BartModel"),Mn=r("."),wt=c(),Q=n("h2"),de=n("a"),No=n("span"),v(xe.$$.fragment),wn=c(),Uo=n("span"),Fn=r("FSMTConfig"),Ft=c(),E=n("div"),v(qe.$$.fragment),Sn=c(),X=n("p"),$n=r("This is the configuration class to store the configuration of a "),ho=n("a"),En=r("FSMTModel"),Cn=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
`),Ie=n("a"),zn=r("facebook/wmt19-en-ru"),xn=r(" architecture."),qn=c(),H=n("p"),In=r("Configuration objects inherit from "),po=n("a"),An=r("PretrainedConfig"),jn=r(` and can be used to control the model outputs. Read the
documentation from `),mo=n("a"),Dn=r("PretrainedConfig"),Nn=r(" for more information."),Un=c(),v(le.$$.fragment),Pn=c(),ce=n("div"),v(Ae.$$.fragment),Rn=c(),Y=n("p"),Wn=r("Serializes this instance to a Python dictionary. Override the default "),Po=n("em"),On=r("to_dict()"),Gn=r(" from "),Ro=n("em"),Vn=r("PretrainedConfig"),Jn=r("."),St=c(),K=n("h2"),he=n("a"),Wo=n("span"),v(je.$$.fragment),Bn=c(),Oo=n("span"),Ln=r("FSMTTokenizer"),$t=c(),S=n("div"),v(De.$$.fragment),Zn=c(),Go=n("p"),Qn=r("Construct an FAIRSEQ Transformer tokenizer. Based on Byte-Pair Encoding. The tokenization process is the following:"),Xn=c(),D=n("ul"),Vo=n("li"),Hn=r("Moses preprocessing and tokenization."),Yn=c(),Jo=n("li"),Kn=r("Normalizing all inputs text."),es=c(),N=n("li"),os=r("The arguments "),Bo=n("code"),ts=r("special_tokens"),ns=r(" and the function "),Lo=n("code"),ss=r("set_special_tokens"),as=r(`, can be used to add additional symbols (like
\u201D`),Zo=n("strong"),rs=r("classify"),is=r("\u201D) to a vocabulary."),ds=c(),Ne=n("li"),ls=r("The argument "),Qo=n("code"),cs=r("langs"),hs=r(" defines a pair of languages."),ps=c(),Ue=n("p"),ms=r("This tokenizer inherits from "),fo=n("a"),fs=r("PreTrainedTokenizer"),us=r(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),_s=c(),R=n("div"),v(Pe.$$.fragment),gs=c(),Xo=n("p"),bs=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:`),Ts=c(),Re=n("ul"),uo=n("li"),vs=r("single sequence: "),Ho=n("code"),ks=r("<s> X </s>"),ys=c(),_o=n("li"),Ms=r("pair of sequences: "),Yo=n("code"),ws=r("<s> A </s> B </s>"),Fs=c(),pe=n("div"),v(We.$$.fragment),Ss=c(),Oe=n("p"),$s=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 `),Ko=n("code"),Es=r("prepare_for_model"),Cs=r(" method."),zs=c(),q=n("div"),v(Ge.$$.fragment),xs=c(),et=n("p"),qs=r("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A FAIRSEQ"),Is=c(),v(me.$$.fragment),As=c(),ee=n("p"),js=r("If "),ot=n("code"),Ds=r("token_ids_1"),Ns=r(" is "),tt=n("code"),Us=r("None"),Ps=r(", this method only returns the first portion of the mask (0s)."),Rs=c(),nt=n("p"),Ws=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:`),Os=c(),go=n("div"),v(Ve.$$.fragment),Et=c(),oe=n("h2"),fe=n("a"),st=n("span"),v(Je.$$.fragment),Gs=c(),at=n("span"),Vs=r("FSMTModel"),Ct=c(),C=n("div"),v(Be.$$.fragment),Js=c(),rt=n("p"),Bs=r("The bare FSMT Model outputting raw hidden-states without any specific head on top."),Ls=c(),Le=n("p"),Zs=r("This model inherits from "),bo=n("a"),Qs=r("PreTrainedModel"),Xs=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.)`),Hs=c(),Ze=n("p"),Ys=r("This model is also a PyTorch "),Qe=n("a"),Ks=r("torch.nn.Module"),ea=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),oa=c(),I=n("div"),v(Xe.$$.fragment),ta=c(),te=n("p"),na=r("The "),To=n("a"),sa=r("FSMTModel"),aa=r(" forward method, overrides the "),it=n("code"),ra=r("__call__"),ia=r(" special method."),da=c(),v(ue.$$.fragment),la=c(),v(_e.$$.fragment),zt=c(),ne=n("h2"),ge=n("a"),dt=n("span"),v(He.$$.fragment),ca=c(),lt=n("span"),ha=r("FSMTForConditionalGeneration"),xt=c(),z=n("div"),v(Ye.$$.fragment),pa=c(),ct=n("p"),ma=r("The FSMT Model with a language modeling head. Can be used for summarization."),fa=c(),Ke=n("p"),ua=r("This model inherits from "),vo=n("a"),_a=r("PreTrainedModel"),ga=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.)`),ba=c(),eo=n("p"),Ta=r("This model is also a PyTorch "),oo=n("a"),va=r("torch.nn.Module"),ka=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ya=c(),A=n("div"),v(to.$$.fragment),Ma=c(),se=n("p"),wa=r("The "),ko=n("a"),Fa=r("FSMTForConditionalGeneration"),Sa=r(" forward method, overrides the "),ht=n("code"),$a=r("__call__"),Ea=r(" special method."),Ca=c(),v(be.$$.fragment),za=c(),v(Te.$$.fragment),this.h()},l(o){const m=Vr('[data-svelte="svelte-1phssyn"]',document.head);p=s(m,"META",{name:!0,content:!0}),m.forEach(t),T=h(o),g=s(o,"H1",{class:!0});var no=a(g);f=s(no,"A",{id:!0,class:!0,href:!0});var pt=a(f);b=s(pt,"SPAN",{});var mt=a(b);k(d.$$.fragment,mt),mt.forEach(t),pt.forEach(t),u=h(no),j=s(no,"SPAN",{});var ft=a(j);Kt=i(ft,"FSMT"),ft.forEach(t),no.forEach(t),_t=h(o),J=s(o,"P",{});var ve=a(J);xo=s(ve,"STRONG",{});var ut=a(xo);en=i(ut,"DISCLAIMER:"),ut.forEach(t),on=i(ve," If you see something strange, file a "),Fe=s(ve,"A",{href:!0,rel:!0});var Ia=a(Fe);tn=i(Ia,"Github Issue"),Ia.forEach(t),nn=i(ve,` and assign
@stas00.`),ve.forEach(t),gt=h(o),B=s(o,"H2",{class:!0});var It=a(B);ae=s(It,"A",{id:!0,class:!0,href:!0});var Aa=a(ae);qo=s(Aa,"SPAN",{});var ja=a(qo);k(Se.$$.fragment,ja),ja.forEach(t),Aa.forEach(t),sn=h(It),Io=s(It,"SPAN",{});var Da=a(Io);an=i(Da,"Overview"),Da.forEach(t),It.forEach(t),bt=h(o),re=s(o,"P",{});var At=a(re);rn=i(At,"FSMT (FairSeq MachineTranslation) models were introduced in "),$e=s(At,"A",{href:!0,rel:!0});var Na=a($e);dn=i(Na,"Facebook FAIR\u2019s WMT19 News Translation Task Submission"),Na.forEach(t),ln=i(At," by Nathan Ng, Kyra Yee, Alexei Baevski, Myle Ott, Michael Auli, Sergey Edunov."),At.forEach(t),Tt=h(o),ao=s(o,"P",{});var Ua=a(ao);cn=i(Ua,"The abstract of the paper is the following:"),Ua.forEach(t),vt=h(o),ro=s(o,"P",{});var Pa=a(ro);Ao=s(Pa,"EM",{});var Ra=a(Ao);hn=i(Ra,`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.`),Ra.forEach(t),Pa.forEach(t),kt=h(o),P=s(o,"P",{});var yo=a(P);pn=i(yo,"This model was contributed by "),Ee=s(yo,"A",{href:!0,rel:!0});var Wa=a(Ee);mn=i(Wa,"stas"),Wa.forEach(t),fn=i(yo,`. The original code can be found
`),Ce=s(yo,"A",{href:!0,rel:!0});var Oa=a(Ce);un=i(Oa,"here"),Oa.forEach(t),_n=i(yo,"."),yo.forEach(t),yt=h(o),L=s(o,"H2",{class:!0});var jt=a(L);ie=s(jt,"A",{id:!0,class:!0,href:!0});var Ga=a(ie);jo=s(Ga,"SPAN",{});var Va=a(jo);k(ze.$$.fragment,Va),Va.forEach(t),Ga.forEach(t),gn=h(jt),Do=s(jt,"SPAN",{});var Ja=a(Do);bn=i(Ja,"Implementation Notes"),Ja.forEach(t),jt.forEach(t),Mt=h(o),io=s(o,"UL",{});var Ba=a(io);Z=s(Ba,"LI",{});var Mo=a(Z);Tn=i(Mo,`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 `),lo=s(Mo,"A",{href:!0});var La=a(lo);vn=i(La,"XLMTokenizer"),La.forEach(t),kn=i(Mo,` and the main model is derived from
`),co=s(Mo,"A",{href:!0});var Za=a(co);yn=i(Za,"BartModel"),Za.forEach(t),Mn=i(Mo,"."),Mo.forEach(t),Ba.forEach(t),wt=h(o),Q=s(o,"H2",{class:!0});var Dt=a(Q);de=s(Dt,"A",{id:!0,class:!0,href:!0});var Qa=a(de);No=s(Qa,"SPAN",{});var Xa=a(No);k(xe.$$.fragment,Xa),Xa.forEach(t),Qa.forEach(t),wn=h(Dt),Uo=s(Dt,"SPAN",{});var Ha=a(Uo);Fn=i(Ha,"FSMTConfig"),Ha.forEach(t),Dt.forEach(t),Ft=h(o),E=s(o,"DIV",{class:!0});var W=a(E);k(qe.$$.fragment,W),Sn=h(W),X=s(W,"P",{});var wo=a(X);$n=i(wo,"This is the configuration class to store the configuration of a "),ho=s(wo,"A",{href:!0});var Ya=a(ho);En=i(Ya,"FSMTModel"),Ya.forEach(t),Cn=i(wo,`. 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
`),Ie=s(wo,"A",{href:!0,rel:!0});var Ka=a(Ie);zn=i(Ka,"facebook/wmt19-en-ru"),Ka.forEach(t),xn=i(wo," architecture."),wo.forEach(t),qn=h(W),H=s(W,"P",{});var Fo=a(H);In=i(Fo,"Configuration objects inherit from "),po=s(Fo,"A",{href:!0});var er=a(po);An=i(er,"PretrainedConfig"),er.forEach(t),jn=i(Fo,` and can be used to control the model outputs. Read the
documentation from `),mo=s(Fo,"A",{href:!0});var or=a(mo);Dn=i(or,"PretrainedConfig"),or.forEach(t),Nn=i(Fo," for more information."),Fo.forEach(t),Un=h(W),k(le.$$.fragment,W),Pn=h(W),ce=s(W,"DIV",{class:!0});var Nt=a(ce);k(Ae.$$.fragment,Nt),Rn=h(Nt),Y=s(Nt,"P",{});var So=a(Y);Wn=i(So,"Serializes this instance to a Python dictionary. Override the default "),Po=s(So,"EM",{});var tr=a(Po);On=i(tr,"to_dict()"),tr.forEach(t),Gn=i(So," from "),Ro=s(So,"EM",{});var nr=a(Ro);Vn=i(nr,"PretrainedConfig"),nr.forEach(t),Jn=i(So,"."),So.forEach(t),Nt.forEach(t),W.forEach(t),St=h(o),K=s(o,"H2",{class:!0});var Ut=a(K);he=s(Ut,"A",{id:!0,class:!0,href:!0});var sr=a(he);Wo=s(sr,"SPAN",{});var ar=a(Wo);k(je.$$.fragment,ar),ar.forEach(t),sr.forEach(t),Bn=h(Ut),Oo=s(Ut,"SPAN",{});var rr=a(Oo);Ln=i(rr,"FSMTTokenizer"),rr.forEach(t),Ut.forEach(t),$t=h(o),S=s(o,"DIV",{class:!0});var $=a(S);k(De.$$.fragment,$),Zn=h($),Go=s($,"P",{});var ir=a(Go);Qn=i(ir,"Construct an FAIRSEQ Transformer tokenizer. Based on Byte-Pair Encoding. The tokenization process is the following:"),ir.forEach(t),Xn=h($),D=s($,"UL",{});var ke=a(D);Vo=s(ke,"LI",{});var dr=a(Vo);Hn=i(dr,"Moses preprocessing and tokenization."),dr.forEach(t),Yn=h(ke),Jo=s(ke,"LI",{});var lr=a(Jo);Kn=i(lr,"Normalizing all inputs text."),lr.forEach(t),es=h(ke),N=s(ke,"LI",{});var ye=a(N);os=i(ye,"The arguments "),Bo=s(ye,"CODE",{});var cr=a(Bo);ts=i(cr,"special_tokens"),cr.forEach(t),ns=i(ye," and the function "),Lo=s(ye,"CODE",{});var hr=a(Lo);ss=i(hr,"set_special_tokens"),hr.forEach(t),as=i(ye,`, can be used to add additional symbols (like
\u201D`),Zo=s(ye,"STRONG",{});var pr=a(Zo);rs=i(pr,"classify"),pr.forEach(t),is=i(ye,"\u201D) to a vocabulary."),ye.forEach(t),ds=h(ke),Ne=s(ke,"LI",{});var Pt=a(Ne);ls=i(Pt,"The argument "),Qo=s(Pt,"CODE",{});var mr=a(Qo);cs=i(mr,"langs"),mr.forEach(t),hs=i(Pt," defines a pair of languages."),Pt.forEach(t),ke.forEach(t),ps=h($),Ue=s($,"P",{});var Rt=a(Ue);ms=i(Rt,"This tokenizer inherits from "),fo=s(Rt,"A",{href:!0});var fr=a(fo);fs=i(fr,"PreTrainedTokenizer"),fr.forEach(t),us=i(Rt,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Rt.forEach(t),_s=h($),R=s($,"DIV",{class:!0});var $o=a(R);k(Pe.$$.fragment,$o),gs=h($o),Xo=s($o,"P",{});var ur=a(Xo);bs=i(ur,`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:`),ur.forEach(t),Ts=h($o),Re=s($o,"UL",{});var Wt=a(Re);uo=s(Wt,"LI",{});var xa=a(uo);vs=i(xa,"single sequence: "),Ho=s(xa,"CODE",{});var _r=a(Ho);ks=i(_r,"<s> X </s>"),_r.forEach(t),xa.forEach(t),ys=h(Wt),_o=s(Wt,"LI",{});var qa=a(_o);Ms=i(qa,"pair of sequences: "),Yo=s(qa,"CODE",{});var gr=a(Yo);ws=i(gr,"<s> A </s> B </s>"),gr.forEach(t),qa.forEach(t),Wt.forEach(t),$o.forEach(t),Fs=h($),pe=s($,"DIV",{class:!0});var Ot=a(pe);k(We.$$.fragment,Ot),Ss=h(Ot),Oe=s(Ot,"P",{});var Gt=a(Oe);$s=i(Gt,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Ko=s(Gt,"CODE",{});var br=a(Ko);Es=i(br,"prepare_for_model"),br.forEach(t),Cs=i(Gt," method."),Gt.forEach(t),Ot.forEach(t),zs=h($),q=s($,"DIV",{class:!0});var O=a(q);k(Ge.$$.fragment,O),xs=h(O),et=s(O,"P",{});var Tr=a(et);qs=i(Tr,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A FAIRSEQ"),Tr.forEach(t),Is=h(O),k(me.$$.fragment,O),As=h(O),ee=s(O,"P",{});var Eo=a(ee);js=i(Eo,"If "),ot=s(Eo,"CODE",{});var vr=a(ot);Ds=i(vr,"token_ids_1"),vr.forEach(t),Ns=i(Eo," is "),tt=s(Eo,"CODE",{});var kr=a(tt);Us=i(kr,"None"),kr.forEach(t),Ps=i(Eo,", this method only returns the first portion of the mask (0s)."),Eo.forEach(t),Rs=h(O),nt=s(O,"P",{});var yr=a(nt);Ws=i(yr,`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:`),yr.forEach(t),O.forEach(t),Os=h($),go=s($,"DIV",{class:!0});var Mr=a(go);k(Ve.$$.fragment,Mr),Mr.forEach(t),$.forEach(t),Et=h(o),oe=s(o,"H2",{class:!0});var Vt=a(oe);fe=s(Vt,"A",{id:!0,class:!0,href:!0});var wr=a(fe);st=s(wr,"SPAN",{});var Fr=a(st);k(Je.$$.fragment,Fr),Fr.forEach(t),wr.forEach(t),Gs=h(Vt),at=s(Vt,"SPAN",{});var Sr=a(at);Vs=i(Sr,"FSMTModel"),Sr.forEach(t),Vt.forEach(t),Ct=h(o),C=s(o,"DIV",{class:!0});var G=a(C);k(Be.$$.fragment,G),Js=h(G),rt=s(G,"P",{});var $r=a(rt);Bs=i($r,"The bare FSMT Model outputting raw hidden-states without any specific head on top."),$r.forEach(t),Ls=h(G),Le=s(G,"P",{});var Jt=a(Le);Zs=i(Jt,"This model inherits from "),bo=s(Jt,"A",{href:!0});var Er=a(bo);Qs=i(Er,"PreTrainedModel"),Er.forEach(t),Xs=i(Jt,`. 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.)`),Jt.forEach(t),Hs=h(G),Ze=s(G,"P",{});var Bt=a(Ze);Ys=i(Bt,"This model is also a PyTorch "),Qe=s(Bt,"A",{href:!0,rel:!0});var Cr=a(Qe);Ks=i(Cr,"torch.nn.Module"),Cr.forEach(t),ea=i(Bt,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Bt.forEach(t),oa=h(G),I=s(G,"DIV",{class:!0});var Me=a(I);k(Xe.$$.fragment,Me),ta=h(Me),te=s(Me,"P",{});var Co=a(te);na=i(Co,"The "),To=s(Co,"A",{href:!0});var zr=a(To);sa=i(zr,"FSMTModel"),zr.forEach(t),aa=i(Co," forward method, overrides the "),it=s(Co,"CODE",{});var xr=a(it);ra=i(xr,"__call__"),xr.forEach(t),ia=i(Co," special method."),Co.forEach(t),da=h(Me),k(ue.$$.fragment,Me),la=h(Me),k(_e.$$.fragment,Me),Me.forEach(t),G.forEach(t),zt=h(o),ne=s(o,"H2",{class:!0});var Lt=a(ne);ge=s(Lt,"A",{id:!0,class:!0,href:!0});var qr=a(ge);dt=s(qr,"SPAN",{});var Ir=a(dt);k(He.$$.fragment,Ir),Ir.forEach(t),qr.forEach(t),ca=h(Lt),lt=s(Lt,"SPAN",{});var Ar=a(lt);ha=i(Ar,"FSMTForConditionalGeneration"),Ar.forEach(t),Lt.forEach(t),xt=h(o),z=s(o,"DIV",{class:!0});var V=a(z);k(Ye.$$.fragment,V),pa=h(V),ct=s(V,"P",{});var jr=a(ct);ma=i(jr,"The FSMT Model with a language modeling head. Can be used for summarization."),jr.forEach(t),fa=h(V),Ke=s(V,"P",{});var Zt=a(Ke);ua=i(Zt,"This model inherits from "),vo=s(Zt,"A",{href:!0});var Dr=a(vo);_a=i(Dr,"PreTrainedModel"),Dr.forEach(t),ga=i(Zt,`. 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.)`),Zt.forEach(t),ba=h(V),eo=s(V,"P",{});var Qt=a(eo);Ta=i(Qt,"This model is also a PyTorch "),oo=s(Qt,"A",{href:!0,rel:!0});var Nr=a(oo);va=i(Nr,"torch.nn.Module"),Nr.forEach(t),ka=i(Qt,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Qt.forEach(t),ya=h(V),A=s(V,"DIV",{class:!0});var we=a(A);k(to.$$.fragment,we),Ma=h(we),se=s(we,"P",{});var zo=a(se);wa=i(zo,"The "),ko=s(zo,"A",{href:!0});var Ur=a(ko);Fa=i(Ur,"FSMTForConditionalGeneration"),Ur.forEach(t),Sa=i(zo," forward method, overrides the "),ht=s(zo,"CODE",{});var Pr=a(ht);$a=i(Pr,"__call__"),Pr.forEach(t),Ea=i(zo," special method."),zo.forEach(t),Ca=h(we),k(be.$$.fragment,we),za=h(we),k(Te.$$.fragment,we),we.forEach(t),V.forEach(t),this.h()},h(){l(p,"name","hf:doc:metadata"),l(p,"content",JSON.stringify(Kr)),l(f,"id","fsmt"),l(f,"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(f,"href","#fsmt"),l(g,"class","relative group"),l(Fe,"href","https://github.com/huggingface/transformers/issues/new?assignees=&labels=&template=bug-report.md&title"),l(Fe,"rel","nofollow"),l(ae,"id","overview"),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","#overview"),l(B,"class","relative group"),l($e,"href","https://arxiv.org/abs/1907.06616"),l($e,"rel","nofollow"),l(Ee,"href","https://huggingface.co/stas"),l(Ee,"rel","nofollow"),l(Ce,"href","https://github.com/pytorch/fairseq/tree/master/examples/wmt19"),l(Ce,"rel","nofollow"),l(ie,"id","implementation-notes"),l(ie,"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(ie,"href","#implementation-notes"),l(L,"class","relative group"),l(lo,"href","/docs/transformers/v4.30.0/en/model_doc/xlm#transformers.XLMTokenizer"),l(co,"href","/docs/transformers/v4.30.0/en/model_doc/bart#transformers.BartModel"),l(de,"id","transformers.FSMTConfig"),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.FSMTConfig"),l(Q,"class","relative group"),l(ho,"href","/docs/transformers/v4.30.0/en/model_doc/fsmt#transformers.FSMTModel"),l(Ie,"href","https://huggingface.co/facebook/wmt19-en-ru"),l(Ie,"rel","nofollow"),l(po,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(mo,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(ce,"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(he,"id","transformers.FSMTTokenizer"),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.FSMTTokenizer"),l(K,"class","relative group"),l(fo,"href","/docs/transformers/v4.30.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),l(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(go,"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(fe,"id","transformers.FSMTModel"),l(fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(fe,"href","#transformers.FSMTModel"),l(oe,"class","relative group"),l(bo,"href","/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel"),l(Qe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Qe,"rel","nofollow"),l(To,"href","/docs/transformers/v4.30.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(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ge,"id","transformers.FSMTForConditionalGeneration"),l(ge,"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(ge,"href","#transformers.FSMTForConditionalGeneration"),l(ne,"class","relative group"),l(vo,"href","/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel"),l(oo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(oo,"rel","nofollow"),l(ko,"href","/docs/transformers/v4.30.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(z,"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,T,m),_(o,g,m),e(g,f),e(f,b),y(d,b,null),e(g,u),e(g,j),e(j,Kt),_(o,_t,m),_(o,J,m),e(J,xo),e(xo,en),e(J,on),e(J,Fe),e(Fe,tn),e(J,nn),_(o,gt,m),_(o,B,m),e(B,ae),e(ae,qo),y(Se,qo,null),e(B,sn),e(B,Io),e(Io,an),_(o,bt,m),_(o,re,m),e(re,rn),e(re,$e),e($e,dn),e(re,ln),_(o,Tt,m),_(o,ao,m),e(ao,cn),_(o,vt,m),_(o,ro,m),e(ro,Ao),e(Ao,hn),_(o,kt,m),_(o,P,m),e(P,pn),e(P,Ee),e(Ee,mn),e(P,fn),e(P,Ce),e(Ce,un),e(P,_n),_(o,yt,m),_(o,L,m),e(L,ie),e(ie,jo),y(ze,jo,null),e(L,gn),e(L,Do),e(Do,bn),_(o,Mt,m),_(o,io,m),e(io,Z),e(Z,Tn),e(Z,lo),e(lo,vn),e(Z,kn),e(Z,co),e(co,yn),e(Z,Mn),_(o,wt,m),_(o,Q,m),e(Q,de),e(de,No),y(xe,No,null),e(Q,wn),e(Q,Uo),e(Uo,Fn),_(o,Ft,m),_(o,E,m),y(qe,E,null),e(E,Sn),e(E,X),e(X,$n),e(X,ho),e(ho,En),e(X,Cn),e(X,Ie),e(Ie,zn),e(X,xn),e(E,qn),e(E,H),e(H,In),e(H,po),e(po,An),e(H,jn),e(H,mo),e(mo,Dn),e(H,Nn),e(E,Un),y(le,E,null),e(E,Pn),e(E,ce),y(Ae,ce,null),e(ce,Rn),e(ce,Y),e(Y,Wn),e(Y,Po),e(Po,On),e(Y,Gn),e(Y,Ro),e(Ro,Vn),e(Y,Jn),_(o,St,m),_(o,K,m),e(K,he),e(he,Wo),y(je,Wo,null),e(K,Bn),e(K,Oo),e(Oo,Ln),_(o,$t,m),_(o,S,m),y(De,S,null),e(S,Zn),e(S,Go),e(Go,Qn),e(S,Xn),e(S,D),e(D,Vo),e(Vo,Hn),e(D,Yn),e(D,Jo),e(Jo,Kn),e(D,es),e(D,N),e(N,os),e(N,Bo),e(Bo,ts),e(N,ns),e(N,Lo),e(Lo,ss),e(N,as),e(N,Zo),e(Zo,rs),e(N,is),e(D,ds),e(D,Ne),e(Ne,ls),e(Ne,Qo),e(Qo,cs),e(Ne,hs),e(S,ps),e(S,Ue),e(Ue,ms),e(Ue,fo),e(fo,fs),e(Ue,us),e(S,_s),e(S,R),y(Pe,R,null),e(R,gs),e(R,Xo),e(Xo,bs),e(R,Ts),e(R,Re),e(Re,uo),e(uo,vs),e(uo,Ho),e(Ho,ks),e(Re,ys),e(Re,_o),e(_o,Ms),e(_o,Yo),e(Yo,ws),e(S,Fs),e(S,pe),y(We,pe,null),e(pe,Ss),e(pe,Oe),e(Oe,$s),e(Oe,Ko),e(Ko,Es),e(Oe,Cs),e(S,zs),e(S,q),y(Ge,q,null),e(q,xs),e(q,et),e(et,qs),e(q,Is),y(me,q,null),e(q,As),e(q,ee),e(ee,js),e(ee,ot),e(ot,Ds),e(ee,Ns),e(ee,tt),e(tt,Us),e(ee,Ps),e(q,Rs),e(q,nt),e(nt,Ws),e(S,Os),e(S,go),y(Ve,go,null),_(o,Et,m),_(o,oe,m),e(oe,fe),e(fe,st),y(Je,st,null),e(oe,Gs),e(oe,at),e(at,Vs),_(o,Ct,m),_(o,C,m),y(Be,C,null),e(C,Js),e(C,rt),e(rt,Bs),e(C,Ls),e(C,Le),e(Le,Zs),e(Le,bo),e(bo,Qs),e(Le,Xs),e(C,Hs),e(C,Ze),e(Ze,Ys),e(Ze,Qe),e(Qe,Ks),e(Ze,ea),e(C,oa),e(C,I),y(Xe,I,null),e(I,ta),e(I,te),e(te,na),e(te,To),e(To,sa),e(te,aa),e(te,it),e(it,ra),e(te,ia),e(I,da),y(ue,I,null),e(I,la),y(_e,I,null),_(o,zt,m),_(o,ne,m),e(ne,ge),e(ge,dt),y(He,dt,null),e(ne,ca),e(ne,lt),e(lt,ha),_(o,xt,m),_(o,z,m),y(Ye,z,null),e(z,pa),e(z,ct),e(ct,ma),e(z,fa),e(z,Ke),e(Ke,ua),e(Ke,vo),e(vo,_a),e(Ke,ga),e(z,ba),e(z,eo),e(eo,Ta),e(eo,oo),e(oo,va),e(eo,ka),e(z,ya),e(z,A),y(to,A,null),e(A,Ma),e(A,se),e(se,wa),e(se,ko),e(ko,Fa),e(se,Sa),e(se,ht),e(ht,$a),e(se,Ea),e(A,Ca),y(be,A,null),e(A,za),y(Te,A,null),qt=!0},p(o,[m]){const no={};m&2&&(no.$$scope={dirty:m,ctx:o}),le.$set(no);const pt={};m&2&&(pt.$$scope={dirty:m,ctx:o}),me.$set(pt);const mt={};m&2&&(mt.$$scope={dirty:m,ctx:o}),ue.$set(mt);const ft={};m&2&&(ft.$$scope={dirty:m,ctx:o}),_e.$set(ft);const ve={};m&2&&(ve.$$scope={dirty:m,ctx:o}),be.$set(ve);const ut={};m&2&&(ut.$$scope={dirty:m,ctx:o}),Te.$set(ut)},i(o){qt||(M(d.$$.fragment,o),M(Se.$$.fragment,o),M(ze.$$.fragment,o),M(xe.$$.fragment,o),M(qe.$$.fragment,o),M(le.$$.fragment,o),M(Ae.$$.fragment,o),M(je.$$.fragment,o),M(De.$$.fragment,o),M(Pe.$$.fragment,o),M(We.$$.fragment,o),M(Ge.$$.fragment,o),M(me.$$.fragment,o),M(Ve.$$.fragment,o),M(Je.$$.fragment,o),M(Be.$$.fragment,o),M(Xe.$$.fragment,o),M(ue.$$.fragment,o),M(_e.$$.fragment,o),M(He.$$.fragment,o),M(Ye.$$.fragment,o),M(to.$$.fragment,o),M(be.$$.fragment,o),M(Te.$$.fragment,o),qt=!0)},o(o){w(d.$$.fragment,o),w(Se.$$.fragment,o),w(ze.$$.fragment,o),w(xe.$$.fragment,o),w(qe.$$.fragment,o),w(le.$$.fragment,o),w(Ae.$$.fragment,o),w(je.$$.fragment,o),w(De.$$.fragment,o),w(Pe.$$.fragment,o),w(We.$$.fragment,o),w(Ge.$$.fragment,o),w(me.$$.fragment,o),w(Ve.$$.fragment,o),w(Je.$$.fragment,o),w(Be.$$.fragment,o),w(Xe.$$.fragment,o),w(ue.$$.fragment,o),w(_e.$$.fragment,o),w(He.$$.fragment,o),w(Ye.$$.fragment,o),w(to.$$.fragment,o),w(be.$$.fragment,o),w(Te.$$.fragment,o),qt=!1},d(o){t(p),o&&t(T),o&&t(g),F(d),o&&t(_t),o&&t(J),o&&t(gt),o&&t(B),F(Se),o&&t(bt),o&&t(re),o&&t(Tt),o&&t(ao),o&&t(vt),o&&t(ro),o&&t(kt),o&&t(P),o&&t(yt),o&&t(L),F(ze),o&&t(Mt),o&&t(io),o&&t(wt),o&&t(Q),F(xe),o&&t(Ft),o&&t(E),F(qe),F(le),F(Ae),o&&t(St),o&&t(K),F(je),o&&t($t),o&&t(S),F(De),F(Pe),F(We),F(Ge),F(me),F(Ve),o&&t(Et),o&&t(oe),F(Je),o&&t(Ct),o&&t(C),F(Be),F(Xe),F(ue),F(_e),o&&t(zt),o&&t(ne),F(He),o&&t(xt),o&&t(z),F(Ye),F(to),F(be),F(Te)}}}const Kr={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 ei(x){return Jr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ii extends Wr{constructor(p){super();Or(this,p,ei,Yr,Gr,{})}}export{ii as default,Kr as metadata};
