import{S as Ig,i as jg,s as Ng,e as n,k as c,w as v,t as a,M as qg,c as r,d as t,m as h,a as s,x as T,h as i,b as d,G as e,g as _,y as k,q as w,o as E,B as M,v as Ug,L as gn}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ke}from"../../chunks/Tip-hf-doc-builder.js";import{D as x}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Zt}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as j}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as fn}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ag($){let p,b,g,u,y;return u=new Zt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEVybmllQ29uZmlnJTJDJTIwRXJuaWVNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBFUk5JRSUyMG5naHV5b25nJTJGZXJuaWUtMy4wLWJhc2UtemglMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwRXJuaWVDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwbmdodXlvbmclMkZlcm5pZS0zLjAtYmFzZS16aCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwRXJuaWVNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ErnieConfig, ErnieModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ERNIE nghuyong/ernie-3.0-base-zh style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = ErnieConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the nghuyong/ernie-3.0-base-zh style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ErnieModel(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(){p=n("p"),b=a("Examples:"),g=c(),v(u.$$.fragment)},l(l){p=r(l,"P",{});var m=s(p);b=i(m,"Examples:"),m.forEach(t),g=h(l),T(u.$$.fragment,l)},m(l,m){_(l,p,m),e(p,b),_(l,g,m),k(u,l,m),y=!0},p:gn,i(l){y||(w(u.$$.fragment,l),y=!0)},o(l){E(u.$$.fragment,l),y=!1},d(l){l&&t(p),l&&t(g),M(u,l)}}}function Wg($){let p,b,g,u,y;return{c(){p=n("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),u=a("Module"),y=a(`
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){p=r(l,"P",{});var m=s(p);b=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var z=s(g);u=i(z,"Module"),z.forEach(t),y=i(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){_(l,p,m),e(p,b),e(p,g),e(g,u),e(p,y)},d(l){l&&t(p)}}}function Sg($){let p,b,g,u,y;return u=new Zt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBFcm5pZU1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJuZ2h1eW9uZyUyRmVybmllLTEuMC1iYXNlLXpoJTIyKSUwQW1vZGVsJTIwJTNEJTIwRXJuaWVNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIybmdodXlvbmclMkZlcm5pZS0xLjAtYmFzZS16aCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ErnieModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;nghuyong/ernie-1.0-base-zh&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ErnieModel.from_pretrained(<span class="hljs-string">&quot;nghuyong/ernie-1.0-base-zh&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>last_hidden_states = outputs.last_hidden_state`}}),{c(){p=n("p"),b=a("Example:"),g=c(),v(u.$$.fragment)},l(l){p=r(l,"P",{});var m=s(p);b=i(m,"Example:"),m.forEach(t),g=h(l),T(u.$$.fragment,l)},m(l,m){_(l,p,m),e(p,b),_(l,g,m),k(u,l,m),y=!0},p:gn,i(l){y||(w(u.$$.fragment,l),y=!0)},o(l){E(u.$$.fragment,l),y=!1},d(l){l&&t(p),l&&t(g),M(u,l)}}}function Zg($){let p,b,g,u,y;return{c(){p=n("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),u=a("Module"),y=a(`
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){p=r(l,"P",{});var m=s(p);b=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var z=s(g);u=i(z,"Module"),z.forEach(t),y=i(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){_(l,p,m),e(p,b),e(p,g),e(g,u),e(p,y)},d(l){l&&t(p)}}}function Lg($){let p,b,g,u,y;return u=new Zt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBFcm5pZUZvclByZVRyYWluaW5nJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJuZ2h1eW9uZyUyRmVybmllLTEuMC1iYXNlLXpoJTIyKSUwQW1vZGVsJTIwJTNEJTIwRXJuaWVGb3JQcmVUcmFpbmluZy5mcm9tX3ByZXRyYWluZWQoJTIybmdodXlvbmclMkZlcm5pZS0xLjAtYmFzZS16aCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQXByZWRpY3Rpb25fbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5wcmVkaWN0aW9uX2xvZ2l0cyUwQXNlcV9yZWxhdGlvbnNoaXBfbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5zZXFfcmVsYXRpb25zaGlwX2xvZ2l0cw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ErnieForPreTraining
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;nghuyong/ernie-1.0-base-zh&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ErnieForPreTraining.from_pretrained(<span class="hljs-string">&quot;nghuyong/ernie-1.0-base-zh&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>prediction_logits = outputs.prediction_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>seq_relationship_logits = outputs.seq_relationship_logits`}}),{c(){p=n("p"),b=a("Example:"),g=c(),v(u.$$.fragment)},l(l){p=r(l,"P",{});var m=s(p);b=i(m,"Example:"),m.forEach(t),g=h(l),T(u.$$.fragment,l)},m(l,m){_(l,p,m),e(p,b),_(l,g,m),k(u,l,m),y=!0},p:gn,i(l){y||(w(u.$$.fragment,l),y=!0)},o(l){E(u.$$.fragment,l),y=!1},d(l){l&&t(p),l&&t(g),M(u,l)}}}function Og($){let p,b,g,u,y;return{c(){p=n("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),u=a("Module"),y=a(`
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){p=r(l,"P",{});var m=s(p);b=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var z=s(g);u=i(z,"Module"),z.forEach(t),y=i(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){_(l,p,m),e(p,b),e(p,g),e(g,u),e(p,y)},d(l){l&&t(p)}}}function Bg($){let p,b,g,u,y;return u=new Zt({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEVybmllRm9yQ2F1c2FsTE0lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJuZ2h1eW9uZyUyRmVybmllLTEuMC1iYXNlLXpoJTIyKSUwQW1vZGVsJTIwJTNEJTIwRXJuaWVGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIybmdodXlvbmclMkZlcm5pZS0xLjAtYmFzZS16aCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzJTJDJTIwbGFiZWxzJTNEaW5wdXRzJTVCJTIyaW5wdXRfaWRzJTIyJTVEKSUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3MlMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ErnieForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;nghuyong/ernie-1.0-base-zh&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ErnieForCausalLM.from_pretrained(<span class="hljs-string">&quot;nghuyong/ernie-1.0-base-zh&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, labels=inputs[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){p=n("p"),b=a("Example:"),g=c(),v(u.$$.fragment)},l(l){p=r(l,"P",{});var m=s(p);b=i(m,"Example:"),m.forEach(t),g=h(l),T(u.$$.fragment,l)},m(l,m){_(l,p,m),e(p,b),_(l,g,m),k(u,l,m),y=!0},p:gn,i(l){y||(w(u.$$.fragment,l),y=!0)},o(l){E(u.$$.fragment,l),y=!1},d(l){l&&t(p),l&&t(g),M(u,l)}}}function Rg($){let p,b,g,u,y;return{c(){p=n("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),u=a("Module"),y=a(`
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){p=r(l,"P",{});var m=s(p);b=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var z=s(g);u=i(z,"Module"),z.forEach(t),y=i(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){_(l,p,m),e(p,b),e(p,g),e(g,u),e(p,y)},d(l){l&&t(p)}}}function Hg($){let p,b,g,u,y;return u=new Zt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBFcm5pZUZvck1hc2tlZExNJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJuZ2h1eW9uZyUyRmVybmllLTEuMC1iYXNlLXpoJTIyKSUwQW1vZGVsJTIwJTNEJTIwRXJuaWVGb3JNYXNrZWRMTS5mcm9tX3ByZXRyYWluZWQoJTIybmdodXlvbmclMkZlcm5pZS0xLjAtYmFzZS16aCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyVGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTIwaXMlMjAlNUJNQVNLJTVELiUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjByZXRyaWV2ZSUyMGluZGV4JTIwb2YlMjAlNUJNQVNLJTVEJTBBbWFza190b2tlbl9pbmRleCUyMCUzRCUyMChpbnB1dHMuaW5wdXRfaWRzJTIwJTNEJTNEJTIwdG9rZW5pemVyLm1hc2tfdG9rZW5faWQpJTVCMCU1RC5ub256ZXJvKGFzX3R1cGxlJTNEVHJ1ZSklNUIwJTVEJTBBJTBBcHJlZGljdGVkX3Rva2VuX2lkJTIwJTNEJTIwbG9naXRzJTVCMCUyQyUyMG1hc2tfdG9rZW5faW5kZXglNUQuYXJnbWF4KGF4aXMlM0QtMSklMEF0b2tlbml6ZXIuZGVjb2RlKHByZWRpY3RlZF90b2tlbl9pZCklMEElMEFsYWJlbHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyVGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTIwaXMlMjBQYXJpcy4lMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSU1QiUyMmlucHV0X2lkcyUyMiU1RCUwQSUyMyUyMG1hc2slMjBsYWJlbHMlMjBvZiUyMG5vbi0lNUJNQVNLJTVEJTIwdG9rZW5zJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2gud2hlcmUoaW5wdXRzLmlucHV0X2lkcyUyMCUzRCUzRCUyMHRva2VuaXplci5tYXNrX3Rva2VuX2lkJTJDJTIwbGFiZWxzJTJDJTIwLTEwMCklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBsYWJlbHMlM0RsYWJlbHMpJTBBcm91bmQob3V0cHV0cy5sb3NzLml0ZW0oKSUyQyUyMDIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ErnieForMaskedLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;nghuyong/ernie-1.0-base-zh&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ErnieForMaskedLM.from_pretrained(<span class="hljs-string">&quot;nghuyong/ernie-1.0-base-zh&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is [MASK].&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve index of [MASK]</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_token_index = (inputs.input_ids == tokenizer.mask_token_id)[<span class="hljs-number">0</span>].nonzero(as_tuple=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_id = logits[<span class="hljs-number">0</span>, mask_token_index].argmax(axis=-<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(predicted_token_id)
<span class="hljs-string">&#x27;paris&#x27;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(<span class="hljs-string">&quot;The capital of France is Paris.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># mask labels of non-[MASK] tokens</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.where(inputs.input_ids == tokenizer.mask_token_id, labels, -<span class="hljs-number">100</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(outputs.loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">0.88</span>`}}),{c(){p=n("p"),b=a("Example:"),g=c(),v(u.$$.fragment)},l(l){p=r(l,"P",{});var m=s(p);b=i(m,"Example:"),m.forEach(t),g=h(l),T(u.$$.fragment,l)},m(l,m){_(l,p,m),e(p,b),_(l,g,m),k(u,l,m),y=!0},p:gn,i(l){y||(w(u.$$.fragment,l),y=!0)},o(l){E(u.$$.fragment,l),y=!1},d(l){l&&t(p),l&&t(g),M(u,l)}}}function Vg($){let p,b,g,u,y;return{c(){p=n("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),u=a("Module"),y=a(`
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){p=r(l,"P",{});var m=s(p);b=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var z=s(g);u=i(z,"Module"),z.forEach(t),y=i(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){_(l,p,m),e(p,b),e(p,g),e(g,u),e(p,y)},d(l){l&&t(p)}}}function Dg($){let p,b,g,u,y;return u=new Zt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBFcm5pZUZvck5leHRTZW50ZW5jZVByZWRpY3Rpb24lMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm5naHV5b25nJTJGZXJuaWUtMS4wLWJhc2UtemglMjIpJTBBbW9kZWwlMjAlM0QlMjBFcm5pZUZvck5leHRTZW50ZW5jZVByZWRpY3Rpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm5naHV5b25nJTJGZXJuaWUtMS4wLWJhc2UtemglMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIySW4lMjBJdGFseSUyQyUyMHBpenphJTIwc2VydmVkJTIwaW4lMjBmb3JtYWwlMjBzZXR0aW5ncyUyQyUyMHN1Y2glMjBhcyUyMGF0JTIwYSUyMHJlc3RhdXJhbnQlMkMlMjBpcyUyMHByZXNlbnRlZCUyMHVuc2xpY2VkLiUyMiUwQW5leHRfc2VudGVuY2UlMjAlM0QlMjAlMjJUaGUlMjBza3klMjBpcyUyMGJsdWUlMjBkdWUlMjB0byUyMHRoZSUyMHNob3J0ZXIlMjB3YXZlbGVuZ3RoJTIwb2YlMjBibHVlJTIwbGlnaHQuJTIyJTBBZW5jb2RpbmclMjAlM0QlMjB0b2tlbml6ZXIocHJvbXB0JTJDJTIwbmV4dF9zZW50ZW5jZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqZW5jb2RpbmclMkMlMjBsYWJlbHMlM0R0b3JjaC5Mb25nVGVuc29yKCU1QjElNUQpKSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRzJTBBYXNzZXJ0JTIwbG9naXRzJTVCMCUyQyUyMDAlNUQlMjAlM0MlMjBsb2dpdHMlNUIwJTJDJTIwMSU1RCUyMCUyMCUyMyUyMG5leHQlMjBzZW50ZW5jZSUyMHdhcyUyMHJhbmRvbQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ErnieForNextSentencePrediction
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;nghuyong/ernie-1.0-base-zh&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ErnieForNextSentencePrediction.from_pretrained(<span class="hljs-string">&quot;nghuyong/ernie-1.0-base-zh&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>next_sentence = <span class="hljs-string">&quot;The sky is blue due to the shorter wavelength of blue light.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(prompt, next_sentence, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding, labels=torch.LongTensor([<span class="hljs-number">1</span>]))
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> logits[<span class="hljs-number">0</span>, <span class="hljs-number">0</span>] &lt; logits[<span class="hljs-number">0</span>, <span class="hljs-number">1</span>]  <span class="hljs-comment"># next sentence was random</span>`}}),{c(){p=n("p"),b=a("Example:"),g=c(),v(u.$$.fragment)},l(l){p=r(l,"P",{});var m=s(p);b=i(m,"Example:"),m.forEach(t),g=h(l),T(u.$$.fragment,l)},m(l,m){_(l,p,m),e(p,b),_(l,g,m),k(u,l,m),y=!0},p:gn,i(l){y||(w(u.$$.fragment,l),y=!0)},o(l){E(u.$$.fragment,l),y=!1},d(l){l&&t(p),l&&t(g),M(u,l)}}}function Gg($){let p,b,g,u,y;return{c(){p=n("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),u=a("Module"),y=a(`
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){p=r(l,"P",{});var m=s(p);b=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var z=s(g);u=i(z,"Module"),z.forEach(t),y=i(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){_(l,p,m),e(p,b),e(p,g),e(g,u),e(p,y)},d(l){l&&t(p)}}}function Xg($){let p,b,g,u,y;return{c(){p=n("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),u=a("Module"),y=a(`
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){p=r(l,"P",{});var m=s(p);b=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var z=s(g);u=i(z,"Module"),z.forEach(t),y=i(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){_(l,p,m),e(p,b),e(p,g),e(g,u),e(p,y)},d(l){l&&t(p)}}}function Qg($){let p,b,g,u,y;return u=new Zt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBFcm5pZUZvck11bHRpcGxlQ2hvaWNlJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJuZ2h1eW9uZyUyRmVybmllLTEuMC1iYXNlLXpoJTIyKSUwQW1vZGVsJTIwJTNEJTIwRXJuaWVGb3JNdWx0aXBsZUNob2ljZS5mcm9tX3ByZXRyYWluZWQoJTIybmdodXlvbmclMkZlcm5pZS0xLjAtYmFzZS16aCUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJJbiUyMEl0YWx5JTJDJTIwcGl6emElMjBzZXJ2ZWQlMjBpbiUyMGZvcm1hbCUyMHNldHRpbmdzJTJDJTIwc3VjaCUyMGFzJTIwYXQlMjBhJTIwcmVzdGF1cmFudCUyQyUyMGlzJTIwcHJlc2VudGVkJTIwdW5zbGljZWQuJTIyJTBBY2hvaWNlMCUyMCUzRCUyMCUyMkl0JTIwaXMlMjBlYXRlbiUyMHdpdGglMjBhJTIwZm9yayUyMGFuZCUyMGElMjBrbmlmZS4lMjIlMEFjaG9pY2UxJTIwJTNEJTIwJTIySXQlMjBpcyUyMGVhdGVuJTIwd2hpbGUlMjBoZWxkJTIwaW4lMjB0aGUlMjBoYW5kLiUyMiUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvcigwKS51bnNxdWVlemUoMCklMjAlMjAlMjMlMjBjaG9pY2UwJTIwaXMlMjBjb3JyZWN0JTIwKGFjY29yZGluZyUyMHRvJTIwV2lraXBlZGlhJTIwJTNCKSklMkMlMjBiYXRjaCUyMHNpemUlMjAxJTBBJTBBZW5jb2RpbmclMjAlM0QlMjB0b2tlbml6ZXIoJTVCcHJvbXB0JTJDJTIwcHJvbXB0JTVEJTJDJTIwJTVCY2hvaWNlMCUyQyUyMGNob2ljZTElNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTIwcGFkZGluZyUzRFRydWUpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqJTdCayUzQSUyMHYudW5zcXVlZXplKDApJTIwZm9yJTIwayUyQyUyMHYlMjBpbiUyMGVuY29kaW5nLml0ZW1zKCklN0QlMkMlMjBsYWJlbHMlM0RsYWJlbHMpJTIwJTIwJTIzJTIwYmF0Y2glMjBzaXplJTIwaXMlMjAxJTBBJTBBJTIzJTIwdGhlJTIwbGluZWFyJTIwY2xhc3NpZmllciUyMHN0aWxsJTIwbmVlZHMlMjB0byUyMGJlJTIwdHJhaW5lZCUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3MlMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ErnieForMultipleChoice
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;nghuyong/ernie-1.0-base-zh&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ErnieForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;nghuyong/ernie-1.0-base-zh&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice0 = <span class="hljs-string">&quot;It is eaten with a fork and a knife.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice1 = <span class="hljs-string">&quot;It is eaten while held in the hand.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor(<span class="hljs-number">0</span>).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># choice0 is correct (according to Wikipedia ;)), batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer([prompt, prompt], [choice0, choice1], 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(**{k: v.unsqueeze(<span class="hljs-number">0</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> encoding.items()}, labels=labels)  <span class="hljs-comment"># batch size is 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the linear classifier still needs to be trained</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){p=n("p"),b=a("Example:"),g=c(),v(u.$$.fragment)},l(l){p=r(l,"P",{});var m=s(p);b=i(m,"Example:"),m.forEach(t),g=h(l),T(u.$$.fragment,l)},m(l,m){_(l,p,m),e(p,b),_(l,g,m),k(u,l,m),y=!0},p:gn,i(l){y||(w(u.$$.fragment,l),y=!0)},o(l){E(u.$$.fragment,l),y=!1},d(l){l&&t(p),l&&t(g),M(u,l)}}}function Yg($){let p,b,g,u,y;return{c(){p=n("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),u=a("Module"),y=a(`
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){p=r(l,"P",{});var m=s(p);b=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var z=s(g);u=i(z,"Module"),z.forEach(t),y=i(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){_(l,p,m),e(p,b),e(p,g),e(g,u),e(p,y)},d(l){l&&t(p)}}}function Kg($){let p,b,g,u,y;return{c(){p=n("p"),b=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),u=a("Module"),y=a(`
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){p=r(l,"P",{});var m=s(p);b=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(m,"CODE",{});var z=s(g);u=i(z,"Module"),z.forEach(t),y=i(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){_(l,p,m),e(p,b),e(p,g),e(g,u),e(p,y)},d(l){l&&t(p)}}}function e_($){let p,b,g,u,y,l,m,z,Ji,_a,me,et,Xr,Lt,Ii,Qr,ji,ya,te,Ni,Ot,qi,Ui,Bt,Ai,Wi,ba,ue,tt,Yr,Rt,Si,Kr,Zi,va,Ht,Ta,fe,ot,es,Vt,Li,ts,Oi,ka,nt,os,ge,_n,Bi,Ri,yn,Hi,Vi,bn,Di,Gi,F,_e,vn,Xi,Qi,Tn,Yi,Ki,kn,ed,td,ye,wn,od,nd,En,rd,sd,Mn,ad,id,be,$n,dd,ld,zn,cd,hd,Fn,pd,md,ve,Cn,ud,fd,xn,gd,_d,Pn,yd,bd,Te,Jn,vd,Td,In,kd,wd,jn,Ed,Md,ke,Nn,$d,zd,qn,Fd,Cd,Un,xd,Pd,we,An,Jd,Id,Wn,jd,Nd,Sn,qd,Ud,Ee,Zn,Ad,Wd,Ln,Sd,Zd,On,Ld,Od,Me,Bn,Bd,Rd,Rn,Hd,Vd,Hn,Dd,Gd,$e,Vn,Xd,Qd,Dn,Yd,Kd,Gn,el,wa,H,tl,Dt,ol,nl,Gt,rl,sl,Xt,al,il,Ea,ze,rt,ns,Qt,dl,rs,ll,Ma,I,ss,Xn,cl,hl,as,Qn,pl,ml,is,Yn,ul,fl,ds,Kn,gl,_l,ls,er,yl,bl,cs,tr,vl,$a,Fe,st,hs,Yt,Tl,ps,kl,za,R,Kt,wl,ee,El,or,Ml,$l,ms,zl,Fl,eo,Cl,xl,Pl,Ce,Jl,nr,Il,jl,rr,Nl,ql,Ul,at,Fa,xe,it,us,to,Al,fs,Wl,Ca,Pe,oo,Sl,no,Zl,sr,Ll,Ol,xa,Je,dt,gs,ro,Bl,_s,Rl,Pa,P,so,Hl,ys,Vl,Dl,ao,Gl,ar,Xl,Ql,Yl,io,Kl,lo,ec,tc,oc,co,nc,ho,rc,sc,ac,J,ic,bs,dc,lc,vs,cc,hc,Ts,pc,mc,ks,uc,fc,ws,gc,_c,Es,yc,bc,vc,V,po,Tc,Ie,kc,ir,wc,Ec,Ms,Mc,$c,zc,lt,Fc,ct,Ja,je,ht,$s,mo,Cc,zs,xc,Ia,N,uo,Pc,Ne,Jc,Fs,Ic,jc,Cs,Nc,qc,Uc,fo,Ac,dr,Wc,Sc,Zc,go,Lc,_o,Oc,Bc,Rc,D,yo,Hc,qe,Vc,lr,Dc,Gc,xs,Xc,Qc,Yc,pt,Kc,mt,ja,Ue,ut,Ps,bo,eh,Js,th,Na,q,vo,oh,To,nh,Is,rh,sh,ah,ko,ih,cr,dh,lh,ch,wo,hh,Eo,ph,mh,uh,G,Mo,fh,Ae,gh,hr,_h,yh,js,bh,vh,Th,ft,kh,gt,qa,We,_t,Ns,$o,wh,qs,Eh,Ua,U,zo,Mh,Fo,$h,Us,zh,Fh,Ch,Co,xh,pr,Ph,Jh,Ih,xo,jh,Po,Nh,qh,Uh,X,Jo,Ah,Se,Wh,mr,Sh,Zh,As,Lh,Oh,Bh,yt,Rh,bt,Aa,Ze,vt,Ws,Io,Hh,Ss,Vh,Wa,A,jo,Dh,No,Gh,Zs,Xh,Qh,Yh,qo,Kh,ur,ep,tp,op,Uo,np,Ao,rp,sp,ap,Q,Wo,ip,Le,dp,fr,lp,cp,Ls,hp,pp,mp,Tt,up,kt,Sa,Oe,wt,Os,So,fp,Bs,gp,Za,W,Zo,_p,Rs,yp,bp,Lo,vp,gr,Tp,kp,wp,Oo,Ep,Bo,Mp,$p,zp,oe,Ro,Fp,Be,Cp,_r,xp,Pp,Hs,Jp,Ip,jp,Et,La,Re,Mt,Vs,Ho,Np,Ds,qp,Oa,S,Vo,Up,Gs,Ap,Wp,Do,Sp,yr,Zp,Lp,Op,Go,Bp,Xo,Rp,Hp,Vp,Y,Qo,Dp,He,Gp,br,Xp,Qp,Xs,Yp,Kp,em,$t,tm,zt,Ba,Ve,Ft,Qs,Yo,om,Ys,nm,Ra,Z,Ko,rm,Ks,sm,am,en,im,vr,dm,lm,cm,tn,hm,on,pm,mm,um,ne,nn,fm,De,gm,Tr,_m,ym,ea,bm,vm,Tm,Ct,Ha,Ge,xt,ta,rn,km,oa,wm,Va,L,sn,Em,Xe,Mm,na,$m,zm,ra,Fm,Cm,xm,an,Pm,kr,Jm,Im,jm,dn,Nm,ln,qm,Um,Am,re,cn,Wm,Qe,Sm,wr,Zm,Lm,sa,Om,Bm,Rm,Pt,Da;return l=new j({}),Lt=new j({}),Rt=new j({}),Ht=new Zt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWwlMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJuZ2h1eW9uZyUyRmVybmllLTEuMC1iYXNlLXpoJTIyKSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsLmZyb21fcHJldHJhaW5lZCglMjJuZ2h1eW9uZyUyRmVybmllLTEuMC1iYXNlLXpoJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;nghuyong/ernie-1.0-base-zh&quot;</span>)
model = AutoModel.from_pretrained(<span class="hljs-string">&quot;nghuyong/ernie-1.0-base-zh&quot;</span>)`}}),Vt=new j({}),Qt=new j({}),Yt=new j({}),Kt=new x({props:{name:"class transformers.ErnieConfig",anchor:"transformers.ErnieConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"task_type_vocab_size",val:" = 3"},{name:"use_task_id",val:" = False"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"pad_token_id",val:" = 0"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"use_cache",val:" = True"},{name:"classifier_dropout",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ErnieConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the ERNIE model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/ernie#transformers.ErnieModel">ErnieModel</a> or <code>TFErnieModel</code>.`,name:"vocab_size"},{anchor:"transformers.ErnieConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.ErnieConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.ErnieConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.ErnieConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.ErnieConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</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:"hidden_act"},{anchor:"transformers.ErnieConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</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:"hidden_dropout_prob"},{anchor:"transformers.ErnieConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.ErnieConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#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.ErnieConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/ernie#transformers.ErnieModel">ErnieModel</a> or <code>TFErnieModel</code>.`,name:"type_vocab_size"},{anchor:"transformers.ErnieConfig.task_type_vocab_size",description:`<strong>task_type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The vocabulary size of the <code>task_type_ids</code> for ERNIE2.0/ERNIE3.0 model`,name:"task_type_vocab_size"},{anchor:"transformers.ErnieConfig.use_task_id",description:`<strong>use_task_id</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the model support <code>task_type_ids</code>`,name:"use_task_id"},{anchor:"transformers.ErnieConfig.initializer_range",description:`<strong>initializer_range</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:"initializer_range"},{anchor:"transformers.ErnieConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.ErnieConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.ErnieConfig.is_decoder",description:`<strong>is_decoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the model is used as a decoder or not. If <code>False</code>, the model is used as an encoder.`,name:"is_decoder"},{anchor:"transformers.ErnieConfig.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). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.ErnieConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The dropout ratio for the classification head.`,name:"classifier_dropout"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ernie/configuration_ernie.py#L41"}}),at=new fn({props:{anchor:"transformers.ErnieConfig.example",$$slots:{default:[Ag]},$$scope:{ctx:$}}}),to=new j({}),oo=new x({props:{name:"class transformers.models.ernie.modeling_ernie.ErnieForPreTrainingOutput",anchor:"transformers.models.ernie.modeling_ernie.ErnieForPreTrainingOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prediction_logits",val:": FloatTensor = None"},{name:"seq_relationship_logits",val:": FloatTensor = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.ernie.modeling_ernie.ErnieForPreTrainingOutput.loss",description:`<strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) &#x2014;
Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.`,name:"loss"},{anchor:"transformers.models.ernie.modeling_ernie.ErnieForPreTrainingOutput.prediction_logits",description:`<strong>prediction_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).`,name:"prediction_logits"},{anchor:"transformers.models.ernie.modeling_ernie.ErnieForPreTrainingOutput.seq_relationship_logits",description:`<strong>seq_relationship_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) &#x2014;
Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
before SoftMax).`,name:"seq_relationship_logits"},{anchor:"transformers.models.ernie.modeling_ernie.ErnieForPreTrainingOutput.hidden_states",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</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 model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.ernie.modeling_ernie.ErnieForPreTrainingOutput.attentions",description:`<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>) &#x2014;
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.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ernie/modeling_ernie.py#L690"}}),ro=new j({}),so=new x({props:{name:"class transformers.ErnieModel",anchor:"transformers.ErnieModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.ErnieModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/ernie#transformers.ErnieConfig">ErnieConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ernie/modeling_ernie.py#L798"}}),po=new x({props:{name:"forward",anchor:"transformers.ErnieModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"task_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[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.ErnieModel.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ErnieModel.forward.attention_mask",description:`<strong>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 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.ErnieModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.ErnieModel.forward.task_type_ids",description:`<strong>task_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Task type embedding is a special embedding to represent the characteristic of different tasks, such as
word-aware pre-training task, structure-aware pre-training task and semantic-aware pre-training task. We
assign a <code>task_type_id</code> to each task and the <code>task_type_id</code> is in the range \`[0,
config.task_type_vocab_size-1]`,name:"task_type_ids"},{anchor:"transformers.ErnieModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</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>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ErnieModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-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.ErnieModel.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.ErnieModel.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.ErnieModel.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.ErnieModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ErnieModel.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.ErnieModel.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>:</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:"encoder_attention_mask"},{anchor:"transformers.ErnieModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up 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.ErnieModel.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ernie/modeling_ernie.py#L841",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/ernie#transformers.ErnieConfig"
>ErnieConfig</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 model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</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> and <code>config.add_cross_attention=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>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 optionally if
<code>config.is_encoder_decoder=True</code> 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 optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),lt=new Ke({props:{$$slots:{default:[Wg]},$$scope:{ctx:$}}}),ct=new fn({props:{anchor:"transformers.ErnieModel.forward.example",$$slots:{default:[Sg]},$$scope:{ctx:$}}}),mo=new j({}),uo=new x({props:{name:"class transformers.ErnieForPreTraining",anchor:"transformers.ErnieForPreTraining",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ErnieForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/ernie#transformers.ErnieConfig">ErnieConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ernie/modeling_ernie.py#L987"}}),yo=new x({props:{name:"forward",anchor:"transformers.ErnieForPreTraining.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"task_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"next_sentence_label",val:": typing.Optional[torch.Tensor] = 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.ErnieForPreTraining.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ErnieForPreTraining.forward.attention_mask",description:`<strong>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 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.ErnieForPreTraining.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.ErnieForPreTraining.forward.task_type_ids",description:`<strong>task_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Task type embedding is a special embedding to represent the characteristic of different tasks, such as
word-aware pre-training task, structure-aware pre-training task and semantic-aware pre-training task. We
assign a <code>task_type_id</code> to each task and the <code>task_type_id</code> is in the range \`[0,
config.task_type_vocab_size-1]`,name:"task_type_ids"},{anchor:"transformers.ErnieForPreTraining.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</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>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ErnieForPreTraining.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-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.ErnieForPreTraining.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.ErnieForPreTraining.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.ErnieForPreTraining.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.ErnieForPreTraining.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.</p>
<p>labels (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (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>
next_sentence_label (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>):
Labels for computing the next sequence prediction (classification) loss. Input should be a sequence
pair (see <code>input_ids</code> docstring) Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates sequence B is a continuation of sequence A,</li>
<li>1 indicates sequence B is a random sequence.
kwargs (<code>Dict[str, any]</code>, optional, defaults to <em>{}</em>):
Used to hide legacy arguments that have been deprecated.</li>
</ul>`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ernie/modeling_ernie.py#L1008",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/ernie#transformers.models.ernie.modeling_ernie.ErnieForPreTrainingOutput"
>transformers.models.ernie.modeling_ernie.ErnieForPreTrainingOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/ernie#transformers.ErnieConfig"
>ErnieConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<em>optional</em>, returned when <code>labels</code> is provided, <code>torch.FloatTensor</code> of shape <code>(1,)</code>) \u2014 Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.</p>
</li>
<li>
<p><strong>prediction_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>seq_relationship_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
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 + 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 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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/ernie#transformers.models.ernie.modeling_ernie.ErnieForPreTrainingOutput"
>transformers.models.ernie.modeling_ernie.ErnieForPreTrainingOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),pt=new Ke({props:{$$slots:{default:[Zg]},$$scope:{ctx:$}}}),mt=new fn({props:{anchor:"transformers.ErnieForPreTraining.forward.example",$$slots:{default:[Lg]},$$scope:{ctx:$}}}),bo=new j({}),vo=new x({props:{name:"class transformers.ErnieForCausalLM",anchor:"transformers.ErnieForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ErnieForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/ernie#transformers.ErnieConfig">ErnieConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ernie/modeling_ernie.py#L1098"}}),Mo=new x({props:{name:"forward",anchor:"transformers.ErnieForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"task_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.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"}],parametersDescription:[{anchor:"transformers.ErnieForCausalLM.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ErnieForCausalLM.forward.attention_mask",description:`<strong>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 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.ErnieForCausalLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.ErnieForCausalLM.forward.task_type_ids",description:`<strong>task_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Task type embedding is a special embedding to represent the characteristic of different tasks, such as
word-aware pre-training task, structure-aware pre-training task and semantic-aware pre-training task. We
assign a <code>task_type_id</code> to each task and the <code>task_type_id</code> is in the range \`[0,
config.task_type_vocab_size-1]`,name:"task_type_ids"},{anchor:"transformers.ErnieForCausalLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</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>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ErnieForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-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.ErnieForCausalLM.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.ErnieForCausalLM.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.ErnieForCausalLM.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.ErnieForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ErnieForCausalLM.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.ErnieForCausalLM.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>:</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:"encoder_attention_mask"},{anchor:"transformers.ErnieForCausalLM.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 left-to-right language modeling loss (next word prediction). Indices should be in
<code>[-100, 0, ..., config.vocab_size]</code> (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 n <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.ErnieForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up 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.ErnieForCausalLM.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ernie/modeling_ernie.py#L1122",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/ernie#transformers.ErnieConfig"
>ErnieConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ft=new Ke({props:{$$slots:{default:[Og]},$$scope:{ctx:$}}}),gt=new fn({props:{anchor:"transformers.ErnieForCausalLM.forward.example",$$slots:{default:[Bg]},$$scope:{ctx:$}}}),$o=new j({}),zo=new x({props:{name:"class transformers.ErnieForMaskedLM",anchor:"transformers.ErnieForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ErnieForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/ernie#transformers.ErnieConfig">ErnieConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ernie/modeling_ernie.py#L1244"}}),Jo=new x({props:{name:"forward",anchor:"transformers.ErnieForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"task_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = 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.ErnieForMaskedLM.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ErnieForMaskedLM.forward.attention_mask",description:`<strong>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 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.ErnieForMaskedLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.ErnieForMaskedLM.forward.task_type_ids",description:`<strong>task_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Task type embedding is a special embedding to represent the characteristic of different tasks, such as
word-aware pre-training task, structure-aware pre-training task and semantic-aware pre-training task. We
assign a <code>task_type_id</code> to each task and the <code>task_type_id</code> is in the range \`[0,
config.task_type_vocab_size-1]`,name:"task_type_ids"},{anchor:"transformers.ErnieForMaskedLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</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>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ErnieForMaskedLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-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.ErnieForMaskedLM.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.ErnieForMaskedLM.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.ErnieForMaskedLM.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.ErnieForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ErnieForMaskedLM.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 be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ernie/modeling_ernie.py#L1271",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/ernie#transformers.ErnieConfig"
>ErnieConfig</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 Masked language modeling (MLM) 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>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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),yt=new Ke({props:{$$slots:{default:[Rg]},$$scope:{ctx:$}}}),bt=new fn({props:{anchor:"transformers.ErnieForMaskedLM.forward.example",$$slots:{default:[Hg]},$$scope:{ctx:$}}}),Io=new j({}),jo=new x({props:{name:"class transformers.ErnieForNextSentencePrediction",anchor:"transformers.ErnieForNextSentencePrediction",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ErnieForNextSentencePrediction.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/ernie#transformers.ErnieConfig">ErnieConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ernie/modeling_ernie.py#L1360"}}),Wo=new x({props:{name:"forward",anchor:"transformers.ErnieForNextSentencePrediction.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"task_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = 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:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ErnieForNextSentencePrediction.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ErnieForNextSentencePrediction.forward.attention_mask",description:`<strong>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 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.ErnieForNextSentencePrediction.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.ErnieForNextSentencePrediction.forward.task_type_ids",description:`<strong>task_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Task type embedding is a special embedding to represent the characteristic of different tasks, such as
word-aware pre-training task, structure-aware pre-training task and semantic-aware pre-training task. We
assign a <code>task_type_id</code> to each task and the <code>task_type_id</code> is in the range \`[0,
config.task_type_vocab_size-1]`,name:"task_type_ids"},{anchor:"transformers.ErnieForNextSentencePrediction.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</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>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ErnieForNextSentencePrediction.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-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.ErnieForNextSentencePrediction.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.ErnieForNextSentencePrediction.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.ErnieForNextSentencePrediction.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.ErnieForNextSentencePrediction.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ErnieForNextSentencePrediction.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the next sequence prediction (classification) loss. Input should be a sequence pair
(see <code>input_ids</code> docstring). Indices should be in <code>[0, 1]</code>:</p>
<ul>
<li>0 indicates sequence B is a continuation of sequence A,</li>
<li>1 indicates sequence B is a random sequence.</li>
</ul>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ernie/modeling_ernie.py#L1371",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/ernie#transformers.ErnieConfig"
>ErnieConfig</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>next_sentence_label</code> is provided) \u2014 Next sequence prediction (classification) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>) \u2014 Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.NextSentencePredictorOutput"
>transformers.modeling_outputs.NextSentencePredictorOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Tt=new Ke({props:{$$slots:{default:[Vg]},$$scope:{ctx:$}}}),kt=new fn({props:{anchor:"transformers.ErnieForNextSentencePrediction.forward.example",$$slots:{default:[Dg]},$$scope:{ctx:$}}}),So=new j({}),Zo=new x({props:{name:"class transformers.ErnieForSequenceClassification",anchor:"transformers.ErnieForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ErnieForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/ernie#transformers.ErnieConfig">ErnieConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ernie/modeling_ernie.py#L1468"}}),Ro=new x({props:{name:"forward",anchor:"transformers.ErnieForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"task_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = 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.ErnieForSequenceClassification.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ErnieForSequenceClassification.forward.attention_mask",description:`<strong>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 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.ErnieForSequenceClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.ErnieForSequenceClassification.forward.task_type_ids",description:`<strong>task_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Task type embedding is a special embedding to represent the characteristic of different tasks, such as
word-aware pre-training task, structure-aware pre-training task and semantic-aware pre-training task. We
assign a <code>task_type_id</code> to each task and the <code>task_type_id</code> is in the range \`[0,
config.task_type_vocab_size-1]`,name:"task_type_ids"},{anchor:"transformers.ErnieForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</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>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ErnieForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-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.ErnieForSequenceClassification.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.ErnieForSequenceClassification.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.ErnieForSequenceClassification.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.ErnieForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ErnieForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ernie/modeling_ernie.py#L1485"}}),Et=new Ke({props:{$$slots:{default:[Gg]},$$scope:{ctx:$}}}),Ho=new j({}),Vo=new x({props:{name:"class transformers.ErnieForMultipleChoice",anchor:"transformers.ErnieForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ErnieForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/ernie#transformers.ErnieConfig">ErnieConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ernie/modeling_ernie.py#L1567"}}),Qo=new x({props:{name:"forward",anchor:"transformers.ErnieForMultipleChoice.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"task_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = 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.ErnieForMultipleChoice.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ErnieForMultipleChoice.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, 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.ErnieForMultipleChoice.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.ErnieForMultipleChoice.forward.task_type_ids",description:`<strong>task_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Task type embedding is a special embedding to represent the characteristic of different tasks, such as
word-aware pre-training task, structure-aware pre-training task and semantic-aware pre-training task. We
assign a <code>task_type_id</code> to each task and the <code>task_type_id</code> is in the range \`[0,
config.task_type_vocab_size-1]`,name:"task_type_ids"},{anchor:"transformers.ErnieForMultipleChoice.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, 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>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ErnieForMultipleChoice.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-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.ErnieForMultipleChoice.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, 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.ErnieForMultipleChoice.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.ErnieForMultipleChoice.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.ErnieForMultipleChoice.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ErnieForMultipleChoice.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices-1]</code> where <code>num_choices</code> is the size of the second dimension of the input tensors. (See
<code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ernie/modeling_ernie.py#L1582",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/ernie#transformers.ErnieConfig"
>ErnieConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <em>(1,)</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$t=new Ke({props:{$$slots:{default:[Xg]},$$scope:{ctx:$}}}),zt=new fn({props:{anchor:"transformers.ErnieForMultipleChoice.forward.example",$$slots:{default:[Qg]},$$scope:{ctx:$}}}),Yo=new j({}),Ko=new x({props:{name:"class transformers.ErnieForTokenClassification",anchor:"transformers.ErnieForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ErnieForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/ernie#transformers.ErnieConfig">ErnieConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ernie/modeling_ernie.py#L1664"}}),nn=new x({props:{name:"forward",anchor:"transformers.ErnieForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"task_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = 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.ErnieForTokenClassification.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ErnieForTokenClassification.forward.attention_mask",description:`<strong>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 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.ErnieForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.ErnieForTokenClassification.forward.task_type_ids",description:`<strong>task_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Task type embedding is a special embedding to represent the characteristic of different tasks, such as
word-aware pre-training task, structure-aware pre-training task and semantic-aware pre-training task. We
assign a <code>task_type_id</code> to each task and the <code>task_type_id</code> is in the range \`[0,
config.task_type_vocab_size-1]`,name:"task_type_ids"},{anchor:"transformers.ErnieForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</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>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ErnieForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-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.ErnieForTokenClassification.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.ErnieForTokenClassification.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.ErnieForTokenClassification.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.ErnieForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ErnieForTokenClassification.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 token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ernie/modeling_ernie.py#L1680"}}),Ct=new Ke({props:{$$slots:{default:[Yg]},$$scope:{ctx:$}}}),rn=new j({}),sn=new x({props:{name:"class transformers.ErnieForQuestionAnswering",anchor:"transformers.ErnieForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ErnieForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/ernie#transformers.ErnieConfig">ErnieConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ernie/modeling_ernie.py#L1743"}}),cn=new x({props:{name:"forward",anchor:"transformers.ErnieForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"task_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"start_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"end_positions",val:": typing.Optional[torch.Tensor] = 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.ErnieForQuestionAnswering.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ErnieForQuestionAnswering.forward.attention_mask",description:`<strong>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 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.ErnieForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.ErnieForQuestionAnswering.forward.task_type_ids",description:`<strong>task_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Task type embedding is a special embedding to represent the characteristic of different tasks, such as
word-aware pre-training task, structure-aware pre-training task and semantic-aware pre-training task. We
assign a <code>task_type_id</code> to each task and the <code>task_type_id</code> is in the range \`[0,
config.task_type_vocab_size-1]`,name:"task_type_ids"},{anchor:"transformers.ErnieForQuestionAnswering.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</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>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ErnieForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-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.ErnieForQuestionAnswering.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.ErnieForQuestionAnswering.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.ErnieForQuestionAnswering.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.ErnieForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ErnieForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.ErnieForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/ernie/modeling_ernie.py#L1755"}}),Pt=new Ke({props:{$$slots:{default:[Kg]},$$scope:{ctx:$}}}),{c(){p=n("meta"),b=c(),g=n("h1"),u=n("a"),y=n("span"),v(l.$$.fragment),m=c(),z=n("span"),Ji=a("ERNIE"),_a=c(),me=n("h2"),et=n("a"),Xr=n("span"),v(Lt.$$.fragment),Ii=c(),Qr=n("span"),ji=a("Overview"),ya=a(`

ERNIE is a series of powerful models proposed by baidu, especially in Chinese tasks,
including [ERNIE1.0](https://arxiv.org/abs/1904.09223), [ERNIE2.0](https://ojs.aaai.org/index.php/AAAI/article/view/6428),
[ERNIE3.0](https://arxiv.org/abs/2107.02137), [ERNIE-Gram](https://arxiv.org/abs/2010.12148), [ERNIE-health](https://arxiv.org/abs/2110.07244), etc.
`),te=n("p"),Ni=a("These models are contributed by "),Ot=n("a"),qi=a("nghuyong"),Ui=a(" and the official code can be found in "),Bt=n("a"),Ai=a("PaddleNLP"),Wi=a(" (in PaddlePaddle)."),ba=c(),ue=n("h3"),tt=n("a"),Yr=n("span"),v(Rt.$$.fragment),Si=c(),Kr=n("span"),Zi=a("How to use"),va=a(`

Take \`ernie-1.0-base-zh\` as an example:

	`),v(Ht.$$.fragment),Ta=c(),fe=n("h3"),ot=n("a"),es=n("span"),v(Vt.$$.fragment),Li=c(),ts=n("span"),Oi=a("Supported Models"),ka=c(),nt=n("table"),os=n("thead"),ge=n("tr"),_n=n("th"),Bi=a("Model Name"),Ri=c(),yn=n("th"),Hi=a("Language"),Vi=c(),bn=n("th"),Di=a("Description"),Gi=c(),F=n("tbody"),_e=n("tr"),vn=n("td"),Xi=a("ernie-1.0-base-zh"),Qi=c(),Tn=n("td"),Yi=a("Chinese"),Ki=c(),kn=n("td"),ed=a("Layer:12, Heads:12, Hidden:768"),td=c(),ye=n("tr"),wn=n("td"),od=a("ernie-2.0-base-en"),nd=c(),En=n("td"),rd=a("English"),sd=c(),Mn=n("td"),ad=a("Layer:12, Heads:12, Hidden:768"),id=c(),be=n("tr"),$n=n("td"),dd=a("ernie-2.0-large-en"),ld=c(),zn=n("td"),cd=a("English"),hd=c(),Fn=n("td"),pd=a("Layer:24, Heads:16, Hidden:1024"),md=c(),ve=n("tr"),Cn=n("td"),ud=a("ernie-3.0-base-zh"),fd=c(),xn=n("td"),gd=a("Chinese"),_d=c(),Pn=n("td"),yd=a("Layer:12, Heads:12, Hidden:768"),bd=c(),Te=n("tr"),Jn=n("td"),vd=a("ernie-3.0-medium-zh"),Td=c(),In=n("td"),kd=a("Chinese"),wd=c(),jn=n("td"),Ed=a("Layer:6, Heads:12, Hidden:768"),Md=c(),ke=n("tr"),Nn=n("td"),$d=a("ernie-3.0-mini-zh"),zd=c(),qn=n("td"),Fd=a("Chinese"),Cd=c(),Un=n("td"),xd=a("Layer:6, Heads:12, Hidden:384"),Pd=c(),we=n("tr"),An=n("td"),Jd=a("ernie-3.0-micro-zh"),Id=c(),Wn=n("td"),jd=a("Chinese"),Nd=c(),Sn=n("td"),qd=a("Layer:4, Heads:12, Hidden:384"),Ud=c(),Ee=n("tr"),Zn=n("td"),Ad=a("ernie-3.0-nano-zh"),Wd=c(),Ln=n("td"),Sd=a("Chinese"),Zd=c(),On=n("td"),Ld=a("Layer:4, Heads:12, Hidden:312"),Od=c(),Me=n("tr"),Bn=n("td"),Bd=a("ernie-health-zh"),Rd=c(),Rn=n("td"),Hd=a("Chinese"),Vd=c(),Hn=n("td"),Dd=a("Layer:12, Heads:12, Hidden:768"),Gd=c(),$e=n("tr"),Vn=n("td"),Xd=a("ernie-gram-zh"),Qd=c(),Dn=n("td"),Yd=a("Chinese"),Kd=c(),Gn=n("td"),el=a("Layer:12, Heads:12, Hidden:768"),wa=c(),H=n("p"),tl=a("You can find all the supported models from huggingface\u2019s model hub: "),Dt=n("a"),ol=a("huggingface.co/nghuyong"),nl=a(`, and model details from paddle\u2019s official
repo: `),Gt=n("a"),rl=a("PaddleNLP"),sl=a(`
and `),Xt=n("a"),al=a("ERNIE"),il=a("."),Ea=c(),ze=n("h2"),rt=n("a"),ns=n("span"),v(Qt.$$.fragment),dl=c(),rs=n("span"),ll=a("Documentation resources"),Ma=c(),I=n("ul"),ss=n("li"),Xn=n("a"),cl=a("Text classification task guide"),hl=c(),as=n("li"),Qn=n("a"),pl=a("Token classification task guide"),ml=c(),is=n("li"),Yn=n("a"),ul=a("Question answering task guide"),fl=c(),ds=n("li"),Kn=n("a"),gl=a("Causal language modeling task guide"),_l=c(),ls=n("li"),er=n("a"),yl=a("Masked language modeling task guide"),bl=c(),cs=n("li"),tr=n("a"),vl=a("Multiple choice task guide"),$a=c(),Fe=n("h2"),st=n("a"),hs=n("span"),v(Yt.$$.fragment),Tl=c(),ps=n("span"),kl=a("ErnieConfig"),za=c(),R=n("div"),v(Kt.$$.fragment),wl=c(),ee=n("p"),El=a("This is the configuration class to store the configuration of a "),or=n("a"),Ml=a("ErnieModel"),$l=a(" or a "),ms=n("code"),zl=a("TFErnieModel"),Fl=a(`. It is used to
instantiate a ERNIE 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 ERNIE
`),eo=n("a"),Cl=a("nghuyong/ernie-3.0-base-zh"),xl=a(" architecture."),Pl=c(),Ce=n("p"),Jl=a("Configuration objects inherit from "),nr=n("a"),Il=a("PretrainedConfig"),jl=a(` and can be used to control the model outputs. Read the
documentation from `),rr=n("a"),Nl=a("PretrainedConfig"),ql=a(" for more information."),Ul=c(),v(at.$$.fragment),Fa=c(),xe=n("h2"),it=n("a"),us=n("span"),v(to.$$.fragment),Al=c(),fs=n("span"),Wl=a("Ernie specific outputs"),Ca=c(),Pe=n("div"),v(oo.$$.fragment),Sl=c(),no=n("p"),Zl=a("Output type of "),sr=n("a"),Ll=a("ErnieForPreTraining"),Ol=a("."),xa=c(),Je=n("h2"),dt=n("a"),gs=n("span"),v(ro.$$.fragment),Bl=c(),_s=n("span"),Rl=a("ErnieModel"),Pa=c(),P=n("div"),v(so.$$.fragment),Hl=c(),ys=n("p"),Vl=a("The bare Ernie Model transformer outputting raw hidden-states without any specific head on top."),Dl=c(),ao=n("p"),Gl=a("This model inherits from "),ar=n("a"),Xl=a("PreTrainedModel"),Ql=a(`. 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.)`),Yl=c(),io=n("p"),Kl=a("This model is also a PyTorch "),lo=n("a"),ec=a("torch.nn.Module"),tc=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),oc=c(),co=n("p"),nc=a(`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),ho=n("a"),rc=a(`Attention is
all you need`),sc=a(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),ac=c(),J=n("p"),ic=a("To behave as an decoder the model needs to be initialized with the "),bs=n("code"),dc=a("is_decoder"),lc=a(` argument of the configuration set
to `),vs=n("code"),cc=a("True"),hc=a(". To be used in a Seq2Seq model, the model needs to initialized with both "),Ts=n("code"),pc=a("is_decoder"),mc=a(` argument and
`),ks=n("code"),uc=a("add_cross_attention"),fc=a(" set to "),ws=n("code"),gc=a("True"),_c=a("; an "),Es=n("code"),yc=a("encoder_hidden_states"),bc=a(" is then expected as an input to the forward pass."),vc=c(),V=n("div"),v(po.$$.fragment),Tc=c(),Ie=n("p"),kc=a("The "),ir=n("a"),wc=a("ErnieModel"),Ec=a(" forward method, overrides the "),Ms=n("code"),Mc=a("__call__"),$c=a(" special method."),zc=c(),v(lt.$$.fragment),Fc=c(),v(ct.$$.fragment),Ja=c(),je=n("h2"),ht=n("a"),$s=n("span"),v(mo.$$.fragment),Cc=c(),zs=n("span"),xc=a("ErnieForPreTraining"),Ia=c(),N=n("div"),v(uo.$$.fragment),Pc=c(),Ne=n("p"),Jc=a("Ernie Model with two heads on top as done during the pretraining: a "),Fs=n("code"),Ic=a("masked language modeling"),jc=a(" head and a "),Cs=n("code"),Nc=a("next sentence prediction (classification)"),qc=a(" head."),Uc=c(),fo=n("p"),Ac=a("This model inherits from "),dr=n("a"),Wc=a("PreTrainedModel"),Sc=a(`. 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.)`),Zc=c(),go=n("p"),Lc=a("This model is also a PyTorch "),_o=n("a"),Oc=a("torch.nn.Module"),Bc=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Rc=c(),D=n("div"),v(yo.$$.fragment),Hc=c(),qe=n("p"),Vc=a("The "),lr=n("a"),Dc=a("ErnieForPreTraining"),Gc=a(" forward method, overrides the "),xs=n("code"),Xc=a("__call__"),Qc=a(" special method."),Yc=c(),v(pt.$$.fragment),Kc=c(),v(mt.$$.fragment),ja=c(),Ue=n("h2"),ut=n("a"),Ps=n("span"),v(bo.$$.fragment),eh=c(),Js=n("span"),th=a("ErnieForCausalLM"),Na=c(),q=n("div"),v(vo.$$.fragment),oh=c(),To=n("p"),nh=a("Ernie Model with a "),Is=n("code"),rh=a("language modeling"),sh=a(" head on top for CLM fine-tuning."),ah=c(),ko=n("p"),ih=a("This model inherits from "),cr=n("a"),dh=a("PreTrainedModel"),lh=a(`. 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.)`),ch=c(),wo=n("p"),hh=a("This model is also a PyTorch "),Eo=n("a"),ph=a("torch.nn.Module"),mh=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),uh=c(),G=n("div"),v(Mo.$$.fragment),fh=c(),Ae=n("p"),gh=a("The "),hr=n("a"),_h=a("ErnieForCausalLM"),yh=a(" forward method, overrides the "),js=n("code"),bh=a("__call__"),vh=a(" special method."),Th=c(),v(ft.$$.fragment),kh=c(),v(gt.$$.fragment),qa=c(),We=n("h2"),_t=n("a"),Ns=n("span"),v($o.$$.fragment),wh=c(),qs=n("span"),Eh=a("ErnieForMaskedLM"),Ua=c(),U=n("div"),v(zo.$$.fragment),Mh=c(),Fo=n("p"),$h=a("Ernie Model with a "),Us=n("code"),zh=a("language modeling"),Fh=a(" head on top."),Ch=c(),Co=n("p"),xh=a("This model inherits from "),pr=n("a"),Ph=a("PreTrainedModel"),Jh=a(`. 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.)`),Ih=c(),xo=n("p"),jh=a("This model is also a PyTorch "),Po=n("a"),Nh=a("torch.nn.Module"),qh=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Uh=c(),X=n("div"),v(Jo.$$.fragment),Ah=c(),Se=n("p"),Wh=a("The "),mr=n("a"),Sh=a("ErnieForMaskedLM"),Zh=a(" forward method, overrides the "),As=n("code"),Lh=a("__call__"),Oh=a(" special method."),Bh=c(),v(yt.$$.fragment),Rh=c(),v(bt.$$.fragment),Aa=c(),Ze=n("h2"),vt=n("a"),Ws=n("span"),v(Io.$$.fragment),Hh=c(),Ss=n("span"),Vh=a("ErnieForNextSentencePrediction"),Wa=c(),A=n("div"),v(jo.$$.fragment),Dh=c(),No=n("p"),Gh=a("Ernie Model with a "),Zs=n("code"),Xh=a("next sentence prediction (classification)"),Qh=a(" head on top."),Yh=c(),qo=n("p"),Kh=a("This model inherits from "),ur=n("a"),ep=a("PreTrainedModel"),tp=a(`. 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.)`),op=c(),Uo=n("p"),np=a("This model is also a PyTorch "),Ao=n("a"),rp=a("torch.nn.Module"),sp=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ap=c(),Q=n("div"),v(Wo.$$.fragment),ip=c(),Le=n("p"),dp=a("The "),fr=n("a"),lp=a("ErnieForNextSentencePrediction"),cp=a(" forward method, overrides the "),Ls=n("code"),hp=a("__call__"),pp=a(" special method."),mp=c(),v(Tt.$$.fragment),up=c(),v(kt.$$.fragment),Sa=c(),Oe=n("h2"),wt=n("a"),Os=n("span"),v(So.$$.fragment),fp=c(),Bs=n("span"),gp=a("ErnieForSequenceClassification"),Za=c(),W=n("div"),v(Zo.$$.fragment),_p=c(),Rs=n("p"),yp=a(`Ernie Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),bp=c(),Lo=n("p"),vp=a("This model inherits from "),gr=n("a"),Tp=a("PreTrainedModel"),kp=a(`. 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.)`),wp=c(),Oo=n("p"),Ep=a("This model is also a PyTorch "),Bo=n("a"),Mp=a("torch.nn.Module"),$p=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),zp=c(),oe=n("div"),v(Ro.$$.fragment),Fp=c(),Be=n("p"),Cp=a("The "),_r=n("a"),xp=a("ErnieForSequenceClassification"),Pp=a(" forward method, overrides the "),Hs=n("code"),Jp=a("__call__"),Ip=a(" special method."),jp=c(),v(Et.$$.fragment),La=c(),Re=n("h2"),Mt=n("a"),Vs=n("span"),v(Ho.$$.fragment),Np=c(),Ds=n("span"),qp=a("ErnieForMultipleChoice"),Oa=c(),S=n("div"),v(Vo.$$.fragment),Up=c(),Gs=n("p"),Ap=a(`Ernie Model with a multiple choice classification head on top (a linear layer on top of the pooled output and a
softmax) e.g. for RocStories/SWAG tasks.`),Wp=c(),Do=n("p"),Sp=a("This model inherits from "),yr=n("a"),Zp=a("PreTrainedModel"),Lp=a(`. 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.)`),Op=c(),Go=n("p"),Bp=a("This model is also a PyTorch "),Xo=n("a"),Rp=a("torch.nn.Module"),Hp=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Vp=c(),Y=n("div"),v(Qo.$$.fragment),Dp=c(),He=n("p"),Gp=a("The "),br=n("a"),Xp=a("ErnieForMultipleChoice"),Qp=a(" forward method, overrides the "),Xs=n("code"),Yp=a("__call__"),Kp=a(" special method."),em=c(),v($t.$$.fragment),tm=c(),v(zt.$$.fragment),Ba=c(),Ve=n("h2"),Ft=n("a"),Qs=n("span"),v(Yo.$$.fragment),om=c(),Ys=n("span"),nm=a("ErnieForTokenClassification"),Ra=c(),Z=n("div"),v(Ko.$$.fragment),rm=c(),Ks=n("p"),sm=a(`Ernie Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),am=c(),en=n("p"),im=a("This model inherits from "),vr=n("a"),dm=a("PreTrainedModel"),lm=a(`. 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.)`),cm=c(),tn=n("p"),hm=a("This model is also a PyTorch "),on=n("a"),pm=a("torch.nn.Module"),mm=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),um=c(),ne=n("div"),v(nn.$$.fragment),fm=c(),De=n("p"),gm=a("The "),Tr=n("a"),_m=a("ErnieForTokenClassification"),ym=a(" forward method, overrides the "),ea=n("code"),bm=a("__call__"),vm=a(" special method."),Tm=c(),v(Ct.$$.fragment),Ha=c(),Ge=n("h2"),xt=n("a"),ta=n("span"),v(rn.$$.fragment),km=c(),oa=n("span"),wm=a("ErnieForQuestionAnswering"),Va=c(),L=n("div"),v(sn.$$.fragment),Em=c(),Xe=n("p"),Mm=a(`Ernie Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layers on top of the hidden-states output to compute `),na=n("code"),$m=a("span start logits"),zm=a(" and "),ra=n("code"),Fm=a("span end logits"),Cm=a(")."),xm=c(),an=n("p"),Pm=a("This model inherits from "),kr=n("a"),Jm=a("PreTrainedModel"),Im=a(`. 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.)`),jm=c(),dn=n("p"),Nm=a("This model is also a PyTorch "),ln=n("a"),qm=a("torch.nn.Module"),Um=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Am=c(),re=n("div"),v(cn.$$.fragment),Wm=c(),Qe=n("p"),Sm=a("The "),wr=n("a"),Zm=a("ErnieForQuestionAnswering"),Lm=a(" forward method, overrides the "),sa=n("code"),Om=a("__call__"),Bm=a(" special method."),Rm=c(),v(Pt.$$.fragment),this.h()},l(o){const f=qg('[data-svelte="svelte-1phssyn"]',document.head);p=r(f,"META",{name:!0,content:!0}),f.forEach(t),b=h(o),g=r(o,"H1",{class:!0});var hn=s(g);u=r(hn,"A",{id:!0,class:!0,href:!0});var aa=s(u);y=r(aa,"SPAN",{});var ia=s(y);T(l.$$.fragment,ia),ia.forEach(t),aa.forEach(t),m=h(hn),z=r(hn,"SPAN",{});var da=s(z);Ji=i(da,"ERNIE"),da.forEach(t),hn.forEach(t),_a=h(o),me=r(o,"H2",{class:!0});var pn=s(me);et=r(pn,"A",{id:!0,class:!0,href:!0});var la=s(et);Xr=r(la,"SPAN",{});var ca=s(Xr);T(Lt.$$.fragment,ca),ca.forEach(t),la.forEach(t),Ii=h(pn),Qr=r(pn,"SPAN",{});var ha=s(Qr);ji=i(ha,"Overview"),ha.forEach(t),pn.forEach(t),ya=i(o,`

ERNIE is a series of powerful models proposed by baidu, especially in Chinese tasks,
including [ERNIE1.0](https://arxiv.org/abs/1904.09223), [ERNIE2.0](https://ojs.aaai.org/index.php/AAAI/article/view/6428),
[ERNIE3.0](https://arxiv.org/abs/2107.02137), [ERNIE-Gram](https://arxiv.org/abs/2010.12148), [ERNIE-health](https://arxiv.org/abs/2110.07244), etc.
`),te=r(o,"P",{});var Ye=s(te);Ni=i(Ye,"These models are contributed by "),Ot=r(Ye,"A",{href:!0,rel:!0});var pa=s(Ot);qi=i(pa,"nghuyong"),pa.forEach(t),Ui=i(Ye," and the official code can be found in "),Bt=r(Ye,"A",{href:!0,rel:!0});var ma=s(Bt);Ai=i(ma,"PaddleNLP"),ma.forEach(t),Wi=i(Ye," (in PaddlePaddle)."),Ye.forEach(t),ba=h(o),ue=r(o,"H3",{class:!0});var mn=s(ue);tt=r(mn,"A",{id:!0,class:!0,href:!0});var ua=s(tt);Yr=r(ua,"SPAN",{});var fa=s(Yr);T(Rt.$$.fragment,fa),fa.forEach(t),ua.forEach(t),Si=h(mn),Kr=r(mn,"SPAN",{});var ga=s(Kr);Zi=i(ga,"How to use"),ga.forEach(t),mn.forEach(t),va=i(o,`

Take \`ernie-1.0-base-zh\` as an example:

	`),T(Ht.$$.fragment,o),Ta=h(o),fe=r(o,"H3",{class:!0});var un=s(fe);ot=r(un,"A",{id:!0,class:!0,href:!0});var Hm=s(ot);es=r(Hm,"SPAN",{});var Vm=s(es);T(Vt.$$.fragment,Vm),Vm.forEach(t),Hm.forEach(t),Li=h(un),ts=r(un,"SPAN",{});var Dm=s(ts);Oi=i(Dm,"Supported Models"),Dm.forEach(t),un.forEach(t),ka=h(o),nt=r(o,"TABLE",{});var Ga=s(nt);os=r(Ga,"THEAD",{});var Gm=s(os);ge=r(Gm,"TR",{});var Er=s(ge);_n=r(Er,"TH",{align:!0});var Xm=s(_n);Bi=i(Xm,"Model Name"),Xm.forEach(t),Ri=h(Er),yn=r(Er,"TH",{align:!0});var Qm=s(yn);Hi=i(Qm,"Language"),Qm.forEach(t),Vi=h(Er),bn=r(Er,"TH",{align:!0});var Ym=s(bn);Di=i(Ym,"Description"),Ym.forEach(t),Er.forEach(t),Gm.forEach(t),Gi=h(Ga),F=r(Ga,"TBODY",{});var C=s(F);_e=r(C,"TR",{});var Mr=s(_e);vn=r(Mr,"TD",{align:!0});var Km=s(vn);Xi=i(Km,"ernie-1.0-base-zh"),Km.forEach(t),Qi=h(Mr),Tn=r(Mr,"TD",{align:!0});var eu=s(Tn);Yi=i(eu,"Chinese"),eu.forEach(t),Ki=h(Mr),kn=r(Mr,"TD",{align:!0});var tu=s(kn);ed=i(tu,"Layer:12, Heads:12, Hidden:768"),tu.forEach(t),Mr.forEach(t),td=h(C),ye=r(C,"TR",{});var $r=s(ye);wn=r($r,"TD",{align:!0});var ou=s(wn);od=i(ou,"ernie-2.0-base-en"),ou.forEach(t),nd=h($r),En=r($r,"TD",{align:!0});var nu=s(En);rd=i(nu,"English"),nu.forEach(t),sd=h($r),Mn=r($r,"TD",{align:!0});var ru=s(Mn);ad=i(ru,"Layer:12, Heads:12, Hidden:768"),ru.forEach(t),$r.forEach(t),id=h(C),be=r(C,"TR",{});var zr=s(be);$n=r(zr,"TD",{align:!0});var su=s($n);dd=i(su,"ernie-2.0-large-en"),su.forEach(t),ld=h(zr),zn=r(zr,"TD",{align:!0});var au=s(zn);cd=i(au,"English"),au.forEach(t),hd=h(zr),Fn=r(zr,"TD",{align:!0});var iu=s(Fn);pd=i(iu,"Layer:24, Heads:16, Hidden:1024"),iu.forEach(t),zr.forEach(t),md=h(C),ve=r(C,"TR",{});var Fr=s(ve);Cn=r(Fr,"TD",{align:!0});var du=s(Cn);ud=i(du,"ernie-3.0-base-zh"),du.forEach(t),fd=h(Fr),xn=r(Fr,"TD",{align:!0});var lu=s(xn);gd=i(lu,"Chinese"),lu.forEach(t),_d=h(Fr),Pn=r(Fr,"TD",{align:!0});var cu=s(Pn);yd=i(cu,"Layer:12, Heads:12, Hidden:768"),cu.forEach(t),Fr.forEach(t),bd=h(C),Te=r(C,"TR",{});var Cr=s(Te);Jn=r(Cr,"TD",{align:!0});var hu=s(Jn);vd=i(hu,"ernie-3.0-medium-zh"),hu.forEach(t),Td=h(Cr),In=r(Cr,"TD",{align:!0});var pu=s(In);kd=i(pu,"Chinese"),pu.forEach(t),wd=h(Cr),jn=r(Cr,"TD",{align:!0});var mu=s(jn);Ed=i(mu,"Layer:6, Heads:12, Hidden:768"),mu.forEach(t),Cr.forEach(t),Md=h(C),ke=r(C,"TR",{});var xr=s(ke);Nn=r(xr,"TD",{align:!0});var uu=s(Nn);$d=i(uu,"ernie-3.0-mini-zh"),uu.forEach(t),zd=h(xr),qn=r(xr,"TD",{align:!0});var fu=s(qn);Fd=i(fu,"Chinese"),fu.forEach(t),Cd=h(xr),Un=r(xr,"TD",{align:!0});var gu=s(Un);xd=i(gu,"Layer:6, Heads:12, Hidden:384"),gu.forEach(t),xr.forEach(t),Pd=h(C),we=r(C,"TR",{});var Pr=s(we);An=r(Pr,"TD",{align:!0});var _u=s(An);Jd=i(_u,"ernie-3.0-micro-zh"),_u.forEach(t),Id=h(Pr),Wn=r(Pr,"TD",{align:!0});var yu=s(Wn);jd=i(yu,"Chinese"),yu.forEach(t),Nd=h(Pr),Sn=r(Pr,"TD",{align:!0});var bu=s(Sn);qd=i(bu,"Layer:4, Heads:12, Hidden:384"),bu.forEach(t),Pr.forEach(t),Ud=h(C),Ee=r(C,"TR",{});var Jr=s(Ee);Zn=r(Jr,"TD",{align:!0});var vu=s(Zn);Ad=i(vu,"ernie-3.0-nano-zh"),vu.forEach(t),Wd=h(Jr),Ln=r(Jr,"TD",{align:!0});var Tu=s(Ln);Sd=i(Tu,"Chinese"),Tu.forEach(t),Zd=h(Jr),On=r(Jr,"TD",{align:!0});var ku=s(On);Ld=i(ku,"Layer:4, Heads:12, Hidden:312"),ku.forEach(t),Jr.forEach(t),Od=h(C),Me=r(C,"TR",{});var Ir=s(Me);Bn=r(Ir,"TD",{align:!0});var wu=s(Bn);Bd=i(wu,"ernie-health-zh"),wu.forEach(t),Rd=h(Ir),Rn=r(Ir,"TD",{align:!0});var Eu=s(Rn);Hd=i(Eu,"Chinese"),Eu.forEach(t),Vd=h(Ir),Hn=r(Ir,"TD",{align:!0});var Mu=s(Hn);Dd=i(Mu,"Layer:12, Heads:12, Hidden:768"),Mu.forEach(t),Ir.forEach(t),Gd=h(C),$e=r(C,"TR",{});var jr=s($e);Vn=r(jr,"TD",{align:!0});var $u=s(Vn);Xd=i($u,"ernie-gram-zh"),$u.forEach(t),Qd=h(jr),Dn=r(jr,"TD",{align:!0});var zu=s(Dn);Yd=i(zu,"Chinese"),zu.forEach(t),Kd=h(jr),Gn=r(jr,"TD",{align:!0});var Fu=s(Gn);el=i(Fu,"Layer:12, Heads:12, Hidden:768"),Fu.forEach(t),jr.forEach(t),C.forEach(t),Ga.forEach(t),wa=h(o),H=r(o,"P",{});var Jt=s(H);tl=i(Jt,"You can find all the supported models from huggingface\u2019s model hub: "),Dt=r(Jt,"A",{href:!0,rel:!0});var Cu=s(Dt);ol=i(Cu,"huggingface.co/nghuyong"),Cu.forEach(t),nl=i(Jt,`, and model details from paddle\u2019s official
repo: `),Gt=r(Jt,"A",{href:!0,rel:!0});var xu=s(Gt);rl=i(xu,"PaddleNLP"),xu.forEach(t),sl=i(Jt,`
and `),Xt=r(Jt,"A",{href:!0,rel:!0});var Pu=s(Xt);al=i(Pu,"ERNIE"),Pu.forEach(t),il=i(Jt,"."),Jt.forEach(t),Ea=h(o),ze=r(o,"H2",{class:!0});var Xa=s(ze);rt=r(Xa,"A",{id:!0,class:!0,href:!0});var Ju=s(rt);ns=r(Ju,"SPAN",{});var Iu=s(ns);T(Qt.$$.fragment,Iu),Iu.forEach(t),Ju.forEach(t),dl=h(Xa),rs=r(Xa,"SPAN",{});var ju=s(rs);ll=i(ju,"Documentation resources"),ju.forEach(t),Xa.forEach(t),Ma=h(o),I=r(o,"UL",{});var K=s(I);ss=r(K,"LI",{});var Nu=s(ss);Xn=r(Nu,"A",{href:!0});var qu=s(Xn);cl=i(qu,"Text classification task guide"),qu.forEach(t),Nu.forEach(t),hl=h(K),as=r(K,"LI",{});var Uu=s(as);Qn=r(Uu,"A",{href:!0});var Au=s(Qn);pl=i(Au,"Token classification task guide"),Au.forEach(t),Uu.forEach(t),ml=h(K),is=r(K,"LI",{});var Wu=s(is);Yn=r(Wu,"A",{href:!0});var Su=s(Yn);ul=i(Su,"Question answering task guide"),Su.forEach(t),Wu.forEach(t),fl=h(K),ds=r(K,"LI",{});var Zu=s(ds);Kn=r(Zu,"A",{href:!0});var Lu=s(Kn);gl=i(Lu,"Causal language modeling task guide"),Lu.forEach(t),Zu.forEach(t),_l=h(K),ls=r(K,"LI",{});var Ou=s(ls);er=r(Ou,"A",{href:!0});var Bu=s(er);yl=i(Bu,"Masked language modeling task guide"),Bu.forEach(t),Ou.forEach(t),bl=h(K),cs=r(K,"LI",{});var Ru=s(cs);tr=r(Ru,"A",{href:!0});var Hu=s(tr);vl=i(Hu,"Multiple choice task guide"),Hu.forEach(t),Ru.forEach(t),K.forEach(t),$a=h(o),Fe=r(o,"H2",{class:!0});var Qa=s(Fe);st=r(Qa,"A",{id:!0,class:!0,href:!0});var Vu=s(st);hs=r(Vu,"SPAN",{});var Du=s(hs);T(Yt.$$.fragment,Du),Du.forEach(t),Vu.forEach(t),Tl=h(Qa),ps=r(Qa,"SPAN",{});var Gu=s(ps);kl=i(Gu,"ErnieConfig"),Gu.forEach(t),Qa.forEach(t),za=h(o),R=r(o,"DIV",{class:!0});var It=s(R);T(Kt.$$.fragment,It),wl=h(It),ee=r(It,"P",{});var jt=s(ee);El=i(jt,"This is the configuration class to store the configuration of a "),or=r(jt,"A",{href:!0});var Xu=s(or);Ml=i(Xu,"ErnieModel"),Xu.forEach(t),$l=i(jt," or a "),ms=r(jt,"CODE",{});var Qu=s(ms);zl=i(Qu,"TFErnieModel"),Qu.forEach(t),Fl=i(jt,`. It is used to
instantiate a ERNIE 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 ERNIE
`),eo=r(jt,"A",{href:!0,rel:!0});var Yu=s(eo);Cl=i(Yu,"nghuyong/ernie-3.0-base-zh"),Yu.forEach(t),xl=i(jt," architecture."),jt.forEach(t),Pl=h(It),Ce=r(It,"P",{});var Nr=s(Ce);Jl=i(Nr,"Configuration objects inherit from "),nr=r(Nr,"A",{href:!0});var Ku=s(nr);Il=i(Ku,"PretrainedConfig"),Ku.forEach(t),jl=i(Nr,` and can be used to control the model outputs. Read the
documentation from `),rr=r(Nr,"A",{href:!0});var ef=s(rr);Nl=i(ef,"PretrainedConfig"),ef.forEach(t),ql=i(Nr," for more information."),Nr.forEach(t),Ul=h(It),T(at.$$.fragment,It),It.forEach(t),Fa=h(o),xe=r(o,"H2",{class:!0});var Ya=s(xe);it=r(Ya,"A",{id:!0,class:!0,href:!0});var tf=s(it);us=r(tf,"SPAN",{});var of=s(us);T(to.$$.fragment,of),of.forEach(t),tf.forEach(t),Al=h(Ya),fs=r(Ya,"SPAN",{});var nf=s(fs);Wl=i(nf,"Ernie specific outputs"),nf.forEach(t),Ya.forEach(t),Ca=h(o),Pe=r(o,"DIV",{class:!0});var Ka=s(Pe);T(oo.$$.fragment,Ka),Sl=h(Ka),no=r(Ka,"P",{});var ei=s(no);Zl=i(ei,"Output type of "),sr=r(ei,"A",{href:!0});var rf=s(sr);Ll=i(rf,"ErnieForPreTraining"),rf.forEach(t),Ol=i(ei,"."),ei.forEach(t),Ka.forEach(t),xa=h(o),Je=r(o,"H2",{class:!0});var ti=s(Je);dt=r(ti,"A",{id:!0,class:!0,href:!0});var sf=s(dt);gs=r(sf,"SPAN",{});var af=s(gs);T(ro.$$.fragment,af),af.forEach(t),sf.forEach(t),Bl=h(ti),_s=r(ti,"SPAN",{});var df=s(_s);Rl=i(df,"ErnieModel"),df.forEach(t),ti.forEach(t),Pa=h(o),P=r(o,"DIV",{class:!0});var O=s(P);T(so.$$.fragment,O),Hl=h(O),ys=r(O,"P",{});var lf=s(ys);Vl=i(lf,"The bare Ernie Model transformer outputting raw hidden-states without any specific head on top."),lf.forEach(t),Dl=h(O),ao=r(O,"P",{});var oi=s(ao);Gl=i(oi,"This model inherits from "),ar=r(oi,"A",{href:!0});var cf=s(ar);Xl=i(cf,"PreTrainedModel"),cf.forEach(t),Ql=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),Yl=h(O),io=r(O,"P",{});var ni=s(io);Kl=i(ni,"This model is also a PyTorch "),lo=r(ni,"A",{href:!0,rel:!0});var hf=s(lo);ec=i(hf,"torch.nn.Module"),hf.forEach(t),tc=i(ni,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ni.forEach(t),oc=h(O),co=r(O,"P",{});var ri=s(co);nc=i(ri,`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),ho=r(ri,"A",{href:!0,rel:!0});var pf=s(ho);rc=i(pf,`Attention is
all you need`),pf.forEach(t),sc=i(ri,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),ri.forEach(t),ac=h(O),J=r(O,"P",{});var B=s(J);ic=i(B,"To behave as an decoder the model needs to be initialized with the "),bs=r(B,"CODE",{});var mf=s(bs);dc=i(mf,"is_decoder"),mf.forEach(t),lc=i(B,` argument of the configuration set
to `),vs=r(B,"CODE",{});var uf=s(vs);cc=i(uf,"True"),uf.forEach(t),hc=i(B,". To be used in a Seq2Seq model, the model needs to initialized with both "),Ts=r(B,"CODE",{});var ff=s(Ts);pc=i(ff,"is_decoder"),ff.forEach(t),mc=i(B,` argument and
`),ks=r(B,"CODE",{});var gf=s(ks);uc=i(gf,"add_cross_attention"),gf.forEach(t),fc=i(B," set to "),ws=r(B,"CODE",{});var _f=s(ws);gc=i(_f,"True"),_f.forEach(t),_c=i(B,"; an "),Es=r(B,"CODE",{});var yf=s(Es);yc=i(yf,"encoder_hidden_states"),yf.forEach(t),bc=i(B," is then expected as an input to the forward pass."),B.forEach(t),vc=h(O),V=r(O,"DIV",{class:!0});var Nt=s(V);T(po.$$.fragment,Nt),Tc=h(Nt),Ie=r(Nt,"P",{});var qr=s(Ie);kc=i(qr,"The "),ir=r(qr,"A",{href:!0});var bf=s(ir);wc=i(bf,"ErnieModel"),bf.forEach(t),Ec=i(qr," forward method, overrides the "),Ms=r(qr,"CODE",{});var vf=s(Ms);Mc=i(vf,"__call__"),vf.forEach(t),$c=i(qr," special method."),qr.forEach(t),zc=h(Nt),T(lt.$$.fragment,Nt),Fc=h(Nt),T(ct.$$.fragment,Nt),Nt.forEach(t),O.forEach(t),Ja=h(o),je=r(o,"H2",{class:!0});var si=s(je);ht=r(si,"A",{id:!0,class:!0,href:!0});var Tf=s(ht);$s=r(Tf,"SPAN",{});var kf=s($s);T(mo.$$.fragment,kf),kf.forEach(t),Tf.forEach(t),Cc=h(si),zs=r(si,"SPAN",{});var wf=s(zs);xc=i(wf,"ErnieForPreTraining"),wf.forEach(t),si.forEach(t),Ia=h(o),N=r(o,"DIV",{class:!0});var se=s(N);T(uo.$$.fragment,se),Pc=h(se),Ne=r(se,"P",{});var Ur=s(Ne);Jc=i(Ur,"Ernie Model with two heads on top as done during the pretraining: a "),Fs=r(Ur,"CODE",{});var Ef=s(Fs);Ic=i(Ef,"masked language modeling"),Ef.forEach(t),jc=i(Ur," head and a "),Cs=r(Ur,"CODE",{});var Mf=s(Cs);Nc=i(Mf,"next sentence prediction (classification)"),Mf.forEach(t),qc=i(Ur," head."),Ur.forEach(t),Uc=h(se),fo=r(se,"P",{});var ai=s(fo);Ac=i(ai,"This model inherits from "),dr=r(ai,"A",{href:!0});var $f=s(dr);Wc=i($f,"PreTrainedModel"),$f.forEach(t),Sc=i(ai,`. 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.)`),ai.forEach(t),Zc=h(se),go=r(se,"P",{});var ii=s(go);Lc=i(ii,"This model is also a PyTorch "),_o=r(ii,"A",{href:!0,rel:!0});var zf=s(_o);Oc=i(zf,"torch.nn.Module"),zf.forEach(t),Bc=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),Rc=h(se),D=r(se,"DIV",{class:!0});var qt=s(D);T(yo.$$.fragment,qt),Hc=h(qt),qe=r(qt,"P",{});var Ar=s(qe);Vc=i(Ar,"The "),lr=r(Ar,"A",{href:!0});var Ff=s(lr);Dc=i(Ff,"ErnieForPreTraining"),Ff.forEach(t),Gc=i(Ar," forward method, overrides the "),xs=r(Ar,"CODE",{});var Cf=s(xs);Xc=i(Cf,"__call__"),Cf.forEach(t),Qc=i(Ar," special method."),Ar.forEach(t),Yc=h(qt),T(pt.$$.fragment,qt),Kc=h(qt),T(mt.$$.fragment,qt),qt.forEach(t),se.forEach(t),ja=h(o),Ue=r(o,"H2",{class:!0});var di=s(Ue);ut=r(di,"A",{id:!0,class:!0,href:!0});var xf=s(ut);Ps=r(xf,"SPAN",{});var Pf=s(Ps);T(bo.$$.fragment,Pf),Pf.forEach(t),xf.forEach(t),eh=h(di),Js=r(di,"SPAN",{});var Jf=s(Js);th=i(Jf,"ErnieForCausalLM"),Jf.forEach(t),di.forEach(t),Na=h(o),q=r(o,"DIV",{class:!0});var ae=s(q);T(vo.$$.fragment,ae),oh=h(ae),To=r(ae,"P",{});var li=s(To);nh=i(li,"Ernie Model with a "),Is=r(li,"CODE",{});var If=s(Is);rh=i(If,"language modeling"),If.forEach(t),sh=i(li," head on top for CLM fine-tuning."),li.forEach(t),ah=h(ae),ko=r(ae,"P",{});var ci=s(ko);ih=i(ci,"This model inherits from "),cr=r(ci,"A",{href:!0});var jf=s(cr);dh=i(jf,"PreTrainedModel"),jf.forEach(t),lh=i(ci,`. 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.)`),ci.forEach(t),ch=h(ae),wo=r(ae,"P",{});var hi=s(wo);hh=i(hi,"This model is also a PyTorch "),Eo=r(hi,"A",{href:!0,rel:!0});var Nf=s(Eo);ph=i(Nf,"torch.nn.Module"),Nf.forEach(t),mh=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),uh=h(ae),G=r(ae,"DIV",{class:!0});var Ut=s(G);T(Mo.$$.fragment,Ut),fh=h(Ut),Ae=r(Ut,"P",{});var Wr=s(Ae);gh=i(Wr,"The "),hr=r(Wr,"A",{href:!0});var qf=s(hr);_h=i(qf,"ErnieForCausalLM"),qf.forEach(t),yh=i(Wr," forward method, overrides the "),js=r(Wr,"CODE",{});var Uf=s(js);bh=i(Uf,"__call__"),Uf.forEach(t),vh=i(Wr," special method."),Wr.forEach(t),Th=h(Ut),T(ft.$$.fragment,Ut),kh=h(Ut),T(gt.$$.fragment,Ut),Ut.forEach(t),ae.forEach(t),qa=h(o),We=r(o,"H2",{class:!0});var pi=s(We);_t=r(pi,"A",{id:!0,class:!0,href:!0});var Af=s(_t);Ns=r(Af,"SPAN",{});var Wf=s(Ns);T($o.$$.fragment,Wf),Wf.forEach(t),Af.forEach(t),wh=h(pi),qs=r(pi,"SPAN",{});var Sf=s(qs);Eh=i(Sf,"ErnieForMaskedLM"),Sf.forEach(t),pi.forEach(t),Ua=h(o),U=r(o,"DIV",{class:!0});var ie=s(U);T(zo.$$.fragment,ie),Mh=h(ie),Fo=r(ie,"P",{});var mi=s(Fo);$h=i(mi,"Ernie Model with a "),Us=r(mi,"CODE",{});var Zf=s(Us);zh=i(Zf,"language modeling"),Zf.forEach(t),Fh=i(mi," head on top."),mi.forEach(t),Ch=h(ie),Co=r(ie,"P",{});var ui=s(Co);xh=i(ui,"This model inherits from "),pr=r(ui,"A",{href:!0});var Lf=s(pr);Ph=i(Lf,"PreTrainedModel"),Lf.forEach(t),Jh=i(ui,`. 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.)`),ui.forEach(t),Ih=h(ie),xo=r(ie,"P",{});var fi=s(xo);jh=i(fi,"This model is also a PyTorch "),Po=r(fi,"A",{href:!0,rel:!0});var Of=s(Po);Nh=i(Of,"torch.nn.Module"),Of.forEach(t),qh=i(fi,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),fi.forEach(t),Uh=h(ie),X=r(ie,"DIV",{class:!0});var At=s(X);T(Jo.$$.fragment,At),Ah=h(At),Se=r(At,"P",{});var Sr=s(Se);Wh=i(Sr,"The "),mr=r(Sr,"A",{href:!0});var Bf=s(mr);Sh=i(Bf,"ErnieForMaskedLM"),Bf.forEach(t),Zh=i(Sr," forward method, overrides the "),As=r(Sr,"CODE",{});var Rf=s(As);Lh=i(Rf,"__call__"),Rf.forEach(t),Oh=i(Sr," special method."),Sr.forEach(t),Bh=h(At),T(yt.$$.fragment,At),Rh=h(At),T(bt.$$.fragment,At),At.forEach(t),ie.forEach(t),Aa=h(o),Ze=r(o,"H2",{class:!0});var gi=s(Ze);vt=r(gi,"A",{id:!0,class:!0,href:!0});var Hf=s(vt);Ws=r(Hf,"SPAN",{});var Vf=s(Ws);T(Io.$$.fragment,Vf),Vf.forEach(t),Hf.forEach(t),Hh=h(gi),Ss=r(gi,"SPAN",{});var Df=s(Ss);Vh=i(Df,"ErnieForNextSentencePrediction"),Df.forEach(t),gi.forEach(t),Wa=h(o),A=r(o,"DIV",{class:!0});var de=s(A);T(jo.$$.fragment,de),Dh=h(de),No=r(de,"P",{});var _i=s(No);Gh=i(_i,"Ernie Model with a "),Zs=r(_i,"CODE",{});var Gf=s(Zs);Xh=i(Gf,"next sentence prediction (classification)"),Gf.forEach(t),Qh=i(_i," head on top."),_i.forEach(t),Yh=h(de),qo=r(de,"P",{});var yi=s(qo);Kh=i(yi,"This model inherits from "),ur=r(yi,"A",{href:!0});var Xf=s(ur);ep=i(Xf,"PreTrainedModel"),Xf.forEach(t),tp=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),op=h(de),Uo=r(de,"P",{});var bi=s(Uo);np=i(bi,"This model is also a PyTorch "),Ao=r(bi,"A",{href:!0,rel:!0});var Qf=s(Ao);rp=i(Qf,"torch.nn.Module"),Qf.forEach(t),sp=i(bi,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),bi.forEach(t),ap=h(de),Q=r(de,"DIV",{class:!0});var Wt=s(Q);T(Wo.$$.fragment,Wt),ip=h(Wt),Le=r(Wt,"P",{});var Zr=s(Le);dp=i(Zr,"The "),fr=r(Zr,"A",{href:!0});var Yf=s(fr);lp=i(Yf,"ErnieForNextSentencePrediction"),Yf.forEach(t),cp=i(Zr," forward method, overrides the "),Ls=r(Zr,"CODE",{});var Kf=s(Ls);hp=i(Kf,"__call__"),Kf.forEach(t),pp=i(Zr," special method."),Zr.forEach(t),mp=h(Wt),T(Tt.$$.fragment,Wt),up=h(Wt),T(kt.$$.fragment,Wt),Wt.forEach(t),de.forEach(t),Sa=h(o),Oe=r(o,"H2",{class:!0});var vi=s(Oe);wt=r(vi,"A",{id:!0,class:!0,href:!0});var eg=s(wt);Os=r(eg,"SPAN",{});var tg=s(Os);T(So.$$.fragment,tg),tg.forEach(t),eg.forEach(t),fp=h(vi),Bs=r(vi,"SPAN",{});var og=s(Bs);gp=i(og,"ErnieForSequenceClassification"),og.forEach(t),vi.forEach(t),Za=h(o),W=r(o,"DIV",{class:!0});var le=s(W);T(Zo.$$.fragment,le),_p=h(le),Rs=r(le,"P",{});var ng=s(Rs);yp=i(ng,`Ernie Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),ng.forEach(t),bp=h(le),Lo=r(le,"P",{});var Ti=s(Lo);vp=i(Ti,"This model inherits from "),gr=r(Ti,"A",{href:!0});var rg=s(gr);Tp=i(rg,"PreTrainedModel"),rg.forEach(t),kp=i(Ti,`. 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.)`),Ti.forEach(t),wp=h(le),Oo=r(le,"P",{});var ki=s(Oo);Ep=i(ki,"This model is also a PyTorch "),Bo=r(ki,"A",{href:!0,rel:!0});var sg=s(Bo);Mp=i(sg,"torch.nn.Module"),sg.forEach(t),$p=i(ki,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ki.forEach(t),zp=h(le),oe=r(le,"DIV",{class:!0});var Lr=s(oe);T(Ro.$$.fragment,Lr),Fp=h(Lr),Be=r(Lr,"P",{});var Or=s(Be);Cp=i(Or,"The "),_r=r(Or,"A",{href:!0});var ag=s(_r);xp=i(ag,"ErnieForSequenceClassification"),ag.forEach(t),Pp=i(Or," forward method, overrides the "),Hs=r(Or,"CODE",{});var ig=s(Hs);Jp=i(ig,"__call__"),ig.forEach(t),Ip=i(Or," special method."),Or.forEach(t),jp=h(Lr),T(Et.$$.fragment,Lr),Lr.forEach(t),le.forEach(t),La=h(o),Re=r(o,"H2",{class:!0});var wi=s(Re);Mt=r(wi,"A",{id:!0,class:!0,href:!0});var dg=s(Mt);Vs=r(dg,"SPAN",{});var lg=s(Vs);T(Ho.$$.fragment,lg),lg.forEach(t),dg.forEach(t),Np=h(wi),Ds=r(wi,"SPAN",{});var cg=s(Ds);qp=i(cg,"ErnieForMultipleChoice"),cg.forEach(t),wi.forEach(t),Oa=h(o),S=r(o,"DIV",{class:!0});var ce=s(S);T(Vo.$$.fragment,ce),Up=h(ce),Gs=r(ce,"P",{});var hg=s(Gs);Ap=i(hg,`Ernie Model with a multiple choice classification head on top (a linear layer on top of the pooled output and a
softmax) e.g. for RocStories/SWAG tasks.`),hg.forEach(t),Wp=h(ce),Do=r(ce,"P",{});var Ei=s(Do);Sp=i(Ei,"This model inherits from "),yr=r(Ei,"A",{href:!0});var pg=s(yr);Zp=i(pg,"PreTrainedModel"),pg.forEach(t),Lp=i(Ei,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ei.forEach(t),Op=h(ce),Go=r(ce,"P",{});var Mi=s(Go);Bp=i(Mi,"This model is also a PyTorch "),Xo=r(Mi,"A",{href:!0,rel:!0});var mg=s(Xo);Rp=i(mg,"torch.nn.Module"),mg.forEach(t),Hp=i(Mi,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Mi.forEach(t),Vp=h(ce),Y=r(ce,"DIV",{class:!0});var St=s(Y);T(Qo.$$.fragment,St),Dp=h(St),He=r(St,"P",{});var Br=s(He);Gp=i(Br,"The "),br=r(Br,"A",{href:!0});var ug=s(br);Xp=i(ug,"ErnieForMultipleChoice"),ug.forEach(t),Qp=i(Br," forward method, overrides the "),Xs=r(Br,"CODE",{});var fg=s(Xs);Yp=i(fg,"__call__"),fg.forEach(t),Kp=i(Br," special method."),Br.forEach(t),em=h(St),T($t.$$.fragment,St),tm=h(St),T(zt.$$.fragment,St),St.forEach(t),ce.forEach(t),Ba=h(o),Ve=r(o,"H2",{class:!0});var $i=s(Ve);Ft=r($i,"A",{id:!0,class:!0,href:!0});var gg=s(Ft);Qs=r(gg,"SPAN",{});var _g=s(Qs);T(Yo.$$.fragment,_g),_g.forEach(t),gg.forEach(t),om=h($i),Ys=r($i,"SPAN",{});var yg=s(Ys);nm=i(yg,"ErnieForTokenClassification"),yg.forEach(t),$i.forEach(t),Ra=h(o),Z=r(o,"DIV",{class:!0});var he=s(Z);T(Ko.$$.fragment,he),rm=h(he),Ks=r(he,"P",{});var bg=s(Ks);sm=i(bg,`Ernie Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),bg.forEach(t),am=h(he),en=r(he,"P",{});var zi=s(en);im=i(zi,"This model inherits from "),vr=r(zi,"A",{href:!0});var vg=s(vr);dm=i(vg,"PreTrainedModel"),vg.forEach(t),lm=i(zi,`. 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.)`),zi.forEach(t),cm=h(he),tn=r(he,"P",{});var Fi=s(tn);hm=i(Fi,"This model is also a PyTorch "),on=r(Fi,"A",{href:!0,rel:!0});var Tg=s(on);pm=i(Tg,"torch.nn.Module"),Tg.forEach(t),mm=i(Fi,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Fi.forEach(t),um=h(he),ne=r(he,"DIV",{class:!0});var Rr=s(ne);T(nn.$$.fragment,Rr),fm=h(Rr),De=r(Rr,"P",{});var Hr=s(De);gm=i(Hr,"The "),Tr=r(Hr,"A",{href:!0});var kg=s(Tr);_m=i(kg,"ErnieForTokenClassification"),kg.forEach(t),ym=i(Hr," forward method, overrides the "),ea=r(Hr,"CODE",{});var wg=s(ea);bm=i(wg,"__call__"),wg.forEach(t),vm=i(Hr," special method."),Hr.forEach(t),Tm=h(Rr),T(Ct.$$.fragment,Rr),Rr.forEach(t),he.forEach(t),Ha=h(o),Ge=r(o,"H2",{class:!0});var Ci=s(Ge);xt=r(Ci,"A",{id:!0,class:!0,href:!0});var Eg=s(xt);ta=r(Eg,"SPAN",{});var Mg=s(ta);T(rn.$$.fragment,Mg),Mg.forEach(t),Eg.forEach(t),km=h(Ci),oa=r(Ci,"SPAN",{});var $g=s(oa);wm=i($g,"ErnieForQuestionAnswering"),$g.forEach(t),Ci.forEach(t),Va=h(o),L=r(o,"DIV",{class:!0});var pe=s(L);T(sn.$$.fragment,pe),Em=h(pe),Xe=r(pe,"P",{});var Vr=s(Xe);Mm=i(Vr,`Ernie Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layers on top of the hidden-states output to compute `),na=r(Vr,"CODE",{});var zg=s(na);$m=i(zg,"span start logits"),zg.forEach(t),zm=i(Vr," and "),ra=r(Vr,"CODE",{});var Fg=s(ra);Fm=i(Fg,"span end logits"),Fg.forEach(t),Cm=i(Vr,")."),Vr.forEach(t),xm=h(pe),an=r(pe,"P",{});var xi=s(an);Pm=i(xi,"This model inherits from "),kr=r(xi,"A",{href:!0});var Cg=s(kr);Jm=i(Cg,"PreTrainedModel"),Cg.forEach(t),Im=i(xi,`. 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.)`),xi.forEach(t),jm=h(pe),dn=r(pe,"P",{});var Pi=s(dn);Nm=i(Pi,"This model is also a PyTorch "),ln=r(Pi,"A",{href:!0,rel:!0});var xg=s(ln);qm=i(xg,"torch.nn.Module"),xg.forEach(t),Um=i(Pi,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Pi.forEach(t),Am=h(pe),re=r(pe,"DIV",{class:!0});var Dr=s(re);T(cn.$$.fragment,Dr),Wm=h(Dr),Qe=r(Dr,"P",{});var Gr=s(Qe);Sm=i(Gr,"The "),wr=r(Gr,"A",{href:!0});var Pg=s(wr);Zm=i(Pg,"ErnieForQuestionAnswering"),Pg.forEach(t),Lm=i(Gr," forward method, overrides the "),sa=r(Gr,"CODE",{});var Jg=s(sa);Om=i(Jg,"__call__"),Jg.forEach(t),Bm=i(Gr," special method."),Gr.forEach(t),Rm=h(Dr),T(Pt.$$.fragment,Dr),Dr.forEach(t),pe.forEach(t),this.h()},h(){d(p,"name","hf:doc:metadata"),d(p,"content",JSON.stringify(t_)),d(u,"id","ernie"),d(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(u,"href","#ernie"),d(g,"class","relative group"),d(et,"id","overview"),d(et,"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(et,"href","#overview"),d(me,"class","relative group"),d(Ot,"href","https://huggingface.co/nghuyong"),d(Ot,"rel","nofollow"),d(Bt,"href","https://github.com/PaddlePaddle/PaddleNLP"),d(Bt,"rel","nofollow"),d(tt,"id","how-to-use"),d(tt,"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(tt,"href","#how-to-use"),d(ue,"class","relative group"),d(ot,"id","supported-models"),d(ot,"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(ot,"href","#supported-models"),d(fe,"class","relative group"),d(_n,"align","center"),d(yn,"align","center"),d(bn,"align","center"),d(vn,"align","center"),d(Tn,"align","center"),d(kn,"align","center"),d(wn,"align","center"),d(En,"align","center"),d(Mn,"align","center"),d($n,"align","center"),d(zn,"align","center"),d(Fn,"align","center"),d(Cn,"align","center"),d(xn,"align","center"),d(Pn,"align","center"),d(Jn,"align","center"),d(In,"align","center"),d(jn,"align","center"),d(Nn,"align","center"),d(qn,"align","center"),d(Un,"align","center"),d(An,"align","center"),d(Wn,"align","center"),d(Sn,"align","center"),d(Zn,"align","center"),d(Ln,"align","center"),d(On,"align","center"),d(Bn,"align","center"),d(Rn,"align","center"),d(Hn,"align","center"),d(Vn,"align","center"),d(Dn,"align","center"),d(Gn,"align","center"),d(Dt,"href","https://huggingface.co/nghuyong"),d(Dt,"rel","nofollow"),d(Gt,"href","https://paddlenlp.readthedocs.io/zh/latest/model_zoo/transformers/ERNIE/contents.html"),d(Gt,"rel","nofollow"),d(Xt,"href","https://github.com/PaddlePaddle/ERNIE/blob/repro"),d(Xt,"rel","nofollow"),d(rt,"id","documentation-resources"),d(rt,"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(rt,"href","#documentation-resources"),d(ze,"class","relative group"),d(Xn,"href","../tasks/sequence_classification"),d(Qn,"href","../tasks/token_classification"),d(Yn,"href","../tasks/question_answering"),d(Kn,"href","../tasks/language_modeling"),d(er,"href","../tasks/masked_language_modeling"),d(tr,"href","../tasks/multiple_choice"),d(st,"id","transformers.ErnieConfig"),d(st,"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(st,"href","#transformers.ErnieConfig"),d(Fe,"class","relative group"),d(or,"href","/docs/transformers/main/en/model_doc/ernie#transformers.ErnieModel"),d(eo,"href","https://huggingface.co/nghuyong/ernie-3.0-base-zh"),d(eo,"rel","nofollow"),d(nr,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(rr,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(it,"id","transformers.models.ernie.modeling_ernie.ErnieForPreTrainingOutput"),d(it,"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(it,"href","#transformers.models.ernie.modeling_ernie.ErnieForPreTrainingOutput"),d(xe,"class","relative group"),d(sr,"href","/docs/transformers/main/en/model_doc/ernie#transformers.ErnieForPreTraining"),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(dt,"id","transformers.ErnieModel"),d(dt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(dt,"href","#transformers.ErnieModel"),d(Je,"class","relative group"),d(ar,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(lo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(lo,"rel","nofollow"),d(ho,"href","https://arxiv.org/abs/1706.03762"),d(ho,"rel","nofollow"),d(ir,"href","/docs/transformers/main/en/model_doc/ernie#transformers.ErnieModel"),d(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ht,"id","transformers.ErnieForPreTraining"),d(ht,"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(ht,"href","#transformers.ErnieForPreTraining"),d(je,"class","relative group"),d(dr,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(_o,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(_o,"rel","nofollow"),d(lr,"href","/docs/transformers/main/en/model_doc/ernie#transformers.ErnieForPreTraining"),d(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ut,"id","transformers.ErnieForCausalLM"),d(ut,"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(ut,"href","#transformers.ErnieForCausalLM"),d(Ue,"class","relative group"),d(cr,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(Eo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Eo,"rel","nofollow"),d(hr,"href","/docs/transformers/main/en/model_doc/ernie#transformers.ErnieForCausalLM"),d(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(_t,"id","transformers.ErnieForMaskedLM"),d(_t,"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(_t,"href","#transformers.ErnieForMaskedLM"),d(We,"class","relative group"),d(pr,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(Po,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Po,"rel","nofollow"),d(mr,"href","/docs/transformers/main/en/model_doc/ernie#transformers.ErnieForMaskedLM"),d(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(vt,"id","transformers.ErnieForNextSentencePrediction"),d(vt,"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(vt,"href","#transformers.ErnieForNextSentencePrediction"),d(Ze,"class","relative group"),d(ur,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(Ao,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ao,"rel","nofollow"),d(fr,"href","/docs/transformers/main/en/model_doc/ernie#transformers.ErnieForNextSentencePrediction"),d(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(wt,"id","transformers.ErnieForSequenceClassification"),d(wt,"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(wt,"href","#transformers.ErnieForSequenceClassification"),d(Oe,"class","relative group"),d(gr,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(Bo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Bo,"rel","nofollow"),d(_r,"href","/docs/transformers/main/en/model_doc/ernie#transformers.ErnieForSequenceClassification"),d(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Mt,"id","transformers.ErnieForMultipleChoice"),d(Mt,"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(Mt,"href","#transformers.ErnieForMultipleChoice"),d(Re,"class","relative group"),d(yr,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(Xo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Xo,"rel","nofollow"),d(br,"href","/docs/transformers/main/en/model_doc/ernie#transformers.ErnieForMultipleChoice"),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"),d(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ft,"id","transformers.ErnieForTokenClassification"),d(Ft,"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(Ft,"href","#transformers.ErnieForTokenClassification"),d(Ve,"class","relative group"),d(vr,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(on,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(on,"rel","nofollow"),d(Tr,"href","/docs/transformers/main/en/model_doc/ernie#transformers.ErnieForTokenClassification"),d(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(xt,"id","transformers.ErnieForQuestionAnswering"),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","#transformers.ErnieForQuestionAnswering"),d(Ge,"class","relative group"),d(kr,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(ln,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(ln,"rel","nofollow"),d(wr,"href","/docs/transformers/main/en/model_doc/ernie#transformers.ErnieForQuestionAnswering"),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(L,"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,f){e(document.head,p),_(o,b,f),_(o,g,f),e(g,u),e(u,y),k(l,y,null),e(g,m),e(g,z),e(z,Ji),_(o,_a,f),_(o,me,f),e(me,et),e(et,Xr),k(Lt,Xr,null),e(me,Ii),e(me,Qr),e(Qr,ji),_(o,ya,f),_(o,te,f),e(te,Ni),e(te,Ot),e(Ot,qi),e(te,Ui),e(te,Bt),e(Bt,Ai),e(te,Wi),_(o,ba,f),_(o,ue,f),e(ue,tt),e(tt,Yr),k(Rt,Yr,null),e(ue,Si),e(ue,Kr),e(Kr,Zi),_(o,va,f),k(Ht,o,f),_(o,Ta,f),_(o,fe,f),e(fe,ot),e(ot,es),k(Vt,es,null),e(fe,Li),e(fe,ts),e(ts,Oi),_(o,ka,f),_(o,nt,f),e(nt,os),e(os,ge),e(ge,_n),e(_n,Bi),e(ge,Ri),e(ge,yn),e(yn,Hi),e(ge,Vi),e(ge,bn),e(bn,Di),e(nt,Gi),e(nt,F),e(F,_e),e(_e,vn),e(vn,Xi),e(_e,Qi),e(_e,Tn),e(Tn,Yi),e(_e,Ki),e(_e,kn),e(kn,ed),e(F,td),e(F,ye),e(ye,wn),e(wn,od),e(ye,nd),e(ye,En),e(En,rd),e(ye,sd),e(ye,Mn),e(Mn,ad),e(F,id),e(F,be),e(be,$n),e($n,dd),e(be,ld),e(be,zn),e(zn,cd),e(be,hd),e(be,Fn),e(Fn,pd),e(F,md),e(F,ve),e(ve,Cn),e(Cn,ud),e(ve,fd),e(ve,xn),e(xn,gd),e(ve,_d),e(ve,Pn),e(Pn,yd),e(F,bd),e(F,Te),e(Te,Jn),e(Jn,vd),e(Te,Td),e(Te,In),e(In,kd),e(Te,wd),e(Te,jn),e(jn,Ed),e(F,Md),e(F,ke),e(ke,Nn),e(Nn,$d),e(ke,zd),e(ke,qn),e(qn,Fd),e(ke,Cd),e(ke,Un),e(Un,xd),e(F,Pd),e(F,we),e(we,An),e(An,Jd),e(we,Id),e(we,Wn),e(Wn,jd),e(we,Nd),e(we,Sn),e(Sn,qd),e(F,Ud),e(F,Ee),e(Ee,Zn),e(Zn,Ad),e(Ee,Wd),e(Ee,Ln),e(Ln,Sd),e(Ee,Zd),e(Ee,On),e(On,Ld),e(F,Od),e(F,Me),e(Me,Bn),e(Bn,Bd),e(Me,Rd),e(Me,Rn),e(Rn,Hd),e(Me,Vd),e(Me,Hn),e(Hn,Dd),e(F,Gd),e(F,$e),e($e,Vn),e(Vn,Xd),e($e,Qd),e($e,Dn),e(Dn,Yd),e($e,Kd),e($e,Gn),e(Gn,el),_(o,wa,f),_(o,H,f),e(H,tl),e(H,Dt),e(Dt,ol),e(H,nl),e(H,Gt),e(Gt,rl),e(H,sl),e(H,Xt),e(Xt,al),e(H,il),_(o,Ea,f),_(o,ze,f),e(ze,rt),e(rt,ns),k(Qt,ns,null),e(ze,dl),e(ze,rs),e(rs,ll),_(o,Ma,f),_(o,I,f),e(I,ss),e(ss,Xn),e(Xn,cl),e(I,hl),e(I,as),e(as,Qn),e(Qn,pl),e(I,ml),e(I,is),e(is,Yn),e(Yn,ul),e(I,fl),e(I,ds),e(ds,Kn),e(Kn,gl),e(I,_l),e(I,ls),e(ls,er),e(er,yl),e(I,bl),e(I,cs),e(cs,tr),e(tr,vl),_(o,$a,f),_(o,Fe,f),e(Fe,st),e(st,hs),k(Yt,hs,null),e(Fe,Tl),e(Fe,ps),e(ps,kl),_(o,za,f),_(o,R,f),k(Kt,R,null),e(R,wl),e(R,ee),e(ee,El),e(ee,or),e(or,Ml),e(ee,$l),e(ee,ms),e(ms,zl),e(ee,Fl),e(ee,eo),e(eo,Cl),e(ee,xl),e(R,Pl),e(R,Ce),e(Ce,Jl),e(Ce,nr),e(nr,Il),e(Ce,jl),e(Ce,rr),e(rr,Nl),e(Ce,ql),e(R,Ul),k(at,R,null),_(o,Fa,f),_(o,xe,f),e(xe,it),e(it,us),k(to,us,null),e(xe,Al),e(xe,fs),e(fs,Wl),_(o,Ca,f),_(o,Pe,f),k(oo,Pe,null),e(Pe,Sl),e(Pe,no),e(no,Zl),e(no,sr),e(sr,Ll),e(no,Ol),_(o,xa,f),_(o,Je,f),e(Je,dt),e(dt,gs),k(ro,gs,null),e(Je,Bl),e(Je,_s),e(_s,Rl),_(o,Pa,f),_(o,P,f),k(so,P,null),e(P,Hl),e(P,ys),e(ys,Vl),e(P,Dl),e(P,ao),e(ao,Gl),e(ao,ar),e(ar,Xl),e(ao,Ql),e(P,Yl),e(P,io),e(io,Kl),e(io,lo),e(lo,ec),e(io,tc),e(P,oc),e(P,co),e(co,nc),e(co,ho),e(ho,rc),e(co,sc),e(P,ac),e(P,J),e(J,ic),e(J,bs),e(bs,dc),e(J,lc),e(J,vs),e(vs,cc),e(J,hc),e(J,Ts),e(Ts,pc),e(J,mc),e(J,ks),e(ks,uc),e(J,fc),e(J,ws),e(ws,gc),e(J,_c),e(J,Es),e(Es,yc),e(J,bc),e(P,vc),e(P,V),k(po,V,null),e(V,Tc),e(V,Ie),e(Ie,kc),e(Ie,ir),e(ir,wc),e(Ie,Ec),e(Ie,Ms),e(Ms,Mc),e(Ie,$c),e(V,zc),k(lt,V,null),e(V,Fc),k(ct,V,null),_(o,Ja,f),_(o,je,f),e(je,ht),e(ht,$s),k(mo,$s,null),e(je,Cc),e(je,zs),e(zs,xc),_(o,Ia,f),_(o,N,f),k(uo,N,null),e(N,Pc),e(N,Ne),e(Ne,Jc),e(Ne,Fs),e(Fs,Ic),e(Ne,jc),e(Ne,Cs),e(Cs,Nc),e(Ne,qc),e(N,Uc),e(N,fo),e(fo,Ac),e(fo,dr),e(dr,Wc),e(fo,Sc),e(N,Zc),e(N,go),e(go,Lc),e(go,_o),e(_o,Oc),e(go,Bc),e(N,Rc),e(N,D),k(yo,D,null),e(D,Hc),e(D,qe),e(qe,Vc),e(qe,lr),e(lr,Dc),e(qe,Gc),e(qe,xs),e(xs,Xc),e(qe,Qc),e(D,Yc),k(pt,D,null),e(D,Kc),k(mt,D,null),_(o,ja,f),_(o,Ue,f),e(Ue,ut),e(ut,Ps),k(bo,Ps,null),e(Ue,eh),e(Ue,Js),e(Js,th),_(o,Na,f),_(o,q,f),k(vo,q,null),e(q,oh),e(q,To),e(To,nh),e(To,Is),e(Is,rh),e(To,sh),e(q,ah),e(q,ko),e(ko,ih),e(ko,cr),e(cr,dh),e(ko,lh),e(q,ch),e(q,wo),e(wo,hh),e(wo,Eo),e(Eo,ph),e(wo,mh),e(q,uh),e(q,G),k(Mo,G,null),e(G,fh),e(G,Ae),e(Ae,gh),e(Ae,hr),e(hr,_h),e(Ae,yh),e(Ae,js),e(js,bh),e(Ae,vh),e(G,Th),k(ft,G,null),e(G,kh),k(gt,G,null),_(o,qa,f),_(o,We,f),e(We,_t),e(_t,Ns),k($o,Ns,null),e(We,wh),e(We,qs),e(qs,Eh),_(o,Ua,f),_(o,U,f),k(zo,U,null),e(U,Mh),e(U,Fo),e(Fo,$h),e(Fo,Us),e(Us,zh),e(Fo,Fh),e(U,Ch),e(U,Co),e(Co,xh),e(Co,pr),e(pr,Ph),e(Co,Jh),e(U,Ih),e(U,xo),e(xo,jh),e(xo,Po),e(Po,Nh),e(xo,qh),e(U,Uh),e(U,X),k(Jo,X,null),e(X,Ah),e(X,Se),e(Se,Wh),e(Se,mr),e(mr,Sh),e(Se,Zh),e(Se,As),e(As,Lh),e(Se,Oh),e(X,Bh),k(yt,X,null),e(X,Rh),k(bt,X,null),_(o,Aa,f),_(o,Ze,f),e(Ze,vt),e(vt,Ws),k(Io,Ws,null),e(Ze,Hh),e(Ze,Ss),e(Ss,Vh),_(o,Wa,f),_(o,A,f),k(jo,A,null),e(A,Dh),e(A,No),e(No,Gh),e(No,Zs),e(Zs,Xh),e(No,Qh),e(A,Yh),e(A,qo),e(qo,Kh),e(qo,ur),e(ur,ep),e(qo,tp),e(A,op),e(A,Uo),e(Uo,np),e(Uo,Ao),e(Ao,rp),e(Uo,sp),e(A,ap),e(A,Q),k(Wo,Q,null),e(Q,ip),e(Q,Le),e(Le,dp),e(Le,fr),e(fr,lp),e(Le,cp),e(Le,Ls),e(Ls,hp),e(Le,pp),e(Q,mp),k(Tt,Q,null),e(Q,up),k(kt,Q,null),_(o,Sa,f),_(o,Oe,f),e(Oe,wt),e(wt,Os),k(So,Os,null),e(Oe,fp),e(Oe,Bs),e(Bs,gp),_(o,Za,f),_(o,W,f),k(Zo,W,null),e(W,_p),e(W,Rs),e(Rs,yp),e(W,bp),e(W,Lo),e(Lo,vp),e(Lo,gr),e(gr,Tp),e(Lo,kp),e(W,wp),e(W,Oo),e(Oo,Ep),e(Oo,Bo),e(Bo,Mp),e(Oo,$p),e(W,zp),e(W,oe),k(Ro,oe,null),e(oe,Fp),e(oe,Be),e(Be,Cp),e(Be,_r),e(_r,xp),e(Be,Pp),e(Be,Hs),e(Hs,Jp),e(Be,Ip),e(oe,jp),k(Et,oe,null),_(o,La,f),_(o,Re,f),e(Re,Mt),e(Mt,Vs),k(Ho,Vs,null),e(Re,Np),e(Re,Ds),e(Ds,qp),_(o,Oa,f),_(o,S,f),k(Vo,S,null),e(S,Up),e(S,Gs),e(Gs,Ap),e(S,Wp),e(S,Do),e(Do,Sp),e(Do,yr),e(yr,Zp),e(Do,Lp),e(S,Op),e(S,Go),e(Go,Bp),e(Go,Xo),e(Xo,Rp),e(Go,Hp),e(S,Vp),e(S,Y),k(Qo,Y,null),e(Y,Dp),e(Y,He),e(He,Gp),e(He,br),e(br,Xp),e(He,Qp),e(He,Xs),e(Xs,Yp),e(He,Kp),e(Y,em),k($t,Y,null),e(Y,tm),k(zt,Y,null),_(o,Ba,f),_(o,Ve,f),e(Ve,Ft),e(Ft,Qs),k(Yo,Qs,null),e(Ve,om),e(Ve,Ys),e(Ys,nm),_(o,Ra,f),_(o,Z,f),k(Ko,Z,null),e(Z,rm),e(Z,Ks),e(Ks,sm),e(Z,am),e(Z,en),e(en,im),e(en,vr),e(vr,dm),e(en,lm),e(Z,cm),e(Z,tn),e(tn,hm),e(tn,on),e(on,pm),e(tn,mm),e(Z,um),e(Z,ne),k(nn,ne,null),e(ne,fm),e(ne,De),e(De,gm),e(De,Tr),e(Tr,_m),e(De,ym),e(De,ea),e(ea,bm),e(De,vm),e(ne,Tm),k(Ct,ne,null),_(o,Ha,f),_(o,Ge,f),e(Ge,xt),e(xt,ta),k(rn,ta,null),e(Ge,km),e(Ge,oa),e(oa,wm),_(o,Va,f),_(o,L,f),k(sn,L,null),e(L,Em),e(L,Xe),e(Xe,Mm),e(Xe,na),e(na,$m),e(Xe,zm),e(Xe,ra),e(ra,Fm),e(Xe,Cm),e(L,xm),e(L,an),e(an,Pm),e(an,kr),e(kr,Jm),e(an,Im),e(L,jm),e(L,dn),e(dn,Nm),e(dn,ln),e(ln,qm),e(dn,Um),e(L,Am),e(L,re),k(cn,re,null),e(re,Wm),e(re,Qe),e(Qe,Sm),e(Qe,wr),e(wr,Zm),e(Qe,Lm),e(Qe,sa),e(sa,Om),e(Qe,Bm),e(re,Rm),k(Pt,re,null),Da=!0},p(o,[f]){const hn={};f&2&&(hn.$$scope={dirty:f,ctx:o}),at.$set(hn);const aa={};f&2&&(aa.$$scope={dirty:f,ctx:o}),lt.$set(aa);const ia={};f&2&&(ia.$$scope={dirty:f,ctx:o}),ct.$set(ia);const da={};f&2&&(da.$$scope={dirty:f,ctx:o}),pt.$set(da);const pn={};f&2&&(pn.$$scope={dirty:f,ctx:o}),mt.$set(pn);const la={};f&2&&(la.$$scope={dirty:f,ctx:o}),ft.$set(la);const ca={};f&2&&(ca.$$scope={dirty:f,ctx:o}),gt.$set(ca);const ha={};f&2&&(ha.$$scope={dirty:f,ctx:o}),yt.$set(ha);const Ye={};f&2&&(Ye.$$scope={dirty:f,ctx:o}),bt.$set(Ye);const pa={};f&2&&(pa.$$scope={dirty:f,ctx:o}),Tt.$set(pa);const ma={};f&2&&(ma.$$scope={dirty:f,ctx:o}),kt.$set(ma);const mn={};f&2&&(mn.$$scope={dirty:f,ctx:o}),Et.$set(mn);const ua={};f&2&&(ua.$$scope={dirty:f,ctx:o}),$t.$set(ua);const fa={};f&2&&(fa.$$scope={dirty:f,ctx:o}),zt.$set(fa);const ga={};f&2&&(ga.$$scope={dirty:f,ctx:o}),Ct.$set(ga);const un={};f&2&&(un.$$scope={dirty:f,ctx:o}),Pt.$set(un)},i(o){Da||(w(l.$$.fragment,o),w(Lt.$$.fragment,o),w(Rt.$$.fragment,o),w(Ht.$$.fragment,o),w(Vt.$$.fragment,o),w(Qt.$$.fragment,o),w(Yt.$$.fragment,o),w(Kt.$$.fragment,o),w(at.$$.fragment,o),w(to.$$.fragment,o),w(oo.$$.fragment,o),w(ro.$$.fragment,o),w(so.$$.fragment,o),w(po.$$.fragment,o),w(lt.$$.fragment,o),w(ct.$$.fragment,o),w(mo.$$.fragment,o),w(uo.$$.fragment,o),w(yo.$$.fragment,o),w(pt.$$.fragment,o),w(mt.$$.fragment,o),w(bo.$$.fragment,o),w(vo.$$.fragment,o),w(Mo.$$.fragment,o),w(ft.$$.fragment,o),w(gt.$$.fragment,o),w($o.$$.fragment,o),w(zo.$$.fragment,o),w(Jo.$$.fragment,o),w(yt.$$.fragment,o),w(bt.$$.fragment,o),w(Io.$$.fragment,o),w(jo.$$.fragment,o),w(Wo.$$.fragment,o),w(Tt.$$.fragment,o),w(kt.$$.fragment,o),w(So.$$.fragment,o),w(Zo.$$.fragment,o),w(Ro.$$.fragment,o),w(Et.$$.fragment,o),w(Ho.$$.fragment,o),w(Vo.$$.fragment,o),w(Qo.$$.fragment,o),w($t.$$.fragment,o),w(zt.$$.fragment,o),w(Yo.$$.fragment,o),w(Ko.$$.fragment,o),w(nn.$$.fragment,o),w(Ct.$$.fragment,o),w(rn.$$.fragment,o),w(sn.$$.fragment,o),w(cn.$$.fragment,o),w(Pt.$$.fragment,o),Da=!0)},o(o){E(l.$$.fragment,o),E(Lt.$$.fragment,o),E(Rt.$$.fragment,o),E(Ht.$$.fragment,o),E(Vt.$$.fragment,o),E(Qt.$$.fragment,o),E(Yt.$$.fragment,o),E(Kt.$$.fragment,o),E(at.$$.fragment,o),E(to.$$.fragment,o),E(oo.$$.fragment,o),E(ro.$$.fragment,o),E(so.$$.fragment,o),E(po.$$.fragment,o),E(lt.$$.fragment,o),E(ct.$$.fragment,o),E(mo.$$.fragment,o),E(uo.$$.fragment,o),E(yo.$$.fragment,o),E(pt.$$.fragment,o),E(mt.$$.fragment,o),E(bo.$$.fragment,o),E(vo.$$.fragment,o),E(Mo.$$.fragment,o),E(ft.$$.fragment,o),E(gt.$$.fragment,o),E($o.$$.fragment,o),E(zo.$$.fragment,o),E(Jo.$$.fragment,o),E(yt.$$.fragment,o),E(bt.$$.fragment,o),E(Io.$$.fragment,o),E(jo.$$.fragment,o),E(Wo.$$.fragment,o),E(Tt.$$.fragment,o),E(kt.$$.fragment,o),E(So.$$.fragment,o),E(Zo.$$.fragment,o),E(Ro.$$.fragment,o),E(Et.$$.fragment,o),E(Ho.$$.fragment,o),E(Vo.$$.fragment,o),E(Qo.$$.fragment,o),E($t.$$.fragment,o),E(zt.$$.fragment,o),E(Yo.$$.fragment,o),E(Ko.$$.fragment,o),E(nn.$$.fragment,o),E(Ct.$$.fragment,o),E(rn.$$.fragment,o),E(sn.$$.fragment,o),E(cn.$$.fragment,o),E(Pt.$$.fragment,o),Da=!1},d(o){t(p),o&&t(b),o&&t(g),M(l),o&&t(_a),o&&t(me),M(Lt),o&&t(ya),o&&t(te),o&&t(ba),o&&t(ue),M(Rt),o&&t(va),M(Ht,o),o&&t(Ta),o&&t(fe),M(Vt),o&&t(ka),o&&t(nt),o&&t(wa),o&&t(H),o&&t(Ea),o&&t(ze),M(Qt),o&&t(Ma),o&&t(I),o&&t($a),o&&t(Fe),M(Yt),o&&t(za),o&&t(R),M(Kt),M(at),o&&t(Fa),o&&t(xe),M(to),o&&t(Ca),o&&t(Pe),M(oo),o&&t(xa),o&&t(Je),M(ro),o&&t(Pa),o&&t(P),M(so),M(po),M(lt),M(ct),o&&t(Ja),o&&t(je),M(mo),o&&t(Ia),o&&t(N),M(uo),M(yo),M(pt),M(mt),o&&t(ja),o&&t(Ue),M(bo),o&&t(Na),o&&t(q),M(vo),M(Mo),M(ft),M(gt),o&&t(qa),o&&t(We),M($o),o&&t(Ua),o&&t(U),M(zo),M(Jo),M(yt),M(bt),o&&t(Aa),o&&t(Ze),M(Io),o&&t(Wa),o&&t(A),M(jo),M(Wo),M(Tt),M(kt),o&&t(Sa),o&&t(Oe),M(So),o&&t(Za),o&&t(W),M(Zo),M(Ro),M(Et),o&&t(La),o&&t(Re),M(Ho),o&&t(Oa),o&&t(S),M(Vo),M(Qo),M($t),M(zt),o&&t(Ba),o&&t(Ve),M(Yo),o&&t(Ra),o&&t(Z),M(Ko),M(nn),M(Ct),o&&t(Ha),o&&t(Ge),M(rn),o&&t(Va),o&&t(L),M(sn),M(cn),M(Pt)}}}const t_={local:"ernie",sections:[{local:"overview",sections:[{local:"how-to-use",title:"How to use"},{local:"supported-models",title:"Supported Models"}],title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.ErnieConfig",title:"ErnieConfig"},{local:"transformers.models.ernie.modeling_ernie.ErnieForPreTrainingOutput",title:"Ernie specific outputs"},{local:"transformers.ErnieModel",title:"ErnieModel"},{local:"transformers.ErnieForPreTraining",title:"ErnieForPreTraining"},{local:"transformers.ErnieForCausalLM",title:"ErnieForCausalLM"},{local:"transformers.ErnieForMaskedLM",title:"ErnieForMaskedLM"},{local:"transformers.ErnieForNextSentencePrediction",title:"ErnieForNextSentencePrediction"},{local:"transformers.ErnieForSequenceClassification",title:"ErnieForSequenceClassification"},{local:"transformers.ErnieForMultipleChoice",title:"ErnieForMultipleChoice"},{local:"transformers.ErnieForTokenClassification",title:"ErnieForTokenClassification"},{local:"transformers.ErnieForQuestionAnswering",title:"ErnieForQuestionAnswering"}],title:"ERNIE"};function o_($){return Ug(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class l_ extends Ig{constructor(p){super();jg(this,p,o_,e_,Ng,{})}}export{l_ as default,t_ as metadata};
