import{s as Xs,o as Bs,n as Hs}from"../chunks/scheduler.9bc65507.js";import{S as Ss,i as As,g as a,s as r,u as g,m as Rs,A as Ps,h as o,f as t,c as i,j as h,v as f,y as c,n as Fs,k as d,o as n,a as l,w as b,d as k,t as _,x as y}from"../chunks/index.78c82d43.js";import{D as Le}from"../chunks/Docstring.4e7352e2.js";import{C as Ze}from"../chunks/CodeBlock.73e038be.js";import{I as Ge}from"../chunks/IconCopyLink.bedaa44d.js";import{E as Vs}from"../chunks/ExampleCodeBlock.872b014d.js";function Ys(Ie){let m,U="Examples:",x,v,M;return v=new Ze({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME5sbGJUb2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBObGxiVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJmYWNlYm9vayUyRm5sbGItMjAwLWRpc3RpbGxlZC02MDBNJTIyJTJDJTIwc3JjX2xhbmclM0QlMjJlbmdfTGF0biUyMiUyQyUyMHRndF9sYW5nJTNEJTIyZnJhX0xhdG4lMjIlMEEpJTBBZXhhbXBsZV9lbmdsaXNoX3BocmFzZSUyMCUzRCUyMCUyMiUyMFVOJTIwQ2hpZWYlMjBTYXlzJTIwVGhlcmUlMjBJcyUyME5vJTIwTWlsaXRhcnklMjBTb2x1dGlvbiUyMGluJTIwU3lyaWElMjIlMEFleHBlY3RlZF90cmFuc2xhdGlvbl9mcmVuY2glMjAlM0QlMjAlMjJMZSUyMGNoZWYlMjBkZSUyMGwnT05VJTIwYWZmaXJtZSUyMHF1J2lsJTIwbid5JTIwYSUyMHBhcyUyMGRlJTIwc29sdXRpb24lMjBtaWxpdGFpcmUlMjBlbiUyMFN5cmllLiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihleGFtcGxlX2VuZ2xpc2hfcGhyYXNlJTJDJTIwdGV4dF90YXJnZXQlM0RleHBlY3RlZF90cmFuc2xhdGlvbl9mcmVuY2glMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> NllbTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = NllbTokenizer.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;facebook/nllb-200-distilled-600M&quot;</span>, src_lang=<span class="hljs-string">&quot;eng_Latn&quot;</span>, tgt_lang=<span class="hljs-string">&quot;fra_Latn&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>example_english_phrase = <span class="hljs-string">&quot; UN Chief Says There Is No Military Solution in Syria&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>expected_translation_french = <span class="hljs-string">&quot;Le chef de l&#x27;ONU affirme qu&#x27;il n&#x27;y a pas de solution militaire en Syrie.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(example_english_phrase, text_target=expected_translation_french, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)`,wrap:!1}}),{c(){m=a("p"),m.textContent=U,x=r(),g(v.$$.fragment)},l(p){m=o(p,"P",{"data-svelte-h":!0}),c(m)!=="svelte-kvfsh7"&&(m.textContent=U),x=i(p),f(v.$$.fragment,p)},m(p,J){l(p,m,J),l(p,x,J),b(v,p,J),M=!0},p:Hs,i(p){M||(k(v.$$.fragment,p),M=!0)},o(p){_(v.$$.fragment,p),M=!1},d(p){p&&(t(m),t(x)),y(v,p)}}}function Ds(Ie){let m,U="Examples:",x,v,M;return v=new Ze({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME5sbGJUb2tlbml6ZXJGYXN0JTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwTmxsYlRva2VuaXplckZhc3QuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmZhY2Vib29rJTJGbmxsYi0yMDAtZGlzdGlsbGVkLTYwME0lMjIlMkMlMjBzcmNfbGFuZyUzRCUyMmVuZ19MYXRuJTIyJTJDJTIwdGd0X2xhbmclM0QlMjJmcmFfTGF0biUyMiUwQSklMEFleGFtcGxlX2VuZ2xpc2hfcGhyYXNlJTIwJTNEJTIwJTIyJTIwVU4lMjBDaGllZiUyMFNheXMlMjBUaGVyZSUyMElzJTIwTm8lMjBNaWxpdGFyeSUyMFNvbHV0aW9uJTIwaW4lMjBTeXJpYSUyMiUwQWV4cGVjdGVkX3RyYW5zbGF0aW9uX2ZyZW5jaCUyMCUzRCUyMCUyMkxlJTIwY2hlZiUyMGRlJTIwbCdPTlUlMjBhZmZpcm1lJTIwcXUnaWwlMjBuJ3klMjBhJTIwcGFzJTIwZGUlMjBzb2x1dGlvbiUyMG1pbGl0YWlyZSUyMGVuJTIwU3lyaWUuJTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKGV4YW1wbGVfZW5nbGlzaF9waHJhc2UlMkMlMjB0ZXh0X3RhcmdldCUzRGV4cGVjdGVkX3RyYW5zbGF0aW9uX2ZyZW5jaCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> NllbTokenizerFast

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = NllbTokenizerFast.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;facebook/nllb-200-distilled-600M&quot;</span>, src_lang=<span class="hljs-string">&quot;eng_Latn&quot;</span>, tgt_lang=<span class="hljs-string">&quot;fra_Latn&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>example_english_phrase = <span class="hljs-string">&quot; UN Chief Says There Is No Military Solution in Syria&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>expected_translation_french = <span class="hljs-string">&quot;Le chef de l&#x27;ONU affirme qu&#x27;il n&#x27;y a pas de solution militaire en Syrie.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(example_english_phrase, text_target=expected_translation_french, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)`,wrap:!1}}),{c(){m=a("p"),m.textContent=U,x=r(),g(v.$$.fragment)},l(p){m=o(p,"P",{"data-svelte-h":!0}),c(m)!=="svelte-kvfsh7"&&(m.textContent=U),x=i(p),f(v.$$.fragment,p)},m(p,J){l(p,m,J),l(p,x,J),b(v,p,J),M=!0},p:Hs,i(p){M||(k(v.$$.fragment,p),M=!0)},o(p){_(v.$$.fragment,p),M=!1},d(p){p&&(t(m),t(x)),y(v,p)}}}function Qs(Ie){let m,U,x,v,M,p,J,D,on,Ee,En="NLLB",_t,Q,Wn="<strong>DISCLAIMER:</strong> The default behaviour for the tokenizer has recently been fixed (and thus changed)!",yt,O,Rn="The previous version adds <code>[self.eos_token_id, self.cur_lang_code]</code> at the end of the token sequence for both target and source tokenization. This is wrong as the NLLB paper mentions (page 48, 6.1.1. Model Architecture) :",vt,K,Fn=`<em>Note that we prefix the source sequence with the source language, as opposed to the target
language as previously done in several works (Arivazhagan et al., 2019; Johnson et al.,
2017). This is primarily because we prioritize optimizing zero-shot performance of our
model on any pair of 200 languages at a minor cost to supervised performance.</em>`,Mt,ee,Vn="Previous behaviour:",wt,te,Tt,ne,Hn="New behaviour",xt,se,jt,ae,Xn="Enabling the old behaviour can be done as follows:",Jt,oe,$t,le,Bn='For more details, feel free to check the linked <a href="https://github.com/huggingface/transformers/pull/22313" rel="nofollow">PR</a> and <a href="https://github.com/huggingface/transformers/issues/19943" rel="nofollow">Issue</a>.',zt,L,R,dt,re,ln,We,Sn="Overview of NLLB",Ut,ie,An=`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.`,Nt,ce,Pn="The abstract of the paper is the following:",Ct,pe,Yn=`<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>`,qt,de,Dn="This implementation contains the dense models available on release.",Lt,he,Qn='<strong>The sparse model NLLB-MoE (Mixture of Expert) is now available! More details <a href="nllb-moe">here</a></strong>',Gt,me,On='This model was contributed by <a href="https://huggingface.co/lysandre" rel="nofollow">Lysandre</a>. The authors’ code can be found <a href="https://github.com/facebookresearch/fairseq/tree/nllb" rel="nofollow">here</a>.',Zt,G,F,ht,ue,rn,Re,Kn="Generating with NLLB",It,ge,es=`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.`,Et,fe,ts=`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.`,Wt,be,Rt,Z,V,mt,ke,cn,Fe,ns="Generating from any other language than English",Ft,_e,ss=`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.`,Vt,ye,as="See example below for a translation from romanian to german:",Ht,ve,Xt,I,H,ut,Me,pn,Ve,os="Documentation resources",Bt,we,ls='<li><a href="../tasks/translation">Translation task guide</a></li> <li><a href="../tasks/summarization">Summarization task guide</a></li>',St,E,X,gt,Te,dn,He,rs="NllbTokenizer",At,T,xe,hn,Xe,is="Construct an NLLB tokenizer.",mn,Be,cs=`Adapted from <a href="/docs/transformers/v4.34.0/en/model_doc/roberta#transformers.RobertaTokenizer">RobertaTokenizer</a> and <a href="/docs/transformers/v4.34.0/en/model_doc/xlnet#transformers.XLNetTokenizer">XLNetTokenizer</a>. Based on
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a>.`,un,Se,ps="The tokenization method is <code>&lt;tokens&gt; &lt;eos&gt; &lt;language code&gt;</code> for source language documents, and `&lt;language code&gt;",gn,B,fn,$,je,bn,Ae,ds=`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An NLLB sequence has the following format, where <code>X</code> represents the sequence:`,kn,Pe,hs="<li><code>input_ids</code> (for encoder) <code>X [eos, src_lang_code]</code></li> <li><code>decoder_input_ids</code>: (for decoder) <code>X [eos, tgt_lang_code]</code></li>",_n,Ye,ms=`BOS is never used. Pairs of sequences are not the expected use case, but they will be handled without a
separator.`,Pt,W,S,ft,Je,yn,De,us="NllbTokenizerFast",Yt,u,$e,vn,Qe,gs=`Construct a “fast” NLLB tokenizer (backed by HuggingFace’s <em>tokenizers</em> library). Based on
<a href="https://huggingface.co/docs/tokenizers/python/latest/components.html?highlight=BPE#models" rel="nofollow">BPE</a>.`,Mn,Oe,fs=`This tokenizer inherits from <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a> which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`,wn,Ke,bs="The tokenization method is <code>&lt;tokens&gt; &lt;eos&gt; &lt;language code&gt;</code> for source language documents, and `&lt;language code&gt;",Tn,A,xn,j,ze,jn,et,ks=`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. The special tokens depend on calling set_lang.`,Jn,tt,_s="An NLLB sequence has the following format, where <code>X</code> represents the sequence:",$n,nt,ys="<li><code>input_ids</code> (for encoder) <code>X [eos, src_lang_code]</code></li> <li><code>decoder_input_ids</code>: (for decoder) <code>X [eos, tgt_lang_code]</code></li>",zn,st,vs=`BOS is never used. Pairs of sequences are not the expected use case, but they will be handled without a
separator.`,Un,P,Ue,Nn,at,Ms=`Create a mask from the two sequences passed to be used in a sequence-pair classification task. nllb does not
make use of token type ids, therefore a list of zeros is returned.`,Cn,N,Ne,qn,ot,ws="Reset the special tokens to the source lang setting.",Ln,lt,Ts="<li>In legacy mode: No prefix and suffix=[eos, src_lang_code].</li> <li>In default mode: Prefix=[src_lang_code], suffix = [eos]</li>",Gn,C,Ce,Zn,rt,xs="Reset the special tokens to the target lang setting.",In,it,js="<li>In legacy mode: No prefix and suffix=[eos, tgt_lang_code].</li> <li>In default mode: Prefix=[tgt_lang_code], suffix = [eos]</li>",Dt,bt,Qt;return D=new Ge({}),te=new Ze({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME5sbGJUb2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBObGxiVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRm5sbGItMjAwLWRpc3RpbGxlZC02MDBNJTIyKSUwQXRva2VuaXplciglMjJIb3clMjB3YXMlMjB5b3VyJTIwZGF5JTNGJTIyKS5pbnB1dF9pZHMlMEElMEElMjMlMjAyJTNBJTIwJyUzQyUyRnMlM0UnJTBBJTIzJTIwMjU2MDQ3JTIwJTNBJTIwJ2VuZ19MYXRuJw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> NllbTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = NllbTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/nllb-200-distilled-600M&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot;How was your day?&quot;</span>).input_ids
[<span class="hljs-number">13374</span>, <span class="hljs-number">1398</span>, <span class="hljs-number">4260</span>, <span class="hljs-number">4039</span>, <span class="hljs-number">248130</span>, <span class="hljs-number">2</span>, <span class="hljs-number">256047</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># 2: &#x27;&lt;/s&gt;&#x27;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># 256047 : &#x27;eng_Latn&#x27;</span>`,wrap:!1}}),se=new Ze({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME5sbGJUb2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBObGxiVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRm5sbGItMjAwLWRpc3RpbGxlZC02MDBNJTIyKSUwQXRva2VuaXplciglMjJIb3clMjB3YXMlMjB5b3VyJTIwZGF5JTNGJTIyKS5pbnB1dF9pZHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> NllbTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = NllbTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/nllb-200-distilled-600M&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot;How was your day?&quot;</span>).input_ids
[<span class="hljs-number">256047</span>, <span class="hljs-number">13374</span>, <span class="hljs-number">1398</span>, <span class="hljs-number">4260</span>, <span class="hljs-number">4039</span>, <span class="hljs-number">248130</span>, <span class="hljs-number">2</span>]`,wrap:!1}}),oe=new Ze({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME5sbGJUb2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBObGxiVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRm5sbGItMjAwLWRpc3RpbGxlZC02MDBNJTIyJTJDJTIwbGVnYWN5X2JlaGF2aW91ciUzRFRydWUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> NllbTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = NllbTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/nllb-200-distilled-600M&quot;</span>, legacy_behaviour=<span class="hljs-literal">True</span>)`,wrap:!1}}),re=new Ge({}),ue=new Ge({}),be=new Ze({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvclNlcTJTZXFMTSUyQyUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRm5sbGItMjAwLWRpc3RpbGxlZC02MDBNJTIyKSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yU2VxMlNlcUxNLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRm5sbGItMjAwLWRpc3RpbGxlZC02MDBNJTIyKSUwQSUwQWFydGljbGUlMjAlM0QlMjAlMjJVTiUyMENoaWVmJTIwc2F5cyUyMHRoZXJlJTIwaXMlMjBubyUyMG1pbGl0YXJ5JTIwc29sdXRpb24lMjBpbiUyMFN5cmlhJTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKGFydGljbGUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXRyYW5zbGF0ZWRfdG9rZW5zJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoJTBBJTIwJTIwJTIwJTIwKippbnB1dHMlMkMlMjBmb3JjZWRfYm9zX3Rva2VuX2lkJTNEdG9rZW5pemVyLmxhbmdfY29kZV90b19pZCU1QiUyMmZyYV9MYXRuJTIyJTVEJTJDJTIwbWF4X2xlbmd0aCUzRDMwJTBBKSUwQXRva2VuaXplci5iYXRjaF9kZWNvZGUodHJhbnNsYXRlZF90b2tlbnMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklNUIwJTVE",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-200-distilled-600M&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForSeq2SeqLM.from_pretrained(<span class="hljs-string">&quot;facebook/nllb-200-distilled-600M&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>article = <span class="hljs-string">&quot;UN Chief says there is no military solution in Syria&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">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>]
Le chef de l<span class="hljs-string">&#x27;ONU dit qu&#x27;</span>il n<span class="hljs-string">&#x27;y a pas de solution militaire en Syrie</span>`,wrap:!1}}),ke=new Ge({}),ve=new Ze({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvclNlcTJTZXFMTSUyQyUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJmYWNlYm9vayUyRm5sbGItMjAwLWRpc3RpbGxlZC02MDBNJTIyJTJDJTIwdXNlX2F1dGhfdG9rZW4lM0RUcnVlJTJDJTIwc3JjX2xhbmclM0QlMjJyb25fTGF0biUyMiUwQSklMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvclNlcTJTZXFMTS5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZubGxiLTIwMC1kaXN0aWxsZWQtNjAwTSUyMiUyQyUyMHVzZV9hdXRoX3Rva2VuJTNEVHJ1ZSklMEElMEFhcnRpY2xlJTIwJTNEJTIwJTIyJUM1JTlFZWZ1bCUyME9OVSUyMHNwdW5lJTIwYyVDNCU4MyUyMG51JTIwZXhpc3QlQzQlODMlMjBvJTIwc29sdSVDNSVBM2llJTIwbWlsaXRhciVDNCU4MyUyMCVDMyVBRW4lMjBTaXJpYSUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihhcnRpY2xlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF0cmFuc2xhdGVkX3Rva2VucyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCUwQSUyMCUyMCUyMCUyMCoqaW5wdXRzJTJDJTIwZm9yY2VkX2Jvc190b2tlbl9pZCUzRHRva2VuaXplci5sYW5nX2NvZGVfdG9faWQlNUIlMjJkZXVfTGF0biUyMiU1RCUyQyUyMG1heF9sZW5ndGglM0QzMCUwQSklMEF0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKHRyYW5zbGF0ZWRfdG9rZW5zJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTVCMCU1RA==",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-meta">... </span>    <span class="hljs-string">&quot;facebook/nllb-200-distilled-600M&quot;</span>, use_auth_token=<span class="hljs-literal">True</span>, src_lang=<span class="hljs-string">&quot;ron_Latn&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForSeq2SeqLM.from_pretrained(<span class="hljs-string">&quot;facebook/nllb-200-distilled-600M&quot;</span>, use_auth_token=<span class="hljs-literal">True</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>]
UN-Chef sagt, es gibt keine militärische Lösung <span class="hljs-keyword">in</span> Syrien`,wrap:!1}}),Me=new Ge({}),Te=new Ge({}),xe=new Le({props:{name:"class transformers.NllbTokenizer",anchor:"transformers.NllbTokenizer",parameters:[{name:"vocab_file",val:""},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"tokenizer_file",val:" = None"},{name:"src_lang",val:" = None"},{name:"tgt_lang",val:" = None"},{name:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"additional_special_tokens",val:" = None"},{name:"legacy_behaviour",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.NllbTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.NllbTokenizer.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.NllbTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence 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 end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.NllbTokenizer.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.NllbTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.NllbTokenizer.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.NllbTokenizer.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"},{anchor:"transformers.NllbTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;mask&gt;&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.NllbTokenizer.tokenizer_file",description:`<strong>tokenizer_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The path to a tokenizer file to use instead of the vocab file.`,name:"tokenizer_file"},{anchor:"transformers.NllbTokenizer.src_lang",description:`<strong>src_lang</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The language to use as source language for translation.`,name:"src_lang"},{anchor:"transformers.NllbTokenizer.tgt_lang",description:`<strong>tgt_lang</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The language to use as target language for translation.`,name:"tgt_lang"},{anchor:"transformers.NllbTokenizer.sp_model_kwargs",description:`<strong>sp_model_kwargs</strong> (<code>Dict[str, str]</code>) &#x2014;
Additional keyword arguments to pass to the model initialization.`,name:"sp_model_kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/nllb/tokenization_nllb.py#L49"}}),B=new Vs({props:{anchor:"transformers.NllbTokenizer.example",$$slots:{default:[Ys]},$$scope:{ctx:Ie}}}),je=new Le({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.NllbTokenizer.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.NllbTokenizer.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.NllbTokenizer.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.34.0/src/transformers/models/nllb/tokenization_nllb.py#L267",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>
`}}),Je=new Ge({}),$e=new Le({props:{name:"class transformers.NllbTokenizerFast",anchor:"transformers.NllbTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"src_lang",val:" = None"},{name:"tgt_lang",val:" = None"},{name:"additional_special_tokens",val:" = None"},{name:"legacy_behaviour",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.NllbTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.NllbTokenizerFast.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.NllbTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence 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 end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.NllbTokenizerFast.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.NllbTokenizerFast.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.NllbTokenizerFast.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.NllbTokenizerFast.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"},{anchor:"transformers.NllbTokenizerFast.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;mask&gt;&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.NllbTokenizerFast.tokenizer_file",description:`<strong>tokenizer_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The path to a tokenizer file to use instead of the vocab file.`,name:"tokenizer_file"},{anchor:"transformers.NllbTokenizerFast.src_lang",description:`<strong>src_lang</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The language to use as source language for translation.`,name:"src_lang"},{anchor:"transformers.NllbTokenizerFast.tgt_lang",description:`<strong>tgt_lang</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The language to use as target language for translation.`,name:"tgt_lang"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/nllb/tokenization_nllb_fast.py#L61"}}),A=new Vs({props:{anchor:"transformers.NllbTokenizerFast.example",$$slots:{default:[Ds]},$$scope:{ctx:Ie}}}),ze=new Le({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.NllbTokenizerFast.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.NllbTokenizerFast.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.NllbTokenizerFast.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.34.0/src/transformers/models/nllb/tokenization_nllb_fast.py#L210",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>
`}}),Ue=new Le({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.NllbTokenizerFast.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.NllbTokenizerFast.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.NllbTokenizerFast.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.34.0/src/transformers/models/nllb/tokenization_nllb_fast.py#L239",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Ne=new Le({props:{name:"set_src_lang_special_tokens",anchor:"transformers.NllbTokenizerFast.set_src_lang_special_tokens",parameters:[{name:"src_lang",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/nllb/tokenization_nllb_fast.py#L294"}}),Ce=new Le({props:{name:"set_tgt_lang_special_tokens",anchor:"transformers.NllbTokenizerFast.set_tgt_lang_special_tokens",parameters:[{name:"lang",val:": str"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/nllb/tokenization_nllb_fast.py#L317"}}),{c(){m=a("meta"),U=r(),x=a("p"),v=r(),M=a("h1"),p=a("a"),J=a("span"),g(D.$$.fragment),on=r(),Ee=a("span"),Ee.textContent=En,_t=r(),Q=a("p"),Q.innerHTML=Wn,yt=r(),O=a("p"),O.innerHTML=Rn,vt=r(),K=a("p"),K.innerHTML=Fn,Mt=r(),ee=a("p"),ee.textContent=Vn,wt=r(),g(te.$$.fragment),Tt=r(),ne=a("p"),ne.textContent=Hn,xt=r(),g(se.$$.fragment),jt=r(),ae=a("p"),ae.textContent=Xn,Jt=r(),g(oe.$$.fragment),$t=r(),le=a("p"),le.innerHTML=Bn,zt=r(),L=a("h2"),R=a("a"),dt=a("span"),g(re.$$.fragment),ln=r(),We=a("span"),We.textContent=Sn,Ut=r(),ie=a("p"),ie.innerHTML=An,Nt=r(),ce=a("p"),ce.textContent=Pn,Ct=r(),pe=a("p"),pe.innerHTML=Yn,qt=r(),de=a("p"),de.textContent=Dn,Lt=r(),he=a("p"),he.innerHTML=Qn,Gt=r(),me=a("p"),me.innerHTML=On,Zt=r(),G=a("h2"),F=a("a"),ht=a("span"),g(ue.$$.fragment),rn=r(),Re=a("span"),Re.textContent=Kn,It=r(),ge=a("p"),ge.innerHTML=es,Et=r(),fe=a("p"),fe.innerHTML=ts,Wt=r(),g(be.$$.fragment),Rt=r(),Z=a("h3"),V=a("a"),mt=a("span"),g(ke.$$.fragment),cn=r(),Fe=a("span"),Fe.textContent=ns,Ft=r(),_e=a("p"),_e.innerHTML=ss,Vt=r(),ye=a("p"),ye.textContent=as,Ht=r(),g(ve.$$.fragment),Xt=r(),I=a("h2"),H=a("a"),ut=a("span"),g(Me.$$.fragment),pn=r(),Ve=a("span"),Ve.textContent=os,Bt=r(),we=a("ul"),we.innerHTML=ls,St=r(),E=a("h2"),X=a("a"),gt=a("span"),g(Te.$$.fragment),dn=r(),He=a("span"),He.textContent=rs,At=r(),T=a("div"),g(xe.$$.fragment),hn=r(),Xe=a("p"),Xe.textContent=is,mn=r(),Be=a("p"),Be.innerHTML=cs,un=r(),Se=a("p"),Se.innerHTML=ps,gn=Rs(`
<tokens> <eos>\` for target language documents.
`),g(B.$$.fragment),fn=r(),$=a("div"),g(je.$$.fragment),bn=r(),Ae=a("p"),Ae.innerHTML=ds,kn=r(),Pe=a("ul"),Pe.innerHTML=hs,_n=r(),Ye=a("p"),Ye.textContent=ms,Pt=r(),W=a("h2"),S=a("a"),ft=a("span"),g(Je.$$.fragment),yn=r(),De=a("span"),De.textContent=us,Yt=r(),u=a("div"),g($e.$$.fragment),vn=r(),Qe=a("p"),Qe.innerHTML=gs,Mn=r(),Oe=a("p"),Oe.innerHTML=fs,wn=r(),Ke=a("p"),Ke.innerHTML=bs,Tn=Rs(`
<tokens> <eos>\` for target language documents.
`),g(A.$$.fragment),xn=r(),j=a("div"),g(ze.$$.fragment),jn=r(),et=a("p"),et.textContent=ks,Jn=r(),tt=a("p"),tt.innerHTML=_s,$n=r(),nt=a("ul"),nt.innerHTML=ys,zn=r(),st=a("p"),st.textContent=vs,Un=r(),P=a("div"),g(Ue.$$.fragment),Nn=r(),at=a("p"),at.textContent=Ms,Cn=r(),N=a("div"),g(Ne.$$.fragment),qn=r(),ot=a("p"),ot.textContent=ws,Ln=r(),lt=a("ul"),lt.innerHTML=Ts,Gn=r(),C=a("div"),g(Ce.$$.fragment),Zn=r(),rt=a("p"),rt.textContent=xs,In=r(),it=a("ul"),it.innerHTML=js,Dt=r(),bt=a("p"),this.h()},l(e){const s=Ps("svelte-1phssyn",document.head);m=o(s,"META",{name:!0,content:!0}),s.forEach(t),U=i(e),x=o(e,"P",{}),h(x).forEach(t),v=i(e),M=o(e,"H1",{class:!0});var qe=h(M);p=o(qe,"A",{id:!0,class:!0,href:!0});var kt=h(p);J=o(kt,"SPAN",{});var Js=h(J);f(D.$$.fragment,Js),Js.forEach(t),kt.forEach(t),on=i(qe),Ee=o(qe,"SPAN",{"data-svelte-h":!0}),c(Ee)!=="svelte-m8m3d1"&&(Ee.textContent=En),qe.forEach(t),_t=i(e),Q=o(e,"P",{"data-svelte-h":!0}),c(Q)!=="svelte-lwvup"&&(Q.innerHTML=Wn),yt=i(e),O=o(e,"P",{"data-svelte-h":!0}),c(O)!=="svelte-7ixket"&&(O.innerHTML=Rn),vt=i(e),K=o(e,"P",{"data-svelte-h":!0}),c(K)!=="svelte-vrv0c7"&&(K.innerHTML=Fn),Mt=i(e),ee=o(e,"P",{"data-svelte-h":!0}),c(ee)!=="svelte-vmuleo"&&(ee.textContent=Vn),wt=i(e),f(te.$$.fragment,e),Tt=i(e),ne=o(e,"P",{"data-svelte-h":!0}),c(ne)!=="svelte-1qx2sah"&&(ne.textContent=Hn),xt=i(e),f(se.$$.fragment,e),jt=i(e),ae=o(e,"P",{"data-svelte-h":!0}),c(ae)!=="svelte-obd9iw"&&(ae.textContent=Xn),Jt=i(e),f(oe.$$.fragment,e),$t=i(e),le=o(e,"P",{"data-svelte-h":!0}),c(le)!=="svelte-ib1bh"&&(le.innerHTML=Bn),zt=i(e),L=o(e,"H2",{class:!0});var Ot=h(L);R=o(Ot,"A",{id:!0,class:!0,href:!0});var $s=h(R);dt=o($s,"SPAN",{});var zs=h(dt);f(re.$$.fragment,zs),zs.forEach(t),$s.forEach(t),ln=i(Ot),We=o(Ot,"SPAN",{"data-svelte-h":!0}),c(We)!=="svelte-vx0qh5"&&(We.textContent=Sn),Ot.forEach(t),Ut=i(e),ie=o(e,"P",{"data-svelte-h":!0}),c(ie)!=="svelte-12x4cpm"&&(ie.innerHTML=An),Nt=i(e),ce=o(e,"P",{"data-svelte-h":!0}),c(ce)!=="svelte-wu27l3"&&(ce.textContent=Pn),Ct=i(e),pe=o(e,"P",{"data-svelte-h":!0}),c(pe)!=="svelte-1j7uypk"&&(pe.innerHTML=Yn),qt=i(e),de=o(e,"P",{"data-svelte-h":!0}),c(de)!=="svelte-1ayd4bm"&&(de.textContent=Dn),Lt=i(e),he=o(e,"P",{"data-svelte-h":!0}),c(he)!=="svelte-qp2ubt"&&(he.innerHTML=Qn),Gt=i(e),me=o(e,"P",{"data-svelte-h":!0}),c(me)!=="svelte-ywl52z"&&(me.innerHTML=On),Zt=i(e),G=o(e,"H2",{class:!0});var Kt=h(G);F=o(Kt,"A",{id:!0,class:!0,href:!0});var Us=h(F);ht=o(Us,"SPAN",{});var Ns=h(ht);f(ue.$$.fragment,Ns),Ns.forEach(t),Us.forEach(t),rn=i(Kt),Re=o(Kt,"SPAN",{"data-svelte-h":!0}),c(Re)!=="svelte-k0md5x"&&(Re.textContent=Kn),Kt.forEach(t),It=i(e),ge=o(e,"P",{"data-svelte-h":!0}),c(ge)!=="svelte-gz9jek"&&(ge.innerHTML=es),Et=i(e),fe=o(e,"P",{"data-svelte-h":!0}),c(fe)!=="svelte-c2ujwv"&&(fe.innerHTML=ts),Wt=i(e),f(be.$$.fragment,e),Rt=i(e),Z=o(e,"H3",{class:!0});var en=h(Z);V=o(en,"A",{id:!0,class:!0,href:!0});var Cs=h(V);mt=o(Cs,"SPAN",{});var qs=h(mt);f(ke.$$.fragment,qs),qs.forEach(t),Cs.forEach(t),cn=i(en),Fe=o(en,"SPAN",{"data-svelte-h":!0}),c(Fe)!=="svelte-1pd6l2"&&(Fe.textContent=ns),en.forEach(t),Ft=i(e),_e=o(e,"P",{"data-svelte-h":!0}),c(_e)!=="svelte-ets0jr"&&(_e.innerHTML=ss),Vt=i(e),ye=o(e,"P",{"data-svelte-h":!0}),c(ye)!=="svelte-14hvt1f"&&(ye.textContent=as),Ht=i(e),f(ve.$$.fragment,e),Xt=i(e),I=o(e,"H2",{class:!0});var tn=h(I);H=o(tn,"A",{id:!0,class:!0,href:!0});var Ls=h(H);ut=o(Ls,"SPAN",{});var Gs=h(ut);f(Me.$$.fragment,Gs),Gs.forEach(t),Ls.forEach(t),pn=i(tn),Ve=o(tn,"SPAN",{"data-svelte-h":!0}),c(Ve)!=="svelte-n3f0j0"&&(Ve.textContent=os),tn.forEach(t),Bt=i(e),we=o(e,"UL",{"data-svelte-h":!0}),c(we)!=="svelte-6ej6p2"&&(we.innerHTML=ls),St=i(e),E=o(e,"H2",{class:!0});var nn=h(E);X=o(nn,"A",{id:!0,class:!0,href:!0});var Zs=h(X);gt=o(Zs,"SPAN",{});var Is=h(gt);f(Te.$$.fragment,Is),Is.forEach(t),Zs.forEach(t),dn=i(nn),He=o(nn,"SPAN",{"data-svelte-h":!0}),c(He)!=="svelte-1eolorq"&&(He.textContent=rs),nn.forEach(t),At=i(e),T=o(e,"DIV",{class:!0});var z=h(T);f(xe.$$.fragment,z),hn=i(z),Xe=o(z,"P",{"data-svelte-h":!0}),c(Xe)!=="svelte-7mmiyn"&&(Xe.textContent=is),mn=i(z),Be=o(z,"P",{"data-svelte-h":!0}),c(Be)!=="svelte-z2kpmr"&&(Be.innerHTML=cs),un=i(z),Se=o(z,"P",{"data-svelte-h":!0}),c(Se)!=="svelte-1i8rh37"&&(Se.innerHTML=ps),gn=Fs(z,`
<tokens> <eos>\` for target language documents.
`),f(B.$$.fragment,z),fn=i(z),$=o(z,"DIV",{class:!0});var Y=h($);f(je.$$.fragment,Y),bn=i(Y),Ae=o(Y,"P",{"data-svelte-h":!0}),c(Ae)!=="svelte-nkpot4"&&(Ae.innerHTML=ds),kn=i(Y),Pe=o(Y,"UL",{"data-svelte-h":!0}),c(Pe)!=="svelte-mlrsks"&&(Pe.innerHTML=hs),_n=i(Y),Ye=o(Y,"P",{"data-svelte-h":!0}),c(Ye)!=="svelte-46aam0"&&(Ye.textContent=ms),Y.forEach(t),z.forEach(t),Pt=i(e),W=o(e,"H2",{class:!0});var sn=h(W);S=o(sn,"A",{id:!0,class:!0,href:!0});var Es=h(S);ft=o(Es,"SPAN",{});var Ws=h(ft);f(Je.$$.fragment,Ws),Ws.forEach(t),Es.forEach(t),yn=i(sn),De=o(sn,"SPAN",{"data-svelte-h":!0}),c(De)!=="svelte-71pu64"&&(De.textContent=us),sn.forEach(t),Yt=i(e),u=o(e,"DIV",{class:!0});var w=h(u);f($e.$$.fragment,w),vn=i(w),Qe=o(w,"P",{"data-svelte-h":!0}),c(Qe)!=="svelte-g5z8ln"&&(Qe.innerHTML=gs),Mn=i(w),Oe=o(w,"P",{"data-svelte-h":!0}),c(Oe)!=="svelte-ttxvs6"&&(Oe.innerHTML=fs),wn=i(w),Ke=o(w,"P",{"data-svelte-h":!0}),c(Ke)!=="svelte-1i8rh37"&&(Ke.innerHTML=bs),Tn=Fs(w,`
<tokens> <eos>\` for target language documents.
`),f(A.$$.fragment,w),xn=i(w),j=o(w,"DIV",{class:!0});var q=h(j);f(ze.$$.fragment,q),jn=i(q),et=o(q,"P",{"data-svelte-h":!0}),c(et)!=="svelte-1vll0v2"&&(et.textContent=ks),Jn=i(q),tt=o(q,"P",{"data-svelte-h":!0}),c(tt)!=="svelte-90np8u"&&(tt.innerHTML=_s),$n=i(q),nt=o(q,"UL",{"data-svelte-h":!0}),c(nt)!=="svelte-mlrsks"&&(nt.innerHTML=ys),zn=i(q),st=o(q,"P",{"data-svelte-h":!0}),c(st)!=="svelte-46aam0"&&(st.textContent=vs),q.forEach(t),Un=i(w),P=o(w,"DIV",{class:!0});var an=h(P);f(Ue.$$.fragment,an),Nn=i(an),at=o(an,"P",{"data-svelte-h":!0}),c(at)!=="svelte-1bcwf97"&&(at.textContent=Ms),an.forEach(t),Cn=i(w),N=o(w,"DIV",{class:!0});var ct=h(N);f(Ne.$$.fragment,ct),qn=i(ct),ot=o(ct,"P",{"data-svelte-h":!0}),c(ot)!=="svelte-1euodjq"&&(ot.textContent=ws),Ln=i(ct),lt=o(ct,"UL",{"data-svelte-h":!0}),c(lt)!=="svelte-rrgzfj"&&(lt.innerHTML=Ts),ct.forEach(t),Gn=i(w),C=o(w,"DIV",{class:!0});var pt=h(C);f(Ce.$$.fragment,pt),Zn=i(pt),rt=o(pt,"P",{"data-svelte-h":!0}),c(rt)!=="svelte-1i6tlcm"&&(rt.textContent=xs),In=i(pt),it=o(pt,"UL",{"data-svelte-h":!0}),c(it)!=="svelte-1durotj"&&(it.innerHTML=js),pt.forEach(t),w.forEach(t),Dt=i(e),bt=o(e,"P",{}),h(bt).forEach(t),this.h()},h(){d(m,"name","hf:doc:metadata"),d(m,"content",JSON.stringify(Os)),d(p,"id","transformers.NllbTokenizer"),d(p,"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"),d(p,"href","#transformers.NllbTokenizer"),d(M,"class","relative group"),d(R,"id","overview-of-nllb"),d(R,"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"),d(R,"href","#overview-of-nllb"),d(L,"class","relative group"),d(F,"id","generating-with-nllb"),d(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"),d(F,"href","#generating-with-nllb"),d(G,"class","relative group"),d(V,"id","generating-from-any-other-language-than-english"),d(V,"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"),d(V,"href","#generating-from-any-other-language-than-english"),d(Z,"class","relative group"),d(H,"id","documentation-resources"),d(H,"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"),d(H,"href","#documentation-resources"),d(I,"class","relative group"),d(X,"id","nllbtokenizer"),d(X,"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"),d(X,"href","#nllbtokenizer"),d(E,"class","relative group"),d($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(S,"id","nllbtokenizerfast"),d(S,"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"),d(S,"href","#nllbtokenizerfast"),d(W,"class","relative group"),d(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(u,"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,s){n(document.head,m),l(e,U,s),l(e,x,s),l(e,v,s),l(e,M,s),n(M,p),n(p,J),b(D,J,null),n(M,on),n(M,Ee),l(e,_t,s),l(e,Q,s),l(e,yt,s),l(e,O,s),l(e,vt,s),l(e,K,s),l(e,Mt,s),l(e,ee,s),l(e,wt,s),b(te,e,s),l(e,Tt,s),l(e,ne,s),l(e,xt,s),b(se,e,s),l(e,jt,s),l(e,ae,s),l(e,Jt,s),b(oe,e,s),l(e,$t,s),l(e,le,s),l(e,zt,s),l(e,L,s),n(L,R),n(R,dt),b(re,dt,null),n(L,ln),n(L,We),l(e,Ut,s),l(e,ie,s),l(e,Nt,s),l(e,ce,s),l(e,Ct,s),l(e,pe,s),l(e,qt,s),l(e,de,s),l(e,Lt,s),l(e,he,s),l(e,Gt,s),l(e,me,s),l(e,Zt,s),l(e,G,s),n(G,F),n(F,ht),b(ue,ht,null),n(G,rn),n(G,Re),l(e,It,s),l(e,ge,s),l(e,Et,s),l(e,fe,s),l(e,Wt,s),b(be,e,s),l(e,Rt,s),l(e,Z,s),n(Z,V),n(V,mt),b(ke,mt,null),n(Z,cn),n(Z,Fe),l(e,Ft,s),l(e,_e,s),l(e,Vt,s),l(e,ye,s),l(e,Ht,s),b(ve,e,s),l(e,Xt,s),l(e,I,s),n(I,H),n(H,ut),b(Me,ut,null),n(I,pn),n(I,Ve),l(e,Bt,s),l(e,we,s),l(e,St,s),l(e,E,s),n(E,X),n(X,gt),b(Te,gt,null),n(E,dn),n(E,He),l(e,At,s),l(e,T,s),b(xe,T,null),n(T,hn),n(T,Xe),n(T,mn),n(T,Be),n(T,un),n(T,Se),n(T,gn),b(B,T,null),n(T,fn),n(T,$),b(je,$,null),n($,bn),n($,Ae),n($,kn),n($,Pe),n($,_n),n($,Ye),l(e,Pt,s),l(e,W,s),n(W,S),n(S,ft),b(Je,ft,null),n(W,yn),n(W,De),l(e,Yt,s),l(e,u,s),b($e,u,null),n(u,vn),n(u,Qe),n(u,Mn),n(u,Oe),n(u,wn),n(u,Ke),n(u,Tn),b(A,u,null),n(u,xn),n(u,j),b(ze,j,null),n(j,jn),n(j,et),n(j,Jn),n(j,tt),n(j,$n),n(j,nt),n(j,zn),n(j,st),n(u,Un),n(u,P),b(Ue,P,null),n(P,Nn),n(P,at),n(u,Cn),n(u,N),b(Ne,N,null),n(N,qn),n(N,ot),n(N,Ln),n(N,lt),n(u,Gn),n(u,C),b(Ce,C,null),n(C,Zn),n(C,rt),n(C,In),n(C,it),l(e,Dt,s),l(e,bt,s),Qt=!0},p(e,[s]){const qe={};s&2&&(qe.$$scope={dirty:s,ctx:e}),B.$set(qe);const kt={};s&2&&(kt.$$scope={dirty:s,ctx:e}),A.$set(kt)},i(e){Qt||(k(D.$$.fragment,e),k(te.$$.fragment,e),k(se.$$.fragment,e),k(oe.$$.fragment,e),k(re.$$.fragment,e),k(ue.$$.fragment,e),k(be.$$.fragment,e),k(ke.$$.fragment,e),k(ve.$$.fragment,e),k(Me.$$.fragment,e),k(Te.$$.fragment,e),k(xe.$$.fragment,e),k(B.$$.fragment,e),k(je.$$.fragment,e),k(Je.$$.fragment,e),k($e.$$.fragment,e),k(A.$$.fragment,e),k(ze.$$.fragment,e),k(Ue.$$.fragment,e),k(Ne.$$.fragment,e),k(Ce.$$.fragment,e),Qt=!0)},o(e){_(D.$$.fragment,e),_(te.$$.fragment,e),_(se.$$.fragment,e),_(oe.$$.fragment,e),_(re.$$.fragment,e),_(ue.$$.fragment,e),_(be.$$.fragment,e),_(ke.$$.fragment,e),_(ve.$$.fragment,e),_(Me.$$.fragment,e),_(Te.$$.fragment,e),_(xe.$$.fragment,e),_(B.$$.fragment,e),_(je.$$.fragment,e),_(Je.$$.fragment,e),_($e.$$.fragment,e),_(A.$$.fragment,e),_(ze.$$.fragment,e),_(Ue.$$.fragment,e),_(Ne.$$.fragment,e),_(Ce.$$.fragment,e),Qt=!1},d(e){e&&(t(U),t(x),t(v),t(M),t(_t),t(Q),t(yt),t(O),t(vt),t(K),t(Mt),t(ee),t(wt),t(Tt),t(ne),t(xt),t(jt),t(ae),t(Jt),t($t),t(le),t(zt),t(L),t(Ut),t(ie),t(Nt),t(ce),t(Ct),t(pe),t(qt),t(de),t(Lt),t(he),t(Gt),t(me),t(Zt),t(G),t(It),t(ge),t(Et),t(fe),t(Wt),t(Rt),t(Z),t(Ft),t(_e),t(Vt),t(ye),t(Ht),t(Xt),t(I),t(Bt),t(we),t(St),t(E),t(At),t(T),t(Pt),t(W),t(Yt),t(u),t(Dt),t(bt)),t(m),y(D),y(te,e),y(se,e),y(oe,e),y(re),y(ue),y(be,e),y(ke),y(ve,e),y(Me),y(Te),y(xe),y(B),y(je),y(Je),y($e),y(A),y(ze),y(Ue),y(Ne),y(Ce)}}}const Os={local:"transformers.NllbTokenizer",title:"NLLB"};function Ks(Ie){return Bs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class la extends Ss{constructor(m){super(),As(this,m,Ks,Qs,Xs,{})}}export{la as component};
