import{S as Gc,i as Vc,s as Rc,e as n,k as c,w as y,t as a,M as Pc,c as s,d as o,m as p,a as r,x as v,h as i,b as h,G as e,g as _,y as w,q as T,o as k,B as E,v as Xc,L as Lo}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ho}from"../../chunks/Tip-hf-doc-builder.js";import{D as C}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Oo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as X}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Qo}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Hc($){let d,b,g,u,M;return{c(){d=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"),M=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){d=s(l,"P",{});var m=r(d);b=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(m,"CODE",{});var J=r(g);u=i(J,"Module"),J.forEach(o),M=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(o)},m(l,m){_(l,d,m),e(d,b),e(d,g),e(g,u),e(d,M)},d(l){l&&o(d)}}}function Qc($){let d,b,g,u,M;return u=new Oo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBFcm5pZU1Nb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyc3VzbmF0byUyRmVybmllLW0tYmFzZV9weXRvcmNoJTIyKSUwQW1vZGVsJTIwJTNEJTIwRXJuaWVNTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnN1c25hdG8lMkZlcm5pZS1tLWJhc2VfcHl0b3JjaCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ErnieMModel
<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;susnato/ernie-m-base_pytorch&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ErnieMModel.from_pretrained(<span class="hljs-string">&quot;susnato/ernie-m-base_pytorch&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(){d=n("p"),b=a("Example:"),g=c(),y(u.$$.fragment)},l(l){d=s(l,"P",{});var m=r(d);b=i(m,"Example:"),m.forEach(o),g=p(l),v(u.$$.fragment,l)},m(l,m){_(l,d,m),e(d,b),_(l,g,m),w(u,l,m),M=!0},p:Lo,i(l){M||(T(u.$$.fragment,l),M=!0)},o(l){k(u.$$.fragment,l),M=!1},d(l){l&&o(d),l&&o(g),E(u,l)}}}function Lc($){let d,b,g,u,M;return{c(){d=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"),M=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){d=s(l,"P",{});var m=r(d);b=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(m,"CODE",{});var J=r(g);u=i(J,"Module"),J.forEach(o),M=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(o)},m(l,m){_(l,d,m),e(d,b),e(d,g),e(g,u),e(d,M)},d(l){l&&o(d)}}}function Oc($){let d,b,g,u,M;return u=new Oo({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEVybmllTUZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJzdXNuYXRvJTJGZXJuaWUtbS1iYXNlX3B5dG9yY2glMjIpJTBBbW9kZWwlMjAlM0QlMjBFcm5pZU1Gb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJzdXNuYXRvJTJGZXJuaWUtbS1iYXNlX3B5dG9yY2glMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX2NsYXNzX2lkJTIwJTNEJTIwbG9naXRzLmFyZ21heCgpLml0ZW0oKSUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyMEVybmllTUZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMnN1c25hdG8lMkZlcm5pZS1tLWJhc2VfcHl0b3JjaCUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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, ErnieMForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;susnato/ernie-m-base_pytorch&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ErnieMForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;susnato/ernie-m-base_pytorch&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><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>predicted_class_id = logits.argmax().item()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ErnieMForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;susnato/ernie-m-base_pytorch&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=n("p"),b=a("Example of single-label classification:"),g=c(),y(u.$$.fragment)},l(l){d=s(l,"P",{});var m=r(d);b=i(m,"Example of single-label classification:"),m.forEach(o),g=p(l),v(u.$$.fragment,l)},m(l,m){_(l,d,m),e(d,b),_(l,g,m),w(u,l,m),M=!0},p:Lo,i(l){M||(T(u.$$.fragment,l),M=!0)},o(l){k(u.$$.fragment,l),M=!1},d(l){l&&o(d),l&&o(g),E(u,l)}}}function Yc($){let d,b,g,u,M;return u=new Oo({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEVybmllTUZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJzdXNuYXRvJTJGZXJuaWUtbS1iYXNlX3B5dG9yY2glMjIpJTBBbW9kZWwlMjAlM0QlMjBFcm5pZU1Gb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJzdXNuYXRvJTJGZXJuaWUtbS1iYXNlX3B5dG9yY2glMjIlMkMlMjBwcm9ibGVtX3R5cGUlM0QlMjJtdWx0aV9sYWJlbF9jbGFzc2lmaWNhdGlvbiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWRzJTIwJTNEJTIwdG9yY2guYXJhbmdlKDAlMkMlMjBsb2dpdHMuc2hhcGUlNUItMSU1RCklNUJ0b3JjaC5zaWdtb2lkKGxvZ2l0cykuc3F1ZWV6ZShkaW0lM0QwKSUyMCUzRSUyMDAuNSU1RCUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyMEVybmllTUZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnN1c25hdG8lMkZlcm5pZS1tLWJhc2VfcHl0b3JjaCUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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, ErnieMForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;susnato/ernie-m-base_pytorch&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ErnieMForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;susnato/ernie-m-base_pytorch&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&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><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>predicted_class_ids = torch.arange(<span class="hljs-number">0</span>, logits.shape[-<span class="hljs-number">1</span>])[torch.sigmoid(logits).squeeze(dim=<span class="hljs-number">0</span>) &gt; <span class="hljs-number">0.5</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ErnieMForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;susnato/ernie-m-base_pytorch&quot;</span>, num_labels=num_labels, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.<span class="hljs-built_in">sum</span>(
<span class="hljs-meta">... </span>    torch.nn.functional.one_hot(predicted_class_ids[<span class="hljs-literal">None</span>, :].clone(), num_classes=num_labels), dim=<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>).to(torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=n("p"),b=a("Example of multi-label classification:"),g=c(),y(u.$$.fragment)},l(l){d=s(l,"P",{});var m=r(d);b=i(m,"Example of multi-label classification:"),m.forEach(o),g=p(l),v(u.$$.fragment,l)},m(l,m){_(l,d,m),e(d,b),_(l,g,m),w(u,l,m),M=!0},p:Lo,i(l){M||(T(u.$$.fragment,l),M=!0)},o(l){k(u.$$.fragment,l),M=!1},d(l){l&&o(d),l&&o(g),E(u,l)}}}function Dc($){let d,b,g,u,M;return{c(){d=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"),M=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){d=s(l,"P",{});var m=r(d);b=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(m,"CODE",{});var J=r(g);u=i(J,"Module"),J.forEach(o),M=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(o)},m(l,m){_(l,d,m),e(d,b),e(d,g),e(g,u),e(d,M)},d(l){l&&o(d)}}}function Kc($){let d,b,g,u,M;return u=new Oo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBFcm5pZU1Gb3JNdWx0aXBsZUNob2ljZSUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyc3VzbmF0byUyRmVybmllLW0tYmFzZV9weXRvcmNoJTIyKSUwQW1vZGVsJTIwJTNEJTIwRXJuaWVNRm9yTXVsdGlwbGVDaG9pY2UuZnJvbV9wcmV0cmFpbmVkKCUyMnN1c25hdG8lMkZlcm5pZS1tLWJhc2VfcHl0b3JjaCUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJJbiUyMEl0YWx5JTJDJTIwcGl6emElMjBzZXJ2ZWQlMjBpbiUyMGZvcm1hbCUyMHNldHRpbmdzJTJDJTIwc3VjaCUyMGFzJTIwYXQlMjBhJTIwcmVzdGF1cmFudCUyQyUyMGlzJTIwcHJlc2VudGVkJTIwdW5zbGljZWQuJTIyJTBBY2hvaWNlMCUyMCUzRCUyMCUyMkl0JTIwaXMlMjBlYXRlbiUyMHdpdGglMjBhJTIwZm9yayUyMGFuZCUyMGElMjBrbmlmZS4lMjIlMEFjaG9pY2UxJTIwJTNEJTIwJTIySXQlMjBpcyUyMGVhdGVuJTIwd2hpbGUlMjBoZWxkJTIwaW4lMjB0aGUlMjBoYW5kLiUyMiUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvcigwKS51bnNxdWVlemUoMCklMjAlMjAlMjMlMjBjaG9pY2UwJTIwaXMlMjBjb3JyZWN0JTIwKGFjY29yZGluZyUyMHRvJTIwV2lraXBlZGlhJTIwJTNCKSklMkMlMjBiYXRjaCUyMHNpemUlMjAxJTBBJTBBZW5jb2RpbmclMjAlM0QlMjB0b2tlbml6ZXIoJTVCcHJvbXB0JTJDJTIwcHJvbXB0JTVEJTJDJTIwJTVCY2hvaWNlMCUyQyUyMGNob2ljZTElNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTIwcGFkZGluZyUzRFRydWUpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqJTdCayUzQSUyMHYudW5zcXVlZXplKDApJTIwZm9yJTIwayUyQyUyMHYlMjBpbiUyMGVuY29kaW5nLml0ZW1zKCklN0QlMkMlMjBsYWJlbHMlM0RsYWJlbHMpJTIwJTIwJTIzJTIwYmF0Y2glMjBzaXplJTIwaXMlMjAxJTBBJTBBJTIzJTIwdGhlJTIwbGluZWFyJTIwY2xhc3NpZmllciUyMHN0aWxsJTIwbmVlZHMlMjB0byUyMGJlJTIwdHJhaW5lZCUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3MlMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ErnieMForMultipleChoice
<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;susnato/ernie-m-base_pytorch&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ErnieMForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;susnato/ernie-m-base_pytorch&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(){d=n("p"),b=a("Example:"),g=c(),y(u.$$.fragment)},l(l){d=s(l,"P",{});var m=r(d);b=i(m,"Example:"),m.forEach(o),g=p(l),v(u.$$.fragment,l)},m(l,m){_(l,d,m),e(d,b),_(l,g,m),w(u,l,m),M=!0},p:Lo,i(l){M||(T(u.$$.fragment,l),M=!0)},o(l){k(u.$$.fragment,l),M=!1},d(l){l&&o(d),l&&o(g),E(u,l)}}}function ep($){let d,b,g,u,M;return{c(){d=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"),M=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){d=s(l,"P",{});var m=r(d);b=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(m,"CODE",{});var J=r(g);u=i(J,"Module"),J.forEach(o),M=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(o)},m(l,m){_(l,d,m),e(d,b),e(d,g),e(g,u),e(d,M)},d(l){l&&o(d)}}}function tp($){let d,b,g,u,M;return u=new Oo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBFcm5pZU1Gb3JUb2tlbkNsYXNzaWZpY2F0aW9uJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJzdXNuYXRvJTJGZXJuaWUtbS1iYXNlX3B5dG9yY2glMjIpJTBBbW9kZWwlMjAlM0QlMjBFcm5pZU1Gb3JUb2tlbkNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJzdXNuYXRvJTJGZXJuaWUtbS1iYXNlX3B5dG9yY2glMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUwQSUyMCUyMCUyMCUyMCUyMkh1Z2dpbmdGYWNlJTIwaXMlMjBhJTIwY29tcGFueSUyMGJhc2VkJTIwaW4lMjBQYXJpcyUyMGFuZCUyME5ldyUyMFlvcmslMjIlMkMlMjBhZGRfc3BlY2lhbF90b2tlbnMlM0RGYWxzZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMEEpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTIwJTNEJTIwbG9naXRzLmFyZ21heCgtMSklMEElMEElMjMlMjBOb3RlJTIwdGhhdCUyMHRva2VucyUyMGFyZSUyMGNsYXNzaWZpZWQlMjByYXRoZXIlMjB0aGVuJTIwaW5wdXQlMjB3b3JkcyUyMHdoaWNoJTIwbWVhbnMlMjB0aGF0JTBBJTIzJTIwdGhlcmUlMjBtaWdodCUyMGJlJTIwbW9yZSUyMHByZWRpY3RlZCUyMHRva2VuJTIwY2xhc3NlcyUyMHRoYW4lMjB3b3Jkcy4lMEElMjMlMjBNdWx0aXBsZSUyMHRva2VuJTIwY2xhc3NlcyUyMG1pZ2h0JTIwYWNjb3VudCUyMGZvciUyMHRoZSUyMHNhbWUlMjB3b3JkJTBBcHJlZGljdGVkX3Rva2Vuc19jbGFzc2VzJTIwJTNEJTIwJTVCbW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCdC5pdGVtKCklNUQlMjBmb3IlMjB0JTIwaW4lMjBwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTVCMCU1RCU1RCUwQSUwQWxhYmVscyUyMCUzRCUyMHByZWRpY3RlZF90b2tlbl9jbGFzc19pZHMlMEFsb3NzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBsYWJlbHMlM0RsYWJlbHMpLmxvc3M=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ErnieMForTokenClassification
<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;susnato/ernie-m-base_pytorch&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ErnieMForTokenClassification.from_pretrained(<span class="hljs-string">&quot;susnato/ernie-m-base_pytorch&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;HuggingFace is a company based in Paris and New York&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </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>predicted_token_class_ids = logits.argmax(-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Note that tokens are classified rather then input words which means that</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># there might be more predicted token classes than words.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Multiple token classes might account for the same word</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes = [model.config.id2label[t.item()] <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> predicted_token_class_ids[<span class="hljs-number">0</span>]]

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=n("p"),b=a("Example:"),g=c(),y(u.$$.fragment)},l(l){d=s(l,"P",{});var m=r(d);b=i(m,"Example:"),m.forEach(o),g=p(l),v(u.$$.fragment,l)},m(l,m){_(l,d,m),e(d,b),_(l,g,m),w(u,l,m),M=!0},p:Lo,i(l){M||(T(u.$$.fragment,l),M=!0)},o(l){k(u.$$.fragment,l),M=!1},d(l){l&&o(d),l&&o(g),E(u,l)}}}function op($){let d,b,g,u,M;return{c(){d=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"),M=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){d=s(l,"P",{});var m=r(d);b=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(m,"CODE",{});var J=r(g);u=i(J,"Module"),J.forEach(o),M=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(o)},m(l,m){_(l,d,m),e(d,b),e(d,g),e(g,u),e(d,M)},d(l){l&&o(d)}}}function np($){let d,b,g,u,M;return u=new Oo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBFcm5pZU1Gb3JRdWVzdGlvbkFuc3dlcmluZyUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyc3VzbmF0byUyRmVybmllLW0tYmFzZV9weXRvcmNoJTIyKSUwQW1vZGVsJTIwJTNEJTIwRXJuaWVNRm9yUXVlc3Rpb25BbnN3ZXJpbmcuZnJvbV9wcmV0cmFpbmVkKCUyMnN1c25hdG8lMkZlcm5pZS1tLWJhc2VfcHl0b3JjaCUyMiklMEElMEFxdWVzdGlvbiUyQyUyMHRleHQlMjAlM0QlMjAlMjJXaG8lMjB3YXMlMjBKaW0lMjBIZW5zb24lM0YlMjIlMkMlMjAlMjJKaW0lMjBIZW5zb24lMjB3YXMlMjBhJTIwbmljZSUyMHB1cHBldCUyMiUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihxdWVzdGlvbiUyQyUyMHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBYW5zd2VyX3N0YXJ0X2luZGV4JTIwJTNEJTIwb3V0cHV0cy5zdGFydF9sb2dpdHMuYXJnbWF4KCklMEFhbnN3ZXJfZW5kX2luZGV4JTIwJTNEJTIwb3V0cHV0cy5lbmRfbG9naXRzLmFyZ21heCgpJTBBJTBBcHJlZGljdF9hbnN3ZXJfdG9rZW5zJTIwJTNEJTIwaW5wdXRzLmlucHV0X2lkcyU1QjAlMkMlMjBhbnN3ZXJfc3RhcnRfaW5kZXglMjAlM0ElMjBhbnN3ZXJfZW5kX2luZGV4JTIwJTJCJTIwMSU1RCUwQSUwQSUyMyUyMHRhcmdldCUyMGlzJTIwJTIybmljZSUyMHB1cHBldCUyMiUwQXRhcmdldF9zdGFydF9pbmRleCUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxNCU1RCklMEF0YXJnZXRfZW5kX2luZGV4JTIwJTNEJTIwdG9yY2gudGVuc29yKCU1QjE1JTVEKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMHN0YXJ0X3Bvc2l0aW9ucyUzRHRhcmdldF9zdGFydF9pbmRleCUyQyUyMGVuZF9wb3NpdGlvbnMlM0R0YXJnZXRfZW5kX2luZGV4KSUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3M=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ErnieMForQuestionAnswering
<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;susnato/ernie-m-base_pytorch&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ErnieMForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;susnato/ernie-m-base_pytorch&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, 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>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>answer_start_index = outputs.start_logits.argmax()
<span class="hljs-meta">&gt;&gt;&gt; </span>answer_end_index = outputs.end_logits.argmax()

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># target is &quot;nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_start_index = torch.tensor([<span class="hljs-number">14</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = torch.tensor([<span class="hljs-number">15</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss`}}),{c(){d=n("p"),b=a("Example:"),g=c(),y(u.$$.fragment)},l(l){d=s(l,"P",{});var m=r(d);b=i(m,"Example:"),m.forEach(o),g=p(l),v(u.$$.fragment,l)},m(l,m){_(l,d,m),e(d,b),_(l,g,m),w(u,l,m),M=!0},p:Lo,i(l){M||(T(u.$$.fragment,l),M=!0)},o(l){k(u.$$.fragment,l),M=!1},d(l){l&&o(d),l&&o(g),E(u,l)}}}function sp($){let d,b,g,u,M;return{c(){d=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"),M=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){d=s(l,"P",{});var m=r(d);b=i(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(m,"CODE",{});var J=r(g);u=i(J,"Module"),J.forEach(o),M=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(o)},m(l,m){_(l,d,m),e(d,b),e(d,g),e(g,u),e(d,M)},d(l){l&&o(d)}}}function rp($){let d,b,g,u,M,l,m,J,sr,rs,ne,ke,Yo,nt,rr,Do,ar,as,Ee,ir,st,lr,dr,is,ao,cr,ls,io,Ko,pr,ds,lo,hr,cs,Z,en,mr,ur,se,fr,tn,gr,_r,on,Mr,br,yr,nn,vr,wr,sn,Tr,ps,H,kr,rt,Er,$r,at,Jr,Cr,hs,re,$e,rn,it,jr,an,zr,ms,S,ln,co,Ur,Fr,dn,po,xr,Ir,cn,ho,Wr,Nr,pn,mo,qr,us,ae,Je,hn,lt,Zr,mn,Sr,fs,q,dt,Br,P,Ar,uo,Gr,Vr,un,Rr,Pr,ct,Xr,Hr,Qr,ie,Lr,fo,Or,Yr,go,Dr,Kr,ea,le,ta,fn,oa,na,gn,sa,ra,gs,de,Ce,_n,pt,aa,Mn,ia,_s,j,ht,la,mt,da,bn,ca,pa,ha,Q,ut,ma,yn,ua,fa,ft,_o,ga,vn,_a,Ma,Mo,ba,wn,ya,va,je,gt,wa,_t,Ta,Tn,ka,Ea,$a,ze,Mt,Ja,bt,Ca,bo,ja,za,Ua,yo,yt,Ms,ce,Ue,kn,vt,Fa,En,xa,bs,z,wt,Ia,$n,Wa,Na,Tt,qa,vo,Za,Sa,Ba,kt,Aa,Et,Ga,Va,Ra,B,$t,Pa,pe,Xa,wo,Ha,Qa,Jn,La,Oa,Ya,Fe,Da,xe,ys,he,Ie,Cn,Jt,Ka,jn,ei,vs,U,Ct,ti,zn,oi,ni,jt,si,To,ri,ai,ii,zt,li,Ut,di,ci,pi,N,Ft,hi,me,mi,ko,ui,fi,Un,gi,_i,Mi,We,bi,Ne,yi,qe,ws,ue,Ze,Fn,xt,vi,xn,wi,Ts,F,It,Ti,In,ki,Ei,Wt,$i,Eo,Ji,Ci,ji,Nt,zi,qt,Ui,Fi,xi,A,Zt,Ii,fe,Wi,$o,Ni,qi,Wn,Zi,Si,Bi,Se,Ai,Be,ks,ge,Ae,Nn,St,Gi,qn,Vi,Es,x,Bt,Ri,Zn,Pi,Xi,At,Hi,Jo,Qi,Li,Oi,Gt,Yi,Vt,Di,Ki,el,G,Rt,tl,_e,ol,Co,nl,sl,Sn,rl,al,il,Ge,ll,Ve,$s,Me,Re,Bn,Pt,dl,An,cl,Js,I,Xt,pl,be,hl,Gn,ml,ul,Vn,fl,gl,_l,Ht,Ml,jo,bl,yl,vl,Qt,wl,Lt,Tl,kl,El,V,Ot,$l,ye,Jl,zo,Cl,jl,Rn,zl,Ul,Fl,Pe,xl,Xe,Cs,ve,He,Pn,Yt,Il,Xn,Wl,js,W,Dt,Nl,we,ql,Hn,Zl,Sl,Qn,Bl,Al,Gl,Kt,Vl,Uo,Rl,Pl,Xl,eo,Hl,to,Ql,Ll,Ol,L,oo,Yl,Te,Dl,Fo,Kl,ed,Ln,td,od,nd,Qe,zs;return l=new X({}),nt=new X({}),it=new X({}),lt=new X({}),dt=new C({props:{name:"class transformers.ErnieMConfig",anchor:"transformers.ErnieMConfig",parameters:[{name:"vocab_size",val:": int = 250002"},{name:"hidden_size",val:": int = 768"},{name:"num_hidden_layers",val:": int = 12"},{name:"num_attention_heads",val:": int = 12"},{name:"intermediate_size",val:": int = 3072"},{name:"hidden_act",val:": str = 'gelu'"},{name:"hidden_dropout_prob",val:": float = 0.1"},{name:"attention_probs_dropout_prob",val:": float = 0.1"},{name:"max_position_embeddings",val:": int = 514"},{name:"initializer_range",val:": float = 0.02"},{name:"pad_token_id",val:": int = 1"},{name:"layer_norm_eps",val:": float = 1e-05"},{name:"classifier_dropout",val:" = None"},{name:"is_decoder",val:" = False"},{name:"act_dropout",val:" = 0.0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ErnieMConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 250002) &#x2014;
Vocabulary size of <code>inputs_ids</code> in <a href="/docs/transformers/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMModel">ErnieMModel</a>. Also is the vocab size of token embedding matrix.
Defines the number of different tokens that can be represented by the <code>inputs_ids</code> passed when calling
<a href="/docs/transformers/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMModel">ErnieMModel</a>.`,name:"vocab_size"},{anchor:"transformers.ErnieMConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the embedding layer, encoder layers and pooler layer.`,name:"hidden_size"},{anchor:"transformers.ErnieMConfig.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.ErnieMConfig.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.ErnieMConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the feed-forward (ff) layer in the encoder. Input tensors to feed-forward layers are
firstly projected from hidden_size to intermediate_size, and then projected back to hidden_size. Typically
intermediate_size is larger than hidden_size.`,name:"intermediate_size"},{anchor:"transformers.ErnieMConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function in the feed-forward layer. <code>&quot;gelu&quot;</code>, <code>&quot;relu&quot;</code> and any other torch
supported activation functions are supported.`,name:"hidden_act"},{anchor:"transformers.ErnieMConfig.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 and encoder.`,name:"hidden_dropout_prob"},{anchor:"transformers.ErnieMConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability used in <code>MultiHeadAttention</code> in all encoder layers to drop some attention target.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.ErnieMConfig.act_dropout",description:`<strong>act_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
This dropout probability is used in <code>ErnieMEncoderLayer</code> after activation.`,name:"act_dropout"},{anchor:"transformers.ErnieMConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum value of the dimensionality of position encoding, which dictates the maximum supported length
of an input sequence.`,name:"max_position_embeddings"},{anchor:"transformers.ErnieMConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-05) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.ErnieMConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The dropout ratio for the classification head.`,name:"classifier_dropout"},{anchor:"transformers.ErnieMConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the normal initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.ErnieMConfig.pad_token_id(int,",description:`<strong>pad_token_id(<code>int</code>,</strong> <em>optional</em>, defaults to 1) &#x2014;
The index of padding token in the token vocabulary.`,name:"pad_token_id(int,"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/ernie_m/configuration_ernie_m.py#L31"}}),pt=new X({}),ht=new C({props:{name:"class transformers.ErnieMTokenizer",anchor:"transformers.ErnieMTokenizer",parameters:[{name:"sentencepiece_model_ckpt",val:""},{name:"vocab_file",val:" = None"},{name:"do_lower_case",val:" = False"},{name:"encoding",val:" = 'utf8'"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ErnieMTokenizer.sentencepiece_model_file",description:`<strong>sentencepiece_model_file</strong> (<code>str</code>) &#x2014;
The file path of sentencepiece model.`,name:"sentencepiece_model_file"},{anchor:"transformers.ErnieMTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The file path of the vocabulary.`,name:"vocab_file"},{anchor:"transformers.ErnieMTokenizer.do_lower_case",description:`<strong>do_lower_case</strong> (<code>str</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.ErnieMTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[UNK]&quot;</code>) &#x2014;
A special token representing the <code>unknown (out-of-vocabulary)</code> token. An unknown token is set to be
<code>unk_token</code> inorder to be converted to an ID.`,name:"unk_token"},{anchor:"transformers.ErnieMTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[SEP]&quot;</code>) &#x2014;
A special token separating two different sentences in the same input.`,name:"sep_token"},{anchor:"transformers.ErnieMTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
A special token used to make arrays of tokens the same size for batching purposes.`,name:"pad_token"},{anchor:"transformers.ErnieMTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>) &#x2014;
A special token used for sequence classification. It is the last token of the sequence when built with
special tokens.`,name:"cls_token"},{anchor:"transformers.ErnieMTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[MASK]&quot;</code>) &#x2014;
A special token representing a masked token. This is the token used in the masked language modeling task
which the model tries to predict the original unmasked ones.`,name:"mask_token"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/ernie_m/tokenization_ernie_m.py#L62"}}),ut=new C({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.ErnieMTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:""},{name:"token_ids_1",val:" = None"}],parametersDescription:[{anchor:"transformers.ErnieMTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.ErnieMTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/ernie_m/tokenization_ernie_m.py#L262",returnDescription:`
<p>List of input_id with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),gt=new C({props:{name:"get_special_tokens_mask",anchor:"transformers.ErnieMTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:""},{name:"token_ids_1",val:" = None"},{name:"already_has_special_tokens",val:" = False"}],parametersDescription:[{anchor:"transformers.ErnieMTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of ids of the first sequence.`,name:"token_ids_0"},{anchor:"transformers.ErnieMTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.ErnieMTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>str</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/ernie_m/tokenization_ernie_m.py#L305",returnDescription:`
<p>The list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Mt=new C({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.ErnieMTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.ErnieMTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
The first tokenized sequence.`,name:"token_ids_0"},{anchor:"transformers.ErnieMTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
The second tokenized sequence.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/ernie_m/tokenization_ernie_m.py#L334",returnDescription:`
<p>The token type ids.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),yt=new C({props:{name:"save_vocabulary",anchor:"transformers.ErnieMTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/ernie_m/tokenization_ernie_m.py#L403"}}),vt=new X({}),wt=new C({props:{name:"class transformers.ErnieMModel",anchor:"transformers.ErnieMModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.ErnieMModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMConfig">ErnieMConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/ernie_m/modeling_ernie_m.py#L500"}}),$t=new C({props:{name:"forward",anchor:"transformers.ErnieMModel.forward",parameters:[{name:"input_ids",val:": typing.Union[<built-in method tensor of type object at 0x7fd2970d3500>, NoneType] = None"},{name:"position_ids",val:": typing.Union[<built-in method tensor of type object at 0x7fd2970d3500>, NoneType] = None"},{name:"attention_mask",val:": typing.Union[<built-in method tensor of type object at 0x7fd2970d3500>, NoneType] = None"},{name:"head_mask",val:": typing.Union[<built-in method tensor of type object at 0x7fd2970d3500>, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[<built-in method tensor of type object at 0x7fd2970d3500>, NoneType] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[<built-in method tensor of type object at 0x7fd2970d3500>]], NoneType] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ErnieMModel.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/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMTokenizer">ErnieMTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.ErnieMModel.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.ErnieMModel.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.ErnieMModel.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.ErnieMModel.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.ErnieMModel.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.ErnieMModel.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.ErnieMModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/ernie_m/modeling_ernie_m.py#L523",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMConfig"
>ErnieMConfig</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>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 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>
<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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Fe=new Ho({props:{$$slots:{default:[Hc]},$$scope:{ctx:$}}}),xe=new Qo({props:{anchor:"transformers.ErnieMModel.forward.example",$$slots:{default:[Qc]},$$scope:{ctx:$}}}),Jt=new X({}),Ct=new C({props:{name:"class transformers.ErnieMForSequenceClassification",anchor:"transformers.ErnieMForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ErnieMForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMConfig">ErnieMConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/ernie_m/modeling_ernie_m.py#L614"}}),Ft=new C({props:{name:"forward",anchor:"transformers.ErnieMForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",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:"past_key_values",val:": typing.Optional[typing.List[torch.Tensor]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = True"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"transformers.ErnieMForSequenceClassification.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/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMTokenizer">ErnieMTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.ErnieMForSequenceClassification.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.ErnieMForSequenceClassification.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.ErnieMForSequenceClassification.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.ErnieMForSequenceClassification.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.ErnieMForSequenceClassification.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.ErnieMForSequenceClassification.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.ErnieMForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ErnieMForSequenceClassification.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/v4.30.0/src/transformers/models/ernie_m/modeling_ernie_m.py#L631",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMConfig"
>ErnieMConfig</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 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) 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/v4.30.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),We=new Ho({props:{$$slots:{default:[Lc]},$$scope:{ctx:$}}}),Ne=new Qo({props:{anchor:"transformers.ErnieMForSequenceClassification.forward.example",$$slots:{default:[Oc]},$$scope:{ctx:$}}}),qe=new Qo({props:{anchor:"transformers.ErnieMForSequenceClassification.forward.example-2",$$slots:{default:[Yc]},$$scope:{ctx:$}}}),xt=new X({}),It=new C({props:{name:"class transformers.ErnieMForMultipleChoice",anchor:"transformers.ErnieMForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ErnieMForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMConfig">ErnieMConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/ernie_m/modeling_ernie_m.py#L716"}}),Zt=new C({props:{name:"forward",anchor:"transformers.ErnieMForMultipleChoice.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",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] = True"}],parametersDescription:[{anchor:"transformers.ErnieMForMultipleChoice.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/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMTokenizer">ErnieMTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.ErnieMForMultipleChoice.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.ErnieMForMultipleChoice.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.ErnieMForMultipleChoice.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.ErnieMForMultipleChoice.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.ErnieMForMultipleChoice.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.ErnieMForMultipleChoice.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.ErnieMForMultipleChoice.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ErnieMForMultipleChoice.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/v4.30.0/src/transformers/models/ernie_m/modeling_ernie_m.py#L731",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/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/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMConfig"
>ErnieMConfig</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/v4.30.0/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Se=new Ho({props:{$$slots:{default:[Dc]},$$scope:{ctx:$}}}),Be=new Qo({props:{anchor:"transformers.ErnieMForMultipleChoice.forward.example",$$slots:{default:[Kc]},$$scope:{ctx:$}}}),St=new X({}),Bt=new C({props:{name:"class transformers.ErnieMForTokenClassification",anchor:"transformers.ErnieMForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ErnieMForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMConfig">ErnieMConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/ernie_m/modeling_ernie_m.py#L806"}}),Rt=new C({props:{name:"forward",anchor:"transformers.ErnieMForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",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:"past_key_values",val:": typing.Optional[typing.List[torch.Tensor]] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = True"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"transformers.ErnieMForTokenClassification.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/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMTokenizer">ErnieMTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.ErnieMForTokenClassification.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.ErnieMForTokenClassification.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.ErnieMForTokenClassification.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.ErnieMForTokenClassification.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.ErnieMForTokenClassification.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.ErnieMForTokenClassification.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.ErnieMForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ErnieMForTokenClassification.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/v4.30.0/src/transformers/models/ernie_m/modeling_ernie_m.py#L822",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMConfig"
>ErnieMConfig</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 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 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/v4.30.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ge=new Ho({props:{$$slots:{default:[ep]},$$scope:{ctx:$}}}),Ve=new Qo({props:{anchor:"transformers.ErnieMForTokenClassification.forward.example",$$slots:{default:[tp]},$$scope:{ctx:$}}}),Pt=new X({}),Xt=new C({props:{name:"class transformers.ErnieMForQuestionAnswering",anchor:"transformers.ErnieMForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ErnieMForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMConfig">ErnieMConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/ernie_m/modeling_ernie_m.py#L887"}}),Ot=new C({props:{name:"forward",anchor:"transformers.ErnieMForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",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] = True"}],parametersDescription:[{anchor:"transformers.ErnieMForQuestionAnswering.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/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMTokenizer">ErnieMTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.ErnieMForQuestionAnswering.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.ErnieMForQuestionAnswering.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.ErnieMForQuestionAnswering.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.ErnieMForQuestionAnswering.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.ErnieMForQuestionAnswering.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.ErnieMForQuestionAnswering.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.ErnieMForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ErnieMForQuestionAnswering.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.ErnieMForQuestionAnswering.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/v4.30.0/src/transformers/models/ernie_m/modeling_ernie_m.py#L899",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMConfig"
>ErnieMConfig</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 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end 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/v4.30.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Pe=new Ho({props:{$$slots:{default:[op]},$$scope:{ctx:$}}}),Xe=new Qo({props:{anchor:"transformers.ErnieMForQuestionAnswering.forward.example",$$slots:{default:[np]},$$scope:{ctx:$}}}),Yt=new X({}),Dt=new C({props:{name:"class transformers.ErnieMForInformationExtraction",anchor:"transformers.ErnieMForInformationExtraction",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ErnieMForInformationExtraction.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMConfig">ErnieMConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/ernie_m/modeling_ernie_m.py#L985"}}),oo=new C({props:{name:"forward",anchor:"transformers.ErnieMForInformationExtraction.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",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] = True"}],parametersDescription:[{anchor:"transformers.ErnieMForInformationExtraction.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/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMTokenizer">ErnieMTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.ErnieMForInformationExtraction.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.ErnieMForInformationExtraction.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.ErnieMForInformationExtraction.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.ErnieMForInformationExtraction.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.ErnieMForInformationExtraction.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.ErnieMForInformationExtraction.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.ErnieMForInformationExtraction.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.30.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ErnieMForInformationExtraction.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for position (index) for computing the start_positions loss. Position outside of the sequence are
not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.ErnieMForInformationExtraction.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) for computing the end_positions loss. Position outside of the sequence are not
taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/ernie_m/modeling_ernie_m.py#L994"}}),Qe=new Ho({props:{$$slots:{default:[sp]},$$scope:{ctx:$}}}),{c(){d=n("meta"),b=c(),g=n("h1"),u=n("a"),M=n("span"),y(l.$$.fragment),m=c(),J=n("span"),sr=a("ErnieM"),rs=c(),ne=n("h2"),ke=n("a"),Yo=n("span"),y(nt.$$.fragment),rr=c(),Do=n("span"),ar=a("Overview"),as=c(),Ee=n("p"),ir=a("The ErnieM model was proposed in "),st=n("a"),lr=a(`ERNIE-M: Enhanced Multilingual Representation by Aligning
Cross-lingual Semantics with Monolingual Corpora`),dr=a(`  by Xuan Ouyang, Shuohuan Wang, Chao Pang, Yu Sun,
Hao Tian, Hua Wu, Haifeng Wang.`),is=c(),ao=n("p"),cr=a("The abstract from the paper is the following:"),ls=c(),io=n("p"),Ko=n("em"),pr=a("Recent studies have demonstrated that pre-trained cross-lingual models achieve impressive performance in downstream cross-lingual tasks. This improvement benefits from learning a large amount of monolingual and parallel corpora. Although it is generally acknowledged that parallel corpora are critical for improving the model performance, existing methods are often constrained by the size of parallel corpora, especially for lowresource languages. In this paper, we propose ERNIE-M, a new training method that encourages the model to align the representation of multiple languages with monolingual corpora, to overcome the constraint that the parallel corpus size places on the model performance. Our key insight is to integrate back-translation into the pre-training process. We generate pseudo-parallel sentence pairs on a monolingual corpus to enable the learning of semantic alignments between different languages, thereby enhancing the semantic modeling of cross-lingual models. Experimental results show that ERNIE-M outperforms existing cross-lingual models and delivers new state-of-the-art results in various cross-lingual downstream tasks."),ds=c(),lo=n("p"),hr=a("Tips:"),cs=c(),Z=n("ol"),en=n("li"),mr=a("Ernie-M is a BERT-like model so it is a stacked Transformer Encoder."),ur=c(),se=n("li"),fr=a("Instead of using MaskedLM for pretraining (like BERT) the authors used two novel techniques: "),tn=n("code"),gr=a("Cross-attention Masked Language Modeling"),_r=a(" and "),on=n("code"),Mr=a("Back-translation Masked Language Modeling"),br=a(". For now these two LMHead objectives are not implemented here."),yr=c(),nn=n("li"),vr=a("It is a multilingual language model."),wr=c(),sn=n("li"),Tr=a("Next Sentence Prediction was not used in pretraining process."),ps=c(),H=n("p"),kr=a("This model was contributed by "),rt=n("a"),Er=a("Susnato Dhar"),$r=a(". The original code can be found "),at=n("a"),Jr=a("here"),Cr=a("."),hs=c(),re=n("h2"),$e=n("a"),rn=n("span"),y(it.$$.fragment),jr=c(),an=n("span"),zr=a("Documentation resources"),ms=c(),S=n("ul"),ln=n("li"),co=n("a"),Ur=a("Text classification task guide"),Fr=c(),dn=n("li"),po=n("a"),xr=a("Token classification task guide"),Ir=c(),cn=n("li"),ho=n("a"),Wr=a("Question answering task guide"),Nr=c(),pn=n("li"),mo=n("a"),qr=a("Multiple choice task guide"),us=c(),ae=n("h2"),Je=n("a"),hn=n("span"),y(lt.$$.fragment),Zr=c(),mn=n("span"),Sr=a("ErnieMConfig"),fs=c(),q=n("div"),y(dt.$$.fragment),Br=c(),P=n("p"),Ar=a("This is the configuration class to store the configuration of a "),uo=n("a"),Gr=a("ErnieMModel"),Vr=a(`. It is used to instantiate a
Ernie-M 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 `),un=n("code"),Rr=a("Ernie-M"),Pr=c(),ct=n("a"),Xr=a("susnato/ernie-m-base_pytorch"),Hr=a(" architecture."),Qr=c(),ie=n("p"),Lr=a("Configuration objects inherit from "),fo=n("a"),Or=a("PretrainedConfig"),Yr=a(` and can be used to control the model outputs. Read the
documentation from `),go=n("a"),Dr=a("PretrainedConfig"),Kr=a(" for more information."),ea=c(),le=n("p"),ta=a(`A normal_initializer initializes weight matrices as normal distributions. See
`),fn=n("code"),oa=a("ErnieMPretrainedModel._init_weights()"),na=a(" for how weights are initialized in "),gn=n("code"),sa=a("ErnieMModel"),ra=a("."),gs=c(),de=n("h2"),Ce=n("a"),_n=n("span"),y(pt.$$.fragment),aa=c(),Mn=n("span"),ia=a("ErnieMTokenizer"),_s=c(),j=n("div"),y(ht.$$.fragment),la=c(),mt=n("p"),da=a("Constructs a Ernie-M tokenizer. It uses the "),bn=n("code"),ca=a("sentencepiece"),pa=a(" tools to cut the words to sub-words."),ha=c(),Q=n("div"),y(ut.$$.fragment),ma=c(),yn=n("p"),ua=a(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An ErnieM sequence has the following format:`),fa=c(),ft=n("ul"),_o=n("li"),ga=a("single sequence: "),vn=n("code"),_a=a("[CLS] X [SEP]"),Ma=c(),Mo=n("li"),ba=a("pair of sequences: "),wn=n("code"),ya=a("[CLS] A [SEP] [SEP] B [SEP]"),va=c(),je=n("div"),y(gt.$$.fragment),wa=c(),_t=n("p"),Ta=a(`Retrieves sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Tn=n("code"),ka=a("encode"),Ea=a(" method."),$a=c(),ze=n("div"),y(Mt.$$.fragment),Ja=c(),bt=n("p"),Ca=a("Create the token type IDs corresponding to the sequences passed. "),bo=n("a"),ja=a(`What are token type
IDs?`),za=a(` Should be overridden in a subclass if the model has a special way of
building: those.`),Ua=c(),yo=n("div"),y(yt.$$.fragment),Ms=c(),ce=n("h2"),Ue=n("a"),kn=n("span"),y(vt.$$.fragment),Fa=c(),En=n("span"),xa=a("ErnieMModel"),bs=c(),z=n("div"),y(wt.$$.fragment),Ia=c(),$n=n("p"),Wa=a("The bare ErnieM Model transformer outputting raw hidden-states without any specific head on top."),Na=c(),Tt=n("p"),qa=a("This model inherits from "),vo=n("a"),Za=a("PreTrainedModel"),Sa=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.)`),Ba=c(),kt=n("p"),Aa=a("This model is a PyTorch "),Et=n("a"),Ga=a("torch.nn.Module"),Va=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ra=c(),B=n("div"),y($t.$$.fragment),Pa=c(),pe=n("p"),Xa=a("The "),wo=n("a"),Ha=a("ErnieMModel"),Qa=a(" forward method, overrides the "),Jn=n("code"),La=a("__call__"),Oa=a(" special method."),Ya=c(),y(Fe.$$.fragment),Da=c(),y(xe.$$.fragment),ys=c(),he=n("h2"),Ie=n("a"),Cn=n("span"),y(Jt.$$.fragment),Ka=c(),jn=n("span"),ei=a("ErnieMForSequenceClassification"),vs=c(),U=n("div"),y(Ct.$$.fragment),ti=c(),zn=n("p"),oi=a(`ErnieM Model transformer with a sequence classification/regression head on top (a linear layer on top of
the pooled output) e.g. for GLUE tasks.`),ni=c(),jt=n("p"),si=a("This model inherits from "),To=n("a"),ri=a("PreTrainedModel"),ai=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.)`),ii=c(),zt=n("p"),li=a("This model is a PyTorch "),Ut=n("a"),di=a("torch.nn.Module"),ci=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),pi=c(),N=n("div"),y(Ft.$$.fragment),hi=c(),me=n("p"),mi=a("The "),ko=n("a"),ui=a("ErnieMForSequenceClassification"),fi=a(" forward method, overrides the "),Un=n("code"),gi=a("__call__"),_i=a(" special method."),Mi=c(),y(We.$$.fragment),bi=c(),y(Ne.$$.fragment),yi=c(),y(qe.$$.fragment),ws=c(),ue=n("h2"),Ze=n("a"),Fn=n("span"),y(xt.$$.fragment),vi=c(),xn=n("span"),wi=a("ErnieMForMultipleChoice"),Ts=c(),F=n("div"),y(It.$$.fragment),Ti=c(),In=n("p"),ki=a(`ErnieM 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.`),Ei=c(),Wt=n("p"),$i=a("This model inherits from "),Eo=n("a"),Ji=a("PreTrainedModel"),Ci=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.)`),ji=c(),Nt=n("p"),zi=a("This model is a PyTorch "),qt=n("a"),Ui=a("torch.nn.Module"),Fi=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),xi=c(),A=n("div"),y(Zt.$$.fragment),Ii=c(),fe=n("p"),Wi=a("The "),$o=n("a"),Ni=a("ErnieMForMultipleChoice"),qi=a(" forward method, overrides the "),Wn=n("code"),Zi=a("__call__"),Si=a(" special method."),Bi=c(),y(Se.$$.fragment),Ai=c(),y(Be.$$.fragment),ks=c(),ge=n("h2"),Ae=n("a"),Nn=n("span"),y(St.$$.fragment),Gi=c(),qn=n("span"),Vi=a("ErnieMForTokenClassification"),Es=c(),x=n("div"),y(Bt.$$.fragment),Ri=c(),Zn=n("p"),Pi=a(`ErnieM 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.`),Xi=c(),At=n("p"),Hi=a("This model inherits from "),Jo=n("a"),Qi=a("PreTrainedModel"),Li=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.)`),Oi=c(),Gt=n("p"),Yi=a("This model is a PyTorch "),Vt=n("a"),Di=a("torch.nn.Module"),Ki=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),el=c(),G=n("div"),y(Rt.$$.fragment),tl=c(),_e=n("p"),ol=a("The "),Co=n("a"),nl=a("ErnieMForTokenClassification"),sl=a(" forward method, overrides the "),Sn=n("code"),rl=a("__call__"),al=a(" special method."),il=c(),y(Ge.$$.fragment),ll=c(),y(Ve.$$.fragment),$s=c(),Me=n("h2"),Re=n("a"),Bn=n("span"),y(Pt.$$.fragment),dl=c(),An=n("span"),cl=a("ErnieMForQuestionAnswering"),Js=c(),I=n("div"),y(Xt.$$.fragment),pl=c(),be=n("p"),hl=a(`ErnieM 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 `),Gn=n("code"),ml=a("span start logits"),ul=a(" and "),Vn=n("code"),fl=a("span end logits"),gl=a(")."),_l=c(),Ht=n("p"),Ml=a("This model inherits from "),jo=n("a"),bl=a("PreTrainedModel"),yl=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.)`),vl=c(),Qt=n("p"),wl=a("This model is a PyTorch "),Lt=n("a"),Tl=a("torch.nn.Module"),kl=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),El=c(),V=n("div"),y(Ot.$$.fragment),$l=c(),ye=n("p"),Jl=a("The "),zo=n("a"),Cl=a("ErnieMForQuestionAnswering"),jl=a(" forward method, overrides the "),Rn=n("code"),zl=a("__call__"),Ul=a(" special method."),Fl=c(),y(Pe.$$.fragment),xl=c(),y(Xe.$$.fragment),Cs=c(),ve=n("h2"),He=n("a"),Pn=n("span"),y(Yt.$$.fragment),Il=c(),Xn=n("span"),Wl=a("ErnieMForInformationExtraction"),js=c(),W=n("div"),y(Dt.$$.fragment),Nl=c(),we=n("p"),ql=a(`ErnieMForInformationExtraction is a Ernie-M Model with two linear layer on top of the hidden-states output to
compute `),Hn=n("code"),Zl=a("start_prob"),Sl=a(" and "),Qn=n("code"),Bl=a("end_prob"),Al=a(", designed for Universal Information Extraction."),Gl=c(),Kt=n("p"),Vl=a("This model inherits from "),Uo=n("a"),Rl=a("PreTrainedModel"),Pl=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.)`),Xl=c(),eo=n("p"),Hl=a("This model is a PyTorch "),to=n("a"),Ql=a("torch.nn.Module"),Ll=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ol=c(),L=n("div"),y(oo.$$.fragment),Yl=c(),Te=n("p"),Dl=a("The "),Fo=n("a"),Kl=a("ErnieMForInformationExtraction"),ed=a(" forward method, overrides the "),Ln=n("code"),td=a("__call__"),od=a(" special method."),nd=c(),y(Qe.$$.fragment),this.h()},l(t){const f=Pc('[data-svelte="svelte-1phssyn"]',document.head);d=s(f,"META",{name:!0,content:!0}),f.forEach(o),b=p(t),g=s(t,"H1",{class:!0});var no=r(g);u=s(no,"A",{id:!0,class:!0,href:!0});var On=r(u);M=s(On,"SPAN",{});var Yn=r(M);v(l.$$.fragment,Yn),Yn.forEach(o),On.forEach(o),m=p(no),J=s(no,"SPAN",{});var Dn=r(J);sr=i(Dn,"ErnieM"),Dn.forEach(o),no.forEach(o),rs=p(t),ne=s(t,"H2",{class:!0});var so=r(ne);ke=s(so,"A",{id:!0,class:!0,href:!0});var Kn=r(ke);Yo=s(Kn,"SPAN",{});var es=r(Yo);v(nt.$$.fragment,es),es.forEach(o),Kn.forEach(o),rr=p(so),Do=s(so,"SPAN",{});var ts=r(Do);ar=i(ts,"Overview"),ts.forEach(o),so.forEach(o),as=p(t),Ee=s(t,"P",{});var ro=r(Ee);ir=i(ro,"The ErnieM model was proposed in "),st=s(ro,"A",{href:!0,rel:!0});var os=r(st);lr=i(os,`ERNIE-M: Enhanced Multilingual Representation by Aligning
Cross-lingual Semantics with Monolingual Corpora`),os.forEach(o),dr=i(ro,`  by Xuan Ouyang, Shuohuan Wang, Chao Pang, Yu Sun,
Hao Tian, Hua Wu, Haifeng Wang.`),ro.forEach(o),is=p(t),ao=s(t,"P",{});var ns=r(ao);cr=i(ns,"The abstract from the paper is the following:"),ns.forEach(o),ls=p(t),io=s(t,"P",{});var ss=r(io);Ko=s(ss,"EM",{});var ad=r(Ko);pr=i(ad,"Recent studies have demonstrated that pre-trained cross-lingual models achieve impressive performance in downstream cross-lingual tasks. This improvement benefits from learning a large amount of monolingual and parallel corpora. Although it is generally acknowledged that parallel corpora are critical for improving the model performance, existing methods are often constrained by the size of parallel corpora, especially for lowresource languages. In this paper, we propose ERNIE-M, a new training method that encourages the model to align the representation of multiple languages with monolingual corpora, to overcome the constraint that the parallel corpus size places on the model performance. Our key insight is to integrate back-translation into the pre-training process. We generate pseudo-parallel sentence pairs on a monolingual corpus to enable the learning of semantic alignments between different languages, thereby enhancing the semantic modeling of cross-lingual models. Experimental results show that ERNIE-M outperforms existing cross-lingual models and delivers new state-of-the-art results in various cross-lingual downstream tasks."),ad.forEach(o),ss.forEach(o),ds=p(t),lo=s(t,"P",{});var id=r(lo);hr=i(id,"Tips:"),id.forEach(o),cs=p(t),Z=s(t,"OL",{});var Le=r(Z);en=s(Le,"LI",{});var ld=r(en);mr=i(ld,"Ernie-M is a BERT-like model so it is a stacked Transformer Encoder."),ld.forEach(o),ur=p(Le),se=s(Le,"LI",{});var xo=r(se);fr=i(xo,"Instead of using MaskedLM for pretraining (like BERT) the authors used two novel techniques: "),tn=s(xo,"CODE",{});var dd=r(tn);gr=i(dd,"Cross-attention Masked Language Modeling"),dd.forEach(o),_r=i(xo," and "),on=s(xo,"CODE",{});var cd=r(on);Mr=i(cd,"Back-translation Masked Language Modeling"),cd.forEach(o),br=i(xo,". For now these two LMHead objectives are not implemented here."),xo.forEach(o),yr=p(Le),nn=s(Le,"LI",{});var pd=r(nn);vr=i(pd,"It is a multilingual language model."),pd.forEach(o),wr=p(Le),sn=s(Le,"LI",{});var hd=r(sn);Tr=i(hd,"Next Sentence Prediction was not used in pretraining process."),hd.forEach(o),Le.forEach(o),ps=p(t),H=s(t,"P",{});var Io=r(H);kr=i(Io,"This model was contributed by "),rt=s(Io,"A",{href:!0,rel:!0});var md=r(rt);Er=i(md,"Susnato Dhar"),md.forEach(o),$r=i(Io,". The original code can be found "),at=s(Io,"A",{href:!0,rel:!0});var ud=r(at);Jr=i(ud,"here"),ud.forEach(o),Cr=i(Io,"."),Io.forEach(o),hs=p(t),re=s(t,"H2",{class:!0});var Us=r(re);$e=s(Us,"A",{id:!0,class:!0,href:!0});var fd=r($e);rn=s(fd,"SPAN",{});var gd=r(rn);v(it.$$.fragment,gd),gd.forEach(o),fd.forEach(o),jr=p(Us),an=s(Us,"SPAN",{});var _d=r(an);zr=i(_d,"Documentation resources"),_d.forEach(o),Us.forEach(o),ms=p(t),S=s(t,"UL",{});var Oe=r(S);ln=s(Oe,"LI",{});var Md=r(ln);co=s(Md,"A",{href:!0});var bd=r(co);Ur=i(bd,"Text classification task guide"),bd.forEach(o),Md.forEach(o),Fr=p(Oe),dn=s(Oe,"LI",{});var yd=r(dn);po=s(yd,"A",{href:!0});var vd=r(po);xr=i(vd,"Token classification task guide"),vd.forEach(o),yd.forEach(o),Ir=p(Oe),cn=s(Oe,"LI",{});var wd=r(cn);ho=s(wd,"A",{href:!0});var Td=r(ho);Wr=i(Td,"Question answering task guide"),Td.forEach(o),wd.forEach(o),Nr=p(Oe),pn=s(Oe,"LI",{});var kd=r(pn);mo=s(kd,"A",{href:!0});var Ed=r(mo);qr=i(Ed,"Multiple choice task guide"),Ed.forEach(o),kd.forEach(o),Oe.forEach(o),us=p(t),ae=s(t,"H2",{class:!0});var Fs=r(ae);Je=s(Fs,"A",{id:!0,class:!0,href:!0});var $d=r(Je);hn=s($d,"SPAN",{});var Jd=r(hn);v(lt.$$.fragment,Jd),Jd.forEach(o),$d.forEach(o),Zr=p(Fs),mn=s(Fs,"SPAN",{});var Cd=r(mn);Sr=i(Cd,"ErnieMConfig"),Cd.forEach(o),Fs.forEach(o),fs=p(t),q=s(t,"DIV",{class:!0});var Ye=r(q);v(dt.$$.fragment,Ye),Br=p(Ye),P=s(Ye,"P",{});var De=r(P);Ar=i(De,"This is the configuration class to store the configuration of a "),uo=s(De,"A",{href:!0});var jd=r(uo);Gr=i(jd,"ErnieMModel"),jd.forEach(o),Vr=i(De,`. It is used to instantiate a
Ernie-M 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 `),un=s(De,"CODE",{});var zd=r(un);Rr=i(zd,"Ernie-M"),zd.forEach(o),Pr=p(De),ct=s(De,"A",{href:!0,rel:!0});var Ud=r(ct);Xr=i(Ud,"susnato/ernie-m-base_pytorch"),Ud.forEach(o),Hr=i(De," architecture."),De.forEach(o),Qr=p(Ye),ie=s(Ye,"P",{});var Wo=r(ie);Lr=i(Wo,"Configuration objects inherit from "),fo=s(Wo,"A",{href:!0});var Fd=r(fo);Or=i(Fd,"PretrainedConfig"),Fd.forEach(o),Yr=i(Wo,` and can be used to control the model outputs. Read the
documentation from `),go=s(Wo,"A",{href:!0});var xd=r(go);Dr=i(xd,"PretrainedConfig"),xd.forEach(o),Kr=i(Wo," for more information."),Wo.forEach(o),ea=p(Ye),le=s(Ye,"P",{});var No=r(le);ta=i(No,`A normal_initializer initializes weight matrices as normal distributions. See
`),fn=s(No,"CODE",{});var Id=r(fn);oa=i(Id,"ErnieMPretrainedModel._init_weights()"),Id.forEach(o),na=i(No," for how weights are initialized in "),gn=s(No,"CODE",{});var Wd=r(gn);sa=i(Wd,"ErnieMModel"),Wd.forEach(o),ra=i(No,"."),No.forEach(o),Ye.forEach(o),gs=p(t),de=s(t,"H2",{class:!0});var xs=r(de);Ce=s(xs,"A",{id:!0,class:!0,href:!0});var Nd=r(Ce);_n=s(Nd,"SPAN",{});var qd=r(_n);v(pt.$$.fragment,qd),qd.forEach(o),Nd.forEach(o),aa=p(xs),Mn=s(xs,"SPAN",{});var Zd=r(Mn);ia=i(Zd,"ErnieMTokenizer"),Zd.forEach(o),xs.forEach(o),_s=p(t),j=s(t,"DIV",{class:!0});var R=r(j);v(ht.$$.fragment,R),la=p(R),mt=s(R,"P",{});var Is=r(mt);da=i(Is,"Constructs a Ernie-M tokenizer. It uses the "),bn=s(Is,"CODE",{});var Sd=r(bn);ca=i(Sd,"sentencepiece"),Sd.forEach(o),pa=i(Is," tools to cut the words to sub-words."),Is.forEach(o),ha=p(R),Q=s(R,"DIV",{class:!0});var qo=r(Q);v(ut.$$.fragment,qo),ma=p(qo),yn=s(qo,"P",{});var Bd=r(yn);ua=i(Bd,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An ErnieM sequence has the following format:`),Bd.forEach(o),fa=p(qo),ft=s(qo,"UL",{});var Ws=r(ft);_o=s(Ws,"LI",{});var sd=r(_o);ga=i(sd,"single sequence: "),vn=s(sd,"CODE",{});var Ad=r(vn);_a=i(Ad,"[CLS] X [SEP]"),Ad.forEach(o),sd.forEach(o),Ma=p(Ws),Mo=s(Ws,"LI",{});var rd=r(Mo);ba=i(rd,"pair of sequences: "),wn=s(rd,"CODE",{});var Gd=r(wn);ya=i(Gd,"[CLS] A [SEP] [SEP] B [SEP]"),Gd.forEach(o),rd.forEach(o),Ws.forEach(o),qo.forEach(o),va=p(R),je=s(R,"DIV",{class:!0});var Ns=r(je);v(gt.$$.fragment,Ns),wa=p(Ns),_t=s(Ns,"P",{});var qs=r(_t);Ta=i(qs,`Retrieves sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Tn=s(qs,"CODE",{});var Vd=r(Tn);ka=i(Vd,"encode"),Vd.forEach(o),Ea=i(qs," method."),qs.forEach(o),Ns.forEach(o),$a=p(R),ze=s(R,"DIV",{class:!0});var Zs=r(ze);v(Mt.$$.fragment,Zs),Ja=p(Zs),bt=s(Zs,"P",{});var Ss=r(bt);Ca=i(Ss,"Create the token type IDs corresponding to the sequences passed. "),bo=s(Ss,"A",{href:!0});var Rd=r(bo);ja=i(Rd,`What are token type
IDs?`),Rd.forEach(o),za=i(Ss,` Should be overridden in a subclass if the model has a special way of
building: those.`),Ss.forEach(o),Zs.forEach(o),Ua=p(R),yo=s(R,"DIV",{class:!0});var Pd=r(yo);v(yt.$$.fragment,Pd),Pd.forEach(o),R.forEach(o),Ms=p(t),ce=s(t,"H2",{class:!0});var Bs=r(ce);Ue=s(Bs,"A",{id:!0,class:!0,href:!0});var Xd=r(Ue);kn=s(Xd,"SPAN",{});var Hd=r(kn);v(vt.$$.fragment,Hd),Hd.forEach(o),Xd.forEach(o),Fa=p(Bs),En=s(Bs,"SPAN",{});var Qd=r(En);xa=i(Qd,"ErnieMModel"),Qd.forEach(o),Bs.forEach(o),bs=p(t),z=s(t,"DIV",{class:!0});var O=r(z);v(wt.$$.fragment,O),Ia=p(O),$n=s(O,"P",{});var Ld=r($n);Wa=i(Ld,"The bare ErnieM Model transformer outputting raw hidden-states without any specific head on top."),Ld.forEach(o),Na=p(O),Tt=s(O,"P",{});var As=r(Tt);qa=i(As,"This model inherits from "),vo=s(As,"A",{href:!0});var Od=r(vo);Za=i(Od,"PreTrainedModel"),Od.forEach(o),Sa=i(As,`. 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.)`),As.forEach(o),Ba=p(O),kt=s(O,"P",{});var Gs=r(kt);Aa=i(Gs,"This model is a PyTorch "),Et=s(Gs,"A",{href:!0,rel:!0});var Yd=r(Et);Ga=i(Yd,"torch.nn.Module"),Yd.forEach(o),Va=i(Gs,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Gs.forEach(o),Ra=p(O),B=s(O,"DIV",{class:!0});var Ke=r(B);v($t.$$.fragment,Ke),Pa=p(Ke),pe=s(Ke,"P",{});var Zo=r(pe);Xa=i(Zo,"The "),wo=s(Zo,"A",{href:!0});var Dd=r(wo);Ha=i(Dd,"ErnieMModel"),Dd.forEach(o),Qa=i(Zo," forward method, overrides the "),Jn=s(Zo,"CODE",{});var Kd=r(Jn);La=i(Kd,"__call__"),Kd.forEach(o),Oa=i(Zo," special method."),Zo.forEach(o),Ya=p(Ke),v(Fe.$$.fragment,Ke),Da=p(Ke),v(xe.$$.fragment,Ke),Ke.forEach(o),O.forEach(o),ys=p(t),he=s(t,"H2",{class:!0});var Vs=r(he);Ie=s(Vs,"A",{id:!0,class:!0,href:!0});var ec=r(Ie);Cn=s(ec,"SPAN",{});var tc=r(Cn);v(Jt.$$.fragment,tc),tc.forEach(o),ec.forEach(o),Ka=p(Vs),jn=s(Vs,"SPAN",{});var oc=r(jn);ei=i(oc,"ErnieMForSequenceClassification"),oc.forEach(o),Vs.forEach(o),vs=p(t),U=s(t,"DIV",{class:!0});var Y=r(U);v(Ct.$$.fragment,Y),ti=p(Y),zn=s(Y,"P",{});var nc=r(zn);oi=i(nc,`ErnieM Model transformer with a sequence classification/regression head on top (a linear layer on top of
the pooled output) e.g. for GLUE tasks.`),nc.forEach(o),ni=p(Y),jt=s(Y,"P",{});var Rs=r(jt);si=i(Rs,"This model inherits from "),To=s(Rs,"A",{href:!0});var sc=r(To);ri=i(sc,"PreTrainedModel"),sc.forEach(o),ai=i(Rs,`. 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.)`),Rs.forEach(o),ii=p(Y),zt=s(Y,"P",{});var Ps=r(zt);li=i(Ps,"This model is a PyTorch "),Ut=s(Ps,"A",{href:!0,rel:!0});var rc=r(Ut);di=i(rc,"torch.nn.Module"),rc.forEach(o),ci=i(Ps,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ps.forEach(o),pi=p(Y),N=s(Y,"DIV",{class:!0});var D=r(N);v(Ft.$$.fragment,D),hi=p(D),me=s(D,"P",{});var So=r(me);mi=i(So,"The "),ko=s(So,"A",{href:!0});var ac=r(ko);ui=i(ac,"ErnieMForSequenceClassification"),ac.forEach(o),fi=i(So," forward method, overrides the "),Un=s(So,"CODE",{});var ic=r(Un);gi=i(ic,"__call__"),ic.forEach(o),_i=i(So," special method."),So.forEach(o),Mi=p(D),v(We.$$.fragment,D),bi=p(D),v(Ne.$$.fragment,D),yi=p(D),v(qe.$$.fragment,D),D.forEach(o),Y.forEach(o),ws=p(t),ue=s(t,"H2",{class:!0});var Xs=r(ue);Ze=s(Xs,"A",{id:!0,class:!0,href:!0});var lc=r(Ze);Fn=s(lc,"SPAN",{});var dc=r(Fn);v(xt.$$.fragment,dc),dc.forEach(o),lc.forEach(o),vi=p(Xs),xn=s(Xs,"SPAN",{});var cc=r(xn);wi=i(cc,"ErnieMForMultipleChoice"),cc.forEach(o),Xs.forEach(o),Ts=p(t),F=s(t,"DIV",{class:!0});var K=r(F);v(It.$$.fragment,K),Ti=p(K),In=s(K,"P",{});var pc=r(In);ki=i(pc,`ErnieM 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.`),pc.forEach(o),Ei=p(K),Wt=s(K,"P",{});var Hs=r(Wt);$i=i(Hs,"This model inherits from "),Eo=s(Hs,"A",{href:!0});var hc=r(Eo);Ji=i(hc,"PreTrainedModel"),hc.forEach(o),Ci=i(Hs,`. 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.)`),Hs.forEach(o),ji=p(K),Nt=s(K,"P",{});var Qs=r(Nt);zi=i(Qs,"This model is a PyTorch "),qt=s(Qs,"A",{href:!0,rel:!0});var mc=r(qt);Ui=i(mc,"torch.nn.Module"),mc.forEach(o),Fi=i(Qs,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Qs.forEach(o),xi=p(K),A=s(K,"DIV",{class:!0});var et=r(A);v(Zt.$$.fragment,et),Ii=p(et),fe=s(et,"P",{});var Bo=r(fe);Wi=i(Bo,"The "),$o=s(Bo,"A",{href:!0});var uc=r($o);Ni=i(uc,"ErnieMForMultipleChoice"),uc.forEach(o),qi=i(Bo," forward method, overrides the "),Wn=s(Bo,"CODE",{});var fc=r(Wn);Zi=i(fc,"__call__"),fc.forEach(o),Si=i(Bo," special method."),Bo.forEach(o),Bi=p(et),v(Se.$$.fragment,et),Ai=p(et),v(Be.$$.fragment,et),et.forEach(o),K.forEach(o),ks=p(t),ge=s(t,"H2",{class:!0});var Ls=r(ge);Ae=s(Ls,"A",{id:!0,class:!0,href:!0});var gc=r(Ae);Nn=s(gc,"SPAN",{});var _c=r(Nn);v(St.$$.fragment,_c),_c.forEach(o),gc.forEach(o),Gi=p(Ls),qn=s(Ls,"SPAN",{});var Mc=r(qn);Vi=i(Mc,"ErnieMForTokenClassification"),Mc.forEach(o),Ls.forEach(o),Es=p(t),x=s(t,"DIV",{class:!0});var ee=r(x);v(Bt.$$.fragment,ee),Ri=p(ee),Zn=s(ee,"P",{});var bc=r(Zn);Pi=i(bc,`ErnieM 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.`),bc.forEach(o),Xi=p(ee),At=s(ee,"P",{});var Os=r(At);Hi=i(Os,"This model inherits from "),Jo=s(Os,"A",{href:!0});var yc=r(Jo);Qi=i(yc,"PreTrainedModel"),yc.forEach(o),Li=i(Os,`. 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.)`),Os.forEach(o),Oi=p(ee),Gt=s(ee,"P",{});var Ys=r(Gt);Yi=i(Ys,"This model is a PyTorch "),Vt=s(Ys,"A",{href:!0,rel:!0});var vc=r(Vt);Di=i(vc,"torch.nn.Module"),vc.forEach(o),Ki=i(Ys,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ys.forEach(o),el=p(ee),G=s(ee,"DIV",{class:!0});var tt=r(G);v(Rt.$$.fragment,tt),tl=p(tt),_e=s(tt,"P",{});var Ao=r(_e);ol=i(Ao,"The "),Co=s(Ao,"A",{href:!0});var wc=r(Co);nl=i(wc,"ErnieMForTokenClassification"),wc.forEach(o),sl=i(Ao," forward method, overrides the "),Sn=s(Ao,"CODE",{});var Tc=r(Sn);rl=i(Tc,"__call__"),Tc.forEach(o),al=i(Ao," special method."),Ao.forEach(o),il=p(tt),v(Ge.$$.fragment,tt),ll=p(tt),v(Ve.$$.fragment,tt),tt.forEach(o),ee.forEach(o),$s=p(t),Me=s(t,"H2",{class:!0});var Ds=r(Me);Re=s(Ds,"A",{id:!0,class:!0,href:!0});var kc=r(Re);Bn=s(kc,"SPAN",{});var Ec=r(Bn);v(Pt.$$.fragment,Ec),Ec.forEach(o),kc.forEach(o),dl=p(Ds),An=s(Ds,"SPAN",{});var $c=r(An);cl=i($c,"ErnieMForQuestionAnswering"),$c.forEach(o),Ds.forEach(o),Js=p(t),I=s(t,"DIV",{class:!0});var te=r(I);v(Xt.$$.fragment,te),pl=p(te),be=s(te,"P",{});var Go=r(be);hl=i(Go,`ErnieM 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 `),Gn=s(Go,"CODE",{});var Jc=r(Gn);ml=i(Jc,"span start logits"),Jc.forEach(o),ul=i(Go," and "),Vn=s(Go,"CODE",{});var Cc=r(Vn);fl=i(Cc,"span end logits"),Cc.forEach(o),gl=i(Go,")."),Go.forEach(o),_l=p(te),Ht=s(te,"P",{});var Ks=r(Ht);Ml=i(Ks,"This model inherits from "),jo=s(Ks,"A",{href:!0});var jc=r(jo);bl=i(jc,"PreTrainedModel"),jc.forEach(o),yl=i(Ks,`. 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.)`),Ks.forEach(o),vl=p(te),Qt=s(te,"P",{});var er=r(Qt);wl=i(er,"This model is a PyTorch "),Lt=s(er,"A",{href:!0,rel:!0});var zc=r(Lt);Tl=i(zc,"torch.nn.Module"),zc.forEach(o),kl=i(er,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),er.forEach(o),El=p(te),V=s(te,"DIV",{class:!0});var ot=r(V);v(Ot.$$.fragment,ot),$l=p(ot),ye=s(ot,"P",{});var Vo=r(ye);Jl=i(Vo,"The "),zo=s(Vo,"A",{href:!0});var Uc=r(zo);Cl=i(Uc,"ErnieMForQuestionAnswering"),Uc.forEach(o),jl=i(Vo," forward method, overrides the "),Rn=s(Vo,"CODE",{});var Fc=r(Rn);zl=i(Fc,"__call__"),Fc.forEach(o),Ul=i(Vo," special method."),Vo.forEach(o),Fl=p(ot),v(Pe.$$.fragment,ot),xl=p(ot),v(Xe.$$.fragment,ot),ot.forEach(o),te.forEach(o),Cs=p(t),ve=s(t,"H2",{class:!0});var tr=r(ve);He=s(tr,"A",{id:!0,class:!0,href:!0});var xc=r(He);Pn=s(xc,"SPAN",{});var Ic=r(Pn);v(Yt.$$.fragment,Ic),Ic.forEach(o),xc.forEach(o),Il=p(tr),Xn=s(tr,"SPAN",{});var Wc=r(Xn);Wl=i(Wc,"ErnieMForInformationExtraction"),Wc.forEach(o),tr.forEach(o),js=p(t),W=s(t,"DIV",{class:!0});var oe=r(W);v(Dt.$$.fragment,oe),Nl=p(oe),we=s(oe,"P",{});var Ro=r(we);ql=i(Ro,`ErnieMForInformationExtraction is a Ernie-M Model with two linear layer on top of the hidden-states output to
compute `),Hn=s(Ro,"CODE",{});var Nc=r(Hn);Zl=i(Nc,"start_prob"),Nc.forEach(o),Sl=i(Ro," and "),Qn=s(Ro,"CODE",{});var qc=r(Qn);Bl=i(qc,"end_prob"),qc.forEach(o),Al=i(Ro,", designed for Universal Information Extraction."),Ro.forEach(o),Gl=p(oe),Kt=s(oe,"P",{});var or=r(Kt);Vl=i(or,"This model inherits from "),Uo=s(or,"A",{href:!0});var Zc=r(Uo);Rl=i(Zc,"PreTrainedModel"),Zc.forEach(o),Pl=i(or,`. 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.)`),or.forEach(o),Xl=p(oe),eo=s(oe,"P",{});var nr=r(eo);Hl=i(nr,"This model is a PyTorch "),to=s(nr,"A",{href:!0,rel:!0});var Sc=r(to);Ql=i(Sc,"torch.nn.Module"),Sc.forEach(o),Ll=i(nr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),nr.forEach(o),Ol=p(oe),L=s(oe,"DIV",{class:!0});var Po=r(L);v(oo.$$.fragment,Po),Yl=p(Po),Te=s(Po,"P",{});var Xo=r(Te);Dl=i(Xo,"The "),Fo=s(Xo,"A",{href:!0});var Bc=r(Fo);Kl=i(Bc,"ErnieMForInformationExtraction"),Bc.forEach(o),ed=i(Xo," forward method, overrides the "),Ln=s(Xo,"CODE",{});var Ac=r(Ln);td=i(Ac,"__call__"),Ac.forEach(o),od=i(Xo," special method."),Xo.forEach(o),nd=p(Po),v(Qe.$$.fragment,Po),Po.forEach(o),oe.forEach(o),this.h()},h(){h(d,"name","hf:doc:metadata"),h(d,"content",JSON.stringify(ap)),h(u,"id","erniem"),h(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(u,"href","#erniem"),h(g,"class","relative group"),h(ke,"id","overview"),h(ke,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ke,"href","#overview"),h(ne,"class","relative group"),h(st,"href","https://arxiv.org/abs/2012.15674"),h(st,"rel","nofollow"),h(rt,"href","https://huggingface.co/susnato"),h(rt,"rel","nofollow"),h(at,"href","https://github.com/PaddlePaddle/PaddleNLP/tree/develop/paddlenlp/transformers/ernie_m"),h(at,"rel","nofollow"),h($e,"id","documentation-resources"),h($e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h($e,"href","#documentation-resources"),h(re,"class","relative group"),h(co,"href","../tasks/sequence_classification"),h(po,"href","../tasks/token_classification"),h(ho,"href","../tasks/question_answering"),h(mo,"href","../tasks/multiple_choice"),h(Je,"id","transformers.ErnieMConfig"),h(Je,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Je,"href","#transformers.ErnieMConfig"),h(ae,"class","relative group"),h(uo,"href","/docs/transformers/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMModel"),h(ct,"href","https://huggingface.co/susnato/ernie-m-base_pytorch"),h(ct,"rel","nofollow"),h(fo,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),h(go,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),h(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ce,"id","transformers.ErnieMTokenizer"),h(Ce,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ce,"href","#transformers.ErnieMTokenizer"),h(de,"class","relative group"),h(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(bo,"href","../glossary#token-type-ids"),h(ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(yo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ue,"id","transformers.ErnieMModel"),h(Ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ue,"href","#transformers.ErnieMModel"),h(ce,"class","relative group"),h(vo,"href","/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel"),h(Et,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Et,"rel","nofollow"),h(wo,"href","/docs/transformers/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMModel"),h(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ie,"id","transformers.ErnieMForSequenceClassification"),h(Ie,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ie,"href","#transformers.ErnieMForSequenceClassification"),h(he,"class","relative group"),h(To,"href","/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel"),h(Ut,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Ut,"rel","nofollow"),h(ko,"href","/docs/transformers/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMForSequenceClassification"),h(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ze,"id","transformers.ErnieMForMultipleChoice"),h(Ze,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ze,"href","#transformers.ErnieMForMultipleChoice"),h(ue,"class","relative group"),h(Eo,"href","/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel"),h(qt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(qt,"rel","nofollow"),h($o,"href","/docs/transformers/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMForMultipleChoice"),h(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ae,"id","transformers.ErnieMForTokenClassification"),h(Ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ae,"href","#transformers.ErnieMForTokenClassification"),h(ge,"class","relative group"),h(Jo,"href","/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel"),h(Vt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Vt,"rel","nofollow"),h(Co,"href","/docs/transformers/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMForTokenClassification"),h(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Re,"id","transformers.ErnieMForQuestionAnswering"),h(Re,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Re,"href","#transformers.ErnieMForQuestionAnswering"),h(Me,"class","relative group"),h(jo,"href","/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel"),h(Lt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Lt,"rel","nofollow"),h(zo,"href","/docs/transformers/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMForQuestionAnswering"),h(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(He,"id","transformers.ErnieMForInformationExtraction"),h(He,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(He,"href","#transformers.ErnieMForInformationExtraction"),h(ve,"class","relative group"),h(Uo,"href","/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel"),h(to,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(to,"rel","nofollow"),h(Fo,"href","/docs/transformers/v4.30.0/en/model_doc/ernie_m#transformers.ErnieMForInformationExtraction"),h(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,f){e(document.head,d),_(t,b,f),_(t,g,f),e(g,u),e(u,M),w(l,M,null),e(g,m),e(g,J),e(J,sr),_(t,rs,f),_(t,ne,f),e(ne,ke),e(ke,Yo),w(nt,Yo,null),e(ne,rr),e(ne,Do),e(Do,ar),_(t,as,f),_(t,Ee,f),e(Ee,ir),e(Ee,st),e(st,lr),e(Ee,dr),_(t,is,f),_(t,ao,f),e(ao,cr),_(t,ls,f),_(t,io,f),e(io,Ko),e(Ko,pr),_(t,ds,f),_(t,lo,f),e(lo,hr),_(t,cs,f),_(t,Z,f),e(Z,en),e(en,mr),e(Z,ur),e(Z,se),e(se,fr),e(se,tn),e(tn,gr),e(se,_r),e(se,on),e(on,Mr),e(se,br),e(Z,yr),e(Z,nn),e(nn,vr),e(Z,wr),e(Z,sn),e(sn,Tr),_(t,ps,f),_(t,H,f),e(H,kr),e(H,rt),e(rt,Er),e(H,$r),e(H,at),e(at,Jr),e(H,Cr),_(t,hs,f),_(t,re,f),e(re,$e),e($e,rn),w(it,rn,null),e(re,jr),e(re,an),e(an,zr),_(t,ms,f),_(t,S,f),e(S,ln),e(ln,co),e(co,Ur),e(S,Fr),e(S,dn),e(dn,po),e(po,xr),e(S,Ir),e(S,cn),e(cn,ho),e(ho,Wr),e(S,Nr),e(S,pn),e(pn,mo),e(mo,qr),_(t,us,f),_(t,ae,f),e(ae,Je),e(Je,hn),w(lt,hn,null),e(ae,Zr),e(ae,mn),e(mn,Sr),_(t,fs,f),_(t,q,f),w(dt,q,null),e(q,Br),e(q,P),e(P,Ar),e(P,uo),e(uo,Gr),e(P,Vr),e(P,un),e(un,Rr),e(P,Pr),e(P,ct),e(ct,Xr),e(P,Hr),e(q,Qr),e(q,ie),e(ie,Lr),e(ie,fo),e(fo,Or),e(ie,Yr),e(ie,go),e(go,Dr),e(ie,Kr),e(q,ea),e(q,le),e(le,ta),e(le,fn),e(fn,oa),e(le,na),e(le,gn),e(gn,sa),e(le,ra),_(t,gs,f),_(t,de,f),e(de,Ce),e(Ce,_n),w(pt,_n,null),e(de,aa),e(de,Mn),e(Mn,ia),_(t,_s,f),_(t,j,f),w(ht,j,null),e(j,la),e(j,mt),e(mt,da),e(mt,bn),e(bn,ca),e(mt,pa),e(j,ha),e(j,Q),w(ut,Q,null),e(Q,ma),e(Q,yn),e(yn,ua),e(Q,fa),e(Q,ft),e(ft,_o),e(_o,ga),e(_o,vn),e(vn,_a),e(ft,Ma),e(ft,Mo),e(Mo,ba),e(Mo,wn),e(wn,ya),e(j,va),e(j,je),w(gt,je,null),e(je,wa),e(je,_t),e(_t,Ta),e(_t,Tn),e(Tn,ka),e(_t,Ea),e(j,$a),e(j,ze),w(Mt,ze,null),e(ze,Ja),e(ze,bt),e(bt,Ca),e(bt,bo),e(bo,ja),e(bt,za),e(j,Ua),e(j,yo),w(yt,yo,null),_(t,Ms,f),_(t,ce,f),e(ce,Ue),e(Ue,kn),w(vt,kn,null),e(ce,Fa),e(ce,En),e(En,xa),_(t,bs,f),_(t,z,f),w(wt,z,null),e(z,Ia),e(z,$n),e($n,Wa),e(z,Na),e(z,Tt),e(Tt,qa),e(Tt,vo),e(vo,Za),e(Tt,Sa),e(z,Ba),e(z,kt),e(kt,Aa),e(kt,Et),e(Et,Ga),e(kt,Va),e(z,Ra),e(z,B),w($t,B,null),e(B,Pa),e(B,pe),e(pe,Xa),e(pe,wo),e(wo,Ha),e(pe,Qa),e(pe,Jn),e(Jn,La),e(pe,Oa),e(B,Ya),w(Fe,B,null),e(B,Da),w(xe,B,null),_(t,ys,f),_(t,he,f),e(he,Ie),e(Ie,Cn),w(Jt,Cn,null),e(he,Ka),e(he,jn),e(jn,ei),_(t,vs,f),_(t,U,f),w(Ct,U,null),e(U,ti),e(U,zn),e(zn,oi),e(U,ni),e(U,jt),e(jt,si),e(jt,To),e(To,ri),e(jt,ai),e(U,ii),e(U,zt),e(zt,li),e(zt,Ut),e(Ut,di),e(zt,ci),e(U,pi),e(U,N),w(Ft,N,null),e(N,hi),e(N,me),e(me,mi),e(me,ko),e(ko,ui),e(me,fi),e(me,Un),e(Un,gi),e(me,_i),e(N,Mi),w(We,N,null),e(N,bi),w(Ne,N,null),e(N,yi),w(qe,N,null),_(t,ws,f),_(t,ue,f),e(ue,Ze),e(Ze,Fn),w(xt,Fn,null),e(ue,vi),e(ue,xn),e(xn,wi),_(t,Ts,f),_(t,F,f),w(It,F,null),e(F,Ti),e(F,In),e(In,ki),e(F,Ei),e(F,Wt),e(Wt,$i),e(Wt,Eo),e(Eo,Ji),e(Wt,Ci),e(F,ji),e(F,Nt),e(Nt,zi),e(Nt,qt),e(qt,Ui),e(Nt,Fi),e(F,xi),e(F,A),w(Zt,A,null),e(A,Ii),e(A,fe),e(fe,Wi),e(fe,$o),e($o,Ni),e(fe,qi),e(fe,Wn),e(Wn,Zi),e(fe,Si),e(A,Bi),w(Se,A,null),e(A,Ai),w(Be,A,null),_(t,ks,f),_(t,ge,f),e(ge,Ae),e(Ae,Nn),w(St,Nn,null),e(ge,Gi),e(ge,qn),e(qn,Vi),_(t,Es,f),_(t,x,f),w(Bt,x,null),e(x,Ri),e(x,Zn),e(Zn,Pi),e(x,Xi),e(x,At),e(At,Hi),e(At,Jo),e(Jo,Qi),e(At,Li),e(x,Oi),e(x,Gt),e(Gt,Yi),e(Gt,Vt),e(Vt,Di),e(Gt,Ki),e(x,el),e(x,G),w(Rt,G,null),e(G,tl),e(G,_e),e(_e,ol),e(_e,Co),e(Co,nl),e(_e,sl),e(_e,Sn),e(Sn,rl),e(_e,al),e(G,il),w(Ge,G,null),e(G,ll),w(Ve,G,null),_(t,$s,f),_(t,Me,f),e(Me,Re),e(Re,Bn),w(Pt,Bn,null),e(Me,dl),e(Me,An),e(An,cl),_(t,Js,f),_(t,I,f),w(Xt,I,null),e(I,pl),e(I,be),e(be,hl),e(be,Gn),e(Gn,ml),e(be,ul),e(be,Vn),e(Vn,fl),e(be,gl),e(I,_l),e(I,Ht),e(Ht,Ml),e(Ht,jo),e(jo,bl),e(Ht,yl),e(I,vl),e(I,Qt),e(Qt,wl),e(Qt,Lt),e(Lt,Tl),e(Qt,kl),e(I,El),e(I,V),w(Ot,V,null),e(V,$l),e(V,ye),e(ye,Jl),e(ye,zo),e(zo,Cl),e(ye,jl),e(ye,Rn),e(Rn,zl),e(ye,Ul),e(V,Fl),w(Pe,V,null),e(V,xl),w(Xe,V,null),_(t,Cs,f),_(t,ve,f),e(ve,He),e(He,Pn),w(Yt,Pn,null),e(ve,Il),e(ve,Xn),e(Xn,Wl),_(t,js,f),_(t,W,f),w(Dt,W,null),e(W,Nl),e(W,we),e(we,ql),e(we,Hn),e(Hn,Zl),e(we,Sl),e(we,Qn),e(Qn,Bl),e(we,Al),e(W,Gl),e(W,Kt),e(Kt,Vl),e(Kt,Uo),e(Uo,Rl),e(Kt,Pl),e(W,Xl),e(W,eo),e(eo,Hl),e(eo,to),e(to,Ql),e(eo,Ll),e(W,Ol),e(W,L),w(oo,L,null),e(L,Yl),e(L,Te),e(Te,Dl),e(Te,Fo),e(Fo,Kl),e(Te,ed),e(Te,Ln),e(Ln,td),e(Te,od),e(L,nd),w(Qe,L,null),zs=!0},p(t,[f]){const no={};f&2&&(no.$$scope={dirty:f,ctx:t}),Fe.$set(no);const On={};f&2&&(On.$$scope={dirty:f,ctx:t}),xe.$set(On);const Yn={};f&2&&(Yn.$$scope={dirty:f,ctx:t}),We.$set(Yn);const Dn={};f&2&&(Dn.$$scope={dirty:f,ctx:t}),Ne.$set(Dn);const so={};f&2&&(so.$$scope={dirty:f,ctx:t}),qe.$set(so);const Kn={};f&2&&(Kn.$$scope={dirty:f,ctx:t}),Se.$set(Kn);const es={};f&2&&(es.$$scope={dirty:f,ctx:t}),Be.$set(es);const ts={};f&2&&(ts.$$scope={dirty:f,ctx:t}),Ge.$set(ts);const ro={};f&2&&(ro.$$scope={dirty:f,ctx:t}),Ve.$set(ro);const os={};f&2&&(os.$$scope={dirty:f,ctx:t}),Pe.$set(os);const ns={};f&2&&(ns.$$scope={dirty:f,ctx:t}),Xe.$set(ns);const ss={};f&2&&(ss.$$scope={dirty:f,ctx:t}),Qe.$set(ss)},i(t){zs||(T(l.$$.fragment,t),T(nt.$$.fragment,t),T(it.$$.fragment,t),T(lt.$$.fragment,t),T(dt.$$.fragment,t),T(pt.$$.fragment,t),T(ht.$$.fragment,t),T(ut.$$.fragment,t),T(gt.$$.fragment,t),T(Mt.$$.fragment,t),T(yt.$$.fragment,t),T(vt.$$.fragment,t),T(wt.$$.fragment,t),T($t.$$.fragment,t),T(Fe.$$.fragment,t),T(xe.$$.fragment,t),T(Jt.$$.fragment,t),T(Ct.$$.fragment,t),T(Ft.$$.fragment,t),T(We.$$.fragment,t),T(Ne.$$.fragment,t),T(qe.$$.fragment,t),T(xt.$$.fragment,t),T(It.$$.fragment,t),T(Zt.$$.fragment,t),T(Se.$$.fragment,t),T(Be.$$.fragment,t),T(St.$$.fragment,t),T(Bt.$$.fragment,t),T(Rt.$$.fragment,t),T(Ge.$$.fragment,t),T(Ve.$$.fragment,t),T(Pt.$$.fragment,t),T(Xt.$$.fragment,t),T(Ot.$$.fragment,t),T(Pe.$$.fragment,t),T(Xe.$$.fragment,t),T(Yt.$$.fragment,t),T(Dt.$$.fragment,t),T(oo.$$.fragment,t),T(Qe.$$.fragment,t),zs=!0)},o(t){k(l.$$.fragment,t),k(nt.$$.fragment,t),k(it.$$.fragment,t),k(lt.$$.fragment,t),k(dt.$$.fragment,t),k(pt.$$.fragment,t),k(ht.$$.fragment,t),k(ut.$$.fragment,t),k(gt.$$.fragment,t),k(Mt.$$.fragment,t),k(yt.$$.fragment,t),k(vt.$$.fragment,t),k(wt.$$.fragment,t),k($t.$$.fragment,t),k(Fe.$$.fragment,t),k(xe.$$.fragment,t),k(Jt.$$.fragment,t),k(Ct.$$.fragment,t),k(Ft.$$.fragment,t),k(We.$$.fragment,t),k(Ne.$$.fragment,t),k(qe.$$.fragment,t),k(xt.$$.fragment,t),k(It.$$.fragment,t),k(Zt.$$.fragment,t),k(Se.$$.fragment,t),k(Be.$$.fragment,t),k(St.$$.fragment,t),k(Bt.$$.fragment,t),k(Rt.$$.fragment,t),k(Ge.$$.fragment,t),k(Ve.$$.fragment,t),k(Pt.$$.fragment,t),k(Xt.$$.fragment,t),k(Ot.$$.fragment,t),k(Pe.$$.fragment,t),k(Xe.$$.fragment,t),k(Yt.$$.fragment,t),k(Dt.$$.fragment,t),k(oo.$$.fragment,t),k(Qe.$$.fragment,t),zs=!1},d(t){o(d),t&&o(b),t&&o(g),E(l),t&&o(rs),t&&o(ne),E(nt),t&&o(as),t&&o(Ee),t&&o(is),t&&o(ao),t&&o(ls),t&&o(io),t&&o(ds),t&&o(lo),t&&o(cs),t&&o(Z),t&&o(ps),t&&o(H),t&&o(hs),t&&o(re),E(it),t&&o(ms),t&&o(S),t&&o(us),t&&o(ae),E(lt),t&&o(fs),t&&o(q),E(dt),t&&o(gs),t&&o(de),E(pt),t&&o(_s),t&&o(j),E(ht),E(ut),E(gt),E(Mt),E(yt),t&&o(Ms),t&&o(ce),E(vt),t&&o(bs),t&&o(z),E(wt),E($t),E(Fe),E(xe),t&&o(ys),t&&o(he),E(Jt),t&&o(vs),t&&o(U),E(Ct),E(Ft),E(We),E(Ne),E(qe),t&&o(ws),t&&o(ue),E(xt),t&&o(Ts),t&&o(F),E(It),E(Zt),E(Se),E(Be),t&&o(ks),t&&o(ge),E(St),t&&o(Es),t&&o(x),E(Bt),E(Rt),E(Ge),E(Ve),t&&o($s),t&&o(Me),E(Pt),t&&o(Js),t&&o(I),E(Xt),E(Ot),E(Pe),E(Xe),t&&o(Cs),t&&o(ve),E(Yt),t&&o(js),t&&o(W),E(Dt),E(oo),E(Qe)}}}const ap={local:"erniem",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.ErnieMConfig",title:"ErnieMConfig"},{local:"transformers.ErnieMTokenizer",title:"ErnieMTokenizer"},{local:"transformers.ErnieMModel",title:"ErnieMModel"},{local:"transformers.ErnieMForSequenceClassification",title:"ErnieMForSequenceClassification"},{local:"transformers.ErnieMForMultipleChoice",title:"ErnieMForMultipleChoice"},{local:"transformers.ErnieMForTokenClassification",title:"ErnieMForTokenClassification"},{local:"transformers.ErnieMForQuestionAnswering",title:"ErnieMForQuestionAnswering"},{local:"transformers.ErnieMForInformationExtraction",title:"ErnieMForInformationExtraction"}],title:"ErnieM"};function ip($){return Xc(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class up extends Gc{constructor(d){super();Vc(this,d,ip,rp,Rc,{})}}export{up as default,ap as metadata};
