import{S as vf,i as kf,s as Tf,e as n,k as c,w as y,t as r,M as yf,c as s,d as t,m as p,a,x as b,h as i,b as d,N as _f,G as e,g as f,y as M,q as w,o as x,B as $,v as bf,L as Yt}from"../../chunks/vendor-hf-doc-builder.js";import{T as Bo}from"../../chunks/Tip-hf-doc-builder.js";import{D as Z}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Pe}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ne}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Jt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Mf(z){let h,k,_,g,v;return g=new Pe({props:{code:`from transformers import MarianModel, MarianConfig

# Initializing a Marian Helsinki-NLP/opus-mt-en-de style configuration
configuration = MarianConfig()

# Initializing a model from the Helsinki-NLP/opus-mt-en-de style configuration
model = MarianModel(configuration)

# Accessing the model configuration
configuration = model.config`,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=n("p"),k=r("Examples:"),_=c(),y(g.$$.fragment)},l(l){h=s(l,"P",{});var u=a(h);k=i(u,"Examples:"),u.forEach(t),_=p(l),b(g.$$.fragment,l)},m(l,u){f(l,h,u),e(h,k),f(l,_,u),M(g,l,u),v=!0},p:Yt,i(l){v||(w(g.$$.fragment,l),v=!0)},o(l){x(g.$$.fragment,l),v=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function wf(z){let h,k,_,g,v;return g=new Pe({props:{code:`from transformers import MarianForCausalLM, MarianTokenizer

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

outputs = model(**inputs)  # should work`,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=n("p"),k=r("Examples:"),_=c(),y(g.$$.fragment)},l(l){h=s(l,"P",{});var u=a(h);k=i(u,"Examples:"),u.forEach(t),_=p(l),b(g.$$.fragment,l)},m(l,u){f(l,h,u),e(h,k),f(l,_,u),M(g,l,u),v=!0},p:Yt,i(l){v||(w(g.$$.fragment,l),v=!0)},o(l){x(g.$$.fragment,l),v=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function xf(z){let h,k,_,g,v;return{c(){h=n("p"),k=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=r("Module"),v=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(l){h=s(l,"P",{});var u=a(h);k=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(u,"CODE",{});var E=a(_);g=i(E,"Module"),E.forEach(t),v=i(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(l,u){f(l,h,u),e(h,k),e(h,_),e(_,g),e(h,v)},d(l){l&&t(h)}}}function $f(z){let h,k,_,g,v;return g=new Pe({props:{code:`from transformers import AutoTokenizer, MarianModel

tokenizer = AutoTokenizer.from_pretrained("Helsinki-NLP/opus-mt-en-de")
model = MarianModel.from_pretrained("Helsinki-NLP/opus-mt-en-de")

inputs = tokenizer("Studies have been shown that owning a dog is good for you", return_tensors="pt")
decoder_inputs = tokenizer(
    "<pad> Studien haben gezeigt dass es hilfreich ist einen Hund zu besitzen",
    return_tensors="pt",
    add_special_tokens=False,
)
outputs = model(input_ids=inputs.input_ids, decoder_input_ids=decoder_inputs.input_ids)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,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=n("p"),k=r("Example:"),_=c(),y(g.$$.fragment)},l(l){h=s(l,"P",{});var u=a(h);k=i(u,"Example:"),u.forEach(t),_=p(l),b(g.$$.fragment,l)},m(l,u){f(l,h,u),e(h,k),f(l,_,u),M(g,l,u),v=!0},p:Yt,i(l){v||(w(g.$$.fragment,l),v=!0)},o(l){x(g.$$.fragment,l),v=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function zf(z){let h,k,_,g,v;return{c(){h=n("p"),k=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=r("Module"),v=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(l){h=s(l,"P",{});var u=a(h);k=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(u,"CODE",{});var E=a(_);g=i(E,"Module"),E.forEach(t),v=i(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(l,u){f(l,h,u),e(h,k),e(h,_),e(_,g),e(h,v)},d(l){l&&t(h)}}}function jf(z){let h,k,_,g,v;return g=new Pe({props:{code:`from transformers import AutoTokenizer, MarianMTModel

src = "fr"  # source language
trg = "en"  # target language

model_name = f"Helsinki-NLP/opus-mt-{src}-{trg}"
model = MarianMTModel.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)

sample_text = "o\xF9 est l'arr\xEAt de bus ?"
batch = tokenizer([sample_text], return_tensors="pt")

generated_ids = model.generate(**batch)
tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]`,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=n("p"),k=r("Examples:"),_=c(),y(g.$$.fragment)},l(l){h=s(l,"P",{});var u=a(h);k=i(u,"Examples:"),u.forEach(t),_=p(l),b(g.$$.fragment,l)},m(l,u){f(l,h,u),e(h,k),f(l,_,u),M(g,l,u),v=!0},p:Yt,i(l){v||(w(g.$$.fragment,l),v=!0)},o(l){x(g.$$.fragment,l),v=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function Ef(z){let h,k,_,g,v;return g=new Pe({props:{code:`from transformers import AutoTokenizer, MarianForCausalLM

tokenizer = AutoTokenizer.from_pretrained("Helsinki-NLP/opus-mt-fr-en")
model = MarianForCausalLM.from_pretrained("Helsinki-NLP/opus-mt-fr-en", add_cross_attention=False)
assert model.config.is_decoder, f"{model.__class__} has to be configured as a decoder."
inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

logits = outputs.logits
expected_shape = [1, inputs.input_ids.shape[-1], model.config.vocab_size]
list(logits.shape) == expected_shape`,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=n("p"),k=r("Example:"),_=c(),y(g.$$.fragment)},l(l){h=s(l,"P",{});var u=a(h);k=i(u,"Example:"),u.forEach(t),_=p(l),b(g.$$.fragment,l)},m(l,u){f(l,h,u),e(h,k),f(l,_,u),M(g,l,u),v=!0},p:Yt,i(l){v||(w(g.$$.fragment,l),v=!0)},o(l){x(g.$$.fragment,l),v=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function qf(z){let h,k,_,g,v,l,u,E,Ke,Ne,O,he,X,j,Ge,D,ue,ct,Q,U,_e,se,Je,ae,re,Ye,Ae,H,Ze,Ce,ee,N,L,me,R,Xe,Le,I,te,ve,A,Qe,W,et,Oe,F,ke,Te,B,tt,V,ie,ye,C,ot,S,nt,be;return{c(){h=n("p"),k=r("TensorFlow models and layers in "),_=n("code"),g=r("transformers"),v=r(" accept two formats as input:"),l=c(),u=n("ul"),E=n("li"),Ke=r("having all inputs as keyword arguments (like PyTorch models), or"),Ne=c(),O=n("li"),he=r("having all inputs as a list, tuple or dict in the first positional argument."),X=c(),j=n("p"),Ge=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 `),D=n("code"),ue=r("model.fit()"),ct=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=n("code"),U=r("model.fit()"),_e=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),se=n("code"),Je=r("fit()"),ae=r(" and "),re=n("code"),Ye=r("predict()"),Ae=r(`, such as when creating your own layers or models with
the Keras `),H=n("code"),Ze=r("Functional"),Ce=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ee=c(),N=n("ul"),L=n("li"),me=r("a single Tensor with "),R=n("code"),Xe=r("input_ids"),Le=r(" only and nothing else: "),I=n("code"),te=r("model(input_ids)"),ve=c(),A=n("li"),Qe=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=n("code"),et=r("model([input_ids, attention_mask])"),Oe=r(" or "),F=n("code"),ke=r("model([input_ids, attention_mask, token_type_ids])"),Te=c(),B=n("li"),tt=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),V=n("code"),ie=r('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ye=c(),C=n("p"),ot=r(`Note that when creating models and layers with
`),S=n("a"),nt=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 q=a(h);k=i(q,"TensorFlow models and layers in "),_=s(q,"CODE",{});var Me=a(_);g=i(Me,"transformers"),Me.forEach(t),v=i(q," accept two formats as input:"),q.forEach(t),l=p(T),u=s(T,"UL",{});var we=a(u);E=s(we,"LI",{});var _t=a(E);Ke=i(_t,"having all inputs as keyword arguments (like PyTorch models), or"),_t.forEach(t),Ne=p(we),O=s(we,"LI",{});var xe=a(O);he=i(xe,"having all inputs as a list, tuple or dict in the first positional argument."),xe.forEach(t),we.forEach(t),X=p(T),j=s(T,"P",{});var P=a(j);Ge=i(P,`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 `),D=s(P,"CODE",{});var vt=a(D);ue=i(vt,"model.fit()"),vt.forEach(t),ct=i(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=s(P,"CODE",{});var kt=a(Q);U=i(kt,"model.fit()"),kt.forEach(t),_e=i(P,` supports! If, however, you want to use the second
format outside of Keras methods like `),se=s(P,"CODE",{});var st=a(se);Je=i(st,"fit()"),st.forEach(t),ae=i(P," and "),re=s(P,"CODE",{});var at=a(re);Ye=i(at,"predict()"),at.forEach(t),Ae=i(P,`, such as when creating your own layers or models with
the Keras `),H=s(P,"CODE",{});var Tt=a(H);Ze=i(Tt,"Functional"),Tt.forEach(t),Ce=i(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),ee=p(T),N=s(T,"UL",{});var K=a(N);L=s(K,"LI",{});var G=a(L);me=i(G,"a single Tensor with "),R=s(G,"CODE",{});var rt=a(R);Xe=i(rt,"input_ids"),rt.forEach(t),Le=i(G," only and nothing else: "),I=s(G,"CODE",{});var yt=a(I);te=i(yt,"model(input_ids)"),yt.forEach(t),G.forEach(t),ve=p(K),A=s(K,"LI",{});var le=a(A);Qe=i(le,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=s(le,"CODE",{});var $e=a(W);et=i($e,"model([input_ids, attention_mask])"),$e.forEach(t),Oe=i(le," or "),F=s(le,"CODE",{});var ze=a(F);ke=i(ze,"model([input_ids, attention_mask, token_type_ids])"),ze.forEach(t),le.forEach(t),Te=p(K),B=s(K,"LI",{});var it=a(B);tt=i(it,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),V=s(it,"CODE",{});var Ie=a(V);ie=i(Ie,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ie.forEach(t),it.forEach(t),K.forEach(t),ye=p(T),C=s(T,"P",{});var je=a(C);ot=i(je,`Note that when creating models and layers with
`),S=s(je,"A",{href:!0,rel:!0});var bt=a(S);nt=i(bt,"subclassing"),bt.forEach(t),be=i(je,` 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!`),je.forEach(t),this.h()},h(){d(S,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),d(S,"rel","nofollow")},m(T,q){f(T,h,q),e(h,k),e(h,_),e(_,g),e(h,v),f(T,l,q),f(T,u,q),e(u,E),e(E,Ke),e(u,Ne),e(u,O),e(O,he),f(T,X,q),f(T,j,q),e(j,Ge),e(j,D),e(D,ue),e(j,ct),e(j,Q),e(Q,U),e(j,_e),e(j,se),e(se,Je),e(j,ae),e(j,re),e(re,Ye),e(j,Ae),e(j,H),e(H,Ze),e(j,Ce),f(T,ee,q),f(T,N,q),e(N,L),e(L,me),e(L,R),e(R,Xe),e(L,Le),e(L,I),e(I,te),e(N,ve),e(N,A),e(A,Qe),e(A,W),e(W,et),e(A,Oe),e(A,F),e(F,ke),e(N,Te),e(N,B),e(B,tt),e(B,V),e(V,ie),f(T,ye,q),f(T,C,q),e(C,ot),e(C,S),e(S,nt),e(C,be)},d(T){T&&t(h),T&&t(l),T&&t(u),T&&t(X),T&&t(j),T&&t(ee),T&&t(N),T&&t(ye),T&&t(C)}}}function Ff(z){let h,k,_,g,v;return{c(){h=n("p"),k=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=r("Module"),v=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(l){h=s(l,"P",{});var u=a(h);k=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(u,"CODE",{});var E=a(_);g=i(E,"Module"),E.forEach(t),v=i(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(l,u){f(l,h,u),e(h,k),e(h,_),e(_,g),e(h,v)},d(l){l&&t(h)}}}function Pf(z){let h,k,_,g,v;return g=new Pe({props:{code:`from transformers import AutoTokenizer, TFMarianModel
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("Helsinki-NLP/opus-mt-en-de")
model = TFMarianModel.from_pretrained("Helsinki-NLP/opus-mt-en-de")

inputs = tokenizer("Hello, my dog is cute", return_tensors="tf")
outputs = model(inputs)

last_hidden_states = outputs.last_hidden_state`,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=n("p"),k=r("Example:"),_=c(),y(g.$$.fragment)},l(l){h=s(l,"P",{});var u=a(h);k=i(u,"Example:"),u.forEach(t),_=p(l),b(g.$$.fragment,l)},m(l,u){f(l,h,u),e(h,k),f(l,_,u),M(g,l,u),v=!0},p:Yt,i(l){v||(w(g.$$.fragment,l),v=!0)},o(l){x(g.$$.fragment,l),v=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function Nf(z){let h,k,_,g,v,l,u,E,Ke,Ne,O,he,X,j,Ge,D,ue,ct,Q,U,_e,se,Je,ae,re,Ye,Ae,H,Ze,Ce,ee,N,L,me,R,Xe,Le,I,te,ve,A,Qe,W,et,Oe,F,ke,Te,B,tt,V,ie,ye,C,ot,S,nt,be;return{c(){h=n("p"),k=r("TensorFlow models and layers in "),_=n("code"),g=r("transformers"),v=r(" accept two formats as input:"),l=c(),u=n("ul"),E=n("li"),Ke=r("having all inputs as keyword arguments (like PyTorch models), or"),Ne=c(),O=n("li"),he=r("having all inputs as a list, tuple or dict in the first positional argument."),X=c(),j=n("p"),Ge=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 `),D=n("code"),ue=r("model.fit()"),ct=r(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=n("code"),U=r("model.fit()"),_e=r(` supports! If, however, you want to use the second
format outside of Keras methods like `),se=n("code"),Je=r("fit()"),ae=r(" and "),re=n("code"),Ye=r("predict()"),Ae=r(`, such as when creating your own layers or models with
the Keras `),H=n("code"),Ze=r("Functional"),Ce=r(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ee=c(),N=n("ul"),L=n("li"),me=r("a single Tensor with "),R=n("code"),Xe=r("input_ids"),Le=r(" only and nothing else: "),I=n("code"),te=r("model(input_ids)"),ve=c(),A=n("li"),Qe=r(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=n("code"),et=r("model([input_ids, attention_mask])"),Oe=r(" or "),F=n("code"),ke=r("model([input_ids, attention_mask, token_type_ids])"),Te=c(),B=n("li"),tt=r(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),V=n("code"),ie=r('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ye=c(),C=n("p"),ot=r(`Note that when creating models and layers with
`),S=n("a"),nt=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 q=a(h);k=i(q,"TensorFlow models and layers in "),_=s(q,"CODE",{});var Me=a(_);g=i(Me,"transformers"),Me.forEach(t),v=i(q," accept two formats as input:"),q.forEach(t),l=p(T),u=s(T,"UL",{});var we=a(u);E=s(we,"LI",{});var _t=a(E);Ke=i(_t,"having all inputs as keyword arguments (like PyTorch models), or"),_t.forEach(t),Ne=p(we),O=s(we,"LI",{});var xe=a(O);he=i(xe,"having all inputs as a list, tuple or dict in the first positional argument."),xe.forEach(t),we.forEach(t),X=p(T),j=s(T,"P",{});var P=a(j);Ge=i(P,`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 `),D=s(P,"CODE",{});var vt=a(D);ue=i(vt,"model.fit()"),vt.forEach(t),ct=i(P,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=s(P,"CODE",{});var kt=a(Q);U=i(kt,"model.fit()"),kt.forEach(t),_e=i(P,` supports! If, however, you want to use the second
format outside of Keras methods like `),se=s(P,"CODE",{});var st=a(se);Je=i(st,"fit()"),st.forEach(t),ae=i(P," and "),re=s(P,"CODE",{});var at=a(re);Ye=i(at,"predict()"),at.forEach(t),Ae=i(P,`, such as when creating your own layers or models with
the Keras `),H=s(P,"CODE",{});var Tt=a(H);Ze=i(Tt,"Functional"),Tt.forEach(t),Ce=i(P,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),P.forEach(t),ee=p(T),N=s(T,"UL",{});var K=a(N);L=s(K,"LI",{});var G=a(L);me=i(G,"a single Tensor with "),R=s(G,"CODE",{});var rt=a(R);Xe=i(rt,"input_ids"),rt.forEach(t),Le=i(G," only and nothing else: "),I=s(G,"CODE",{});var yt=a(I);te=i(yt,"model(input_ids)"),yt.forEach(t),G.forEach(t),ve=p(K),A=s(K,"LI",{});var le=a(A);Qe=i(le,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),W=s(le,"CODE",{});var $e=a(W);et=i($e,"model([input_ids, attention_mask])"),$e.forEach(t),Oe=i(le," or "),F=s(le,"CODE",{});var ze=a(F);ke=i(ze,"model([input_ids, attention_mask, token_type_ids])"),ze.forEach(t),le.forEach(t),Te=p(K),B=s(K,"LI",{});var it=a(B);tt=i(it,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),V=s(it,"CODE",{});var Ie=a(V);ie=i(Ie,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ie.forEach(t),it.forEach(t),K.forEach(t),ye=p(T),C=s(T,"P",{});var je=a(C);ot=i(je,`Note that when creating models and layers with
`),S=s(je,"A",{href:!0,rel:!0});var bt=a(S);nt=i(bt,"subclassing"),bt.forEach(t),be=i(je,` 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!`),je.forEach(t),this.h()},h(){d(S,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),d(S,"rel","nofollow")},m(T,q){f(T,h,q),e(h,k),e(h,_),e(_,g),e(h,v),f(T,l,q),f(T,u,q),e(u,E),e(E,Ke),e(u,Ne),e(u,O),e(O,he),f(T,X,q),f(T,j,q),e(j,Ge),e(j,D),e(D,ue),e(j,ct),e(j,Q),e(Q,U),e(j,_e),e(j,se),e(se,Je),e(j,ae),e(j,re),e(re,Ye),e(j,Ae),e(j,H),e(H,Ze),e(j,Ce),f(T,ee,q),f(T,N,q),e(N,L),e(L,me),e(L,R),e(R,Xe),e(L,Le),e(L,I),e(I,te),e(N,ve),e(N,A),e(A,Qe),e(A,W),e(W,et),e(A,Oe),e(A,F),e(F,ke),e(N,Te),e(N,B),e(B,tt),e(B,V),e(V,ie),f(T,ye,q),f(T,C,q),e(C,ot),e(C,S),e(S,nt),e(C,be)},d(T){T&&t(h),T&&t(l),T&&t(u),T&&t(X),T&&t(j),T&&t(ee),T&&t(N),T&&t(ye),T&&t(C)}}}function Af(z){let h,k,_,g,v;return{c(){h=n("p"),k=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=r("Module"),v=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(l){h=s(l,"P",{});var u=a(h);k=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(u,"CODE",{});var E=a(_);g=i(E,"Module"),E.forEach(t),v=i(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(l,u){f(l,h,u),e(h,k),e(h,_),e(_,g),e(h,v)},d(l){l&&t(h)}}}function Cf(z){let h,k,_,g,v;return g=new Pe({props:{code:`from transformers import AutoTokenizer, TFMarianMTModel
from typing import List

src = "fr"  # source language
trg = "en"  # target language
sample_text = "o\xF9 est l'arr\xEAt de bus ?"
model_name = f"Helsinki-NLP/opus-mt-{src}-{trg}"

model = TFMarianMTModel.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
batch = tokenizer([sample_text], return_tensors="tf")
gen = model.generate(**batch)
tokenizer.batch_decode(gen, skip_special_tokens=True)`,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=n("p"),k=r("Examples:"),_=c(),y(g.$$.fragment)},l(l){h=s(l,"P",{});var u=a(h);k=i(u,"Examples:"),u.forEach(t),_=p(l),b(g.$$.fragment,l)},m(l,u){f(l,h,u),e(h,k),f(l,_,u),M(g,l,u),v=!0},p:Yt,i(l){v||(w(g.$$.fragment,l),v=!0)},o(l){x(g.$$.fragment,l),v=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function Lf(z){let h,k,_,g,v;return{c(){h=n("p"),k=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=r("Module"),v=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(l){h=s(l,"P",{});var u=a(h);k=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(u,"CODE",{});var E=a(_);g=i(E,"Module"),E.forEach(t),v=i(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(l,u){f(l,h,u),e(h,k),e(h,_),e(_,g),e(h,v)},d(l){l&&t(h)}}}function Of(z){let h,k,_,g,v;return g=new Pe({props:{code:`from transformers import AutoTokenizer, FlaxMarianModel

tokenizer = AutoTokenizer.from_pretrained("Helsinki-NLP/opus-mt-en-de")
model = FlaxMarianModel.from_pretrained("Helsinki-NLP/opus-mt-en-de")

inputs = tokenizer("Hello, my dog is cute", return_tensors="jax")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state`,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=n("p"),k=r("Example:"),_=c(),y(g.$$.fragment)},l(l){h=s(l,"P",{});var u=a(h);k=i(u,"Example:"),u.forEach(t),_=p(l),b(g.$$.fragment,l)},m(l,u){f(l,h,u),e(h,k),f(l,_,u),M(g,l,u),v=!0},p:Yt,i(l){v||(w(g.$$.fragment,l),v=!0)},o(l){x(g.$$.fragment,l),v=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function If(z){let h,k,_,g,v;return{c(){h=n("p"),k=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=r("Module"),v=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(l){h=s(l,"P",{});var u=a(h);k=i(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(u,"CODE",{});var E=a(_);g=i(E,"Module"),E.forEach(t),v=i(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(l,u){f(l,h,u),e(h,k),e(h,_),e(_,g),e(h,v)},d(l){l&&t(h)}}}function Sf(z){let h,k,_,g,v;return g=new Pe({props:{code:`from transformers import AutoTokenizer, FlaxMarianMTModel

model = FlaxMarianMTModel.from_pretrained("Helsinki-NLP/opus-mt-en-de")
tokenizer = AutoTokenizer.from_pretrained("Helsinki-NLP/opus-mt-en-de")

text = "My friends are cool but they eat too many carbs."
input_ids = tokenizer(text, max_length=64, return_tensors="jax").input_ids

sequences = model.generate(input_ids, max_length=64, num_beams=2).sequences

outputs = tokenizer.batch_decode(sequences, skip_special_tokens=True)
# should give *Meine Freunde sind cool, aber sie essen zu viele Kohlenhydrate.*`,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=n("p"),k=r("Example:"),_=c(),y(g.$$.fragment)},l(l){h=s(l,"P",{});var u=a(h);k=i(u,"Example:"),u.forEach(t),_=p(l),b(g.$$.fragment,l)},m(l,u){f(l,h,u),e(h,k),f(l,_,u),M(g,l,u),v=!0},p:Yt,i(l){v||(w(g.$$.fragment,l),v=!0)},o(l){x(g.$$.fragment,l),v=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function Df(z){let h,k,_,g,v,l,u,E,Ke,Ne,O,he,X,j,Ge,D,ue,ct,Q,U,_e,se,Je,ae,re,Ye,Ae,H,Ze,Ce,ee,N,L,me,R,Xe,Le,I,te,ve,A,Qe,W,et,Oe,F,ke,Te,B,tt,V,ie,ye,C,ot,S,nt,be,T,q,Me,we,_t,xe,P,vt,kt,st,at,Tt,K,G,rt,yt,le,$e,ze,it,Ie,je,bt,al,Mt,Vo,rl,aa,il,ll,dl,Ko,cl,ra,pl,hl,ul,wt,ml,ia,fl,gl,la,_l,vl,kl,da,Go,Tl,ca,yl,bl,Ml,pa,Jo,wl,Yo,xl,$l,qr,xt,Zt,ha,Zo,zl,ua,jl,Fr,Se,xs,El,ma,ql,Fl,Xo,Pl,Qo,Nl,Al,Cl,$t,Ll,fa,Ol,Il,ga,Sl,Dl,Hl,_a,Ul,Pr,zt,Xt,va,en,Rl,ka,Wl,Nr,Qt,Ta,Bl,Vl,ya,tn,Kl,Ar,jt,eo,ba,on,Gl,Ma,Jl,Cr,De,nn,Yl,wa,Zl,Xl,Ql,sn,ed,xa,td,od,nd,an,sd,rn,ad,rd,id,ln,ld,$a,dd,cd,Lr,to,pd,dn,hd,ud,Or,cn,Ir,$s,md,Sr,pn,Dr,Et,oo,za,hn,fd,ja,gd,Hr,zs,_d,Ur,un,Rr,js,vd,Wr,mn,Br,qt,no,Ea,fn,kd,qa,Td,Vr,pt,Fa,Es,yd,bd,Pa,qs,Md,wd,Na,Fs,xd,Kr,Ft,so,Aa,gn,$d,Ca,zd,Gr,Ee,_n,jd,Pt,Ed,Ps,qd,Fd,vn,Pd,Nd,Ad,Nt,Cd,Ns,Ld,Od,As,Id,Sd,Dd,ao,Jr,At,ro,La,kn,Hd,Oa,Ud,Yr,de,Tn,Rd,yn,Wd,bn,Bd,Vd,Kd,Mn,Gd,Cs,Jd,Yd,Zd,io,Xd,lo,wn,Qd,Ia,ec,Zr,Ct,co,Sa,xn,tc,Da,oc,Xr,qe,$n,nc,zn,sc,Ls,ac,rc,ic,jn,lc,En,dc,cc,pc,He,qn,hc,Lt,uc,Os,mc,fc,Ha,gc,_c,vc,po,kc,ho,Qr,Ot,uo,Ua,Fn,Tc,Ra,yc,ei,Fe,Pn,bc,Nn,Mc,Is,wc,xc,$c,An,zc,Cn,jc,Ec,qc,fe,Ln,Fc,It,Pc,Ss,Nc,Ac,Wa,Cc,Lc,Oc,mo,Ic,On,Sc,In,Dc,Hc,Uc,fo,ti,St,go,Ba,Sn,Rc,Va,Wc,oi,Dt,Dn,Bc,_o,Hn,Vc,vo,ni,Ht,ko,Ka,Un,Kc,Ga,Gc,si,ce,Rn,Jc,Wn,Yc,Ds,Zc,Xc,Qc,Bn,ep,Vn,tp,op,np,To,sp,Ue,Kn,ap,Ut,rp,Hs,ip,lp,Ja,dp,cp,pp,yo,hp,bo,ai,Rt,Mo,Ya,Gn,up,Za,mp,ri,pe,Jn,fp,Yn,gp,Us,_p,vp,kp,Zn,Tp,Xn,yp,bp,Mp,wo,wp,ge,Qn,xp,Wt,$p,Rs,zp,jp,Xa,Ep,qp,Fp,xo,Pp,es,Np,ts,Ap,Cp,Lp,$o,ii,Bt,zo,Qa,os,Op,er,Ip,li,J,ns,Sp,ss,Dp,Ws,Hp,Up,Rp,as,Wp,rs,Bp,Vp,Kp,tr,Gp,Jp,lt,or,is,Yp,Zp,nr,ls,Xp,Qp,sr,ds,eh,th,ar,cs,oh,nh,Re,ps,sh,Vt,ah,rr,rh,ih,ir,lh,dh,ch,jo,ph,Eo,di,Kt,qo,lr,hs,hh,dr,uh,ci,Y,us,mh,ms,fh,Bs,gh,_h,vh,fs,kh,gs,Th,yh,bh,cr,Mh,wh,dt,pr,_s,xh,$h,hr,vs,zh,jh,ur,ks,Eh,qh,mr,Ts,Fh,Ph,We,ys,Nh,Gt,Ah,fr,Ch,Lh,gr,Oh,Ih,Sh,Fo,Dh,Po,pi;return l=new ne({}),A=new ne({}),Zo=new ne({}),en=new ne({}),on=new ne({}),cn=new Pe({props:{code:`from transformers import MarianMTModel, MarianTokenizer

src_text = [
    ">>fra<< this is a sentence in english that we want to translate to french",
    ">>por<< This should go to portuguese",
    ">>esp<< And this to Spanish",
]

model_name = "Helsinki-NLP/opus-mt-en-roa"
tokenizer = MarianTokenizer.from_pretrained(model_name)
print(tokenizer.supported_language_codes)

model = MarianMTModel.from_pretrained(model_name)
translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
[tokenizer.decode(t, skip_special_tokens=True) for t in translated]`,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>]`}}),pn=new Pe({props:{code:`from huggingface_hub import list_models

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

src_text = [
    ">>fr<< this is a sentence in english that we want to translate to french",
    ">>pt<< This should go to portuguese",
    ">>es<< And this to Spanish",
]

model_name = "Helsinki-NLP/opus-mt-en-ROMANCE"
tokenizer = MarianTokenizer.from_pretrained(model_name)

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