import{S as Gr,i as Br,s as Rr,e as n,k as c,w as b,t as r,M as Wr,c as s,d as t,m as h,a,x as v,h as i,b as l,G as e,g as _,y,q as w,o as M,B as F,v as Ur,L as Yt}from"../../chunks/vendor-hf-doc-builder.js";import{T as jr}from"../../chunks/Tip-hf-doc-builder.js";import{D}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Jt}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as so}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Kt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Hr(E){let m,k,g,f,T;return f=new Jt({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=r("Examples:"),g=c(),b(f.$$.fragment)},l(d){m=s(d,"P",{});var u=a(m);k=i(u,"Examples:"),u.forEach(t),g=h(d),v(f.$$.fragment,d)},m(d,u){_(d,m,u),e(m,k),_(d,g,u),y(f,d,u),T=!0},p:Yt,i(d){T||(w(f.$$.fragment,d),T=!0)},o(d){M(f.$$.fragment,d),T=!1},d(d){d&&t(m),d&&t(g),F(f,d)}}}function Vr(E){let m,k,g,f,T;return f=new Jt({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=r("Transformer sequence pair mask has the following format:"),g=c(),b(f.$$.fragment)},l(d){m=s(d,"P",{});var u=a(m);k=i(u,"Transformer sequence pair mask has the following format:"),u.forEach(t),g=h(d),v(f.$$.fragment,d)},m(d,u){_(d,m,u),e(m,k),_(d,g,u),y(f,d,u),T=!0},p:Yt,i(d){T||(w(f.$$.fragment,d),T=!0)},o(d){M(f.$$.fragment,d),T=!1},d(d){d&&t(m),d&&t(g),F(f,d)}}}function Qr(E){let m,k,g,f,T;return{c(){m=n("p"),k=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),f=r("Module"),T=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){m=s(d,"P",{});var u=a(m);k=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(u,"CODE",{});var I=a(g);f=i(I,"Module"),I.forEach(t),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(t)},m(d,u){_(d,m,u),e(m,k),e(m,g),e(g,f),e(m,T)},d(d){d&&t(m)}}}function Xr(E){let m,k,g,f,T;return f=new Jt({props:{code:`from transformers import AutoTokenizer, FSMTModel
import torch

tokenizer = AutoTokenizer.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> 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(){m=n("p"),k=r("Example:"),g=c(),b(f.$$.fragment)},l(d){m=s(d,"P",{});var u=a(m);k=i(u,"Example:"),u.forEach(t),g=h(d),v(f.$$.fragment,d)},m(d,u){_(d,m,u),e(m,k),_(d,g,u),y(f,d,u),T=!0},p:Yt,i(d){T||(w(f.$$.fragment,d),T=!0)},o(d){M(f.$$.fragment,d),T=!1},d(d){d&&t(m),d&&t(g),F(f,d)}}}function Kr(E){let m,k,g,f,T;return{c(){m=n("p"),k=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),f=r("Module"),T=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){m=s(d,"P",{});var u=a(m);k=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(u,"CODE",{});var I=a(g);f=i(I,"Module"),I.forEach(t),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(t)},m(d,u){_(d,m,u),e(m,k),e(m,g),e(g,f),e(m,T)},d(d){d&&t(m)}}}function Yr(E){let m,k,g,f,T;return f=new Jt({props:{code:`from transformers import AutoTokenizer, FSMTForConditionalGeneration

mname = "facebook/wmt19-ru-en"
model = FSMTForConditionalGeneration.from_pretrained(mname)
tokenizer = AutoTokenizer.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> 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(){m=n("p"),k=r("Translation example::"),g=c(),b(f.$$.fragment)},l(d){m=s(d,"P",{});var u=a(m);k=i(u,"Translation example::"),u.forEach(t),g=h(d),v(f.$$.fragment,d)},m(d,u){_(d,m,u),e(m,k),_(d,g,u),y(f,d,u),T=!0},p:Yt,i(d){T||(w(f.$$.fragment,d),T=!0)},o(d){M(f.$$.fragment,d),T=!1},d(d){d&&t(m),d&&t(g),F(f,d)}}}function Jr(E){let m,k,g,f,T,d,u,I,Zt,_t,U,Eo,en,on,Fe,tn,nn,gt,H,ae,Co,$e,sn,Po,an,Tt,re,rn,Se,dn,ln,kt,ao,cn,bt,ro,Ao,hn,vt,L,mn,ze,pn,fn,qe,un,_n,yt,V,ie,Io,xe,gn,Oo,Tn,wt,io,Q,kn,lo,bn,vn,co,yn,wn,Mt,X,de,No,Ee,Mn,Do,Fn,Ft,z,Ce,$n,K,Sn,ho,zn,qn,Pe,xn,En,Cn,Y,Pn,mo,An,In,po,On,Nn,Dn,le,Ln,ce,Ae,jn,J,Gn,Lo,Bn,Rn,jo,Wn,Un,$t,Z,he,Go,Ie,Hn,Bo,Vn,St,$,Oe,Qn,Ro,Xn,Kn,O,Wo,Yn,Jn,Uo,Zn,es,N,os,Ho,ts,ns,Vo,ss,as,Qo,rs,is,ds,Ne,ls,Xo,cs,hs,ms,De,ps,fo,fs,us,_s,j,Le,gs,Ko,Ts,ks,je,uo,bs,Yo,vs,ys,_o,ws,Jo,Ms,Fs,me,Ge,$s,Be,Ss,Zo,zs,qs,xs,C,Re,Es,et,Cs,Ps,pe,As,ee,Is,ot,Os,Ns,tt,Ds,Ls,js,nt,Gs,Bs,go,We,zt,oe,fe,st,Ue,Rs,at,Ws,qt,q,He,Us,rt,Hs,Vs,Ve,Qs,To,Xs,Ks,Ys,Qe,Js,Xe,Zs,ea,oa,P,Ke,ta,te,na,ko,sa,aa,it,ra,ia,da,ue,la,_e,xt,ne,ge,dt,Ye,ca,lt,ha,Et,x,Je,ma,ct,pa,fa,Ze,ua,bo,_a,ga,Ta,eo,ka,oo,ba,va,ya,A,to,wa,se,Ma,vo,Fa,$a,ht,Sa,za,qa,Te,xa,ke,Ct;return d=new so({}),$e=new so({}),xe=new so({}),Ee=new so({}),Ce=new D({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/main/src/transformers/models/fsmt/configuration_fsmt.py#L41"}}),le=new Kt({props:{anchor:"transformers.FSMTConfig.example",$$slots:{default:[Hr]},$$scope:{ctx:E}}}),Ae=new D({props:{name:"to_dict",anchor:"transformers.FSMTConfig.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/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>
`}}),Ie=new so({}),Oe=new D({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/main/src/transformers/models/fsmt/tokenization_fsmt.py#L135"}}),Le=new D({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/main/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 D({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/main/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 D({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/main/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 Kt({props:{anchor:"transformers.FSMTTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[Vr]},$$scope:{ctx:E}}}),We=new D({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/main/src/transformers/models/fsmt/tokenization_fsmt.py#L491"}}),Ue=new so({}),He=new D({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/main/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/main/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/main/src/transformers/models/fsmt/modeling_fsmt.py#L1036"}}),Ke=new D({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/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>FSMT uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).`,name:"decoder_input_ids"},{anchor:"transformers.FSMTModel.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.`,name:"decoder_attention_mask"},{anchor:"transformers.FSMTModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.FSMTModel.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.FSMTModel.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.FSMTModel.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>Tuple(torch.FloatTensor)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code> is a sequence of hidden-states at
the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.FSMTModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden-states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.FSMTModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.FSMTModel.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>decoder_input_ids</code> you can choose to directly pass an embedded
representation. If <code>past_key_values</code> is used, optionally only the last <code>decoder_inputs_embeds</code> have to be
input (see <code>past_key_values</code>). This is useful if you want more control over how to convert
<code>decoder_input_ids</code> indices into associated vectors than the model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>decoder_input_ids</code> and <code>decoder_inputs_embeds</code> are both unset, <code>decoder_inputs_embeds</code> takes the value
of <code>inputs_embeds</code>.`,name:"decoder_inputs_embeds"},{anchor:"transformers.FSMTModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.FSMTModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FSMTModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FSMTModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/fsmt/modeling_fsmt.py#L1058",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ue=new jr({props:{$$slots:{default:[Qr]},$$scope:{ctx:E}}}),_e=new Kt({props:{anchor:"transformers.FSMTModel.forward.example",$$slots:{default:[Xr]},$$scope:{ctx:E}}}),Ye=new so({}),Je=new D({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/main/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/main/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/main/src/transformers/models/fsmt/modeling_fsmt.py#L1172"}}),to=new D({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/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>FSMT uses the <code>eos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If <code>past_key_values</code>
is used, optionally only the last <code>decoder_input_ids</code> have to be input (see <code>past_key_values</code>).`,name:"decoder_input_ids"},{anchor:"transformers.FSMTForConditionalGeneration.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.`,name:"decoder_attention_mask"},{anchor:"transformers.FSMTForConditionalGeneration.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.FSMTForConditionalGeneration.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.FSMTForConditionalGeneration.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.FSMTForConditionalGeneration.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>Tuple(torch.FloatTensor)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code> is a sequence of hidden-states at
the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.FSMTForConditionalGeneration.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden-states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.FSMTForConditionalGeneration.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.FSMTForConditionalGeneration.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>decoder_input_ids</code> you can choose to directly pass an embedded
representation. If <code>past_key_values</code> is used, optionally only the last <code>decoder_inputs_embeds</code> have to be
input (see <code>past_key_values</code>). This is useful if you want more control over how to convert
<code>decoder_input_ids</code> indices into associated vectors than the model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>decoder_input_ids</code> and <code>decoder_inputs_embeds</code> are both unset, <code>decoder_inputs_embeds</code> takes the value
of <code>inputs_embeds</code>.`,name:"decoder_inputs_embeds"},{anchor:"transformers.FSMTForConditionalGeneration.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.FSMTForConditionalGeneration.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FSMTForConditionalGeneration.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FSMTForConditionalGeneration.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/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/main/src/transformers/models/fsmt/modeling_fsmt.py#L1189",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Te=new jr({props:{$$slots:{default:[Kr]},$$scope:{ctx:E}}}),ke=new Kt({props:{anchor:"transformers.FSMTForConditionalGeneration.forward.example",$$slots:{default:[Yr]},$$scope:{ctx:E}}}),{c(){m=n("meta"),k=c(),g=n("h1"),f=n("a"),T=n("span"),b(d.$$.fragment),u=c(),I=n("span"),Zt=r("FSMT"),_t=c(),U=n("p"),Eo=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(),H=n("h2"),ae=n("a"),Co=n("span"),b($e.$$.fragment),sn=c(),Po=n("span"),an=r("Overview"),Tt=c(),re=n("p"),rn=r("FSMT (FairSeq MachineTranslation) models were introduced in "),Se=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."),kt=c(),ao=n("p"),cn=r("The abstract of the paper is the following:"),bt=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.`),vt=c(),L=n("p"),mn=r("This model was contributed by "),ze=n("a"),pn=r("stas"),fn=r(`. The original code can be found
`),qe=n("a"),un=r("here"),_n=r("."),yt=c(),V=n("h2"),ie=n("a"),Io=n("span"),b(xe.$$.fragment),gn=c(),Oo=n("span"),Tn=r("Implementation Notes"),wt=c(),io=n("ul"),Q=n("li"),kn=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"),bn=r("XLMTokenizer"),vn=r(` and the main model is derived from
`),co=n("a"),yn=r("BartModel"),wn=r("."),Mt=c(),X=n("h2"),de=n("a"),No=n("span"),b(Ee.$$.fragment),Mn=c(),Do=n("span"),Fn=r("FSMTConfig"),Ft=c(),z=n("div"),b(Ce.$$.fragment),$n=c(),K=n("p"),Sn=r("This is the configuration class to store the configuration of a "),ho=n("a"),zn=r("FSMTModel"),qn=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
`),Pe=n("a"),xn=r("facebook/wmt19-en-ru"),En=r(" architecture."),Cn=c(),Y=n("p"),Pn=r("Configuration objects inherit from "),mo=n("a"),An=r("PretrainedConfig"),In=r(` and can be used to control the model outputs. Read the
documentation from `),po=n("a"),On=r("PretrainedConfig"),Nn=r(" for more information."),Dn=c(),b(le.$$.fragment),Ln=c(),ce=n("div"),b(Ae.$$.fragment),jn=c(),J=n("p"),Gn=r("Serializes this instance to a Python dictionary. Override the default "),Lo=n("em"),Bn=r("to_dict()"),Rn=r(" from "),jo=n("em"),Wn=r("PretrainedConfig"),Un=r("."),$t=c(),Z=n("h2"),he=n("a"),Go=n("span"),b(Ie.$$.fragment),Hn=c(),Bo=n("span"),Vn=r("FSMTTokenizer"),St=c(),$=n("div"),b(Oe.$$.fragment),Qn=c(),Ro=n("p"),Xn=r("Construct an FAIRSEQ Transformer tokenizer. Based on Byte-Pair Encoding. The tokenization process is the following:"),Kn=c(),O=n("ul"),Wo=n("li"),Yn=r("Moses preprocessing and tokenization."),Jn=c(),Uo=n("li"),Zn=r("Normalizing all inputs text."),es=c(),N=n("li"),os=r("The arguments "),Ho=n("code"),ts=r("special_tokens"),ns=r(" and the function "),Vo=n("code"),ss=r("set_special_tokens"),as=r(`, can be used to add additional symbols (like
\u201D`),Qo=n("strong"),rs=r("classify"),is=r("\u201D) to a vocabulary."),ds=c(),Ne=n("li"),ls=r("The argument "),Xo=n("code"),cs=r("langs"),hs=r(" defines a pair of languages."),ms=c(),De=n("p"),ps=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(),j=n("div"),b(Le.$$.fragment),gs=c(),Ko=n("p"),Ts=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:`),ks=c(),je=n("ul"),uo=n("li"),bs=r("single sequence: "),Yo=n("code"),vs=r("<s> X </s>"),ys=c(),_o=n("li"),ws=r("pair of sequences: "),Jo=n("code"),Ms=r("<s> A </s> B </s>"),Fs=c(),me=n("div"),b(Ge.$$.fragment),$s=c(),Be=n("p"),Ss=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 `),Zo=n("code"),zs=r("prepare_for_model"),qs=r(" method."),xs=c(),C=n("div"),b(Re.$$.fragment),Es=c(),et=n("p"),Cs=r("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A FAIRSEQ"),Ps=c(),b(pe.$$.fragment),As=c(),ee=n("p"),Is=r("If "),ot=n("code"),Os=r("token_ids_1"),Ns=r(" is "),tt=n("code"),Ds=r("None"),Ls=r(", this method only returns the first portion of the mask (0s)."),js=c(),nt=n("p"),Gs=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:`),Bs=c(),go=n("div"),b(We.$$.fragment),zt=c(),oe=n("h2"),fe=n("a"),st=n("span"),b(Ue.$$.fragment),Rs=c(),at=n("span"),Ws=r("FSMTModel"),qt=c(),q=n("div"),b(He.$$.fragment),Us=c(),rt=n("p"),Hs=r("The bare FSMT Model outputting raw hidden-states without any specific head on top."),Vs=c(),Ve=n("p"),Qs=r("This model inherits from "),To=n("a"),Xs=r("PreTrainedModel"),Ks=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.)`),Ys=c(),Qe=n("p"),Js=r("This model is also a PyTorch "),Xe=n("a"),Zs=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(),P=n("div"),b(Ke.$$.fragment),ta=c(),te=n("p"),na=r("The "),ko=n("a"),sa=r("FSMTModel"),aa=r(" forward method, overrides the "),it=n("code"),ra=r("__call__"),ia=r(" special method."),da=c(),b(ue.$$.fragment),la=c(),b(_e.$$.fragment),xt=c(),ne=n("h2"),ge=n("a"),dt=n("span"),b(Ye.$$.fragment),ca=c(),lt=n("span"),ha=r("FSMTForConditionalGeneration"),Et=c(),x=n("div"),b(Je.$$.fragment),ma=c(),ct=n("p"),pa=r("The FSMT Model with a language modeling head. Can be used for summarization."),fa=c(),Ze=n("p"),ua=r("This model inherits from "),bo=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.)`),Ta=c(),eo=n("p"),ka=r("This model is also a PyTorch "),oo=n("a"),ba=r("torch.nn.Module"),va=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"),b(to.$$.fragment),wa=c(),se=n("p"),Ma=r("The "),vo=n("a"),Fa=r("FSMTForConditionalGeneration"),$a=r(" forward method, overrides the "),ht=n("code"),Sa=r("__call__"),za=r(" special method."),qa=c(),b(Te.$$.fragment),xa=c(),b(ke.$$.fragment),this.h()},l(o){const p=Wr('[data-svelte="svelte-1phssyn"]',document.head);m=s(p,"META",{name:!0,content:!0}),p.forEach(t),k=h(o),g=s(o,"H1",{class:!0});var no=a(g);f=s(no,"A",{id:!0,class:!0,href:!0});var mt=a(f);T=s(mt,"SPAN",{});var pt=a(T);v(d.$$.fragment,pt),pt.forEach(t),mt.forEach(t),u=h(no),I=s(no,"SPAN",{});var ft=a(I);Zt=i(ft,"FSMT"),ft.forEach(t),no.forEach(t),_t=h(o),U=s(o,"P",{});var be=a(U);Eo=s(be,"STRONG",{});var ut=a(Eo);en=i(ut,"DISCLAIMER:"),ut.forEach(t),on=i(be," If you see something strange, file a "),Fe=s(be,"A",{href:!0,rel:!0});var Pa=a(Fe);tn=i(Pa,"Github Issue"),Pa.forEach(t),nn=i(be,` and assign
@stas00.`),be.forEach(t),gt=h(o),H=s(o,"H2",{class:!0});var Pt=a(H);ae=s(Pt,"A",{id:!0,class:!0,href:!0});var Aa=a(ae);Co=s(Aa,"SPAN",{});var Ia=a(Co);v($e.$$.fragment,Ia),Ia.forEach(t),Aa.forEach(t),sn=h(Pt),Po=s(Pt,"SPAN",{});var Oa=a(Po);an=i(Oa,"Overview"),Oa.forEach(t),Pt.forEach(t),Tt=h(o),re=s(o,"P",{});var At=a(re);rn=i(At,"FSMT (FairSeq MachineTranslation) models were introduced in "),Se=s(At,"A",{href:!0,rel:!0});var Na=a(Se);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),kt=h(o),ao=s(o,"P",{});var Da=a(ao);cn=i(Da,"The abstract of the paper is the following:"),Da.forEach(t),bt=h(o),ro=s(o,"P",{});var La=a(ro);Ao=s(La,"EM",{});var ja=a(Ao);hn=i(ja,`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.`),ja.forEach(t),La.forEach(t),vt=h(o),L=s(o,"P",{});var yo=a(L);mn=i(yo,"This model was contributed by "),ze=s(yo,"A",{href:!0,rel:!0});var Ga=a(ze);pn=i(Ga,"stas"),Ga.forEach(t),fn=i(yo,`. The original code can be found
`),qe=s(yo,"A",{href:!0,rel:!0});var Ba=a(qe);un=i(Ba,"here"),Ba.forEach(t),_n=i(yo,"."),yo.forEach(t),yt=h(o),V=s(o,"H2",{class:!0});var It=a(V);ie=s(It,"A",{id:!0,class:!0,href:!0});var Ra=a(ie);Io=s(Ra,"SPAN",{});var Wa=a(Io);v(xe.$$.fragment,Wa),Wa.forEach(t),Ra.forEach(t),gn=h(It),Oo=s(It,"SPAN",{});var Ua=a(Oo);Tn=i(Ua,"Implementation Notes"),Ua.forEach(t),It.forEach(t),wt=h(o),io=s(o,"UL",{});var Ha=a(io);Q=s(Ha,"LI",{});var wo=a(Q);kn=i(wo,`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(wo,"A",{href:!0});var Va=a(lo);bn=i(Va,"XLMTokenizer"),Va.forEach(t),vn=i(wo,` and the main model is derived from
`),co=s(wo,"A",{href:!0});var Qa=a(co);yn=i(Qa,"BartModel"),Qa.forEach(t),wn=i(wo,"."),wo.forEach(t),Ha.forEach(t),Mt=h(o),X=s(o,"H2",{class:!0});var Ot=a(X);de=s(Ot,"A",{id:!0,class:!0,href:!0});var Xa=a(de);No=s(Xa,"SPAN",{});var Ka=a(No);v(Ee.$$.fragment,Ka),Ka.forEach(t),Xa.forEach(t),Mn=h(Ot),Do=s(Ot,"SPAN",{});var Ya=a(Do);Fn=i(Ya,"FSMTConfig"),Ya.forEach(t),Ot.forEach(t),Ft=h(o),z=s(o,"DIV",{class:!0});var G=a(z);v(Ce.$$.fragment,G),$n=h(G),K=s(G,"P",{});var Mo=a(K);Sn=i(Mo,"This is the configuration class to store the configuration of a "),ho=s(Mo,"A",{href:!0});var Ja=a(ho);zn=i(Ja,"FSMTModel"),Ja.forEach(t),qn=i(Mo,`. 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(Mo,"A",{href:!0,rel:!0});var Za=a(Pe);xn=i(Za,"facebook/wmt19-en-ru"),Za.forEach(t),En=i(Mo," architecture."),Mo.forEach(t),Cn=h(G),Y=s(G,"P",{});var Fo=a(Y);Pn=i(Fo,"Configuration objects inherit from "),mo=s(Fo,"A",{href:!0});var er=a(mo);An=i(er,"PretrainedConfig"),er.forEach(t),In=i(Fo,` and can be used to control the model outputs. Read the
documentation from `),po=s(Fo,"A",{href:!0});var or=a(po);On=i(or,"PretrainedConfig"),or.forEach(t),Nn=i(Fo," for more information."),Fo.forEach(t),Dn=h(G),v(le.$$.fragment,G),Ln=h(G),ce=s(G,"DIV",{class:!0});var Nt=a(ce);v(Ae.$$.fragment,Nt),jn=h(Nt),J=s(Nt,"P",{});var $o=a(J);Gn=i($o,"Serializes this instance to a Python dictionary. Override the default "),Lo=s($o,"EM",{});var tr=a(Lo);Bn=i(tr,"to_dict()"),tr.forEach(t),Rn=i($o," from "),jo=s($o,"EM",{});var nr=a(jo);Wn=i(nr,"PretrainedConfig"),nr.forEach(t),Un=i($o,"."),$o.forEach(t),Nt.forEach(t),G.forEach(t),$t=h(o),Z=s(o,"H2",{class:!0});var Dt=a(Z);he=s(Dt,"A",{id:!0,class:!0,href:!0});var sr=a(he);Go=s(sr,"SPAN",{});var ar=a(Go);v(Ie.$$.fragment,ar),ar.forEach(t),sr.forEach(t),Hn=h(Dt),Bo=s(Dt,"SPAN",{});var rr=a(Bo);Vn=i(rr,"FSMTTokenizer"),rr.forEach(t),Dt.forEach(t),St=h(o),$=s(o,"DIV",{class:!0});var S=a($);v(Oe.$$.fragment,S),Qn=h(S),Ro=s(S,"P",{});var ir=a(Ro);Xn=i(ir,"Construct an FAIRSEQ Transformer tokenizer. Based on Byte-Pair Encoding. The tokenization process is the following:"),ir.forEach(t),Kn=h(S),O=s(S,"UL",{});var ve=a(O);Wo=s(ve,"LI",{});var dr=a(Wo);Yn=i(dr,"Moses preprocessing and tokenization."),dr.forEach(t),Jn=h(ve),Uo=s(ve,"LI",{});var lr=a(Uo);Zn=i(lr,"Normalizing all inputs text."),lr.forEach(t),es=h(ve),N=s(ve,"LI",{});var ye=a(N);os=i(ye,"The arguments "),Ho=s(ye,"CODE",{});var cr=a(Ho);ts=i(cr,"special_tokens"),cr.forEach(t),ns=i(ye," and the function "),Vo=s(ye,"CODE",{});var hr=a(Vo);ss=i(hr,"set_special_tokens"),hr.forEach(t),as=i(ye,`, can be used to add additional symbols (like
\u201D`),Qo=s(ye,"STRONG",{});var mr=a(Qo);rs=i(mr,"classify"),mr.forEach(t),is=i(ye,"\u201D) to a vocabulary."),ye.forEach(t),ds=h(ve),Ne=s(ve,"LI",{});var Lt=a(Ne);ls=i(Lt,"The argument "),Xo=s(Lt,"CODE",{});var pr=a(Xo);cs=i(pr,"langs"),pr.forEach(t),hs=i(Lt," defines a pair of languages."),Lt.forEach(t),ve.forEach(t),ms=h(S),De=s(S,"P",{});var jt=a(De);ps=i(jt,"This tokenizer inherits from "),fo=s(jt,"A",{href:!0});var fr=a(fo);fs=i(fr,"PreTrainedTokenizer"),fr.forEach(t),us=i(jt,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),jt.forEach(t),_s=h(S),j=s(S,"DIV",{class:!0});var So=a(j);v(Le.$$.fragment,So),gs=h(So),Ko=s(So,"P",{});var ur=a(Ko);Ts=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),ks=h(So),je=s(So,"UL",{});var Gt=a(je);uo=s(Gt,"LI",{});var Ea=a(uo);bs=i(Ea,"single sequence: "),Yo=s(Ea,"CODE",{});var _r=a(Yo);vs=i(_r,"<s> X </s>"),_r.forEach(t),Ea.forEach(t),ys=h(Gt),_o=s(Gt,"LI",{});var Ca=a(_o);ws=i(Ca,"pair of sequences: "),Jo=s(Ca,"CODE",{});var gr=a(Jo);Ms=i(gr,"<s> A </s> B </s>"),gr.forEach(t),Ca.forEach(t),Gt.forEach(t),So.forEach(t),Fs=h(S),me=s(S,"DIV",{class:!0});var Bt=a(me);v(Ge.$$.fragment,Bt),$s=h(Bt),Be=s(Bt,"P",{});var Rt=a(Be);Ss=i(Rt,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Zo=s(Rt,"CODE",{});var Tr=a(Zo);zs=i(Tr,"prepare_for_model"),Tr.forEach(t),qs=i(Rt," method."),Rt.forEach(t),Bt.forEach(t),xs=h(S),C=s(S,"DIV",{class:!0});var B=a(C);v(Re.$$.fragment,B),Es=h(B),et=s(B,"P",{});var kr=a(et);Cs=i(kr,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A FAIRSEQ"),kr.forEach(t),Ps=h(B),v(pe.$$.fragment,B),As=h(B),ee=s(B,"P",{});var zo=a(ee);Is=i(zo,"If "),ot=s(zo,"CODE",{});var br=a(ot);Os=i(br,"token_ids_1"),br.forEach(t),Ns=i(zo," is "),tt=s(zo,"CODE",{});var vr=a(tt);Ds=i(vr,"None"),vr.forEach(t),Ls=i(zo,", this method only returns the first portion of the mask (0s)."),zo.forEach(t),js=h(B),nt=s(B,"P",{});var yr=a(nt);Gs=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),B.forEach(t),Bs=h(S),go=s(S,"DIV",{class:!0});var wr=a(go);v(We.$$.fragment,wr),wr.forEach(t),S.forEach(t),zt=h(o),oe=s(o,"H2",{class:!0});var Wt=a(oe);fe=s(Wt,"A",{id:!0,class:!0,href:!0});var Mr=a(fe);st=s(Mr,"SPAN",{});var Fr=a(st);v(Ue.$$.fragment,Fr),Fr.forEach(t),Mr.forEach(t),Rs=h(Wt),at=s(Wt,"SPAN",{});var $r=a(at);Ws=i($r,"FSMTModel"),$r.forEach(t),Wt.forEach(t),qt=h(o),q=s(o,"DIV",{class:!0});var R=a(q);v(He.$$.fragment,R),Us=h(R),rt=s(R,"P",{});var Sr=a(rt);Hs=i(Sr,"The bare FSMT Model outputting raw hidden-states without any specific head on top."),Sr.forEach(t),Vs=h(R),Ve=s(R,"P",{});var Ut=a(Ve);Qs=i(Ut,"This model inherits from "),To=s(Ut,"A",{href:!0});var zr=a(To);Xs=i(zr,"PreTrainedModel"),zr.forEach(t),Ks=i(Ut,`. 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.)`),Ut.forEach(t),Ys=h(R),Qe=s(R,"P",{});var Ht=a(Qe);Js=i(Ht,"This model is also a PyTorch "),Xe=s(Ht,"A",{href:!0,rel:!0});var qr=a(Xe);Zs=i(qr,"torch.nn.Module"),qr.forEach(t),ea=i(Ht,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ht.forEach(t),oa=h(R),P=s(R,"DIV",{class:!0});var we=a(P);v(Ke.$$.fragment,we),ta=h(we),te=s(we,"P",{});var qo=a(te);na=i(qo,"The "),ko=s(qo,"A",{href:!0});var xr=a(ko);sa=i(xr,"FSMTModel"),xr.forEach(t),aa=i(qo," forward method, overrides the "),it=s(qo,"CODE",{});var Er=a(it);ra=i(Er,"__call__"),Er.forEach(t),ia=i(qo," special method."),qo.forEach(t),da=h(we),v(ue.$$.fragment,we),la=h(we),v(_e.$$.fragment,we),we.forEach(t),R.forEach(t),xt=h(o),ne=s(o,"H2",{class:!0});var Vt=a(ne);ge=s(Vt,"A",{id:!0,class:!0,href:!0});var Cr=a(ge);dt=s(Cr,"SPAN",{});var Pr=a(dt);v(Ye.$$.fragment,Pr),Pr.forEach(t),Cr.forEach(t),ca=h(Vt),lt=s(Vt,"SPAN",{});var Ar=a(lt);ha=i(Ar,"FSMTForConditionalGeneration"),Ar.forEach(t),Vt.forEach(t),Et=h(o),x=s(o,"DIV",{class:!0});var W=a(x);v(Je.$$.fragment,W),ma=h(W),ct=s(W,"P",{});var Ir=a(ct);pa=i(Ir,"The FSMT Model with a language modeling head. Can be used for summarization."),Ir.forEach(t),fa=h(W),Ze=s(W,"P",{});var Qt=a(Ze);ua=i(Qt,"This model inherits from "),bo=s(Qt,"A",{href:!0});var Or=a(bo);_a=i(Or,"PreTrainedModel"),Or.forEach(t),ga=i(Qt,`. 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.)`),Qt.forEach(t),Ta=h(W),eo=s(W,"P",{});var Xt=a(eo);ka=i(Xt,"This model is also a PyTorch "),oo=s(Xt,"A",{href:!0,rel:!0});var Nr=a(oo);ba=i(Nr,"torch.nn.Module"),Nr.forEach(t),va=i(Xt,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Xt.forEach(t),ya=h(W),A=s(W,"DIV",{class:!0});var Me=a(A);v(to.$$.fragment,Me),wa=h(Me),se=s(Me,"P",{});var xo=a(se);Ma=i(xo,"The "),vo=s(xo,"A",{href:!0});var Dr=a(vo);Fa=i(Dr,"FSMTForConditionalGeneration"),Dr.forEach(t),$a=i(xo," forward method, overrides the "),ht=s(xo,"CODE",{});var Lr=a(ht);Sa=i(Lr,"__call__"),Lr.forEach(t),za=i(xo," special method."),xo.forEach(t),qa=h(Me),v(Te.$$.fragment,Me),xa=h(Me),v(ke.$$.fragment,Me),Me.forEach(t),W.forEach(t),this.h()},h(){l(m,"name","hf:doc:metadata"),l(m,"content",JSON.stringify(Zr)),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(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(lo,"href","/docs/transformers/main/en/model_doc/xlm#transformers.XLMTokenizer"),l(co,"href","/docs/transformers/main/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(ho,"href","/docs/transformers/main/en/model_doc/fsmt#transformers.FSMTModel"),l(Pe,"href","https://huggingface.co/facebook/wmt19-en-ru"),l(Pe,"rel","nofollow"),l(mo,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),l(po,"href","/docs/transformers/main/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(fo,"href","/docs/transformers/main/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(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($,"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(To,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),l(Xe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Xe,"rel","nofollow"),l(ko,"href","/docs/transformers/main/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(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(bo,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),l(oo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(oo,"rel","nofollow"),l(vo,"href","/docs/transformers/main/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(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(o,p){e(document.head,m),_(o,k,p),_(o,g,p),e(g,f),e(f,T),y(d,T,null),e(g,u),e(g,I),e(I,Zt),_(o,_t,p),_(o,U,p),e(U,Eo),e(Eo,en),e(U,on),e(U,Fe),e(Fe,tn),e(U,nn),_(o,gt,p),_(o,H,p),e(H,ae),e(ae,Co),y($e,Co,null),e(H,sn),e(H,Po),e(Po,an),_(o,Tt,p),_(o,re,p),e(re,rn),e(re,Se),e(Se,dn),e(re,ln),_(o,kt,p),_(o,ao,p),e(ao,cn),_(o,bt,p),_(o,ro,p),e(ro,Ao),e(Ao,hn),_(o,vt,p),_(o,L,p),e(L,mn),e(L,ze),e(ze,pn),e(L,fn),e(L,qe),e(qe,un),e(L,_n),_(o,yt,p),_(o,V,p),e(V,ie),e(ie,Io),y(xe,Io,null),e(V,gn),e(V,Oo),e(Oo,Tn),_(o,wt,p),_(o,io,p),e(io,Q),e(Q,kn),e(Q,lo),e(lo,bn),e(Q,vn),e(Q,co),e(co,yn),e(Q,wn),_(o,Mt,p),_(o,X,p),e(X,de),e(de,No),y(Ee,No,null),e(X,Mn),e(X,Do),e(Do,Fn),_(o,Ft,p),_(o,z,p),y(Ce,z,null),e(z,$n),e(z,K),e(K,Sn),e(K,ho),e(ho,zn),e(K,qn),e(K,Pe),e(Pe,xn),e(K,En),e(z,Cn),e(z,Y),e(Y,Pn),e(Y,mo),e(mo,An),e(Y,In),e(Y,po),e(po,On),e(Y,Nn),e(z,Dn),y(le,z,null),e(z,Ln),e(z,ce),y(Ae,ce,null),e(ce,jn),e(ce,J),e(J,Gn),e(J,Lo),e(Lo,Bn),e(J,Rn),e(J,jo),e(jo,Wn),e(J,Un),_(o,$t,p),_(o,Z,p),e(Z,he),e(he,Go),y(Ie,Go,null),e(Z,Hn),e(Z,Bo),e(Bo,Vn),_(o,St,p),_(o,$,p),y(Oe,$,null),e($,Qn),e($,Ro),e(Ro,Xn),e($,Kn),e($,O),e(O,Wo),e(Wo,Yn),e(O,Jn),e(O,Uo),e(Uo,Zn),e(O,es),e(O,N),e(N,os),e(N,Ho),e(Ho,ts),e(N,ns),e(N,Vo),e(Vo,ss),e(N,as),e(N,Qo),e(Qo,rs),e(N,is),e(O,ds),e(O,Ne),e(Ne,ls),e(Ne,Xo),e(Xo,cs),e(Ne,hs),e($,ms),e($,De),e(De,ps),e(De,fo),e(fo,fs),e(De,us),e($,_s),e($,j),y(Le,j,null),e(j,gs),e(j,Ko),e(Ko,Ts),e(j,ks),e(j,je),e(je,uo),e(uo,bs),e(uo,Yo),e(Yo,vs),e(je,ys),e(je,_o),e(_o,ws),e(_o,Jo),e(Jo,Ms),e($,Fs),e($,me),y(Ge,me,null),e(me,$s),e(me,Be),e(Be,Ss),e(Be,Zo),e(Zo,zs),e(Be,qs),e($,xs),e($,C),y(Re,C,null),e(C,Es),e(C,et),e(et,Cs),e(C,Ps),y(pe,C,null),e(C,As),e(C,ee),e(ee,Is),e(ee,ot),e(ot,Os),e(ee,Ns),e(ee,tt),e(tt,Ds),e(ee,Ls),e(C,js),e(C,nt),e(nt,Gs),e($,Bs),e($,go),y(We,go,null),_(o,zt,p),_(o,oe,p),e(oe,fe),e(fe,st),y(Ue,st,null),e(oe,Rs),e(oe,at),e(at,Ws),_(o,qt,p),_(o,q,p),y(He,q,null),e(q,Us),e(q,rt),e(rt,Hs),e(q,Vs),e(q,Ve),e(Ve,Qs),e(Ve,To),e(To,Xs),e(Ve,Ks),e(q,Ys),e(q,Qe),e(Qe,Js),e(Qe,Xe),e(Xe,Zs),e(Qe,ea),e(q,oa),e(q,P),y(Ke,P,null),e(P,ta),e(P,te),e(te,na),e(te,ko),e(ko,sa),e(te,aa),e(te,it),e(it,ra),e(te,ia),e(P,da),y(ue,P,null),e(P,la),y(_e,P,null),_(o,xt,p),_(o,ne,p),e(ne,ge),e(ge,dt),y(Ye,dt,null),e(ne,ca),e(ne,lt),e(lt,ha),_(o,Et,p),_(o,x,p),y(Je,x,null),e(x,ma),e(x,ct),e(ct,pa),e(x,fa),e(x,Ze),e(Ze,ua),e(Ze,bo),e(bo,_a),e(Ze,ga),e(x,Ta),e(x,eo),e(eo,ka),e(eo,oo),e(oo,ba),e(eo,va),e(x,ya),e(x,A),y(to,A,null),e(A,wa),e(A,se),e(se,Ma),e(se,vo),e(vo,Fa),e(se,$a),e(se,ht),e(ht,Sa),e(se,za),e(A,qa),y(Te,A,null),e(A,xa),y(ke,A,null),Ct=!0},p(o,[p]){const no={};p&2&&(no.$$scope={dirty:p,ctx:o}),le.$set(no);const mt={};p&2&&(mt.$$scope={dirty:p,ctx:o}),pe.$set(mt);const pt={};p&2&&(pt.$$scope={dirty:p,ctx:o}),ue.$set(pt);const ft={};p&2&&(ft.$$scope={dirty:p,ctx:o}),_e.$set(ft);const be={};p&2&&(be.$$scope={dirty:p,ctx:o}),Te.$set(be);const ut={};p&2&&(ut.$$scope={dirty:p,ctx:o}),ke.$set(ut)},i(o){Ct||(w(d.$$.fragment,o),w($e.$$.fragment,o),w(xe.$$.fragment,o),w(Ee.$$.fragment,o),w(Ce.$$.fragment,o),w(le.$$.fragment,o),w(Ae.$$.fragment,o),w(Ie.$$.fragment,o),w(Oe.$$.fragment,o),w(Le.$$.fragment,o),w(Ge.$$.fragment,o),w(Re.$$.fragment,o),w(pe.$$.fragment,o),w(We.$$.fragment,o),w(Ue.$$.fragment,o),w(He.$$.fragment,o),w(Ke.$$.fragment,o),w(ue.$$.fragment,o),w(_e.$$.fragment,o),w(Ye.$$.fragment,o),w(Je.$$.fragment,o),w(to.$$.fragment,o),w(Te.$$.fragment,o),w(ke.$$.fragment,o),Ct=!0)},o(o){M(d.$$.fragment,o),M($e.$$.fragment,o),M(xe.$$.fragment,o),M(Ee.$$.fragment,o),M(Ce.$$.fragment,o),M(le.$$.fragment,o),M(Ae.$$.fragment,o),M(Ie.$$.fragment,o),M(Oe.$$.fragment,o),M(Le.$$.fragment,o),M(Ge.$$.fragment,o),M(Re.$$.fragment,o),M(pe.$$.fragment,o),M(We.$$.fragment,o),M(Ue.$$.fragment,o),M(He.$$.fragment,o),M(Ke.$$.fragment,o),M(ue.$$.fragment,o),M(_e.$$.fragment,o),M(Ye.$$.fragment,o),M(Je.$$.fragment,o),M(to.$$.fragment,o),M(Te.$$.fragment,o),M(ke.$$.fragment,o),Ct=!1},d(o){t(m),o&&t(k),o&&t(g),F(d),o&&t(_t),o&&t(U),o&&t(gt),o&&t(H),F($e),o&&t(Tt),o&&t(re),o&&t(kt),o&&t(ao),o&&t(bt),o&&t(ro),o&&t(vt),o&&t(L),o&&t(yt),o&&t(V),F(xe),o&&t(wt),o&&t(io),o&&t(Mt),o&&t(X),F(Ee),o&&t(Ft),o&&t(z),F(Ce),F(le),F(Ae),o&&t($t),o&&t(Z),F(Ie),o&&t(St),o&&t($),F(Oe),F(Le),F(Ge),F(Re),F(pe),F(We),o&&t(zt),o&&t(oe),F(Ue),o&&t(qt),o&&t(q),F(He),F(Ke),F(ue),F(_e),o&&t(xt),o&&t(ne),F(Ye),o&&t(Et),o&&t(x),F(Je),F(to),F(Te),F(ke)}}}const Zr={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 Ur(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ii extends Gr{constructor(m){super();Br(this,m,ei,Jr,Rr,{})}}export{ii as default,Zr as metadata};
