import{S as Mf,i as yf,s as Tf,e as o,k as c,w as v,t as r,M as vf,c as s,d as t,m as p,a,x as b,h as l,b as d,N as _f,G as e,g as f,y as k,q as w,o as x,B as j,v as bf,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 kf(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(),v(g.$$.fragment)},l(i){h=s(i,"P",{});var u=a(h);y=l(u,"Examples:"),u.forEach(t),_=p(i),b(g.$$.fragment,i)},m(i,u){f(i,h,u),e(h,y),f(i,_,u),k(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(),v(g.$$.fragment)},l(i){h=s(i,"P",{});var u=a(h);y=l(u,"Examples:"),u.forEach(t),_=p(i),b(g.$$.fragment,i)},m(i,u){f(i,h,u),e(h,y),f(i,_,u),k(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=s(i,"P",{});var u=a(h);y=l(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(u,"CODE",{});var U=a(_);g=l(U,"Module"),U.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(),v(g.$$.fragment)},l(i){h=s(i,"P",{});var u=a(h);y=l(u,"Example:"),u.forEach(t),_=p(i),b(g.$$.fragment,i)},m(i,u){f(i,h,u),e(h,y),f(i,_,u),k(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=s(i,"P",{});var u=a(h);y=l(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(u,"CODE",{});var U=a(_);g=l(U,"Module"),U.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(),v(g.$$.fragment)},l(i){h=s(i,"P",{});var u=a(h);y=l(u,"Examples:"),u.forEach(t),_=p(i),b(g.$$.fragment,i)},m(i,u){f(i,h,u),e(h,y),f(i,_,u),k(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;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(),v(g.$$.fragment)},l(i){h=s(i,"P",{});var u=a(h);y=l(u,"Example:"),u.forEach(t),_=p(i),b(g.$$.fragment,i)},m(i,u){f(i,h,u),e(h,y),f(i,_,u),k(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,i,u,U,Le,Ce,W,he,Y,$,He,S,ue,ct,K,P,_e,se,Qe,ae,re,Oe,Fe,V,De,Ne,ee,C,q,me,B,Ye,qe,Z,te,Me,F,Ke,R,et,We,E,ye,Te,G,tt,X,le,ve,N,nt,A,ot,be;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"),U=o("li"),Le=r("having all inputs as keyword arguments (like PyTorch models), or"),Ce=c(),W=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"),P=r("model.fit()"),_e=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),se=o("code"),Qe=r("fit()"),ae=r(" and "),re=o("code"),Oe=r("predict()"),Fe=r(`, such as when creating your own layers or models with
the Keras `),V=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(),C=o("ul"),q=o("li"),me=r("a single Tensor with "),B=o("code"),Ye=r("input_ids"),qe=r(" only and nothing else: "),Z=o("code"),te=r("model(input_ids)"),Me=c(),F=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])"),We=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})'),ve=c(),N=o("p"),nt=r(`Note that when creating models and layers with
`),A=o("a"),ot=r("subclassing"),be=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=s(T,"P",{});var z=a(h);y=l(z,"TensorFlow models and layers in "),_=s(z,"CODE",{});var ke=a(_);g=l(ke,"transformers"),ke.forEach(t),M=l(z," accept two formats as input:"),z.forEach(t),i=p(T),u=s(T,"UL",{});var we=a(u);U=s(we,"LI",{});var _t=a(U);Le=l(_t,"having all inputs as keyword arguments (like PyTorch models), or"),_t.forEach(t),Ce=p(we),W=s(we,"LI",{});var xe=a(W);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),$=s(T,"P",{});var I=a($);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=s(I,"CODE",{});var Mt=a(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=s(I,"CODE",{});var yt=a(K);P=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 `),se=s(I,"CODE",{});var st=a(se);Qe=l(st,"fit()"),st.forEach(t),ae=l(I," and "),re=s(I,"CODE",{});var at=a(re);Oe=l(at,"predict()"),at.forEach(t),Fe=l(I,`, such as when creating your own layers or models with
the Keras `),V=s(I,"CODE",{});var Tt=a(V);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),C=s(T,"UL",{});var L=a(C);q=s(L,"LI",{});var H=a(q);me=l(H,"a single Tensor with "),B=s(H,"CODE",{});var rt=a(B);Ye=l(rt,"input_ids"),rt.forEach(t),qe=l(H," only and nothing else: "),Z=s(H,"CODE",{});var vt=a(Z);te=l(vt,"model(input_ids)"),vt.forEach(t),H.forEach(t),Me=p(L),F=s(L,"LI",{});var ie=a(F);Ke=l(ie,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=s(ie,"CODE",{});var je=a(R);et=l(je,"model([input_ids, attention_mask])"),je.forEach(t),We=l(ie," or "),E=s(ie,"CODE",{});var Je=a(E);ye=l(Je,"model([input_ids, attention_mask, token_type_ids])"),Je.forEach(t),ie.forEach(t),Te=p(L),G=s(L,"LI",{});var lt=a(G);tt=l(lt,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),X=s(lt,"CODE",{});var Ze=a(X);le=l(Ze,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ze.forEach(t),lt.forEach(t),L.forEach(t),ve=p(T),N=s(T,"P",{});var $e=a(N);nt=l($e,`Note that when creating models and layers with
`),A=s($e,"A",{href:!0,rel:!0});var bt=a(A);ot=l(bt,"subclassing"),bt.forEach(t),be=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(A,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),d(A,"rel","nofollow")},m(T,z){f(T,h,z),e(h,y),e(h,_),e(_,g),e(h,M),f(T,i,z),f(T,u,z),e(u,U),e(U,Le),e(u,Ce),e(u,W),e(W,he),f(T,Y,z),f(T,$,z),e($,He),e($,S),e(S,ue),e($,ct),e($,K),e(K,P),e($,_e),e($,se),e(se,Qe),e($,ae),e($,re),e(re,Oe),e($,Fe),e($,V),e(V,De),e($,Ne),f(T,ee,z),f(T,C,z),e(C,q),e(q,me),e(q,B),e(B,Ye),e(q,qe),e(q,Z),e(Z,te),e(C,Me),e(C,F),e(F,Ke),e(F,R),e(R,et),e(F,We),e(F,E),e(E,ye),e(C,Te),e(C,G),e(G,tt),e(G,X),e(X,le),f(T,ve,z),f(T,N,z),e(N,nt),e(N,A),e(A,ot),e(N,be)},d(T){T&&t(h),T&&t(i),T&&t(u),T&&t(Y),T&&t($),T&&t(ee),T&&t(C),T&&t(ve),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=s(i,"P",{});var u=a(h);y=l(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(u,"CODE",{});var U=a(_);g=l(U,"Module"),U.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(),v(g.$$.fragment)},l(i){h=s(i,"P",{});var u=a(h);y=l(u,"Example:"),u.forEach(t),_=p(i),b(g.$$.fragment,i)},m(i,u){f(i,h,u),e(h,y),f(i,_,u),k(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 Cf(J){let h,y,_,g,M,i,u,U,Le,Ce,W,he,Y,$,He,S,ue,ct,K,P,_e,se,Qe,ae,re,Oe,Fe,V,De,Ne,ee,C,q,me,B,Ye,qe,Z,te,Me,F,Ke,R,et,We,E,ye,Te,G,tt,X,le,ve,N,nt,A,ot,be;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"),U=o("li"),Le=r("having all inputs as keyword arguments (like PyTorch models), or"),Ce=c(),W=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"),P=r("model.fit()"),_e=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),se=o("code"),Qe=r("fit()"),ae=r(" and "),re=o("code"),Oe=r("predict()"),Fe=r(`, such as when creating your own layers or models with
the Keras `),V=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(),C=o("ul"),q=o("li"),me=r("a single Tensor with "),B=o("code"),Ye=r("input_ids"),qe=r(" only and nothing else: "),Z=o("code"),te=r("model(input_ids)"),Me=c(),F=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])"),We=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})'),ve=c(),N=o("p"),nt=r(`Note that when creating models and layers with
`),A=o("a"),ot=r("subclassing"),be=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=s(T,"P",{});var z=a(h);y=l(z,"TensorFlow models and layers in "),_=s(z,"CODE",{});var ke=a(_);g=l(ke,"transformers"),ke.forEach(t),M=l(z," accept two formats as input:"),z.forEach(t),i=p(T),u=s(T,"UL",{});var we=a(u);U=s(we,"LI",{});var _t=a(U);Le=l(_t,"having all inputs as keyword arguments (like PyTorch models), or"),_t.forEach(t),Ce=p(we),W=s(we,"LI",{});var xe=a(W);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),$=s(T,"P",{});var I=a($);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=s(I,"CODE",{});var Mt=a(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=s(I,"CODE",{});var yt=a(K);P=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 `),se=s(I,"CODE",{});var st=a(se);Qe=l(st,"fit()"),st.forEach(t),ae=l(I," and "),re=s(I,"CODE",{});var at=a(re);Oe=l(at,"predict()"),at.forEach(t),Fe=l(I,`, such as when creating your own layers or models with
the Keras `),V=s(I,"CODE",{});var Tt=a(V);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),C=s(T,"UL",{});var L=a(C);q=s(L,"LI",{});var H=a(q);me=l(H,"a single Tensor with "),B=s(H,"CODE",{});var rt=a(B);Ye=l(rt,"input_ids"),rt.forEach(t),qe=l(H," only and nothing else: "),Z=s(H,"CODE",{});var vt=a(Z);te=l(vt,"model(input_ids)"),vt.forEach(t),H.forEach(t),Me=p(L),F=s(L,"LI",{});var ie=a(F);Ke=l(ie,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),R=s(ie,"CODE",{});var je=a(R);et=l(je,"model([input_ids, attention_mask])"),je.forEach(t),We=l(ie," or "),E=s(ie,"CODE",{});var Je=a(E);ye=l(Je,"model([input_ids, attention_mask, token_type_ids])"),Je.forEach(t),ie.forEach(t),Te=p(L),G=s(L,"LI",{});var lt=a(G);tt=l(lt,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),X=s(lt,"CODE",{});var Ze=a(X);le=l(Ze,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ze.forEach(t),lt.forEach(t),L.forEach(t),ve=p(T),N=s(T,"P",{});var $e=a(N);nt=l($e,`Note that when creating models and layers with
`),A=s($e,"A",{href:!0,rel:!0});var bt=a(A);ot=l(bt,"subclassing"),bt.forEach(t),be=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(A,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),d(A,"rel","nofollow")},m(T,z){f(T,h,z),e(h,y),e(h,_),e(_,g),e(h,M),f(T,i,z),f(T,u,z),e(u,U),e(U,Le),e(u,Ce),e(u,W),e(W,he),f(T,Y,z),f(T,$,z),e($,He),e($,S),e(S,ue),e($,ct),e($,K),e(K,P),e($,_e),e($,se),e(se,Qe),e($,ae),e($,re),e(re,Oe),e($,Fe),e($,V),e(V,De),e($,Ne),f(T,ee,z),f(T,C,z),e(C,q),e(q,me),e(q,B),e(B,Ye),e(q,qe),e(q,Z),e(Z,te),e(C,Me),e(C,F),e(F,Ke),e(F,R),e(R,et),e(F,We),e(F,E),e(E,ye),e(C,Te),e(C,G),e(G,tt),e(G,X),e(X,le),f(T,ve,z),f(T,N,z),e(N,nt),e(N,A),e(A,ot),e(N,be)},d(T){T&&t(h),T&&t(i),T&&t(u),T&&t(Y),T&&t($),T&&t(ee),T&&t(C),T&&t(ve),T&&t(N)}}}function Ff(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=s(i,"P",{});var u=a(h);y=l(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(u,"CODE",{});var U=a(_);g=l(U,"Module"),U.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(),v(g.$$.fragment)},l(i){h=s(i,"P",{});var u=a(h);y=l(u,"Examples:"),u.forEach(t),_=p(i),b(g.$$.fragment,i)},m(i,u){f(i,h,u),e(h,y),f(i,_,u),k(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=s(i,"P",{});var u=a(h);y=l(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(u,"CODE",{});var U=a(_);g=l(U,"Module"),U.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:"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(),v(g.$$.fragment)},l(i){h=s(i,"P",{});var u=a(h);y=l(u,"Example:"),u.forEach(t),_=p(i),b(g.$$.fragment,i)},m(i,u){f(i,h,u),e(h,y),f(i,_,u),k(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{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=s(i,"P",{});var u=a(h);y=l(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(u,"CODE",{});var U=a(_);g=l(U,"Module"),U.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 Af(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(),v(g.$$.fragment)},l(i){h=s(i,"P",{});var u=a(h);y=l(u,"Example:"),u.forEach(t),_=p(i),b(g.$$.fragment,i)},m(i,u){f(i,h,u),e(h,y),f(i,_,u),k(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,U,Le,Ce,W,he,Y,$,He,S,ue,ct,K,P,_e,se,Qe,ae,re,Oe,Fe,V,De,Ne,ee,C,q,me,B,Ye,qe,Z,te,Me,F,Ke,R,et,We,E,ye,Te,G,tt,X,le,ve,N,nt,A,ot,be,T,z,ke,we,_t,xe,I,Mt,yt,st,at,Tt,L,H,rt,vt,ie,je,Je,lt,Ze,$e,bt,ai,kt,Xn,ri,aa,li,ii,di,Ln,ci,ra,pi,hi,ui,wt,mi,la,fi,gi,ia,_i,Mi,yi,da,Hn,Ti,ca,vi,bi,ki,pa,Qn,wi,On,xi,ji,zr,xt,Dt,ha,Dn,Ji,ua,$i,Er,Ae,xs,Ui,ma,zi,Ei,Yn,Ii,Kn,Ci,Fi,Ni,jt,qi,fa,Wi,Zi,ga,Ai,Si,Vi,_a,Pi,Ir,Jt,Yt,Ma,eo,Bi,ya,Ri,Cr,Kt,Ta,Gi,Xi,va,to,Li,Fr,$t,en,ba,no,Hi,ka,Qi,Nr,Se,oo,Oi,wa,Di,Yi,Ki,so,ed,xa,td,nd,od,ao,sd,ro,ad,rd,ld,lo,id,ja,dd,cd,qr,tn,pd,io,hd,ud,Wr,co,Zr,js,md,Ar,po,Sr,Ut,nn,Ja,ho,fd,$a,gd,Vr,Js,_d,Pr,uo,Br,$s,Md,Rr,mo,Gr,zt,on,Ua,fo,yd,za,Td,Xr,pt,Ea,Us,vd,bd,Ia,zs,kd,wd,Ca,Es,xd,Lr,Et,sn,Fa,go,jd,Na,Jd,Hr,Ue,_o,$d,It,Ud,Is,zd,Ed,Mo,Id,Cd,Fd,Ct,Nd,Cs,qd,Wd,Fs,Zd,Ad,Sd,an,Qr,Ft,rn,qa,yo,Vd,Wa,Pd,Or,de,To,Bd,vo,Rd,bo,Gd,Xd,Ld,ko,Hd,Ns,Qd,Od,Dd,ln,Yd,dn,wo,Kd,Za,ec,Dr,Nt,cn,Aa,xo,tc,Sa,nc,Yr,ze,jo,oc,Jo,sc,qs,ac,rc,lc,$o,ic,Uo,dc,cc,pc,Ve,zo,hc,qt,uc,Ws,mc,fc,Va,gc,_c,Mc,pn,yc,hn,Kr,Wt,un,Pa,Eo,Tc,Ba,vc,el,Ee,Io,bc,Co,kc,Zs,wc,xc,jc,Fo,Jc,No,$c,Uc,zc,fe,qo,Ec,Zt,Ic,As,Cc,Fc,Ra,Nc,qc,Wc,mn,Zc,Wo,Ac,Zo,Sc,Vc,Pc,fn,tl,At,gn,Ga,Ao,Bc,Xa,Rc,nl,St,So,Gc,_n,Vo,Xc,Mn,ol,Vt,yn,La,Po,Lc,Ha,Hc,sl,ce,Bo,Qc,Ro,Oc,Ss,Dc,Yc,Kc,Go,ep,Xo,tp,np,op,Tn,sp,Pe,Lo,ap,Pt,rp,Vs,lp,ip,Qa,dp,cp,pp,vn,hp,bn,al,Bt,kn,Oa,Ho,up,Da,mp,rl,pe,Qo,fp,Oo,gp,Ps,_p,Mp,yp,Do,Tp,Yo,vp,bp,kp,wn,wp,ge,Ko,xp,Rt,jp,Bs,Jp,$p,Ya,Up,zp,Ep,xn,Ip,es,Cp,ts,Fp,Np,qp,jn,ll,Gt,Jn,Ka,ns,Wp,er,Zp,il,Q,os,Ap,ss,Sp,Rs,Vp,Pp,Bp,as,Rp,rs,Gp,Xp,Lp,tr,Hp,Qp,it,nr,ls,Op,Dp,or,is,Yp,Kp,sr,ds,eh,th,ar,cs,nh,oh,Be,ps,sh,Xt,ah,rr,rh,lh,lr,ih,dh,ch,$n,ph,Un,dl,Lt,zn,ir,hs,hh,dr,uh,cl,O,us,mh,ms,fh,Gs,gh,_h,Mh,fs,yh,gs,Th,vh,bh,cr,kh,wh,dt,pr,_s,xh,jh,hr,Ms,Jh,$h,ur,ys,Uh,zh,mr,Ts,Eh,Ih,Re,vs,Ch,Ht,Fh,fr,Nh,qh,gr,Wh,Zh,Ah,En,Sh,In,pl;return i=new oe({}),F=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/v4.31.0/en/model_doc/marian#transformers.MarianModel">MarianModel</a> or <a href="/docs/transformers/v4.31.0/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/v4.31.0/src/transformers/models/marian/configuration_marian.py#L34"}}),an=new Qt({props:{anchor:"transformers.MarianConfig.example",$$slots:{default:[kf]},$$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/v4.31.0/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/v4.31.0/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/v4.31.0/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/v4.31.0/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/v4.31.0/src/transformers/models/marian/modeling_marian.py#L1105"}}),zo=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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/marian/modeling_marian.py#L1189",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/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/v4.31.0/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/v4.31.0/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/v4.31.0/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/v4.31.0/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/v4.31.0/src/transformers/models/marian/modeling_marian.py#L1291"}}),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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/v4.31.0/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/v4.31.0/src/transformers/models/marian/modeling_marian.py#L1414",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/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/v4.31.0/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/v4.31.0/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}}}),Ao=new oe({}),So=new D({props:{name:"class transformers.MarianForCausalLM",anchor:"transformers.MarianForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/marian/modeling_marian.py#L1558"}}),Vo=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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/marian/modeling_marian.py#L1591",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/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/v4.31.0/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/v4.31.0/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:[Uf]},$$scope:{ctx:J}}}),Po=new oe({}),Bo=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/v4.31.0/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/v4.31.0/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/v4.31.0/src/transformers/models/marian/modeling_tf_marian.py#L1157"}}),Tn=new Gn({props:{$$slots:{default:[zf]},$$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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/v4.31.0/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/v4.31.0/src/transformers/models/marian/modeling_tf_marian.py#L1169",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/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/v4.31.0/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/v4.31.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSeq2SeqModelOutput"
>transformers.modeling_tf_outputs.TFSeq2SeqModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),vn=new Gn({props:{$$slots:{default:[Ef]},$$scope:{ctx:J}}}),bn=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/v4.31.0/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/v4.31.0/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/v4.31.0/src/transformers/models/marian/modeling_tf_marian.py#L1262"}}),wn=new Gn({props:{$$slots:{default:[Cf]},$$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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/v4.31.0/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/v4.31.0/src/transformers/models/marian/modeling_tf_marian.py#L1300",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/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/v4.31.0/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/v4.31.0/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:[Ff]},$$scope:{ctx:J}}}),jn=new Qt({props:{anchor:"transformers.TFMarianMTModel.call.example",$$slots:{default:[Nf]},$$scope:{ctx:J}}}),ns=new oe({}),os=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/v4.31.0/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/v4.31.0/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/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/marian/modeling_flax_marian.py#L1205"}}),ps=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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/marian/modeling_flax_marian.py#L1140",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/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/v4.31.0/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/v4.31.0/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}}}),Un=new Qt({props:{anchor:"transformers.FlaxMarianModel.__call__.example",$$slots:{default:[Wf]},$$scope:{ctx:J}}}),hs=new oe({}),us=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/v4.31.0/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/v4.31.0/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/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/marian/modeling_flax_marian.py#L1289"}}),vs=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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/marian/modeling_flax_marian.py#L1140",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/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/v4.31.0/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/v4.31.0/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:[Zf]},$$scope:{ctx:J}}}),In=new Qt({props:{anchor:"transformers.FlaxMarianMTModel.__call__.example",$$slots:{default:[Af]},$$scope:{ctx:J}}}),{c(){h=o("meta"),y=c(),_=o("h1"),g=o("a"),M=o("span"),v(i.$$.fragment),u=c(),U=o("span"),Le=r("MarianMT"),Ce=c(),W=o("div"),he=o("a"),Y=o("img"),He=c(),S=o("a"),ue=o("img"),K=c(),P=o("p"),_e=o("strong"),se=r("Bugs:"),Qe=r(" If you see something strange, file a "),ae=o("a"),re=r("Github Issue"),Oe=r(`
and assign @patrickvonplaten.`),Fe=c(),V=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"),C=r("Tips:"),q=c(),me=o("ul"),B=o("li"),Ye=r("A framework for translation models, using the same models as BART."),qe=c(),Z=o("h2"),te=o("a"),Me=o("span"),v(F.$$.fragment),Ke=c(),R=o("span"),et=r("Implementation Notes"),We=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"),ve=r("The list of supported language pairs can be found "),N=o("a"),nt=r("here"),A=r("."),ot=c(),be=o("li"),T=o("p"),z=r("Models were originally trained by "),ke=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(),st=o("li"),at=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"),vt=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 "),Ze=o("a"),$e=r("BartForConditionalGeneration"),bt=r(" with a few minor modifications:"),ai=c(),kt=o("ul"),Xn=o("li"),ri=r("static (sinusoid) positional embeddings ("),aa=o("code"),li=r("MarianConfig.static_position_embeddings=True"),ii=r(")"),di=c(),Ln=o("li"),ci=r("no layernorm_embedding ("),ra=o("code"),pi=r("MarianConfig.normalize_embedding=False"),hi=r(")"),ui=c(),wt=o("li"),mi=r("the model starts generating with "),la=o("code"),fi=r("pad_token_id"),gi=r(` (which has 0 as a token_embedding) as the prefix (Bart uses
`),ia=o("code"),_i=r("<s/>"),Mi=r("),"),yi=c(),da=o("li"),Hn=o("p"),Ti=r("Code to bulk convert models can be found in "),ca=o("code"),vi=r("convert_marian_to_pytorch.py"),bi=r("."),ki=c(),pa=o("li"),Qn=o("p"),wi=r("This model was contributed by "),On=o("a"),xi=r("sshleifer"),ji=r("."),zr=c(),xt=o("h2"),Dt=o("a"),ha=o("span"),v(Dn.$$.fragment),Ji=c(),ua=o("span"),$i=r("Naming"),Er=c(),Ae=o("ul"),xs=o("li"),Ui=r("All model names use the following format: "),ma=o("code"),zi=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"),Ci=r("here"),Fi=r(`, three digit codes require googling \u201Clanguage
code {code}\u201C.`),Ni=c(),jt=o("li"),qi=r("Codes formatted like "),fa=o("code"),Wi=r("es_AR"),Zi=r(" are usually "),ga=o("code"),Ai=r("code_{region}"),Si=r(". That one is Spanish from Argentina."),Vi=c(),_a=o("li"),Pi=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"),Ma=o("span"),v(eo.$$.fragment),Bi=c(),ya=o("span"),Ri=r("Examples"),Cr=c(),Kt=o("ul"),Ta=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(),va=o("li"),to=o("a"),Li=r("Fine-tune on GPU"),Fr=c(),$t=o("h2"),en=o("a"),ba=o("span"),v(no.$$.fragment),Hi=c(),ka=o("span"),Qi=r("Multilingual Models"),Nr=c(),Se=o("ul"),oo=o("li"),Oi=r("All model names use the following format: "),wa=o("code"),Di=r("Helsinki-NLP/opus-mt-{src}-{tgt}"),Yi=r(":"),Ki=c(),so=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 `),xa=o("code"),td=r("src_text"),nd=r("."),od=c(),ao=o("li"),sd=r("You can see a models\u2019s supported language codes in its model card, under target constituents, like in "),ro=o("a"),ad=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 "),ja=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:`),Wr=c(),v(co.$$.fragment),Zr=c(),js=o("p"),md=r("Here is the code to see all available pretrained models on the hub:"),Ar=c(),v(po.$$.fragment),Sr=c(),Ut=o("h2"),nn=o("a"),Ja=o("span"),v(ho.$$.fragment),fd=c(),$a=o("span"),gd=r("Old Style Multi-Lingual Models"),Vr=c(),Js=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:`),Pr=c(),v(uo.$$.fragment),Br=c(),$s=o("p"),Md=r("Example of translating english to many romance languages, using old-style 2 character language codes"),Rr=c(),v(mo.$$.fragment),Gr=c(),zt=o("h2"),on=o("a"),Ua=o("span"),v(fo.$$.fragment),yd=c(),za=o("span"),Td=r("Documentation resources"),Xr=c(),pt=o("ul"),Ea=o("li"),Us=o("a"),vd=r("Translation task guide"),bd=c(),Ia=o("li"),zs=o("a"),kd=r("Summarization task guide"),wd=c(),Ca=o("li"),Es=o("a"),xd=r("Causal language modeling task guide"),Lr=c(),Et=o("h2"),sn=o("a"),Fa=o("span"),v(go.$$.fragment),jd=c(),Na=o("span"),Jd=r("MarianConfig"),Hr=c(),Ue=o("div"),v(_o.$$.fragment),$d=c(),It=o("p"),Ud=r("This is the configuration class to store the configuration of a "),Is=o("a"),zd=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"),Cd=r(" architecture."),Fd=c(),Ct=o("p"),Nd=r("Configuration objects inherit from "),Cs=o("a"),qd=r("PretrainedConfig"),Wd=r(` and can be used to control the model outputs. Read the
documentation from `),Fs=o("a"),Zd=r("PretrainedConfig"),Ad=r(" for more information."),Sd=c(),v(an.$$.fragment),Qr=c(),Ft=o("h2"),rn=o("a"),qa=o("span"),v(yo.$$.fragment),Vd=c(),Wa=o("span"),Pd=r("MarianTokenizer"),Or=c(),de=o("div"),v(To.$$.fragment),Bd=c(),vo=o("p"),Rd=r("Construct a Marian tokenizer. Based on "),bo=o("a"),Gd=r("SentencePiece"),Xd=r("."),Ld=c(),ko=o("p"),Hd=r("This tokenizer inherits from "),Ns=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(),v(ln.$$.fragment),Yd=c(),dn=o("div"),v(wo.$$.fragment),Kd=c(),Za=o("p"),ec=r("Build model inputs from a sequence by appending eos_token_id."),Dr=c(),Nt=o("h2"),cn=o("a"),Aa=o("span"),v(xo.$$.fragment),tc=c(),Sa=o("span"),nc=r("MarianModel"),Yr=c(),ze=o("div"),v(jo.$$.fragment),oc=c(),Jo=o("p"),sc=r(`The bare Marian Model outputting raw hidden-states without any specific head on top.
This model inherits from `),qs=o("a"),ac=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 "),Uo=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(),Ve=o("div"),v(zo.$$.fragment),hc=c(),qt=o("p"),uc=r("The "),Ws=o("a"),mc=r("MarianModel"),fc=r(" forward method, overrides the "),Va=o("code"),gc=r("__call__"),_c=r(" special method."),Mc=c(),v(pn.$$.fragment),yc=c(),v(hn.$$.fragment),Kr=c(),Wt=o("h2"),un=o("a"),Pa=o("span"),v(Eo.$$.fragment),Tc=c(),Ba=o("span"),vc=r("MarianMTModel"),el=c(),Ee=o("div"),v(Io.$$.fragment),bc=c(),Co=o("p"),kc=r(`The Marian Model with a language modeling head. Can be used for summarization.
This model inherits from `),Zs=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(),Fo=o("p"),Jc=r("This model is also a PyTorch "),No=o("a"),$c=r("torch.nn.Module"),Uc=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),zc=c(),fe=o("div"),v(qo.$$.fragment),Ec=c(),Zt=o("p"),Ic=r("The "),As=o("a"),Cc=r("MarianMTModel"),Fc=r(" forward method, overrides the "),Ra=o("code"),Nc=r("__call__"),qc=r(" special method."),Wc=c(),v(mn.$$.fragment),Zc=c(),Wo=o("p"),Ac=r(`Pytorch version of marian-nmt\u2019s transformer.h (c++). Designed for the OPUS-NMT translation checkpoints. Available
models are listed `),Zo=o("a"),Sc=r("here"),Vc=r("."),Pc=c(),v(fn.$$.fragment),tl=c(),At=o("h2"),gn=o("a"),Ga=o("span"),v(Ao.$$.fragment),Bc=c(),Xa=o("span"),Rc=r("MarianForCausalLM"),nl=c(),St=o("div"),v(So.$$.fragment),Gc=c(),_n=o("div"),v(Vo.$$.fragment),Xc=c(),v(Mn.$$.fragment),ol=c(),Vt=o("h2"),yn=o("a"),La=o("span"),v(Po.$$.fragment),Lc=c(),Ha=o("span"),Hc=r("TFMarianModel"),sl=c(),ce=o("div"),v(Bo.$$.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 `),Ss=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(),v(Tn.$$.fragment),sp=c(),Pe=o("div"),v(Lo.$$.fragment),ap=c(),Pt=o("p"),rp=r("The "),Vs=o("a"),lp=r("TFMarianModel"),ip=r(" forward method, overrides the "),Qa=o("code"),dp=r("__call__"),cp=r(" special method."),pp=c(),v(vn.$$.fragment),hp=c(),v(bn.$$.fragment),al=c(),Bt=o("h2"),kn=o("a"),Oa=o("span"),v(Ho.$$.fragment),up=c(),Da=o("span"),mp=r("TFMarianMTModel"),rl=c(),pe=o("div"),v(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 `),Ps=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"),vp=r("tf.keras.Model"),bp=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.`),kp=c(),v(wn.$$.fragment),wp=c(),ge=o("div"),v(Ko.$$.fragment),xp=c(),Rt=o("p"),jp=r("The "),Bs=o("a"),Jp=r("TFMarianMTModel"),$p=r(" forward method, overrides the "),Ya=o("code"),Up=r("__call__"),zp=r(" special method."),Ep=c(),v(xn.$$.fragment),Ip=c(),es=o("p"),Cp=r(`TF version of marian-nmt\u2019s transformer.h (c++). Designed for the OPUS-NMT translation checkpoints. Available
models are listed `),ts=o("a"),Fp=r("here"),Np=r("."),qp=c(),v(jn.$$.fragment),ll=c(),Gt=o("h2"),Jn=o("a"),Ka=o("span"),v(ns.$$.fragment),Wp=c(),er=o("span"),Zp=r("FlaxMarianModel"),il=c(),Q=o("div"),v(os.$$.fragment),Ap=c(),ss=o("p"),Sp=r(`The bare Marian Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),Rs=o("a"),Vp=r("FlaxPreTrainedModel"),Pp=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.)`),Bp=c(),as=o("p"),Rp=r(`This model is also a Flax Linen
`),rs=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"),ls=o("a"),Op=r("Just-In-Time (JIT) compilation"),Dp=c(),or=o("li"),is=o("a"),Yp=r("Automatic Differentiation"),Kp=c(),sr=o("li"),ds=o("a"),eh=r("Vectorization"),th=c(),ar=o("li"),cs=o("a"),nh=r("Parallelization"),oh=c(),Be=o("div"),v(ps.$$.fragment),sh=c(),Xt=o("p"),ah=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(),v($n.$$.fragment),ph=c(),v(Un.$$.fragment),dl=c(),Lt=o("h2"),zn=o("a"),ir=o("span"),v(hs.$$.fragment),hh=c(),dr=o("span"),uh=r("FlaxMarianMTModel"),cl=c(),O=o("div"),v(us.$$.fragment),mh=c(),ms=o("p"),fh=r(`The MARIAN Model with a language modeling head. Can be used for translation.
This model inherits from `),Gs=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(),fs=o("p"),yh=r(`This model is also a Flax Linen
`),gs=o("a"),Th=r("flax.nn.Module"),vh=r(` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),bh=c(),cr=o("p"),kh=r("Finally, this model supports inherent JAX features such as:"),wh=c(),dt=o("ul"),pr=o("li"),_s=o("a"),xh=r("Just-In-Time (JIT) compilation"),jh=c(),hr=o("li"),Ms=o("a"),Jh=r("Automatic Differentiation"),$h=c(),ur=o("li"),ys=o("a"),Uh=r("Vectorization"),zh=c(),mr=o("li"),Ts=o("a"),Eh=r("Parallelization"),Ih=c(),Re=o("div"),v(vs.$$.fragment),Ch=c(),Ht=o("p"),Fh=r("The "),fr=o("code"),Nh=r("FlaxMarianPreTrainedModel"),qh=r(" forward method, overrides the "),gr=o("code"),Wh=r("__call__"),Zh=r(" special method."),Ah=c(),v(En.$$.fragment),Sh=c(),v(In.$$.fragment),this.h()},l(n){const m=vf('[data-svelte="svelte-1phssyn"]',document.head);h=s(m,"META",{name:!0,content:!0}),m.forEach(t),y=p(n),_=s(n,"H1",{class:!0});var bs=a(_);g=s(bs,"A",{id:!0,class:!0,href:!0});var _r=a(g);M=s(_r,"SPAN",{});var Mr=a(M);b(i.$$.fragment,Mr),Mr.forEach(t),_r.forEach(t),u=p(bs),U=s(bs,"SPAN",{});var yr=a(U);Le=l(yr,"MarianMT"),yr.forEach(t),bs.forEach(t),Ce=p(n),W=s(n,"DIV",{class:!0});var ks=a(W);he=s(ks,"A",{href:!0});var Tr=a(he);Y=s(Tr,"IMG",{alt:!0,src:!0}),Tr.forEach(t),He=p(ks),S=s(ks,"A",{href:!0});var vr=a(S);ue=s(vr,"IMG",{alt:!0,src:!0}),vr.forEach(t),ks.forEach(t),K=p(n),P=s(n,"P",{});var Cn=a(P);_e=s(Cn,"STRONG",{});var br=a(_e);se=l(br,"Bugs:"),br.forEach(t),Qe=l(Cn," If you see something strange, file a "),ae=s(Cn,"A",{href:!0,rel:!0});var kr=a(ae);re=l(kr,"Github Issue"),kr.forEach(t),Oe=l(Cn,`
and assign @patrickvonplaten.`),Cn.forEach(t),Fe=p(n),V=s(n,"P",{});var wr=a(V);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=s(n,"P",{});var xr=a(ee);C=l(xr,"Tips:"),xr.forEach(t),q=p(n),me=s(n,"UL",{});var jr=a(me);B=s(jr,"LI",{});var Jr=a(B);Ye=l(Jr,"A framework for translation models, using the same models as BART."),Jr.forEach(t),jr.forEach(t),qe=p(n),Z=s(n,"H2",{class:!0});var ws=a(Z);te=s(ws,"A",{id:!0,class:!0,href:!0});var $r=a(te);Me=s($r,"SPAN",{});var Ur=a(Me);b(F.$$.fragment,Ur),Ur.forEach(t),$r.forEach(t),Ke=p(ws),R=s(ws,"SPAN",{});var Ph=a(R);et=l(Ph,"Implementation Notes"),Ph.forEach(t),ws.forEach(t),We=p(n),E=s(n,"UL",{});var ne=a(E);ye=s(ne,"LI",{});var Bh=a(ye);Te=s(Bh,"P",{});var Rh=a(Te);G=l(Rh,"Each model is about 298 MB on disk, there are more than 1,000 models."),Rh.forEach(t),Bh.forEach(t),tt=p(ne),X=s(ne,"LI",{});var Gh=a(X);le=s(Gh,"P",{});var hl=a(le);ve=l(hl,"The list of supported language pairs can be found "),N=s(hl,"A",{href:!0,rel:!0});var Xh=a(N);nt=l(Xh,"here"),Xh.forEach(t),A=l(hl,"."),hl.forEach(t),Gh.forEach(t),ot=p(ne),be=s(ne,"LI",{});var Lh=a(be);T=s(Lh,"P",{});var Xs=a(T);z=l(Xs,"Models were originally trained by "),ke=s(Xs,"A",{href:!0,rel:!0});var Hh=a(ke);we=l(Hh,"J\xF6rg Tiedemann"),Hh.forEach(t),_t=l(Xs," using the "),xe=s(Xs,"A",{href:!0,rel:!0});var Qh=a(xe);I=l(Qh,"Marian"),Qh.forEach(t),Mt=l(Xs," C++ library, which supports fast training and translation."),Xs.forEach(t),Lh.forEach(t),yt=p(ne),st=s(ne,"LI",{});var Oh=a(st);at=s(Oh,"P",{});var Dh=a(at);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=s(ne,"LI",{});var Yh=a(H);rt=s(Yh,"P",{});var Kh=a(rt);vt=l(Kh,"The 80 opus models that require BPE preprocessing are not supported."),Kh.forEach(t),Yh.forEach(t),ie=p(ne),je=s(ne,"LI",{});var ul=a(je);Je=s(ul,"P",{});var ml=a(Je);lt=l(ml,"The modeling code is the same as "),Ze=s(ml,"A",{href:!0});var eu=a(Ze);$e=l(eu,"BartForConditionalGeneration"),eu.forEach(t),bt=l(ml," with a few minor modifications:"),ml.forEach(t),ai=p(ul),kt=s(ul,"UL",{});var Ls=a(kt);Xn=s(Ls,"LI",{});var fl=a(Xn);ri=l(fl,"static (sinusoid) positional embeddings ("),aa=s(fl,"CODE",{});var tu=a(aa);li=l(tu,"MarianConfig.static_position_embeddings=True"),tu.forEach(t),ii=l(fl,")"),fl.forEach(t),di=p(Ls),Ln=s(Ls,"LI",{});var gl=a(Ln);ci=l(gl,"no layernorm_embedding ("),ra=s(gl,"CODE",{});var nu=a(ra);pi=l(nu,"MarianConfig.normalize_embedding=False"),nu.forEach(t),hi=l(gl,")"),gl.forEach(t),ui=p(Ls),wt=s(Ls,"LI",{});var Hs=a(wt);mi=l(Hs,"the model starts generating with "),la=s(Hs,"CODE",{});var ou=a(la);fi=l(ou,"pad_token_id"),ou.forEach(t),gi=l(Hs,` (which has 0 as a token_embedding) as the prefix (Bart uses
`),ia=s(Hs,"CODE",{});var su=a(ia);_i=l(su,"<s/>"),su.forEach(t),Mi=l(Hs,"),"),Hs.forEach(t),Ls.forEach(t),ul.forEach(t),yi=p(ne),da=s(ne,"LI",{});var au=a(da);Hn=s(au,"P",{});var _l=a(Hn);Ti=l(_l,"Code to bulk convert models can be found in "),ca=s(_l,"CODE",{});var ru=a(ca);vi=l(ru,"convert_marian_to_pytorch.py"),ru.forEach(t),bi=l(_l,"."),_l.forEach(t),au.forEach(t),ki=p(ne),pa=s(ne,"LI",{});var lu=a(pa);Qn=s(lu,"P",{});var Ml=a(Qn);wi=l(Ml,"This model was contributed by "),On=s(Ml,"A",{href:!0,rel:!0});var iu=a(On);xi=l(iu,"sshleifer"),iu.forEach(t),ji=l(Ml,"."),Ml.forEach(t),lu.forEach(t),ne.forEach(t),zr=p(n),xt=s(n,"H2",{class:!0});var yl=a(xt);Dt=s(yl,"A",{id:!0,class:!0,href:!0});var du=a(Dt);ha=s(du,"SPAN",{});var cu=a(ha);b(Dn.$$.fragment,cu),cu.forEach(t),du.forEach(t),Ji=p(yl),ua=s(yl,"SPAN",{});var pu=a(ua);$i=l(pu,"Naming"),pu.forEach(t),yl.forEach(t),Er=p(n),Ae=s(n,"UL",{});var Fn=a(Ae);xs=s(Fn,"LI",{});var Vh=a(xs);Ui=l(Vh,"All model names use the following format: "),ma=s(Vh,"CODE",{});var hu=a(ma);zi=l(hu,"Helsinki-NLP/opus-mt-{src}-{tgt}"),hu.forEach(t),Vh.forEach(t),Ei=p(Fn),Yn=s(Fn,"LI",{});var Tl=a(Yn);Ii=l(Tl,"The language codes used to name models are inconsistent. Two digit codes can usually be found "),Kn=s(Tl,"A",{href:!0,rel:!0});var uu=a(Kn);Ci=l(uu,"here"),uu.forEach(t),Fi=l(Tl,`, three digit codes require googling \u201Clanguage
code {code}\u201C.`),Tl.forEach(t),Ni=p(Fn),jt=s(Fn,"LI",{});var Qs=a(jt);qi=l(Qs,"Codes formatted like "),fa=s(Qs,"CODE",{});var mu=a(fa);Wi=l(mu,"es_AR"),mu.forEach(t),Zi=l(Qs," are usually "),ga=s(Qs,"CODE",{});var fu=a(ga);Ai=l(fu,"code_{region}"),fu.forEach(t),Si=l(Qs,". That one is Spanish from Argentina."),Qs.forEach(t),Vi=p(Fn),_a=s(Fn,"LI",{});var gu=a(_a);Pi=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),Fn.forEach(t),Ir=p(n),Jt=s(n,"H2",{class:!0});var vl=a(Jt);Yt=s(vl,"A",{id:!0,class:!0,href:!0});var _u=a(Yt);Ma=s(_u,"SPAN",{});var Mu=a(Ma);b(eo.$$.fragment,Mu),Mu.forEach(t),_u.forEach(t),Bi=p(vl),ya=s(vl,"SPAN",{});var yu=a(ya);Ri=l(yu,"Examples"),yu.forEach(t),vl.forEach(t),Cr=p(n),Kt=s(n,"UL",{});var bl=a(Kt);Ta=s(bl,"LI",{});var Tu=a(Ta);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(bl),va=s(bl,"LI",{});var vu=a(va);to=s(vu,"A",{href:!0,rel:!0});var bu=a(to);Li=l(bu,"Fine-tune on GPU"),bu.forEach(t),vu.forEach(t),bl.forEach(t),Fr=p(n),$t=s(n,"H2",{class:!0});var kl=a($t);en=s(kl,"A",{id:!0,class:!0,href:!0});var ku=a(en);ba=s(ku,"SPAN",{});var wu=a(ba);b(no.$$.fragment,wu),wu.forEach(t),ku.forEach(t),Hi=p(kl),ka=s(kl,"SPAN",{});var xu=a(ka);Qi=l(xu,"Multilingual Models"),xu.forEach(t),kl.forEach(t),Nr=p(n),Se=s(n,"UL",{});var Nn=a(Se);oo=s(Nn,"LI",{});var wl=a(oo);Oi=l(wl,"All model names use the following format: "),wa=s(wl,"CODE",{});var ju=a(wa);Di=l(ju,"Helsinki-NLP/opus-mt-{src}-{tgt}"),ju.forEach(t),Yi=l(wl,":"),wl.forEach(t),Ki=p(Nn),so=s(Nn,"LI",{});var xl=a(so);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 `),xa=s(xl,"CODE",{});var Ju=a(xa);td=l(Ju,"src_text"),Ju.forEach(t),nd=l(xl,"."),xl.forEach(t),od=p(Nn),ao=s(Nn,"LI",{});var jl=a(ao);sd=l(jl,"You can see a models\u2019s supported language codes in its model card, under target constituents, like in "),ro=s(jl,"A",{href:!0,rel:!0});var $u=a(ro);ad=l($u,"opus-mt-en-roa"),$u.forEach(t),rd=l(jl,"."),jl.forEach(t),ld=p(Nn),lo=s(Nn,"LI",{});var Jl=a(lo);id=l(Jl,"Note that if a model is only multilingual on the source side, like "),ja=s(Jl,"CODE",{});var Uu=a(ja);dd=l(Uu,"Helsinki-NLP/opus-mt-roa-en"),Uu.forEach(t),cd=l(Jl,`, no language
codes are required.`),Jl.forEach(t),Nn.forEach(t),qr=p(n),tn=s(n,"P",{});var $l=a(tn);pd=l($l,"New multi-lingual models from the "),io=s($l,"A",{href:!0,rel:!0});var zu=a(io);hd=l(zu,"Tatoeba-Challenge repo"),zu.forEach(t),ud=l($l,`
require 3 character language codes:`),$l.forEach(t),Wr=p(n),b(co.$$.fragment,n),Zr=p(n),js=s(n,"P",{});var Eu=a(js);md=l(Eu,"Here is the code to see all available pretrained models on the hub:"),Eu.forEach(t),Ar=p(n),b(po.$$.fragment,n),Sr=p(n),Ut=s(n,"H2",{class:!0});var Ul=a(Ut);nn=s(Ul,"A",{id:!0,class:!0,href:!0});var Iu=a(nn);Ja=s(Iu,"SPAN",{});var Cu=a(Ja);b(ho.$$.fragment,Cu),Cu.forEach(t),Iu.forEach(t),fd=p(Ul),$a=s(Ul,"SPAN",{});var Fu=a($a);gd=l(Fu,"Old Style Multi-Lingual Models"),Fu.forEach(t),Ul.forEach(t),Vr=p(n),Js=s(n,"P",{});var Nu=a(Js);_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),Pr=p(n),b(uo.$$.fragment,n),Br=p(n),$s=s(n,"P",{});var qu=a($s);Md=l(qu,"Example of translating english to many romance languages, using old-style 2 character language codes"),qu.forEach(t),Rr=p(n),b(mo.$$.fragment,n),Gr=p(n),zt=s(n,"H2",{class:!0});var zl=a(zt);on=s(zl,"A",{id:!0,class:!0,href:!0});var Wu=a(on);Ua=s(Wu,"SPAN",{});var Zu=a(Ua);b(fo.$$.fragment,Zu),Zu.forEach(t),Wu.forEach(t),yd=p(zl),za=s(zl,"SPAN",{});var Au=a(za);Td=l(Au,"Documentation resources"),Au.forEach(t),zl.forEach(t),Xr=p(n),pt=s(n,"UL",{});var Os=a(pt);Ea=s(Os,"LI",{});var Su=a(Ea);Us=s(Su,"A",{href:!0});var Vu=a(Us);vd=l(Vu,"Translation task guide"),Vu.forEach(t),Su.forEach(t),bd=p(Os),Ia=s(Os,"LI",{});var Pu=a(Ia);zs=s(Pu,"A",{href:!0});var Bu=a(zs);kd=l(Bu,"Summarization task guide"),Bu.forEach(t),Pu.forEach(t),wd=p(Os),Ca=s(Os,"LI",{});var Ru=a(Ca);Es=s(Ru,"A",{href:!0});var Gu=a(Es);xd=l(Gu,"Causal language modeling task guide"),Gu.forEach(t),Ru.forEach(t),Os.forEach(t),Lr=p(n),Et=s(n,"H2",{class:!0});var El=a(Et);sn=s(El,"A",{id:!0,class:!0,href:!0});var Xu=a(sn);Fa=s(Xu,"SPAN",{});var Lu=a(Fa);b(go.$$.fragment,Lu),Lu.forEach(t),Xu.forEach(t),jd=p(El),Na=s(El,"SPAN",{});var Hu=a(Na);Jd=l(Hu,"MarianConfig"),Hu.forEach(t),El.forEach(t),Hr=p(n),Ue=s(n,"DIV",{class:!0});var qn=a(Ue);b(_o.$$.fragment,qn),$d=p(qn),It=s(qn,"P",{});var Ds=a(It);Ud=l(Ds,"This is the configuration class to store the configuration of a "),Is=s(Ds,"A",{href:!0});var Qu=a(Is);zd=l(Qu,"MarianModel"),Qu.forEach(t),Ed=l(Ds,`. 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=s(Ds,"A",{href:!0,rel:!0});var Ou=a(Mo);Id=l(Ou,"Helsinki-NLP/opus-mt-en-de"),Ou.forEach(t),Cd=l(Ds," architecture."),Ds.forEach(t),Fd=p(qn),Ct=s(qn,"P",{});var Ys=a(Ct);Nd=l(Ys,"Configuration objects inherit from "),Cs=s(Ys,"A",{href:!0});var Du=a(Cs);qd=l(Du,"PretrainedConfig"),Du.forEach(t),Wd=l(Ys,` and can be used to control the model outputs. Read the
documentation from `),Fs=s(Ys,"A",{href:!0});var Yu=a(Fs);Zd=l(Yu,"PretrainedConfig"),Yu.forEach(t),Ad=l(Ys," for more information."),Ys.forEach(t),Sd=p(qn),b(an.$$.fragment,qn),qn.forEach(t),Qr=p(n),Ft=s(n,"H2",{class:!0});var Il=a(Ft);rn=s(Il,"A",{id:!0,class:!0,href:!0});var Ku=a(rn);qa=s(Ku,"SPAN",{});var em=a(qa);b(yo.$$.fragment,em),em.forEach(t),Ku.forEach(t),Vd=p(Il),Wa=s(Il,"SPAN",{});var tm=a(Wa);Pd=l(tm,"MarianTokenizer"),tm.forEach(t),Il.forEach(t),Or=p(n),de=s(n,"DIV",{class:!0});var ht=a(de);b(To.$$.fragment,ht),Bd=p(ht),vo=s(ht,"P",{});var Cl=a(vo);Rd=l(Cl,"Construct a Marian tokenizer. Based on "),bo=s(Cl,"A",{href:!0,rel:!0});var nm=a(bo);Gd=l(nm,"SentencePiece"),nm.forEach(t),Xd=l(Cl,"."),Cl.forEach(t),Ld=p(ht),ko=s(ht,"P",{});var Fl=a(ko);Hd=l(Fl,"This tokenizer inherits from "),Ns=s(Fl,"A",{href:!0});var om=a(Ns);Qd=l(om,"PreTrainedTokenizer"),om.forEach(t),Od=l(Fl,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Fl.forEach(t),Dd=p(ht),b(ln.$$.fragment,ht),Yd=p(ht),dn=s(ht,"DIV",{class:!0});var Nl=a(dn);b(wo.$$.fragment,Nl),Kd=p(Nl),Za=s(Nl,"P",{});var sm=a(Za);ec=l(sm,"Build model inputs from a sequence by appending eos_token_id."),sm.forEach(t),Nl.forEach(t),ht.forEach(t),Dr=p(n),Nt=s(n,"H2",{class:!0});var ql=a(Nt);cn=s(ql,"A",{id:!0,class:!0,href:!0});var am=a(cn);Aa=s(am,"SPAN",{});var rm=a(Aa);b(xo.$$.fragment,rm),rm.forEach(t),am.forEach(t),tc=p(ql),Sa=s(ql,"SPAN",{});var lm=a(Sa);nc=l(lm,"MarianModel"),lm.forEach(t),ql.forEach(t),Yr=p(n),ze=s(n,"DIV",{class:!0});var Wn=a(ze);b(jo.$$.fragment,Wn),oc=p(Wn),Jo=s(Wn,"P",{});var Wl=a(Jo);sc=l(Wl,`The bare Marian Model outputting raw hidden-states without any specific head on top.
This model inherits from `),qs=s(Wl,"A",{href:!0});var im=a(qs);ac=l(im,"PreTrainedModel"),im.forEach(t),rc=l(Wl,`. 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.)`),Wl.forEach(t),lc=p(Wn),$o=s(Wn,"P",{});var Zl=a($o);ic=l(Zl,"This model is also a PyTorch "),Uo=s(Zl,"A",{href:!0,rel:!0});var dm=a(Uo);dc=l(dm,"torch.nn.Module"),dm.forEach(t),cc=l(Zl,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Zl.forEach(t),pc=p(Wn),Ve=s(Wn,"DIV",{class:!0});var Zn=a(Ve);b(zo.$$.fragment,Zn),hc=p(Zn),qt=s(Zn,"P",{});var Ks=a(qt);uc=l(Ks,"The "),Ws=s(Ks,"A",{href:!0});var cm=a(Ws);mc=l(cm,"MarianModel"),cm.forEach(t),fc=l(Ks," forward method, overrides the "),Va=s(Ks,"CODE",{});var pm=a(Va);gc=l(pm,"__call__"),pm.forEach(t),_c=l(Ks," special method."),Ks.forEach(t),Mc=p(Zn),b(pn.$$.fragment,Zn),yc=p(Zn),b(hn.$$.fragment,Zn),Zn.forEach(t),Wn.forEach(t),Kr=p(n),Wt=s(n,"H2",{class:!0});var Al=a(Wt);un=s(Al,"A",{id:!0,class:!0,href:!0});var hm=a(un);Pa=s(hm,"SPAN",{});var um=a(Pa);b(Eo.$$.fragment,um),um.forEach(t),hm.forEach(t),Tc=p(Al),Ba=s(Al,"SPAN",{});var mm=a(Ba);vc=l(mm,"MarianMTModel"),mm.forEach(t),Al.forEach(t),el=p(n),Ee=s(n,"DIV",{class:!0});var An=a(Ee);b(Io.$$.fragment,An),bc=p(An),Co=s(An,"P",{});var Sl=a(Co);kc=l(Sl,`The Marian Model with a language modeling head. Can be used for summarization.
This model inherits from `),Zs=s(Sl,"A",{href:!0});var fm=a(Zs);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(An),Fo=s(An,"P",{});var Vl=a(Fo);Jc=l(Vl,"This model is also a PyTorch "),No=s(Vl,"A",{href:!0,rel:!0});var gm=a(No);$c=l(gm,"torch.nn.Module"),gm.forEach(t),Uc=l(Vl,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Vl.forEach(t),zc=p(An),fe=s(An,"DIV",{class:!0});var ut=a(fe);b(qo.$$.fragment,ut),Ec=p(ut),Zt=s(ut,"P",{});var ea=a(Zt);Ic=l(ea,"The "),As=s(ea,"A",{href:!0});var _m=a(As);Cc=l(_m,"MarianMTModel"),_m.forEach(t),Fc=l(ea," forward method, overrides the "),Ra=s(ea,"CODE",{});var Mm=a(Ra);Nc=l(Mm,"__call__"),Mm.forEach(t),qc=l(ea," special method."),ea.forEach(t),Wc=p(ut),b(mn.$$.fragment,ut),Zc=p(ut),Wo=s(ut,"P",{});var Pl=a(Wo);Ac=l(Pl,`Pytorch version of marian-nmt\u2019s transformer.h (c++). Designed for the OPUS-NMT translation checkpoints. Available
models are listed `),Zo=s(Pl,"A",{href:!0,rel:!0});var ym=a(Zo);Sc=l(ym,"here"),ym.forEach(t),Vc=l(Pl,"."),Pl.forEach(t),Pc=p(ut),b(fn.$$.fragment,ut),ut.forEach(t),An.forEach(t),tl=p(n),At=s(n,"H2",{class:!0});var Bl=a(At);gn=s(Bl,"A",{id:!0,class:!0,href:!0});var Tm=a(gn);Ga=s(Tm,"SPAN",{});var vm=a(Ga);b(Ao.$$.fragment,vm),vm.forEach(t),Tm.forEach(t),Bc=p(Bl),Xa=s(Bl,"SPAN",{});var bm=a(Xa);Rc=l(bm,"MarianForCausalLM"),bm.forEach(t),Bl.forEach(t),nl=p(n),St=s(n,"DIV",{class:!0});var Rl=a(St);b(So.$$.fragment,Rl),Gc=p(Rl),_n=s(Rl,"DIV",{class:!0});var Gl=a(_n);b(Vo.$$.fragment,Gl),Xc=p(Gl),b(Mn.$$.fragment,Gl),Gl.forEach(t),Rl.forEach(t),ol=p(n),Vt=s(n,"H2",{class:!0});var Xl=a(Vt);yn=s(Xl,"A",{id:!0,class:!0,href:!0});var km=a(yn);La=s(km,"SPAN",{});var wm=a(La);b(Po.$$.fragment,wm),wm.forEach(t),km.forEach(t),Lc=p(Xl),Ha=s(Xl,"SPAN",{});var xm=a(Ha);Hc=l(xm,"TFMarianModel"),xm.forEach(t),Xl.forEach(t),sl=p(n),ce=s(n,"DIV",{class:!0});var mt=a(ce);b(Bo.$$.fragment,mt),Qc=p(mt),Ro=s(mt,"P",{});var Ll=a(Ro);Oc=l(Ll,`The bare MARIAN Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Ss=s(Ll,"A",{href:!0});var jm=a(Ss);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=s(mt,"P",{});var Hl=a(Go);ep=l(Hl,"This model is also a "),Xo=s(Hl,"A",{href:!0,rel:!0});var Jm=a(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),b(Tn.$$.fragment,mt),sp=p(mt),Pe=s(mt,"DIV",{class:!0});var Sn=a(Pe);b(Lo.$$.fragment,Sn),ap=p(Sn),Pt=s(Sn,"P",{});var ta=a(Pt);rp=l(ta,"The "),Vs=s(ta,"A",{href:!0});var $m=a(Vs);lp=l($m,"TFMarianModel"),$m.forEach(t),ip=l(ta," forward method, overrides the "),Qa=s(ta,"CODE",{});var Um=a(Qa);dp=l(Um,"__call__"),Um.forEach(t),cp=l(ta," special method."),ta.forEach(t),pp=p(Sn),b(vn.$$.fragment,Sn),hp=p(Sn),b(bn.$$.fragment,Sn),Sn.forEach(t),mt.forEach(t),al=p(n),Bt=s(n,"H2",{class:!0});var Ql=a(Bt);kn=s(Ql,"A",{id:!0,class:!0,href:!0});var zm=a(kn);Oa=s(zm,"SPAN",{});var Em=a(Oa);b(Ho.$$.fragment,Em),Em.forEach(t),zm.forEach(t),up=p(Ql),Da=s(Ql,"SPAN",{});var Im=a(Da);mp=l(Im,"TFMarianMTModel"),Im.forEach(t),Ql.forEach(t),rl=p(n),pe=s(n,"DIV",{class:!0});var ft=a(pe);b(Qo.$$.fragment,ft),fp=p(ft),Oo=s(ft,"P",{});var Ol=a(Oo);gp=l(Ol,`The MARIAN Model with a language modeling head. Can be used for summarization.
This model inherits from `),Ps=s(Ol,"A",{href:!0});var Cm=a(Ps);_p=l(Cm,"TFPreTrainedModel"),Cm.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=s(ft,"P",{});var Dl=a(Do);Tp=l(Dl,"This model is also a "),Yo=s(Dl,"A",{href:!0,rel:!0});var Fm=a(Yo);vp=l(Fm,"tf.keras.Model"),Fm.forEach(t),bp=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),kp=p(ft),b(wn.$$.fragment,ft),wp=p(ft),ge=s(ft,"DIV",{class:!0});var gt=a(ge);b(Ko.$$.fragment,gt),xp=p(gt),Rt=s(gt,"P",{});var na=a(Rt);jp=l(na,"The "),Bs=s(na,"A",{href:!0});var Nm=a(Bs);Jp=l(Nm,"TFMarianMTModel"),Nm.forEach(t),$p=l(na," forward method, overrides the "),Ya=s(na,"CODE",{});var qm=a(Ya);Up=l(qm,"__call__"),qm.forEach(t),zp=l(na," special method."),na.forEach(t),Ep=p(gt),b(xn.$$.fragment,gt),Ip=p(gt),es=s(gt,"P",{});var Yl=a(es);Cp=l(Yl,`TF version of marian-nmt\u2019s transformer.h (c++). Designed for the OPUS-NMT translation checkpoints. Available
models are listed `),ts=s(Yl,"A",{href:!0,rel:!0});var Wm=a(ts);Fp=l(Wm,"here"),Wm.forEach(t),Np=l(Yl,"."),Yl.forEach(t),qp=p(gt),b(jn.$$.fragment,gt),gt.forEach(t),ft.forEach(t),ll=p(n),Gt=s(n,"H2",{class:!0});var Kl=a(Gt);Jn=s(Kl,"A",{id:!0,class:!0,href:!0});var Zm=a(Jn);Ka=s(Zm,"SPAN",{});var Am=a(Ka);b(ns.$$.fragment,Am),Am.forEach(t),Zm.forEach(t),Wp=p(Kl),er=s(Kl,"SPAN",{});var Sm=a(er);Zp=l(Sm,"FlaxMarianModel"),Sm.forEach(t),Kl.forEach(t),il=p(n),Q=s(n,"DIV",{class:!0});var Ge=a(Q);b(os.$$.fragment,Ge),Ap=p(Ge),ss=s(Ge,"P",{});var ei=a(ss);Sp=l(ei,`The bare Marian Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),Rs=s(ei,"A",{href:!0});var Vm=a(Rs);Vp=l(Vm,"FlaxPreTrainedModel"),Vm.forEach(t),Pp=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),Bp=p(Ge),as=s(Ge,"P",{});var ti=a(as);Rp=l(ti,`This model is also a Flax Linen
`),rs=s(ti,"A",{href:!0,rel:!0});var Pm=a(rs);Gp=l(Pm,"flax.nn.Module"),Pm.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=s(Ge,"P",{});var Bm=a(tr);Hp=l(Bm,"Finally, this model supports inherent JAX features such as:"),Bm.forEach(t),Qp=p(Ge),it=s(Ge,"UL",{});var Vn=a(it);nr=s(Vn,"LI",{});var Rm=a(nr);ls=s(Rm,"A",{href:!0,rel:!0});var Gm=a(ls);Op=l(Gm,"Just-In-Time (JIT) compilation"),Gm.forEach(t),Rm.forEach(t),Dp=p(Vn),or=s(Vn,"LI",{});var Xm=a(or);is=s(Xm,"A",{href:!0,rel:!0});var Lm=a(is);Yp=l(Lm,"Automatic Differentiation"),Lm.forEach(t),Xm.forEach(t),Kp=p(Vn),sr=s(Vn,"LI",{});var Hm=a(sr);ds=s(Hm,"A",{href:!0,rel:!0});var Qm=a(ds);eh=l(Qm,"Vectorization"),Qm.forEach(t),Hm.forEach(t),th=p(Vn),ar=s(Vn,"LI",{});var Om=a(ar);cs=s(Om,"A",{href:!0,rel:!0});var Dm=a(cs);nh=l(Dm,"Parallelization"),Dm.forEach(t),Om.forEach(t),Vn.forEach(t),oh=p(Ge),Be=s(Ge,"DIV",{class:!0});var Pn=a(Be);b(ps.$$.fragment,Pn),sh=p(Pn),Xt=s(Pn,"P",{});var oa=a(Xt);ah=l(oa,"The "),rr=s(oa,"CODE",{});var Ym=a(rr);rh=l(Ym,"FlaxMarianPreTrainedModel"),Ym.forEach(t),lh=l(oa," forward method, overrides the "),lr=s(oa,"CODE",{});var Km=a(lr);ih=l(Km,"__call__"),Km.forEach(t),dh=l(oa," special method."),oa.forEach(t),ch=p(Pn),b($n.$$.fragment,Pn),ph=p(Pn),b(Un.$$.fragment,Pn),Pn.forEach(t),Ge.forEach(t),dl=p(n),Lt=s(n,"H2",{class:!0});var ni=a(Lt);zn=s(ni,"A",{id:!0,class:!0,href:!0});var ef=a(zn);ir=s(ef,"SPAN",{});var tf=a(ir);b(hs.$$.fragment,tf),tf.forEach(t),ef.forEach(t),hh=p(ni),dr=s(ni,"SPAN",{});var nf=a(dr);uh=l(nf,"FlaxMarianMTModel"),nf.forEach(t),ni.forEach(t),cl=p(n),O=s(n,"DIV",{class:!0});var Xe=a(O);b(us.$$.fragment,Xe),mh=p(Xe),ms=s(Xe,"P",{});var oi=a(ms);fh=l(oi,`The MARIAN Model with a language modeling head. Can be used for translation.
This model inherits from `),Gs=s(oi,"A",{href:!0});var of=a(Gs);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),fs=s(Xe,"P",{});var si=a(fs);yh=l(si,`This model is also a Flax Linen
`),gs=s(si,"A",{href:!0,rel:!0});var sf=a(gs);Th=l(sf,"flax.nn.Module"),sf.forEach(t),vh=l(si,` subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`),si.forEach(t),bh=p(Xe),cr=s(Xe,"P",{});var af=a(cr);kh=l(af,"Finally, this model supports inherent JAX features such as:"),af.forEach(t),wh=p(Xe),dt=s(Xe,"UL",{});var Bn=a(dt);pr=s(Bn,"LI",{});var rf=a(pr);_s=s(rf,"A",{href:!0,rel:!0});var lf=a(_s);xh=l(lf,"Just-In-Time (JIT) compilation"),lf.forEach(t),rf.forEach(t),jh=p(Bn),hr=s(Bn,"LI",{});var df=a(hr);Ms=s(df,"A",{href:!0,rel:!0});var cf=a(Ms);Jh=l(cf,"Automatic Differentiation"),cf.forEach(t),df.forEach(t),$h=p(Bn),ur=s(Bn,"LI",{});var pf=a(ur);ys=s(pf,"A",{href:!0,rel:!0});var hf=a(ys);Uh=l(hf,"Vectorization"),hf.forEach(t),pf.forEach(t),zh=p(Bn),mr=s(Bn,"LI",{});var uf=a(mr);Ts=s(uf,"A",{href:!0,rel:!0});var mf=a(Ts);Eh=l(mf,"Parallelization"),mf.forEach(t),uf.forEach(t),Bn.forEach(t),Ih=p(Xe),Re=s(Xe,"DIV",{class:!0});var Rn=a(Re);b(vs.$$.fragment,Rn),Ch=p(Rn),Ht=s(Rn,"P",{});var sa=a(Ht);Fh=l(sa,"The "),fr=s(sa,"CODE",{});var ff=a(fr);Nh=l(ff,"FlaxMarianPreTrainedModel"),ff.forEach(t),qh=l(sa," forward method, overrides the "),gr=s(sa,"CODE",{});var gf=a(gr);Wh=l(gf,"__call__"),gf.forEach(t),Zh=l(sa," special method."),sa.forEach(t),Ah=p(Rn),b(En.$$.fragment,Rn),Sh=p(Rn),b(In.$$.fragment,Rn),Rn.forEach(t),Xe.forEach(t),this.h()},h(){d(h,"name","hf:doc:metadata"),d(h,"content",JSON.stringify(Vf)),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(W,"class","flex flex-wrap space-x-1"),d(ae,"href","https://github.com/huggingface/transformers/issues/new?assignees=sshleifer&labels=&template=bug-report.md&title"),d(ae,"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(Z,"class","relative group"),d(N,"href","https://huggingface.co/Helsinki-NLP"),d(N,"rel","nofollow"),d(ke,"href","https://researchportal.helsinki.fi/en/persons/j%C3%B6rg-tiedemann"),d(ke,"rel","nofollow"),d(xe,"href","https://marian-nmt.github.io/"),d(xe,"rel","nofollow"),d(Ze,"href","/docs/transformers/v4.31.0/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(Ut,"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(zt,"class","relative group"),d(Us,"href","../tasks/translation"),d(zs,"href","../tasks/summarization"),d(Es,"href","../tasks/language_modeling"),d(sn,"id","transformers.MarianConfig"),d(sn,"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(sn,"href","#transformers.MarianConfig"),d(Et,"class","relative group"),d(Is,"href","/docs/transformers/v4.31.0/en/model_doc/marian#transformers.MarianModel"),d(Mo,"href","https://huggingface.co/Helsinki-NLP/opus-mt-en-de"),d(Mo,"rel","nofollow"),d(Cs,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(Fs,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),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(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(Ft,"class","relative group"),d(bo,"href","https://github.com/google/sentencepiece"),d(bo,"rel","nofollow"),d(Ns,"href","/docs/transformers/v4.31.0/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(qs,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),d(Uo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Uo,"rel","nofollow"),d(Ws,"href","/docs/transformers/v4.31.0/en/model_doc/marian#transformers.MarianModel"),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(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(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(Wt,"class","relative group"),d(Zs,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),d(No,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(No,"rel","nofollow"),d(As,"href","/docs/transformers/v4.31.0/en/model_doc/marian#transformers.MarianMTModel"),d(Zo,"href","https://huggingface.co/models?search=Helsinki-NLP"),d(Zo,"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(At,"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(Vt,"class","relative group"),d(Ss,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.TFPreTrainedModel"),d(Xo,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),d(Xo,"rel","nofollow"),d(Vs,"href","/docs/transformers/v4.31.0/en/model_doc/marian#transformers.TFMarianModel"),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(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(kn,"id","transformers.TFMarianMTModel"),d(kn,"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(kn,"href","#transformers.TFMarianMTModel"),d(Bt,"class","relative group"),d(Ps,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.TFPreTrainedModel"),d(Yo,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),d(Yo,"rel","nofollow"),d(Bs,"href","/docs/transformers/v4.31.0/en/model_doc/marian#transformers.TFMarianMTModel"),d(ts,"href","https://huggingface.co/models?search=Helsinki-NLP"),d(ts,"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(Rs,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),d(rs,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),d(rs,"rel","nofollow"),d(ls,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),d(ls,"rel","nofollow"),d(is,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),d(is,"rel","nofollow"),d(ds,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),d(ds,"rel","nofollow"),d(cs,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),d(cs,"rel","nofollow"),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(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(zn,"id","transformers.FlaxMarianMTModel"),d(zn,"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(zn,"href","#transformers.FlaxMarianMTModel"),d(Lt,"class","relative group"),d(Gs,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),d(gs,"href","https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html"),d(gs,"rel","nofollow"),d(_s,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),d(_s,"rel","nofollow"),d(Ms,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),d(Ms,"rel","nofollow"),d(ys,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),d(ys,"rel","nofollow"),d(Ts,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),d(Ts,"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),k(i,M,null),e(_,u),e(_,U),e(U,Le),f(n,Ce,m),f(n,W,m),e(W,he),e(he,Y),e(W,He),e(W,S),e(S,ue),f(n,K,m),f(n,P,m),e(P,_e),e(_e,se),e(P,Qe),e(P,ae),e(ae,re),e(P,Oe),f(n,Fe,m),f(n,V,m),e(V,De),f(n,Ne,m),f(n,ee,m),e(ee,C),f(n,q,m),f(n,me,m),e(me,B),e(B,Ye),f(n,qe,m),f(n,Z,m),e(Z,te),e(te,Me),k(F,Me,null),e(Z,Ke),e(Z,R),e(R,et),f(n,We,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,ve),e(le,N),e(N,nt),e(le,A),e(E,ot),e(E,be),e(be,T),e(T,z),e(T,ke),e(ke,we),e(T,_t),e(T,xe),e(xe,I),e(T,Mt),e(E,yt),e(E,st),e(st,at),e(at,Tt),e(E,L),e(E,H),e(H,rt),e(rt,vt),e(E,ie),e(E,je),e(je,Je),e(Je,lt),e(Je,Ze),e(Ze,$e),e(Je,bt),e(je,ai),e(je,kt),e(kt,Xn),e(Xn,ri),e(Xn,aa),e(aa,li),e(Xn,ii),e(kt,di),e(kt,Ln),e(Ln,ci),e(Ln,ra),e(ra,pi),e(Ln,hi),e(kt,ui),e(kt,wt),e(wt,mi),e(wt,la),e(la,fi),e(wt,gi),e(wt,ia),e(ia,_i),e(wt,Mi),e(E,yi),e(E,da),e(da,Hn),e(Hn,Ti),e(Hn,ca),e(ca,vi),e(Hn,bi),e(E,ki),e(E,pa),e(pa,Qn),e(Qn,wi),e(Qn,On),e(On,xi),e(Qn,ji),f(n,zr,m),f(n,xt,m),e(xt,Dt),e(Dt,ha),k(Dn,ha,null),e(xt,Ji),e(xt,ua),e(ua,$i),f(n,Er,m),f(n,Ae,m),e(Ae,xs),e(xs,Ui),e(xs,ma),e(ma,zi),e(Ae,Ei),e(Ae,Yn),e(Yn,Ii),e(Yn,Kn),e(Kn,Ci),e(Yn,Fi),e(Ae,Ni),e(Ae,jt),e(jt,qi),e(jt,fa),e(fa,Wi),e(jt,Zi),e(jt,ga),e(ga,Ai),e(jt,Si),e(Ae,Vi),e(Ae,_a),e(_a,Pi),f(n,Ir,m),f(n,Jt,m),e(Jt,Yt),e(Yt,Ma),k(eo,Ma,null),e(Jt,Bi),e(Jt,ya),e(ya,Ri),f(n,Cr,m),f(n,Kt,m),e(Kt,Ta),e(Ta,Gi),e(Kt,Xi),e(Kt,va),e(va,to),e(to,Li),f(n,Fr,m),f(n,$t,m),e($t,en),e(en,ba),k(no,ba,null),e($t,Hi),e($t,ka),e(ka,Qi),f(n,Nr,m),f(n,Se,m),e(Se,oo),e(oo,Oi),e(oo,wa),e(wa,Di),e(oo,Yi),e(Se,Ki),e(Se,so),e(so,ed),e(so,xa),e(xa,td),e(so,nd),e(Se,od),e(Se,ao),e(ao,sd),e(ao,ro),e(ro,ad),e(ao,rd),e(Se,ld),e(Se,lo),e(lo,id),e(lo,ja),e(ja,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,Wr,m),k(co,n,m),f(n,Zr,m),f(n,js,m),e(js,md),f(n,Ar,m),k(po,n,m),f(n,Sr,m),f(n,Ut,m),e(Ut,nn),e(nn,Ja),k(ho,Ja,null),e(Ut,fd),e(Ut,$a),e($a,gd),f(n,Vr,m),f(n,Js,m),e(Js,_d),f(n,Pr,m),k(uo,n,m),f(n,Br,m),f(n,$s,m),e($s,Md),f(n,Rr,m),k(mo,n,m),f(n,Gr,m),f(n,zt,m),e(zt,on),e(on,Ua),k(fo,Ua,null),e(zt,yd),e(zt,za),e(za,Td),f(n,Xr,m),f(n,pt,m),e(pt,Ea),e(Ea,Us),e(Us,vd),e(pt,bd),e(pt,Ia),e(Ia,zs),e(zs,kd),e(pt,wd),e(pt,Ca),e(Ca,Es),e(Es,xd),f(n,Lr,m),f(n,Et,m),e(Et,sn),e(sn,Fa),k(go,Fa,null),e(Et,jd),e(Et,Na),e(Na,Jd),f(n,Hr,m),f(n,Ue,m),k(_o,Ue,null),e(Ue,$d),e(Ue,It),e(It,Ud),e(It,Is),e(Is,zd),e(It,Ed),e(It,Mo),e(Mo,Id),e(It,Cd),e(Ue,Fd),e(Ue,Ct),e(Ct,Nd),e(Ct,Cs),e(Cs,qd),e(Ct,Wd),e(Ct,Fs),e(Fs,Zd),e(Ct,Ad),e(Ue,Sd),k(an,Ue,null),f(n,Qr,m),f(n,Ft,m),e(Ft,rn),e(rn,qa),k(yo,qa,null),e(Ft,Vd),e(Ft,Wa),e(Wa,Pd),f(n,Or,m),f(n,de,m),k(To,de,null),e(de,Bd),e(de,vo),e(vo,Rd),e(vo,bo),e(bo,Gd),e(vo,Xd),e(de,Ld),e(de,ko),e(ko,Hd),e(ko,Ns),e(Ns,Qd),e(ko,Od),e(de,Dd),k(ln,de,null),e(de,Yd),e(de,dn),k(wo,dn,null),e(dn,Kd),e(dn,Za),e(Za,ec),f(n,Dr,m),f(n,Nt,m),e(Nt,cn),e(cn,Aa),k(xo,Aa,null),e(Nt,tc),e(Nt,Sa),e(Sa,nc),f(n,Yr,m),f(n,ze,m),k(jo,ze,null),e(ze,oc),e(ze,Jo),e(Jo,sc),e(Jo,qs),e(qs,ac),e(Jo,rc),e(ze,lc),e(ze,$o),e($o,ic),e($o,Uo),e(Uo,dc),e($o,cc),e(ze,pc),e(ze,Ve),k(zo,Ve,null),e(Ve,hc),e(Ve,qt),e(qt,uc),e(qt,Ws),e(Ws,mc),e(qt,fc),e(qt,Va),e(Va,gc),e(qt,_c),e(Ve,Mc),k(pn,Ve,null),e(Ve,yc),k(hn,Ve,null),f(n,Kr,m),f(n,Wt,m),e(Wt,un),e(un,Pa),k(Eo,Pa,null),e(Wt,Tc),e(Wt,Ba),e(Ba,vc),f(n,el,m),f(n,Ee,m),k(Io,Ee,null),e(Ee,bc),e(Ee,Co),e(Co,kc),e(Co,Zs),e(Zs,wc),e(Co,xc),e(Ee,jc),e(Ee,Fo),e(Fo,Jc),e(Fo,No),e(No,$c),e(Fo,Uc),e(Ee,zc),e(Ee,fe),k(qo,fe,null),e(fe,Ec),e(fe,Zt),e(Zt,Ic),e(Zt,As),e(As,Cc),e(Zt,Fc),e(Zt,Ra),e(Ra,Nc),e(Zt,qc),e(fe,Wc),k(mn,fe,null),e(fe,Zc),e(fe,Wo),e(Wo,Ac),e(Wo,Zo),e(Zo,Sc),e(Wo,Vc),e(fe,Pc),k(fn,fe,null),f(n,tl,m),f(n,At,m),e(At,gn),e(gn,Ga),k(Ao,Ga,null),e(At,Bc),e(At,Xa),e(Xa,Rc),f(n,nl,m),f(n,St,m),k(So,St,null),e(St,Gc),e(St,_n),k(Vo,_n,null),e(_n,Xc),k(Mn,_n,null),f(n,ol,m),f(n,Vt,m),e(Vt,yn),e(yn,La),k(Po,La,null),e(Vt,Lc),e(Vt,Ha),e(Ha,Hc),f(n,sl,m),f(n,ce,m),k(Bo,ce,null),e(ce,Qc),e(ce,Ro),e(Ro,Oc),e(Ro,Ss),e(Ss,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),k(Tn,ce,null),e(ce,sp),e(ce,Pe),k(Lo,Pe,null),e(Pe,ap),e(Pe,Pt),e(Pt,rp),e(Pt,Vs),e(Vs,lp),e(Pt,ip),e(Pt,Qa),e(Qa,dp),e(Pt,cp),e(Pe,pp),k(vn,Pe,null),e(Pe,hp),k(bn,Pe,null),f(n,al,m),f(n,Bt,m),e(Bt,kn),e(kn,Oa),k(Ho,Oa,null),e(Bt,up),e(Bt,Da),e(Da,mp),f(n,rl,m),f(n,pe,m),k(Qo,pe,null),e(pe,fp),e(pe,Oo),e(Oo,gp),e(Oo,Ps),e(Ps,_p),e(Oo,Mp),e(pe,yp),e(pe,Do),e(Do,Tp),e(Do,Yo),e(Yo,vp),e(Do,bp),e(pe,kp),k(wn,pe,null),e(pe,wp),e(pe,ge),k(Ko,ge,null),e(ge,xp),e(ge,Rt),e(Rt,jp),e(Rt,Bs),e(Bs,Jp),e(Rt,$p),e(Rt,Ya),e(Ya,Up),e(Rt,zp),e(ge,Ep),k(xn,ge,null),e(ge,Ip),e(ge,es),e(es,Cp),e(es,ts),e(ts,Fp),e(es,Np),e(ge,qp),k(jn,ge,null),f(n,ll,m),f(n,Gt,m),e(Gt,Jn),e(Jn,Ka),k(ns,Ka,null),e(Gt,Wp),e(Gt,er),e(er,Zp),f(n,il,m),f(n,Q,m),k(os,Q,null),e(Q,Ap),e(Q,ss),e(ss,Sp),e(ss,Rs),e(Rs,Vp),e(ss,Pp),e(Q,Bp),e(Q,as),e(as,Rp),e(as,rs),e(rs,Gp),e(as,Xp),e(Q,Lp),e(Q,tr),e(tr,Hp),e(Q,Qp),e(Q,it),e(it,nr),e(nr,ls),e(ls,Op),e(it,Dp),e(it,or),e(or,is),e(is,Yp),e(it,Kp),e(it,sr),e(sr,ds),e(ds,eh),e(it,th),e(it,ar),e(ar,cs),e(cs,nh),e(Q,oh),e(Q,Be),k(ps,Be,null),e(Be,sh),e(Be,Xt),e(Xt,ah),e(Xt,rr),e(rr,rh),e(Xt,lh),e(Xt,lr),e(lr,ih),e(Xt,dh),e(Be,ch),k($n,Be,null),e(Be,ph),k(Un,Be,null),f(n,dl,m),f(n,Lt,m),e(Lt,zn),e(zn,ir),k(hs,ir,null),e(Lt,hh),e(Lt,dr),e(dr,uh),f(n,cl,m),f(n,O,m),k(us,O,null),e(O,mh),e(O,ms),e(ms,fh),e(ms,Gs),e(Gs,gh),e(ms,_h),e(O,Mh),e(O,fs),e(fs,yh),e(fs,gs),e(gs,Th),e(fs,vh),e(O,bh),e(O,cr),e(cr,kh),e(O,wh),e(O,dt),e(dt,pr),e(pr,_s),e(_s,xh),e(dt,jh),e(dt,hr),e(hr,Ms),e(Ms,Jh),e(dt,$h),e(dt,ur),e(ur,ys),e(ys,Uh),e(dt,zh),e(dt,mr),e(mr,Ts),e(Ts,Eh),e(O,Ih),e(O,Re),k(vs,Re,null),e(Re,Ch),e(Re,Ht),e(Ht,Fh),e(Ht,fr),e(fr,Nh),e(Ht,qh),e(Ht,gr),e(gr,Wh),e(Ht,Zh),e(Re,Ah),k(En,Re,null),e(Re,Sh),k(In,Re,null),pl=!0},p(n,[m]){const bs={};m&2&&(bs.$$scope={dirty:m,ctx:n}),an.$set(bs);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 ks={};m&2&&(ks.$$scope={dirty:m,ctx:n}),mn.$set(ks);const Tr={};m&2&&(Tr.$$scope={dirty:m,ctx:n}),fn.$set(Tr);const vr={};m&2&&(vr.$$scope={dirty:m,ctx:n}),Mn.$set(vr);const Cn={};m&2&&(Cn.$$scope={dirty:m,ctx:n}),Tn.$set(Cn);const br={};m&2&&(br.$$scope={dirty:m,ctx:n}),vn.$set(br);const kr={};m&2&&(kr.$$scope={dirty:m,ctx:n}),bn.$set(kr);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 ws={};m&2&&(ws.$$scope={dirty:m,ctx:n}),Un.$set(ws);const $r={};m&2&&($r.$$scope={dirty:m,ctx:n}),En.$set($r);const Ur={};m&2&&(Ur.$$scope={dirty:m,ctx:n}),In.$set(Ur)},i(n){pl||(w(i.$$.fragment,n),w(F.$$.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(an.$$.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(zo.$$.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(Ao.$$.fragment,n),w(So.$$.fragment,n),w(Vo.$$.fragment,n),w(Mn.$$.fragment,n),w(Po.$$.fragment,n),w(Bo.$$.fragment,n),w(Tn.$$.fragment,n),w(Lo.$$.fragment,n),w(vn.$$.fragment,n),w(bn.$$.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(ns.$$.fragment,n),w(os.$$.fragment,n),w(ps.$$.fragment,n),w($n.$$.fragment,n),w(Un.$$.fragment,n),w(hs.$$.fragment,n),w(us.$$.fragment,n),w(vs.$$.fragment,n),w(En.$$.fragment,n),w(In.$$.fragment,n),pl=!0)},o(n){x(i.$$.fragment,n),x(F.$$.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(an.$$.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(zo.$$.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(Ao.$$.fragment,n),x(So.$$.fragment,n),x(Vo.$$.fragment,n),x(Mn.$$.fragment,n),x(Po.$$.fragment,n),x(Bo.$$.fragment,n),x(Tn.$$.fragment,n),x(Lo.$$.fragment,n),x(vn.$$.fragment,n),x(bn.$$.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(ns.$$.fragment,n),x(os.$$.fragment,n),x(ps.$$.fragment,n),x($n.$$.fragment,n),x(Un.$$.fragment,n),x(hs.$$.fragment,n),x(us.$$.fragment,n),x(vs.$$.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(Ce),n&&t(W),n&&t(K),n&&t(P),n&&t(Fe),n&&t(V),n&&t(Ne),n&&t(ee),n&&t(q),n&&t(me),n&&t(qe),n&&t(Z),j(F),n&&t(We),n&&t(E),n&&t(zr),n&&t(xt),j(Dn),n&&t(Er),n&&t(Ae),n&&t(Ir),n&&t(Jt),j(eo),n&&t(Cr),n&&t(Kt),n&&t(Fr),n&&t($t),j(no),n&&t(Nr),n&&t(Se),n&&t(qr),n&&t(tn),n&&t(Wr),j(co,n),n&&t(Zr),n&&t(js),n&&t(Ar),j(po,n),n&&t(Sr),n&&t(Ut),j(ho),n&&t(Vr),n&&t(Js),n&&t(Pr),j(uo,n),n&&t(Br),n&&t($s),n&&t(Rr),j(mo,n),n&&t(Gr),n&&t(zt),j(fo),n&&t(Xr),n&&t(pt),n&&t(Lr),n&&t(Et),j(go),n&&t(Hr),n&&t(Ue),j(_o),j(an),n&&t(Qr),n&&t(Ft),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(ze),j(jo),j(zo),j(pn),j(hn),n&&t(Kr),n&&t(Wt),j(Eo),n&&t(el),n&&t(Ee),j(Io),j(qo),j(mn),j(fn),n&&t(tl),n&&t(At),j(Ao),n&&t(nl),n&&t(St),j(So),j(Vo),j(Mn),n&&t(ol),n&&t(Vt),j(Po),n&&t(sl),n&&t(ce),j(Bo),j(Tn),j(Lo),j(vn),j(bn),n&&t(al),n&&t(Bt),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(ns),n&&t(il),n&&t(Q),j(os),j(ps),j($n),j(Un),n&&t(dl),n&&t(Lt),j(hs),n&&t(cl),n&&t(O),j(us),j(vs),j(En),j(In)}}}const Vf={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 Pf(J){return bf(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Qf extends Mf{constructor(h){super();yf(this,h,Pf,Sf,Tf,{})}}export{Qf as default,Vf as metadata};
