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