import{s as Xo,o as So,n as et}from"../chunks/scheduler.01eeda35.js";import{S as Po,i as Yo,g as i,s as n,r as u,A as Do,h as d,f as o,c as s,j as Z,u as f,x as m,k as j,y as l,a,v as g,d as _,t as b,w as M}from"../chunks/index.6dd51b66.js";import{T as mo}from"../chunks/Tip.de9bae2b.js";import{D as B}from"../chunks/Docstring.76e6b3cf.js";import{C as ot}from"../chunks/CodeBlock.864da1b0.js";import{E as ho}from"../chunks/ExampleCodeBlock.6a36fb6b.js";import{H as G,E as Ao}from"../chunks/EditOnGithub.7faefd25.js";function Oo(x){let r,y="Example:",p,h,T;return h=new ot({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME5sbGJNb2VNb2RlbCUyQyUyME5sbGJNb2VDb25maWclMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwTmxsYk1vZSUyMGZhY2Vib29rJTJGbmxsYi1tb2UtNTRiJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyME5sbGJNb2VDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMGZyb20lMjB0aGUlMjBmYWNlYm9vayUyRm5sbGItbW9lLTU0YiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwTmxsYk1vZU1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> NllbMoeModel, NllbMoeConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a NllbMoe facebook/nllb-moe-54b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = NllbMoeConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the facebook/nllb-moe-54b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NllbMoeModel(configuration)

<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`,wrap:!1}}),{c(){r=i("p"),r.textContent=y,p=n(),u(h.$$.fragment)},l(c){r=d(c,"P",{"data-svelte-h":!0}),m(r)!=="svelte-11lpom8"&&(r.textContent=y),p=s(c),f(h.$$.fragment,c)},m(c,v){a(c,r,v),a(c,p,v),g(h,c,v),T=!0},p:et,i(c){T||(_(h.$$.fragment,c),T=!0)},o(c){b(h.$$.fragment,c),T=!1},d(c){c&&(o(r),o(p)),M(h,c)}}}function Qo(x){let r,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){r=i("p"),r.innerHTML=y},l(p){r=d(p,"P",{"data-svelte-h":!0}),m(r)!=="svelte-fincs2"&&(r.innerHTML=y)},m(p,h){a(p,r,h)},p:et,d(p){p&&o(r)}}}function Ko(x){let r,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){r=i("p"),r.innerHTML=y},l(p){r=d(p,"P",{"data-svelte-h":!0}),m(r)!=="svelte-fincs2"&&(r.innerHTML=y)},m(p,h){a(p,r,h)},p:et,d(p){p&&o(r)}}}function en(x){let r,y="Example:",p,h,T;return h=new ot({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBObGxiTW9lTW9kZWwlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJoZi1pbnRlcm5hbC10ZXN0aW5nJTJGcmFuZG9tLW5sbGItbW9lLTItZXhwZXJ0cyUyMiklMEFtb2RlbCUyMCUzRCUyMFN3aXRjaFRyYW5zZm9ybWVyc01vZGVsLmZyb21fcHJldHJhaW5lZCglMjJoZi1pbnRlcm5hbC10ZXN0aW5nJTJGcmFuZG9tLW5sbGItbW9lLTItZXhwZXJ0cyUyMiklMEElMEFpbnB1dF9pZHMlMjAlM0QlMjB0b2tlbml6ZXIoJTBBJTIwJTIwJTIwJTIwJTIyU3R1ZGllcyUyMGhhdmUlMjBiZWVuJTIwc2hvd24lMjB0aGF0JTIwb3duaW5nJTIwYSUyMGRvZyUyMGlzJTIwZ29vZCUyMGZvciUyMHlvdSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMEEpLmlucHV0X2lkcyUyMCUyMCUyMyUyMEJhdGNoJTIwc2l6ZSUyMDElMEFkZWNvZGVyX2lucHV0X2lkcyUyMCUzRCUyMHRva2VuaXplciglMjJTdHVkaWVzJTIwc2hvdyUyMHRoYXQlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5pbnB1dF9pZHMlMjAlMjAlMjMlMjBCYXRjaCUyMHNpemUlMjAxJTBBJTBBJTIzJTIwcHJlcHJvY2VzcyUzQSUyMFByZXBlbmQlMjBkZWNvZGVyX2lucHV0X2lkcyUyMHdpdGglMjBzdGFydCUyMHRva2VuJTIwd2hpY2glMjBpcyUyMHBhZCUyMHRva2VuJTIwZm9yJTIwTmxsYk1vZU1vZGVsJTBBZGVjb2Rlcl9pbnB1dF9pZHMlMjAlM0QlMjBtb2RlbC5fc2hpZnRfcmlnaHQoZGVjb2Rlcl9pbnB1dF9pZHMpJTBBJTBBJTIzJTIwZm9yd2FyZCUyMHBhc3MlMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRfaWRzJTNEaW5wdXRfaWRzJTJDJTIwZGVjb2Rlcl9pbnB1dF9pZHMlM0RkZWNvZGVyX2lucHV0X2lkcyklMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, NllbMoeModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;hf-internal-testing/random-nllb-moe-2-experts&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SwitchTransformersModel.from_pretrained(<span class="hljs-string">&quot;hf-internal-testing/random-nllb-moe-2-experts&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Studies have been shown that owning a dog is good for you&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>).input_ids  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = tokenizer(<span class="hljs-string">&quot;Studies show that&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids  <span class="hljs-comment"># Batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># preprocess: Prepend decoder_input_ids with start token which is pad token for NllbMoeModel</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_input_ids = model._shift_right(decoder_input_ids)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward pass</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids=input_ids, decoder_input_ids=decoder_input_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`,wrap:!1}}),{c(){r=i("p"),r.textContent=y,p=n(),u(h.$$.fragment)},l(c){r=d(c,"P",{"data-svelte-h":!0}),m(r)!=="svelte-11lpom8"&&(r.textContent=y),p=s(c),f(h.$$.fragment,c)},m(c,v){a(c,r,v),a(c,p,v),g(h,c,v),T=!0},p:et,i(c){T||(_(h.$$.fragment,c),T=!0)},o(c){b(h.$$.fragment,c),T=!1},d(c){c&&(o(r),o(p)),M(h,c)}}}function tn(x){let r,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){r=i("p"),r.innerHTML=y},l(p){r=d(p,"P",{"data-svelte-h":!0}),m(r)!=="svelte-fincs2"&&(r.innerHTML=y)},m(p,h){a(p,r,h)},p:et,d(p){p&&o(r)}}}function on(x){let r,y="Translation example:",p,h,T;return h=new ot({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBObGxiTW9lRm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uJTBBJTBBbW9kZWwlMjAlM0QlMjBObGxiTW9lRm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRm5sbGItbW9lLTU0YiUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRm5sbGItbW9lLTU0YiUyMiklMEElMEF0ZXh0X3RvX3RyYW5zbGF0ZSUyMCUzRCUyMCUyMkxpZmUlMjBpcyUyMGxpa2UlMjBhJTIwYm94JTIwb2YlMjBjaG9jb2xhdGVzJTIyJTBBbW9kZWxfaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHRleHRfdG9fdHJhbnNsYXRlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEElMjMlMjB0cmFuc2xhdGUlMjB0byUyMEZyZW5jaCUwQWdlbl90b2tlbnMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKm1vZGVsX2lucHV0cyUyQyUyMGZvcmNlZF9ib3NfdG9rZW5faWQlM0R0b2tlbml6ZXIuZ2V0X2xhbmdfaWQoJTIyZW5nX0xhdG4lMjIpKSUwQXByaW50KHRva2VuaXplci5iYXRjaF9kZWNvZGUoZ2VuX3Rva2VucyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, NllbMoeForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>model = NllbMoeForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/nllb-moe-54b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/nllb-moe-54b&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>text_to_translate = <span class="hljs-string">&quot;Life is like a box of chocolates&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model_inputs = tokenizer(text_to_translate, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># translate to French</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>gen_tokens = model.generate(**model_inputs, forced_bos_token_id=tokenizer.get_lang_id(<span class="hljs-string">&quot;eng_Latn&quot;</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(gen_tokens, skip_special_tokens=<span class="hljs-literal">True</span>))`,wrap:!1}}),{c(){r=i("p"),r.textContent=y,p=n(),u(h.$$.fragment)},l(c){r=d(c,"P",{"data-svelte-h":!0}),m(r)!=="svelte-g2jatv"&&(r.textContent=y),p=s(c),f(h.$$.fragment,c)},m(c,v){a(c,r,v),a(c,p,v),g(h,c,v),T=!0},p:et,i(c){T||(_(h.$$.fragment,c),T=!0)},o(c){b(h.$$.fragment,c),T=!1},d(c){c&&(o(r),o(p)),M(h,c)}}}function nn(x){let r,y,p,h,T,c,v,uo='<img alt="PyTorch" src="https://img.shields.io/badge/PyTorch-DE3412?style=flat&amp;logo=pytorch&amp;logoColor=white"/>',nt,Q,st,K,fo=`The NLLB model was presented in <a href="https://arxiv.org/abs/2207.04672" rel="nofollow">No Language Left Behind: Scaling Human-Centered Machine Translation</a> by Marta R. Costa-jussà, James Cross, Onur Çelebi,
Maha Elbayad, Kenneth Heafield, Kevin Heffernan, Elahe Kalbassi, Janice Lam, Daniel Licht, Jean Maillard, Anna Sun, Skyler Wang, Guillaume Wenzek, Al Youngblood, Bapi Akula,
Loic Barrault, Gabriel Mejia Gonzalez, Prangthip Hansanti, John Hoffman, Semarley Jarrett, Kaushik Ram Sadagopan, Dirk Rowe, Shannon Spruit, Chau Tran, Pierre Andrews,
Necip Fazil Ayan, Shruti Bhosale, Sergey Edunov, Angela Fan, Cynthia Gao, Vedanuj Goswami, Francisco Guzmán, Philipp Koehn, Alexandre Mourachko, Christophe Ropers,
Safiyyah Saleem, Holger Schwenk, and Jeff Wang.`,at,ee,go="The abstract of the paper is the following:",rt,te,_o=`<em>Driven by the goal of eradicating language barriers on a global scale, machine translation has solidified itself as a key focus of artificial intelligence research today.
However, such efforts have coalesced around a small subset of languages, leaving behind the vast majority of mostly low-resource languages. What does it take to break the
200 language barrier while ensuring safe, high quality results, all while keeping ethical considerations in mind? In No Language Left Behind, we took on this challenge by
first contextualizing the need for low-resource language translation support through exploratory interviews with native speakers. Then, we created datasets and models aimed
at narrowing the performance gap between low and high-resource languages. More specifically, we developed a conditional compute model based on Sparsely Gated Mixture of
Experts that is trained on data obtained with novel and effective data mining techniques tailored for low-resource languages. We propose multiple architectural and training
improvements to counteract overfitting while training on thousands of tasks. Critically, we evaluated the performance of over 40,000 different translation directions using
a human-translated benchmark, Flores-200, and combined human evaluation with a novel toxicity benchmark covering all languages in Flores-200 to assess translation safety.
Our model achieves an improvement of 44% BLEU relative to the previous state-of-the-art, laying important groundwork towards realizing a universal translation system.</em>`,lt,oe,bo=`This model was contributed by <a href="https://huggingface.co/ArthurZ" rel="nofollow">Arthur Zucker</a>.
The original code can be found <a href="https://github.com/facebookresearch/fairseq" rel="nofollow">here</a>.`,it,ne,dt,se,Mo="<li>M2M100ForConditionalGeneration is the base model for both NLLB and NLLB MoE</li> <li>The NLLB-MoE is very similar to the NLLB model, but it’s feed forward layer is based on the implementation of SwitchTransformers.</li> <li>The tokenizer is the same as the NLLB models.</li>",ct,ae,pt,re,yo=`The biggest difference is the way the tokens are routed. NLLB-MoE uses a <code>top-2-gate</code> which means that for each input, only the top two experts are selected based on the
highest predicted probabilities from the gating network, and the remaining experts are ignored. In <code>SwitchTransformers</code>, only the top-1 probabilities are computed,
which means that tokens have less probability of being forwarded. Moreover, if a token is not routed to any expert, <code>SwitchTransformers</code> still adds its unmodified hidden
states (kind of like a residual connection) while they are masked in <code>NLLB</code>’s top-2 routing mechanism.`,mt,le,ht,ie,To="The available checkpoints require around 350GB of storage. Make sure to use <code>accelerate</code> if you do not have enough RAM on your machine.",ut,de,vo=`While generating the target text set the <code>forced_bos_token_id</code> to the target language id. The following
example shows how to translate English to French using the <em>facebook/nllb-200-distilled-600M</em> model.`,ft,ce,wo=`Note that we’re using the BCP-47 code for French <code>fra_Latn</code>. See <a href="https://github.com/facebookresearch/flores/blob/main/flores200/README.md#languages-in-flores-200" rel="nofollow">here</a>
for the list of all BCP-47 in the Flores 200 dataset.`,gt,pe,_t,me,bt,he,ko=`English (<code>eng_Latn</code>) is set as the default language from which to translate. In order to specify that you’d like to translate from a different language,
you should specify the BCP-47 code in the <code>src_lang</code> keyword argument of the tokenizer initialization.`,Mt,ue,$o="See example below for a translation from romanian to german:",yt,fe,Tt,ge,vt,_e,xo='<li><a href="../tasks/translation">Translation task guide</a></li> <li><a href="../tasks/summarization">Summarization task guide</a></li>',wt,be,kt,N,Me,Lt,Le,No=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/nllb-moe#transformers.NllbMoeModel">NllbMoeModel</a>. It is used to instantiate an
NLLB-MoE 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 NLLB-MoE
<a href="https://huggingface.co/facebook/nllb-moe-54b" rel="nofollow">facebook/nllb-moe-54b</a> architecture.`,qt,qe,Co=`Configuration objects inherit from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Wt,I,$t,ye,xt,w,Te,Bt,We,zo="Router using tokens choose top-2 experts assignment.",Rt,Be,jo=`This router uses the same mechanism as in NLLB-MoE from the fairseq repository. Items are sorted by router_probs
and then routed to their choice of expert until the expert’s expert_capacity is reached. <strong>There is no guarantee
that each token is processed by an expert</strong>, or that each expert receives at least one token.`,It,Re,Uo="The router combining weights are also returned to make sure that the states that are not updated will be masked.",Ht,H,ve,Et,Ie,Jo=`Computes the <code>dispatch_mask</code> and the <code>dispatch_weights</code> for each experts. The masks are adapted to the expert
capacity.`,Vt,E,we,Xt,He,Fo=`The hidden states are reshaped to simplify the computation of the router probabilities (combining weights for
each experts.)`,Nt,ke,Ct,L,$e,St,Ee,Zo="Implementation of the NLLB-MoE sparse MLP module.",Pt,U,xe,Yt,Ve,Go=`The goal of this forward pass is to have the same number of operation as the equivalent <code>NllbMoeDenseActDense</code>
(mlp) layer. This means that all of the hidden states should be processed at most twice ( since we are using a
top_2 gating mecanism). This means that we keep the complexity to O(batch_size x sequence_length x hidden_dim)
instead of O(num_experts x batch_size x sequence_length x hidden_dim).`,Dt,Xe,Lo=`1- Get the <code>router_probs</code> from the <code>router</code>. The shape of the <code>router_mask</code> is <code>(batch_size X sequence_length, num_expert)</code> and corresponds to the boolean version of the <code>router_probs</code>. The inputs are masked using the
<code>router_mask</code>.`,At,Se,qo=`2- Dispatch the hidden_states to its associated experts. The router probabilities are used to weight the
contribution of each experts when updating the masked hidden states.`,zt,Ne,jt,C,Ce,Ot,Pe,Wo=`The bare NllbMoe Model outputting raw hidden-states without any specific head on top.
This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</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.)`,Qt,Ye,Bo=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Kt,k,ze,eo,De,Ro='The <a href="/docs/transformers/main/en/model_doc/nllb-moe#transformers.NllbMoeModel">NllbMoeModel</a> forward method, overrides the <code>__call__</code> special method.',to,V,oo,Ae,Io='The <a href="/docs/transformers/main/en/model_doc/nllb-moe#transformers.NllbMoeModel">NllbMoeModel</a> forward method, overrides the <code>__call__</code> special method.',no,X,so,S,Ut,je,Jt,z,Ue,ao,Oe,Ho=`The NllbMoe Model with a language modeling head. Can be used for summarization.
This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</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.)`,ro,Qe,Eo=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,lo,J,Je,io,Ke,Vo='The <a href="/docs/transformers/main/en/model_doc/nllb-moe#transformers.NllbMoeForConditionalGeneration">NllbMoeForConditionalGeneration</a> forward method, overrides the <code>__call__</code> special method.',co,P,po,Y,Ft,Fe,Zt,tt,Gt;return T=new G({props:{title:"NLLB-MOE",local:"nllb-moe",headingTag:"h1"}}),Q=new G({props:{title:"Overview",local:"overview",headingTag:"h2"}}),ne=new G({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),ae=new G({props:{title:"Implementation differences with SwitchTransformers",local:"implementation-differences-with-switchtransformers",headingTag:"h2"}}),le=new G({props:{title:"Generating with NLLB-MoE",local:"generating-with-nllb-moe",headingTag:"h2"}}),pe=new ot({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvclNlcTJTZXFMTSUyQyUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRm5sbGItbW9lLTU0YiUyMiklMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvclNlcTJTZXFMTS5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZubGxiLW1vZS01NGIlMjIpJTBBJTBBYXJ0aWNsZSUyMCUzRCUyMCUyMlByZXZpb3VzbHklMkMlMjBSaW5nJ3MlMjBDRU8lMkMlMjBKYW1pZSUyMFNpbWlub2ZmJTJDJTIwcmVtYXJrZWQlMjB0aGUlMjBjb21wYW55JTIwc3RhcnRlZCUyMHdoZW4lMjBoaXMlMjBkb29yYmVsbCUyMHdhc24ndCUyMGF1ZGlibGUlMjBmcm9tJTIwaGlzJTIwc2hvcCUyMGluJTIwaGlzJTIwZ2FyYWdlLiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihhcnRpY2xlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF0cmFuc2xhdGVkX3Rva2VucyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCUwQSUyMCUyMCUyMCUyMCoqaW5wdXRzJTJDJTIwZm9yY2VkX2Jvc190b2tlbl9pZCUzRHRva2VuaXplci5sYW5nX2NvZGVfdG9faWQlNUIlMjJmcmFfTGF0biUyMiU1RCUyQyUyMG1heF9sZW5ndGglM0Q1MCUwQSklMEF0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKHRyYW5zbGF0ZWRfdG9rZW5zJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTVCMCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForSeq2SeqLM, AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/nllb-moe-54b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForSeq2SeqLM.from_pretrained(<span class="hljs-string">&quot;facebook/nllb-moe-54b&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>article = <span class="hljs-string">&quot;Previously, Ring&#x27;s CEO, Jamie Siminoff, remarked the company started when his doorbell wasn&#x27;t audible from his shop in his garage.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(article, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>translated_tokens = model.generate(
<span class="hljs-meta">... </span>    **inputs, forced_bos_token_id=tokenizer.lang_code_to_id[<span class="hljs-string">&quot;fra_Latn&quot;</span>], max_length=<span class="hljs-number">50</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(translated_tokens, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&quot;Auparavant, le PDG de Ring, Jamie Siminoff, a fait remarquer que la société avait commencé lorsque sa sonnette n&#x27;était pas audible depuis son magasin dans son garage.&quot;</span>`,wrap:!1}}),me=new G({props:{title:"Generating from any other language than English",local:"generating-from-any-other-language-than-english",headingTag:"h3"}}),fe=new ot({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvclNlcTJTZXFMTSUyQyUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRm5sbGItbW9lLTU0YiUyMiUyQyUyMHNyY19sYW5nJTNEJTIycm9uX0xhdG4lMjIpJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JTZXEyU2VxTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGbmxsYi1tb2UtNTRiJTIyKSUwQSUwQWFydGljbGUlMjAlM0QlMjAlMjIlQzUlOUVlZnVsJTIwT05VJTIwc3B1bmUlMjBjJUM0JTgzJTIwbnUlMjBleGlzdCVDNCU4MyUyMG8lMjBzb2x1JUM1JUEzaWUlMjBtaWxpdGFyJUM0JTgzJTIwJUMzJUFFbiUyMFNpcmlhJTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKGFydGljbGUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXRyYW5zbGF0ZWRfdG9rZW5zJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoJTBBJTIwJTIwJTIwJTIwKippbnB1dHMlMkMlMjBmb3JjZWRfYm9zX3Rva2VuX2lkJTNEdG9rZW5pemVyLmxhbmdfY29kZV90b19pZCU1QiUyMmRldV9MYXRuJTIyJTVEJTJDJTIwbWF4X2xlbmd0aCUzRDMwJTBBKSUwQXRva2VuaXplci5iYXRjaF9kZWNvZGUodHJhbnNsYXRlZF90b2tlbnMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklNUIwJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForSeq2SeqLM, AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/nllb-moe-54b&quot;</span>, src_lang=<span class="hljs-string">&quot;ron_Latn&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForSeq2SeqLM.from_pretrained(<span class="hljs-string">&quot;facebook/nllb-moe-54b&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>article = <span class="hljs-string">&quot;Şeful ONU spune că nu există o soluţie militară în Siria&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(article, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>translated_tokens = model.generate(
<span class="hljs-meta">... </span>    **inputs, forced_bos_token_id=tokenizer.lang_code_to_id[<span class="hljs-string">&quot;deu_Latn&quot;</span>], max_length=<span class="hljs-number">30</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(translated_tokens, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]`,wrap:!1}}),ge=new G({props:{title:"Resources",local:"resources",headingTag:"h2"}}),be=new G({props:{title:"NllbMoeConfig",local:"transformers.NllbMoeConfig",headingTag:"h2"}}),Me=new B({props:{name:"class transformers.NllbMoeConfig",anchor:"transformers.NllbMoeConfig",parameters:[{name:"vocab_size",val:" = 128112"},{name:"max_position_embeddings",val:" = 1024"},{name:"encoder_layers",val:" = 12"},{name:"encoder_ffn_dim",val:" = 4096"},{name:"encoder_attention_heads",val:" = 16"},{name:"decoder_layers",val:" = 12"},{name:"decoder_ffn_dim",val:" = 4096"},{name:"decoder_attention_heads",val:" = 16"},{name:"encoder_layerdrop",val:" = 0.05"},{name:"decoder_layerdrop",val:" = 0.05"},{name:"use_cache",val:" = True"},{name:"is_encoder_decoder",val:" = True"},{name:"activation_function",val:" = 'relu'"},{name:"d_model",val:" = 1024"},{name:"dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.1"},{name:"activation_dropout",val:" = 0.0"},{name:"init_std",val:" = 0.02"},{name:"decoder_start_token_id",val:" = 2"},{name:"scale_embedding",val:" = True"},{name:"router_bias",val:" = False"},{name:"router_dtype",val:" = 'float32'"},{name:"router_ignore_padding_tokens",val:" = False"},{name:"num_experts",val:" = 128"},{name:"expert_capacity",val:" = 64"},{name:"encoder_sparse_step",val:" = 4"},{name:"decoder_sparse_step",val:" = 4"},{name:"router_z_loss_coef",val:" = 0.001"},{name:"router_aux_loss_coef",val:" = 0.001"},{name:"second_expert_policy",val:" = 'all'"},{name:"normalize_router_prob_before_dropping",val:" = False"},{name:"batch_prioritized_routing",val:" = False"},{name:"moe_eval_capacity_token_fraction",val:" = 1.0"},{name:"moe_token_dropout",val:" = 0.2"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"output_router_logits",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.NllbMoeConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50265) &#x2014;
Vocabulary size of the NllbMoe model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/nllb-moe#transformers.NllbMoeModel">NllbMoeModel</a> or`,name:"vocab_size"},{anchor:"transformers.NllbMoeConfig.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.NllbMoeConfig.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.NllbMoeConfig.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.NllbMoeConfig.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.NllbMoeConfig.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.NllbMoeConfig.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.NllbMoeConfig.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 encoder.`,name:"encoder_ffn_dim"},{anchor:"transformers.NllbMoeConfig.activation_function",description:`<strong>activation_function</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&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.NllbMoeConfig.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.NllbMoeConfig.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.NllbMoeConfig.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.NllbMoeConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for classifier.`,name:"classifier_dropout"},{anchor:"transformers.NllbMoeConfig.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.NllbMoeConfig.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.NllbMoeConfig.encoder_layerdrop",description:`<strong>encoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the encoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"encoder_layerdrop"},{anchor:"transformers.NllbMoeConfig.decoder_layerdrop",description:`<strong>decoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the decoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"decoder_layerdrop"},{anchor:"transformers.NllbMoeConfig.second_expert_policy",description:`<strong>second_expert_policy</strong> ( <code>str</code>, <em>optional</em>, default to <code>&quot;all&quot;</code>) &#x2014;
The policy used for the sampling the probability of being sampled to a second expert for each token.`,name:"second_expert_policy"},{anchor:"transformers.NllbMoeConfig.normalize_router_prob_before_dropping",description:`<strong>normalize_router_prob_before_dropping</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to normalize the router probabilities before applying a mask based on the experts capacity
(capacity dropping).`,name:"normalize_router_prob_before_dropping"},{anchor:"transformers.NllbMoeConfig.batch_prioritized_routing",description:`<strong>batch_prioritized_routing</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to orders the tokens by their router probabilities before capacity dropping. This means that
the tokens that have the highest probabilities will be routed before other tokens that might be further in
the sequence.`,name:"batch_prioritized_routing"},{anchor:"transformers.NllbMoeConfig.moe_eval_capacity_token_fraction",description:`<strong>moe_eval_capacity_token_fraction</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Fraction of tokens as capacity during validation, if set to negative, uses the same as training. Should be
in range: (0.0, 1.0].`,name:"moe_eval_capacity_token_fraction"},{anchor:"transformers.NllbMoeConfig.num_experts",description:`<strong>num_experts</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
Number of experts for each NllbMoeSparseMlp layer.`,name:"num_experts"},{anchor:"transformers.NllbMoeConfig.expert_capacity",description:`<strong>expert_capacity</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Number of tokens that can be stored in each expert.`,name:"expert_capacity"},{anchor:"transformers.NllbMoeConfig.encoder_sparse_step",description:`<strong>encoder_sparse_step</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Frequency of the sparse layers in the encoder. 4 means that one out of 4 layers will be sparse.`,name:"encoder_sparse_step"},{anchor:"transformers.NllbMoeConfig.decoder_sparse_step",description:`<strong>decoder_sparse_step</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Frequency of the sparse layers in the decoder. 4 means that one out of 4 layers will be sparse.`,name:"decoder_sparse_step"},{anchor:"transformers.NllbMoeConfig.router_dtype",description:`<strong>router_dtype</strong> (<code>str</code>, <em>optional</em>, default to <code>&quot;float32&quot;</code>) &#x2014;
The <code>dtype</code> used for the routers. It is preferable to keep the <code>dtype</code> to <code>&quot;float32&quot;</code> as specified in the
<em>selective precision</em> discussion in <a href="https://arxiv.org/abs/2101.03961" rel="nofollow">the paper</a>.`,name:"router_dtype"},{anchor:"transformers.NllbMoeConfig.router_ignore_padding_tokens",description:`<strong>router_ignore_padding_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to ignore padding tokens when routing. if <code>False</code>, the padding tokens are not routed to any
experts.`,name:"router_ignore_padding_tokens"},{anchor:"transformers.NllbMoeConfig.router_bias",description:`<strong>router_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the classifier of the router should have a bias.`,name:"router_bias"},{anchor:"transformers.NllbMoeConfig.moe_token_dropout",description:`<strong>moe_token_dropout</strong> (<code>float</code>, <em>optional</em>, default to 0.2) &#x2014;
Masking rate for MoE expert output masking (EOM), which is implemented via a Dropout2d on the expert
outputs.`,name:"moe_token_dropout"},{anchor:"transformers.NllbMoeConfig.output_router_logits",description:`<strong>output_router_logits</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return the router logits. Only set to <code>True</code> to get the auxiliary loss when training.`,name:"output_router_logits"},{anchor:"transformers.NllbMoeConfig.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nllb_moe/configuration_nllb_moe.py#L24"}}),I=new ho({props:{anchor:"transformers.NllbMoeConfig.example",$$slots:{default:[Oo]},$$scope:{ctx:x}}}),ye=new G({props:{title:"NllbMoeTop2Router",local:"transformers.NllbMoeTop2Router",headingTag:"h2"}}),Te=new B({props:{name:"class transformers.NllbMoeTop2Router",anchor:"transformers.NllbMoeTop2Router",parameters:[{name:"config",val:": NllbMoeConfig"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nllb_moe/modeling_nllb_moe.py#L228"}}),ve=new B({props:{name:"route_tokens",anchor:"transformers.NllbMoeTop2Router.route_tokens",parameters:[{name:"router_logits",val:": Tensor"},{name:"input_dtype",val:": dtype = torch.float32"},{name:"padding_mask",val:": typing.Optional[torch.LongTensor] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nllb_moe/modeling_nllb_moe.py#L269"}}),we=new B({props:{name:"forward",anchor:"transformers.NllbMoeTop2Router.forward",parameters:[{name:"hidden_states",val:": Tensor"},{name:"padding_mask",val:": typing.Optional[torch.LongTensor] = None"}],parametersDescription:[{anchor:"transformers.NllbMoeTop2Router.forward.hidden_states",description:`<strong>hidden_states</strong> (<code>torch.Tensor</code>) &#x2014;
(batch_size, sequence_length, hidden_dim) from which router probabilities are computed.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nllb_moe/modeling_nllb_moe.py#L354",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Index tensor of shape [batch_size, sequence_length] corresponding to the expert selected for each token
using the top1 probabilities of the router.
router_probabilities (<code>torch.Tensor</code> of shape (batch_size, sequence_length, nump_experts)):
Tensor of shape (batch_size, sequence_length, num_experts) corresponding to the probabilities for each
token and expert. Used for routing tokens to experts.
router_logits (<code>torch.Tensor</code> of shape (batch_size, sequence_length))):
Logits tensor of shape (batch_size, sequence_length, num_experts) corresponding to raw router logits.
This is used later for computing router z-loss.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>top_1_mask (<code>torch.Tensor</code> of shape (batch_size, sequence_length))</p>
`}}),ke=new G({props:{title:"NllbMoeSparseMLP",local:"transformers.NllbMoeSparseMLP",headingTag:"h2"}}),$e=new B({props:{name:"class transformers.NllbMoeSparseMLP",anchor:"transformers.NllbMoeSparseMLP",parameters:[{name:"config",val:": NllbMoeConfig"},{name:"ffn_dim",val:": int"},{name:"expert_class",val:": Module = <class 'transformers.models.nllb_moe.modeling_nllb_moe.NllbMoeDenseActDense'>"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nllb_moe/modeling_nllb_moe.py#L405"}}),xe=new B({props:{name:"forward",anchor:"transformers.NllbMoeSparseMLP.forward",parameters:[{name:"hidden_states",val:": Tensor"},{name:"padding_mask",val:": typing.Optional[torch.Tensor] = False"}],parametersDescription:[{anchor:"transformers.NllbMoeSparseMLP.forward.hidden_states",description:`<strong>hidden_states</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_dim)</code>) &#x2014;
The hidden states`,name:"hidden_states"},{anchor:"transformers.NllbMoeSparseMLP.forward.padding_mask",description:`<strong>padding_mask</strong> (<code>torch.Tensor</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Attention mask. Can be in the causal form or not.`,name:"padding_mask"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nllb_moe/modeling_nllb_moe.py#L421",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Updated hidden states
router_logits (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length, num_experts)</code>):
Needed for computing the loss</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>hidden_states (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_dim)</code>)</p>
`}}),Ne=new G({props:{title:"NllbMoeModel",local:"transformers.NllbMoeModel",headingTag:"h2"}}),Ce=new B({props:{name:"class transformers.NllbMoeModel",anchor:"transformers.NllbMoeModel",parameters:[{name:"config",val:": NllbMoeConfig"}],parametersDescription:[{anchor:"transformers.NllbMoeModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/nllb-moe#transformers.NllbMoeConfig">NllbMoeConfig</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/nllb_moe/modeling_nllb_moe.py#L1467"}}),ze=new B({props:{name:"forward",anchor:"transformers.NllbMoeModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{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.LongTensor] = 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[typing.Tuple[torch.FloatTensor]]] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[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:"output_router_logits",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.NllbMoeModel.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. Padding will be ignored by default should you provide
it.`,name:"input_ids"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nllb_moe/modeling_nllb_moe.py#L1506",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.modeling_outputs.Seq2SeqMoEModelOutput</code> 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/nllb-moe#transformers.NllbMoeConfig"
>NllbMoeConfig</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>) — 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>) — 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>) — 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>) — 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>decoder_router_logits</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_router_logits=True</code> is passed or when <code>config.add_router_probs=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, sequence_length, num_experts)</code>.</p>
<p>Router logits of the decoder model, useful to compute the auxiliary loss for Mixture of Experts models.</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>) — 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’s 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>) — 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>) — 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>) — 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>
<li>
<p><strong>encoder_router_logits</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_router_logits=True</code> is passed or when <code>config.add_router_probs=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, sequence_length, num_experts)</code>.</p>
<p>Router logits of the encoder model, useful to compute the auxiliary loss and the z_loss for the sparse
modules.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.modeling_outputs.Seq2SeqMoEModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),V=new mo({props:{$$slots:{default:[Qo]},$$scope:{ctx:x}}}),X=new mo({props:{$$slots:{default:[Ko]},$$scope:{ctx:x}}}),S=new ho({props:{anchor:"transformers.NllbMoeModel.forward.example",$$slots:{default:[en]},$$scope:{ctx:x}}}),je=new G({props:{title:"NllbMoeForConditionalGeneration",local:"transformers.NllbMoeForConditionalGeneration",headingTag:"h2"}}),Ue=new B({props:{name:"class transformers.NllbMoeForConditionalGeneration",anchor:"transformers.NllbMoeForConditionalGeneration",parameters:[{name:"config",val:": NllbMoeConfig"}],parametersDescription:[{anchor:"transformers.NllbMoeForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/nllb-moe#transformers.NllbMoeConfig">NllbMoeConfig</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/nllb_moe/modeling_nllb_moe.py#L1606"}}),Je=new B({props:{name:"forward",anchor:"transformers.NllbMoeForConditionalGeneration.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{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.LongTensor] = 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[typing.Tuple[torch.FloatTensor]]] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"output_router_logits",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.NllbMoeForConditionalGeneration.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. Padding will be ignored by default should you provide
it.</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#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.NllbMoeForConditionalGeneration.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.NllbMoeForConditionalGeneration.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>NllbMoe 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.NllbMoeForConditionalGeneration.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</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.NllbMoeForConditionalGeneration.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.NllbMoeForConditionalGeneration.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.NllbMoeForConditionalGeneration.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.NllbMoeForConditionalGeneration.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(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>, <em>optional</em>) 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.NllbMoeForConditionalGeneration.forward.past_key_values",description:`<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>) &#x2014;
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>
<p>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.NllbMoeForConditionalGeneration.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.NllbMoeForConditionalGeneration.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.NllbMoeForConditionalGeneration.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#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.NllbMoeForConditionalGeneration.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.NllbMoeForConditionalGeneration.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.NllbMoeForConditionalGeneration.forward.output_router_logits",description:`<strong>output_router_logits</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the logits of all the routers. They are useful for computing the router loss, and
should not be returned during inference.`,name:"output_router_logits"},{anchor:"transformers.NllbMoeForConditionalGeneration.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.NllbMoeForConditionalGeneration.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/nllb_moe/modeling_nllb_moe.py#L1635",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.modeling_outputs.Seq2SeqMoEOutput</code> 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/nllb-moe#transformers.NllbMoeConfig"
>NllbMoeConfig</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) — 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>) — 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>) — 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>) — 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>) — 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>decoder_router_logits</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_router_logits=True</code> is passed or when <code>config.add_router_probs=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, sequence_length, num_experts)</code>.</p>
<p>Router logits of the decoder model, useful to compute the auxiliary loss for Mixture of Experts models.</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>) — 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’s 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>) — 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>) — 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>) — 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>
<li>
<p><strong>encoder_router_logits</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_router_logits=True</code> is passed or when <code>config.add_router_probs=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, sequence_length, num_experts)</code>.</p>
<p>Router logits of the encoder model, useful to compute the auxiliary loss and z_loss for Mixture of Experts
models.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.modeling_outputs.Seq2SeqMoEOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),P=new mo({props:{$$slots:{default:[tn]},$$scope:{ctx:x}}}),Y=new ho({props:{anchor:"transformers.NllbMoeForConditionalGeneration.forward.example",$$slots:{default:[on]},$$scope:{ctx:x}}}),Fe=new Ao({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/nllb-moe.md"}}),{c(){r=i("meta"),y=n(),p=i("p"),h=n(),u(T.$$.fragment),c=n(),v=i("div"),v.innerHTML=uo,nt=n(),u(Q.$$.fragment),st=n(),K=i("p"),K.innerHTML=fo,at=n(),ee=i("p"),ee.textContent=go,rt=n(),te=i("p"),te.innerHTML=_o,lt=n(),oe=i("p"),oe.innerHTML=bo,it=n(),u(ne.$$.fragment),dt=n(),se=i("ul"),se.innerHTML=Mo,ct=n(),u(ae.$$.fragment),pt=n(),re=i("p"),re.innerHTML=yo,mt=n(),u(le.$$.fragment),ht=n(),ie=i("p"),ie.innerHTML=To,ut=n(),de=i("p"),de.innerHTML=vo,ft=n(),ce=i("p"),ce.innerHTML=wo,gt=n(),u(pe.$$.fragment),_t=n(),u(me.$$.fragment),bt=n(),he=i("p"),he.innerHTML=ko,Mt=n(),ue=i("p"),ue.textContent=$o,yt=n(),u(fe.$$.fragment),Tt=n(),u(ge.$$.fragment),vt=n(),_e=i("ul"),_e.innerHTML=xo,wt=n(),u(be.$$.fragment),kt=n(),N=i("div"),u(Me.$$.fragment),Lt=n(),Le=i("p"),Le.innerHTML=No,qt=n(),qe=i("p"),qe.innerHTML=Co,Wt=n(),u(I.$$.fragment),$t=n(),u(ye.$$.fragment),xt=n(),w=i("div"),u(Te.$$.fragment),Bt=n(),We=i("p"),We.textContent=zo,Rt=n(),Be=i("p"),Be.innerHTML=jo,It=n(),Re=i("p"),Re.textContent=Uo,Ht=n(),H=i("div"),u(ve.$$.fragment),Et=n(),Ie=i("p"),Ie.innerHTML=Jo,Vt=n(),E=i("div"),u(we.$$.fragment),Xt=n(),He=i("p"),He.textContent=Fo,Nt=n(),u(ke.$$.fragment),Ct=n(),L=i("div"),u($e.$$.fragment),St=n(),Ee=i("p"),Ee.textContent=Zo,Pt=n(),U=i("div"),u(xe.$$.fragment),Yt=n(),Ve=i("p"),Ve.innerHTML=Go,Dt=n(),Xe=i("p"),Xe.innerHTML=Lo,At=n(),Se=i("p"),Se.textContent=qo,zt=n(),u(Ne.$$.fragment),jt=n(),C=i("div"),u(Ce.$$.fragment),Ot=n(),Pe=i("p"),Pe.innerHTML=Wo,Qt=n(),Ye=i("p"),Ye.innerHTML=Bo,Kt=n(),k=i("div"),u(ze.$$.fragment),eo=n(),De=i("p"),De.innerHTML=Ro,to=n(),u(V.$$.fragment),oo=n(),Ae=i("p"),Ae.innerHTML=Io,no=n(),u(X.$$.fragment),so=n(),u(S.$$.fragment),Ut=n(),u(je.$$.fragment),Jt=n(),z=i("div"),u(Ue.$$.fragment),ao=n(),Oe=i("p"),Oe.innerHTML=Ho,ro=n(),Qe=i("p"),Qe.innerHTML=Eo,lo=n(),J=i("div"),u(Je.$$.fragment),io=n(),Ke=i("p"),Ke.innerHTML=Vo,co=n(),u(P.$$.fragment),po=n(),u(Y.$$.fragment),Ft=n(),u(Fe.$$.fragment),Zt=n(),tt=i("p"),this.h()},l(e){const t=Do("svelte-u9bgzb",document.head);r=d(t,"META",{name:!0,content:!0}),t.forEach(o),y=s(e),p=d(e,"P",{}),Z(p).forEach(o),h=s(e),f(T.$$.fragment,e),c=s(e),v=d(e,"DIV",{class:!0,"data-svelte-h":!0}),m(v)!=="svelte-13t8s2t"&&(v.innerHTML=uo),nt=s(e),f(Q.$$.fragment,e),st=s(e),K=d(e,"P",{"data-svelte-h":!0}),m(K)!=="svelte-12x4cpm"&&(K.innerHTML=fo),at=s(e),ee=d(e,"P",{"data-svelte-h":!0}),m(ee)!=="svelte-wu27l3"&&(ee.textContent=go),rt=s(e),te=d(e,"P",{"data-svelte-h":!0}),m(te)!=="svelte-1j7uypk"&&(te.innerHTML=_o),lt=s(e),oe=d(e,"P",{"data-svelte-h":!0}),m(oe)!=="svelte-10n1tet"&&(oe.innerHTML=bo),it=s(e),f(ne.$$.fragment,e),dt=s(e),se=d(e,"UL",{"data-svelte-h":!0}),m(se)!=="svelte-1d7jqov"&&(se.innerHTML=Mo),ct=s(e),f(ae.$$.fragment,e),pt=s(e),re=d(e,"P",{"data-svelte-h":!0}),m(re)!=="svelte-udi8rb"&&(re.innerHTML=yo),mt=s(e),f(le.$$.fragment,e),ht=s(e),ie=d(e,"P",{"data-svelte-h":!0}),m(ie)!=="svelte-19ah26a"&&(ie.innerHTML=To),ut=s(e),de=d(e,"P",{"data-svelte-h":!0}),m(de)!=="svelte-gz9jek"&&(de.innerHTML=vo),ft=s(e),ce=d(e,"P",{"data-svelte-h":!0}),m(ce)!=="svelte-c2ujwv"&&(ce.innerHTML=wo),gt=s(e),f(pe.$$.fragment,e),_t=s(e),f(me.$$.fragment,e),bt=s(e),he=d(e,"P",{"data-svelte-h":!0}),m(he)!=="svelte-ets0jr"&&(he.innerHTML=ko),Mt=s(e),ue=d(e,"P",{"data-svelte-h":!0}),m(ue)!=="svelte-14hvt1f"&&(ue.textContent=$o),yt=s(e),f(fe.$$.fragment,e),Tt=s(e),f(ge.$$.fragment,e),vt=s(e),_e=d(e,"UL",{"data-svelte-h":!0}),m(_e)!=="svelte-6ej6p2"&&(_e.innerHTML=xo),wt=s(e),f(be.$$.fragment,e),kt=s(e),N=d(e,"DIV",{class:!0});var q=Z(N);f(Me.$$.fragment,q),Lt=s(q),Le=d(q,"P",{"data-svelte-h":!0}),m(Le)!=="svelte-1l2hikf"&&(Le.innerHTML=No),qt=s(q),qe=d(q,"P",{"data-svelte-h":!0}),m(qe)!=="svelte-o55m63"&&(qe.innerHTML=Co),Wt=s(q),f(I.$$.fragment,q),q.forEach(o),$t=s(e),f(ye.$$.fragment,e),xt=s(e),w=d(e,"DIV",{class:!0});var $=Z(w);f(Te.$$.fragment,$),Bt=s($),We=d($,"P",{"data-svelte-h":!0}),m(We)!=="svelte-1j1lh5i"&&(We.textContent=zo),Rt=s($),Be=d($,"P",{"data-svelte-h":!0}),m(Be)!=="svelte-ov8d9x"&&(Be.innerHTML=jo),It=s($),Re=d($,"P",{"data-svelte-h":!0}),m(Re)!=="svelte-1wf6mr8"&&(Re.textContent=Uo),Ht=s($),H=d($,"DIV",{class:!0});var Ze=Z(H);f(ve.$$.fragment,Ze),Et=s(Ze),Ie=d(Ze,"P",{"data-svelte-h":!0}),m(Ie)!=="svelte-xjs57s"&&(Ie.innerHTML=Jo),Ze.forEach(o),Vt=s($),E=d($,"DIV",{class:!0});var Ge=Z(E);f(we.$$.fragment,Ge),Xt=s(Ge),He=d(Ge,"P",{"data-svelte-h":!0}),m(He)!=="svelte-19860ws"&&(He.textContent=Fo),Ge.forEach(o),$.forEach(o),Nt=s(e),f(ke.$$.fragment,e),Ct=s(e),L=d(e,"DIV",{class:!0});var R=Z(L);f($e.$$.fragment,R),St=s(R),Ee=d(R,"P",{"data-svelte-h":!0}),m(Ee)!=="svelte-35dv9n"&&(Ee.textContent=Zo),Pt=s(R),U=d(R,"DIV",{class:!0});var W=Z(U);f(xe.$$.fragment,W),Yt=s(W),Ve=d(W,"P",{"data-svelte-h":!0}),m(Ve)!=="svelte-znv5vs"&&(Ve.innerHTML=Go),Dt=s(W),Xe=d(W,"P",{"data-svelte-h":!0}),m(Xe)!=="svelte-bpke9a"&&(Xe.innerHTML=Lo),At=s(W),Se=d(W,"P",{"data-svelte-h":!0}),m(Se)!=="svelte-t4vd7i"&&(Se.textContent=qo),W.forEach(o),R.forEach(o),zt=s(e),f(Ne.$$.fragment,e),jt=s(e),C=d(e,"DIV",{class:!0});var D=Z(C);f(Ce.$$.fragment,D),Ot=s(D),Pe=d(D,"P",{"data-svelte-h":!0}),m(Pe)!=="svelte-s8v7kl"&&(Pe.innerHTML=Wo),Qt=s(D),Ye=d(D,"P",{"data-svelte-h":!0}),m(Ye)!=="svelte-hswkmf"&&(Ye.innerHTML=Bo),Kt=s(D),k=d(D,"DIV",{class:!0});var F=Z(k);f(ze.$$.fragment,F),eo=s(F),De=d(F,"P",{"data-svelte-h":!0}),m(De)!=="svelte-1ugew6t"&&(De.innerHTML=Ro),to=s(F),f(V.$$.fragment,F),oo=s(F),Ae=d(F,"P",{"data-svelte-h":!0}),m(Ae)!=="svelte-1ugew6t"&&(Ae.innerHTML=Io),no=s(F),f(X.$$.fragment,F),so=s(F),f(S.$$.fragment,F),F.forEach(o),D.forEach(o),Ut=s(e),f(je.$$.fragment,e),Jt=s(e),z=d(e,"DIV",{class:!0});var A=Z(z);f(Ue.$$.fragment,A),ao=s(A),Oe=d(A,"P",{"data-svelte-h":!0}),m(Oe)!=="svelte-2fq6bb"&&(Oe.innerHTML=Ho),ro=s(A),Qe=d(A,"P",{"data-svelte-h":!0}),m(Qe)!=="svelte-hswkmf"&&(Qe.innerHTML=Eo),lo=s(A),J=d(A,"DIV",{class:!0});var O=Z(J);f(Je.$$.fragment,O),io=s(O),Ke=d(O,"P",{"data-svelte-h":!0}),m(Ke)!=="svelte-zf431p"&&(Ke.innerHTML=Vo),co=s(O),f(P.$$.fragment,O),po=s(O),f(Y.$$.fragment,O),O.forEach(o),A.forEach(o),Ft=s(e),f(Fe.$$.fragment,e),Zt=s(e),tt=d(e,"P",{}),Z(tt).forEach(o),this.h()},h(){j(r,"name","hf:doc:metadata"),j(r,"content",sn),j(v,"class","flex flex-wrap space-x-1"),j(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){l(document.head,r),a(e,y,t),a(e,p,t),a(e,h,t),g(T,e,t),a(e,c,t),a(e,v,t),a(e,nt,t),g(Q,e,t),a(e,st,t),a(e,K,t),a(e,at,t),a(e,ee,t),a(e,rt,t),a(e,te,t),a(e,lt,t),a(e,oe,t),a(e,it,t),g(ne,e,t),a(e,dt,t),a(e,se,t),a(e,ct,t),g(ae,e,t),a(e,pt,t),a(e,re,t),a(e,mt,t),g(le,e,t),a(e,ht,t),a(e,ie,t),a(e,ut,t),a(e,de,t),a(e,ft,t),a(e,ce,t),a(e,gt,t),g(pe,e,t),a(e,_t,t),g(me,e,t),a(e,bt,t),a(e,he,t),a(e,Mt,t),a(e,ue,t),a(e,yt,t),g(fe,e,t),a(e,Tt,t),g(ge,e,t),a(e,vt,t),a(e,_e,t),a(e,wt,t),g(be,e,t),a(e,kt,t),a(e,N,t),g(Me,N,null),l(N,Lt),l(N,Le),l(N,qt),l(N,qe),l(N,Wt),g(I,N,null),a(e,$t,t),g(ye,e,t),a(e,xt,t),a(e,w,t),g(Te,w,null),l(w,Bt),l(w,We),l(w,Rt),l(w,Be),l(w,It),l(w,Re),l(w,Ht),l(w,H),g(ve,H,null),l(H,Et),l(H,Ie),l(w,Vt),l(w,E),g(we,E,null),l(E,Xt),l(E,He),a(e,Nt,t),g(ke,e,t),a(e,Ct,t),a(e,L,t),g($e,L,null),l(L,St),l(L,Ee),l(L,Pt),l(L,U),g(xe,U,null),l(U,Yt),l(U,Ve),l(U,Dt),l(U,Xe),l(U,At),l(U,Se),a(e,zt,t),g(Ne,e,t),a(e,jt,t),a(e,C,t),g(Ce,C,null),l(C,Ot),l(C,Pe),l(C,Qt),l(C,Ye),l(C,Kt),l(C,k),g(ze,k,null),l(k,eo),l(k,De),l(k,to),g(V,k,null),l(k,oo),l(k,Ae),l(k,no),g(X,k,null),l(k,so),g(S,k,null),a(e,Ut,t),g(je,e,t),a(e,Jt,t),a(e,z,t),g(Ue,z,null),l(z,ao),l(z,Oe),l(z,ro),l(z,Qe),l(z,lo),l(z,J),g(Je,J,null),l(J,io),l(J,Ke),l(J,co),g(P,J,null),l(J,po),g(Y,J,null),a(e,Ft,t),g(Fe,e,t),a(e,Zt,t),a(e,tt,t),Gt=!0},p(e,[t]){const q={};t&2&&(q.$$scope={dirty:t,ctx:e}),I.$set(q);const $={};t&2&&($.$$scope={dirty:t,ctx:e}),V.$set($);const Ze={};t&2&&(Ze.$$scope={dirty:t,ctx:e}),X.$set(Ze);const Ge={};t&2&&(Ge.$$scope={dirty:t,ctx:e}),S.$set(Ge);const R={};t&2&&(R.$$scope={dirty:t,ctx:e}),P.$set(R);const W={};t&2&&(W.$$scope={dirty:t,ctx:e}),Y.$set(W)},i(e){Gt||(_(T.$$.fragment,e),_(Q.$$.fragment,e),_(ne.$$.fragment,e),_(ae.$$.fragment,e),_(le.$$.fragment,e),_(pe.$$.fragment,e),_(me.$$.fragment,e),_(fe.$$.fragment,e),_(ge.$$.fragment,e),_(be.$$.fragment,e),_(Me.$$.fragment,e),_(I.$$.fragment,e),_(ye.$$.fragment,e),_(Te.$$.fragment,e),_(ve.$$.fragment,e),_(we.$$.fragment,e),_(ke.$$.fragment,e),_($e.$$.fragment,e),_(xe.$$.fragment,e),_(Ne.$$.fragment,e),_(Ce.$$.fragment,e),_(ze.$$.fragment,e),_(V.$$.fragment,e),_(X.$$.fragment,e),_(S.$$.fragment,e),_(je.$$.fragment,e),_(Ue.$$.fragment,e),_(Je.$$.fragment,e),_(P.$$.fragment,e),_(Y.$$.fragment,e),_(Fe.$$.fragment,e),Gt=!0)},o(e){b(T.$$.fragment,e),b(Q.$$.fragment,e),b(ne.$$.fragment,e),b(ae.$$.fragment,e),b(le.$$.fragment,e),b(pe.$$.fragment,e),b(me.$$.fragment,e),b(fe.$$.fragment,e),b(ge.$$.fragment,e),b(be.$$.fragment,e),b(Me.$$.fragment,e),b(I.$$.fragment,e),b(ye.$$.fragment,e),b(Te.$$.fragment,e),b(ve.$$.fragment,e),b(we.$$.fragment,e),b(ke.$$.fragment,e),b($e.$$.fragment,e),b(xe.$$.fragment,e),b(Ne.$$.fragment,e),b(Ce.$$.fragment,e),b(ze.$$.fragment,e),b(V.$$.fragment,e),b(X.$$.fragment,e),b(S.$$.fragment,e),b(je.$$.fragment,e),b(Ue.$$.fragment,e),b(Je.$$.fragment,e),b(P.$$.fragment,e),b(Y.$$.fragment,e),b(Fe.$$.fragment,e),Gt=!1},d(e){e&&(o(y),o(p),o(h),o(c),o(v),o(nt),o(st),o(K),o(at),o(ee),o(rt),o(te),o(lt),o(oe),o(it),o(dt),o(se),o(ct),o(pt),o(re),o(mt),o(ht),o(ie),o(ut),o(de),o(ft),o(ce),o(gt),o(_t),o(bt),o(he),o(Mt),o(ue),o(yt),o(Tt),o(vt),o(_e),o(wt),o(kt),o(N),o($t),o(xt),o(w),o(Nt),o(Ct),o(L),o(zt),o(jt),o(C),o(Ut),o(Jt),o(z),o(Ft),o(Zt),o(tt)),o(r),M(T,e),M(Q,e),M(ne,e),M(ae,e),M(le,e),M(pe,e),M(me,e),M(fe,e),M(ge,e),M(be,e),M(Me),M(I),M(ye,e),M(Te),M(ve),M(we),M(ke,e),M($e),M(xe),M(Ne,e),M(Ce),M(ze),M(V),M(X),M(S),M(je,e),M(Ue),M(Je),M(P),M(Y),M(Fe,e)}}}const sn='{"title":"NLLB-MOE","local":"nllb-moe","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Implementation differences with SwitchTransformers","local":"implementation-differences-with-switchtransformers","sections":[],"depth":2},{"title":"Generating with NLLB-MoE","local":"generating-with-nllb-moe","sections":[{"title":"Generating from any other language than English","local":"generating-from-any-other-language-than-english","sections":[],"depth":3}],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"NllbMoeConfig","local":"transformers.NllbMoeConfig","sections":[],"depth":2},{"title":"NllbMoeTop2Router","local":"transformers.NllbMoeTop2Router","sections":[],"depth":2},{"title":"NllbMoeSparseMLP","local":"transformers.NllbMoeSparseMLP","sections":[],"depth":2},{"title":"NllbMoeModel","local":"transformers.NllbMoeModel","sections":[],"depth":2},{"title":"NllbMoeForConditionalGeneration","local":"transformers.NllbMoeForConditionalGeneration","sections":[],"depth":2}],"depth":1}';function an(x){return So(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class un extends Po{constructor(r){super(),Yo(this,r,an,nn,Xo,{})}}export{un as component};
