import{s as $n,o as Jn,n as Oe}from"../chunks/scheduler.56725da7.js";import{S as Bn,i as Nn,e as d,s,c as m,h as Cn,a as p,d as o,b as r,f as v,g as u,j as _,k,l,m as c,n as g,t as h,o as f,p as M}from"../chunks/index.18a26576.js";import{C as Zn}from"../chunks/CopyLLMTxtMenu.08cb1880.js";import{D as U}from"../chunks/Docstring.4f5c8174.js";import{C as ne}from"../chunks/CodeBlock.8cfad13f.js";import{E as Ke}from"../chunks/ExampleCodeBlock.0c069651.js";import{H as X}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.bfeb55ce.js";function Un(j){let a,T="Example:",y,i,b;return i=new ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEFmcm9tJTIwb3B0aW11bS5uZXVyb24lMjBpbXBvcnQlMjBOZXVyb25CZXJ0TW9kZWwlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJvcHRpbXVtJTJGYmVydC1iYXNlLXVuY2FzZWQtbmV1cm9ueC1iczEtc3ExMjglMjIpJTBBbW9kZWwlMjAlM0QlMjBOZXVyb25CZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm9wdGltdW0lMkZiZXJ0LWJhc2UtdW5jYXNlZC1uZXVyb254LWJzMS1zcTEyOCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyRGVhciUyMEV2YW4lMjBIYW5zZW4lMjBpcyUyMHRoZSUyMHdpbm5lciUyMG9mJTIwc2l4JTIwVG9ueSUyMEF3YXJkcy4lMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsYXN0X2hpZGRlbl9zdGF0ZSUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> optimum.neuron <span class="hljs-keyword">import</span> NeuronBertModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;optimum/bert-base-uncased-neuronx-bs1-sq128&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NeuronBertModel.from_pretrained(<span class="hljs-string">&quot;optimum/bert-base-uncased-neuronx-bs1-sq128&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Dear Evan Hansen is the winner of six Tony Awards.&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_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_state.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">13</span>, <span class="hljs-number">384</span>]`,wrap:!1}}),{c(){a=d("p"),a.textContent=T,y=s(),m(i.$$.fragment)},l(t){a=p(t,"P",{"data-svelte-h":!0}),_(a)!=="svelte-11lpom8"&&(a.textContent=T),y=r(t),u(i.$$.fragment,t)},m(t,w){c(t,a,w),c(t,y,w),g(i,t,w),b=!0},p:Oe,i(t){b||(h(i.$$.fragment,t),b=!0)},o(t){f(i.$$.fragment,t),b=!1},d(t){t&&(o(a),o(y)),M(i,t)}}}function In(j){let a,T="Example:",y,i,b;return i=new ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEFmcm9tJTIwb3B0aW11bS5uZXVyb24lMjBpbXBvcnQlMjBOZXVyb25CZXJ0Rm9yTWFza2VkTE0lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJvcHRpbXVtJTJGbGVnYWwtYmVydC1iYXNlLXVuY2FzZWQtbmV1cm9ueCUyMiklMEFtb2RlbCUyMCUzRCUyME5ldXJvbkJlcnRGb3JNYXNrZWRMTS5mcm9tX3ByZXRyYWluZWQoJTIyb3B0aW11bSUyRmxlZ2FsLWJlcnQtYmFzZS11bmNhc2VkLW5ldXJvbnglMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMlRoaXMlMjAlNUJNQVNLJTVEJTIwQWdyZWVtZW50JTIwaXMlMjBiZXR3ZWVuJTIwR2VuZXJhbCUyME1vdG9ycyUyMGFuZCUyMEpvaG4lMjBNdXJyYXkuJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHMlMEFsaXN0KGxvZ2l0cy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> optimum.neuron <span class="hljs-keyword">import</span> NeuronBertForMaskedLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;optimum/legal-bert-base-uncased-neuronx&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NeuronBertForMaskedLM.from_pretrained(<span class="hljs-string">&quot;optimum/legal-bert-base-uncased-neuronx&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;This [MASK] Agreement is between General Motors and John Murray.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">13</span>, <span class="hljs-number">30522</span>]`,wrap:!1}}),{c(){a=d("p"),a.textContent=T,y=s(),m(i.$$.fragment)},l(t){a=p(t,"P",{"data-svelte-h":!0}),_(a)!=="svelte-11lpom8"&&(a.textContent=T),y=r(t),u(i.$$.fragment,t)},m(t,w){c(t,a,w),c(t,y,w),g(i,t,w),b=!0},p:Oe,i(t){b||(h(i.$$.fragment,t),b=!0)},o(t){f(i.$$.fragment,t),b=!1},d(t){t&&(o(a),o(y)),M(i,t)}}}function Fn(j){let a,T="Example:",y,i,b;return i=new ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEFmcm9tJTIwb3B0aW11bS5uZXVyb24lMjBpbXBvcnQlMjBOZXVyb25CZXJ0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm9wdGltdW0lMkZiZXJ0LWJhc2UtbXVsdGlsaW5ndWFsLXVuY2FzZWQtc2VudGltZW50LW5ldXJvbnglMjIpJTBBbW9kZWwlMjAlM0QlMjBOZXVyb25CZXJ0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyb3B0aW11bSUyRmJlcnQtYmFzZS1tdWx0aWxpbmd1YWwtdW5jYXNlZC1zZW50aW1lbnQtbmV1cm9ueCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGFtaWx0b24lMjBpcyUyMGNvbnNpZGVyZWQlMjB0byUyMGJlJTIwdGhlJTIwYmVzdCUyMG11c2ljYWwlMjBvZiUyMGh1bWFuJTIwaGlzdG9yeS4lMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cyUwQWxpc3QobG9naXRzLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> optimum.neuron <span class="hljs-keyword">import</span> NeuronBertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;optimum/bert-base-multilingual-uncased-sentiment-neuronx&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NeuronBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;optimum/bert-base-multilingual-uncased-sentiment-neuronx&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hamilton is considered to be the best musical of human history.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>]`,wrap:!1}}),{c(){a=d("p"),a.textContent=T,y=s(),m(i.$$.fragment)},l(t){a=p(t,"P",{"data-svelte-h":!0}),_(a)!=="svelte-11lpom8"&&(a.textContent=T),y=r(t),u(i.$$.fragment,t)},m(t,w){c(t,a,w),c(t,y,w),g(i,t,w),b=!0},p:Oe,i(t){b||(h(i.$$.fragment,t),b=!0)},o(t){f(i.$$.fragment,t),b=!1},d(t){t&&(o(a),o(y)),M(i,t)}}}function Wn(j){let a,T="Example:",y,i,b;return i=new ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEFmcm9tJTIwb3B0aW11bS5uZXVyb24lMjBpbXBvcnQlMjBOZXVyb25CZXJ0Rm9yVG9rZW5DbGFzc2lmaWNhdGlvbiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm9wdGltdW0lMkZiZXJ0LWJhc2UtTkVSLW5ldXJvbnglMjIpJTBBbW9kZWwlMjAlM0QlMjBOZXVyb25CZXJ0Rm9yVG9rZW5DbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyb3B0aW11bSUyRmJlcnQtYmFzZS1ORVItbmV1cm9ueCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyTGluLU1hbnVlbCUyME1pcmFuZGElMjBpcyUyMGFuJTIwQW1lcmljYW4lMjBzb25nd3JpdGVyJTJDJTIwYWN0b3IlMkMlMjBzaW5nZXIlMkMlMjBmaWxtbWFrZXIlMkMlMjBhbmQlMjBwbGF5d3JpZ2h0LiUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRzJTBBbGlzdChsb2dpdHMuc2hhcGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> optimum.neuron <span class="hljs-keyword">import</span> NeuronBertForTokenClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;optimum/bert-base-NER-neuronx&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NeuronBertForTokenClassification.from_pretrained(<span class="hljs-string">&quot;optimum/bert-base-NER-neuronx&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Lin-Manuel Miranda is an American songwriter, actor, singer, filmmaker, and playwright.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">20</span>, <span class="hljs-number">9</span>]`,wrap:!1}}),{c(){a=d("p"),a.textContent=T,y=s(),m(i.$$.fragment)},l(t){a=p(t,"P",{"data-svelte-h":!0}),_(a)!=="svelte-11lpom8"&&(a.textContent=T),y=r(t),u(i.$$.fragment,t)},m(t,w){c(t,a,w),c(t,y,w),g(i,t,w),b=!0},p:Oe,i(t){b||(h(i.$$.fragment,t),b=!0)},o(t){f(i.$$.fragment,t),b=!1},d(t){t&&(o(a),o(y)),M(i,t)}}}function Xn(j){let a,T="Example:",y,i,b;return i=new ne({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUwQWZyb20lMjBvcHRpbXVtLm5ldXJvbiUyMGltcG9ydCUyME5ldXJvbkJlcnRGb3JRdWVzdGlvbkFuc3dlcmluZyUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm9wdGltdW0lMkZiZXJ0LWJhc2UtY2FzZWQtc3F1YWQyLW5ldXJvbnglMjIpJTBBbW9kZWwlMjAlM0QlMjBOZXVyb25CZXJ0Rm9yUXVlc3Rpb25BbnN3ZXJpbmcuZnJvbV9wcmV0cmFpbmVkKCUyMm9wdGltdW0lMkZiZXJ0LWJhc2UtY2FzZWQtc3F1YWQyLW5ldXJvbnglMjIpJTBBJTBBcXVlc3Rpb24lMkMlMjB0ZXh0JTIwJTNEJTIwJTIyQXJlJTIwdGhlcmUlMjB3aGVlbGNoYWlyJTIwc3BhY2VzJTIwaW4lMjB0aGUlMjB0aGVhdHJlcyUzRiUyMiUyQyUyMCUyMlllcyUyQyUyMHdlJTIwaGF2ZSUyMHJlc2VydmVkJTIwd2hlZWxjaGFpciUyMHNwYWNlcyUyMHdpdGglMjBhJTIwZ29vZCUyMHZpZXcuJTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHF1ZXN0aW9uJTJDJTIwdGV4dCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBc3RhcnRfcG9zaXRpb25zJTIwJTNEJTIwdG9yY2gudGVuc29yKCU1QjElNUQpJTBBZW5kX3Bvc2l0aW9ucyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxMiU1RCklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBzdGFydF9wb3NpdGlvbnMlM0RzdGFydF9wb3NpdGlvbnMlMkMlMjBlbmRfcG9zaXRpb25zJTNEZW5kX3Bvc2l0aW9ucyklMEFzdGFydF9zY29yZXMlMjAlM0QlMjBvdXRwdXRzLnN0YXJ0X2xvZ2l0cyUwQWVuZF9zY29yZXMlMjAlM0QlMjBvdXRwdXRzLmVuZF9sb2dpdHM=",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
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> optimum.neuron <span class="hljs-keyword">import</span> NeuronBertForQuestionAnswering

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;optimum/bert-base-cased-squad2-neuronx&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NeuronBertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;optimum/bert-base-cased-squad2-neuronx&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Are there wheelchair spaces in the theatres?&quot;</span>, <span class="hljs-string">&quot;Yes, we have reserved wheelchair spaces with a good view.&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>start_positions = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>end_positions = torch.tensor([<span class="hljs-number">12</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=start_positions, end_positions=end_positions)
<span class="hljs-meta">&gt;&gt;&gt; </span>start_scores = outputs.start_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>end_scores = outputs.end_logits`,wrap:!1}}),{c(){a=d("p"),a.textContent=T,y=s(),m(i.$$.fragment)},l(t){a=p(t,"P",{"data-svelte-h":!0}),_(a)!=="svelte-11lpom8"&&(a.textContent=T),y=r(t),u(i.$$.fragment,t)},m(t,w){c(t,a,w),c(t,y,w),g(i,t,w),b=!0},p:Oe,i(t){b||(h(i.$$.fragment,t),b=!0)},o(t){f(i.$$.fragment,t),b=!1},d(t){t&&(o(a),o(y)),M(i,t)}}}function xn(j){let a,T="Example:",y,i,b;return i=new ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEFmcm9tJTIwb3B0aW11bS5uZXVyb24lMjBpbXBvcnQlMjBOZXVyb25CZXJ0Rm9yTXVsdGlwbGVDaG9pY2UlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJvcHRpbXVtJTJGYmVydC1iYXNlLWNhc2VkLXN3YWctbmV1cm9ueCUyMiklMEFtb2RlbCUyMCUzRCUyME5ldXJvbkJlcnRGb3JNdWx0aXBsZUNob2ljZS5mcm9tX3ByZXRyYWluZWQoJTIyb3B0aW11bSUyRmJlcnQtYmFzZS1jYXNlZC1zd2FnLW5ldXJvbnglMjIpJTBBJTBBbnVtX2Nob2ljZXMlMjAlM0QlMjA0JTBBZmlyc3Rfc2VudGVuY2UlMjAlM0QlMjAlNUIlMjJNZW1iZXJzJTIwb2YlMjB0aGUlMjBwcm9jZXNzaW9uJTIwd2FsayUyMGRvd24lMjB0aGUlMjBzdHJlZXQlMjBob2xkaW5nJTIwc21hbGwlMjBob3JuJTIwYnJhc3MlMjBpbnN0cnVtZW50cy4lMjIlNUQlMjAqJTIwbnVtX2Nob2ljZXMlMEFzZWNvbmRfc2VudGVuY2UlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlMjJBJTIwZHJ1bSUyMGxpbmUlMjBwYXNzZXMlMjBieSUyMHdhbGtpbmclMjBkb3duJTIwdGhlJTIwc3RyZWV0JTIwcGxheWluZyUyMHRoZWlyJTIwaW5zdHJ1bWVudHMuJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyQSUyMGRydW0lMjBsaW5lJTIwaGFzJTIwaGVhcmQlMjBhcHByb2FjaGluZyUyMHRoZW0uJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyQSUyMGRydW0lMjBsaW5lJTIwYXJyaXZlcyUyMGFuZCUyMHRoZXkncmUlMjBvdXRzaWRlJTIwZGFuY2luZyUyMGFuZCUyMGFzbGVlcC4lMjIlMkMlMEElMjAlMjAlMjAlMjAlMjJBJTIwZHJ1bSUyMGxpbmUlMjB0dXJucyUyMHRoZSUyMGxlYWQlMjBzaW5nZXIlMjB3YXRjaGVzJTIwdGhlJTIwcGVyZm9ybWFuY2UuJTIyJTBBJTVEJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKGZpcnN0X3NlbnRlbmNlJTJDJTIwc2Vjb25kX3NlbnRlbmNlJTJDJTIwdHJ1bmNhdGlvbiUzRFRydWUlMkMlMjBwYWRkaW5nJTNEVHJ1ZSklMEElMEFmb3IlMjBrJTJDJTIwdiUyMGluJTIwaW5wdXRzLml0ZW1zKCklM0ElMEElMjAlMjAlMjAlMjBpbnB1dHMlNUJrJTVEJTIwJTNEJTIwJTVCdiU1QmklM0ElMjBpJTIwJTJCJTIwbnVtX2Nob2ljZXMlNUQlMjBmb3IlMjBpJTIwaW4lMjByYW5nZSgwJTJDJTIwbGVuKHYpJTJDJTIwbnVtX2Nob2ljZXMpJTVEJTBBaW5wdXRzJTIwJTNEJTIwZGljdChpbnB1dHMuY29udmVydF90b190ZW5zb3JzKHRlbnNvcl90eXBlJTNEJTIycHQlMjIpKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cyUwQWxvZ2l0cy5zaGFwZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> optimum.neuron <span class="hljs-keyword">import</span> NeuronBertForMultipleChoice

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;optimum/bert-base-cased-swag-neuronx&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = NeuronBertForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;optimum/bert-base-cased-swag-neuronx&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>num_choices = <span class="hljs-number">4</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>first_sentence = [<span class="hljs-string">&quot;Members of the procession walk down the street holding small horn brass instruments.&quot;</span>] * num_choices
<span class="hljs-meta">&gt;&gt;&gt; </span>second_sentence = [
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;A drum line passes by walking down the street playing their instruments.&quot;</span>,
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;A drum line has heard approaching them.&quot;</span>,
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;A drum line arrives and they&#x27;re outside dancing and asleep.&quot;</span>,
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;A drum line turns the lead singer watches the performance.&quot;</span>
<span class="hljs-meta">... </span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(first_sentence, second_sentence, truncation=<span class="hljs-literal">True</span>, padding=<span class="hljs-literal">True</span>)

<span class="hljs-comment"># Unflatten the inputs values expanding it to the shape [batch_size, num_choices, seq_length]</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> inputs.items():
<span class="hljs-meta">... </span>    inputs[k] = [v[i: i + num_choices] <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-number">0</span>, <span class="hljs-built_in">len</span>(v), num_choices)]
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = <span class="hljs-built_in">dict</span>(inputs.convert_to_tensors(tensor_type=<span class="hljs-string">&quot;pt&quot;</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span>logits.shape
[<span class="hljs-number">1</span>, <span class="hljs-number">4</span>]`,wrap:!1}}),{c(){a=d("p"),a.textContent=T,y=s(),m(i.$$.fragment)},l(t){a=p(t,"P",{"data-svelte-h":!0}),_(a)!=="svelte-11lpom8"&&(a.textContent=T),y=r(t),u(i.$$.fragment,t)},m(t,w){c(t,a,w),c(t,y,w),g(i,t,w),b=!0},p:Oe,i(t){b||(h(i.$$.fragment,t),b=!0)},o(t){f(i.$$.fragment,t),b=!1},d(t){t&&(o(a),o(y)),M(i,t)}}}function zn(j){let a,T,y,i,b,t,w,tt,oe,nt,se,nn='<a href="https://huggingface.co/papers/1810.04805" rel="nofollow">BERT</a> is a bidirectional transformer pretrained on unlabeled text to predict masked tokens in a sentence and to predict whether one sentence follows another. The main idea is that by randomly masking some tokens, the model can train on text to the left and right, giving it a more thorough understanding. BERT is also very versatile because its learned language representations can be adapted for other NLP tasks by fine-tuning an additional layer or head.',ot,re,on='You can find all the original BERT checkpoints under the <a href="https://huggingface.co/collections/google/bert-release-64ff5e7a4be99045d1896dbc" rel="nofollow">BERT</a> collection.',st,ae,rt,le,sn='To deploy 🤗 <a href="https://huggingface.co/docs/transformers/index" rel="nofollow">Transformers</a> models on Neuron devices, you first need to compile the models and export them to a serialized format for inference. Below are two approaches to compile the model, you can choose the one that best suits your needs. Here we take the <code>feature-extraction</code> as an example:',at,ie,lt,ce,rn="You can export the model using the Optimum command-line interface as follows:",it,de,ct,Q,an="<p>Execute <code>optimum-cli export neuron --help</code> to display all command line options and their description.</p>",dt,pe,pt,me,mt,ue,ut,$,ge,$t,Ze,ln="Bare Bert Model transformer outputting raw hidden-states without any specific head on top, used for the task “feature-extraction”.",Jt,Ue,cn=`This model inherits from <code>~neuron.modeling.NeuronTracedModel</code>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving)`,Bt,x,he,Nt,Ie,dn="The <code>NeuronBertModel</code> forward method, overrides the <code>__call__</code> special method. Accepts only the inputs traced during the compilation step. Any additional inputs provided during inference will be ignored. To include extra inputs, recompile the model with those inputs specified.",Ct,A,gt,fe,ht,J,Me,Zt,Fe,pn="Masked language Bert Model with a <code>language modeling</code> head on top, for masked language modeling tasks on Neuron devices.",Ut,We,mn=`This model inherits from <code>~neuron.modeling.NeuronTracedModel</code>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving)`,It,z,be,Ft,Xe,un="The <code>NeuronBertForMaskedLM</code> forward method, overrides the <code>__call__</code> special method. Accepts only the inputs traced during the compilation step. Any additional inputs provided during inference will be ignored. To include extra inputs, recompile the model with those inputs specified.",Wt,L,ft,ye,Mt,B,we,Xt,xe,gn=`Neuron Model with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`,xt,ze,hn=`This model inherits from <code>~neuron.modeling.NeuronTracedModel</code>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving)`,zt,V,_e,Vt,Ve,fn="The <code>NeuronBertForSequenceClassification</code> forward method, overrides the <code>__call__</code> special method. Accepts only the inputs traced during the compilation step. Any additional inputs provided during inference will be ignored. To include extra inputs, recompile the model with those inputs specified.",Gt,Y,bt,Te,yt,N,ke,Et,Ge,Mn=`Neuron 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.`,Rt,Ee,bn=`This model inherits from <code>~neuron.modeling.NeuronTracedModel</code>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving)`,qt,G,je,Ht,Re,yn="The <code>NeuronBertForTokenClassification</code> forward method, overrides the <code>__call__</code> special method. Accepts only the inputs traced during the compilation step. Any additional inputs provided during inference will be ignored. To include extra inputs, recompile the model with those inputs specified.",St,P,wt,ve,_t,C,$e,Qt,qe,wn=`Bert 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 <code>span start logits</code> and <code>span end logits</code>).`,At,He,_n=`This model inherits from <code>~neuron.modeling.NeuronTracedModel</code>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving)`,Lt,E,Je,Yt,Se,Tn="The <code>NeuronBertForQuestionAnswering</code> forward method, overrides the <code>__call__</code> special method. Accepts only the inputs traced during the compilation step. Any additional inputs provided during inference will be ignored. To include extra inputs, recompile the model with those inputs specified.",Pt,D,Tt,Be,kt,Z,Ne,Dt,Qe,kn=`Neuron 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.`,Kt,Ae,jn=`This model inherits from <code>~neuron.modeling.NeuronTracedModel</code>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving)`,Ot,R,Ce,en,Le,vn="The <code>NeuronBertForMultipleChoice</code> forward method, overrides the <code>__call__</code> special method. Accepts only the inputs traced during the compilation step. Any additional inputs provided during inference will be ignored. To include extra inputs, recompile the model with those inputs specified.",tn,K,jt,et,vt;return b=new Zn({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),w=new X({props:{title:"BERT",local:"bert",headingTag:"h1"}}),oe=new X({props:{title:"Overview",local:"overview",headingTag:"h2"}}),ae=new X({props:{title:"Export to Neuron",local:"export-to-neuron",headingTag:"h2"}}),ie=new X({props:{title:"Option 1: CLI",local:"option-1-cli",headingTag:"h3"}}),de=new ne({props:{code:"b3B0aW11bS1jbGklMjBleHBvcnQlMjBuZXVyb24lMjAtLW1vZGVsJTIwZ29vZ2xlLWJlcnQlMkZiZXJ0LWJhc2UtdW5jYXNlZCUyMC0tdGFzayUyMGZlYXR1cmUtZXh0cmFjdGlvbiUyMC0tYmF0Y2hfc2l6ZSUyMDElMjAtLXNlcXVlbmNlX2xlbmd0aCUyMDEyOCUyMGJlcnRfZmVhdHVyZV9leHRyYWN0aW9uX25ldXJvbnglMkY=",highlighted:'optimum-cli <span class="hljs-built_in">export</span> neuron --model google-bert/bert-base-uncased --task feature-extraction --batch_size 1 --sequence_length 128 bert_feature_extraction_neuronx/',wrap:!1}}),pe=new X({props:{title:"Option 2: Python API",local:"option-2-python-api",headingTag:"h3"}}),me=new ne({props:{code:"ZnJvbSUyMG9wdGltdW0ubmV1cm9uJTIwaW1wb3J0JTIwTmV1cm9uTW9kZWxGb3JGZWF0dXJlRXh0cmFjdGlvbiUwQSUwQWlucHV0X3NoYXBlcyUyMCUzRCUyMCU3QiUyMmJhdGNoX3NpemUlMjIlM0ElMjAxJTJDJTIwJTIyc2VxdWVuY2VfbGVuZ3RoJTIyJTNBJTIwMTI4JTdEJTBBY29tcGlsZXJfYXJncyUyMCUzRCUyMCU3QiUyMmF1dG9fY2FzdCUyMiUzQSUyMCUyMm1hdG11bCUyMiUyQyUyMCUyMmF1dG9fY2FzdF90eXBlJTIyJTNBJTIwJTIyYmYxNiUyMiU3RCUwQW5ldXJvbl9tb2RlbCUyMCUzRCUyME5ldXJvbk1vZGVsRm9yRmVhdHVyZUV4dHJhY3Rpb24uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmdvb2dsZS1iZXJ0JTJGYmVydC1iYXNlLXVuY2FzZWQlMjIlMkMlMEElMjAlMjAlMjAlMjBleHBvcnQlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwKippbnB1dF9zaGFwZXMlMkMlMEElMjAlMjAlMjAlMjAqKmNvbXBpbGVyX2FyZ3MlMkMlMEEpJTBBJTIzJTIwU2F2ZSUyMGxvY2FsbHklMEFuZXVyb25fbW9kZWwuc2F2ZV9wcmV0cmFpbmVkKCUyMmJlcnRfZmVhdHVyZV9leHRyYWN0aW9uX25ldXJvbnglMjIpJTBBJTBBJTIzJTIwVXBsb2FkJTIwdG8lMjB0aGUlMjBIdWdnaW5nRmFjZSUyMEh1YiUwQW5ldXJvbl9tb2RlbC5wdXNoX3RvX2h1YiglMEElMjAlMjAlMjAlMjAlMjJiZXJ0X2ZlYXR1cmVfZXh0cmFjdGlvbl9uZXVyb254JTIyJTJDJTIwcmVwb3NpdG9yeV9pZCUzRCUyMm15LW5ldXJvbi1yZXBvJTIyJTIwJTIwJTIzJTIwUmVwbGFjZSUyMHdpdGglMjB5b3VyJTIwSEYlMjBIdWIlMjByZXBvJTIwaWQlMEEp",highlighted:`<span class="hljs-keyword">from</span> optimum.neuron <span class="hljs-keyword">import</span> NeuronModelForFeatureExtraction

input_shapes = {<span class="hljs-string">&quot;batch_size&quot;</span>: <span class="hljs-number">1</span>, <span class="hljs-string">&quot;sequence_length&quot;</span>: <span class="hljs-number">128</span>}
compiler_args = {<span class="hljs-string">&quot;auto_cast&quot;</span>: <span class="hljs-string">&quot;matmul&quot;</span>, <span class="hljs-string">&quot;auto_cast_type&quot;</span>: <span class="hljs-string">&quot;bf16&quot;</span>}
neuron_model = NeuronModelForFeatureExtraction.from_pretrained(
    <span class="hljs-string">&quot;google-bert/bert-base-uncased&quot;</span>,
    export=<span class="hljs-literal">True</span>,
    **input_shapes,
    **compiler_args,
)
<span class="hljs-comment"># Save locally</span>
neuron_model.save_pretrained(<span class="hljs-string">&quot;bert_feature_extraction_neuronx&quot;</span>)

<span class="hljs-comment"># Upload to the HuggingFace Hub</span>
neuron_model.push_to_hub(
    <span class="hljs-string">&quot;bert_feature_extraction_neuronx&quot;</span>, repository_id=<span class="hljs-string">&quot;my-neuron-repo&quot;</span>  <span class="hljs-comment"># Replace with your HF Hub repo id</span>
)`,wrap:!1}}),ue=new X({props:{title:"NeuronBertModel",local:"optimum.neuron.NeuronBertModel",headingTag:"h2"}}),ge=new U({props:{name:"class optimum.neuron.NeuronBertModel",anchor:"optimum.neuron.NeuronBertModel",parameters:[{name:"model",val:": ScriptModule"},{name:"config",val:": PretrainedConfig"},{name:"model_save_dir",val:": str | pathlib.Path | tempfile.TemporaryDirectory | None = None"},{name:"model_file_name",val:": str | None = None"},{name:"preprocessors",val:": list | None = None"},{name:"neuron_config",val:": NeuronDefaultConfig | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.neuron.NeuronBertModel.config",description:`<strong>config</strong> (<code>transformers.PretrainedConfig</code>) &#x2014; <a href="https://huggingface.co/docs/transformers/main_classes/configuration#transformers.PretrainedConfig" rel="nofollow">PretrainedConfig</a> is the 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 <code>optimum.neuron.modeling.NeuronTracedModel.from_pretrained</code> method to load the model weights.`,name:"config"},{anchor:"optimum.neuron.NeuronBertModel.model",description:'<strong>model</strong> (<code>torch.jit._script.ScriptModule</code>) &#x2014; <a href="https://pytorch.org/docs/stable/generated/torch.jit.ScriptModule.html" rel="nofollow">torch.jit._script.ScriptModule</a> is the TorchScript module with embedded NEFF(Neuron Executable File Format) compiled by neuron(x) compiler.',name:"model"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1011/optimum/neuron/models/inference/bert/modeling_bert.py#L62"}}),he=new U({props:{name:"forward",anchor:"optimum.neuron.NeuronBertModel.forward",parameters:[{name:"input_ids",val:": Tensor"},{name:"attention_mask",val:": Tensor"},{name:"token_type_ids",val:": torch.Tensor | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.neuron.NeuronBertModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.
Indices can be obtained using <a href="https://huggingface.co/docs/transformers/autoclass_tutorial#autotokenizer" rel="nofollow"><code>AutoTokenizer</code></a>.
See <a href="https://huggingface.co/docs/transformers/main_classes/tokenizer#transformers.PreTrainedTokenizerBase.encode" rel="nofollow"><code>PreTrainedTokenizer.encode</code></a> and
<a href="https://huggingface.co/docs/transformers/main_classes/tokenizer#transformers.PreTrainedTokenizerBase.__call__" rel="nofollow"><code>PreTrainedTokenizer.__call__</code></a> for details.
<a href="https://huggingface.co/docs/transformers/glossary#input-ids" rel="nofollow">What are input IDs?</a>`,name:"input_ids"},{anchor:"optimum.neuron.NeuronBertModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor | None</code> of shape <code>(batch_size, sequence_length)</code>, defaults to <code>None</code>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.
<a href="https://huggingface.co/docs/transformers/glossary#attention-mask" rel="nofollow">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"optimum.neuron.NeuronBertModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.Tensor | None</code> of shape <code>(batch_size, sequence_length)</code>, defaults to <code>None</code>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:
<ul>
<li>1 for tokens that are <strong>sentence A</strong>,</li>
<li>0 for tokens that are <strong>sentence B</strong>.
<a href="https://huggingface.co/docs/transformers/glossary#token-type-ids" rel="nofollow">What are token type IDs?</a></li>
</ul>`,name:"token_type_ids"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1011/optimum/neuron/models/inference/bert/modeling_bert.py#L65"}}),A=new Ke({props:{anchor:"optimum.neuron.NeuronBertModel.forward.example",$$slots:{default:[Un]},$$scope:{ctx:j}}}),fe=new X({props:{title:"NeuronBertForMaskedLM",local:"optimum.neuron.NeuronBertForMaskedLM",headingTag:"h2"}}),Me=new U({props:{name:"class optimum.neuron.NeuronBertForMaskedLM",anchor:"optimum.neuron.NeuronBertForMaskedLM",parameters:[{name:"model",val:": ScriptModule"},{name:"config",val:": PretrainedConfig"},{name:"model_save_dir",val:": str | pathlib.Path | tempfile.TemporaryDirectory | None = None"},{name:"model_file_name",val:": str | None = None"},{name:"preprocessors",val:": list | None = None"},{name:"neuron_config",val:": NeuronDefaultConfig | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.neuron.NeuronBertForMaskedLM.config",description:`<strong>config</strong> (<code>transformers.PretrainedConfig</code>) &#x2014; <a href="https://huggingface.co/docs/transformers/main_classes/configuration#transformers.PretrainedConfig" rel="nofollow">PretrainedConfig</a> is the 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 <code>optimum.neuron.modeling.NeuronTracedModel.from_pretrained</code> method to load the model weights.`,name:"config"},{anchor:"optimum.neuron.NeuronBertForMaskedLM.model",description:'<strong>model</strong> (<code>torch.jit._script.ScriptModule</code>) &#x2014; <a href="https://pytorch.org/docs/stable/generated/torch.jit.ScriptModule.html" rel="nofollow">torch.jit._script.ScriptModule</a> is the TorchScript module with embedded NEFF(Neuron Executable File Format) compiled by neuron(x) compiler.',name:"model"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1011/optimum/neuron/models/inference/bert/modeling_bert.py#L110"}}),be=new U({props:{name:"forward",anchor:"optimum.neuron.NeuronBertForMaskedLM.forward",parameters:[{name:"input_ids",val:": Tensor"},{name:"attention_mask",val:": Tensor"},{name:"token_type_ids",val:": torch.Tensor | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.neuron.NeuronBertForMaskedLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.
Indices can be obtained using <a href="https://huggingface.co/docs/transformers/autoclass_tutorial#autotokenizer" rel="nofollow"><code>AutoTokenizer</code></a>.
See <a href="https://huggingface.co/docs/transformers/main_classes/tokenizer#transformers.PreTrainedTokenizerBase.encode" rel="nofollow"><code>PreTrainedTokenizer.encode</code></a> and
<a href="https://huggingface.co/docs/transformers/main_classes/tokenizer#transformers.PreTrainedTokenizerBase.__call__" rel="nofollow"><code>PreTrainedTokenizer.__call__</code></a> for details.
<a href="https://huggingface.co/docs/transformers/glossary#input-ids" rel="nofollow">What are input IDs?</a>`,name:"input_ids"},{anchor:"optimum.neuron.NeuronBertForMaskedLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor | None</code> of shape <code>(batch_size, sequence_length)</code>, defaults to <code>None</code>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.
<a href="https://huggingface.co/docs/transformers/glossary#attention-mask" rel="nofollow">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"optimum.neuron.NeuronBertForMaskedLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.Tensor | None</code> of shape <code>(batch_size, sequence_length)</code>, defaults to <code>None</code>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:
<ul>
<li>1 for tokens that are <strong>sentence A</strong>,</li>
<li>0 for tokens that are <strong>sentence B</strong>.
<a href="https://huggingface.co/docs/transformers/glossary#token-type-ids" rel="nofollow">What are token type IDs?</a></li>
</ul>`,name:"token_type_ids"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1011/optimum/neuron/models/inference/bert/modeling_bert.py#L113"}}),L=new Ke({props:{anchor:"optimum.neuron.NeuronBertForMaskedLM.forward.example",$$slots:{default:[In]},$$scope:{ctx:j}}}),ye=new X({props:{title:"NeuronBertForSequenceClassification",local:"optimum.neuron.NeuronBertForSequenceClassification",headingTag:"h2"}}),we=new U({props:{name:"class optimum.neuron.NeuronBertForSequenceClassification",anchor:"optimum.neuron.NeuronBertForSequenceClassification",parameters:[{name:"model",val:": ScriptModule"},{name:"config",val:": PretrainedConfig"},{name:"model_save_dir",val:": str | pathlib.Path | tempfile.TemporaryDirectory | None = None"},{name:"model_file_name",val:": str | None = None"},{name:"preprocessors",val:": list | None = None"},{name:"neuron_config",val:": NeuronDefaultConfig | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.neuron.NeuronBertForSequenceClassification.config",description:`<strong>config</strong> (<code>transformers.PretrainedConfig</code>) &#x2014; <a href="https://huggingface.co/docs/transformers/main_classes/configuration#transformers.PretrainedConfig" rel="nofollow">PretrainedConfig</a> is the 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 <code>optimum.neuron.modeling.NeuronTracedModel.from_pretrained</code> method to load the model weights.`,name:"config"},{anchor:"optimum.neuron.NeuronBertForSequenceClassification.model",description:'<strong>model</strong> (<code>torch.jit._script.ScriptModule</code>) &#x2014; <a href="https://pytorch.org/docs/stable/generated/torch.jit.ScriptModule.html" rel="nofollow">torch.jit._script.ScriptModule</a> is the TorchScript module with embedded NEFF(Neuron Executable File Format) compiled by neuron(x) compiler.',name:"model"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1011/optimum/neuron/models/inference/bert/modeling_bert.py#L197"}}),_e=new U({props:{name:"forward",anchor:"optimum.neuron.NeuronBertForSequenceClassification.forward",parameters:[{name:"input_ids",val:": Tensor"},{name:"attention_mask",val:": Tensor"},{name:"token_type_ids",val:": torch.Tensor | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.neuron.NeuronBertForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.
Indices can be obtained using <a href="https://huggingface.co/docs/transformers/autoclass_tutorial#autotokenizer" rel="nofollow"><code>AutoTokenizer</code></a>.
See <a href="https://huggingface.co/docs/transformers/main_classes/tokenizer#transformers.PreTrainedTokenizerBase.encode" rel="nofollow"><code>PreTrainedTokenizer.encode</code></a> and
<a href="https://huggingface.co/docs/transformers/main_classes/tokenizer#transformers.PreTrainedTokenizerBase.__call__" rel="nofollow"><code>PreTrainedTokenizer.__call__</code></a> for details.
<a href="https://huggingface.co/docs/transformers/glossary#input-ids" rel="nofollow">What are input IDs?</a>`,name:"input_ids"},{anchor:"optimum.neuron.NeuronBertForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor | None</code> of shape <code>(batch_size, sequence_length)</code>, defaults to <code>None</code>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.
<a href="https://huggingface.co/docs/transformers/glossary#attention-mask" rel="nofollow">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"optimum.neuron.NeuronBertForSequenceClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.Tensor | None</code> of shape <code>(batch_size, sequence_length)</code>, defaults to <code>None</code>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:
<ul>
<li>1 for tokens that are <strong>sentence A</strong>,</li>
<li>0 for tokens that are <strong>sentence B</strong>.
<a href="https://huggingface.co/docs/transformers/glossary#token-type-ids" rel="nofollow">What are token type IDs?</a></li>
</ul>`,name:"token_type_ids"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1011/optimum/neuron/models/inference/bert/modeling_bert.py#L200"}}),Y=new Ke({props:{anchor:"optimum.neuron.NeuronBertForSequenceClassification.forward.example",$$slots:{default:[Fn]},$$scope:{ctx:j}}}),Te=new X({props:{title:"NeuronBertForTokenClassification",local:"optimum.neuron.NeuronBertForTokenClassification",headingTag:"h2"}}),ke=new U({props:{name:"class optimum.neuron.NeuronBertForTokenClassification",anchor:"optimum.neuron.NeuronBertForTokenClassification",parameters:[{name:"model",val:": ScriptModule"},{name:"config",val:": PretrainedConfig"},{name:"model_save_dir",val:": str | pathlib.Path | tempfile.TemporaryDirectory | None = None"},{name:"model_file_name",val:": str | None = None"},{name:"preprocessors",val:": list | None = None"},{name:"neuron_config",val:": NeuronDefaultConfig | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.neuron.NeuronBertForTokenClassification.config",description:`<strong>config</strong> (<code>transformers.PretrainedConfig</code>) &#x2014; <a href="https://huggingface.co/docs/transformers/main_classes/configuration#transformers.PretrainedConfig" rel="nofollow">PretrainedConfig</a> is the 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 <code>optimum.neuron.modeling.NeuronTracedModel.from_pretrained</code> method to load the model weights.`,name:"config"},{anchor:"optimum.neuron.NeuronBertForTokenClassification.model",description:'<strong>model</strong> (<code>torch.jit._script.ScriptModule</code>) &#x2014; <a href="https://pytorch.org/docs/stable/generated/torch.jit.ScriptModule.html" rel="nofollow">torch.jit._script.ScriptModule</a> is the TorchScript module with embedded NEFF(Neuron Executable File Format) compiled by neuron(x) compiler.',name:"model"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1011/optimum/neuron/models/inference/bert/modeling_bert.py#L240"}}),je=new U({props:{name:"forward",anchor:"optimum.neuron.NeuronBertForTokenClassification.forward",parameters:[{name:"input_ids",val:": Tensor"},{name:"attention_mask",val:": Tensor"},{name:"token_type_ids",val:": torch.Tensor | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.neuron.NeuronBertForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.
Indices can be obtained using <a href="https://huggingface.co/docs/transformers/autoclass_tutorial#autotokenizer" rel="nofollow"><code>AutoTokenizer</code></a>.
See <a href="https://huggingface.co/docs/transformers/main_classes/tokenizer#transformers.PreTrainedTokenizerBase.encode" rel="nofollow"><code>PreTrainedTokenizer.encode</code></a> and
<a href="https://huggingface.co/docs/transformers/main_classes/tokenizer#transformers.PreTrainedTokenizerBase.__call__" rel="nofollow"><code>PreTrainedTokenizer.__call__</code></a> for details.
<a href="https://huggingface.co/docs/transformers/glossary#input-ids" rel="nofollow">What are input IDs?</a>`,name:"input_ids"},{anchor:"optimum.neuron.NeuronBertForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor | None</code> of shape <code>(batch_size, sequence_length)</code>, defaults to <code>None</code>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.
<a href="https://huggingface.co/docs/transformers/glossary#attention-mask" rel="nofollow">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"optimum.neuron.NeuronBertForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.Tensor | None</code> of shape <code>(batch_size, sequence_length)</code>, defaults to <code>None</code>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:
<ul>
<li>1 for tokens that are <strong>sentence A</strong>,</li>
<li>0 for tokens that are <strong>sentence B</strong>.
<a href="https://huggingface.co/docs/transformers/glossary#token-type-ids" rel="nofollow">What are token type IDs?</a></li>
</ul>`,name:"token_type_ids"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1011/optimum/neuron/models/inference/bert/modeling_bert.py#L243"}}),P=new Ke({props:{anchor:"optimum.neuron.NeuronBertForTokenClassification.forward.example",$$slots:{default:[Wn]},$$scope:{ctx:j}}}),ve=new X({props:{title:"NeuronBertForQuestionAnswering",local:"optimum.neuron.NeuronBertForQuestionAnswering",headingTag:"h2"}}),$e=new U({props:{name:"class optimum.neuron.NeuronBertForQuestionAnswering",anchor:"optimum.neuron.NeuronBertForQuestionAnswering",parameters:[{name:"model",val:": ScriptModule"},{name:"config",val:": PretrainedConfig"},{name:"model_save_dir",val:": str | pathlib.Path | tempfile.TemporaryDirectory | None = None"},{name:"model_file_name",val:": str | None = None"},{name:"preprocessors",val:": list | None = None"},{name:"neuron_config",val:": NeuronDefaultConfig | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.neuron.NeuronBertForQuestionAnswering.config",description:`<strong>config</strong> (<code>transformers.PretrainedConfig</code>) &#x2014; <a href="https://huggingface.co/docs/transformers/main_classes/configuration#transformers.PretrainedConfig" rel="nofollow">PretrainedConfig</a> is the 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 <code>optimum.neuron.modeling.NeuronTracedModel.from_pretrained</code> method to load the model weights.`,name:"config"},{anchor:"optimum.neuron.NeuronBertForQuestionAnswering.model",description:'<strong>model</strong> (<code>torch.jit._script.ScriptModule</code>) &#x2014; <a href="https://pytorch.org/docs/stable/generated/torch.jit.ScriptModule.html" rel="nofollow">torch.jit._script.ScriptModule</a> is the TorchScript module with embedded NEFF(Neuron Executable File Format) compiled by neuron(x) compiler.',name:"model"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1011/optimum/neuron/models/inference/bert/modeling_bert.py#L153"}}),Je=new U({props:{name:"forward",anchor:"optimum.neuron.NeuronBertForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": Tensor"},{name:"attention_mask",val:": Tensor"},{name:"token_type_ids",val:": torch.Tensor | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.neuron.NeuronBertForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.
Indices can be obtained using <a href="https://huggingface.co/docs/transformers/autoclass_tutorial#autotokenizer" rel="nofollow"><code>AutoTokenizer</code></a>.
See <a href="https://huggingface.co/docs/transformers/main_classes/tokenizer#transformers.PreTrainedTokenizerBase.encode" rel="nofollow"><code>PreTrainedTokenizer.encode</code></a> and
<a href="https://huggingface.co/docs/transformers/main_classes/tokenizer#transformers.PreTrainedTokenizerBase.__call__" rel="nofollow"><code>PreTrainedTokenizer.__call__</code></a> for details.
<a href="https://huggingface.co/docs/transformers/glossary#input-ids" rel="nofollow">What are input IDs?</a>`,name:"input_ids"},{anchor:"optimum.neuron.NeuronBertForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor | None</code> of shape <code>(batch_size, sequence_length)</code>, defaults to <code>None</code>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.
<a href="https://huggingface.co/docs/transformers/glossary#attention-mask" rel="nofollow">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"optimum.neuron.NeuronBertForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.Tensor | None</code> of shape <code>(batch_size, sequence_length)</code>, defaults to <code>None</code>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:
<ul>
<li>1 for tokens that are <strong>sentence A</strong>,</li>
<li>0 for tokens that are <strong>sentence B</strong>.
<a href="https://huggingface.co/docs/transformers/glossary#token-type-ids" rel="nofollow">What are token type IDs?</a></li>
</ul>`,name:"token_type_ids"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1011/optimum/neuron/models/inference/bert/modeling_bert.py#L156"}}),D=new Ke({props:{anchor:"optimum.neuron.NeuronBertForQuestionAnswering.forward.example",$$slots:{default:[Xn]},$$scope:{ctx:j}}}),Be=new X({props:{title:"NeuronBertForMultipleChoice",local:"optimum.neuron.NeuronBertForMultipleChoice",headingTag:"h2"}}),Ne=new U({props:{name:"class optimum.neuron.NeuronBertForMultipleChoice",anchor:"optimum.neuron.NeuronBertForMultipleChoice",parameters:[{name:"model",val:": ScriptModule"},{name:"config",val:": PretrainedConfig"},{name:"model_save_dir",val:": str | pathlib.Path | tempfile.TemporaryDirectory | None = None"},{name:"model_file_name",val:": str | None = None"},{name:"preprocessors",val:": list | None = None"},{name:"neuron_config",val:": NeuronDefaultConfig | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.neuron.NeuronBertForMultipleChoice.config",description:`<strong>config</strong> (<code>transformers.PretrainedConfig</code>) &#x2014; <a href="https://huggingface.co/docs/transformers/main_classes/configuration#transformers.PretrainedConfig" rel="nofollow">PretrainedConfig</a> is the 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 <code>optimum.neuron.modeling.NeuronTracedModel.from_pretrained</code> method to load the model weights.`,name:"config"},{anchor:"optimum.neuron.NeuronBertForMultipleChoice.model",description:'<strong>model</strong> (<code>torch.jit._script.ScriptModule</code>) &#x2014; <a href="https://pytorch.org/docs/stable/generated/torch.jit.ScriptModule.html" rel="nofollow">torch.jit._script.ScriptModule</a> is the TorchScript module with embedded NEFF(Neuron Executable File Format) compiled by neuron(x) compiler.',name:"model"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1011/optimum/neuron/models/inference/bert/modeling_bert.py#L284"}}),Ce=new U({props:{name:"forward",anchor:"optimum.neuron.NeuronBertForMultipleChoice.forward",parameters:[{name:"input_ids",val:": Tensor"},{name:"attention_mask",val:": Tensor"},{name:"token_type_ids",val:": torch.Tensor | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.neuron.NeuronBertForMultipleChoice.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.
Indices can be obtained using <a href="https://huggingface.co/docs/transformers/autoclass_tutorial#autotokenizer" rel="nofollow"><code>AutoTokenizer</code></a>.
See <a href="https://huggingface.co/docs/transformers/main_classes/tokenizer#transformers.PreTrainedTokenizerBase.encode" rel="nofollow"><code>PreTrainedTokenizer.encode</code></a> and
<a href="https://huggingface.co/docs/transformers/main_classes/tokenizer#transformers.PreTrainedTokenizerBase.__call__" rel="nofollow"><code>PreTrainedTokenizer.__call__</code></a> for details.
<a href="https://huggingface.co/docs/transformers/glossary#input-ids" rel="nofollow">What are input IDs?</a>`,name:"input_ids"},{anchor:"optimum.neuron.NeuronBertForMultipleChoice.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor | None</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, defaults to <code>None</code>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.
<a href="https://huggingface.co/docs/transformers/glossary#attention-mask" rel="nofollow">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"optimum.neuron.NeuronBertForMultipleChoice.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.Tensor | None</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, defaults to <code>None</code>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:
<ul>
<li>1 for tokens that are <strong>sentence A</strong>,</li>
<li>0 for tokens that are <strong>sentence B</strong>.
<a href="https://huggingface.co/docs/transformers/glossary#token-type-ids" rel="nofollow">What are token type IDs?</a></li>
</ul>`,name:"token_type_ids"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1011/optimum/neuron/models/inference/bert/modeling_bert.py#L287"}}),K=new Ke({props:{anchor:"optimum.neuron.NeuronBertForMultipleChoice.forward.example",$$slots:{default:[xn]},$$scope:{ctx:j}}}),{c(){a=d("meta"),T=s(),y=d("p"),i=s(),m(b.$$.fragment),t=s(),m(w.$$.fragment),tt=s(),m(oe.$$.fragment),nt=s(),se=d("p"),se.innerHTML=nn,ot=s(),re=d("p"),re.innerHTML=on,st=s(),m(ae.$$.fragment),rt=s(),le=d("p"),le.innerHTML=sn,at=s(),m(ie.$$.fragment),lt=s(),ce=d("p"),ce.textContent=rn,it=s(),m(de.$$.fragment),ct=s(),Q=d("blockquote"),Q.innerHTML=an,dt=s(),m(pe.$$.fragment),pt=s(),m(me.$$.fragment),mt=s(),m(ue.$$.fragment),ut=s(),$=d("div"),m(ge.$$.fragment),$t=s(),Ze=d("p"),Ze.textContent=ln,Jt=s(),Ue=d("p"),Ue.innerHTML=cn,Bt=s(),x=d("div"),m(he.$$.fragment),Nt=s(),Ie=d("p"),Ie.innerHTML=dn,Ct=s(),m(A.$$.fragment),gt=s(),m(fe.$$.fragment),ht=s(),J=d("div"),m(Me.$$.fragment),Zt=s(),Fe=d("p"),Fe.innerHTML=pn,Ut=s(),We=d("p"),We.innerHTML=mn,It=s(),z=d("div"),m(be.$$.fragment),Ft=s(),Xe=d("p"),Xe.innerHTML=un,Wt=s(),m(L.$$.fragment),ft=s(),m(ye.$$.fragment),Mt=s(),B=d("div"),m(we.$$.fragment),Xt=s(),xe=d("p"),xe.textContent=gn,xt=s(),ze=d("p"),ze.innerHTML=hn,zt=s(),V=d("div"),m(_e.$$.fragment),Vt=s(),Ve=d("p"),Ve.innerHTML=fn,Gt=s(),m(Y.$$.fragment),bt=s(),m(Te.$$.fragment),yt=s(),N=d("div"),m(ke.$$.fragment),Et=s(),Ge=d("p"),Ge.textContent=Mn,Rt=s(),Ee=d("p"),Ee.innerHTML=bn,qt=s(),G=d("div"),m(je.$$.fragment),Ht=s(),Re=d("p"),Re.innerHTML=yn,St=s(),m(P.$$.fragment),wt=s(),m(ve.$$.fragment),_t=s(),C=d("div"),m($e.$$.fragment),Qt=s(),qe=d("p"),qe.innerHTML=wn,At=s(),He=d("p"),He.innerHTML=_n,Lt=s(),E=d("div"),m(Je.$$.fragment),Yt=s(),Se=d("p"),Se.innerHTML=Tn,Pt=s(),m(D.$$.fragment),Tt=s(),m(Be.$$.fragment),kt=s(),Z=d("div"),m(Ne.$$.fragment),Dt=s(),Qe=d("p"),Qe.textContent=kn,Kt=s(),Ae=d("p"),Ae.innerHTML=jn,Ot=s(),R=d("div"),m(Ce.$$.fragment),en=s(),Le=d("p"),Le.innerHTML=vn,tn=s(),m(K.$$.fragment),jt=s(),et=d("p"),this.h()},l(e){const n=Cn("svelte-u9bgzb",document.head);a=p(n,"META",{name:!0,content:!0}),n.forEach(o),T=r(e),y=p(e,"P",{}),v(y).forEach(o),i=r(e),u(b.$$.fragment,e),t=r(e),u(w.$$.fragment,e),tt=r(e),u(oe.$$.fragment,e),nt=r(e),se=p(e,"P",{"data-svelte-h":!0}),_(se)!=="svelte-16kuata"&&(se.innerHTML=nn),ot=r(e),re=p(e,"P",{"data-svelte-h":!0}),_(re)!=="svelte-z34ajl"&&(re.innerHTML=on),st=r(e),u(ae.$$.fragment,e),rt=r(e),le=p(e,"P",{"data-svelte-h":!0}),_(le)!=="svelte-huz3tp"&&(le.innerHTML=sn),at=r(e),u(ie.$$.fragment,e),lt=r(e),ce=p(e,"P",{"data-svelte-h":!0}),_(ce)!=="svelte-87nkn2"&&(ce.textContent=rn),it=r(e),u(de.$$.fragment,e),ct=r(e),Q=p(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),_(Q)!=="svelte-13x1ycp"&&(Q.innerHTML=an),dt=r(e),u(pe.$$.fragment,e),pt=r(e),u(me.$$.fragment,e),mt=r(e),u(ue.$$.fragment,e),ut=r(e),$=p(e,"DIV",{class:!0});var I=v($);u(ge.$$.fragment,I),$t=r(I),Ze=p(I,"P",{"data-svelte-h":!0}),_(Ze)!=="svelte-hbw8e6"&&(Ze.textContent=ln),Jt=r(I),Ue=p(I,"P",{"data-svelte-h":!0}),_(Ue)!=="svelte-t21i2g"&&(Ue.innerHTML=cn),Bt=r(I),x=p(I,"DIV",{class:!0});var q=v(x);u(he.$$.fragment,q),Nt=r(q),Ie=p(q,"P",{"data-svelte-h":!0}),_(Ie)!=="svelte-jiesgj"&&(Ie.innerHTML=dn),Ct=r(q),u(A.$$.fragment,q),q.forEach(o),I.forEach(o),gt=r(e),u(fe.$$.fragment,e),ht=r(e),J=p(e,"DIV",{class:!0});var F=v(J);u(Me.$$.fragment,F),Zt=r(F),Fe=p(F,"P",{"data-svelte-h":!0}),_(Fe)!=="svelte-j3mfpi"&&(Fe.innerHTML=pn),Ut=r(F),We=p(F,"P",{"data-svelte-h":!0}),_(We)!=="svelte-t21i2g"&&(We.innerHTML=mn),It=r(F),z=p(F,"DIV",{class:!0});var H=v(z);u(be.$$.fragment,H),Ft=r(H),Xe=p(H,"P",{"data-svelte-h":!0}),_(Xe)!=="svelte-1aoqerb"&&(Xe.innerHTML=un),Wt=r(H),u(L.$$.fragment,H),H.forEach(o),F.forEach(o),ft=r(e),u(ye.$$.fragment,e),Mt=r(e),B=p(e,"DIV",{class:!0});var W=v(B);u(we.$$.fragment,W),Xt=r(W),xe=p(W,"P",{"data-svelte-h":!0}),_(xe)!=="svelte-sy64kq"&&(xe.textContent=gn),xt=r(W),ze=p(W,"P",{"data-svelte-h":!0}),_(ze)!=="svelte-t21i2g"&&(ze.innerHTML=hn),zt=r(W),V=p(W,"DIV",{class:!0});var S=v(V);u(_e.$$.fragment,S),Vt=r(S),Ve=p(S,"P",{"data-svelte-h":!0}),_(Ve)!=="svelte-1a3qtk"&&(Ve.innerHTML=fn),Gt=r(S),u(Y.$$.fragment,S),S.forEach(o),W.forEach(o),bt=r(e),u(Te.$$.fragment,e),yt=r(e),N=p(e,"DIV",{class:!0});var O=v(N);u(ke.$$.fragment,O),Et=r(O),Ge=p(O,"P",{"data-svelte-h":!0}),_(Ge)!=="svelte-16p5zms"&&(Ge.textContent=Mn),Rt=r(O),Ee=p(O,"P",{"data-svelte-h":!0}),_(Ee)!=="svelte-t21i2g"&&(Ee.innerHTML=bn),qt=r(O),G=p(O,"DIV",{class:!0});var Ye=v(G);u(je.$$.fragment,Ye),Ht=r(Ye),Re=p(Ye,"P",{"data-svelte-h":!0}),_(Re)!=="svelte-ht9lny"&&(Re.innerHTML=yn),St=r(Ye),u(P.$$.fragment,Ye),Ye.forEach(o),O.forEach(o),wt=r(e),u(ve.$$.fragment,e),_t=r(e),C=p(e,"DIV",{class:!0});var ee=v(C);u($e.$$.fragment,ee),Qt=r(ee),qe=p(ee,"P",{"data-svelte-h":!0}),_(qe)!=="svelte-1k6no5p"&&(qe.innerHTML=wn),At=r(ee),He=p(ee,"P",{"data-svelte-h":!0}),_(He)!=="svelte-t21i2g"&&(He.innerHTML=_n),Lt=r(ee),E=p(ee,"DIV",{class:!0});var Pe=v(E);u(Je.$$.fragment,Pe),Yt=r(Pe),Se=p(Pe,"P",{"data-svelte-h":!0}),_(Se)!=="svelte-1fgv7jr"&&(Se.innerHTML=Tn),Pt=r(Pe),u(D.$$.fragment,Pe),Pe.forEach(o),ee.forEach(o),Tt=r(e),u(Be.$$.fragment,e),kt=r(e),Z=p(e,"DIV",{class:!0});var te=v(Z);u(Ne.$$.fragment,te),Dt=r(te),Qe=p(te,"P",{"data-svelte-h":!0}),_(Qe)!=="svelte-1kpvzm3"&&(Qe.textContent=kn),Kt=r(te),Ae=p(te,"P",{"data-svelte-h":!0}),_(Ae)!=="svelte-t21i2g"&&(Ae.innerHTML=jn),Ot=r(te),R=p(te,"DIV",{class:!0});var De=v(R);u(Ce.$$.fragment,De),en=r(De),Le=p(De,"P",{"data-svelte-h":!0}),_(Le)!=="svelte-ujqr1a"&&(Le.innerHTML=vn),tn=r(De),u(K.$$.fragment,De),De.forEach(o),te.forEach(o),jt=r(e),et=p(e,"P",{}),v(et).forEach(o),this.h()},h(){k(a,"name","hf:doc:metadata"),k(a,"content",Vn),k(Q,"class","tip"),k(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,n){l(document.head,a),c(e,T,n),c(e,y,n),c(e,i,n),g(b,e,n),c(e,t,n),g(w,e,n),c(e,tt,n),g(oe,e,n),c(e,nt,n),c(e,se,n),c(e,ot,n),c(e,re,n),c(e,st,n),g(ae,e,n),c(e,rt,n),c(e,le,n),c(e,at,n),g(ie,e,n),c(e,lt,n),c(e,ce,n),c(e,it,n),g(de,e,n),c(e,ct,n),c(e,Q,n),c(e,dt,n),g(pe,e,n),c(e,pt,n),g(me,e,n),c(e,mt,n),g(ue,e,n),c(e,ut,n),c(e,$,n),g(ge,$,null),l($,$t),l($,Ze),l($,Jt),l($,Ue),l($,Bt),l($,x),g(he,x,null),l(x,Nt),l(x,Ie),l(x,Ct),g(A,x,null),c(e,gt,n),g(fe,e,n),c(e,ht,n),c(e,J,n),g(Me,J,null),l(J,Zt),l(J,Fe),l(J,Ut),l(J,We),l(J,It),l(J,z),g(be,z,null),l(z,Ft),l(z,Xe),l(z,Wt),g(L,z,null),c(e,ft,n),g(ye,e,n),c(e,Mt,n),c(e,B,n),g(we,B,null),l(B,Xt),l(B,xe),l(B,xt),l(B,ze),l(B,zt),l(B,V),g(_e,V,null),l(V,Vt),l(V,Ve),l(V,Gt),g(Y,V,null),c(e,bt,n),g(Te,e,n),c(e,yt,n),c(e,N,n),g(ke,N,null),l(N,Et),l(N,Ge),l(N,Rt),l(N,Ee),l(N,qt),l(N,G),g(je,G,null),l(G,Ht),l(G,Re),l(G,St),g(P,G,null),c(e,wt,n),g(ve,e,n),c(e,_t,n),c(e,C,n),g($e,C,null),l(C,Qt),l(C,qe),l(C,At),l(C,He),l(C,Lt),l(C,E),g(Je,E,null),l(E,Yt),l(E,Se),l(E,Pt),g(D,E,null),c(e,Tt,n),g(Be,e,n),c(e,kt,n),c(e,Z,n),g(Ne,Z,null),l(Z,Dt),l(Z,Qe),l(Z,Kt),l(Z,Ae),l(Z,Ot),l(Z,R),g(Ce,R,null),l(R,en),l(R,Le),l(R,tn),g(K,R,null),c(e,jt,n),c(e,et,n),vt=!0},p(e,[n]){const I={};n&2&&(I.$$scope={dirty:n,ctx:e}),A.$set(I);const q={};n&2&&(q.$$scope={dirty:n,ctx:e}),L.$set(q);const F={};n&2&&(F.$$scope={dirty:n,ctx:e}),Y.$set(F);const H={};n&2&&(H.$$scope={dirty:n,ctx:e}),P.$set(H);const W={};n&2&&(W.$$scope={dirty:n,ctx:e}),D.$set(W);const S={};n&2&&(S.$$scope={dirty:n,ctx:e}),K.$set(S)},i(e){vt||(h(b.$$.fragment,e),h(w.$$.fragment,e),h(oe.$$.fragment,e),h(ae.$$.fragment,e),h(ie.$$.fragment,e),h(de.$$.fragment,e),h(pe.$$.fragment,e),h(me.$$.fragment,e),h(ue.$$.fragment,e),h(ge.$$.fragment,e),h(he.$$.fragment,e),h(A.$$.fragment,e),h(fe.$$.fragment,e),h(Me.$$.fragment,e),h(be.$$.fragment,e),h(L.$$.fragment,e),h(ye.$$.fragment,e),h(we.$$.fragment,e),h(_e.$$.fragment,e),h(Y.$$.fragment,e),h(Te.$$.fragment,e),h(ke.$$.fragment,e),h(je.$$.fragment,e),h(P.$$.fragment,e),h(ve.$$.fragment,e),h($e.$$.fragment,e),h(Je.$$.fragment,e),h(D.$$.fragment,e),h(Be.$$.fragment,e),h(Ne.$$.fragment,e),h(Ce.$$.fragment,e),h(K.$$.fragment,e),vt=!0)},o(e){f(b.$$.fragment,e),f(w.$$.fragment,e),f(oe.$$.fragment,e),f(ae.$$.fragment,e),f(ie.$$.fragment,e),f(de.$$.fragment,e),f(pe.$$.fragment,e),f(me.$$.fragment,e),f(ue.$$.fragment,e),f(ge.$$.fragment,e),f(he.$$.fragment,e),f(A.$$.fragment,e),f(fe.$$.fragment,e),f(Me.$$.fragment,e),f(be.$$.fragment,e),f(L.$$.fragment,e),f(ye.$$.fragment,e),f(we.$$.fragment,e),f(_e.$$.fragment,e),f(Y.$$.fragment,e),f(Te.$$.fragment,e),f(ke.$$.fragment,e),f(je.$$.fragment,e),f(P.$$.fragment,e),f(ve.$$.fragment,e),f($e.$$.fragment,e),f(Je.$$.fragment,e),f(D.$$.fragment,e),f(Be.$$.fragment,e),f(Ne.$$.fragment,e),f(Ce.$$.fragment,e),f(K.$$.fragment,e),vt=!1},d(e){e&&(o(T),o(y),o(i),o(t),o(tt),o(nt),o(se),o(ot),o(re),o(st),o(rt),o(le),o(at),o(lt),o(ce),o(it),o(ct),o(Q),o(dt),o(pt),o(mt),o(ut),o($),o(gt),o(ht),o(J),o(ft),o(Mt),o(B),o(bt),o(yt),o(N),o(wt),o(_t),o(C),o(Tt),o(kt),o(Z),o(jt),o(et)),o(a),M(b,e),M(w,e),M(oe,e),M(ae,e),M(ie,e),M(de,e),M(pe,e),M(me,e),M(ue,e),M(ge),M(he),M(A),M(fe,e),M(Me),M(be),M(L),M(ye,e),M(we),M(_e),M(Y),M(Te,e),M(ke),M(je),M(P),M(ve,e),M($e),M(Je),M(D),M(Be,e),M(Ne),M(Ce),M(K)}}}const Vn='{"title":"BERT","local":"bert","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Export to Neuron","local":"export-to-neuron","sections":[{"title":"Option 1: CLI","local":"option-1-cli","sections":[],"depth":3},{"title":"Option 2: Python API","local":"option-2-python-api","sections":[],"depth":3}],"depth":2},{"title":"NeuronBertModel","local":"optimum.neuron.NeuronBertModel","sections":[],"depth":2},{"title":"NeuronBertForMaskedLM","local":"optimum.neuron.NeuronBertForMaskedLM","sections":[],"depth":2},{"title":"NeuronBertForSequenceClassification","local":"optimum.neuron.NeuronBertForSequenceClassification","sections":[],"depth":2},{"title":"NeuronBertForTokenClassification","local":"optimum.neuron.NeuronBertForTokenClassification","sections":[],"depth":2},{"title":"NeuronBertForQuestionAnswering","local":"optimum.neuron.NeuronBertForQuestionAnswering","sections":[],"depth":2},{"title":"NeuronBertForMultipleChoice","local":"optimum.neuron.NeuronBertForMultipleChoice","sections":[],"depth":2}],"depth":1}';function Gn(j){return Jn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ln extends Bn{constructor(a){super(),Nn(this,a,Gn,zn,$n,{})}}export{Ln as component};
