import{S as Ga,i as Ba,s as Ra,e as n,k as c,w as v,t as a,M as Wa,c as s,d as o,m as h,a as r,x as b,h as i,b as l,G as e,g,y,q as w,o as M,B as F,v as Ua,L as Yo}from"../../chunks/vendor-hf-doc-builder.js";import{T as ja}from"../../chunks/Tip-hf-doc-builder.js";import{D as N}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Jo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as st}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ko}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ha(E){let m,k,_,f,T;return f=new Jo({props:{code:`from transformers import FSMTConfig, FSMTModel

# Initializing a FSMT facebook/wmt19-en-ru style configuration
config = FSMTConfig()

# Initializing a model (with random weights) from the configuration
model = FSMTModel(config)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> 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(){m=n("p"),k=a("Examples:"),_=c(),v(f.$$.fragment)},l(d){m=s(d,"P",{});var u=r(m);k=i(u,"Examples:"),u.forEach(o),_=h(d),b(f.$$.fragment,d)},m(d,u){g(d,m,u),e(m,k),g(d,_,u),y(f,d,u),T=!0},p:Yo,i(d){T||(w(f.$$.fragment,d),T=!0)},o(d){M(f.$$.fragment,d),T=!1},d(d){d&&o(m),d&&o(_),F(f,d)}}}function Va(E){let m,k,_,f,T;return f=new Jo({props:{code:`0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
| first sequence    | second sequence |`,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(){m=n("p"),k=a("Transformer sequence pair mask has the following format:"),_=c(),v(f.$$.fragment)},l(d){m=s(d,"P",{});var u=r(m);k=i(u,"Transformer sequence pair mask has the following format:"),u.forEach(o),_=h(d),b(f.$$.fragment,d)},m(d,u){g(d,m,u),e(m,k),g(d,_,u),y(f,d,u),T=!0},p:Yo,i(d){T||(w(f.$$.fragment,d),T=!0)},o(d){M(f.$$.fragment,d),T=!1},d(d){d&&o(m),d&&o(_),F(f,d)}}}function Qa(E){let m,k,_,f,T;return{c(){m=n("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),f=a("Module"),T=a(`
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){m=s(d,"P",{});var u=r(m);k=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(u,"CODE",{});var A=r(_);f=i(A,"Module"),A.forEach(o),T=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(o)},m(d,u){g(d,m,u),e(m,k),e(m,_),e(_,f),e(m,T)},d(d){d&&o(m)}}}function Xa(E){let m,k,_,f,T;return f=new Jo({props:{code:`from transformers import FSMTTokenizer, FSMTModel
import torch

tokenizer = FSMTTokenizer.from_pretrained("facebook/wmt19-ru-en")
model = FSMTModel.from_pretrained("facebook/wmt19-ru-en")

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

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> FSMTTokenizer, 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 = FSMTTokenizer.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(){m=n("p"),k=a("Example:"),_=c(),v(f.$$.fragment)},l(d){m=s(d,"P",{});var u=r(m);k=i(u,"Example:"),u.forEach(o),_=h(d),b(f.$$.fragment,d)},m(d,u){g(d,m,u),e(m,k),g(d,_,u),y(f,d,u),T=!0},p:Yo,i(d){T||(w(f.$$.fragment,d),T=!0)},o(d){M(f.$$.fragment,d),T=!1},d(d){d&&o(m),d&&o(_),F(f,d)}}}function Ka(E){let m,k,_,f,T;return{c(){m=n("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),f=a("Module"),T=a(`
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){m=s(d,"P",{});var u=r(m);k=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(u,"CODE",{});var A=r(_);f=i(A,"Module"),A.forEach(o),T=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(o)},m(d,u){g(d,m,u),e(m,k),e(m,_),e(_,f),e(m,T)},d(d){d&&o(m)}}}function Ya(E){let m,k,_,f,T;return f=new Jo({props:{code:`from transformers import FSMTTokenizer, FSMTForConditionalGeneration

mname = "facebook/wmt19-ru-en"
model = FSMTForConditionalGeneration.from_pretrained(mname)
tokenizer = FSMTTokenizer.from_pretrained(mname)

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