import{S as ql,i as Il,s as Gl,e as s,k as c,w as b,t as r,M as Ll,c as n,d as a,m as d,a as o,x as k,h as l,b as h,G as t,g as p,y as _,q as y,o as v,B as w,v as Zl,L as xl}from"../../chunks/vendor-hf-doc-builder.js";import{D as Ye}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Qe}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as He}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ul}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Bl(Oe){let m,N,M,u,j;return u=new Qe({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>)`}}),{c(){m=s("p"),N=r("Examples:"),M=c(),b(u.$$.fragment)},l(f){m=n(f,"P",{});var E=o(m);N=l(E,"Examples:"),E.forEach(a),M=d(f),k(u.$$.fragment,f)},m(f,E){p(f,m,E),t(m,N),p(f,M,E),_(u,f,E),j=!0},p:xl,i(f){j||(y(u.$$.fragment,f),j=!0)},o(f){v(u.$$.fragment,f),j=!1},d(f){f&&a(m),f&&a(M),w(u,f)}}}function Fl(Oe){let m,N,M,u,j;return u=new Qe({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>)`}}),{c(){m=s("p"),N=r("Examples:"),M=c(),b(u.$$.fragment)},l(f){m=n(f,"P",{});var E=o(m);N=l(E,"Examples:"),E.forEach(a),M=d(f),k(u.$$.fragment,f)},m(f,E){p(f,m,E),t(m,N),p(f,M,E),_(u,f,E),j=!0},p:xl,i(f){j||(y(u.$$.fragment,f),j=!0)},o(f){v(u.$$.fragment,f),j=!1},d(f){f&&a(m),f&&a(M),w(u,f)}}}function Rl(Oe){let m,N,M,u,j,f,E,Et,vs,wa,de,Jt,ws,Ms,Ma,H,Ts,jt,Es,Js,Ta,Ke,zt,js,Ea,et,zs,Ja,pe,ja,tt,Ns,za,he,Na,at,$s,$a,fe,Ua,q,Us,ue,xs,qs,me,Is,Gs,xa,C,Q,Nt,ge,Ls,$t,Zs,qa,O,Bs,be,Fs,Rs,Ia,st,Cs,Ga,nt,Ut,Ws,La,ot,Ss,Za,rt,lt,Xs,it,Vs,Ba,I,As,ke,Ds,Ps,_e,Ys,Hs,Fa,W,K,xt,ye,Qs,qt,Os,Ra,G,Ks,It,en,tn,Gt,an,sn,Ca,L,nn,Lt,on,rn,ve,ln,cn,Wa,we,Sa,S,ee,Zt,Me,dn,Bt,pn,Xa,Z,hn,Ft,fn,un,Rt,mn,gn,Va,ct,bn,Aa,Te,Da,X,te,Ct,Ee,kn,Wt,_n,Pa,ae,St,dt,yn,vn,Xt,pt,wn,Ya,V,se,Vt,Je,Mn,At,Tn,Ha,J,je,En,Dt,Jn,jn,x,zn,ht,Nn,$n,ft,Un,xn,ze,qn,In,Gn,A,Ln,Pt,Zn,Bn,Yt,Fn,Rn,Cn,ne,Wn,$,Ne,Sn,$e,Xn,Ht,Vn,An,Dn,Ue,xe,Qt,Pn,Yn,Ot,Hn,Qn,qe,Kt,On,Kn,ea,eo,to,ta,ao,Qa,D,oe,aa,Ie,so,sa,no,Oa,g,Ge,oo,P,ro,na,lo,io,Le,co,po,ho,Ze,fo,ut,uo,mo,go,Y,bo,oa,ko,_o,ra,yo,vo,wo,re,Mo,z,Be,To,la,Eo,Jo,Fe,jo,ia,zo,No,$o,Re,Ce,ca,Uo,xo,da,qo,Io,We,pa,Go,Lo,ha,Zo,Bo,fa,Fo,Ro,le,Se,Co,ua,Wo,So,B,Xe,Xo,ma,Vo,Ao,Ve,ga,Do,Po,ba,Yo,Ho,F,Ae,Qo,ka,Oo,Ko,De,_a,er,tr,ya,ar,Ka;return f=new He({}),pe=new Qe({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>`}}),he=new Qe({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>]`}}),fe=new Qe({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>)`}}),ge=new He({}),ye=new He({}),we=new Qe({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>`}}),Me=new He({}),Te=new Qe({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;\u015Eeful ONU spune c\u0103 nu exist\u0103 o solu\u0163ie militar\u0103 \xEEn 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\xE4rische L\xF6sung <span class="hljs-keyword">in</span> Syrien`}}),Ee=new He({}),Je=new He({}),je=new Ye({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.31.0/src/transformers/models/nllb/tokenization_nllb.py#L49"}}),ne=new Ul({props:{anchor:"transformers.NllbTokenizer.example",$$slots:{default:[Bl]},$$scope:{ctx:Oe}}}),Ne=new Ye({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.31.0/src/transformers/models/nllb/tokenization_nllb.py#L265",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>
`}}),Ie=new He({}),Ge=new Ye({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.31.0/src/transformers/models/nllb/tokenization_nllb_fast.py#L61"}}),re=new Ul({props:{anchor:"transformers.NllbTokenizerFast.example",$$slots:{default:[Fl]},$$scope:{ctx:Oe}}}),Be=new Ye({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.31.0/src/transformers/models/nllb/tokenization_nllb_fast.py#L207",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>
`}}),Se=new Ye({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.31.0/src/transformers/models/nllb/tokenization_nllb_fast.py#L236",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Xe=new Ye({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.31.0/src/transformers/models/nllb/tokenization_nllb_fast.py#L291"}}),Ae=new Ye({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.31.0/src/transformers/models/nllb/tokenization_nllb_fast.py#L314"}}),{c(){m=s("meta"),N=c(),M=s("h1"),u=s("a"),j=s("span"),b(f.$$.fragment),E=c(),Et=s("span"),vs=r("NLLB"),wa=c(),de=s("p"),Jt=s("strong"),ws=r("DISCLAIMER:"),Ms=r(" The default behaviour for the tokenizer has recently been fixed (and thus changed)!"),Ma=c(),H=s("p"),Ts=r("The previous version adds "),jt=s("code"),Es=r("[self.eos_token_id, self.cur_lang_code]"),Js=r(" 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) :"),Ta=c(),Ke=s("p"),zt=s("em"),js=r(`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.`),Ea=c(),et=s("p"),zs=r("Previous behaviour:"),Ja=c(),b(pe.$$.fragment),ja=c(),tt=s("p"),Ns=r("New behaviour"),za=c(),b(he.$$.fragment),Na=c(),at=s("p"),$s=r("Enabling the old behaviour can be done as follows:"),$a=c(),b(fe.$$.fragment),Ua=c(),q=s("p"),Us=r("For more details, feel free to check the linked "),ue=s("a"),xs=r("PR"),qs=r(" and "),me=s("a"),Is=r("Issue"),Gs=r("."),xa=c(),C=s("h2"),Q=s("a"),Nt=s("span"),b(ge.$$.fragment),Ls=c(),$t=s("span"),Zs=r("Overview of NLLB"),qa=c(),O=s("p"),Bs=r("The NLLB model was presented in "),be=s("a"),Fs=r("No Language Left Behind: Scaling Human-Centered Machine Translation"),Rs=r(` by Marta R. Costa-juss\xE0, James Cross, Onur \xC7elebi,
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\xE1n, Philipp Koehn, Alexandre Mourachko, Christophe Ropers,
Safiyyah Saleem, Holger Schwenk, and Jeff Wang.`),Ia=c(),st=s("p"),Cs=r("The abstract of the paper is the following:"),Ga=c(),nt=s("p"),Ut=s("em"),Ws=r(`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.`),La=c(),ot=s("p"),Ss=r("This implementation contains the dense models available on release."),Za=c(),rt=s("p"),lt=s("strong"),Xs=r("The sparse model NLLB-MoE (Mixture of Expert) is now available! More details "),it=s("a"),Vs=r("here"),Ba=c(),I=s("p"),As=r("This model was contributed by "),ke=s("a"),Ds=r("Lysandre"),Ps=r(". The authors\u2019 code can be found "),_e=s("a"),Ys=r("here"),Hs=r("."),Fa=c(),W=s("h2"),K=s("a"),xt=s("span"),b(ye.$$.fragment),Qs=c(),qt=s("span"),Os=r("Generating with NLLB"),Ra=c(),G=s("p"),Ks=r("While generating the target text set the "),It=s("code"),en=r("forced_bos_token_id"),tn=r(` to the target language id. The following
example shows how to translate English to French using the `),Gt=s("em"),an=r("facebook/nllb-200-distilled-600M"),sn=r(" model."),Ca=c(),L=s("p"),nn=r("Note that we\u2019re using the BCP-47 code for French "),Lt=s("code"),on=r("fra_Latn"),rn=r(". See "),ve=s("a"),ln=r("here"),cn=r(`
for the list of all BCP-47 in the Flores 200 dataset.`),Wa=c(),b(we.$$.fragment),Sa=c(),S=s("h3"),ee=s("a"),Zt=s("span"),b(Me.$$.fragment),dn=c(),Bt=s("span"),pn=r("Generating from any other language than English"),Xa=c(),Z=s("p"),hn=r("English ("),Ft=s("code"),fn=r("eng_Latn"),un=r(`) is set as the default language from which to translate. In order to specify that you\u2019d like to translate from a different language,
you should specify the BCP-47 code in the `),Rt=s("code"),mn=r("src_lang"),gn=r(" keyword argument of the tokenizer initialization."),Va=c(),ct=s("p"),bn=r("See example below for a translation from romanian to german:"),Aa=c(),b(Te.$$.fragment),Da=c(),X=s("h2"),te=s("a"),Ct=s("span"),b(Ee.$$.fragment),kn=c(),Wt=s("span"),_n=r("Documentation resources"),Pa=c(),ae=s("ul"),St=s("li"),dt=s("a"),yn=r("Translation task guide"),vn=c(),Xt=s("li"),pt=s("a"),wn=r("Summarization task guide"),Ya=c(),V=s("h2"),se=s("a"),Vt=s("span"),b(Je.$$.fragment),Mn=c(),At=s("span"),Tn=r("NllbTokenizer"),Ha=c(),J=s("div"),b(je.$$.fragment),En=c(),Dt=s("p"),Jn=r("Construct an NLLB tokenizer."),jn=c(),x=s("p"),zn=r("Adapted from "),ht=s("a"),Nn=r("RobertaTokenizer"),$n=r(" and "),ft=s("a"),Un=r("XLNetTokenizer"),xn=r(`. Based on
`),ze=s("a"),qn=r("SentencePiece"),In=r("."),Gn=c(),A=s("p"),Ln=r("The tokenization method is "),Pt=s("code"),Zn=r("<tokens> <eos> <language code>"),Bn=r(" for source language documents, and "),Yt=s("code"),Fn=r("<language code> <tokens> <eos>"),Rn=r(" for target language documents."),Cn=c(),b(ne.$$.fragment),Wn=c(),$=s("div"),b(Ne.$$.fragment),Sn=c(),$e=s("p"),Xn=r(`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 `),Ht=s("code"),Vn=r("X"),An=r(" represents the sequence:"),Dn=c(),Ue=s("ul"),xe=s("li"),Qt=s("code"),Pn=r("input_ids"),Yn=r(" (for encoder) "),Ot=s("code"),Hn=r("X [eos, src_lang_code]"),Qn=c(),qe=s("li"),Kt=s("code"),On=r("decoder_input_ids"),Kn=r(": (for decoder) "),ea=s("code"),eo=r("X [eos, tgt_lang_code]"),to=c(),ta=s("p"),ao=r(`BOS is never used. Pairs of sequences are not the expected use case, but they will be handled without a
separator.`),Qa=c(),D=s("h2"),oe=s("a"),aa=s("span"),b(Ie.$$.fragment),so=c(),sa=s("span"),no=r("NllbTokenizerFast"),Oa=c(),g=s("div"),b(Ge.$$.fragment),oo=c(),P=s("p"),ro=r("Construct a \u201Cfast\u201D NLLB tokenizer (backed by HuggingFace\u2019s "),na=s("em"),lo=r("tokenizers"),io=r(` library). Based on
`),Le=s("a"),co=r("BPE"),po=r("."),ho=c(),Ze=s("p"),fo=r("This tokenizer inherits from "),ut=s("a"),uo=r("PreTrainedTokenizerFast"),mo=r(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),go=c(),Y=s("p"),bo=r("The tokenization method is "),oa=s("code"),ko=r("<tokens> <eos> <language code>"),_o=r(" for source language documents, and "),ra=s("code"),yo=r("<language code> <tokens> <eos>"),vo=r(" for target language documents."),wo=c(),b(re.$$.fragment),Mo=c(),z=s("div"),b(Be.$$.fragment),To=c(),la=s("p"),Eo=r(`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.`),Jo=c(),Fe=s("p"),jo=r("An NLLB sequence has the following format, where "),ia=s("code"),zo=r("X"),No=r(" represents the sequence:"),$o=c(),Re=s("ul"),Ce=s("li"),ca=s("code"),Uo=r("input_ids"),xo=r(" (for encoder) "),da=s("code"),qo=r("X [eos, src_lang_code]"),Io=c(),We=s("li"),pa=s("code"),Go=r("decoder_input_ids"),Lo=r(": (for decoder) "),ha=s("code"),Zo=r("X [eos, tgt_lang_code]"),Bo=c(),fa=s("p"),Fo=r(`BOS is never used. Pairs of sequences are not the expected use case, but they will be handled without a
separator.`),Ro=c(),le=s("div"),b(Se.$$.fragment),Co=c(),ua=s("p"),Wo=r(`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.`),So=c(),B=s("div"),b(Xe.$$.fragment),Xo=c(),ma=s("p"),Vo=r("Reset the special tokens to the source lang setting."),Ao=c(),Ve=s("ul"),ga=s("li"),Do=r("In legacy mode: No prefix and suffix=[eos, src_lang_code]."),Po=c(),ba=s("li"),Yo=r("In default mode: Prefix=[src_lang_code], suffix = [eos]"),Ho=c(),F=s("div"),b(Ae.$$.fragment),Qo=c(),ka=s("p"),Oo=r("Reset the special tokens to the target lang setting."),Ko=c(),De=s("ul"),_a=s("li"),er=r("In legacy mode: No prefix and suffix=[eos, tgt_lang_code]."),tr=c(),ya=s("li"),ar=r("In default mode: Prefix=[tgt_lang_code], suffix = [eos]"),this.h()},l(e){const i=Ll('[data-svelte="svelte-1phssyn"]',document.head);m=n(i,"META",{name:!0,content:!0}),i.forEach(a),N=d(e),M=n(e,"H1",{class:!0});var Pe=o(M);u=n(Pe,"A",{id:!0,class:!0,href:!0});var va=o(u);j=n(va,"SPAN",{});var or=o(j);k(f.$$.fragment,or),or.forEach(a),va.forEach(a),E=d(Pe),Et=n(Pe,"SPAN",{});var rr=o(Et);vs=l(rr,"NLLB"),rr.forEach(a),Pe.forEach(a),wa=d(e),de=n(e,"P",{});var sr=o(de);Jt=n(sr,"STRONG",{});var lr=o(Jt);ws=l(lr,"DISCLAIMER:"),lr.forEach(a),Ms=l(sr," The default behaviour for the tokenizer has recently been fixed (and thus changed)!"),sr.forEach(a),Ma=d(e),H=n(e,"P",{});var es=o(H);Ts=l(es,"The previous version adds "),jt=n(es,"CODE",{});var ir=o(jt);Es=l(ir,"[self.eos_token_id, self.cur_lang_code]"),ir.forEach(a),Js=l(es," 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) :"),es.forEach(a),Ta=d(e),Ke=n(e,"P",{});var cr=o(Ke);zt=n(cr,"EM",{});var dr=o(zt);js=l(dr,`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.`),dr.forEach(a),cr.forEach(a),Ea=d(e),et=n(e,"P",{});var pr=o(et);zs=l(pr,"Previous behaviour:"),pr.forEach(a),Ja=d(e),k(pe.$$.fragment,e),ja=d(e),tt=n(e,"P",{});var hr=o(tt);Ns=l(hr,"New behaviour"),hr.forEach(a),za=d(e),k(he.$$.fragment,e),Na=d(e),at=n(e,"P",{});var fr=o(at);$s=l(fr,"Enabling the old behaviour can be done as follows:"),fr.forEach(a),$a=d(e),k(fe.$$.fragment,e),Ua=d(e),q=n(e,"P",{});var mt=o(q);Us=l(mt,"For more details, feel free to check the linked "),ue=n(mt,"A",{href:!0,rel:!0});var ur=o(ue);xs=l(ur,"PR"),ur.forEach(a),qs=l(mt," and "),me=n(mt,"A",{href:!0,rel:!0});var mr=o(me);Is=l(mr,"Issue"),mr.forEach(a),Gs=l(mt,"."),mt.forEach(a),xa=d(e),C=n(e,"H2",{class:!0});var ts=o(C);Q=n(ts,"A",{id:!0,class:!0,href:!0});var gr=o(Q);Nt=n(gr,"SPAN",{});var br=o(Nt);k(ge.$$.fragment,br),br.forEach(a),gr.forEach(a),Ls=d(ts),$t=n(ts,"SPAN",{});var kr=o($t);Zs=l(kr,"Overview of NLLB"),kr.forEach(a),ts.forEach(a),qa=d(e),O=n(e,"P",{});var as=o(O);Bs=l(as,"The NLLB model was presented in "),be=n(as,"A",{href:!0,rel:!0});var _r=o(be);Fs=l(_r,"No Language Left Behind: Scaling Human-Centered Machine Translation"),_r.forEach(a),Rs=l(as,` by Marta R. Costa-juss\xE0, James Cross, Onur \xC7elebi,
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\xE1n, Philipp Koehn, Alexandre Mourachko, Christophe Ropers,
Safiyyah Saleem, Holger Schwenk, and Jeff Wang.`),as.forEach(a),Ia=d(e),st=n(e,"P",{});var yr=o(st);Cs=l(yr,"The abstract of the paper is the following:"),yr.forEach(a),Ga=d(e),nt=n(e,"P",{});var vr=o(nt);Ut=n(vr,"EM",{});var wr=o(Ut);Ws=l(wr,`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.`),wr.forEach(a),vr.forEach(a),La=d(e),ot=n(e,"P",{});var Mr=o(ot);Ss=l(Mr,"This implementation contains the dense models available on release."),Mr.forEach(a),Za=d(e),rt=n(e,"P",{});var Tr=o(rt);lt=n(Tr,"STRONG",{});var nr=o(lt);Xs=l(nr,"The sparse model NLLB-MoE (Mixture of Expert) is now available! More details "),it=n(nr,"A",{href:!0});var Er=o(it);Vs=l(Er,"here"),Er.forEach(a),nr.forEach(a),Tr.forEach(a),Ba=d(e),I=n(e,"P",{});var gt=o(I);As=l(gt,"This model was contributed by "),ke=n(gt,"A",{href:!0,rel:!0});var Jr=o(ke);Ds=l(Jr,"Lysandre"),Jr.forEach(a),Ps=l(gt,". The authors\u2019 code can be found "),_e=n(gt,"A",{href:!0,rel:!0});var jr=o(_e);Ys=l(jr,"here"),jr.forEach(a),Hs=l(gt,"."),gt.forEach(a),Fa=d(e),W=n(e,"H2",{class:!0});var ss=o(W);K=n(ss,"A",{id:!0,class:!0,href:!0});var zr=o(K);xt=n(zr,"SPAN",{});var Nr=o(xt);k(ye.$$.fragment,Nr),Nr.forEach(a),zr.forEach(a),Qs=d(ss),qt=n(ss,"SPAN",{});var $r=o(qt);Os=l($r,"Generating with NLLB"),$r.forEach(a),ss.forEach(a),Ra=d(e),G=n(e,"P",{});var bt=o(G);Ks=l(bt,"While generating the target text set the "),It=n(bt,"CODE",{});var Ur=o(It);en=l(Ur,"forced_bos_token_id"),Ur.forEach(a),tn=l(bt,` to the target language id. The following
example shows how to translate English to French using the `),Gt=n(bt,"EM",{});var xr=o(Gt);an=l(xr,"facebook/nllb-200-distilled-600M"),xr.forEach(a),sn=l(bt," model."),bt.forEach(a),Ca=d(e),L=n(e,"P",{});var kt=o(L);nn=l(kt,"Note that we\u2019re using the BCP-47 code for French "),Lt=n(kt,"CODE",{});var qr=o(Lt);on=l(qr,"fra_Latn"),qr.forEach(a),rn=l(kt,". See "),ve=n(kt,"A",{href:!0,rel:!0});var Ir=o(ve);ln=l(Ir,"here"),Ir.forEach(a),cn=l(kt,`
for the list of all BCP-47 in the Flores 200 dataset.`),kt.forEach(a),Wa=d(e),k(we.$$.fragment,e),Sa=d(e),S=n(e,"H3",{class:!0});var ns=o(S);ee=n(ns,"A",{id:!0,class:!0,href:!0});var Gr=o(ee);Zt=n(Gr,"SPAN",{});var Lr=o(Zt);k(Me.$$.fragment,Lr),Lr.forEach(a),Gr.forEach(a),dn=d(ns),Bt=n(ns,"SPAN",{});var Zr=o(Bt);pn=l(Zr,"Generating from any other language than English"),Zr.forEach(a),ns.forEach(a),Xa=d(e),Z=n(e,"P",{});var _t=o(Z);hn=l(_t,"English ("),Ft=n(_t,"CODE",{});var Br=o(Ft);fn=l(Br,"eng_Latn"),Br.forEach(a),un=l(_t,`) is set as the default language from which to translate. In order to specify that you\u2019d like to translate from a different language,
you should specify the BCP-47 code in the `),Rt=n(_t,"CODE",{});var Fr=o(Rt);mn=l(Fr,"src_lang"),Fr.forEach(a),gn=l(_t," keyword argument of the tokenizer initialization."),_t.forEach(a),Va=d(e),ct=n(e,"P",{});var Rr=o(ct);bn=l(Rr,"See example below for a translation from romanian to german:"),Rr.forEach(a),Aa=d(e),k(Te.$$.fragment,e),Da=d(e),X=n(e,"H2",{class:!0});var os=o(X);te=n(os,"A",{id:!0,class:!0,href:!0});var Cr=o(te);Ct=n(Cr,"SPAN",{});var Wr=o(Ct);k(Ee.$$.fragment,Wr),Wr.forEach(a),Cr.forEach(a),kn=d(os),Wt=n(os,"SPAN",{});var Sr=o(Wt);_n=l(Sr,"Documentation resources"),Sr.forEach(a),os.forEach(a),Pa=d(e),ae=n(e,"UL",{});var rs=o(ae);St=n(rs,"LI",{});var Xr=o(St);dt=n(Xr,"A",{href:!0});var Vr=o(dt);yn=l(Vr,"Translation task guide"),Vr.forEach(a),Xr.forEach(a),vn=d(rs),Xt=n(rs,"LI",{});var Ar=o(Xt);pt=n(Ar,"A",{href:!0});var Dr=o(pt);wn=l(Dr,"Summarization task guide"),Dr.forEach(a),Ar.forEach(a),rs.forEach(a),Ya=d(e),V=n(e,"H2",{class:!0});var ls=o(V);se=n(ls,"A",{id:!0,class:!0,href:!0});var Pr=o(se);Vt=n(Pr,"SPAN",{});var Yr=o(Vt);k(Je.$$.fragment,Yr),Yr.forEach(a),Pr.forEach(a),Mn=d(ls),At=n(ls,"SPAN",{});var Hr=o(At);Tn=l(Hr,"NllbTokenizer"),Hr.forEach(a),ls.forEach(a),Ha=d(e),J=n(e,"DIV",{class:!0});var U=o(J);k(je.$$.fragment,U),En=d(U),Dt=n(U,"P",{});var Qr=o(Dt);Jn=l(Qr,"Construct an NLLB tokenizer."),Qr.forEach(a),jn=d(U),x=n(U,"P",{});var ie=o(x);zn=l(ie,"Adapted from "),ht=n(ie,"A",{href:!0});var Or=o(ht);Nn=l(Or,"RobertaTokenizer"),Or.forEach(a),$n=l(ie," and "),ft=n(ie,"A",{href:!0});var Kr=o(ft);Un=l(Kr,"XLNetTokenizer"),Kr.forEach(a),xn=l(ie,`. Based on
`),ze=n(ie,"A",{href:!0,rel:!0});var el=o(ze);qn=l(el,"SentencePiece"),el.forEach(a),In=l(ie,"."),ie.forEach(a),Gn=d(U),A=n(U,"P",{});var yt=o(A);Ln=l(yt,"The tokenization method is "),Pt=n(yt,"CODE",{});var tl=o(Pt);Zn=l(tl,"<tokens> <eos> <language code>"),tl.forEach(a),Bn=l(yt," for source language documents, and "),Yt=n(yt,"CODE",{});var al=o(Yt);Fn=l(al,"<language code> <tokens> <eos>"),al.forEach(a),Rn=l(yt," for target language documents."),yt.forEach(a),Cn=d(U),k(ne.$$.fragment,U),Wn=d(U),$=n(U,"DIV",{class:!0});var ce=o($);k(Ne.$$.fragment,ce),Sn=d(ce),$e=n(ce,"P",{});var is=o($e);Xn=l(is,`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 `),Ht=n(is,"CODE",{});var sl=o(Ht);Vn=l(sl,"X"),sl.forEach(a),An=l(is," represents the sequence:"),is.forEach(a),Dn=d(ce),Ue=n(ce,"UL",{});var cs=o(Ue);xe=n(cs,"LI",{});var ds=o(xe);Qt=n(ds,"CODE",{});var nl=o(Qt);Pn=l(nl,"input_ids"),nl.forEach(a),Yn=l(ds," (for encoder) "),Ot=n(ds,"CODE",{});var ol=o(Ot);Hn=l(ol,"X [eos, src_lang_code]"),ol.forEach(a),ds.forEach(a),Qn=d(cs),qe=n(cs,"LI",{});var ps=o(qe);Kt=n(ps,"CODE",{});var rl=o(Kt);On=l(rl,"decoder_input_ids"),rl.forEach(a),Kn=l(ps,": (for decoder) "),ea=n(ps,"CODE",{});var ll=o(ea);eo=l(ll,"X [eos, tgt_lang_code]"),ll.forEach(a),ps.forEach(a),cs.forEach(a),to=d(ce),ta=n(ce,"P",{});var il=o(ta);ao=l(il,`BOS is never used. Pairs of sequences are not the expected use case, but they will be handled without a
separator.`),il.forEach(a),ce.forEach(a),U.forEach(a),Qa=d(e),D=n(e,"H2",{class:!0});var hs=o(D);oe=n(hs,"A",{id:!0,class:!0,href:!0});var cl=o(oe);aa=n(cl,"SPAN",{});var dl=o(aa);k(Ie.$$.fragment,dl),dl.forEach(a),cl.forEach(a),so=d(hs),sa=n(hs,"SPAN",{});var pl=o(sa);no=l(pl,"NllbTokenizerFast"),pl.forEach(a),hs.forEach(a),Oa=d(e),g=n(e,"DIV",{class:!0});var T=o(g);k(Ge.$$.fragment,T),oo=d(T),P=n(T,"P",{});var vt=o(P);ro=l(vt,"Construct a \u201Cfast\u201D NLLB tokenizer (backed by HuggingFace\u2019s "),na=n(vt,"EM",{});var hl=o(na);lo=l(hl,"tokenizers"),hl.forEach(a),io=l(vt,` library). Based on
`),Le=n(vt,"A",{href:!0,rel:!0});var fl=o(Le);co=l(fl,"BPE"),fl.forEach(a),po=l(vt,"."),vt.forEach(a),ho=d(T),Ze=n(T,"P",{});var fs=o(Ze);fo=l(fs,"This tokenizer inherits from "),ut=n(fs,"A",{href:!0});var ul=o(ut);uo=l(ul,"PreTrainedTokenizerFast"),ul.forEach(a),mo=l(fs,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),fs.forEach(a),go=d(T),Y=n(T,"P",{});var wt=o(Y);bo=l(wt,"The tokenization method is "),oa=n(wt,"CODE",{});var ml=o(oa);ko=l(ml,"<tokens> <eos> <language code>"),ml.forEach(a),_o=l(wt," for source language documents, and "),ra=n(wt,"CODE",{});var gl=o(ra);yo=l(gl,"<language code> <tokens> <eos>"),gl.forEach(a),vo=l(wt," for target language documents."),wt.forEach(a),wo=d(T),k(re.$$.fragment,T),Mo=d(T),z=n(T,"DIV",{class:!0});var R=o(z);k(Be.$$.fragment,R),To=d(R),la=n(R,"P",{});var bl=o(la);Eo=l(bl,`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.`),bl.forEach(a),Jo=d(R),Fe=n(R,"P",{});var us=o(Fe);jo=l(us,"An NLLB sequence has the following format, where "),ia=n(us,"CODE",{});var kl=o(ia);zo=l(kl,"X"),kl.forEach(a),No=l(us," represents the sequence:"),us.forEach(a),$o=d(R),Re=n(R,"UL",{});var ms=o(Re);Ce=n(ms,"LI",{});var gs=o(Ce);ca=n(gs,"CODE",{});var _l=o(ca);Uo=l(_l,"input_ids"),_l.forEach(a),xo=l(gs," (for encoder) "),da=n(gs,"CODE",{});var yl=o(da);qo=l(yl,"X [eos, src_lang_code]"),yl.forEach(a),gs.forEach(a),Io=d(ms),We=n(ms,"LI",{});var bs=o(We);pa=n(bs,"CODE",{});var vl=o(pa);Go=l(vl,"decoder_input_ids"),vl.forEach(a),Lo=l(bs,": (for decoder) "),ha=n(bs,"CODE",{});var wl=o(ha);Zo=l(wl,"X [eos, tgt_lang_code]"),wl.forEach(a),bs.forEach(a),ms.forEach(a),Bo=d(R),fa=n(R,"P",{});var Ml=o(fa);Fo=l(Ml,`BOS is never used. Pairs of sequences are not the expected use case, but they will be handled without a
separator.`),Ml.forEach(a),R.forEach(a),Ro=d(T),le=n(T,"DIV",{class:!0});var ks=o(le);k(Se.$$.fragment,ks),Co=d(ks),ua=n(ks,"P",{});var Tl=o(ua);Wo=l(Tl,`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.`),Tl.forEach(a),ks.forEach(a),So=d(T),B=n(T,"DIV",{class:!0});var Mt=o(B);k(Xe.$$.fragment,Mt),Xo=d(Mt),ma=n(Mt,"P",{});var El=o(ma);Vo=l(El,"Reset the special tokens to the source lang setting."),El.forEach(a),Ao=d(Mt),Ve=n(Mt,"UL",{});var _s=o(Ve);ga=n(_s,"LI",{});var Jl=o(ga);Do=l(Jl,"In legacy mode: No prefix and suffix=[eos, src_lang_code]."),Jl.forEach(a),Po=d(_s),ba=n(_s,"LI",{});var jl=o(ba);Yo=l(jl,"In default mode: Prefix=[src_lang_code], suffix = [eos]"),jl.forEach(a),_s.forEach(a),Mt.forEach(a),Ho=d(T),F=n(T,"DIV",{class:!0});var Tt=o(F);k(Ae.$$.fragment,Tt),Qo=d(Tt),ka=n(Tt,"P",{});var zl=o(ka);Oo=l(zl,"Reset the special tokens to the target lang setting."),zl.forEach(a),Ko=d(Tt),De=n(Tt,"UL",{});var ys=o(De);_a=n(ys,"LI",{});var Nl=o(_a);er=l(Nl,"In legacy mode: No prefix and suffix=[eos, tgt_lang_code]."),Nl.forEach(a),tr=d(ys),ya=n(ys,"LI",{});var $l=o(ya);ar=l($l,"In default mode: Prefix=[tgt_lang_code], suffix = [eos]"),$l.forEach(a),ys.forEach(a),Tt.forEach(a),T.forEach(a),this.h()},h(){h(m,"name","hf:doc:metadata"),h(m,"content",JSON.stringify(Cl)),h(u,"id","transformers.NllbTokenizer"),h(u,"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"),h(u,"href","#transformers.NllbTokenizer"),h(M,"class","relative group"),h(ue,"href","https://github.com/huggingface/transformers/pull/22313"),h(ue,"rel","nofollow"),h(me,"href","https://github.com/huggingface/transformers/issues/19943"),h(me,"rel","nofollow"),h(Q,"id","overview-of-nllb"),h(Q,"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"),h(Q,"href","#overview-of-nllb"),h(C,"class","relative group"),h(be,"href","https://arxiv.org/abs/2207.04672"),h(be,"rel","nofollow"),h(it,"href","nllb-moe"),h(ke,"href","https://huggingface.co/lysandre"),h(ke,"rel","nofollow"),h(_e,"href","https://github.com/facebookresearch/fairseq/tree/nllb"),h(_e,"rel","nofollow"),h(K,"id","generating-with-nllb"),h(K,"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"),h(K,"href","#generating-with-nllb"),h(W,"class","relative group"),h(ve,"href","https://github.com/facebookresearch/flores/blob/main/flores200/README.md#languages-in-flores-200"),h(ve,"rel","nofollow"),h(ee,"id","generating-from-any-other-language-than-english"),h(ee,"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"),h(ee,"href","#generating-from-any-other-language-than-english"),h(S,"class","relative group"),h(te,"id","documentation-resources"),h(te,"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"),h(te,"href","#documentation-resources"),h(X,"class","relative group"),h(dt,"href","../tasks/translation"),h(pt,"href","../tasks/summarization"),h(se,"id","nllbtokenizer"),h(se,"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"),h(se,"href","#nllbtokenizer"),h(V,"class","relative group"),h(ht,"href","/docs/transformers/v4.31.0/en/model_doc/roberta#transformers.RobertaTokenizer"),h(ft,"href","/docs/transformers/v4.31.0/en/model_doc/xlnet#transformers.XLNetTokenizer"),h(ze,"href","https://github.com/google/sentencepiece"),h(ze,"rel","nofollow"),h($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(oe,"id","nllbtokenizerfast"),h(oe,"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"),h(oe,"href","#nllbtokenizerfast"),h(D,"class","relative group"),h(Le,"href","https://huggingface.co/docs/tokenizers/python/latest/components.html?highlight=BPE#models"),h(Le,"rel","nofollow"),h(ut,"href","/docs/transformers/v4.31.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),h(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(g,"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,i){t(document.head,m),p(e,N,i),p(e,M,i),t(M,u),t(u,j),_(f,j,null),t(M,E),t(M,Et),t(Et,vs),p(e,wa,i),p(e,de,i),t(de,Jt),t(Jt,ws),t(de,Ms),p(e,Ma,i),p(e,H,i),t(H,Ts),t(H,jt),t(jt,Es),t(H,Js),p(e,Ta,i),p(e,Ke,i),t(Ke,zt),t(zt,js),p(e,Ea,i),p(e,et,i),t(et,zs),p(e,Ja,i),_(pe,e,i),p(e,ja,i),p(e,tt,i),t(tt,Ns),p(e,za,i),_(he,e,i),p(e,Na,i),p(e,at,i),t(at,$s),p(e,$a,i),_(fe,e,i),p(e,Ua,i),p(e,q,i),t(q,Us),t(q,ue),t(ue,xs),t(q,qs),t(q,me),t(me,Is),t(q,Gs),p(e,xa,i),p(e,C,i),t(C,Q),t(Q,Nt),_(ge,Nt,null),t(C,Ls),t(C,$t),t($t,Zs),p(e,qa,i),p(e,O,i),t(O,Bs),t(O,be),t(be,Fs),t(O,Rs),p(e,Ia,i),p(e,st,i),t(st,Cs),p(e,Ga,i),p(e,nt,i),t(nt,Ut),t(Ut,Ws),p(e,La,i),p(e,ot,i),t(ot,Ss),p(e,Za,i),p(e,rt,i),t(rt,lt),t(lt,Xs),t(lt,it),t(it,Vs),p(e,Ba,i),p(e,I,i),t(I,As),t(I,ke),t(ke,Ds),t(I,Ps),t(I,_e),t(_e,Ys),t(I,Hs),p(e,Fa,i),p(e,W,i),t(W,K),t(K,xt),_(ye,xt,null),t(W,Qs),t(W,qt),t(qt,Os),p(e,Ra,i),p(e,G,i),t(G,Ks),t(G,It),t(It,en),t(G,tn),t(G,Gt),t(Gt,an),t(G,sn),p(e,Ca,i),p(e,L,i),t(L,nn),t(L,Lt),t(Lt,on),t(L,rn),t(L,ve),t(ve,ln),t(L,cn),p(e,Wa,i),_(we,e,i),p(e,Sa,i),p(e,S,i),t(S,ee),t(ee,Zt),_(Me,Zt,null),t(S,dn),t(S,Bt),t(Bt,pn),p(e,Xa,i),p(e,Z,i),t(Z,hn),t(Z,Ft),t(Ft,fn),t(Z,un),t(Z,Rt),t(Rt,mn),t(Z,gn),p(e,Va,i),p(e,ct,i),t(ct,bn),p(e,Aa,i),_(Te,e,i),p(e,Da,i),p(e,X,i),t(X,te),t(te,Ct),_(Ee,Ct,null),t(X,kn),t(X,Wt),t(Wt,_n),p(e,Pa,i),p(e,ae,i),t(ae,St),t(St,dt),t(dt,yn),t(ae,vn),t(ae,Xt),t(Xt,pt),t(pt,wn),p(e,Ya,i),p(e,V,i),t(V,se),t(se,Vt),_(Je,Vt,null),t(V,Mn),t(V,At),t(At,Tn),p(e,Ha,i),p(e,J,i),_(je,J,null),t(J,En),t(J,Dt),t(Dt,Jn),t(J,jn),t(J,x),t(x,zn),t(x,ht),t(ht,Nn),t(x,$n),t(x,ft),t(ft,Un),t(x,xn),t(x,ze),t(ze,qn),t(x,In),t(J,Gn),t(J,A),t(A,Ln),t(A,Pt),t(Pt,Zn),t(A,Bn),t(A,Yt),t(Yt,Fn),t(A,Rn),t(J,Cn),_(ne,J,null),t(J,Wn),t(J,$),_(Ne,$,null),t($,Sn),t($,$e),t($e,Xn),t($e,Ht),t(Ht,Vn),t($e,An),t($,Dn),t($,Ue),t(Ue,xe),t(xe,Qt),t(Qt,Pn),t(xe,Yn),t(xe,Ot),t(Ot,Hn),t(Ue,Qn),t(Ue,qe),t(qe,Kt),t(Kt,On),t(qe,Kn),t(qe,ea),t(ea,eo),t($,to),t($,ta),t(ta,ao),p(e,Qa,i),p(e,D,i),t(D,oe),t(oe,aa),_(Ie,aa,null),t(D,so),t(D,sa),t(sa,no),p(e,Oa,i),p(e,g,i),_(Ge,g,null),t(g,oo),t(g,P),t(P,ro),t(P,na),t(na,lo),t(P,io),t(P,Le),t(Le,co),t(P,po),t(g,ho),t(g,Ze),t(Ze,fo),t(Ze,ut),t(ut,uo),t(Ze,mo),t(g,go),t(g,Y),t(Y,bo),t(Y,oa),t(oa,ko),t(Y,_o),t(Y,ra),t(ra,yo),t(Y,vo),t(g,wo),_(re,g,null),t(g,Mo),t(g,z),_(Be,z,null),t(z,To),t(z,la),t(la,Eo),t(z,Jo),t(z,Fe),t(Fe,jo),t(Fe,ia),t(ia,zo),t(Fe,No),t(z,$o),t(z,Re),t(Re,Ce),t(Ce,ca),t(ca,Uo),t(Ce,xo),t(Ce,da),t(da,qo),t(Re,Io),t(Re,We),t(We,pa),t(pa,Go),t(We,Lo),t(We,ha),t(ha,Zo),t(z,Bo),t(z,fa),t(fa,Fo),t(g,Ro),t(g,le),_(Se,le,null),t(le,Co),t(le,ua),t(ua,Wo),t(g,So),t(g,B),_(Xe,B,null),t(B,Xo),t(B,ma),t(ma,Vo),t(B,Ao),t(B,Ve),t(Ve,ga),t(ga,Do),t(Ve,Po),t(Ve,ba),t(ba,Yo),t(g,Ho),t(g,F),_(Ae,F,null),t(F,Qo),t(F,ka),t(ka,Oo),t(F,Ko),t(F,De),t(De,_a),t(_a,er),t(De,tr),t(De,ya),t(ya,ar),Ka=!0},p(e,[i]){const Pe={};i&2&&(Pe.$$scope={dirty:i,ctx:e}),ne.$set(Pe);const va={};i&2&&(va.$$scope={dirty:i,ctx:e}),re.$set(va)},i(e){Ka||(y(f.$$.fragment,e),y(pe.$$.fragment,e),y(he.$$.fragment,e),y(fe.$$.fragment,e),y(ge.$$.fragment,e),y(ye.$$.fragment,e),y(we.$$.fragment,e),y(Me.$$.fragment,e),y(Te.$$.fragment,e),y(Ee.$$.fragment,e),y(Je.$$.fragment,e),y(je.$$.fragment,e),y(ne.$$.fragment,e),y(Ne.$$.fragment,e),y(Ie.$$.fragment,e),y(Ge.$$.fragment,e),y(re.$$.fragment,e),y(Be.$$.fragment,e),y(Se.$$.fragment,e),y(Xe.$$.fragment,e),y(Ae.$$.fragment,e),Ka=!0)},o(e){v(f.$$.fragment,e),v(pe.$$.fragment,e),v(he.$$.fragment,e),v(fe.$$.fragment,e),v(ge.$$.fragment,e),v(ye.$$.fragment,e),v(we.$$.fragment,e),v(Me.$$.fragment,e),v(Te.$$.fragment,e),v(Ee.$$.fragment,e),v(Je.$$.fragment,e),v(je.$$.fragment,e),v(ne.$$.fragment,e),v(Ne.$$.fragment,e),v(Ie.$$.fragment,e),v(Ge.$$.fragment,e),v(re.$$.fragment,e),v(Be.$$.fragment,e),v(Se.$$.fragment,e),v(Xe.$$.fragment,e),v(Ae.$$.fragment,e),Ka=!1},d(e){a(m),e&&a(N),e&&a(M),w(f),e&&a(wa),e&&a(de),e&&a(Ma),e&&a(H),e&&a(Ta),e&&a(Ke),e&&a(Ea),e&&a(et),e&&a(Ja),w(pe,e),e&&a(ja),e&&a(tt),e&&a(za),w(he,e),e&&a(Na),e&&a(at),e&&a($a),w(fe,e),e&&a(Ua),e&&a(q),e&&a(xa),e&&a(C),w(ge),e&&a(qa),e&&a(O),e&&a(Ia),e&&a(st),e&&a(Ga),e&&a(nt),e&&a(La),e&&a(ot),e&&a(Za),e&&a(rt),e&&a(Ba),e&&a(I),e&&a(Fa),e&&a(W),w(ye),e&&a(Ra),e&&a(G),e&&a(Ca),e&&a(L),e&&a(Wa),w(we,e),e&&a(Sa),e&&a(S),w(Me),e&&a(Xa),e&&a(Z),e&&a(Va),e&&a(ct),e&&a(Aa),w(Te,e),e&&a(Da),e&&a(X),w(Ee),e&&a(Pa),e&&a(ae),e&&a(Ya),e&&a(V),w(Je),e&&a(Ha),e&&a(J),w(je),w(ne),w(Ne),e&&a(Qa),e&&a(D),w(Ie),e&&a(Oa),e&&a(g),w(Ge),w(re),w(Be),w(Se),w(Xe),w(Ae)}}}const Cl={local:"transformers.NllbTokenizer",title:"NLLB"};function Wl(Oe){return Zl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Pl extends ql{constructor(m){super();Il(this,m,Wl,Rl,Gl,{})}}export{Pl as default,Cl as metadata};
