import{S as Mf,i as yf,s as Tf,e as o,k as c,w as b,t as r,M as bf,c as a,d as t,m as p,a as s,x as k,h as l,b as d,N as _f,G as e,g as f,y as v,q as w,o as x,B as j,v as kf,L as Ot}from"../../chunks/vendor-hf-doc-builder.js";import{T as Gn}from"../../chunks/Tip-hf-doc-builder.js";import{D}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ie}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as oe}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Qt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function vf(J){let h,y,_,g,M;return g=new Ie({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1hcmlhbk1vZGVsJTJDJTIwTWFyaWFuQ29uZmlnJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyME1hcmlhbiUyMEhlbHNpbmtpLU5MUCUyRm9wdXMtbXQtZW4tZGUlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwTWFyaWFuQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjBmcm9tJTIwdGhlJTIwSGVsc2lua2ktTkxQJTJGb3B1cy1tdC1lbi1kZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwTWFyaWFuTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MarianModel, MarianConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Marian Helsinki-NLP/opus-mt-en-de style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = MarianConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the Helsinki-NLP/opus-mt-en-de style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MarianModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){h=o("p"),y=r("Examples:"),_=c(),b(g.$$.fragment)},l(i){h=a(i,"P",{});var u=s(h);y=l(u,"Examples:"),u.forEach(t),_=p(i),k(g.$$.fragment,i)},m(i,u){f(i,h,u),e(h,y),f(i,_,u),v(g,i,u),M=!0},p:Ot,i(i){M||(w(g.$$.fragment,i),M=!0)},o(i){x(g.$$.fragment,i),M=!1},d(i){i&&t(h),i&&t(_),j(g,i)}}}function wf(J){let h,y,_,g,M;return g=new Ie({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1hcmlhbkZvckNhdXNhbExNJTJDJTIwTWFyaWFuVG9rZW5pemVyJTBBJTBBbW9kZWwlMjAlM0QlMjBNYXJpYW5Gb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIySGVsc2lua2ktTkxQJTJGb3B1cy1tdC1lbi1kZSUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBNYXJpYW5Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMkhlbHNpbmtpLU5MUCUyRm9wdXMtbXQtZW4tZGUlMjIpJTBBc3JjX3RleHRzJTIwJTNEJTIwJTVCJTIySSUyMGFtJTIwYSUyMHNtYWxsJTIwZnJvZy4lMjIlMkMlMjAlMjJUb20lMjBhc2tlZCUyMGhpcyUyMHRlYWNoZXIlMjBmb3IlMjBhZHZpY2UuJTIyJTVEJTBBdGd0X3RleHRzJTIwJTNEJTIwJTVCJTIySWNoJTIwYmluJTIwZWluJTIwa2xlaW5lciUyMEZyb3NjaC4lMjIlMkMlMjAlMjJUb20lMjBiYXQlMjBzZWluZW4lMjBMZWhyZXIlMjB1bSUyMFJhdC4lMjIlNUQlMjAlMjAlMjMlMjBvcHRpb25hbCUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihzcmNfdGV4dHMlMkMlMjB0ZXh0X3RhcmdldCUzRHRndF90ZXh0cyUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMkMlMjBwYWRkaW5nJTNEVHJ1ZSklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTIwJTIwJTIzJTIwc2hvdWxkJTIwd29yaw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MarianForCausalLM, MarianTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>model = MarianForCausalLM.from_pretrained(<span class="hljs-string">&quot;Helsinki-NLP/opus-mt-en-de&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = MarianTokenizer.from_pretrained(<span class="hljs-string">&quot;Helsinki-NLP/opus-mt-en-de&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>src_texts = [<span class="hljs-string">&quot;I am a small frog.&quot;</span>, <span class="hljs-string">&quot;Tom asked his teacher for advice.&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>tgt_texts = [<span class="hljs-string">&quot;Ich bin ein kleiner Frosch.&quot;</span>, <span class="hljs-string">&quot;Tom bat seinen Lehrer um Rat.&quot;</span>]  <span class="hljs-comment"># optional</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(src_texts, text_target=tgt_texts, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)  <span class="hljs-comment"># should work</span>`}}),{c(){h=o("p"),y=r("Examples:"),_=c(),b(g.$$.fragment)},l(i){h=a(i,"P",{});var u=s(h);y=l(u,"Examples:"),u.forEach(t),_=p(i),k(g.$$.fragment,i)},m(i,u){f(i,h,u),e(h,y),f(i,_,u),v(g,i,u),M=!0},p:Ot,i(i){M||(w(g.$$.fragment,i),M=!0)},o(i){x(g.$$.fragment,i),M=!1},d(i){i&&t(h),i&&t(_),j(g,i)}}}function xf(J){let h,y,_,g,M;return{c(){h=o("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=o("code"),g=r("Module"),M=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){h=a(i,"P",{});var u=s(h);y=l(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var z=s(_);g=l(z,"Module"),z.forEach(t),M=l(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(i,u){f(i,h,u),e(h,y),e(h,_),e(_,g),e(h,M)},d(i){i&&t(h)}}}function jf(J){let h,y,_,g,M;return g=new Ie({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBNYXJpYW5Nb2RlbCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMkhlbHNpbmtpLU5MUCUyRm9wdXMtbXQtZW4tZGUlMjIpJTBBbW9kZWwlMjAlM0QlMjBNYXJpYW5Nb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIySGVsc2lua2ktTkxQJTJGb3B1cy1tdC1lbi1kZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyU3R1ZGllcyUyMGhhdmUlMjBiZWVuJTIwc2hvd24lMjB0aGF0JTIwb3duaW5nJTIwYSUyMGRvZyUyMGlzJTIwZ29vZCUyMGZvciUyMHlvdSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBZGVjb2Rlcl9pbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTBBJTIwJTIwJTIwJTIwJTIyJTNDcGFkJTNFJTIwU3R1ZGllbiUyMGhhYmVuJTIwZ2V6ZWlndCUyMGRhc3MlMjBlcyUyMGhpbGZyZWljaCUyMGlzdCUyMGVpbmVuJTIwSHVuZCUyMHp1JTIwYmVzaXR6ZW4lMjIlMkMlMEElMjAlMjAlMjAlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTBBJTIwJTIwJTIwJTIwYWRkX3NwZWNpYWxfdG9rZW5zJTNERmFsc2UlMkMlMEEpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0X2lkcyUzRGlucHV0cy5pbnB1dF9pZHMlMkMlMjBkZWNvZGVyX2lucHV0X2lkcyUzRGRlY29kZXJfaW5wdXRzLmlucHV0X2lkcyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBbGlzdChsYXN0X2hpZGRlbl9zdGF0ZXMuc2hhcGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MarianModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;Helsinki-NLP/opus-mt-en-de&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MarianModel.from_pretrained(<span class="hljs-string">&quot;Helsinki-NLP/opus-mt-en-de&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Studies have been shown that owning a dog is good for you&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>decoder_inputs = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;&lt;pad&gt; Studien haben gezeigt dass es hilfreich ist einen Hund zu besitzen&quot;</span>,
<span class="hljs-meta">... </span>    return_tensors=<span class="hljs-string">&quot;pt&quot;</span>,
<span class="hljs-meta">... </span>    add_special_tokens=<span class="hljs-literal">False</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids=inputs.input_ids, decoder_input_ids=decoder_inputs.input_ids)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">26</span>, <span class="hljs-number">512</span>]`}}),{c(){h=o("p"),y=r("Example:"),_=c(),b(g.$$.fragment)},l(i){h=a(i,"P",{});var u=s(h);y=l(u,"Example:"),u.forEach(t),_=p(i),k(g.$$.fragment,i)},m(i,u){f(i,h,u),e(h,y),f(i,_,u),v(g,i,u),M=!0},p:Ot,i(i){M||(w(g.$$.fragment,i),M=!0)},o(i){x(g.$$.fragment,i),M=!1},d(i){i&&t(h),i&&t(_),j(g,i)}}}function Jf(J){let h,y,_,g,M;return{c(){h=o("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=o("code"),g=r("Module"),M=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){h=a(i,"P",{});var u=s(h);y=l(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var z=s(_);g=l(z,"Module"),z.forEach(t),M=l(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(i,u){f(i,h,u),e(h,y),e(h,_),e(_,g),e(h,M)},d(i){i&&t(h)}}}function $f(J){let h,y,_,g,M;return g=new Ie({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBNYXJpYW5NVE1vZGVsJTBBJTBBc3JjJTIwJTNEJTIwJTIyZnIlMjIlMjAlMjAlMjMlMjBzb3VyY2UlMjBsYW5ndWFnZSUwQXRyZyUyMCUzRCUyMCUyMmVuJTIyJTIwJTIwJTIzJTIwdGFyZ2V0JTIwbGFuZ3VhZ2UlMEElMEFtb2RlbF9uYW1lJTIwJTNEJTIwZiUyMkhlbHNpbmtpLU5MUCUyRm9wdXMtbXQtJTdCc3JjJTdELSU3QnRyZyU3RCUyMiUwQW1vZGVsJTIwJTNEJTIwTWFyaWFuTVRNb2RlbC5mcm9tX3ByZXRyYWluZWQobW9kZWxfbmFtZSklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZChtb2RlbF9uYW1lKSUwQSUwQXNhbXBsZV90ZXh0JTIwJTNEJTIwJTIybyVDMyVCOSUyMGVzdCUyMGwnYXJyJUMzJUFBdCUyMGRlJTIwYnVzJTIwJTNGJTIyJTBBYmF0Y2glMjAlM0QlMjB0b2tlbml6ZXIoJTVCc2FtcGxlX3RleHQlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQWdlbmVyYXRlZF9pZHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKmJhdGNoKSUwQXRva2VuaXplci5iYXRjaF9kZWNvZGUoZ2VuZXJhdGVkX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MarianMTModel

<span class="hljs-meta">&gt;&gt;&gt; </span>src = <span class="hljs-string">&quot;fr&quot;</span>  <span class="hljs-comment"># source language</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>trg = <span class="hljs-string">&quot;en&quot;</span>  <span class="hljs-comment"># target language</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>model_name = <span class="hljs-string">f&quot;Helsinki-NLP/opus-mt-<span class="hljs-subst">{src}</span>-<span class="hljs-subst">{trg}</span>&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MarianMTModel.from_pretrained(model_name)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(model_name)

<span class="hljs-meta">&gt;&gt;&gt; </span>sample_text = <span class="hljs-string">&quot;o\xF9 est l&#x27;arr\xEAt de bus ?&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>batch = tokenizer([sample_text], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(**batch)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&quot;Where&#x27;s the bus stop?&quot;</span>`}}),{c(){h=o("p"),y=r("Examples:"),_=c(),b(g.$$.fragment)},l(i){h=a(i,"P",{});var u=s(h);y=l(u,"Examples:"),u.forEach(t),_=p(i),k(g.$$.fragment,i)},m(i,u){f(i,h,u),e(h,y),f(i,_,u),v(g,i,u),M=!0},p:Ot,i(i){M||(w(g.$$.fragment,i),M=!0)},o(i){x(g.$$.fragment,i),M=!1},d(i){i&&t(h),i&&t(_),j(g,i)}}}function zf(J){let h,y,_,g,M;return g=new Ie({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBNYXJpYW5Gb3JDYXVzYWxMTSUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMkhlbHNpbmtpLU5MUCUyRm9wdXMtbXQtZnItZW4lMjIpJTBBbW9kZWwlMjAlM0QlMjBNYXJpYW5Gb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIySGVsc2lua2ktTkxQJTJGb3B1cy1tdC1mci1lbiUyMiUyQyUyMGFkZF9jcm9zc19hdHRlbnRpb24lM0RGYWxzZSklMEFhc3NlcnQlMjBtb2RlbC5jb25maWcuaXNfZGVjb2RlciUyQyUyMGYlMjIlN0Jtb2RlbC5fX2NsYXNzX18lN0QlMjBoYXMlMjB0byUyMGJlJTIwY29uZmlndXJlZCUyMGFzJTIwYSUyMGRlY29kZXIuJTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cyUwQWV4cGVjdGVkX3NoYXBlJTIwJTNEJTIwJTVCMSUyQyUyMGlucHV0cy5pbnB1dF9pZHMuc2hhcGUlNUItMSU1RCUyQyUyMG1vZGVsLmNvbmZpZy52b2NhYl9zaXplJTVEJTBBbGlzdChsb2dpdHMuc2hhcGUpJTIwJTNEJTNEJTIwZXhwZWN0ZWRfc2hhcGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MarianForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;Helsinki-NLP/opus-mt-fr-en&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MarianForCausalLM.from_pretrained(<span class="hljs-string">&quot;Helsinki-NLP/opus-mt-fr-en&quot;</span>, add_cross_attention=<span class="hljs-literal">False</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> model.config.is_decoder, <span class="hljs-string">f&quot;<span class="hljs-subst">{model.__class__}</span> has to be configured as a decoder.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span>expected_shape = [<span class="hljs-number">1</span>, inputs.input_ids.shape[-<span class="hljs-number">1</span>], model.config.vocab_size]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape) == expected_shape
<span class="hljs-literal">True</span>`}}),{c(){h=o("p"),y=r("Example:"),_=c(),b(g.$$.fragment)},l(i){h=a(i,"P",{});var u=s(h);y=l(u,"Example:"),u.forEach(t),_=p(i),k(g.$$.fragment,i)},m(i,u){f(i,h,u),e(h,y),f(i,_,u),v(g,i,u),M=!0},p:Ot,i(i){M||(w(g.$$.fragment,i),M=!0)},o(i){x(g.$$.fragment,i),M=!1},d(i){i&&t(h),i&&t(_),j(g,i)}}}function Uf(J){let h,y,_,g,M,i,u,z,Le,Fe,Z,he,Y,$,He,S,ue,ct,K,B,_e,ae,Qe,se,re,Oe,Ce,P,De,Ne,ee,F,q,me,V,Ye,qe,A,te,Me,C,Ke,R,et,Ze,E,ye,Te,G,tt,X,le,be,N,nt,W,ot,ke;return{c(){h=o("p"),y=r("TensorFlow models and layers in "),_=o("code"),g=r("transformers"),M=r(" accept two formats as input:"),i=c(),u=o("ul"),z=o("li"),Le=r("having all inputs as keyword arguments (like PyTorch models), or"),Fe=c(),Z=o("li"),he=r("having all inputs as a list, tuple or dict in the first positional argument."),Y=c(),$=o("p"),He=r(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),S=o("code"),ue=r("model.fit()"),ct=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),K=o("code"),B=r("model.fit()"),_e=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),ae=o("code"),Qe=r("fit()"),se=r(" and "),re=o("code"),Oe=r("predict()"),Ce=r(`, such as when creating your own layers or models with
the Keras `),P=o("code"),De=r("Functional"),Ne=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ee=c(),F=o("ul"),q=o("li"),me=r("a single Tensor with "),V=o("code"),Ye=r("input_ids"),qe=r(" only and nothing else: "),A=o("code"),te=r("model(input_ids)"),Me=c(),C=o("li"),Ke=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=o("code"),et=r("model([input_ids, attention_mask])"),Ze=r(" or "),E=o("code"),ye=r("model([input_ids, attention_mask, token_type_ids])"),Te=c(),G=o("li"),tt=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),X=o("code"),le=r('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),be=c(),N=o("p"),nt=r(`Note that when creating models and layers with
`),W=o("a"),ot=r("subclassing"),ke=r(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(T){h=a(T,"P",{});var U=s(h);y=l(U,"TensorFlow models and layers in "),_=a(U,"CODE",{});var ve=s(_);g=l(ve,"transformers"),ve.forEach(t),M=l(U," accept two formats as input:"),U.forEach(t),i=p(T),u=a(T,"UL",{});var we=s(u);z=a(we,"LI",{});var _t=s(z);Le=l(_t,"having all inputs as keyword arguments (like PyTorch models), or"),_t.forEach(t),Fe=p(we),Z=a(we,"LI",{});var xe=s(Z);he=l(xe,"having all inputs as a list, tuple or dict in the first positional argument."),xe.forEach(t),we.forEach(t),Y=p(T),$=a(T,"P",{});var I=s($);He=l(I,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),S=a(I,"CODE",{});var Mt=s(S);ue=l(Mt,"model.fit()"),Mt.forEach(t),ct=l(I,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),K=a(I,"CODE",{});var yt=s(K);B=l(yt,"model.fit()"),yt.forEach(t),_e=l(I,` supports! If, however, you want to use the second
format outside of Keras methods like `),ae=a(I,"CODE",{});var at=s(ae);Qe=l(at,"fit()"),at.forEach(t),se=l(I," and "),re=a(I,"CODE",{});var st=s(re);Oe=l(st,"predict()"),st.forEach(t),Ce=l(I,`, such as when creating your own layers or models with
the Keras `),P=a(I,"CODE",{});var Tt=s(P);De=l(Tt,"Functional"),Tt.forEach(t),Ne=l(I,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),I.forEach(t),ee=p(T),F=a(T,"UL",{});var L=s(F);q=a(L,"LI",{});var H=s(q);me=l(H,"a single Tensor with "),V=a(H,"CODE",{});var rt=s(V);Ye=l(rt,"input_ids"),rt.forEach(t),qe=l(H," only and nothing else: "),A=a(H,"CODE",{});var bt=s(A);te=l(bt,"model(input_ids)"),bt.forEach(t),H.forEach(t),Me=p(L),C=a(L,"LI",{});var ie=s(C);Ke=l(ie,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=a(ie,"CODE",{});var je=s(R);et=l(je,"model([input_ids, attention_mask])"),je.forEach(t),Ze=l(ie," or "),E=a(ie,"CODE",{});var Je=s(E);ye=l(Je,"model([input_ids, attention_mask, token_type_ids])"),Je.forEach(t),ie.forEach(t),Te=p(L),G=a(L,"LI",{});var lt=s(G);tt=l(lt,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),X=a(lt,"CODE",{});var Ae=s(X);le=l(Ae,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ae.forEach(t),lt.forEach(t),L.forEach(t),be=p(T),N=a(T,"P",{});var $e=s(N);nt=l($e,`Note that when creating models and layers with
`),W=a($e,"A",{href:!0,rel:!0});var kt=s(W);ot=l(kt,"subclassing"),kt.forEach(t),ke=l($e,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),$e.forEach(t),this.h()},h(){d(W,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),d(W,"rel","nofollow")},m(T,U){f(T,h,U),e(h,y),e(h,_),e(_,g),e(h,M),f(T,i,U),f(T,u,U),e(u,z),e(z,Le),e(u,Fe),e(u,Z),e(Z,he),f(T,Y,U),f(T,$,U),e($,He),e($,S),e(S,ue),e($,ct),e($,K),e(K,B),e($,_e),e($,ae),e(ae,Qe),e($,se),e($,re),e(re,Oe),e($,Ce),e($,P),e(P,De),e($,Ne),f(T,ee,U),f(T,F,U),e(F,q),e(q,me),e(q,V),e(V,Ye),e(q,qe),e(q,A),e(A,te),e(F,Me),e(F,C),e(C,Ke),e(C,R),e(R,et),e(C,Ze),e(C,E),e(E,ye),e(F,Te),e(F,G),e(G,tt),e(G,X),e(X,le),f(T,be,U),f(T,N,U),e(N,nt),e(N,W),e(W,ot),e(N,ke)},d(T){T&&t(h),T&&t(i),T&&t(u),T&&t(Y),T&&t($),T&&t(ee),T&&t(F),T&&t(be),T&&t(N)}}}function Ef(J){let h,y,_,g,M;return{c(){h=o("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=o("code"),g=r("Module"),M=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){h=a(i,"P",{});var u=s(h);y=l(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var z=s(_);g=l(z,"Module"),z.forEach(t),M=l(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(i,u){f(i,h,u),e(h,y),e(h,_),e(_,g),e(h,M)},d(i){i&&t(h)}}}function If(J){let h,y,_,g,M;return g=new Ie({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURk1hcmlhbk1vZGVsJTBBaW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJIZWxzaW5raS1OTFAlMkZvcHVzLW10LWVuLWRlJTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZNYXJpYW5Nb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIySGVsc2lua2ktTkxQJTJGb3B1cy1tdC1lbi1kZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFMarianModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;Helsinki-NLP/opus-mt-en-de&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMarianModel.from_pretrained(<span class="hljs-string">&quot;Helsinki-NLP/opus-mt-en-de&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){h=o("p"),y=r("Example:"),_=c(),b(g.$$.fragment)},l(i){h=a(i,"P",{});var u=s(h);y=l(u,"Example:"),u.forEach(t),_=p(i),k(g.$$.fragment,i)},m(i,u){f(i,h,u),e(h,y),f(i,_,u),v(g,i,u),M=!0},p:Ot,i(i){M||(w(g.$$.fragment,i),M=!0)},o(i){x(g.$$.fragment,i),M=!1},d(i){i&&t(h),i&&t(_),j(g,i)}}}function Ff(J){let h,y,_,g,M,i,u,z,Le,Fe,Z,he,Y,$,He,S,ue,ct,K,B,_e,ae,Qe,se,re,Oe,Ce,P,De,Ne,ee,F,q,me,V,Ye,qe,A,te,Me,C,Ke,R,et,Ze,E,ye,Te,G,tt,X,le,be,N,nt,W,ot,ke;return{c(){h=o("p"),y=r("TensorFlow models and layers in "),_=o("code"),g=r("transformers"),M=r(" accept two formats as input:"),i=c(),u=o("ul"),z=o("li"),Le=r("having all inputs as keyword arguments (like PyTorch models), or"),Fe=c(),Z=o("li"),he=r("having all inputs as a list, tuple or dict in the first positional argument."),Y=c(),$=o("p"),He=r(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),S=o("code"),ue=r("model.fit()"),ct=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),K=o("code"),B=r("model.fit()"),_e=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),ae=o("code"),Qe=r("fit()"),se=r(" and "),re=o("code"),Oe=r("predict()"),Ce=r(`, such as when creating your own layers or models with
the Keras `),P=o("code"),De=r("Functional"),Ne=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ee=c(),F=o("ul"),q=o("li"),me=r("a single Tensor with "),V=o("code"),Ye=r("input_ids"),qe=r(" only and nothing else: "),A=o("code"),te=r("model(input_ids)"),Me=c(),C=o("li"),Ke=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=o("code"),et=r("model([input_ids, attention_mask])"),Ze=r(" or "),E=o("code"),ye=r("model([input_ids, attention_mask, token_type_ids])"),Te=c(),G=o("li"),tt=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),X=o("code"),le=r('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),be=c(),N=o("p"),nt=r(`Note that when creating models and layers with
`),W=o("a"),ot=r("subclassing"),ke=r(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(T){h=a(T,"P",{});var U=s(h);y=l(U,"TensorFlow models and layers in "),_=a(U,"CODE",{});var ve=s(_);g=l(ve,"transformers"),ve.forEach(t),M=l(U," accept two formats as input:"),U.forEach(t),i=p(T),u=a(T,"UL",{});var we=s(u);z=a(we,"LI",{});var _t=s(z);Le=l(_t,"having all inputs as keyword arguments (like PyTorch models), or"),_t.forEach(t),Fe=p(we),Z=a(we,"LI",{});var xe=s(Z);he=l(xe,"having all inputs as a list, tuple or dict in the first positional argument."),xe.forEach(t),we.forEach(t),Y=p(T),$=a(T,"P",{});var I=s($);He=l(I,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),S=a(I,"CODE",{});var Mt=s(S);ue=l(Mt,"model.fit()"),Mt.forEach(t),ct=l(I,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),K=a(I,"CODE",{});var yt=s(K);B=l(yt,"model.fit()"),yt.forEach(t),_e=l(I,` supports! If, however, you want to use the second
format outside of Keras methods like `),ae=a(I,"CODE",{});var at=s(ae);Qe=l(at,"fit()"),at.forEach(t),se=l(I," and "),re=a(I,"CODE",{});var st=s(re);Oe=l(st,"predict()"),st.forEach(t),Ce=l(I,`, such as when creating your own layers or models with
the Keras `),P=a(I,"CODE",{});var Tt=s(P);De=l(Tt,"Functional"),Tt.forEach(t),Ne=l(I,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),I.forEach(t),ee=p(T),F=a(T,"UL",{});var L=s(F);q=a(L,"LI",{});var H=s(q);me=l(H,"a single Tensor with "),V=a(H,"CODE",{});var rt=s(V);Ye=l(rt,"input_ids"),rt.forEach(t),qe=l(H," only and nothing else: "),A=a(H,"CODE",{});var bt=s(A);te=l(bt,"model(input_ids)"),bt.forEach(t),H.forEach(t),Me=p(L),C=a(L,"LI",{});var ie=s(C);Ke=l(ie,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=a(ie,"CODE",{});var je=s(R);et=l(je,"model([input_ids, attention_mask])"),je.forEach(t),Ze=l(ie," or "),E=a(ie,"CODE",{});var Je=s(E);ye=l(Je,"model([input_ids, attention_mask, token_type_ids])"),Je.forEach(t),ie.forEach(t),Te=p(L),G=a(L,"LI",{});var lt=s(G);tt=l(lt,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),X=a(lt,"CODE",{});var Ae=s(X);le=l(Ae,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ae.forEach(t),lt.forEach(t),L.forEach(t),be=p(T),N=a(T,"P",{});var $e=s(N);nt=l($e,`Note that when creating models and layers with
`),W=a($e,"A",{href:!0,rel:!0});var kt=s(W);ot=l(kt,"subclassing"),kt.forEach(t),ke=l($e,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),$e.forEach(t),this.h()},h(){d(W,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),d(W,"rel","nofollow")},m(T,U){f(T,h,U),e(h,y),e(h,_),e(_,g),e(h,M),f(T,i,U),f(T,u,U),e(u,z),e(z,Le),e(u,Fe),e(u,Z),e(Z,he),f(T,Y,U),f(T,$,U),e($,He),e($,S),e(S,ue),e($,ct),e($,K),e(K,B),e($,_e),e($,ae),e(ae,Qe),e($,se),e($,re),e(re,Oe),e($,Ce),e($,P),e(P,De),e($,Ne),f(T,ee,U),f(T,F,U),e(F,q),e(q,me),e(q,V),e(V,Ye),e(q,qe),e(q,A),e(A,te),e(F,Me),e(F,C),e(C,Ke),e(C,R),e(R,et),e(C,Ze),e(C,E),e(E,ye),e(F,Te),e(F,G),e(G,tt),e(G,X),e(X,le),f(T,be,U),f(T,N,U),e(N,nt),e(N,W),e(W,ot),e(N,ke)},d(T){T&&t(h),T&&t(i),T&&t(u),T&&t(Y),T&&t($),T&&t(ee),T&&t(F),T&&t(be),T&&t(N)}}}function Cf(J){let h,y,_,g,M;return{c(){h=o("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=o("code"),g=r("Module"),M=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){h=a(i,"P",{});var u=s(h);y=l(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var z=s(_);g=l(z,"Module"),z.forEach(t),M=l(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(i,u){f(i,h,u),e(h,y),e(h,_),e(_,g),e(h,M)},d(i){i&&t(h)}}}function Nf(J){let h,y,_,g,M;return g=new Ie({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURk1hcmlhbk1UTW9kZWwlMEFmcm9tJTIwdHlwaW5nJTIwaW1wb3J0JTIwTGlzdCUwQSUwQXNyYyUyMCUzRCUyMCUyMmZyJTIyJTIwJTIwJTIzJTIwc291cmNlJTIwbGFuZ3VhZ2UlMEF0cmclMjAlM0QlMjAlMjJlbiUyMiUyMCUyMCUyMyUyMHRhcmdldCUyMGxhbmd1YWdlJTBBc2FtcGxlX3RleHQlMjAlM0QlMjAlMjJvJUMzJUI5JTIwZXN0JTIwbCdhcnIlQzMlQUF0JTIwZGUlMjBidXMlMjAlM0YlMjIlMEFtb2RlbF9uYW1lJTIwJTNEJTIwZiUyMkhlbHNpbmtpLU5MUCUyRm9wdXMtbXQtJTdCc3JjJTdELSU3QnRyZyU3RCUyMiUwQSUwQW1vZGVsJTIwJTNEJTIwVEZNYXJpYW5NVE1vZGVsLmZyb21fcHJldHJhaW5lZChtb2RlbF9uYW1lKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKG1vZGVsX25hbWUpJTBBYmF0Y2glMjAlM0QlMjB0b2tlbml6ZXIoJTVCc2FtcGxlX3RleHQlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQWdlbiUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqYmF0Y2gpJTBBdG9rZW5pemVyLmJhdGNoX2RlY29kZShnZW4lMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFMarianMTModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> typing <span class="hljs-keyword">import</span> <span class="hljs-type">List</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>src = <span class="hljs-string">&quot;fr&quot;</span>  <span class="hljs-comment"># source language</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>trg = <span class="hljs-string">&quot;en&quot;</span>  <span class="hljs-comment"># target language</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>sample_text = <span class="hljs-string">&quot;o\xF9 est l&#x27;arr\xEAt de bus ?&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model_name = <span class="hljs-string">f&quot;Helsinki-NLP/opus-mt-<span class="hljs-subst">{src}</span>-<span class="hljs-subst">{trg}</span>&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFMarianMTModel.from_pretrained(model_name)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(model_name)
<span class="hljs-meta">&gt;&gt;&gt; </span>batch = tokenizer([sample_text], return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>gen = model.generate(**batch)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(gen, skip_special_tokens=<span class="hljs-literal">True</span>)
<span class="hljs-string">&quot;Where is the bus stop ?&quot;</span>`}}),{c(){h=o("p"),y=r("Examples:"),_=c(),b(g.$$.fragment)},l(i){h=a(i,"P",{});var u=s(h);y=l(u,"Examples:"),u.forEach(t),_=p(i),k(g.$$.fragment,i)},m(i,u){f(i,h,u),e(h,y),f(i,_,u),v(g,i,u),M=!0},p:Ot,i(i){M||(w(g.$$.fragment,i),M=!0)},o(i){x(g.$$.fragment,i),M=!1},d(i){i&&t(h),i&&t(_),j(g,i)}}}function qf(J){let h,y,_,g,M;return{c(){h=o("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=o("code"),g=r("Module"),M=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){h=a(i,"P",{});var u=s(h);y=l(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var z=s(_);g=l(z,"Module"),z.forEach(t),M=l(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(i,u){f(i,h,u),e(h,y),e(h,_),e(_,g),e(h,M)},d(i){i&&t(h)}}}function Zf(J){let h,y,_,g,M;return g=new Ie({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4TWFyaWFuTW9kZWwlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJIZWxzaW5raS1OTFAlMkZvcHVzLW10LWVuLWRlJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheE1hcmlhbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJIZWxzaW5raS1OTFAlMkZvcHVzLW10LWVuLWRlJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJqYXglMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxMarianModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;Helsinki-NLP/opus-mt-en-de&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxMarianModel.from_pretrained(<span class="hljs-string">&quot;Helsinki-NLP/opus-mt-en-de&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;jax&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){h=o("p"),y=r("Example:"),_=c(),b(g.$$.fragment)},l(i){h=a(i,"P",{});var u=s(h);y=l(u,"Example:"),u.forEach(t),_=p(i),k(g.$$.fragment,i)},m(i,u){f(i,h,u),e(h,y),f(i,_,u),v(g,i,u),M=!0},p:Ot,i(i){M||(w(g.$$.fragment,i),M=!0)},o(i){x(g.$$.fragment,i),M=!1},d(i){i&&t(h),i&&t(_),j(g,i)}}}function Af(J){let h,y,_,g,M;return{c(){h=o("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=o("code"),g=r("Module"),M=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){h=a(i,"P",{});var u=s(h);y=l(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var z=s(_);g=l(z,"Module"),z.forEach(t),M=l(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(i,u){f(i,h,u),e(h,y),e(h,_),e(_,g),e(h,M)},d(i){i&&t(h)}}}function Wf(J){let h,y,_,g,M;return g=new Ie({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4TWFyaWFuTVRNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwRmxheE1hcmlhbk1UTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMkhlbHNpbmtpLU5MUCUyRm9wdXMtbXQtZW4tZGUlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIySGVsc2lua2ktTkxQJTJGb3B1cy1tdC1lbi1kZSUyMiklMEElMEF0ZXh0JTIwJTNEJTIwJTIyTXklMjBmcmllbmRzJTIwYXJlJTIwY29vbCUyMGJ1dCUyMHRoZXklMjBlYXQlMjB0b28lMjBtYW55JTIwY2FyYnMuJTIyJTBBaW5wdXRfaWRzJTIwJTNEJTIwdG9rZW5pemVyKHRleHQlMkMlMjBtYXhfbGVuZ3RoJTNENjQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMmpheCUyMikuaW5wdXRfaWRzJTBBJTBBc2VxdWVuY2VzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRfaWRzJTJDJTIwbWF4X2xlbmd0aCUzRDY0JTJDJTIwbnVtX2JlYW1zJTNEMikuc2VxdWVuY2VzJTBBJTBBb3V0cHV0cyUyMCUzRCUyMHRva2VuaXplci5iYXRjaF9kZWNvZGUoc2VxdWVuY2VzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTBBJTIzJTIwc2hvdWxkJTIwZ2l2ZSUyMCpNZWluZSUyMEZyZXVuZGUlMjBzaW5kJTIwY29vbCUyQyUyMGFiZXIlMjBzaWUlMjBlc3NlbiUyMHp1JTIwdmllbGUlMjBLb2hsZW5oeWRyYXRlLio=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxMarianMTModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxMarianMTModel.from_pretrained(<span class="hljs-string">&quot;Helsinki-NLP/opus-mt-en-de&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;Helsinki-NLP/opus-mt-en-de&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;My friends are cool but they eat too many carbs.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(text, max_length=<span class="hljs-number">64</span>, return_tensors=<span class="hljs-string">&quot;jax&quot;</span>).input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span>sequences = model.generate(input_ids, max_length=<span class="hljs-number">64</span>, num_beams=<span class="hljs-number">2</span>).sequences

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = tokenizer.batch_decode(sequences, skip_special_tokens=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># should give *Meine Freunde sind cool, aber sie essen zu viele Kohlenhydrate.*</span>`}}),{c(){h=o("p"),y=r("Example:"),_=c(),b(g.$$.fragment)},l(i){h=a(i,"P",{});var u=s(h);y=l(u,"Example:"),u.forEach(t),_=p(i),k(g.$$.fragment,i)},m(i,u){f(i,h,u),e(h,y),f(i,_,u),v(g,i,u),M=!0},p:Ot,i(i){M||(w(g.$$.fragment,i),M=!0)},o(i){x(g.$$.fragment,i),M=!1},d(i){i&&t(h),i&&t(_),j(g,i)}}}function Sf(J){let h,y,_,g,M,i,u,z,Le,Fe,Z,he,Y,$,He,S,ue,ct,K,B,_e,ae,Qe,se,re,Oe,Ce,P,De,Ne,ee,F,q,me,V,Ye,qe,A,te,Me,C,Ke,R,et,Ze,E,ye,Te,G,tt,X,le,be,N,nt,W,ot,ke,T,U,ve,we,_t,xe,I,Mt,yt,at,st,Tt,L,H,rt,bt,ie,je,Je,lt,Ae,$e,kt,si,vt,Xn,ri,ss,li,ii,di,Ln,ci,rs,pi,hi,ui,wt,mi,ls,fi,gi,is,_i,Mi,yi,ds,Hn,Ti,cs,bi,ki,vi,ps,Qn,wi,On,xi,ji,Ur,xt,Dt,hs,Dn,Ji,us,$i,Er,We,xa,zi,ms,Ui,Ei,Yn,Ii,Kn,Fi,Ci,Ni,jt,qi,fs,Zi,Ai,gs,Wi,Si,Pi,_s,Bi,Ir,Jt,Yt,Ms,eo,Vi,ys,Ri,Fr,Kt,Ts,Gi,Xi,bs,to,Li,Cr,$t,en,ks,no,Hi,vs,Qi,Nr,Se,oo,Oi,ws,Di,Yi,Ki,ao,ed,xs,td,nd,od,so,ad,ro,sd,rd,ld,lo,id,js,dd,cd,qr,tn,pd,io,hd,ud,Zr,co,Ar,ja,md,Wr,po,Sr,zt,nn,Js,ho,fd,$s,gd,Pr,Ja,_d,Br,uo,Vr,$a,Md,Rr,mo,Gr,Ut,on,zs,fo,yd,Us,Td,Xr,pt,Es,za,bd,kd,Is,Ua,vd,wd,Fs,Ea,xd,Lr,Et,an,Cs,go,jd,Ns,Jd,Hr,ze,_o,$d,It,zd,Ia,Ud,Ed,Mo,Id,Fd,Cd,Ft,Nd,Fa,qd,Zd,Ca,Ad,Wd,Sd,sn,Qr,Ct,rn,qs,yo,Pd,Zs,Bd,Or,de,To,Vd,bo,Rd,ko,Gd,Xd,Ld,vo,Hd,Na,Qd,Od,Dd,ln,Yd,dn,wo,Kd,As,ec,Dr,Nt,cn,Ws,xo,tc,Ss,nc,Yr,Ue,jo,oc,Jo,ac,qa,sc,rc,lc,$o,ic,zo,dc,cc,pc,Pe,Uo,hc,qt,uc,Za,mc,fc,Ps,gc,_c,Mc,pn,yc,hn,Kr,Zt,un,Bs,Eo,Tc,Vs,bc,el,Ee,Io,kc,Fo,vc,Aa,wc,xc,jc,Co,Jc,No,$c,zc,Uc,fe,qo,Ec,At,Ic,Wa,Fc,Cc,Rs,Nc,qc,Zc,mn,Ac,Zo,Wc,Ao,Sc,Pc,Bc,fn,tl,Wt,gn,Gs,Wo,Vc,Xs,Rc,nl,St,So,Gc,_n,Po,Xc,Mn,ol,Pt,yn,Ls,Bo,Lc,Hs,Hc,al,ce,Vo,Qc,Ro,Oc,Sa,Dc,Yc,Kc,Go,ep,Xo,tp,np,op,Tn,ap,Be,Lo,sp,Bt,rp,Pa,lp,ip,Qs,dp,cp,pp,bn,hp,kn,sl,Vt,vn,Os,Ho,up,Ds,mp,rl,pe,Qo,fp,Oo,gp,Ba,_p,Mp,yp,Do,Tp,Yo,bp,kp,vp,wn,wp,ge,Ko,xp,Rt,jp,Va,Jp,$p,Ys,zp,Up,Ep,xn,Ip,ea,Fp,ta,Cp,Np,qp,jn,ll,Gt,Jn,Ks,na,Zp,er,Ap,il,Q,oa,Wp,aa,Sp,Ra,Pp,Bp,Vp,sa,Rp,ra,Gp,Xp,Lp,tr,Hp,Qp,it,nr,la,Op,Dp,or,ia,Yp,Kp,ar,da,eh,th,sr,ca,nh,oh,Ve,pa,ah,Xt,sh,rr,rh,lh,lr,ih,dh,ch,$n,ph,zn,dl,Lt,Un,ir,ha,hh,dr,uh,cl,O,ua,mh,ma,fh,Ga,gh,_h,Mh,fa,yh,ga,Th,bh,kh,cr,vh,wh,dt,pr,_a,xh,jh,hr,Ma,Jh,$h,ur,ya,zh,Uh,mr,Ta,Eh,Ih,Re,ba,Fh,Ht,Ch,fr,Nh,qh,gr,Zh,Ah,Wh,En,Sh,In,pl;return i=new oe({}),C=new oe({}),Dn=new oe({}),eo=new oe({}),no=new oe({}),co=new Ie({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1hcmlhbk1UTW9kZWwlMkMlMjBNYXJpYW5Ub2tlbml6ZXIlMEElMEFzcmNfdGV4dCUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMiUzRSUzRWZyYSUzQyUzQyUyMHRoaXMlMjBpcyUyMGElMjBzZW50ZW5jZSUyMGluJTIwZW5nbGlzaCUyMHRoYXQlMjB3ZSUyMHdhbnQlMjB0byUyMHRyYW5zbGF0ZSUyMHRvJTIwZnJlbmNoJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyJTNFJTNFcG9yJTNDJTNDJTIwVGhpcyUyMHNob3VsZCUyMGdvJTIwdG8lMjBwb3J0dWd1ZXNlJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyJTNFJTNFZXNwJTNDJTNDJTIwQW5kJTIwdGhpcyUyMHRvJTIwU3BhbmlzaCUyMiUyQyUwQSU1RCUwQSUwQW1vZGVsX25hbWUlMjAlM0QlMjAlMjJIZWxzaW5raS1OTFAlMkZvcHVzLW10LWVuLXJvYSUyMiUwQXRva2VuaXplciUyMCUzRCUyME1hcmlhblRva2VuaXplci5mcm9tX3ByZXRyYWluZWQobW9kZWxfbmFtZSklMEFwcmludCh0b2tlbml6ZXIuc3VwcG9ydGVkX2xhbmd1YWdlX2NvZGVzKSUwQSUwQW1vZGVsJTIwJTNEJTIwTWFyaWFuTVRNb2RlbC5mcm9tX3ByZXRyYWluZWQobW9kZWxfbmFtZSklMEF0cmFuc2xhdGVkJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKip0b2tlbml6ZXIoc3JjX3RleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTIwcGFkZGluZyUzRFRydWUpKSUwQSU1QnRva2VuaXplci5kZWNvZGUodCUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSUyMGZvciUyMHQlMjBpbiUyMHRyYW5zbGF0ZWQlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MarianMTModel, MarianTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>src_text = [
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;&gt;&gt;fra&lt;&lt; this is a sentence in english that we want to translate to french&quot;</span>,
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;&gt;&gt;por&lt;&lt; This should go to portuguese&quot;</span>,
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;&gt;&gt;esp&lt;&lt; And this to Spanish&quot;</span>,
<span class="hljs-meta">... </span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>model_name = <span class="hljs-string">&quot;Helsinki-NLP/opus-mt-en-roa&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = MarianTokenizer.from_pretrained(model_name)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.supported_language_codes)
[<span class="hljs-string">&#x27;&gt;&gt;zlm_Latn&lt;&lt;&#x27;</span>, <span class="hljs-string">&#x27;&gt;&gt;mfe&lt;&lt;&#x27;</span>, <span class="hljs-string">&#x27;&gt;&gt;hat&lt;&lt;&#x27;</span>, <span class="hljs-string">&#x27;&gt;&gt;pap&lt;&lt;&#x27;</span>, <span class="hljs-string">&#x27;&gt;&gt;ast&lt;&lt;&#x27;</span>, <span class="hljs-string">&#x27;&gt;&gt;cat&lt;&lt;&#x27;</span>, <span class="hljs-string">&#x27;&gt;&gt;ind&lt;&lt;&#x27;</span>, <span class="hljs-string">&#x27;&gt;&gt;glg&lt;&lt;&#x27;</span>, <span class="hljs-string">&#x27;&gt;&gt;wln&lt;&lt;&#x27;</span>, <span class="hljs-string">&#x27;&gt;&gt;spa&lt;&lt;&#x27;</span>, <span class="hljs-string">&#x27;&gt;&gt;fra&lt;&lt;&#x27;</span>, <span class="hljs-string">&#x27;&gt;&gt;ron&lt;&lt;&#x27;</span>, <span class="hljs-string">&#x27;&gt;&gt;por&lt;&lt;&#x27;</span>, <span class="hljs-string">&#x27;&gt;&gt;ita&lt;&lt;&#x27;</span>, <span class="hljs-string">&#x27;&gt;&gt;oci&lt;&lt;&#x27;</span>, <span class="hljs-string">&#x27;&gt;&gt;arg&lt;&lt;&#x27;</span>, <span class="hljs-string">&#x27;&gt;&gt;min&lt;&lt;&#x27;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>model = MarianMTModel.from_pretrained(model_name)
<span class="hljs-meta">&gt;&gt;&gt; </span>translated = model.generate(**tokenizer(src_text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span>[tokenizer.decode(t, skip_special_tokens=<span class="hljs-literal">True</span>) <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> translated]
[<span class="hljs-string">&quot;c&#x27;est une phrase en anglais que nous voulons traduire en fran\xE7ais&quot;</span>,
 <span class="hljs-string">&#x27;Isto deve ir para o portugu\xEAs.&#x27;</span>,
 <span class="hljs-string">&#x27;Y esto al espa\xF1ol&#x27;</span>]`}}),po=new Ie({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGxpc3RfbW9kZWxzJTBBJTBBbW9kZWxfbGlzdCUyMCUzRCUyMGxpc3RfbW9kZWxzKCklMEFvcmclMjAlM0QlMjAlMjJIZWxzaW5raS1OTFAlMjIlMEFtb2RlbF9pZHMlMjAlM0QlMjAlNUJ4Lm1vZGVsSWQlMjBmb3IlMjB4JTIwaW4lMjBtb2RlbF9saXN0JTIwaWYlMjB4Lm1vZGVsSWQuc3RhcnRzd2l0aChvcmcpJTVEJTBBc3VmZml4JTIwJTNEJTIwJTVCeC5zcGxpdCglMjIlMkYlMjIpJTVCMSU1RCUyMGZvciUyMHglMjBpbiUyMG1vZGVsX2lkcyU1RCUwQW9sZF9zdHlsZV9tdWx0aV9tb2RlbHMlMjAlM0QlMjAlNUJmJTIyJTdCb3JnJTdEJTJGJTdCcyU3RCUyMiUyMGZvciUyMHMlMjBpbiUyMHN1ZmZpeCUyMGlmJTIwcyUyMCElM0QlMjBzLmxvd2VyKCklNUQ=",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> list_models

model_list = list_models()
org = <span class="hljs-string">&quot;Helsinki-NLP&quot;</span>
model_ids = [x.modelId <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> model_list <span class="hljs-keyword">if</span> x.modelId.startswith(org)]
suffix = [x.split(<span class="hljs-string">&quot;/&quot;</span>)[<span class="hljs-number">1</span>] <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> model_ids]
old_style_multi_models = [<span class="hljs-string">f&quot;<span class="hljs-subst">{org}</span>/<span class="hljs-subst">{s}</span>&quot;</span> <span class="hljs-keyword">for</span> s <span class="hljs-keyword">in</span> suffix <span class="hljs-keyword">if</span> s != s.lower()]`}}),ho=new oe({}),uo=new Ie({props:{code:"JTVCJ0hlbHNpbmtpLU5MUCUyRm9wdXMtbXQtTk9SVEhfRVUtTk9SVEhfRVUnJTJDJTBBJTIwJ0hlbHNpbmtpLU5MUCUyRm9wdXMtbXQtUk9NQU5DRS1lbiclMkMlMEElMjAnSGVsc2lua2ktTkxQJTJGb3B1cy1tdC1TQ0FORElOQVZJQS1TQ0FORElOQVZJQSclMkMlMEElMjAnSGVsc2lua2ktTkxQJTJGb3B1cy1tdC1kZS1aSCclMkMlMEElMjAnSGVsc2lua2ktTkxQJTJGb3B1cy1tdC1lbi1DRUxUSUMnJTJDJTBBJTIwJ0hlbHNpbmtpLU5MUCUyRm9wdXMtbXQtZW4tUk9NQU5DRSclMkMlMEElMjAnSGVsc2lua2ktTkxQJTJGb3B1cy1tdC1lcy1OT1JXQVknJTJDJTBBJTIwJ0hlbHNpbmtpLU5MUCUyRm9wdXMtbXQtZmktTk9SV0FZJyUyQyUwQSUyMCdIZWxzaW5raS1OTFAlMkZvcHVzLW10LWZpLVpIJyUyQyUwQSUyMCdIZWxzaW5raS1OTFAlMkZvcHVzLW10LWZpX25iX25vX25uX3J1X3N2X2VuLVNBTUknJTJDJTBBJTIwJ0hlbHNpbmtpLU5MUCUyRm9wdXMtbXQtc3YtTk9SV0FZJyUyQyUwQSUyMCdIZWxzaW5raS1OTFAlMkZvcHVzLW10LXN2LVpIJyU1RCUwQUdST1VQX01FTUJFUlMlMjAlM0QlMjAlN0IlMEElMjAnWkgnJTNBJTIwJTVCJ2NtbiclMkMlMjAnY24nJTJDJTIwJ3l1ZSclMkMlMjAnemVfemgnJTJDJTIwJ3poX2NuJyUyQyUyMCd6aF9DTiclMkMlMjAnemhfSEsnJTJDJTIwJ3poX3R3JyUyQyUyMCd6aF9UVyclMkMlMjAnemhfeXVlJyUyQyUyMCd6aHMnJTJDJTIwJ3podCclMkMlMjAnemgnJTVEJTJDJTBBJTIwJ1JPTUFOQ0UnJTNBJTIwJTVCJ2ZyJyUyQyUyMCdmcl9CRSclMkMlMjAnZnJfQ0EnJTJDJTIwJ2ZyX0ZSJyUyQyUyMCd3YSclMkMlMjAnZnJwJyUyQyUyMCdvYyclMkMlMjAnY2EnJTJDJTIwJ3JtJyUyQyUyMCdsbGQnJTJDJTIwJ2Z1ciclMkMlMjAnbGlqJyUyQyUyMCdsbW8nJTJDJTIwJ2VzJyUyQyUyMCdlc19BUiclMkMlMjAnZXNfQ0wnJTJDJTIwJ2VzX0NPJyUyQyUyMCdlc19DUiclMkMlMjAnZXNfRE8nJTJDJTIwJ2VzX0VDJyUyQyUyMCdlc19FUyclMkMlMjAnZXNfR1QnJTJDJTIwJ2VzX0hOJyUyQyUyMCdlc19NWCclMkMlMjAnZXNfTkknJTJDJTIwJ2VzX1BBJyUyQyUyMCdlc19QRSclMkMlMjAnZXNfUFInJTJDJTIwJ2VzX1NWJyUyQyUyMCdlc19VWSclMkMlMjAnZXNfVkUnJTJDJTIwJ3B0JyUyQyUyMCdwdF9iciclMkMlMjAncHRfQlInJTJDJTIwJ3B0X1BUJyUyQyUyMCdnbCclMkMlMjAnbGFkJyUyQyUyMCdhbiclMkMlMjAnbXdsJyUyQyUyMCdpdCclMkMlMjAnaXRfSVQnJTJDJTIwJ2NvJyUyQyUyMCduYXAnJTJDJTIwJ3NjbiclMkMlMjAndmVjJyUyQyUyMCdzYyclMkMlMjAncm8nJTJDJTIwJ2xhJyU1RCUyQyUwQSUyMCdOT1JUSF9FVSclM0ElMjAlNUInZGUnJTJDJTIwJ25sJyUyQyUyMCdmeSclMkMlMjAnYWYnJTJDJTIwJ2RhJyUyQyUyMCdmbyclMkMlMjAnaXMnJTJDJTIwJ25vJyUyQyUyMCduYiclMkMlMjAnbm4nJTJDJTIwJ3N2JyU1RCUyQyUwQSUyMCdTQ0FORElOQVZJQSclM0ElMjAlNUInZGEnJTJDJTIwJ2ZvJyUyQyUyMCdpcyclMkMlMjAnbm8nJTJDJTIwJ25iJyUyQyUyMCdubiclMkMlMjAnc3YnJTVEJTJDJTBBJTIwJ1NBTUknJTNBJTIwJTVCJ3NlJyUyQyUyMCdzbWEnJTJDJTIwJ3NtaiclMkMlMjAnc21uJyUyQyUyMCdzbXMnJTVEJTJDJTBBJTIwJ05PUldBWSclM0ElMjAlNUInbmJfTk8nJTJDJTIwJ25iJyUyQyUyMCdubl9OTyclMkMlMjAnbm4nJTJDJTIwJ25vZyclMkMlMjAnbm9fbmInJTJDJTIwJ25vJyU1RCUyQyUwQSUyMCdDRUxUSUMnJTNBJTIwJTVCJ2dhJyUyQyUyMCdjeSclMkMlMjAnYnInJTJDJTIwJ2dkJyUyQyUyMCdrdyclMkMlMjAnZ3YnJTVEJTBBJTdE",highlighted:`[<span class="hljs-string">&#x27;Helsinki-NLP/opus-mt-NORTH_EU-NORTH_EU&#x27;</span>,
 <span class="hljs-string">&#x27;Helsinki-NLP/opus-mt-ROMANCE-en&#x27;</span>,
 <span class="hljs-string">&#x27;Helsinki-NLP/opus-mt-SCANDINAVIA-SCANDINAVIA&#x27;</span>,
 <span class="hljs-string">&#x27;Helsinki-NLP/opus-mt-de-ZH&#x27;</span>,
 <span class="hljs-string">&#x27;Helsinki-NLP/opus-mt-en-CELTIC&#x27;</span>,
 <span class="hljs-string">&#x27;Helsinki-NLP/opus-mt-en-ROMANCE&#x27;</span>,
 <span class="hljs-string">&#x27;Helsinki-NLP/opus-mt-es-NORWAY&#x27;</span>,
 <span class="hljs-string">&#x27;Helsinki-NLP/opus-mt-fi-NORWAY&#x27;</span>,
 <span class="hljs-string">&#x27;Helsinki-NLP/opus-mt-fi-ZH&#x27;</span>,
 <span class="hljs-string">&#x27;Helsinki-NLP/opus-mt-fi_nb_no_nn_ru_sv_en-SAMI&#x27;</span>,
 <span class="hljs-string">&#x27;Helsinki-NLP/opus-mt-sv-NORWAY&#x27;</span>,
 <span class="hljs-string">&#x27;Helsinki-NLP/opus-mt-sv-ZH&#x27;</span>]
GROUP_MEMBERS = {
 <span class="hljs-string">&#x27;ZH&#x27;</span>: [<span class="hljs-string">&#x27;cmn&#x27;</span>, <span class="hljs-string">&#x27;cn&#x27;</span>, <span class="hljs-string">&#x27;yue&#x27;</span>, <span class="hljs-string">&#x27;ze_zh&#x27;</span>, <span class="hljs-string">&#x27;zh_cn&#x27;</span>, <span class="hljs-string">&#x27;zh_CN&#x27;</span>, <span class="hljs-string">&#x27;zh_HK&#x27;</span>, <span class="hljs-string">&#x27;zh_tw&#x27;</span>, <span class="hljs-string">&#x27;zh_TW&#x27;</span>, <span class="hljs-string">&#x27;zh_yue&#x27;</span>, <span class="hljs-string">&#x27;zhs&#x27;</span>, <span class="hljs-string">&#x27;zht&#x27;</span>, <span class="hljs-string">&#x27;zh&#x27;</span>],
 <span class="hljs-string">&#x27;ROMANCE&#x27;</span>: [<span class="hljs-string">&#x27;fr&#x27;</span>, <span class="hljs-string">&#x27;fr_BE&#x27;</span>, <span class="hljs-string">&#x27;fr_CA&#x27;</span>, <span class="hljs-string">&#x27;fr_FR&#x27;</span>, <span class="hljs-string">&#x27;wa&#x27;</span>, <span class="hljs-string">&#x27;frp&#x27;</span>, <span class="hljs-string">&#x27;oc&#x27;</span>, <span class="hljs-string">&#x27;ca&#x27;</span>, <span class="hljs-string">&#x27;rm&#x27;</span>, <span class="hljs-string">&#x27;lld&#x27;</span>, <span class="hljs-string">&#x27;fur&#x27;</span>, <span class="hljs-string">&#x27;lij&#x27;</span>, <span class="hljs-string">&#x27;lmo&#x27;</span>, <span class="hljs-string">&#x27;es&#x27;</span>, <span class="hljs-string">&#x27;es_AR&#x27;</span>, <span class="hljs-string">&#x27;es_CL&#x27;</span>, <span class="hljs-string">&#x27;es_CO&#x27;</span>, <span class="hljs-string">&#x27;es_CR&#x27;</span>, <span class="hljs-string">&#x27;es_DO&#x27;</span>, <span class="hljs-string">&#x27;es_EC&#x27;</span>, <span class="hljs-string">&#x27;es_ES&#x27;</span>, <span class="hljs-string">&#x27;es_GT&#x27;</span>, <span class="hljs-string">&#x27;es_HN&#x27;</span>, <span class="hljs-string">&#x27;es_MX&#x27;</span>, <span class="hljs-string">&#x27;es_NI&#x27;</span>, <span class="hljs-string">&#x27;es_PA&#x27;</span>, <span class="hljs-string">&#x27;es_PE&#x27;</span>, <span class="hljs-string">&#x27;es_PR&#x27;</span>, <span class="hljs-string">&#x27;es_SV&#x27;</span>, <span class="hljs-string">&#x27;es_UY&#x27;</span>, <span class="hljs-string">&#x27;es_VE&#x27;</span>, <span class="hljs-string">&#x27;pt&#x27;</span>, <span class="hljs-string">&#x27;pt_br&#x27;</span>, <span class="hljs-string">&#x27;pt_BR&#x27;</span>, <span class="hljs-string">&#x27;pt_PT&#x27;</span>, <span class="hljs-string">&#x27;gl&#x27;</span>, <span class="hljs-string">&#x27;lad&#x27;</span>, <span class="hljs-string">&#x27;an&#x27;</span>, <span class="hljs-string">&#x27;mwl&#x27;</span>, <span class="hljs-string">&#x27;it&#x27;</span>, <span class="hljs-string">&#x27;it_IT&#x27;</span>, <span class="hljs-string">&#x27;co&#x27;</span>, <span class="hljs-string">&#x27;nap&#x27;</span>, <span class="hljs-string">&#x27;scn&#x27;</span>, <span class="hljs-string">&#x27;vec&#x27;</span>, <span class="hljs-string">&#x27;sc&#x27;</span>, <span class="hljs-string">&#x27;ro&#x27;</span>, <span class="hljs-string">&#x27;la&#x27;</span>],
 <span class="hljs-string">&#x27;NORTH_EU&#x27;</span>: [<span class="hljs-string">&#x27;de&#x27;</span>, <span class="hljs-string">&#x27;nl&#x27;</span>, <span class="hljs-string">&#x27;fy&#x27;</span>, <span class="hljs-string">&#x27;af&#x27;</span>, <span class="hljs-string">&#x27;da&#x27;</span>, <span class="hljs-string">&#x27;fo&#x27;</span>, <span class="hljs-string">&#x27;is&#x27;</span>, <span class="hljs-string">&#x27;no&#x27;</span>, <span class="hljs-string">&#x27;nb&#x27;</span>, <span class="hljs-string">&#x27;nn&#x27;</span>, <span class="hljs-string">&#x27;sv&#x27;</span>],
 <span class="hljs-string">&#x27;SCANDINAVIA&#x27;</span>: [<span class="hljs-string">&#x27;da&#x27;</span>, <span class="hljs-string">&#x27;fo&#x27;</span>, <span class="hljs-string">&#x27;is&#x27;</span>, <span class="hljs-string">&#x27;no&#x27;</span>, <span class="hljs-string">&#x27;nb&#x27;</span>, <span class="hljs-string">&#x27;nn&#x27;</span>, <span class="hljs-string">&#x27;sv&#x27;</span>],
 <span class="hljs-string">&#x27;SAMI&#x27;</span>: [<span class="hljs-string">&#x27;se&#x27;</span>, <span class="hljs-string">&#x27;sma&#x27;</span>, <span class="hljs-string">&#x27;smj&#x27;</span>, <span class="hljs-string">&#x27;smn&#x27;</span>, <span class="hljs-string">&#x27;sms&#x27;</span>],
 <span class="hljs-string">&#x27;NORWAY&#x27;</span>: [<span class="hljs-string">&#x27;nb_NO&#x27;</span>, <span class="hljs-string">&#x27;nb&#x27;</span>, <span class="hljs-string">&#x27;nn_NO&#x27;</span>, <span class="hljs-string">&#x27;nn&#x27;</span>, <span class="hljs-string">&#x27;nog&#x27;</span>, <span class="hljs-string">&#x27;no_nb&#x27;</span>, <span class="hljs-string">&#x27;no&#x27;</span>],
 <span class="hljs-string">&#x27;CELTIC&#x27;</span>: [<span class="hljs-string">&#x27;ga&#x27;</span>, <span class="hljs-string">&#x27;cy&#x27;</span>, <span class="hljs-string">&#x27;br&#x27;</span>, <span class="hljs-string">&#x27;gd&#x27;</span>, <span class="hljs-string">&#x27;kw&#x27;</span>, <span class="hljs-string">&#x27;gv&#x27;</span>]
}`}}),mo=new Ie({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1hcmlhbk1UTW9kZWwlMkMlMjBNYXJpYW5Ub2tlbml6ZXIlMEElMEFzcmNfdGV4dCUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMiUzRSUzRWZyJTNDJTNDJTIwdGhpcyUyMGlzJTIwYSUyMHNlbnRlbmNlJTIwaW4lMjBlbmdsaXNoJTIwdGhhdCUyMHdlJTIwd2FudCUyMHRvJTIwdHJhbnNsYXRlJTIwdG8lMjBmcmVuY2glMjIlMkMlMEElMjAlMjAlMjAlMjAlMjIlM0UlM0VwdCUzQyUzQyUyMFRoaXMlMjBzaG91bGQlMjBnbyUyMHRvJTIwcG9ydHVndWVzZSUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMiUzRSUzRWVzJTNDJTNDJTIwQW5kJTIwdGhpcyUyMHRvJTIwU3BhbmlzaCUyMiUyQyUwQSU1RCUwQSUwQW1vZGVsX25hbWUlMjAlM0QlMjAlMjJIZWxzaW5raS1OTFAlMkZvcHVzLW10LWVuLVJPTUFOQ0UlMjIlMEF0b2tlbml6ZXIlMjAlM0QlMjBNYXJpYW5Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKG1vZGVsX25hbWUpJTBBJTBBbW9kZWwlMjAlM0QlMjBNYXJpYW5NVE1vZGVsLmZyb21fcHJldHJhaW5lZChtb2RlbF9uYW1lKSUwQXRyYW5zbGF0ZWQlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKnRva2VuaXplcihzcmNfdGV4dCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMkMlMjBwYWRkaW5nJTNEVHJ1ZSkpJTBBdGd0X3RleHQlMjAlM0QlMjAlNUJ0b2tlbml6ZXIuZGVjb2RlKHQlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklMjBmb3IlMjB0JTIwaW4lMjB0cmFuc2xhdGVkJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MarianMTModel, MarianTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>src_text = [
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;&gt;&gt;fr&lt;&lt; this is a sentence in english that we want to translate to french&quot;</span>,
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;&gt;&gt;pt&lt;&lt; This should go to portuguese&quot;</span>,
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;&gt;&gt;es&lt;&lt; And this to Spanish&quot;</span>,
<span class="hljs-meta">... </span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>model_name = <span class="hljs-string">&quot;Helsinki-NLP/opus-mt-en-ROMANCE&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = MarianTokenizer.from_pretrained(model_name)

<span class="hljs-meta">&gt;&gt;&gt; </span>model = MarianMTModel.from_pretrained(model_name)
<span class="hljs-meta">&gt;&gt;&gt; </span>translated = model.generate(**tokenizer(src_text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span>tgt_text = [tokenizer.decode(t, skip_special_tokens=<span class="hljs-literal">True</span>) <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> translated]
[<span class="hljs-string">&quot;c&#x27;est une phrase en anglais que nous voulons traduire en fran\xE7ais&quot;</span>, 
 <span class="hljs-string">&#x27;Isto deve ir para o portugu\xEAs.&#x27;</span>,
 <span class="hljs-string">&#x27;Y esto al espa\xF1ol&#x27;</span>]`}}),fo=new oe({}),go=new oe({}),_o=new D({props:{name:"class transformers.MarianConfig",anchor:"transformers.MarianConfig",parameters:[{name:"vocab_size",val:" = 58101"},{name:"decoder_vocab_size",val:" = None"},{name:"max_position_embeddings",val:" = 1024"},{name:"encoder_layers",val:" = 12"},{name:"encoder_ffn_dim",val:" = 4096"},{name:"encoder_attention_heads",val:" = 16"},{name:"decoder_layers",val:" = 12"},{name:"decoder_ffn_dim",val:" = 4096"},{name:"decoder_attention_heads",val:" = 16"},{name:"encoder_layerdrop",val:" = 0.0"},{name:"decoder_layerdrop",val:" = 0.0"},{name:"use_cache",val:" = True"},{name:"is_encoder_decoder",val:" = True"},{name:"activation_function",val:" = 'gelu'"},{name:"d_model",val:" = 1024"},{name:"dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.0"},{name:"activation_dropout",val:" = 0.0"},{name:"init_std",val:" = 0.02"},{name:"decoder_start_token_id",val:" = 58100"},{name:"scale_embedding",val:" = False"},{name:"pad_token_id",val:" = 58100"},{name:"eos_token_id",val:" = 0"},{name:"forced_eos_token_id",val:" = 0"},{name:"share_encoder_decoder_embeddings",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MarianConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 58101) &#x2014;
Vocabulary size of the Marian model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/marian#transformers.MarianModel">MarianModel</a> or <a href="/docs/transformers/main/en/model_doc/marian#transformers.TFMarianModel">TFMarianModel</a>.`,name:"vocab_size"},{anchor:"transformers.MarianConfig.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the layers and the pooler layer.`,name:"d_model"},{anchor:"transformers.MarianConfig.encoder_layers",description:`<strong>encoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of encoder layers.`,name:"encoder_layers"},{anchor:"transformers.MarianConfig.decoder_layers",description:`<strong>decoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of decoder layers.`,name:"decoder_layers"},{anchor:"transformers.MarianConfig.encoder_attention_heads",description:`<strong>encoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"encoder_attention_heads"},{anchor:"transformers.MarianConfig.decoder_attention_heads",description:`<strong>decoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"decoder_attention_heads"},{anchor:"transformers.MarianConfig.decoder_ffn_dim",description:`<strong>decoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"decoder_ffn_dim"},{anchor:"transformers.MarianConfig.encoder_ffn_dim",description:`<strong>encoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"encoder_ffn_dim"},{anchor:"transformers.MarianConfig.activation_function",description:`<strong>activation_function</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"activation_function"},{anchor:"transformers.MarianConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.MarianConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.MarianConfig.activation_dropout",description:`<strong>activation_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for activations inside the fully connected layer.`,name:"activation_dropout"},{anchor:"transformers.MarianConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.MarianConfig.init_std",description:`<strong>init_std</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"init_std"},{anchor:"transformers.MarianConfig.encoder_layerdrop",description:`<strong>encoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the encoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"encoder_layerdrop"},{anchor:"transformers.MarianConfig.decoder_layerdrop",description:`<strong>decoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the decoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"decoder_layerdrop"},{anchor:"transformers.MarianConfig.scale_embedding",description:`<strong>scale_embedding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Scale embeddings by diving by sqrt(d_model).`,name:"scale_embedding"},{anchor:"transformers.MarianConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models)`,name:"use_cache"},{anchor:"transformers.MarianConfig.forced_eos_token_id",description:`<strong>forced_eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The id of the token to force as the last generated token when <code>max_length</code> is reached. Usually set to
<code>eos_token_id</code>.`,name:"forced_eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/marian/configuration_marian.py#L34"}}),sn=new Qt({props:{anchor:"transformers.MarianConfig.example",$$slots:{default:[vf]},$$scope:{ctx:J}}}),yo=new oe({}),To=new D({props:{name:"class transformers.MarianTokenizer",anchor:"transformers.MarianTokenizer",parameters:[{name:"source_spm",val:""},{name:"target_spm",val:""},{name:"vocab",val:""},{name:"target_vocab_file",val:" = None"},{name:"source_lang",val:" = None"},{name:"target_lang",val:" = None"},{name:"unk_token",val:" = '<unk>'"},{name:"eos_token",val:" = '</s>'"},{name:"pad_token",val:" = '<pad>'"},{name:"model_max_length",val:" = 512"},{name:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"separate_vocabs",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MarianTokenizer.source_spm",description:`<strong>source_spm</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a .spm extension) that
contains the vocabulary for the source language.`,name:"source_spm"},{anchor:"transformers.MarianTokenizer.target_spm",description:`<strong>target_spm</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a .spm extension) that
contains the vocabulary for the target language.`,name:"target_spm"},{anchor:"transformers.MarianTokenizer.source_lang",description:`<strong>source_lang</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A string representing the source language.`,name:"source_lang"},{anchor:"transformers.MarianTokenizer.target_lang",description:`<strong>target_lang</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A string representing the target language.`,name:"target_lang"},{anchor:"transformers.MarianTokenizer.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.MarianTokenizer.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.`,name:"eos_token"},{anchor:"transformers.MarianTokenizer.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.MarianTokenizer.model_max_length",description:`<strong>model_max_length</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum sentence length the model accepts.`,name:"model_max_length"},{anchor:"transformers.MarianTokenizer.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (<code>List[str]</code>, <em>optional</em>, defaults to <code>[&quot;&lt;eop&gt;&quot;, &quot;&lt;eod&gt;&quot;]</code>) &#x2014;
Additional special tokens used by the tokenizer.`,name:"additional_special_tokens"},{anchor:"transformers.MarianTokenizer.sp_model_kwargs",description:`<strong>sp_model_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Will be passed to the <code>SentencePieceProcessor.__init__()</code> method. The <a href="https://github.com/google/sentencepiece/tree/master/python" rel="nofollow">Python wrapper for
SentencePiece</a> can be used, among other things,
to set:</p>
<ul>
<li>
<p><code>enable_sampling</code>: Enable subword regularization.</p>
</li>
<li>
<p><code>nbest_size</code>: Sampling parameters for unigram. Invalid for BPE-Dropout.</p>
<ul>
<li><code>nbest_size = {0,1}</code>: No sampling is performed.</li>
<li><code>nbest_size &gt; 1</code>: samples from the nbest_size results.</li>
<li><code>nbest_size &lt; 0</code>: assuming that nbest_size is infinite and samples from the all hypothesis (lattice)
using forward-filtering-and-backward-sampling algorithm.</li>
</ul>
</li>
<li>
<p><code>alpha</code>: Smoothing parameter for unigram sampling, and dropout probability of merge operations for
BPE-dropout.</p>
</li>
</ul>`,name:"sp_model_kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/marian/tokenization_marian.py#L61"}}),ln=new Qt({props:{anchor:"transformers.MarianTokenizer.example",$$slots:{default:[wf]},$$scope:{ctx:J}}}),wo=new D({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.MarianTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:""},{name:"token_ids_1",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/marian/tokenization_marian.py#L283"}}),xo=new oe({}),jo=new D({props:{name:"class transformers.MarianModel",anchor:"transformers.MarianModel",parameters:[{name:"config",val:": MarianConfig"}],parametersDescription:[{anchor:"transformers.MarianModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/marian#transformers.MarianConfig">MarianConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/marian/modeling_marian.py#L1106"}}),Uo=new D({props:{name:"forward",anchor:"transformers.MarianModel.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Union[typing.Tuple[torch.Tensor], transformers.modeling_outputs.BaseModelOutput, NoneType] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MarianModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.MarianModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.MarianModel.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Marian uses the <code>pad_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If
<code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).`,name:"decoder_input_ids"},{anchor:"transformers.MarianModel.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.`,name:"decoder_attention_mask"},{anchor:"transformers.MarianModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.MarianModel.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.MarianModel.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.MarianModel.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(torch.FloatTensor)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.MarianModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.MarianModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.MarianModel.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>decoder_input_ids</code> you can choose to directly pass an embedded
representation. If <code>past_key_values</code> is used, optionally only the last <code>decoder_inputs_embeds</code> have to be
input (see <code>past_key_values</code>). This is useful if you want more control over how to convert
<code>decoder_input_ids</code> indices into associated vectors than the model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>decoder_input_ids</code> and <code>decoder_inputs_embeds</code> are both unset, <code>decoder_inputs_embeds</code> takes the value
of <code>inputs_embeds</code>.`,name:"decoder_inputs_embeds"},{anchor:"transformers.MarianModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.MarianModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.MarianModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.MarianModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/marian/modeling_marian.py#L1190",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/marian#transformers.MarianConfig"
>MarianConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput"
>transformers.modeling_outputs.Seq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),pn=new Gn({props:{$$slots:{default:[xf]},$$scope:{ctx:J}}}),hn=new Qt({props:{anchor:"transformers.MarianModel.forward.example",$$slots:{default:[jf]},$$scope:{ctx:J}}}),Eo=new oe({}),Io=new D({props:{name:"class transformers.MarianMTModel",anchor:"transformers.MarianMTModel",parameters:[{name:"config",val:": MarianConfig"}],parametersDescription:[{anchor:"transformers.MarianMTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/marian#transformers.MarianConfig">MarianConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/marian/modeling_marian.py#L1292"}}),qo=new D({props:{name:"forward",anchor:"transformers.MarianMTModel.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_outputs",val:": typing.Union[typing.Tuple[torch.Tensor], transformers.modeling_outputs.BaseModelOutput, NoneType] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MarianMTModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.MarianMTModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.MarianMTModel.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Marian uses the <code>pad_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If
<code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).`,name:"decoder_input_ids"},{anchor:"transformers.MarianMTModel.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.`,name:"decoder_attention_mask"},{anchor:"transformers.MarianMTModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.MarianMTModel.forward.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.MarianMTModel.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.MarianMTModel.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(torch.FloatTensor)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.MarianMTModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.MarianMTModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.MarianMTModel.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>decoder_input_ids</code> you can choose to directly pass an embedded
representation. If <code>past_key_values</code> is used, optionally only the last <code>decoder_inputs_embeds</code> have to be
input (see <code>past_key_values</code>). This is useful if you want more control over how to convert
<code>decoder_input_ids</code> indices into associated vectors than the model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>decoder_input_ids</code> and <code>decoder_inputs_embeds</code> are both unset, <code>decoder_inputs_embeds</code> takes the value
of <code>inputs_embeds</code>.`,name:"decoder_inputs_embeds"},{anchor:"transformers.MarianMTModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.MarianMTModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.MarianMTModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.MarianMTModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MarianMTModel.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/marian/modeling_marian.py#L1416",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/marian#transformers.MarianConfig"
>MarianConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput"
>transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),mn=new Gn({props:{$$slots:{default:[Jf]},$$scope:{ctx:J}}}),fn=new Qt({props:{anchor:"transformers.MarianMTModel.forward.example",$$slots:{default:[$f]},$$scope:{ctx:J}}}),Wo=new oe({}),So=new D({props:{name:"class transformers.MarianForCausalLM",anchor:"transformers.MarianForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/marian/modeling_marian.py#L1556"}}),Po=new D({props:{name:"forward",anchor:"transformers.MarianForCausalLM.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"cross_attn_head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MarianForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you
provide it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.MarianForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.MarianForCausalLM.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention
if the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.MarianForCausalLM.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used
in the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:`,name:"encoder_attention_mask"},{anchor:"transformers.MarianForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.MarianForCausalLM.forward.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>torch.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.MarianForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of
shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>. The two additional
tensors are only required when the model is used as a decoder in a Sequence to Sequence model.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the
cross-attention blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those
that don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of
all <code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.MarianForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"},{anchor:"transformers.MarianForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding
(see <code>past_key_values</code>).</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"use_cache"},{anchor:"transformers.MarianForCausalLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under
returned tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.MarianForCausalLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors
for more detail.`,name:"output_hidden_states"},{anchor:"transformers.MarianForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/marian/modeling_marian.py#L1589",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/marian#transformers.MarianConfig"
>MarianConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Mn=new Qt({props:{anchor:"transformers.MarianForCausalLM.forward.example",$$slots:{default:[zf]},$$scope:{ctx:J}}}),Bo=new oe({}),Vo=new D({props:{name:"class transformers.TFMarianModel",anchor:"transformers.TFMarianModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMarianModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/marian#transformers.MarianConfig">MarianConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/marian/modeling_tf_marian.py#L1157"}}),Tn=new Gn({props:{$$slots:{default:[Uf]},$$scope:{ctx:J}}}),Lo=new D({props:{name:"call",anchor:"transformers.TFMarianModel.call",parameters:[{name:"input_ids",val:": tf.Tensor | None = None"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"decoder_input_ids",val:": tf.Tensor | None = None"},{name:"decoder_attention_mask",val:": tf.Tensor | None = None"},{name:"decoder_position_ids",val:": tf.Tensor | None = None"},{name:"head_mask",val:": tf.Tensor | None = None"},{name:"decoder_head_mask",val:": tf.Tensor | None = None"},{name:"cross_attn_head_mask",val:": tf.Tensor | None = None"},{name:"encoder_outputs",val:": tf.Tensor | None = None"},{name:"past_key_values",val:": Tuple[Tuple[tf.Tensor]] | None = None"},{name:"inputs_embeds",val:": tf.Tensor | None = None"},{name:"decoder_inputs_embeds",val:": tf.Tensor | None = None"},{name:"use_cache",val:": Optional[bool] = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMarianModel.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFMarianModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFMarianModel.call.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Marian uses the <code>pad_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If
<code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).`,name:"decoder_input_ids"},{anchor:"transformers.TFMarianModel.call.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
will be made by default and ignore pad tokens. It is not recommended to set this for most use cases.`,name:"decoder_attention_mask"},{anchor:"transformers.TFMarianModel.call.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.TFMarianModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFMarianModel.call.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.TFMarianModel.call.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.TFMarianModel.call.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tf.FloatTensor</code>, <em>optional</em>) &#x2014;
hidden states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.
of shape <code>(batch_size, sequence_length, hidden_size)</code> is a sequence of`,name:"encoder_outputs"},{anchor:"transformers.TFMarianModel.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.TFMarianModel.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>). Set to <code>False</code> during training, <code>True</code> during generation`,name:"use_cache"},{anchor:"transformers.TFMarianModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFMarianModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFMarianModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFMarianModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/marian/modeling_tf_marian.py#L1169",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqModelOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/marian#transformers.MarianConfig"
>MarianConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqModelOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),bn=new Gn({props:{$$slots:{default:[Ef]},$$scope:{ctx:J}}}),kn=new Qt({props:{anchor:"transformers.TFMarianModel.call.example",$$slots:{default:[If]},$$scope:{ctx:J}}}),Ho=new oe({}),Qo=new D({props:{name:"class transformers.TFMarianMTModel",anchor:"transformers.TFMarianMTModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFMarianMTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/marian#transformers.MarianConfig">MarianConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/marian/modeling_tf_marian.py#L1262"}}),wn=new Gn({props:{$$slots:{default:[Ff]},$$scope:{ctx:J}}}),Ko=new D({props:{name:"call",anchor:"transformers.TFMarianMTModel.call",parameters:[{name:"input_ids",val:": tf.Tensor | None = None"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"decoder_input_ids",val:": tf.Tensor | None = None"},{name:"decoder_attention_mask",val:": tf.Tensor | None = None"},{name:"decoder_position_ids",val:": tf.Tensor | None = None"},{name:"head_mask",val:": tf.Tensor | None = None"},{name:"decoder_head_mask",val:": tf.Tensor | None = None"},{name:"cross_attn_head_mask",val:": tf.Tensor | None = None"},{name:"encoder_outputs",val:": Optional[TFBaseModelOutput] = None"},{name:"past_key_values",val:": Tuple[Tuple[tf.Tensor]] | None = None"},{name:"inputs_embeds",val:": tf.Tensor | None = None"},{name:"decoder_inputs_embeds",val:": tf.Tensor | None = None"},{name:"use_cache",val:": Optional[bool] = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"labels",val:": tf.Tensor | None = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFMarianMTModel.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFMarianMTModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFMarianMTModel.call.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>Marian uses the <code>pad_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If
<code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).`,name:"decoder_input_ids"},{anchor:"transformers.TFMarianMTModel.call.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
will be made by default and ignore pad tokens. It is not recommended to set this for most use cases.`,name:"decoder_attention_mask"},{anchor:"transformers.TFMarianMTModel.call.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.TFMarianMTModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFMarianMTModel.call.decoder_head_mask",description:`<strong>decoder_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"decoder_head_mask"},{anchor:"transformers.TFMarianMTModel.call.cross_attn_head_mask",description:`<strong>cross_attn_head_mask</strong> (<code>tf.Tensor</code> of shape <code>(decoder_layers, decoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the cross-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"cross_attn_head_mask"},{anchor:"transformers.TFMarianMTModel.call.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tf.FloatTensor</code>, <em>optional</em>) &#x2014;
hidden states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.
of shape <code>(batch_size, sequence_length, hidden_size)</code> is a sequence of`,name:"encoder_outputs"},{anchor:"transformers.TFMarianMTModel.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.TFMarianMTModel.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>). Set to <code>False</code> during training, <code>True</code> during generation`,name:"use_cache"},{anchor:"transformers.TFMarianMTModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFMarianMTModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFMarianMTModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFMarianMTModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFMarianMTModel.call.labels",description:`<strong>labels</strong> (<code>tf.tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/marian/modeling_tf_marian.py#L1300",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqLMOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqLMOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/marian#transformers.MarianConfig"
>MarianConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Language modeling loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) of the decoder that can be
used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqLMOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),xn=new Gn({props:{$$slots:{default:[Cf]},$$scope:{ctx:J}}}),jn=new Qt({props:{anchor:"transformers.TFMarianMTModel.call.example",$$slots:{default:[Nf]},$$scope:{ctx:J}}}),na=new oe({}),oa=new D({props:{name:"class transformers.FlaxMarianModel",anchor:"transformers.FlaxMarianModel",parameters:[{name:"config",val:": MarianConfig"},{name:"input_shape",val:": typing.Tuple[int] = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxMarianModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/marian#transformers.MarianConfig">MarianConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxMarianModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/marian/modeling_flax_marian.py#L1205"}}),pa=new D({props:{name:"__call__",anchor:"transformers.FlaxMarianModel.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"decoder_input_ids",val:": typing.Optional[jax.Array] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"position_ids",val:": typing.Optional[jax.Array] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax.Array] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxMarianModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxMarianModel.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxMarianModel.__call__.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxMarianModel.__call__.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxMarianModel.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxMarianModel.__call__.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxMarianModel.__call__.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxMarianModel.__call__.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxMarianModel.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/marian/modeling_flax_marian.py#L1140",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqModelOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/marian#transformers.MarianConfig"
>MarianConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqModelOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$n=new Gn({props:{$$slots:{default:[qf]},$$scope:{ctx:J}}}),zn=new Qt({props:{anchor:"transformers.FlaxMarianModel.__call__.example",$$slots:{default:[Zf]},$$scope:{ctx:J}}}),ha=new oe({}),ua=new D({props:{name:"class transformers.FlaxMarianMTModel",anchor:"transformers.FlaxMarianMTModel",parameters:[{name:"config",val:": MarianConfig"},{name:"input_shape",val:": typing.Tuple[int] = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxMarianMTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/marian#transformers.MarianConfig">MarianConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxMarianMTModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/marian/modeling_flax_marian.py#L1289"}}),ba=new D({props:{name:"__call__",anchor:"transformers.FlaxMarianMTModel.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"decoder_input_ids",val:": typing.Optional[jax.Array] = None"},{name:"decoder_attention_mask",val:": typing.Optional[jax.Array] = None"},{name:"position_ids",val:": typing.Optional[jax.Array] = None"},{name:"decoder_position_ids",val:": typing.Optional[jax.Array] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"train",val:": bool = False"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"}],parametersDescription:[{anchor:"transformers.FlaxMarianMTModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxMarianMTModel.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.FlaxMarianMTModel.__call__.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p>
<p>For translation and summarization training, <code>decoder_input_ids</code> should be provided. If no
<code>decoder_input_ids</code> is provided, the model will create this tensor by shifting the <code>input_ids</code> to the right
for denoising pre-training following the paper.`,name:"decoder_input_ids"},{anchor:"transformers.FlaxMarianMTModel.__call__.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) &#x2014;
Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also
be used by default.</p>
<p>If you want to change padding behavior, you should modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the
paper</a> for more information on the default strategy.`,name:"decoder_attention_mask"},{anchor:"transformers.FlaxMarianMTModel.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.FlaxMarianMTModel.__call__.decoder_position_ids",description:`<strong>decoder_position_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each decoder input sequence tokens in the position embeddings. Selected in the
range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"decoder_position_ids"},{anchor:"transformers.FlaxMarianMTModel.__call__.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.FlaxMarianMTModel.__call__.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.FlaxMarianMTModel.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/marian/modeling_flax_marian.py#L1140",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/marian#transformers.MarianConfig"
>MarianConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(jnp.ndarray))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(jnp.ndarray)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>decoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>decoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>encoder_last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the encoder of the model.</p>
</li>
<li>
<p><strong>encoder_hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>encoder_attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
self-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput"
>transformers.modeling_flax_outputs.FlaxSeq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),En=new Gn({props:{$$slots:{default:[Af]},$$scope:{ctx:J}}}),In=new Qt({props:{anchor:"transformers.FlaxMarianMTModel.__call__.example",$$slots:{default:[Wf]},$$scope:{ctx:J}}}),{c(){h=o("meta"),y=c(),_=o("h1"),g=o("a"),M=o("span"),b(i.$$.fragment),u=c(),z=o("span"),Le=r("MarianMT"),Fe=c(),Z=o("div"),he=o("a"),Y=o("img"),He=c(),S=o("a"),ue=o("img"),K=c(),B=o("p"),_e=o("strong"),ae=r("Bugs:"),Qe=r(" If you see something strange, file a "),se=o("a"),re=r("Github Issue"),Oe=r(`
and assign @patrickvonplaten.`),Ce=c(),P=o("p"),De=r("Translations should be similar, but not identical to output in the test set linked to in each model card."),Ne=c(),ee=o("p"),F=r("Tips:"),q=c(),me=o("ul"),V=o("li"),Ye=r("A framework for translation models, using the same models as BART."),qe=c(),A=o("h2"),te=o("a"),Me=o("span"),b(C.$$.fragment),Ke=c(),R=o("span"),et=r("Implementation Notes"),Ze=c(),E=o("ul"),ye=o("li"),Te=o("p"),G=r("Each model is about 298 MB on disk, there are more than 1,000 models."),tt=c(),X=o("li"),le=o("p"),be=r("The list of supported language pairs can be found "),N=o("a"),nt=r("here"),W=r("."),ot=c(),ke=o("li"),T=o("p"),U=r("Models were originally trained by "),ve=o("a"),we=r("J\xF6rg Tiedemann"),_t=r(" using the "),xe=o("a"),I=r("Marian"),Mt=r(" C++ library, which supports fast training and translation."),yt=c(),at=o("li"),st=o("p"),Tt=r(`All models are transformer encoder-decoders with 6 layers in each component. Each model\u2019s performance is documented
in a model card.`),L=c(),H=o("li"),rt=o("p"),bt=r("The 80 opus models that require BPE preprocessing are not supported."),ie=c(),je=o("li"),Je=o("p"),lt=r("The modeling code is the same as "),Ae=o("a"),$e=r("BartForConditionalGeneration"),kt=r(" with a few minor modifications:"),si=c(),vt=o("ul"),Xn=o("li"),ri=r("static (sinusoid) positional embeddings ("),ss=o("code"),li=r("MarianConfig.static_position_embeddings=True"),ii=r(")"),di=c(),Ln=o("li"),ci=r("no layernorm_embedding ("),rs=o("code"),pi=r("MarianConfig.normalize_embedding=False"),hi=r(")"),ui=c(),wt=o("li"),mi=r("the model starts generating with "),ls=o("code"),fi=r("pad_token_id"),gi=r(` (which has 0 as a token_embedding) as the prefix (Bart uses
`),is=o("code"),_i=r("<s/>"),Mi=r("),"),yi=c(),ds=o("li"),Hn=o("p"),Ti=r("Code to bulk convert models can be found in "),cs=o("code"),bi=r("convert_marian_to_pytorch.py"),ki=r("."),vi=c(),ps=o("li"),Qn=o("p"),wi=r("This model was contributed by "),On=o("a"),xi=r("sshleifer"),ji=r("."),Ur=c(),xt=o("h2"),Dt=o("a"),hs=o("span"),b(Dn.$$.fragment),Ji=c(),us=o("span"),$i=r("Naming"),Er=c(),We=o("ul"),xa=o("li"),zi=r("All model names use the following format: "),ms=o("code"),Ui=r("Helsinki-NLP/opus-mt-{src}-{tgt}"),Ei=c(),Yn=o("li"),Ii=r("The language codes used to name models are inconsistent. Two digit codes can usually be found "),Kn=o("a"),Fi=r("here"),Ci=r(`, three digit codes require googling \u201Clanguage
code {code}\u201C.`),Ni=c(),jt=o("li"),qi=r("Codes formatted like "),fs=o("code"),Zi=r("es_AR"),Ai=r(" are usually "),gs=o("code"),Wi=r("code_{region}"),Si=r(". That one is Spanish from Argentina."),Pi=c(),_s=o("li"),Bi=r(`The models were converted in two stages. The first 1000 models use ISO-639-2 codes to identify languages, the second
group use a combination of ISO-639-5 codes and ISO-639-2 codes.`),Ir=c(),Jt=o("h2"),Yt=o("a"),Ms=o("span"),b(eo.$$.fragment),Vi=c(),ys=o("span"),Ri=r("Examples"),Fr=c(),Kt=o("ul"),Ts=o("li"),Gi=r(`Since Marian models are smaller than many other translation models available in the library, they can be useful for
fine-tuning experiments and integration tests.`),Xi=c(),bs=o("li"),to=o("a"),Li=r("Fine-tune on GPU"),Cr=c(),$t=o("h2"),en=o("a"),ks=o("span"),b(no.$$.fragment),Hi=c(),vs=o("span"),Qi=r("Multilingual Models"),Nr=c(),Se=o("ul"),oo=o("li"),Oi=r("All model names use the following format: "),ws=o("code"),Di=r("Helsinki-NLP/opus-mt-{src}-{tgt}"),Yi=r(":"),Ki=c(),ao=o("li"),ed=r(`If a model can output multiple languages, and you should specify a language code by prepending the desired output
language to the `),xs=o("code"),td=r("src_text"),nd=r("."),od=c(),so=o("li"),ad=r("You can see a models\u2019s supported language codes in its model card, under target constituents, like in "),ro=o("a"),sd=r("opus-mt-en-roa"),rd=r("."),ld=c(),lo=o("li"),id=r("Note that if a model is only multilingual on the source side, like "),js=o("code"),dd=r("Helsinki-NLP/opus-mt-roa-en"),cd=r(`, no language
codes are required.`),qr=c(),tn=o("p"),pd=r("New multi-lingual models from the "),io=o("a"),hd=r("Tatoeba-Challenge repo"),ud=r(`
require 3 character language codes:`),Zr=c(),b(co.$$.fragment),Ar=c(),ja=o("p"),md=r("Here is the code to see all available pretrained models on the hub:"),Wr=c(),b(po.$$.fragment),Sr=c(),zt=o("h2"),nn=o("a"),Js=o("span"),b(ho.$$.fragment),fd=c(),$s=o("span"),gd=r("Old Style Multi-Lingual Models"),Pr=c(),Ja=o("p"),_d=r(`These are the old style multi-lingual models ported from the OPUS-MT-Train repo: and the members of each language
group:`),Br=c(),b(uo.$$.fragment),Vr=c(),$a=o("p"),Md=r("Example of translating english to many romance languages, using old-style 2 character language codes"),Rr=c(),b(mo.$$.fragment),Gr=c(),Ut=o("h2"),on=o("a"),zs=o("span"),b(fo.$$.fragment),yd=c(),Us=o("span"),Td=r("Documentation resources"),Xr=c(),pt=o("ul"),Es=o("li"),za=o("a"),bd=r("Translation task guide"),kd=c(),Is=o("li"),Ua=o("a"),vd=r("Summarization task guide"),wd=c(),Fs=o("li"),Ea=o("a"),xd=r("Causal language modeling task guide"),Lr=c(),Et=o("h2"),an=o("a"),Cs=o("span"),b(go.$$.fragment),jd=c(),Ns=o("span"),Jd=r("MarianConfig"),Hr=c(),ze=o("div"),b(_o.$$.fragment),$d=c(),It=o("p"),zd=r("This is the configuration class to store the configuration of a "),Ia=o("a"),Ud=r("MarianModel"),Ed=r(`. It is used to instantiate an
Marian model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the Marian
`),Mo=o("a"),Id=r("Helsinki-NLP/opus-mt-en-de"),Fd=r(" architecture."),Cd=c(),Ft=o("p"),Nd=r("Configuration objects inherit from "),Fa=o("a"),qd=r("PretrainedConfig"),Zd=r(` and can be used to control the model outputs. Read the
documentation from `),Ca=o("a"),Ad=r("PretrainedConfig"),Wd=r(" for more information."),Sd=c(),b(sn.$$.fragment),Qr=c(),Ct=o("h2"),rn=o("a"),qs=o("span"),b(yo.$$.fragment),Pd=c(),Zs=o("span"),Bd=r("MarianTokenizer"),Or=c(),de=o("div"),b(To.$$.fragment),Vd=c(),bo=o("p"),Rd=r("Construct a Marian tokenizer. Based on "),ko=o("a"),Gd=r("SentencePiece"),Xd=r("."),Ld=c(),vo=o("p"),Hd=r("This tokenizer inherits from "),Na=o("a"),Qd=r("PreTrainedTokenizer"),Od=r(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Dd=c(),b(ln.$$.fragment),Yd=c(),dn=o("div"),b(wo.$$.fragment),Kd=c(),As=o("p"),ec=r("Build model inputs from a sequence by appending eos_token_id."),Dr=c(),Nt=o("h2"),cn=o("a"),Ws=o("span"),b(xo.$$.fragment),tc=c(),Ss=o("span"),nc=r("MarianModel"),Yr=c(),Ue=o("div"),b(jo.$$.fragment),oc=c(),Jo=o("p"),ac=r(`The bare Marian Model outputting raw hidden-states without any specific head on top.
This model inherits from `),qa=o("a"),sc=r("PreTrainedModel"),rc=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),lc=c(),$o=o("p"),ic=r("This model is also a PyTorch "),zo=o("a"),dc=r("torch.nn.Module"),cc=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),pc=c(),Pe=o("div"),b(Uo.$$.fragment),hc=c(),qt=o("p"),uc=r("The "),Za=o("a"),mc=r("MarianModel"),fc=r(" forward method, overrides the "),Ps=o("code"),gc=r("__call__"),_c=r(" special method."),Mc=c(),b(pn.$$.fragment),yc=c(),b(hn.$$.fragment),Kr=c(),Zt=o("h2"),un=o("a"),Bs=o("span"),b(Eo.$$.fragment),Tc=c(),Vs=o("span"),bc=r("MarianMTModel"),el=c(),Ee=o("div"),b(Io.$$.fragment),kc=c(),Fo=o("p"),vc=r(`The Marian Model with a language modeling head. Can be used for summarization.
This model inherits from `),Aa=o("a"),wc=r("PreTrainedModel"),xc=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),jc=c(),Co=o("p"),Jc=r("This model is also a PyTorch "),No=o("a"),$c=r("torch.nn.Module"),zc=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Uc=c(),fe=o("div"),b(qo.$$.fragment),Ec=c(),At=o("p"),Ic=r("The "),Wa=o("a"),Fc=r("MarianMTModel"),Cc=r(" forward method, overrides the "),Rs=o("code"),Nc=r("__call__"),qc=r(" special method."),Zc=c(),b(mn.$$.fragment),Ac=c(),Zo=o("p"),Wc=r(`Pytorch version of marian-nmt\u2019s transformer.h (c++). Designed for the OPUS-NMT translation checkpoints. Available
models are listed `),Ao=o("a"),Sc=r("here"),Pc=r("."),Bc=c(),b(fn.$$.fragment),tl=c(),Wt=o("h2"),gn=o("a"),Gs=o("span"),b(Wo.$$.fragment),Vc=c(),Xs=o("span"),Rc=r("MarianForCausalLM"),nl=c(),St=o("div"),b(So.$$.fragment),Gc=c(),_n=o("div"),b(Po.$$.fragment),Xc=c(),b(Mn.$$.fragment),ol=c(),Pt=o("h2"),yn=o("a"),Ls=o("span"),b(Bo.$$.fragment),Lc=c(),Hs=o("span"),Hc=r("TFMarianModel"),al=c(),ce=o("div"),b(Vo.$$.fragment),Qc=c(),Ro=o("p"),Oc=r(`The bare MARIAN Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Sa=o("a"),Dc=r("TFPreTrainedModel"),Yc=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Kc=c(),Go=o("p"),ep=r("This model is also a "),Xo=o("a"),tp=r("tf.keras.Model"),np=r(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),op=c(),b(Tn.$$.fragment),ap=c(),Be=o("div"),b(Lo.$$.fragment),sp=c(),Bt=o("p"),rp=r("The "),Pa=o("a"),lp=r("TFMarianModel"),ip=r(" forward method, overrides the "),Qs=o("code"),dp=r("__call__"),cp=r(" special method."),pp=c(),b(bn.$$.fragment),hp=c(),b(kn.$$.fragment),sl=c(),Vt=o("h2"),vn=o("a"),Os=o("span"),b(Ho.$$.fragment),up=c(),Ds=o("span"),mp=r("TFMarianMTModel"),rl=c(),pe=o("div"),b(Qo.$$.fragment),fp=c(),Oo=o("p"),gp=r(`The MARIAN Model with a language modeling head. Can be used for summarization.
This model inherits from `),Ba=o("a"),_p=r("TFPreTrainedModel"),Mp=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),yp=c(),Do=o("p"),Tp=r("This model is also a "),Yo=o("a"),bp=r("tf.keras.Model"),kp=r(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),vp=c(),b(wn.$$.fragment),wp=c(),ge=o("div"),b(Ko.$$.fragment),xp=c(),Rt=o("p"),jp=r("The "),Va=o("a"),Jp=r("TFMarianMTModel"),$p=r(" forward method, overrides the "),Ys=o("code"),zp=r("__call__"),Up=r(" special method."),Ep=c(),b(xn.$$.fragment),Ip=c(),ea=o("p"),Fp=r(`TF version of marian-nmt\u2019s transformer.h (c++). Designed for the OPUS-NMT translation checkpoints. Available
models are listed `),ta=o("a"),Cp=r("here"),Np=r("."),qp=c(),b(jn.$$.fragment),ll=c(),Gt=o("h2"),Jn=o("a"),Ks=o("span"),b(na.$$.fragment),Zp=c(),er=o("span"),Ap=r("FlaxMarianModel"),il=c(),Q=o("div"),b(oa.$$.fragment),Wp=c(),aa=o("p"),Sp=r(`The bare Marian Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),Ra=o("a"),Pp=r("FlaxPreTrainedModel"),Bp=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Vp=c(),sa=o("p"),Rp=r(`This model is also a Flax Linen
`),ra=o("a"),Gp=r("flax.nn.Module"),Xp=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),Lp=c(),tr=o("p"),Hp=r("Finally, this model supports inherent JAX features such as:"),Qp=c(),it=o("ul"),nr=o("li"),la=o("a"),Op=r("Just-In-Time (JIT) compilation"),Dp=c(),or=o("li"),ia=o("a"),Yp=r("Automatic Differentiation"),Kp=c(),ar=o("li"),da=o("a"),eh=r("Vectorization"),th=c(),sr=o("li"),ca=o("a"),nh=r("Parallelization"),oh=c(),Ve=o("div"),b(pa.$$.fragment),ah=c(),Xt=o("p"),sh=r("The "),rr=o("code"),rh=r("FlaxMarianPreTrainedModel"),lh=r(" forward method, overrides the "),lr=o("code"),ih=r("__call__"),dh=r(" special method."),ch=c(),b($n.$$.fragment),ph=c(),b(zn.$$.fragment),dl=c(),Lt=o("h2"),Un=o("a"),ir=o("span"),b(ha.$$.fragment),hh=c(),dr=o("span"),uh=r("FlaxMarianMTModel"),cl=c(),O=o("div"),b(ua.$$.fragment),mh=c(),ma=o("p"),fh=r(`The MARIAN Model with a language modeling head. Can be used for translation.
This model inherits from `),Ga=o("a"),gh=r("FlaxPreTrainedModel"),_h=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Mh=c(),fa=o("p"),yh=r(`This model is also a Flax Linen
`),ga=o("a"),Th=r("flax.nn.Module"),bh=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),kh=c(),cr=o("p"),vh=r("Finally, this model supports inherent JAX features such as:"),wh=c(),dt=o("ul"),pr=o("li"),_a=o("a"),xh=r("Just-In-Time (JIT) compilation"),jh=c(),hr=o("li"),Ma=o("a"),Jh=r("Automatic Differentiation"),$h=c(),ur=o("li"),ya=o("a"),zh=r("Vectorization"),Uh=c(),mr=o("li"),Ta=o("a"),Eh=r("Parallelization"),Ih=c(),Re=o("div"),b(ba.$$.fragment),Fh=c(),Ht=o("p"),Ch=r("The "),fr=o("code"),Nh=r("FlaxMarianPreTrainedModel"),qh=r(" forward method, overrides the "),gr=o("code"),Zh=r("__call__"),Ah=r(" special method."),Wh=c(),b(En.$$.fragment),Sh=c(),b(In.$$.fragment),this.h()},l(n){const m=bf('[data-svelte="svelte-1phssyn"]',document.head);h=a(m,"META",{name:!0,content:!0}),m.forEach(t),y=p(n),_=a(n,"H1",{class:!0});var ka=s(_);g=a(ka,"A",{id:!0,class:!0,href:!0});var _r=s(g);M=a(_r,"SPAN",{});var Mr=s(M);k(i.$$.fragment,Mr),Mr.forEach(t),_r.forEach(t),u=p(ka),z=a(ka,"SPAN",{});var yr=s(z);Le=l(yr,"MarianMT"),yr.forEach(t),ka.forEach(t),Fe=p(n),Z=a(n,"DIV",{class:!0});var va=s(Z);he=a(va,"A",{href:!0});var Tr=s(he);Y=a(Tr,"IMG",{alt:!0,src:!0}),Tr.forEach(t),He=p(va),S=a(va,"A",{href:!0});var br=s(S);ue=a(br,"IMG",{alt:!0,src:!0}),br.forEach(t),va.forEach(t),K=p(n),B=a(n,"P",{});var Fn=s(B);_e=a(Fn,"STRONG",{});var kr=s(_e);ae=l(kr,"Bugs:"),kr.forEach(t),Qe=l(Fn," If you see something strange, file a "),se=a(Fn,"A",{href:!0,rel:!0});var vr=s(se);re=l(vr,"Github Issue"),vr.forEach(t),Oe=l(Fn,`
and assign @patrickvonplaten.`),Fn.forEach(t),Ce=p(n),P=a(n,"P",{});var wr=s(P);De=l(wr,"Translations should be similar, but not identical to output in the test set linked to in each model card."),wr.forEach(t),Ne=p(n),ee=a(n,"P",{});var xr=s(ee);F=l(xr,"Tips:"),xr.forEach(t),q=p(n),me=a(n,"UL",{});var jr=s(me);V=a(jr,"LI",{});var Jr=s(V);Ye=l(Jr,"A framework for translation models, using the same models as BART."),Jr.forEach(t),jr.forEach(t),qe=p(n),A=a(n,"H2",{class:!0});var wa=s(A);te=a(wa,"A",{id:!0,class:!0,href:!0});var $r=s(te);Me=a($r,"SPAN",{});var zr=s(Me);k(C.$$.fragment,zr),zr.forEach(t),$r.forEach(t),Ke=p(wa),R=a(wa,"SPAN",{});var Bh=s(R);et=l(Bh,"Implementation Notes"),Bh.forEach(t),wa.forEach(t),Ze=p(n),E=a(n,"UL",{});var ne=s(E);ye=a(ne,"LI",{});var Vh=s(ye);Te=a(Vh,"P",{});var Rh=s(Te);G=l(Rh,"Each model is about 298 MB on disk, there are more than 1,000 models."),Rh.forEach(t),Vh.forEach(t),tt=p(ne),X=a(ne,"LI",{});var Gh=s(X);le=a(Gh,"P",{});var hl=s(le);be=l(hl,"The list of supported language pairs can be found "),N=a(hl,"A",{href:!0,rel:!0});var Xh=s(N);nt=l(Xh,"here"),Xh.forEach(t),W=l(hl,"."),hl.forEach(t),Gh.forEach(t),ot=p(ne),ke=a(ne,"LI",{});var Lh=s(ke);T=a(Lh,"P",{});var Xa=s(T);U=l(Xa,"Models were originally trained by "),ve=a(Xa,"A",{href:!0,rel:!0});var Hh=s(ve);we=l(Hh,"J\xF6rg Tiedemann"),Hh.forEach(t),_t=l(Xa," using the "),xe=a(Xa,"A",{href:!0,rel:!0});var Qh=s(xe);I=l(Qh,"Marian"),Qh.forEach(t),Mt=l(Xa," C++ library, which supports fast training and translation."),Xa.forEach(t),Lh.forEach(t),yt=p(ne),at=a(ne,"LI",{});var Oh=s(at);st=a(Oh,"P",{});var Dh=s(st);Tt=l(Dh,`All models are transformer encoder-decoders with 6 layers in each component. Each model\u2019s performance is documented
in a model card.`),Dh.forEach(t),Oh.forEach(t),L=p(ne),H=a(ne,"LI",{});var Yh=s(H);rt=a(Yh,"P",{});var Kh=s(rt);bt=l(Kh,"The 80 opus models that require BPE preprocessing are not supported."),Kh.forEach(t),Yh.forEach(t),ie=p(ne),je=a(ne,"LI",{});var ul=s(je);Je=a(ul,"P",{});var ml=s(Je);lt=l(ml,"The modeling code is the same as "),Ae=a(ml,"A",{href:!0});var eu=s(Ae);$e=l(eu,"BartForConditionalGeneration"),eu.forEach(t),kt=l(ml," with a few minor modifications:"),ml.forEach(t),si=p(ul),vt=a(ul,"UL",{});var La=s(vt);Xn=a(La,"LI",{});var fl=s(Xn);ri=l(fl,"static (sinusoid) positional embeddings ("),ss=a(fl,"CODE",{});var tu=s(ss);li=l(tu,"MarianConfig.static_position_embeddings=True"),tu.forEach(t),ii=l(fl,")"),fl.forEach(t),di=p(La),Ln=a(La,"LI",{});var gl=s(Ln);ci=l(gl,"no layernorm_embedding ("),rs=a(gl,"CODE",{});var nu=s(rs);pi=l(nu,"MarianConfig.normalize_embedding=False"),nu.forEach(t),hi=l(gl,")"),gl.forEach(t),ui=p(La),wt=a(La,"LI",{});var Ha=s(wt);mi=l(Ha,"the model starts generating with "),ls=a(Ha,"CODE",{});var ou=s(ls);fi=l(ou,"pad_token_id"),ou.forEach(t),gi=l(Ha,` (which has 0 as a token_embedding) as the prefix (Bart uses
`),is=a(Ha,"CODE",{});var au=s(is);_i=l(au,"<s/>"),au.forEach(t),Mi=l(Ha,"),"),Ha.forEach(t),La.forEach(t),ul.forEach(t),yi=p(ne),ds=a(ne,"LI",{});var su=s(ds);Hn=a(su,"P",{});var _l=s(Hn);Ti=l(_l,"Code to bulk convert models can be found in "),cs=a(_l,"CODE",{});var ru=s(cs);bi=l(ru,"convert_marian_to_pytorch.py"),ru.forEach(t),ki=l(_l,"."),_l.forEach(t),su.forEach(t),vi=p(ne),ps=a(ne,"LI",{});var lu=s(ps);Qn=a(lu,"P",{});var Ml=s(Qn);wi=l(Ml,"This model was contributed by "),On=a(Ml,"A",{href:!0,rel:!0});var iu=s(On);xi=l(iu,"sshleifer"),iu.forEach(t),ji=l(Ml,"."),Ml.forEach(t),lu.forEach(t),ne.forEach(t),Ur=p(n),xt=a(n,"H2",{class:!0});var yl=s(xt);Dt=a(yl,"A",{id:!0,class:!0,href:!0});var du=s(Dt);hs=a(du,"SPAN",{});var cu=s(hs);k(Dn.$$.fragment,cu),cu.forEach(t),du.forEach(t),Ji=p(yl),us=a(yl,"SPAN",{});var pu=s(us);$i=l(pu,"Naming"),pu.forEach(t),yl.forEach(t),Er=p(n),We=a(n,"UL",{});var Cn=s(We);xa=a(Cn,"LI",{});var Ph=s(xa);zi=l(Ph,"All model names use the following format: "),ms=a(Ph,"CODE",{});var hu=s(ms);Ui=l(hu,"Helsinki-NLP/opus-mt-{src}-{tgt}"),hu.forEach(t),Ph.forEach(t),Ei=p(Cn),Yn=a(Cn,"LI",{});var Tl=s(Yn);Ii=l(Tl,"The language codes used to name models are inconsistent. Two digit codes can usually be found "),Kn=a(Tl,"A",{href:!0,rel:!0});var uu=s(Kn);Fi=l(uu,"here"),uu.forEach(t),Ci=l(Tl,`, three digit codes require googling \u201Clanguage
code {code}\u201C.`),Tl.forEach(t),Ni=p(Cn),jt=a(Cn,"LI",{});var Qa=s(jt);qi=l(Qa,"Codes formatted like "),fs=a(Qa,"CODE",{});var mu=s(fs);Zi=l(mu,"es_AR"),mu.forEach(t),Ai=l(Qa," are usually "),gs=a(Qa,"CODE",{});var fu=s(gs);Wi=l(fu,"code_{region}"),fu.forEach(t),Si=l(Qa,". That one is Spanish from Argentina."),Qa.forEach(t),Pi=p(Cn),_s=a(Cn,"LI",{});var gu=s(_s);Bi=l(gu,`The models were converted in two stages. The first 1000 models use ISO-639-2 codes to identify languages, the second
group use a combination of ISO-639-5 codes and ISO-639-2 codes.`),gu.forEach(t),Cn.forEach(t),Ir=p(n),Jt=a(n,"H2",{class:!0});var bl=s(Jt);Yt=a(bl,"A",{id:!0,class:!0,href:!0});var _u=s(Yt);Ms=a(_u,"SPAN",{});var Mu=s(Ms);k(eo.$$.fragment,Mu),Mu.forEach(t),_u.forEach(t),Vi=p(bl),ys=a(bl,"SPAN",{});var yu=s(ys);Ri=l(yu,"Examples"),yu.forEach(t),bl.forEach(t),Fr=p(n),Kt=a(n,"UL",{});var kl=s(Kt);Ts=a(kl,"LI",{});var Tu=s(Ts);Gi=l(Tu,`Since Marian models are smaller than many other translation models available in the library, they can be useful for
fine-tuning experiments and integration tests.`),Tu.forEach(t),Xi=p(kl),bs=a(kl,"LI",{});var bu=s(bs);to=a(bu,"A",{href:!0,rel:!0});var ku=s(to);Li=l(ku,"Fine-tune on GPU"),ku.forEach(t),bu.forEach(t),kl.forEach(t),Cr=p(n),$t=a(n,"H2",{class:!0});var vl=s($t);en=a(vl,"A",{id:!0,class:!0,href:!0});var vu=s(en);ks=a(vu,"SPAN",{});var wu=s(ks);k(no.$$.fragment,wu),wu.forEach(t),vu.forEach(t),Hi=p(vl),vs=a(vl,"SPAN",{});var xu=s(vs);Qi=l(xu,"Multilingual Models"),xu.forEach(t),vl.forEach(t),Nr=p(n),Se=a(n,"UL",{});var Nn=s(Se);oo=a(Nn,"LI",{});var wl=s(oo);Oi=l(wl,"All model names use the following format: "),ws=a(wl,"CODE",{});var ju=s(ws);Di=l(ju,"Helsinki-NLP/opus-mt-{src}-{tgt}"),ju.forEach(t),Yi=l(wl,":"),wl.forEach(t),Ki=p(Nn),ao=a(Nn,"LI",{});var xl=s(ao);ed=l(xl,`If a model can output multiple languages, and you should specify a language code by prepending the desired output
language to the `),xs=a(xl,"CODE",{});var Ju=s(xs);td=l(Ju,"src_text"),Ju.forEach(t),nd=l(xl,"."),xl.forEach(t),od=p(Nn),so=a(Nn,"LI",{});var jl=s(so);ad=l(jl,"You can see a models\u2019s supported language codes in its model card, under target constituents, like in "),ro=a(jl,"A",{href:!0,rel:!0});var $u=s(ro);sd=l($u,"opus-mt-en-roa"),$u.forEach(t),rd=l(jl,"."),jl.forEach(t),ld=p(Nn),lo=a(Nn,"LI",{});var Jl=s(lo);id=l(Jl,"Note that if a model is only multilingual on the source side, like "),js=a(Jl,"CODE",{});var zu=s(js);dd=l(zu,"Helsinki-NLP/opus-mt-roa-en"),zu.forEach(t),cd=l(Jl,`, no language
codes are required.`),Jl.forEach(t),Nn.forEach(t),qr=p(n),tn=a(n,"P",{});var $l=s(tn);pd=l($l,"New multi-lingual models from the "),io=a($l,"A",{href:!0,rel:!0});var Uu=s(io);hd=l(Uu,"Tatoeba-Challenge repo"),Uu.forEach(t),ud=l($l,`
require 3 character language codes:`),$l.forEach(t),Zr=p(n),k(co.$$.fragment,n),Ar=p(n),ja=a(n,"P",{});var Eu=s(ja);md=l(Eu,"Here is the code to see all available pretrained models on the hub:"),Eu.forEach(t),Wr=p(n),k(po.$$.fragment,n),Sr=p(n),zt=a(n,"H2",{class:!0});var zl=s(zt);nn=a(zl,"A",{id:!0,class:!0,href:!0});var Iu=s(nn);Js=a(Iu,"SPAN",{});var Fu=s(Js);k(ho.$$.fragment,Fu),Fu.forEach(t),Iu.forEach(t),fd=p(zl),$s=a(zl,"SPAN",{});var Cu=s($s);gd=l(Cu,"Old Style Multi-Lingual Models"),Cu.forEach(t),zl.forEach(t),Pr=p(n),Ja=a(n,"P",{});var Nu=s(Ja);_d=l(Nu,`These are the old style multi-lingual models ported from the OPUS-MT-Train repo: and the members of each language
group:`),Nu.forEach(t),Br=p(n),k(uo.$$.fragment,n),Vr=p(n),$a=a(n,"P",{});var qu=s($a);Md=l(qu,"Example of translating english to many romance languages, using old-style 2 character language codes"),qu.forEach(t),Rr=p(n),k(mo.$$.fragment,n),Gr=p(n),Ut=a(n,"H2",{class:!0});var Ul=s(Ut);on=a(Ul,"A",{id:!0,class:!0,href:!0});var Zu=s(on);zs=a(Zu,"SPAN",{});var Au=s(zs);k(fo.$$.fragment,Au),Au.forEach(t),Zu.forEach(t),yd=p(Ul),Us=a(Ul,"SPAN",{});var Wu=s(Us);Td=l(Wu,"Documentation resources"),Wu.forEach(t),Ul.forEach(t),Xr=p(n),pt=a(n,"UL",{});var Oa=s(pt);Es=a(Oa,"LI",{});var Su=s(Es);za=a(Su,"A",{href:!0});var Pu=s(za);bd=l(Pu,"Translation task guide"),Pu.forEach(t),Su.forEach(t),kd=p(Oa),Is=a(Oa,"LI",{});var Bu=s(Is);Ua=a(Bu,"A",{href:!0});var Vu=s(Ua);vd=l(Vu,"Summarization task guide"),Vu.forEach(t),Bu.forEach(t),wd=p(Oa),Fs=a(Oa,"LI",{});var Ru=s(Fs);Ea=a(Ru,"A",{href:!0});var Gu=s(Ea);xd=l(Gu,"Causal language modeling task guide"),Gu.forEach(t),Ru.forEach(t),Oa.forEach(t),Lr=p(n),Et=a(n,"H2",{class:!0});var El=s(Et);an=a(El,"A",{id:!0,class:!0,href:!0});var Xu=s(an);Cs=a(Xu,"SPAN",{});var Lu=s(Cs);k(go.$$.fragment,Lu),Lu.forEach(t),Xu.forEach(t),jd=p(El),Ns=a(El,"SPAN",{});var Hu=s(Ns);Jd=l(Hu,"MarianConfig"),Hu.forEach(t),El.forEach(t),Hr=p(n),ze=a(n,"DIV",{class:!0});var qn=s(ze);k(_o.$$.fragment,qn),$d=p(qn),It=a(qn,"P",{});var Da=s(It);zd=l(Da,"This is the configuration class to store the configuration of a "),Ia=a(Da,"A",{href:!0});var Qu=s(Ia);Ud=l(Qu,"MarianModel"),Qu.forEach(t),Ed=l(Da,`. It is used to instantiate an
Marian model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the Marian
`),Mo=a(Da,"A",{href:!0,rel:!0});var Ou=s(Mo);Id=l(Ou,"Helsinki-NLP/opus-mt-en-de"),Ou.forEach(t),Fd=l(Da," architecture."),Da.forEach(t),Cd=p(qn),Ft=a(qn,"P",{});var Ya=s(Ft);Nd=l(Ya,"Configuration objects inherit from "),Fa=a(Ya,"A",{href:!0});var Du=s(Fa);qd=l(Du,"PretrainedConfig"),Du.forEach(t),Zd=l(Ya,` and can be used to control the model outputs. Read the
documentation from `),Ca=a(Ya,"A",{href:!0});var Yu=s(Ca);Ad=l(Yu,"PretrainedConfig"),Yu.forEach(t),Wd=l(Ya," for more information."),Ya.forEach(t),Sd=p(qn),k(sn.$$.fragment,qn),qn.forEach(t),Qr=p(n),Ct=a(n,"H2",{class:!0});var Il=s(Ct);rn=a(Il,"A",{id:!0,class:!0,href:!0});var Ku=s(rn);qs=a(Ku,"SPAN",{});var em=s(qs);k(yo.$$.fragment,em),em.forEach(t),Ku.forEach(t),Pd=p(Il),Zs=a(Il,"SPAN",{});var tm=s(Zs);Bd=l(tm,"MarianTokenizer"),tm.forEach(t),Il.forEach(t),Or=p(n),de=a(n,"DIV",{class:!0});var ht=s(de);k(To.$$.fragment,ht),Vd=p(ht),bo=a(ht,"P",{});var Fl=s(bo);Rd=l(Fl,"Construct a Marian tokenizer. Based on "),ko=a(Fl,"A",{href:!0,rel:!0});var nm=s(ko);Gd=l(nm,"SentencePiece"),nm.forEach(t),Xd=l(Fl,"."),Fl.forEach(t),Ld=p(ht),vo=a(ht,"P",{});var Cl=s(vo);Hd=l(Cl,"This tokenizer inherits from "),Na=a(Cl,"A",{href:!0});var om=s(Na);Qd=l(om,"PreTrainedTokenizer"),om.forEach(t),Od=l(Cl,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Cl.forEach(t),Dd=p(ht),k(ln.$$.fragment,ht),Yd=p(ht),dn=a(ht,"DIV",{class:!0});var Nl=s(dn);k(wo.$$.fragment,Nl),Kd=p(Nl),As=a(Nl,"P",{});var am=s(As);ec=l(am,"Build model inputs from a sequence by appending eos_token_id."),am.forEach(t),Nl.forEach(t),ht.forEach(t),Dr=p(n),Nt=a(n,"H2",{class:!0});var ql=s(Nt);cn=a(ql,"A",{id:!0,class:!0,href:!0});var sm=s(cn);Ws=a(sm,"SPAN",{});var rm=s(Ws);k(xo.$$.fragment,rm),rm.forEach(t),sm.forEach(t),tc=p(ql),Ss=a(ql,"SPAN",{});var lm=s(Ss);nc=l(lm,"MarianModel"),lm.forEach(t),ql.forEach(t),Yr=p(n),Ue=a(n,"DIV",{class:!0});var Zn=s(Ue);k(jo.$$.fragment,Zn),oc=p(Zn),Jo=a(Zn,"P",{});var Zl=s(Jo);ac=l(Zl,`The bare Marian Model outputting raw hidden-states without any specific head on top.
This model inherits from `),qa=a(Zl,"A",{href:!0});var im=s(qa);sc=l(im,"PreTrainedModel"),im.forEach(t),rc=l(Zl,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Zl.forEach(t),lc=p(Zn),$o=a(Zn,"P",{});var Al=s($o);ic=l(Al,"This model is also a PyTorch "),zo=a(Al,"A",{href:!0,rel:!0});var dm=s(zo);dc=l(dm,"torch.nn.Module"),dm.forEach(t),cc=l(Al,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Al.forEach(t),pc=p(Zn),Pe=a(Zn,"DIV",{class:!0});var An=s(Pe);k(Uo.$$.fragment,An),hc=p(An),qt=a(An,"P",{});var Ka=s(qt);uc=l(Ka,"The "),Za=a(Ka,"A",{href:!0});var cm=s(Za);mc=l(cm,"MarianModel"),cm.forEach(t),fc=l(Ka," forward method, overrides the "),Ps=a(Ka,"CODE",{});var pm=s(Ps);gc=l(pm,"__call__"),pm.forEach(t),_c=l(Ka," special method."),Ka.forEach(t),Mc=p(An),k(pn.$$.fragment,An),yc=p(An),k(hn.$$.fragment,An),An.forEach(t),Zn.forEach(t),Kr=p(n),Zt=a(n,"H2",{class:!0});var Wl=s(Zt);un=a(Wl,"A",{id:!0,class:!0,href:!0});var hm=s(un);Bs=a(hm,"SPAN",{});var um=s(Bs);k(Eo.$$.fragment,um),um.forEach(t),hm.forEach(t),Tc=p(Wl),Vs=a(Wl,"SPAN",{});var mm=s(Vs);bc=l(mm,"MarianMTModel"),mm.forEach(t),Wl.forEach(t),el=p(n),Ee=a(n,"DIV",{class:!0});var Wn=s(Ee);k(Io.$$.fragment,Wn),kc=p(Wn),Fo=a(Wn,"P",{});var Sl=s(Fo);vc=l(Sl,`The Marian Model with a language modeling head. Can be used for summarization.
This model inherits from `),Aa=a(Sl,"A",{href:!0});var fm=s(Aa);wc=l(fm,"PreTrainedModel"),fm.forEach(t),xc=l(Sl,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Sl.forEach(t),jc=p(Wn),Co=a(Wn,"P",{});var Pl=s(Co);Jc=l(Pl,"This model is also a PyTorch "),No=a(Pl,"A",{href:!0,rel:!0});var gm=s(No);$c=l(gm,"torch.nn.Module"),gm.forEach(t),zc=l(Pl,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Pl.forEach(t),Uc=p(Wn),fe=a(Wn,"DIV",{class:!0});var ut=s(fe);k(qo.$$.fragment,ut),Ec=p(ut),At=a(ut,"P",{});var es=s(At);Ic=l(es,"The "),Wa=a(es,"A",{href:!0});var _m=s(Wa);Fc=l(_m,"MarianMTModel"),_m.forEach(t),Cc=l(es," forward method, overrides the "),Rs=a(es,"CODE",{});var Mm=s(Rs);Nc=l(Mm,"__call__"),Mm.forEach(t),qc=l(es," special method."),es.forEach(t),Zc=p(ut),k(mn.$$.fragment,ut),Ac=p(ut),Zo=a(ut,"P",{});var Bl=s(Zo);Wc=l(Bl,`Pytorch version of marian-nmt\u2019s transformer.h (c++). Designed for the OPUS-NMT translation checkpoints. Available
models are listed `),Ao=a(Bl,"A",{href:!0,rel:!0});var ym=s(Ao);Sc=l(ym,"here"),ym.forEach(t),Pc=l(Bl,"."),Bl.forEach(t),Bc=p(ut),k(fn.$$.fragment,ut),ut.forEach(t),Wn.forEach(t),tl=p(n),Wt=a(n,"H2",{class:!0});var Vl=s(Wt);gn=a(Vl,"A",{id:!0,class:!0,href:!0});var Tm=s(gn);Gs=a(Tm,"SPAN",{});var bm=s(Gs);k(Wo.$$.fragment,bm),bm.forEach(t),Tm.forEach(t),Vc=p(Vl),Xs=a(Vl,"SPAN",{});var km=s(Xs);Rc=l(km,"MarianForCausalLM"),km.forEach(t),Vl.forEach(t),nl=p(n),St=a(n,"DIV",{class:!0});var Rl=s(St);k(So.$$.fragment,Rl),Gc=p(Rl),_n=a(Rl,"DIV",{class:!0});var Gl=s(_n);k(Po.$$.fragment,Gl),Xc=p(Gl),k(Mn.$$.fragment,Gl),Gl.forEach(t),Rl.forEach(t),ol=p(n),Pt=a(n,"H2",{class:!0});var Xl=s(Pt);yn=a(Xl,"A",{id:!0,class:!0,href:!0});var vm=s(yn);Ls=a(vm,"SPAN",{});var wm=s(Ls);k(Bo.$$.fragment,wm),wm.forEach(t),vm.forEach(t),Lc=p(Xl),Hs=a(Xl,"SPAN",{});var xm=s(Hs);Hc=l(xm,"TFMarianModel"),xm.forEach(t),Xl.forEach(t),al=p(n),ce=a(n,"DIV",{class:!0});var mt=s(ce);k(Vo.$$.fragment,mt),Qc=p(mt),Ro=a(mt,"P",{});var Ll=s(Ro);Oc=l(Ll,`The bare MARIAN Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Sa=a(Ll,"A",{href:!0});var jm=s(Sa);Dc=l(jm,"TFPreTrainedModel"),jm.forEach(t),Yc=l(Ll,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ll.forEach(t),Kc=p(mt),Go=a(mt,"P",{});var Hl=s(Go);ep=l(Hl,"This model is also a "),Xo=a(Hl,"A",{href:!0,rel:!0});var Jm=s(Xo);tp=l(Jm,"tf.keras.Model"),Jm.forEach(t),np=l(Hl,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Hl.forEach(t),op=p(mt),k(Tn.$$.fragment,mt),ap=p(mt),Be=a(mt,"DIV",{class:!0});var Sn=s(Be);k(Lo.$$.fragment,Sn),sp=p(Sn),Bt=a(Sn,"P",{});var ts=s(Bt);rp=l(ts,"The "),Pa=a(ts,"A",{href:!0});var $m=s(Pa);lp=l($m,"TFMarianModel"),$m.forEach(t),ip=l(ts," forward method, overrides the "),Qs=a(ts,"CODE",{});var zm=s(Qs);dp=l(zm,"__call__"),zm.forEach(t),cp=l(ts," special method."),ts.forEach(t),pp=p(Sn),k(bn.$$.fragment,Sn),hp=p(Sn),k(kn.$$.fragment,Sn),Sn.forEach(t),mt.forEach(t),sl=p(n),Vt=a(n,"H2",{class:!0});var Ql=s(Vt);vn=a(Ql,"A",{id:!0,class:!0,href:!0});var Um=s(vn);Os=a(Um,"SPAN",{});var Em=s(Os);k(Ho.$$.fragment,Em),Em.forEach(t),Um.forEach(t),up=p(Ql),Ds=a(Ql,"SPAN",{});var Im=s(Ds);mp=l(Im,"TFMarianMTModel"),Im.forEach(t),Ql.forEach(t),rl=p(n),pe=a(n,"DIV",{class:!0});var ft=s(pe);k(Qo.$$.fragment,ft),fp=p(ft),Oo=a(ft,"P",{});var Ol=s(Oo);gp=l(Ol,`The MARIAN Model with a language modeling head. Can be used for summarization.
This model inherits from `),Ba=a(Ol,"A",{href:!0});var Fm=s(Ba);_p=l(Fm,"TFPreTrainedModel"),Fm.forEach(t),Mp=l(Ol,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ol.forEach(t),yp=p(ft),Do=a(ft,"P",{});var Dl=s(Do);Tp=l(Dl,"This model is also a "),Yo=a(Dl,"A",{href:!0,rel:!0});var Cm=s(Yo);bp=l(Cm,"tf.keras.Model"),Cm.forEach(t),kp=l(Dl,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Dl.forEach(t),vp=p(ft),k(wn.$$.fragment,ft),wp=p(ft),ge=a(ft,"DIV",{class:!0});var gt=s(ge);k(Ko.$$.fragment,gt),xp=p(gt),Rt=a(gt,"P",{});var ns=s(Rt);jp=l(ns,"The "),Va=a(ns,"A",{href:!0});var Nm=s(Va);Jp=l(Nm,"TFMarianMTModel"),Nm.forEach(t),$p=l(ns," forward method, overrides the "),Ys=a(ns,"CODE",{});var qm=s(Ys);zp=l(qm,"__call__"),qm.forEach(t),Up=l(ns," special method."),ns.forEach(t),Ep=p(gt),k(xn.$$.fragment,gt),Ip=p(gt),ea=a(gt,"P",{});var Yl=s(ea);Fp=l(Yl,`TF version of marian-nmt\u2019s transformer.h (c++). Designed for the OPUS-NMT translation checkpoints. Available
models are listed `),ta=a(Yl,"A",{href:!0,rel:!0});var Zm=s(ta);Cp=l(Zm,"here"),Zm.forEach(t),Np=l(Yl,"."),Yl.forEach(t),qp=p(gt),k(jn.$$.fragment,gt),gt.forEach(t),ft.forEach(t),ll=p(n),Gt=a(n,"H2",{class:!0});var Kl=s(Gt);Jn=a(Kl,"A",{id:!0,class:!0,href:!0});var Am=s(Jn);Ks=a(Am,"SPAN",{});var Wm=s(Ks);k(na.$$.fragment,Wm),Wm.forEach(t),Am.forEach(t),Zp=p(Kl),er=a(Kl,"SPAN",{});var Sm=s(er);Ap=l(Sm,"FlaxMarianModel"),Sm.forEach(t),Kl.forEach(t),il=p(n),Q=a(n,"DIV",{class:!0});var Ge=s(Q);k(oa.$$.fragment,Ge),Wp=p(Ge),aa=a(Ge,"P",{});var ei=s(aa);Sp=l(ei,`The bare Marian Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),Ra=a(ei,"A",{href:!0});var Pm=s(Ra);Pp=l(Pm,"FlaxPreTrainedModel"),Pm.forEach(t),Bp=l(ei,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ei.forEach(t),Vp=p(Ge),sa=a(Ge,"P",{});var ti=s(sa);Rp=l(ti,`This model is also a Flax Linen
`),ra=a(ti,"A",{href:!0,rel:!0});var Bm=s(ra);Gp=l(Bm,"flax.nn.Module"),Bm.forEach(t),Xp=l(ti,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),ti.forEach(t),Lp=p(Ge),tr=a(Ge,"P",{});var Vm=s(tr);Hp=l(Vm,"Finally, this model supports inherent JAX features such as:"),Vm.forEach(t),Qp=p(Ge),it=a(Ge,"UL",{});var Pn=s(it);nr=a(Pn,"LI",{});var Rm=s(nr);la=a(Rm,"A",{href:!0,rel:!0});var Gm=s(la);Op=l(Gm,"Just-In-Time (JIT) compilation"),Gm.forEach(t),Rm.forEach(t),Dp=p(Pn),or=a(Pn,"LI",{});var Xm=s(or);ia=a(Xm,"A",{href:!0,rel:!0});var Lm=s(ia);Yp=l(Lm,"Automatic Differentiation"),Lm.forEach(t),Xm.forEach(t),Kp=p(Pn),ar=a(Pn,"LI",{});var Hm=s(ar);da=a(Hm,"A",{href:!0,rel:!0});var Qm=s(da);eh=l(Qm,"Vectorization"),Qm.forEach(t),Hm.forEach(t),th=p(Pn),sr=a(Pn,"LI",{});var Om=s(sr);ca=a(Om,"A",{href:!0,rel:!0});var Dm=s(ca);nh=l(Dm,"Parallelization"),Dm.forEach(t),Om.forEach(t),Pn.forEach(t),oh=p(Ge),Ve=a(Ge,"DIV",{class:!0});var Bn=s(Ve);k(pa.$$.fragment,Bn),ah=p(Bn),Xt=a(Bn,"P",{});var os=s(Xt);sh=l(os,"The "),rr=a(os,"CODE",{});var Ym=s(rr);rh=l(Ym,"FlaxMarianPreTrainedModel"),Ym.forEach(t),lh=l(os," forward method, overrides the "),lr=a(os,"CODE",{});var Km=s(lr);ih=l(Km,"__call__"),Km.forEach(t),dh=l(os," special method."),os.forEach(t),ch=p(Bn),k($n.$$.fragment,Bn),ph=p(Bn),k(zn.$$.fragment,Bn),Bn.forEach(t),Ge.forEach(t),dl=p(n),Lt=a(n,"H2",{class:!0});var ni=s(Lt);Un=a(ni,"A",{id:!0,class:!0,href:!0});var ef=s(Un);ir=a(ef,"SPAN",{});var tf=s(ir);k(ha.$$.fragment,tf),tf.forEach(t),ef.forEach(t),hh=p(ni),dr=a(ni,"SPAN",{});var nf=s(dr);uh=l(nf,"FlaxMarianMTModel"),nf.forEach(t),ni.forEach(t),cl=p(n),O=a(n,"DIV",{class:!0});var Xe=s(O);k(ua.$$.fragment,Xe),mh=p(Xe),ma=a(Xe,"P",{});var oi=s(ma);fh=l(oi,`The MARIAN Model with a language modeling head. Can be used for translation.
This model inherits from `),Ga=a(oi,"A",{href:!0});var of=s(Ga);gh=l(of,"FlaxPreTrainedModel"),of.forEach(t),_h=l(oi,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),oi.forEach(t),Mh=p(Xe),fa=a(Xe,"P",{});var ai=s(fa);yh=l(ai,`This model is also a Flax Linen
`),ga=a(ai,"A",{href:!0,rel:!0});var af=s(ga);Th=l(af,"flax.nn.Module"),af.forEach(t),bh=l(ai,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),ai.forEach(t),kh=p(Xe),cr=a(Xe,"P",{});var sf=s(cr);vh=l(sf,"Finally, this model supports inherent JAX features such as:"),sf.forEach(t),wh=p(Xe),dt=a(Xe,"UL",{});var Vn=s(dt);pr=a(Vn,"LI",{});var rf=s(pr);_a=a(rf,"A",{href:!0,rel:!0});var lf=s(_a);xh=l(lf,"Just-In-Time (JIT) compilation"),lf.forEach(t),rf.forEach(t),jh=p(Vn),hr=a(Vn,"LI",{});var df=s(hr);Ma=a(df,"A",{href:!0,rel:!0});var cf=s(Ma);Jh=l(cf,"Automatic Differentiation"),cf.forEach(t),df.forEach(t),$h=p(Vn),ur=a(Vn,"LI",{});var pf=s(ur);ya=a(pf,"A",{href:!0,rel:!0});var hf=s(ya);zh=l(hf,"Vectorization"),hf.forEach(t),pf.forEach(t),Uh=p(Vn),mr=a(Vn,"LI",{});var uf=s(mr);Ta=a(uf,"A",{href:!0,rel:!0});var mf=s(Ta);Eh=l(mf,"Parallelization"),mf.forEach(t),uf.forEach(t),Vn.forEach(t),Ih=p(Xe),Re=a(Xe,"DIV",{class:!0});var Rn=s(Re);k(ba.$$.fragment,Rn),Fh=p(Rn),Ht=a(Rn,"P",{});var as=s(Ht);Ch=l(as,"The "),fr=a(as,"CODE",{});var ff=s(fr);Nh=l(ff,"FlaxMarianPreTrainedModel"),ff.forEach(t),qh=l(as," forward method, overrides the "),gr=a(as,"CODE",{});var gf=s(gr);Zh=l(gf,"__call__"),gf.forEach(t),Ah=l(as," special method."),as.forEach(t),Wh=p(Rn),k(En.$$.fragment,Rn),Sh=p(Rn),k(In.$$.fragment,Rn),Rn.forEach(t),Xe.forEach(t),this.h()},h(){d(h,"name","hf:doc:metadata"),d(h,"content",JSON.stringify(Pf)),d(g,"id","marianmt"),d(g,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(g,"href","#marianmt"),d(_,"class","relative group"),d(Y,"alt","Models"),_f(Y.src,$="https://img.shields.io/badge/All_model_pages-marian-blueviolet")||d(Y,"src",$),d(he,"href","https://huggingface.co/models?filter=marian"),d(ue,"alt","Spaces"),_f(ue.src,ct="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||d(ue,"src",ct),d(S,"href","https://huggingface.co/spaces/docs-demos/opus-mt-zh-en"),d(Z,"class","flex flex-wrap space-x-1"),d(se,"href","https://github.com/huggingface/transformers/issues/new?assignees=sshleifer&labels=&template=bug-report.md&title"),d(se,"rel","nofollow"),d(te,"id","implementation-notes"),d(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"),d(te,"href","#implementation-notes"),d(A,"class","relative group"),d(N,"href","https://huggingface.co/Helsinki-NLP"),d(N,"rel","nofollow"),d(ve,"href","https://researchportal.helsinki.fi/en/persons/j%C3%B6rg-tiedemann"),d(ve,"rel","nofollow"),d(xe,"href","https://marian-nmt.github.io/"),d(xe,"rel","nofollow"),d(Ae,"href","/docs/transformers/main/en/model_doc/bart#transformers.BartForConditionalGeneration"),d(On,"href","https://huggingface.co/sshleifer"),d(On,"rel","nofollow"),d(Dt,"id","naming"),d(Dt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Dt,"href","#naming"),d(xt,"class","relative group"),d(Kn,"href","https://developers.google.com/admin-sdk/directory/v1/languages"),d(Kn,"rel","nofollow"),d(Yt,"id","examples"),d(Yt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Yt,"href","#examples"),d(Jt,"class","relative group"),d(to,"href","https://github.com/huggingface/transformers/blob/master/examples/legacy/seq2seq/train_distil_marian_enro.sh"),d(to,"rel","nofollow"),d(en,"id","multilingual-models"),d(en,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(en,"href","#multilingual-models"),d($t,"class","relative group"),d(ro,"href","https://huggingface.co/Helsinki-NLP/opus-mt-en-roa"),d(ro,"rel","nofollow"),d(io,"href","https://github.com/Helsinki-NLP/Tatoeba-Challenge"),d(io,"rel","nofollow"),d(nn,"id","old-style-multilingual-models"),d(nn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(nn,"href","#old-style-multilingual-models"),d(zt,"class","relative group"),d(on,"id","documentation-resources"),d(on,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(on,"href","#documentation-resources"),d(Ut,"class","relative group"),d(za,"href","../tasks/translation"),d(Ua,"href","../tasks/summarization"),d(Ea,"href","../tasks/language_modeling"),d(an,"id","transformers.MarianConfig"),d(an,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(an,"href","#transformers.MarianConfig"),d(Et,"class","relative group"),d(Ia,"href","/docs/transformers/main/en/model_doc/marian#transformers.MarianModel"),d(Mo,"href","https://huggingface.co/Helsinki-NLP/opus-mt-en-de"),d(Mo,"rel","nofollow"),d(Fa,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(Ca,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(rn,"id","transformers.MarianTokenizer"),d(rn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(rn,"href","#transformers.MarianTokenizer"),d(Ct,"class","relative group"),d(ko,"href","https://github.com/google/sentencepiece"),d(ko,"rel","nofollow"),d(Na,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),d(dn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(cn,"id","transformers.MarianModel"),d(cn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(cn,"href","#transformers.MarianModel"),d(Nt,"class","relative group"),d(qa,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(zo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(zo,"rel","nofollow"),d(Za,"href","/docs/transformers/main/en/model_doc/marian#transformers.MarianModel"),d(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(un,"id","transformers.MarianMTModel"),d(un,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(un,"href","#transformers.MarianMTModel"),d(Zt,"class","relative group"),d(Aa,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(No,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(No,"rel","nofollow"),d(Wa,"href","/docs/transformers/main/en/model_doc/marian#transformers.MarianMTModel"),d(Ao,"href","https://huggingface.co/models?search=Helsinki-NLP"),d(Ao,"rel","nofollow"),d(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(gn,"id","transformers.MarianForCausalLM"),d(gn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(gn,"href","#transformers.MarianForCausalLM"),d(Wt,"class","relative group"),d(_n,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(St,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(yn,"id","transformers.TFMarianModel"),d(yn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(yn,"href","#transformers.TFMarianModel"),d(Pt,"class","relative group"),d(Sa,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),d(Xo,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),d(Xo,"rel","nofollow"),d(Pa,"href","/docs/transformers/main/en/model_doc/marian#transformers.TFMarianModel"),d(Be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(vn,"id","transformers.TFMarianMTModel"),d(vn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(vn,"href","#transformers.TFMarianMTModel"),d(Vt,"class","relative group"),d(Ba,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),d(Yo,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),d(Yo,"rel","nofollow"),d(Va,"href","/docs/transformers/main/en/model_doc/marian#transformers.TFMarianMTModel"),d(ta,"href","https://huggingface.co/models?search=Helsinki-NLP"),d(ta,"rel","nofollow"),d(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Jn,"id","transformers.FlaxMarianModel"),d(Jn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Jn,"href","#transformers.FlaxMarianModel"),d(Gt,"class","relative group"),d(Ra,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),d(ra,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),d(ra,"rel","nofollow"),d(la,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),d(la,"rel","nofollow"),d(ia,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),d(ia,"rel","nofollow"),d(da,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),d(da,"rel","nofollow"),d(ca,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),d(ca,"rel","nofollow"),d(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Un,"id","transformers.FlaxMarianMTModel"),d(Un,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Un,"href","#transformers.FlaxMarianMTModel"),d(Lt,"class","relative group"),d(Ga,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),d(ga,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),d(ga,"rel","nofollow"),d(_a,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),d(_a,"rel","nofollow"),d(Ma,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),d(Ma,"rel","nofollow"),d(ya,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),d(ya,"rel","nofollow"),d(Ta,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),d(Ta,"rel","nofollow"),d(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(n,m){e(document.head,h),f(n,y,m),f(n,_,m),e(_,g),e(g,M),v(i,M,null),e(_,u),e(_,z),e(z,Le),f(n,Fe,m),f(n,Z,m),e(Z,he),e(he,Y),e(Z,He),e(Z,S),e(S,ue),f(n,K,m),f(n,B,m),e(B,_e),e(_e,ae),e(B,Qe),e(B,se),e(se,re),e(B,Oe),f(n,Ce,m),f(n,P,m),e(P,De),f(n,Ne,m),f(n,ee,m),e(ee,F),f(n,q,m),f(n,me,m),e(me,V),e(V,Ye),f(n,qe,m),f(n,A,m),e(A,te),e(te,Me),v(C,Me,null),e(A,Ke),e(A,R),e(R,et),f(n,Ze,m),f(n,E,m),e(E,ye),e(ye,Te),e(Te,G),e(E,tt),e(E,X),e(X,le),e(le,be),e(le,N),e(N,nt),e(le,W),e(E,ot),e(E,ke),e(ke,T),e(T,U),e(T,ve),e(ve,we),e(T,_t),e(T,xe),e(xe,I),e(T,Mt),e(E,yt),e(E,at),e(at,st),e(st,Tt),e(E,L),e(E,H),e(H,rt),e(rt,bt),e(E,ie),e(E,je),e(je,Je),e(Je,lt),e(Je,Ae),e(Ae,$e),e(Je,kt),e(je,si),e(je,vt),e(vt,Xn),e(Xn,ri),e(Xn,ss),e(ss,li),e(Xn,ii),e(vt,di),e(vt,Ln),e(Ln,ci),e(Ln,rs),e(rs,pi),e(Ln,hi),e(vt,ui),e(vt,wt),e(wt,mi),e(wt,ls),e(ls,fi),e(wt,gi),e(wt,is),e(is,_i),e(wt,Mi),e(E,yi),e(E,ds),e(ds,Hn),e(Hn,Ti),e(Hn,cs),e(cs,bi),e(Hn,ki),e(E,vi),e(E,ps),e(ps,Qn),e(Qn,wi),e(Qn,On),e(On,xi),e(Qn,ji),f(n,Ur,m),f(n,xt,m),e(xt,Dt),e(Dt,hs),v(Dn,hs,null),e(xt,Ji),e(xt,us),e(us,$i),f(n,Er,m),f(n,We,m),e(We,xa),e(xa,zi),e(xa,ms),e(ms,Ui),e(We,Ei),e(We,Yn),e(Yn,Ii),e(Yn,Kn),e(Kn,Fi),e(Yn,Ci),e(We,Ni),e(We,jt),e(jt,qi),e(jt,fs),e(fs,Zi),e(jt,Ai),e(jt,gs),e(gs,Wi),e(jt,Si),e(We,Pi),e(We,_s),e(_s,Bi),f(n,Ir,m),f(n,Jt,m),e(Jt,Yt),e(Yt,Ms),v(eo,Ms,null),e(Jt,Vi),e(Jt,ys),e(ys,Ri),f(n,Fr,m),f(n,Kt,m),e(Kt,Ts),e(Ts,Gi),e(Kt,Xi),e(Kt,bs),e(bs,to),e(to,Li),f(n,Cr,m),f(n,$t,m),e($t,en),e(en,ks),v(no,ks,null),e($t,Hi),e($t,vs),e(vs,Qi),f(n,Nr,m),f(n,Se,m),e(Se,oo),e(oo,Oi),e(oo,ws),e(ws,Di),e(oo,Yi),e(Se,Ki),e(Se,ao),e(ao,ed),e(ao,xs),e(xs,td),e(ao,nd),e(Se,od),e(Se,so),e(so,ad),e(so,ro),e(ro,sd),e(so,rd),e(Se,ld),e(Se,lo),e(lo,id),e(lo,js),e(js,dd),e(lo,cd),f(n,qr,m),f(n,tn,m),e(tn,pd),e(tn,io),e(io,hd),e(tn,ud),f(n,Zr,m),v(co,n,m),f(n,Ar,m),f(n,ja,m),e(ja,md),f(n,Wr,m),v(po,n,m),f(n,Sr,m),f(n,zt,m),e(zt,nn),e(nn,Js),v(ho,Js,null),e(zt,fd),e(zt,$s),e($s,gd),f(n,Pr,m),f(n,Ja,m),e(Ja,_d),f(n,Br,m),v(uo,n,m),f(n,Vr,m),f(n,$a,m),e($a,Md),f(n,Rr,m),v(mo,n,m),f(n,Gr,m),f(n,Ut,m),e(Ut,on),e(on,zs),v(fo,zs,null),e(Ut,yd),e(Ut,Us),e(Us,Td),f(n,Xr,m),f(n,pt,m),e(pt,Es),e(Es,za),e(za,bd),e(pt,kd),e(pt,Is),e(Is,Ua),e(Ua,vd),e(pt,wd),e(pt,Fs),e(Fs,Ea),e(Ea,xd),f(n,Lr,m),f(n,Et,m),e(Et,an),e(an,Cs),v(go,Cs,null),e(Et,jd),e(Et,Ns),e(Ns,Jd),f(n,Hr,m),f(n,ze,m),v(_o,ze,null),e(ze,$d),e(ze,It),e(It,zd),e(It,Ia),e(Ia,Ud),e(It,Ed),e(It,Mo),e(Mo,Id),e(It,Fd),e(ze,Cd),e(ze,Ft),e(Ft,Nd),e(Ft,Fa),e(Fa,qd),e(Ft,Zd),e(Ft,Ca),e(Ca,Ad),e(Ft,Wd),e(ze,Sd),v(sn,ze,null),f(n,Qr,m),f(n,Ct,m),e(Ct,rn),e(rn,qs),v(yo,qs,null),e(Ct,Pd),e(Ct,Zs),e(Zs,Bd),f(n,Or,m),f(n,de,m),v(To,de,null),e(de,Vd),e(de,bo),e(bo,Rd),e(bo,ko),e(ko,Gd),e(bo,Xd),e(de,Ld),e(de,vo),e(vo,Hd),e(vo,Na),e(Na,Qd),e(vo,Od),e(de,Dd),v(ln,de,null),e(de,Yd),e(de,dn),v(wo,dn,null),e(dn,Kd),e(dn,As),e(As,ec),f(n,Dr,m),f(n,Nt,m),e(Nt,cn),e(cn,Ws),v(xo,Ws,null),e(Nt,tc),e(Nt,Ss),e(Ss,nc),f(n,Yr,m),f(n,Ue,m),v(jo,Ue,null),e(Ue,oc),e(Ue,Jo),e(Jo,ac),e(Jo,qa),e(qa,sc),e(Jo,rc),e(Ue,lc),e(Ue,$o),e($o,ic),e($o,zo),e(zo,dc),e($o,cc),e(Ue,pc),e(Ue,Pe),v(Uo,Pe,null),e(Pe,hc),e(Pe,qt),e(qt,uc),e(qt,Za),e(Za,mc),e(qt,fc),e(qt,Ps),e(Ps,gc),e(qt,_c),e(Pe,Mc),v(pn,Pe,null),e(Pe,yc),v(hn,Pe,null),f(n,Kr,m),f(n,Zt,m),e(Zt,un),e(un,Bs),v(Eo,Bs,null),e(Zt,Tc),e(Zt,Vs),e(Vs,bc),f(n,el,m),f(n,Ee,m),v(Io,Ee,null),e(Ee,kc),e(Ee,Fo),e(Fo,vc),e(Fo,Aa),e(Aa,wc),e(Fo,xc),e(Ee,jc),e(Ee,Co),e(Co,Jc),e(Co,No),e(No,$c),e(Co,zc),e(Ee,Uc),e(Ee,fe),v(qo,fe,null),e(fe,Ec),e(fe,At),e(At,Ic),e(At,Wa),e(Wa,Fc),e(At,Cc),e(At,Rs),e(Rs,Nc),e(At,qc),e(fe,Zc),v(mn,fe,null),e(fe,Ac),e(fe,Zo),e(Zo,Wc),e(Zo,Ao),e(Ao,Sc),e(Zo,Pc),e(fe,Bc),v(fn,fe,null),f(n,tl,m),f(n,Wt,m),e(Wt,gn),e(gn,Gs),v(Wo,Gs,null),e(Wt,Vc),e(Wt,Xs),e(Xs,Rc),f(n,nl,m),f(n,St,m),v(So,St,null),e(St,Gc),e(St,_n),v(Po,_n,null),e(_n,Xc),v(Mn,_n,null),f(n,ol,m),f(n,Pt,m),e(Pt,yn),e(yn,Ls),v(Bo,Ls,null),e(Pt,Lc),e(Pt,Hs),e(Hs,Hc),f(n,al,m),f(n,ce,m),v(Vo,ce,null),e(ce,Qc),e(ce,Ro),e(Ro,Oc),e(Ro,Sa),e(Sa,Dc),e(Ro,Yc),e(ce,Kc),e(ce,Go),e(Go,ep),e(Go,Xo),e(Xo,tp),e(Go,np),e(ce,op),v(Tn,ce,null),e(ce,ap),e(ce,Be),v(Lo,Be,null),e(Be,sp),e(Be,Bt),e(Bt,rp),e(Bt,Pa),e(Pa,lp),e(Bt,ip),e(Bt,Qs),e(Qs,dp),e(Bt,cp),e(Be,pp),v(bn,Be,null),e(Be,hp),v(kn,Be,null),f(n,sl,m),f(n,Vt,m),e(Vt,vn),e(vn,Os),v(Ho,Os,null),e(Vt,up),e(Vt,Ds),e(Ds,mp),f(n,rl,m),f(n,pe,m),v(Qo,pe,null),e(pe,fp),e(pe,Oo),e(Oo,gp),e(Oo,Ba),e(Ba,_p),e(Oo,Mp),e(pe,yp),e(pe,Do),e(Do,Tp),e(Do,Yo),e(Yo,bp),e(Do,kp),e(pe,vp),v(wn,pe,null),e(pe,wp),e(pe,ge),v(Ko,ge,null),e(ge,xp),e(ge,Rt),e(Rt,jp),e(Rt,Va),e(Va,Jp),e(Rt,$p),e(Rt,Ys),e(Ys,zp),e(Rt,Up),e(ge,Ep),v(xn,ge,null),e(ge,Ip),e(ge,ea),e(ea,Fp),e(ea,ta),e(ta,Cp),e(ea,Np),e(ge,qp),v(jn,ge,null),f(n,ll,m),f(n,Gt,m),e(Gt,Jn),e(Jn,Ks),v(na,Ks,null),e(Gt,Zp),e(Gt,er),e(er,Ap),f(n,il,m),f(n,Q,m),v(oa,Q,null),e(Q,Wp),e(Q,aa),e(aa,Sp),e(aa,Ra),e(Ra,Pp),e(aa,Bp),e(Q,Vp),e(Q,sa),e(sa,Rp),e(sa,ra),e(ra,Gp),e(sa,Xp),e(Q,Lp),e(Q,tr),e(tr,Hp),e(Q,Qp),e(Q,it),e(it,nr),e(nr,la),e(la,Op),e(it,Dp),e(it,or),e(or,ia),e(ia,Yp),e(it,Kp),e(it,ar),e(ar,da),e(da,eh),e(it,th),e(it,sr),e(sr,ca),e(ca,nh),e(Q,oh),e(Q,Ve),v(pa,Ve,null),e(Ve,ah),e(Ve,Xt),e(Xt,sh),e(Xt,rr),e(rr,rh),e(Xt,lh),e(Xt,lr),e(lr,ih),e(Xt,dh),e(Ve,ch),v($n,Ve,null),e(Ve,ph),v(zn,Ve,null),f(n,dl,m),f(n,Lt,m),e(Lt,Un),e(Un,ir),v(ha,ir,null),e(Lt,hh),e(Lt,dr),e(dr,uh),f(n,cl,m),f(n,O,m),v(ua,O,null),e(O,mh),e(O,ma),e(ma,fh),e(ma,Ga),e(Ga,gh),e(ma,_h),e(O,Mh),e(O,fa),e(fa,yh),e(fa,ga),e(ga,Th),e(fa,bh),e(O,kh),e(O,cr),e(cr,vh),e(O,wh),e(O,dt),e(dt,pr),e(pr,_a),e(_a,xh),e(dt,jh),e(dt,hr),e(hr,Ma),e(Ma,Jh),e(dt,$h),e(dt,ur),e(ur,ya),e(ya,zh),e(dt,Uh),e(dt,mr),e(mr,Ta),e(Ta,Eh),e(O,Ih),e(O,Re),v(ba,Re,null),e(Re,Fh),e(Re,Ht),e(Ht,Ch),e(Ht,fr),e(fr,Nh),e(Ht,qh),e(Ht,gr),e(gr,Zh),e(Ht,Ah),e(Re,Wh),v(En,Re,null),e(Re,Sh),v(In,Re,null),pl=!0},p(n,[m]){const ka={};m&2&&(ka.$$scope={dirty:m,ctx:n}),sn.$set(ka);const _r={};m&2&&(_r.$$scope={dirty:m,ctx:n}),ln.$set(_r);const Mr={};m&2&&(Mr.$$scope={dirty:m,ctx:n}),pn.$set(Mr);const yr={};m&2&&(yr.$$scope={dirty:m,ctx:n}),hn.$set(yr);const va={};m&2&&(va.$$scope={dirty:m,ctx:n}),mn.$set(va);const Tr={};m&2&&(Tr.$$scope={dirty:m,ctx:n}),fn.$set(Tr);const br={};m&2&&(br.$$scope={dirty:m,ctx:n}),Mn.$set(br);const Fn={};m&2&&(Fn.$$scope={dirty:m,ctx:n}),Tn.$set(Fn);const kr={};m&2&&(kr.$$scope={dirty:m,ctx:n}),bn.$set(kr);const vr={};m&2&&(vr.$$scope={dirty:m,ctx:n}),kn.$set(vr);const wr={};m&2&&(wr.$$scope={dirty:m,ctx:n}),wn.$set(wr);const xr={};m&2&&(xr.$$scope={dirty:m,ctx:n}),xn.$set(xr);const jr={};m&2&&(jr.$$scope={dirty:m,ctx:n}),jn.$set(jr);const Jr={};m&2&&(Jr.$$scope={dirty:m,ctx:n}),$n.$set(Jr);const wa={};m&2&&(wa.$$scope={dirty:m,ctx:n}),zn.$set(wa);const $r={};m&2&&($r.$$scope={dirty:m,ctx:n}),En.$set($r);const zr={};m&2&&(zr.$$scope={dirty:m,ctx:n}),In.$set(zr)},i(n){pl||(w(i.$$.fragment,n),w(C.$$.fragment,n),w(Dn.$$.fragment,n),w(eo.$$.fragment,n),w(no.$$.fragment,n),w(co.$$.fragment,n),w(po.$$.fragment,n),w(ho.$$.fragment,n),w(uo.$$.fragment,n),w(mo.$$.fragment,n),w(fo.$$.fragment,n),w(go.$$.fragment,n),w(_o.$$.fragment,n),w(sn.$$.fragment,n),w(yo.$$.fragment,n),w(To.$$.fragment,n),w(ln.$$.fragment,n),w(wo.$$.fragment,n),w(xo.$$.fragment,n),w(jo.$$.fragment,n),w(Uo.$$.fragment,n),w(pn.$$.fragment,n),w(hn.$$.fragment,n),w(Eo.$$.fragment,n),w(Io.$$.fragment,n),w(qo.$$.fragment,n),w(mn.$$.fragment,n),w(fn.$$.fragment,n),w(Wo.$$.fragment,n),w(So.$$.fragment,n),w(Po.$$.fragment,n),w(Mn.$$.fragment,n),w(Bo.$$.fragment,n),w(Vo.$$.fragment,n),w(Tn.$$.fragment,n),w(Lo.$$.fragment,n),w(bn.$$.fragment,n),w(kn.$$.fragment,n),w(Ho.$$.fragment,n),w(Qo.$$.fragment,n),w(wn.$$.fragment,n),w(Ko.$$.fragment,n),w(xn.$$.fragment,n),w(jn.$$.fragment,n),w(na.$$.fragment,n),w(oa.$$.fragment,n),w(pa.$$.fragment,n),w($n.$$.fragment,n),w(zn.$$.fragment,n),w(ha.$$.fragment,n),w(ua.$$.fragment,n),w(ba.$$.fragment,n),w(En.$$.fragment,n),w(In.$$.fragment,n),pl=!0)},o(n){x(i.$$.fragment,n),x(C.$$.fragment,n),x(Dn.$$.fragment,n),x(eo.$$.fragment,n),x(no.$$.fragment,n),x(co.$$.fragment,n),x(po.$$.fragment,n),x(ho.$$.fragment,n),x(uo.$$.fragment,n),x(mo.$$.fragment,n),x(fo.$$.fragment,n),x(go.$$.fragment,n),x(_o.$$.fragment,n),x(sn.$$.fragment,n),x(yo.$$.fragment,n),x(To.$$.fragment,n),x(ln.$$.fragment,n),x(wo.$$.fragment,n),x(xo.$$.fragment,n),x(jo.$$.fragment,n),x(Uo.$$.fragment,n),x(pn.$$.fragment,n),x(hn.$$.fragment,n),x(Eo.$$.fragment,n),x(Io.$$.fragment,n),x(qo.$$.fragment,n),x(mn.$$.fragment,n),x(fn.$$.fragment,n),x(Wo.$$.fragment,n),x(So.$$.fragment,n),x(Po.$$.fragment,n),x(Mn.$$.fragment,n),x(Bo.$$.fragment,n),x(Vo.$$.fragment,n),x(Tn.$$.fragment,n),x(Lo.$$.fragment,n),x(bn.$$.fragment,n),x(kn.$$.fragment,n),x(Ho.$$.fragment,n),x(Qo.$$.fragment,n),x(wn.$$.fragment,n),x(Ko.$$.fragment,n),x(xn.$$.fragment,n),x(jn.$$.fragment,n),x(na.$$.fragment,n),x(oa.$$.fragment,n),x(pa.$$.fragment,n),x($n.$$.fragment,n),x(zn.$$.fragment,n),x(ha.$$.fragment,n),x(ua.$$.fragment,n),x(ba.$$.fragment,n),x(En.$$.fragment,n),x(In.$$.fragment,n),pl=!1},d(n){t(h),n&&t(y),n&&t(_),j(i),n&&t(Fe),n&&t(Z),n&&t(K),n&&t(B),n&&t(Ce),n&&t(P),n&&t(Ne),n&&t(ee),n&&t(q),n&&t(me),n&&t(qe),n&&t(A),j(C),n&&t(Ze),n&&t(E),n&&t(Ur),n&&t(xt),j(Dn),n&&t(Er),n&&t(We),n&&t(Ir),n&&t(Jt),j(eo),n&&t(Fr),n&&t(Kt),n&&t(Cr),n&&t($t),j(no),n&&t(Nr),n&&t(Se),n&&t(qr),n&&t(tn),n&&t(Zr),j(co,n),n&&t(Ar),n&&t(ja),n&&t(Wr),j(po,n),n&&t(Sr),n&&t(zt),j(ho),n&&t(Pr),n&&t(Ja),n&&t(Br),j(uo,n),n&&t(Vr),n&&t($a),n&&t(Rr),j(mo,n),n&&t(Gr),n&&t(Ut),j(fo),n&&t(Xr),n&&t(pt),n&&t(Lr),n&&t(Et),j(go),n&&t(Hr),n&&t(ze),j(_o),j(sn),n&&t(Qr),n&&t(Ct),j(yo),n&&t(Or),n&&t(de),j(To),j(ln),j(wo),n&&t(Dr),n&&t(Nt),j(xo),n&&t(Yr),n&&t(Ue),j(jo),j(Uo),j(pn),j(hn),n&&t(Kr),n&&t(Zt),j(Eo),n&&t(el),n&&t(Ee),j(Io),j(qo),j(mn),j(fn),n&&t(tl),n&&t(Wt),j(Wo),n&&t(nl),n&&t(St),j(So),j(Po),j(Mn),n&&t(ol),n&&t(Pt),j(Bo),n&&t(al),n&&t(ce),j(Vo),j(Tn),j(Lo),j(bn),j(kn),n&&t(sl),n&&t(Vt),j(Ho),n&&t(rl),n&&t(pe),j(Qo),j(wn),j(Ko),j(xn),j(jn),n&&t(ll),n&&t(Gt),j(na),n&&t(il),n&&t(Q),j(oa),j(pa),j($n),j(zn),n&&t(dl),n&&t(Lt),j(ha),n&&t(cl),n&&t(O),j(ua),j(ba),j(En),j(In)}}}const Pf={local:"marianmt",sections:[{local:"implementation-notes",title:"Implementation Notes"},{local:"naming",title:"Naming"},{local:"examples",title:"Examples"},{local:"multilingual-models",title:"Multilingual Models"},{local:"old-style-multilingual-models",title:"Old Style Multi-Lingual Models"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.MarianConfig",title:"MarianConfig"},{local:"transformers.MarianTokenizer",title:"MarianTokenizer"},{local:"transformers.MarianModel",title:"MarianModel"},{local:"transformers.MarianMTModel",title:"MarianMTModel"},{local:"transformers.MarianForCausalLM",title:"MarianForCausalLM"},{local:"transformers.TFMarianModel",title:"TFMarianModel"},{local:"transformers.TFMarianMTModel",title:"TFMarianMTModel"},{local:"transformers.FlaxMarianModel",title:"FlaxMarianModel"},{local:"transformers.FlaxMarianMTModel",title:"FlaxMarianMTModel"}],title:"MarianMT"};function Bf(J){return kf(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Qf extends Mf{constructor(h){super();yf(this,h,Bf,Sf,Tf,{})}}export{Qf as default,Pf as metadata};
