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