import{S as Qi,i as Xi,s as Hi,e as a,k as f,w,t as p,M as Wi,c as i,d as o,m as h,a as l,x as T,h as m,b as q,G as e,g as v,y as b,q as M,o as O,B as y,v as Bi,L as D}from"../../../chunks/vendor-hf-doc-builder.js";import{T as Gt}from"../../../chunks/Tip-hf-doc-builder.js";import{D as R}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as Q}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as be}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as L}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Vi(E){let s,_,d,u,g;return{c(){s=a("p"),_=p("Although the recipe for forward pass needs to be defined within this function, one should call the "),d=a("code"),u=p("Module"),g=p(`
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(n){s=i(n,"P",{});var r=l(s);_=m(r,"Although the recipe for forward pass needs to be defined within this function, one should call the "),d=i(r,"CODE",{});var x=l(d);u=m(x,"Module"),x.forEach(o),g=m(r,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),r.forEach(o)},m(n,r){v(n,s,r),e(s,_),e(s,d),e(d,u),e(s,g)},d(n){n&&o(s)}}}function Ui(E){let s,_,d,u,g;return u=new Q({props:{code:`from transformers import AutoTokenizer
from optimum.onnxruntime import ORTModelForFeatureExtraction
import torch

tokenizer = AutoTokenizer.from_pretrained("optimum/all-MiniLM-L6-v2")
model = ORTModelForFeatureExtraction.from_pretrained("optimum/all-MiniLM-L6-v2")

inputs = tokenizer("My name is Philipp and I live in Germany.", return_tensors="pt")

outputs = model(**inputs)
logits = outputs.logits
list(logits.shape)`,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.onnxruntime <span class="hljs-keyword">import</span> ORTModelForFeatureExtraction
<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;optimum/all-MiniLM-L6-v2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ORTModelForFeatureExtraction.from_pretrained(<span class="hljs-string">&quot;optimum/all-MiniLM-L6-v2&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;My name is Philipp and I live in Germany.&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)`}}),{c(){s=a("p"),_=p("Example of feature extraction:"),d=f(),w(u.$$.fragment)},l(n){s=i(n,"P",{});var r=l(s);_=m(r,"Example of feature extraction:"),r.forEach(o),d=h(n),T(u.$$.fragment,n)},m(n,r){v(n,s,r),e(s,_),v(n,d,r),b(u,n,r),g=!0},p:D,i(n){g||(M(u.$$.fragment,n),g=!0)},o(n){O(u.$$.fragment,n),g=!1},d(n){n&&o(s),n&&o(d),y(u,n)}}}function Gi(E){let s,_,d,u,g,n,r,x;return r=new Q({props:{code:`from transformers import AutoTokenizer, pipeline
from optimum.onnxruntime import ORTModelForFeatureExtraction

tokenizer = AutoTokenizer.from_pretrained("optimum/all-MiniLM-L6-v2")
model = ORTModelForFeatureExtraction.from_pretrained("optimum/all-MiniLM-L6-v2")
onnx_extractor = pipeline("feature-extraction", model=model, tokenizer=tokenizer)

text = "My name is Philipp and I live in Germany."
pred = onnx_extractor(text)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, pipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> optimum.onnxruntime <span class="hljs-keyword">import</span> ORTModelForFeatureExtraction

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;optimum/all-MiniLM-L6-v2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ORTModelForFeatureExtraction.from_pretrained(<span class="hljs-string">&quot;optimum/all-MiniLM-L6-v2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>onnx_extractor = pipeline(<span class="hljs-string">&quot;feature-extraction&quot;</span>, model=model, tokenizer=tokenizer)

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;My name is Philipp and I live in Germany.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pred = onnx_extractor(text)`}}),{c(){s=a("p"),_=p("Example using "),d=a("code"),u=p("transformers.pipeline"),g=p(":"),n=f(),w(r.$$.fragment)},l(c){s=i(c,"P",{});var k=l(s);_=m(k,"Example using "),d=i(k,"CODE",{});var j=l(d);u=m(j,"transformers.pipeline"),j.forEach(o),g=m(k,":"),k.forEach(o),n=h(c),T(r.$$.fragment,c)},m(c,k){v(c,s,k),e(s,_),e(s,d),e(d,u),e(s,g),v(c,n,k),b(r,c,k),x=!0},p:D,i(c){x||(M(r.$$.fragment,c),x=!0)},o(c){O(r.$$.fragment,c),x=!1},d(c){c&&o(s),c&&o(n),y(r,c)}}}function Ji(E){let s,_,d,u,g;return{c(){s=a("p"),_=p("Although the recipe for forward pass needs to be defined within this function, one should call the "),d=a("code"),u=p("Module"),g=p(`
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(n){s=i(n,"P",{});var r=l(s);_=m(r,"Although the recipe for forward pass needs to be defined within this function, one should call the "),d=i(r,"CODE",{});var x=l(d);u=m(x,"Module"),x.forEach(o),g=m(r,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),r.forEach(o)},m(n,r){v(n,s,r),e(s,_),e(s,d),e(d,u),e(s,g)},d(n){n&&o(s)}}}function Yi(E){let s,_,d,u,g;return u=new Q({props:{code:`from transformers import AutoTokenizer
from optimum.onnxruntime import ORTModelForQuestionAnswering
import torch

tokenizer = AutoTokenizer.from_pretrained("optimum/roberta-base-squad2")
model = ORTModelForQuestionAnswering.from_pretrained("optimum/roberta-base-squad2")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"
inputs = tokenizer(question, text, return_tensors="pt")
start_positions = torch.tensor([1])
end_positions = torch.tensor([3])

outputs = model(**inputs, start_positions=start_positions, end_positions=end_positions)
start_scores = outputs.start_logits
end_scores = outputs.end_logits`,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.onnxruntime <span class="hljs-keyword">import</span> ORTModelForQuestionAnswering
<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;optimum/roberta-base-squad2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ORTModelForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;optimum/roberta-base-squad2&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>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">3</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`}}),{c(){s=a("p"),_=p("Example of question answering:"),d=f(),w(u.$$.fragment)},l(n){s=i(n,"P",{});var r=l(s);_=m(r,"Example of question answering:"),r.forEach(o),d=h(n),T(u.$$.fragment,n)},m(n,r){v(n,s,r),e(s,_),v(n,d,r),b(u,n,r),g=!0},p:D,i(n){g||(M(u.$$.fragment,n),g=!0)},o(n){O(u.$$.fragment,n),g=!1},d(n){n&&o(s),n&&o(d),y(u,n)}}}function Ki(E){let s,_,d,u,g,n,r,x;return r=new Q({props:{code:`from transformers import AutoTokenizer, pipeline
from optimum.onnxruntime import ORTModelForQuestionAnswering

tokenizer = AutoTokenizer.from_pretrained("optimum/roberta-base-squad2")
model = ORTModelForQuestionAnswering.from_pretrained("optimum/roberta-base-squad2")
onnx_qa = pipeline("question-answering", model=model, tokenizer=tokenizer)

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"
pred = onnx_qa(question, text)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, pipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> optimum.onnxruntime <span class="hljs-keyword">import</span> ORTModelForQuestionAnswering

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;optimum/roberta-base-squad2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ORTModelForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;optimum/roberta-base-squad2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>onnx_qa = pipeline(<span class="hljs-string">&quot;question-answering&quot;</span>, model=model, tokenizer=tokenizer)

<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>pred = onnx_qa(question, text)`}}),{c(){s=a("p"),_=p("Example using "),d=a("code"),u=p("transformers.pipeline"),g=p(":"),n=f(),w(r.$$.fragment)},l(c){s=i(c,"P",{});var k=l(s);_=m(k,"Example using "),d=i(k,"CODE",{});var j=l(d);u=m(j,"transformers.pipeline"),j.forEach(o),g=m(k,":"),k.forEach(o),n=h(c),T(r.$$.fragment,c)},m(c,k){v(c,s,k),e(s,_),e(s,d),e(d,u),e(s,g),v(c,n,k),b(r,c,k),x=!0},p:D,i(c){x||(M(r.$$.fragment,c),x=!0)},o(c){O(r.$$.fragment,c),x=!1},d(c){c&&o(s),c&&o(n),y(r,c)}}}function Zi(E){let s,_,d,u,g;return{c(){s=a("p"),_=p("Although the recipe for forward pass needs to be defined within this function, one should call the "),d=a("code"),u=p("Module"),g=p(`
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(n){s=i(n,"P",{});var r=l(s);_=m(r,"Although the recipe for forward pass needs to be defined within this function, one should call the "),d=i(r,"CODE",{});var x=l(d);u=m(x,"Module"),x.forEach(o),g=m(r,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),r.forEach(o)},m(n,r){v(n,s,r),e(s,_),e(s,d),e(d,u),e(s,g)},d(n){n&&o(s)}}}function el(E){let s,_,d,u,g;return u=new Q({props:{code:`from transformers import AutoTokenizer
from optimum.onnxruntime import ORTModelForSequenceClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("optimum/distilbert-base-uncased-finetuned-sst-2-english")
model = ORTModelForSequenceClassification.from_pretrained("optimum/distilbert-base-uncased-finetuned-sst-2-english")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")

outputs = model(**inputs)
logits = outputs.logits
list(logits.shape)`,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.onnxruntime <span class="hljs-keyword">import</span> ORTModelForSequenceClassification
<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;optimum/distilbert-base-uncased-finetuned-sst-2-english&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ORTModelForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;optimum/distilbert-base-uncased-finetuned-sst-2-english&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(logits.shape)`}}),{c(){s=a("p"),_=p("Example of single-label classification:"),d=f(),w(u.$$.fragment)},l(n){s=i(n,"P",{});var r=l(s);_=m(r,"Example of single-label classification:"),r.forEach(o),d=h(n),T(u.$$.fragment,n)},m(n,r){v(n,s,r),e(s,_),v(n,d,r),b(u,n,r),g=!0},p:D,i(n){g||(M(u.$$.fragment,n),g=!0)},o(n){O(u.$$.fragment,n),g=!1},d(n){n&&o(s),n&&o(d),y(u,n)}}}function tl(E){let s,_,d,u,g,n,r,x;return r=new Q({props:{code:`from transformers import AutoTokenizer, pipeline
from optimum.onnxruntime import ORTModelForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("optimum/distilbert-base-uncased-finetuned-sst-2-english")
model = ORTModelForSequenceClassification.from_pretrained("optimum/distilbert-base-uncased-finetuned-sst-2-english")
onnx_classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)

text = "Hello, my dog is cute"
pred = onnx_classifier(text)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, pipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> optimum.onnxruntime <span class="hljs-keyword">import</span> ORTModelForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;optimum/distilbert-base-uncased-finetuned-sst-2-english&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ORTModelForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;optimum/distilbert-base-uncased-finetuned-sst-2-english&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>onnx_classifier = pipeline(<span class="hljs-string">&quot;text-classification&quot;</span>, model=model, tokenizer=tokenizer)

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pred = onnx_classifier(text)`}}),{c(){s=a("p"),_=p("Example using "),d=a("code"),u=p("transformers.pipelines"),g=p(":"),n=f(),w(r.$$.fragment)},l(c){s=i(c,"P",{});var k=l(s);_=m(k,"Example using "),d=i(k,"CODE",{});var j=l(d);u=m(j,"transformers.pipelines"),j.forEach(o),g=m(k,":"),k.forEach(o),n=h(c),T(r.$$.fragment,c)},m(c,k){v(c,s,k),e(s,_),e(s,d),e(d,u),e(s,g),v(c,n,k),b(r,c,k),x=!0},p:D,i(c){x||(M(r.$$.fragment,c),x=!0)},o(c){O(r.$$.fragment,c),x=!1},d(c){c&&o(s),c&&o(n),y(r,c)}}}function ol(E){let s,_,d,u,g,n,r,x;return r=new Q({props:{code:`from transformers import AutoTokenizer, pipeline
from optimum.onnxruntime import ORTModelForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("optimum/distilbert-base-uncased-mnli")
model = ORTModelForSequenceClassification.from_pretrained("optimum/distilbert-base-uncased-mnli")
onnx_z0 = pipeline("zero-shot-classification", model=model, tokenizer=tokenizer)

sequence_to_classify = "Who are you voting for in 2020?"
candidate_labels = ["Europe", "public health", "politics", "elections"]
pred = onnx_z0(sequence_to_classify, candidate_labels, multi_class=True)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, pipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> optimum.onnxruntime <span class="hljs-keyword">import</span> ORTModelForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;optimum/distilbert-base-uncased-mnli&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ORTModelForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;optimum/distilbert-base-uncased-mnli&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>onnx_z0 = pipeline(<span class="hljs-string">&quot;zero-shot-classification&quot;</span>, model=model, tokenizer=tokenizer)

<span class="hljs-meta">&gt;&gt;&gt; </span>sequence_to_classify = <span class="hljs-string">&quot;Who are you voting for in 2020?&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>candidate_labels = [<span class="hljs-string">&quot;Europe&quot;</span>, <span class="hljs-string">&quot;public health&quot;</span>, <span class="hljs-string">&quot;politics&quot;</span>, <span class="hljs-string">&quot;elections&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>pred = onnx_z0(sequence_to_classify, candidate_labels, multi_class=<span class="hljs-literal">True</span>)`}}),{c(){s=a("p"),_=p("Example using zero-shot-classification "),d=a("code"),u=p("transformers.pipelines"),g=p(":"),n=f(),w(r.$$.fragment)},l(c){s=i(c,"P",{});var k=l(s);_=m(k,"Example using zero-shot-classification "),d=i(k,"CODE",{});var j=l(d);u=m(j,"transformers.pipelines"),j.forEach(o),g=m(k,":"),k.forEach(o),n=h(c),T(r.$$.fragment,c)},m(c,k){v(c,s,k),e(s,_),e(s,d),e(d,u),e(s,g),v(c,n,k),b(r,c,k),x=!0},p:D,i(c){x||(M(r.$$.fragment,c),x=!0)},o(c){O(r.$$.fragment,c),x=!1},d(c){c&&o(s),c&&o(n),y(r,c)}}}function nl(E){let s,_,d,u,g;return{c(){s=a("p"),_=p("Although the recipe for forward pass needs to be defined within this function, one should call the "),d=a("code"),u=p("Module"),g=p(`
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(n){s=i(n,"P",{});var r=l(s);_=m(r,"Although the recipe for forward pass needs to be defined within this function, one should call the "),d=i(r,"CODE",{});var x=l(d);u=m(x,"Module"),x.forEach(o),g=m(r,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),r.forEach(o)},m(n,r){v(n,s,r),e(s,_),e(s,d),e(d,u),e(s,g)},d(n){n&&o(s)}}}function sl(E){let s,_,d,u,g;return u=new Q({props:{code:`from transformers import AutoTokenizer
from optimum.onnxruntime import ORTModelForTokenClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("optimum/bert-base-NER")
model = ORTModelForTokenClassification.from_pretrained("optimum/bert-base-NER")

inputs = tokenizer("My name is Philipp and I live in Germany.", return_tensors="pt")

outputs = model(**inputs)
logits = outputs.logits
list(logits.shape)`,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.onnxruntime <span class="hljs-keyword">import</span> ORTModelForTokenClassification
<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;optimum/bert-base-NER&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ORTModelForTokenClassification.from_pretrained(<span class="hljs-string">&quot;optimum/bert-base-NER&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;My name is Philipp and I live in Germany.&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)`}}),{c(){s=a("p"),_=p("Example of token classification:"),d=f(),w(u.$$.fragment)},l(n){s=i(n,"P",{});var r=l(s);_=m(r,"Example of token classification:"),r.forEach(o),d=h(n),T(u.$$.fragment,n)},m(n,r){v(n,s,r),e(s,_),v(n,d,r),b(u,n,r),g=!0},p:D,i(n){g||(M(u.$$.fragment,n),g=!0)},o(n){O(u.$$.fragment,n),g=!1},d(n){n&&o(s),n&&o(d),y(u,n)}}}function rl(E){let s,_,d,u,g,n,r,x;return r=new Q({props:{code:`from transformers import AutoTokenizer, pipeline
from optimum.onnxruntime import ORTModelForTokenClassification

tokenizer = AutoTokenizer.from_pretrained("optimum/bert-base-NER")
model = ORTModelForTokenClassification.from_pretrained("optimum/bert-base-NER")
onnx_ner = pipeline("token-classification", model=model, tokenizer=tokenizer)

text = "My name is Philipp and I live in Germany."
pred = onnx_ner(text)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, pipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> optimum.onnxruntime <span class="hljs-keyword">import</span> ORTModelForTokenClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;optimum/bert-base-NER&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ORTModelForTokenClassification.from_pretrained(<span class="hljs-string">&quot;optimum/bert-base-NER&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>onnx_ner = pipeline(<span class="hljs-string">&quot;token-classification&quot;</span>, model=model, tokenizer=tokenizer)

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;My name is Philipp and I live in Germany.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pred = onnx_ner(text)`}}),{c(){s=a("p"),_=p("Example using "),d=a("code"),u=p("transformers.pipelines"),g=p(":"),n=f(),w(r.$$.fragment)},l(c){s=i(c,"P",{});var k=l(s);_=m(k,"Example using "),d=i(k,"CODE",{});var j=l(d);u=m(j,"transformers.pipelines"),j.forEach(o),g=m(k,":"),k.forEach(o),n=h(c),T(r.$$.fragment,c)},m(c,k){v(c,s,k),e(s,_),e(s,d),e(d,u),e(s,g),v(c,n,k),b(r,c,k),x=!0},p:D,i(c){x||(M(r.$$.fragment,c),x=!0)},o(c){O(r.$$.fragment,c),x=!1},d(c){c&&o(s),c&&o(n),y(r,c)}}}function al(E){let s,_,d,u,g;return{c(){s=a("p"),_=p("Although the recipe for forward pass needs to be defined within this function, one should call the "),d=a("code"),u=p("Module"),g=p(`
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(n){s=i(n,"P",{});var r=l(s);_=m(r,"Although the recipe for forward pass needs to be defined within this function, one should call the "),d=i(r,"CODE",{});var x=l(d);u=m(x,"Module"),x.forEach(o),g=m(r,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),r.forEach(o)},m(n,r){v(n,s,r),e(s,_),e(s,d),e(d,u),e(s,g)},d(n){n&&o(s)}}}function il(E){let s,_,d,u,g;return u=new Q({props:{code:`from transformers import AutoTokenizer
from optimum.onnxruntime import ORTModelForCausalLM
import torch

tokenizer = AutoTokenizer.from_pretrained("optimum/gpt2")
model = ORTModelForCausalLM.from_pretrained("optimum/gpt2")

inputs = tokenizer("My name is Philipp and I live in Germany.", return_tensors="pt")

gen_tokens = model.generate(**inputs,do_sample=True,temperature=0.9, min_length=20,max_length=20)
tokenizer.batch_decode(gen_tokens)`,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.onnxruntime <span class="hljs-keyword">import</span> ORTModelForCausalLM
<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;optimum/gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ORTModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;optimum/gpt2&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;My name is Philipp and I live in Germany.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>gen_tokens = model.generate(**inputs,do_sample=<span class="hljs-literal">True</span>,temperature=<span class="hljs-number">0.9</span>, min_length=<span class="hljs-number">20</span>,max_length=<span class="hljs-number">20</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(gen_tokens)`}}),{c(){s=a("p"),_=p("Example of text generation:"),d=f(),w(u.$$.fragment)},l(n){s=i(n,"P",{});var r=l(s);_=m(r,"Example of text generation:"),r.forEach(o),d=h(n),T(u.$$.fragment,n)},m(n,r){v(n,s,r),e(s,_),v(n,d,r),b(u,n,r),g=!0},p:D,i(n){g||(M(u.$$.fragment,n),g=!0)},o(n){O(u.$$.fragment,n),g=!1},d(n){n&&o(s),n&&o(d),y(u,n)}}}function ll(E){let s,_,d,u,g,n,r,x;return r=new Q({props:{code:`from transformers import AutoTokenizer, pipeline
from optimum.onnxruntime import ORTModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("optimum/gpt2")
model = ORTModelForCausalLM.from_pretrained("optimum/gpt2")
onnx_gen = pipeline("text-generation", model=model, tokenizer=tokenizer)

text = "My name is Philipp and I live in Germany."
gen = onnx_gen(text)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, pipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> optimum.onnxruntime <span class="hljs-keyword">import</span> ORTModelForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;optimum/gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ORTModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;optimum/gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>onnx_gen = pipeline(<span class="hljs-string">&quot;text-generation&quot;</span>, model=model, tokenizer=tokenizer)

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;My name is Philipp and I live in Germany.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>gen = onnx_gen(text)`}}),{c(){s=a("p"),_=p("Example using "),d=a("code"),u=p("transformers.pipelines"),g=p(":"),n=f(),w(r.$$.fragment)},l(c){s=i(c,"P",{});var k=l(s);_=m(k,"Example using "),d=i(k,"CODE",{});var j=l(d);u=m(j,"transformers.pipelines"),j.forEach(o),g=m(k,":"),k.forEach(o),n=h(c),T(r.$$.fragment,c)},m(c,k){v(c,s,k),e(s,_),e(s,d),e(d,u),e(s,g),v(c,n,k),b(r,c,k),x=!0},p:D,i(c){x||(M(r.$$.fragment,c),x=!0)},o(c){O(r.$$.fragment,c),x=!1},d(c){c&&o(s),c&&o(n),y(r,c)}}}function pl(E){let s,_,d,u,g;return{c(){s=a("p"),_=p("Although the recipe for forward pass needs to be defined within this function, one should call the "),d=a("code"),u=p("Module"),g=p(`
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(n){s=i(n,"P",{});var r=l(s);_=m(r,"Although the recipe for forward pass needs to be defined within this function, one should call the "),d=i(r,"CODE",{});var x=l(d);u=m(x,"Module"),x.forEach(o),g=m(r,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),r.forEach(o)},m(n,r){v(n,s,r),e(s,_),e(s,d),e(d,u),e(s,g)},d(n){n&&o(s)}}}function ml(E){let s,_,d,u,g;return u=new Q({props:{code:`from transformers import AutoTokenizer
from optimum.onnxruntime import ORTModelForSeq2SeqLM

tokenizer = AutoTokenizer.from_pretrained("optimum/t5-small")
model = ORTModelForSeq2SeqLM.from_pretrained("optimum/t5-small")

inputs = tokenizer("My name is Eustache and I like to", return_tensors="pt")

gen_tokens = model.generate(**inputs)
outputs = tokenizer.batch_decode(gen_tokens)`,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.onnxruntime <span class="hljs-keyword">import</span> ORTModelForSeq2SeqLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;optimum/t5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ORTModelForSeq2SeqLM.from_pretrained(<span class="hljs-string">&quot;optimum/t5-small&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;My name is Eustache and I like to&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>gen_tokens = model.generate(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = tokenizer.batch_decode(gen_tokens)`}}),{c(){s=a("p"),_=p("Example of text generation:"),d=f(),w(u.$$.fragment)},l(n){s=i(n,"P",{});var r=l(s);_=m(r,"Example of text generation:"),r.forEach(o),d=h(n),T(u.$$.fragment,n)},m(n,r){v(n,s,r),e(s,_),v(n,d,r),b(u,n,r),g=!0},p:D,i(n){g||(M(u.$$.fragment,n),g=!0)},o(n){O(u.$$.fragment,n),g=!1},d(n){n&&o(s),n&&o(d),y(u,n)}}}function dl(E){let s,_,d,u,g,n,r,x;return r=new Q({props:{code:`from transformers import AutoTokenizer, pipeline
from optimum.onnxruntime import ORTModelForSeq2SeqLM

tokenizer = AutoTokenizer.from_pretrained("optimum/t5-small")
model = ORTModelForSeq2SeqLM.from_pretrained("optimum/t5-small")
onnx_translation = pipeline("translation_en_to_de", model=model, tokenizer=tokenizer)

text = "My name is Eustache."
pred = onnx_translation(text)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, pipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> optimum.onnxruntime <span class="hljs-keyword">import</span> ORTModelForSeq2SeqLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;optimum/t5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ORTModelForSeq2SeqLM.from_pretrained(<span class="hljs-string">&quot;optimum/t5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>onnx_translation = pipeline(<span class="hljs-string">&quot;translation_en_to_de&quot;</span>, model=model, tokenizer=tokenizer)

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;My name is Eustache.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pred = onnx_translation(text)`}}),{c(){s=a("p"),_=p("Example using "),d=a("code"),u=p("transformers.pipeline"),g=p(":"),n=f(),w(r.$$.fragment)},l(c){s=i(c,"P",{});var k=l(s);_=m(k,"Example using "),d=i(k,"CODE",{});var j=l(d);u=m(j,"transformers.pipeline"),j.forEach(o),g=m(k,":"),k.forEach(o),n=h(c),T(r.$$.fragment,c)},m(c,k){v(c,s,k),e(s,_),e(s,d),e(d,u),e(s,g),v(c,n,k),b(r,c,k),x=!0},p:D,i(c){x||(M(r.$$.fragment,c),x=!0)},o(c){O(r.$$.fragment,c),x=!1},d(c){c&&o(s),c&&o(n),y(r,c)}}}function cl(E){let s,_,d,u,g;return{c(){s=a("p"),_=p("Although the recipe for forward pass needs to be defined within this function, one should call the "),d=a("code"),u=p("Module"),g=p(`
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(n){s=i(n,"P",{});var r=l(s);_=m(r,"Although the recipe for forward pass needs to be defined within this function, one should call the "),d=i(r,"CODE",{});var x=l(d);u=m(x,"Module"),x.forEach(o),g=m(r,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),r.forEach(o)},m(n,r){v(n,s,r),e(s,_),e(s,d),e(d,u),e(s,g)},d(n){n&&o(s)}}}function ul(E){let s,_,d,u,g;return u=new Q({props:{code:`import requests
from PIL import Image
from optimum.onnxruntime import ORTModelForImageClassification
from transformers import AutoFeatureExtractor

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

preprocessor = AutoFeatureExtractor.from_pretrained("optimum/vit-base-patch16-224")
model = ORTModelForImageClassification.from_pretrained("optimum/vit-base-patch16-224")

inputs = preprocessor(images=image, return_tensors="pt")

outputs = model(**inputs)
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> optimum.onnxruntime <span class="hljs-keyword">import</span> ORTModelForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>preprocessor = AutoFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;optimum/vit-base-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ORTModelForImageClassification.from_pretrained(<span class="hljs-string">&quot;optimum/vit-base-patch16-224&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = preprocessor(images=image, 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`}}),{c(){s=a("p"),_=p("Example of image classification:"),d=f(),w(u.$$.fragment)},l(n){s=i(n,"P",{});var r=l(s);_=m(r,"Example of image classification:"),r.forEach(o),d=h(n),T(u.$$.fragment,n)},m(n,r){v(n,s,r),e(s,_),v(n,d,r),b(u,n,r),g=!0},p:D,i(n){g||(M(u.$$.fragment,n),g=!0)},o(n){O(u.$$.fragment,n),g=!1},d(n){n&&o(s),n&&o(d),y(u,n)}}}function fl(E){let s,_,d,u,g,n,r,x;return r=new Q({props:{code:`import requests
from PIL import Image
from transformers import AutoFeatureExtractor, pipeline
from optimum.onnxruntime import ORTModelForImageClassification

preprocessor = AutoFeatureExtractor.from_pretrained("optimum/vit-base-patch16-224")
model = ORTModelForImageClassification.from_pretrained("optimum/vit-base-patch16-224")
onnx_image_classifier = pipeline("image-classification", model=model, feature_extractor=preprocessor)

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
pred = onnx_image_classifier(url)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, pipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> optimum.onnxruntime <span class="hljs-keyword">import</span> ORTModelForImageClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>preprocessor = AutoFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;optimum/vit-base-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ORTModelForImageClassification.from_pretrained(<span class="hljs-string">&quot;optimum/vit-base-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>onnx_image_classifier = pipeline(<span class="hljs-string">&quot;image-classification&quot;</span>, model=model, feature_extractor=preprocessor)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pred = onnx_image_classifier(url)`}}),{c(){s=a("p"),_=p("Example using "),d=a("code"),u=p("transformers.pipeline"),g=p(":"),n=f(),w(r.$$.fragment)},l(c){s=i(c,"P",{});var k=l(s);_=m(k,"Example using "),d=i(k,"CODE",{});var j=l(d);u=m(j,"transformers.pipeline"),j.forEach(o),g=m(k,":"),k.forEach(o),n=h(c),T(r.$$.fragment,c)},m(c,k){v(c,s,k),e(s,_),e(s,d),e(d,u),e(s,g),v(c,n,k),b(r,c,k),x=!0},p:D,i(c){x||(M(r.$$.fragment,c),x=!0)},o(c){O(r.$$.fragment,c),x=!1},d(c){c&&o(s),c&&o(n),y(r,c)}}}function hl(E){let s,_,d,u,g,n,r,x,c,k,j,Me,so,rt,Gn,ro,Jn,kn,z,at,Yn,it,Kn,ao,Zn,es,ts,Oe,lt,os,io,ns,ss,ye,pt,rs,mt,as,lo,is,ls,ps,qe,dt,ms,po,ds,vn,me,Ee,mo,ct,cs,co,us,xn,P,ut,fs,uo,hs,gs,ft,_s,fo,$s,ks,vs,ho,xs,ws,X,ht,Ts,de,bs,go,Ms,Os,_o,ys,qs,Es,je,js,Re,Rs,Fe,wn,ce,Ce,$o,gt,Fs,ko,Cs,Tn,A,_t,zs,vo,Ps,As,$t,Ss,xo,Ns,Is,Ls,wo,Ds,Qs,H,kt,Xs,ue,Hs,To,Ws,Bs,bo,Vs,Us,Gs,ze,Js,Pe,Ys,Ae,bn,fe,Se,Mo,vt,Ks,Oo,Zs,Mn,S,xt,er,yo,tr,or,wt,nr,qo,sr,rr,ar,Eo,ir,lr,C,Tt,pr,he,mr,jo,dr,cr,Ro,ur,fr,hr,Ne,gr,Ie,_r,Le,$r,De,On,ge,Qe,Fo,bt,kr,Co,vr,yn,N,Mt,xr,zo,wr,Tr,Ot,br,Po,Mr,Or,yr,Ao,qr,Er,W,yt,jr,_e,Rr,So,Fr,Cr,No,zr,Pr,Ar,Xe,Sr,He,Nr,We,qn,$e,Be,Io,qt,Ir,Lo,Lr,En,F,Et,Dr,Do,Qr,Xr,jt,Hr,Qo,Wr,Br,Vr,Xo,Ur,Gr,B,Rt,Jr,ke,Yr,Ho,Kr,Zr,Wo,ea,ta,oa,Ve,na,Ue,sa,Ge,ra,Je,Ft,aa,Ct,ia,Bo,la,pa,jn,ve,Ye,Vo,zt,ma,Uo,da,Rn,K,Pt,ca,Go,ua,fa,V,At,ha,xe,ga,Jo,_a,$a,Yo,ka,va,xa,Ke,wa,Ze,Ta,et,Fn,we,tt,Ko,St,ba,Zo,Ma,Cn,I,Nt,Oa,en,ya,qa,It,Ea,tn,ja,Ra,Fa,on,Ca,za,U,Lt,Pa,Te,Aa,nn,Sa,Na,sn,Ia,La,Da,ot,Qa,nt,Xa,st,zn;return n=new be({}),rt=new be({}),at=new R({props:{name:"class optimum.onnxruntime.ORTModel",anchor:"optimum.onnxruntime.ORTModel",parameters:[{name:"model",val:": InferenceSession = None"},{name:"config",val:": PretrainedConfig = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/optimum/blob/vr_439/optimum/onnxruntime/modeling_ort.py#L106"}}),lt=new R({props:{name:"from_pretrained",anchor:"optimum.onnxruntime.ORTModel.from_pretrained",parameters:[{name:"model_id",val:": typing.Union[str, pathlib.Path]"},{name:"from_transformers",val:": bool = False"},{name:"force_download",val:": bool = False"},{name:"use_auth_token",val:": typing.Optional[str] = None"},{name:"cache_dir",val:": typing.Optional[str] = None"},{name:"provider",val:": typing.Optional[str] = 'CPUExecutionProvider'"},{name:"session_options",val:": typing.Optional[onnxruntime.capi.onnxruntime_pybind11_state.SessionOptions] = None"},{name:"provider_options",val:": typing.Optional[typing.Dict] = None"},{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.onnxruntime.ORTModel.from_pretrained.model_id",description:`<strong>model_id</strong> (<code>Union[str, Path]</code>) &#x2014;
Can be either:</p>
<ul>
<li>A string, the <em>model id</em> of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids can be located at the root-level, like <code>bert-base-uncased</code>, or namespaced under a
user or organization name, like <code>dbmdz/bert-base-german-cased</code>.</li>
<li>A path to a <em>directory</em> containing a model saved using <code>~OptimizedModel.save_pretrained</code>,
e.g., <code>./my_model_directory/</code>.</li>
</ul>`,name:"model_id"},{anchor:"optimum.onnxruntime.ORTModel.from_pretrained.from_transformers",description:`<strong>from_transformers</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Defines whether the provided <code>model_id</code> contains a vanilla Transformers checkpoint.`,name:"from_transformers"},{anchor:"optimum.onnxruntime.ORTModel.from_pretrained.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"optimum.onnxruntime.ORTModel.from_pretrained.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, will use the token generated
when running <code>transformers-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"use_auth_token"},{anchor:"optimum.onnxruntime.ORTModel.from_pretrained.cache_dir",description:`<strong>cache_dir</strong> (<code>str</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.`,name:"cache_dir"},{anchor:"optimum.onnxruntime.ORTModel.from_pretrained.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{anchor:"optimum.onnxruntime.ORTModel.from_pretrained.provider",description:`<strong>provider</strong> (<code>str</code>, <em>optional</em>) &#x2014;
ONNX Runtime providers to use for loading the model. See <a href="https://onnxruntime.ai/docs/execution-providers/" rel="nofollow">https://onnxruntime.ai/docs/execution-providers/</a> for
possible providers. Defaults to <code>CPUExecutionProvider</code>.`,name:"provider"},{anchor:"optimum.onnxruntime.ORTModel.from_pretrained.session_options",description:`<strong>session_options</strong> (<code>onnxruntime.SessionOptions</code>, <em>optional</em>), &#x2014;
ONNX Runtime session options to use for loading the model. Defaults to <code>None</code>.`,name:"session_options"},{anchor:"optimum.onnxruntime.ORTModel.from_pretrained.provider_options",description:`<strong>provider_options</strong> (<code>Dict</code>, <strong>optional</strong>) &#x2014;
Provider option dictionaries corresponding to the provider used. See available options
for each provider: <a href="https://onnxruntime.ai/docs/api/c/group___global.html" rel="nofollow">https://onnxruntime.ai/docs/api/c/group___global.html</a> . Defaults to <code>None</code>.`,name:"provider_options"}],source:"https://github.com/huggingface/optimum/blob/vr_439/optimum/onnxruntime/modeling_ort.py#L224",returnDescription:`
<p>The loaded ORTModel model.</p>
`,returnType:`
<p><code>ORTModel</code></p>
`}}),pt=new R({props:{name:"load_model",anchor:"optimum.onnxruntime.ORTModel.load_model",parameters:[{name:"path",val:": typing.Union[str, pathlib.Path]"},{name:"provider",val:": typing.Optional[str] = 'CPUExecutionProvider'"},{name:"session_options",val:": typing.Optional[onnxruntime.capi.onnxruntime_pybind11_state.SessionOptions] = None"},{name:"provider_options",val:": typing.Optional[typing.Dict] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.onnxruntime.ORTModel.load_model.path",description:`<strong>path</strong> (<code>str</code> or <code>Path</code>) &#x2014;
Directory from which to load the model.`,name:"path"},{anchor:"optimum.onnxruntime.ORTModel.load_model.provider",description:`<strong>provider</strong> (<code>str</code>, <em>optional</em>) &#x2014;
ONNX Runtime provider to use for loading the model. See <a href="https://onnxruntime.ai/docs/execution-providers/" rel="nofollow">https://onnxruntime.ai/docs/execution-providers/</a>
for possible providers. Defaults to <code>CPUExecutionProvider</code>.`,name:"provider"},{anchor:"optimum.onnxruntime.ORTModel.load_model.session_options",description:`<strong>session_options</strong> (<code>onnxruntime.SessionOptions</code>, <em>optional</em>) &#x2014;
ONNX Runtime session options to use for loading the model. Defaults to <code>None</code>.`,name:"session_options"},{anchor:"optimum.onnxruntime.ORTModel.load_model.provider_options",description:`<strong>provider_options</strong> (<code>Dict</code>, <strong>optional</strong>) &#x2014;
Provider option dictionary corresponding to the provider used. See available options
for each provider: <a href="https://onnxruntime.ai/docs/api/c/group___global.html" rel="nofollow">https://onnxruntime.ai/docs/api/c/group___global.html</a> . Defaults to <code>None</code>.`,name:"provider_options"}],source:"https://github.com/huggingface/optimum/blob/vr_439/optimum/onnxruntime/modeling_ort.py#L165"}}),dt=new R({props:{name:"to",anchor:"optimum.onnxruntime.ORTModel.to",parameters:[{name:"device",val:": typing.Union[torch.device, str, int]"}],parametersDescription:[{anchor:"optimum.onnxruntime.ORTModel.to.device",description:`<strong>device</strong> (<code>torch.device</code> or <code>str</code> or <code>int</code>) &#x2014;
Device ordinal for CPU/GPU supports. Setting this to -1 will leverage CPU, a positive will run
the model on the associated CUDA device id. You can pass native <code>torch.device</code> or a <code>str</code> too.`,name:"device"}],source:"https://github.com/huggingface/optimum/blob/vr_439/optimum/onnxruntime/modeling_ort.py#L141",returnDescription:`
<p>the model placed on the requested device.</p>
`,returnType:`
<p><code>ORTModel</code></p>
`}}),ct=new be({}),ut=new R({props:{name:"class optimum.onnxruntime.ORTModelForFeatureExtraction",anchor:"optimum.onnxruntime.ORTModelForFeatureExtraction",parameters:[{name:"model",val:" = None"},{name:"config",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.onnxruntime.ORTModelForFeatureExtraction.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 <a href="/docs/optimum/pr_439/en/onnxruntime/package_reference/modeling_ort#optimum.onnxruntime.ORTModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"optimum.onnxruntime.ORTModelForFeatureExtraction.model",description:'<strong>model</strong> (<code>onnxruntime.InferenceSession</code>) &#x2014; <a href="https://onnxruntime.ai/docs/api/python/api_summary.html#inferencesession" rel="nofollow">onnxruntime.InferenceSession</a> is the main class used to run a model. Check out the <a href="/docs/optimum/pr_439/en/onnxruntime/package_reference/modeling_ort#optimum.onnxruntime.ORTModel.load_model">load_model()</a> method for more information.',name:"model"}],source:"https://github.com/huggingface/optimum/blob/vr_439/optimum/onnxruntime/modeling_ort.py#L432"}}),ht=new R({props:{name:"forward",anchor:"optimum.onnxruntime.ORTModelForFeatureExtraction.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.onnxruntime.ORTModelForFeatureExtraction.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.onnxruntime.ORTModelForFeatureExtraction.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:<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.onnxruntime.ORTModelForFeatureExtraction.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:<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/blob/vr_439/optimum/onnxruntime/modeling_ort.py#L446"}}),je=new Gt({props:{$$slots:{default:[Vi]},$$scope:{ctx:E}}}),Re=new L({props:{anchor:"optimum.onnxruntime.ORTModelForFeatureExtraction.forward.example",$$slots:{default:[Ui]},$$scope:{ctx:E}}}),Fe=new L({props:{anchor:"optimum.onnxruntime.ORTModelForFeatureExtraction.forward.example-2",$$slots:{default:[Gi]},$$scope:{ctx:E}}}),gt=new be({}),_t=new R({props:{name:"class optimum.onnxruntime.ORTModelForQuestionAnswering",anchor:"optimum.onnxruntime.ORTModelForQuestionAnswering",parameters:[{name:"model",val:" = None"},{name:"config",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.onnxruntime.ORTModelForQuestionAnswering.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 <a href="/docs/optimum/pr_439/en/onnxruntime/package_reference/modeling_ort#optimum.onnxruntime.ORTModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"optimum.onnxruntime.ORTModelForQuestionAnswering.model",description:'<strong>model</strong> (<code>onnxruntime.InferenceSession</code>) &#x2014; <a href="https://onnxruntime.ai/docs/api/python/api_summary.html#inferencesession" rel="nofollow">onnxruntime.InferenceSession</a> is the main class used to run a model. Check out the <a href="/docs/optimum/pr_439/en/onnxruntime/package_reference/modeling_ort#optimum.onnxruntime.ORTModel.load_model">load_model()</a> method for more information.',name:"model"}],source:"https://github.com/huggingface/optimum/blob/vr_439/optimum/onnxruntime/modeling_ort.py#L517"}}),kt=new R({props:{name:"forward",anchor:"optimum.onnxruntime.ORTModelForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.onnxruntime.ORTModelForQuestionAnswering.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.onnxruntime.ORTModelForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:<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.onnxruntime.ORTModelForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:<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/blob/vr_439/optimum/onnxruntime/modeling_ort.py#L531"}}),ze=new Gt({props:{$$slots:{default:[Ji]},$$scope:{ctx:E}}}),Pe=new L({props:{anchor:"optimum.onnxruntime.ORTModelForQuestionAnswering.forward.example",$$slots:{default:[Yi]},$$scope:{ctx:E}}}),Ae=new L({props:{anchor:"optimum.onnxruntime.ORTModelForQuestionAnswering.forward.example-2",$$slots:{default:[Ki]},$$scope:{ctx:E}}}),vt=new be({}),xt=new R({props:{name:"class optimum.onnxruntime.ORTModelForSequenceClassification",anchor:"optimum.onnxruntime.ORTModelForSequenceClassification",parameters:[{name:"model",val:" = None"},{name:"config",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.onnxruntime.ORTModelForSequenceClassification.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 <a href="/docs/optimum/pr_439/en/onnxruntime/package_reference/modeling_ort#optimum.onnxruntime.ORTModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"optimum.onnxruntime.ORTModelForSequenceClassification.model",description:'<strong>model</strong> (<code>onnxruntime.InferenceSession</code>) &#x2014; <a href="https://onnxruntime.ai/docs/api/python/api_summary.html#inferencesession" rel="nofollow">onnxruntime.InferenceSession</a> is the main class used to run a model. Check out the <a href="/docs/optimum/pr_439/en/onnxruntime/package_reference/modeling_ort#optimum.onnxruntime.ORTModel.load_model">load_model()</a> method for more information.',name:"model"}],source:"https://github.com/huggingface/optimum/blob/vr_439/optimum/onnxruntime/modeling_ort.py#L617"}}),Tt=new R({props:{name:"forward",anchor:"optimum.onnxruntime.ORTModelForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.onnxruntime.ORTModelForSequenceClassification.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.onnxruntime.ORTModelForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:<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.onnxruntime.ORTModelForSequenceClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:<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/blob/vr_439/optimum/onnxruntime/modeling_ort.py#L632"}}),Ne=new Gt({props:{$$slots:{default:[Zi]},$$scope:{ctx:E}}}),Ie=new L({props:{anchor:"optimum.onnxruntime.ORTModelForSequenceClassification.forward.example",$$slots:{default:[el]},$$scope:{ctx:E}}}),Le=new L({props:{anchor:"optimum.onnxruntime.ORTModelForSequenceClassification.forward.example-2",$$slots:{default:[tl]},$$scope:{ctx:E}}}),De=new L({props:{anchor:"optimum.onnxruntime.ORTModelForSequenceClassification.forward.example-3",$$slots:{default:[ol]},$$scope:{ctx:E}}}),bt=new be({}),Mt=new R({props:{name:"class optimum.onnxruntime.ORTModelForTokenClassification",anchor:"optimum.onnxruntime.ORTModelForTokenClassification",parameters:[{name:"model",val:" = None"},{name:"config",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.onnxruntime.ORTModelForTokenClassification.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 <a href="/docs/optimum/pr_439/en/onnxruntime/package_reference/modeling_ort#optimum.onnxruntime.ORTModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"optimum.onnxruntime.ORTModelForTokenClassification.model",description:'<strong>model</strong> (<code>onnxruntime.InferenceSession</code>) &#x2014; <a href="https://onnxruntime.ai/docs/api/python/api_summary.html#inferencesession" rel="nofollow">onnxruntime.InferenceSession</a> is the main class used to run a model. Check out the <a href="/docs/optimum/pr_439/en/onnxruntime/package_reference/modeling_ort#optimum.onnxruntime.ORTModel.load_model">load_model()</a> method for more information.',name:"model"}],source:"https://github.com/huggingface/optimum/blob/vr_439/optimum/onnxruntime/modeling_ort.py#L703"}}),yt=new R({props:{name:"forward",anchor:"optimum.onnxruntime.ORTModelForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.onnxruntime.ORTModelForTokenClassification.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.onnxruntime.ORTModelForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:<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.onnxruntime.ORTModelForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:<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/blob/vr_439/optimum/onnxruntime/modeling_ort.py#L717"}}),Xe=new Gt({props:{$$slots:{default:[nl]},$$scope:{ctx:E}}}),He=new L({props:{anchor:"optimum.onnxruntime.ORTModelForTokenClassification.forward.example",$$slots:{default:[sl]},$$scope:{ctx:E}}}),We=new L({props:{anchor:"optimum.onnxruntime.ORTModelForTokenClassification.forward.example-2",$$slots:{default:[rl]},$$scope:{ctx:E}}}),qt=new be({}),Et=new R({props:{name:"class optimum.onnxruntime.ORTModelForCausalLM",anchor:"optimum.onnxruntime.ORTModelForCausalLM",parameters:[{name:"model",val:" = None"},{name:"config",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.onnxruntime.ORTModelForCausalLM.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 <a href="/docs/optimum/pr_439/en/onnxruntime/package_reference/modeling_ort#optimum.onnxruntime.ORTModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"optimum.onnxruntime.ORTModelForCausalLM.model",description:'<strong>model</strong> (<code>onnxruntime.InferenceSession</code>) &#x2014; <a href="https://onnxruntime.ai/docs/api/python/api_summary.html#inferencesession" rel="nofollow">onnxruntime.InferenceSession</a> is the main class used to run a model. Check out the <a href="/docs/optimum/pr_439/en/onnxruntime/package_reference/modeling_ort#optimum.onnxruntime.ORTModel.load_model">load_model()</a> method for more information.',name:"model"}],source:"https://github.com/huggingface/optimum/blob/vr_439/optimum/onnxruntime/modeling_ort.py#L866"}}),Rt=new R({props:{name:"forward",anchor:"optimum.onnxruntime.ORTModelForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.onnxruntime.ORTModelForCausalLM.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.onnxruntime.ORTModelForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:<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.onnxruntime.ORTModelForCausalLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:<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/blob/vr_439/optimum/onnxruntime/modeling_ort.py#L890"}}),Ve=new Gt({props:{$$slots:{default:[al]},$$scope:{ctx:E}}}),Ue=new L({props:{anchor:"optimum.onnxruntime.ORTModelForCausalLM.forward.example",$$slots:{default:[il]},$$scope:{ctx:E}}}),Ge=new L({props:{anchor:"optimum.onnxruntime.ORTModelForCausalLM.forward.example-2",$$slots:{default:[ll]},$$scope:{ctx:E}}}),Ft=new R({props:{name:"prepare_inputs_for_generation",anchor:"optimum.onnxruntime.ORTModelForCausalLM.prepare_inputs_for_generation",parameters:[{name:"input_ids",val:": LongTensor"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/optimum/blob/vr_439/optimum/onnxruntime/modeling_ort.py#L881"}}),zt=new be({}),Pt=new R({props:{name:"class optimum.onnxruntime.ORTModelForSeq2SeqLM",anchor:"optimum.onnxruntime.ORTModelForSeq2SeqLM",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/optimum/blob/vr_439/optimum/onnxruntime/modeling_seq2seq.py#L619"}}),At=new R({props:{name:"forward",anchor:"optimum.onnxruntime.ORTModelForSeq2SeqLM.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"encoder_outputs",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.onnxruntime.ORTModelForSeq2SeqLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code>) &#x2014;
Indices of input sequence tokens in the vocabulary of shape <code>(batch_size, encoder_sequence_length)</code>.`,name:"input_ids"},{anchor:"optimum.onnxruntime.ORTModelForSeq2SeqLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code>) &#x2014;
Mask to avoid performing attention on padding token indices, of shape
<code>(batch_size, encoder_sequence_length)</code>. Mask values selected in <code>[0, 1]</code>.`,name:"attention_mask"},{anchor:"optimum.onnxruntime.ORTModelForSeq2SeqLM.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code>) &#x2014;
Indices of decoder input sequence tokens in the vocabulary of shape <code>(batch_size, decoder_sequence_length)</code>.`,name:"decoder_input_ids"},{anchor:"optimum.onnxruntime.ORTModelForSeq2SeqLM.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>torch.FloatTensor</code>) &#x2014;
The encoder <code>last_hidden_state</code> of shape <code>(batch_size, encoder_sequence_length, hidden_size)</code>.`,name:"encoder_outputs"},{anchor:"optimum.onnxruntime.ORTModelForSeq2SeqLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor), *optional*)</code> &#x2014;
Contains the precomputed key and value hidden states of the attention blocks used to speed up decoding.
The tuple is of length <code>config.n_layers</code> with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, decoder_sequence_length, embed_size_per_head)</code> and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.`,name:"past_key_values"}],source:"https://github.com/huggingface/optimum/blob/vr_439/optimum/onnxruntime/modeling_seq2seq.py#L628"}}),Ke=new Gt({props:{$$slots:{default:[pl]},$$scope:{ctx:E}}}),Ze=new L({props:{anchor:"optimum.onnxruntime.ORTModelForSeq2SeqLM.forward.example",$$slots:{default:[ml]},$$scope:{ctx:E}}}),et=new L({props:{anchor:"optimum.onnxruntime.ORTModelForSeq2SeqLM.forward.example-2",$$slots:{default:[dl]},$$scope:{ctx:E}}}),St=new be({}),Nt=new R({props:{name:"class optimum.onnxruntime.ORTModelForImageClassification",anchor:"optimum.onnxruntime.ORTModelForImageClassification",parameters:[{name:"model",val:" = None"},{name:"config",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.onnxruntime.ORTModelForImageClassification.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 <a href="/docs/optimum/pr_439/en/onnxruntime/package_reference/modeling_ort#optimum.onnxruntime.ORTModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"optimum.onnxruntime.ORTModelForImageClassification.model",description:'<strong>model</strong> (<code>onnxruntime.InferenceSession</code>) &#x2014; <a href="https://onnxruntime.ai/docs/api/python/api_summary.html#inferencesession" rel="nofollow">onnxruntime.InferenceSession</a> is the main class used to run a model. Check out the <a href="/docs/optimum/pr_439/en/onnxruntime/package_reference/modeling_ort#optimum.onnxruntime.ORTModel.load_model">load_model()</a> method for more information.',name:"model"}],source:"https://github.com/huggingface/optimum/blob/vr_439/optimum/onnxruntime/modeling_ort.py#L984"}}),Lt=new R({props:{name:"forward",anchor:"optimum.onnxruntime.ORTModelForImageClassification.forward",parameters:[{name:"pixel_values",val:": Tensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"optimum.onnxruntime.ORTModelForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values corresponding to the images in the current batch.
Pixel values can be obtained from encoded images using <a href="https://huggingface.co/docs/transformers/autoclass_tutorial#autofeatureextractor" rel="nofollow"><code>AutoFeatureExtractor</code></a>.`,name:"pixel_values"}],source:"https://github.com/huggingface/optimum/blob/vr_439/optimum/onnxruntime/modeling_ort.py#L998"}}),ot=new Gt({props:{$$slots:{default:[cl]},$$scope:{ctx:E}}}),nt=new L({props:{anchor:"optimum.onnxruntime.ORTModelForImageClassification.forward.example",$$slots:{default:[ul]},$$scope:{ctx:E}}}),st=new L({props:{anchor:"optimum.onnxruntime.ORTModelForImageClassification.forward.example-2",$$slots:{default:[fl]},$$scope:{ctx:E}}}),{c(){s=a("meta"),_=f(),d=a("h1"),u=a("a"),g=a("span"),w(n.$$.fragment),r=f(),x=a("span"),c=p("Models"),k=f(),j=a("h2"),Me=a("a"),so=a("span"),w(rt.$$.fragment),Gn=f(),ro=a("span"),Jn=p("ORTModel"),kn=f(),z=a("div"),w(at.$$.fragment),Yn=f(),it=a("p"),Kn=p(`Base ORTModel class for implementing models using ONNX Runtime. The ORTModel implements generic methods for interacting
with the Hugging Face Hub as well as exporting vanilla transformers models to ONNX using `),ao=a("code"),Zn=p("transformers.onnx"),es=p(` toolchain.
The ORTModel implements additionally generic methods for optimizing and quantizing Onnx models.`),ts=f(),Oe=a("div"),w(lt.$$.fragment),os=f(),io=a("p"),ns=p("Instantiate a pretrained model from a pre-trained model configuration."),ss=f(),ye=a("div"),w(pt.$$.fragment),rs=f(),mt=a("p"),as=p("Loads an ONNX Inference session with a given provider. Default provider is "),lo=a("code"),is=p("CPUExecutionProvider"),ls=p(" to match the default behaviour in PyTorch/TensorFlow/JAX."),ps=f(),qe=a("div"),w(dt.$$.fragment),ms=f(),po=a("p"),ds=p("Changes the ONNX Runtime provider according to the device."),vn=f(),me=a("h2"),Ee=a("a"),mo=a("span"),w(ct.$$.fragment),cs=f(),co=a("span"),us=p("ORTModelForFeatureExtraction"),xn=f(),P=a("div"),w(ut.$$.fragment),fs=f(),uo=a("p"),hs=p("Onnx Model with a MaskedLMOutput for feature-extraction tasks."),gs=f(),ft=a("p"),_s=p("This model inherits from [~"),fo=a("code"),$s=p("onnxruntime.modeling_ort.ORTModel"),ks=p(`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving)`),vs=f(),ho=a("p"),xs=p("Feature Extraction model for ONNX."),ws=f(),X=a("div"),w(ht.$$.fragment),Ts=f(),de=a("p"),bs=p("The "),go=a("code"),Ms=p("ORTModelForFeatureExtraction"),Os=p(" forward method, overrides the "),_o=a("code"),ys=p("__call__"),qs=p(" special method."),Es=f(),w(je.$$.fragment),js=f(),w(Re.$$.fragment),Rs=f(),w(Fe.$$.fragment),wn=f(),ce=a("h2"),Ce=a("a"),$o=a("span"),w(gt.$$.fragment),Fs=f(),ko=a("span"),Cs=p("ORTModelForQuestionAnswering"),Tn=f(),A=a("div"),w(_t.$$.fragment),zs=f(),vo=a("p"),Ps=p("Onnx Model with a QuestionAnsweringModelOutput for extractive question-answering tasks like SQuAD."),As=f(),$t=a("p"),Ss=p("This model inherits from [~"),xo=a("code"),Ns=p("onnxruntime.modeling_ort.ORTModel"),Is=p(`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving)`),Ls=f(),wo=a("p"),Ds=p("Question Answering model for ONNX."),Qs=f(),H=a("div"),w(kt.$$.fragment),Xs=f(),ue=a("p"),Hs=p("The "),To=a("code"),Ws=p("ORTModelForQuestionAnswering"),Bs=p(" forward method, overrides the "),bo=a("code"),Vs=p("__call__"),Us=p(" special method."),Gs=f(),w(ze.$$.fragment),Js=f(),w(Pe.$$.fragment),Ys=f(),w(Ae.$$.fragment),bn=f(),fe=a("h2"),Se=a("a"),Mo=a("span"),w(vt.$$.fragment),Ks=f(),Oo=a("span"),Zs=p("ORTModelForSequenceClassification"),Mn=f(),S=a("div"),w(xt.$$.fragment),er=f(),yo=a("p"),tr=p(`Onnx Model with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),or=f(),wt=a("p"),nr=p("This model inherits from [~"),qo=a("code"),sr=p("onnxruntime.modeling_ort.ORTModel"),rr=p(`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving)`),ar=f(),Eo=a("p"),ir=p("Sequence Classification model for ONNX."),lr=f(),C=a("div"),w(Tt.$$.fragment),pr=f(),he=a("p"),mr=p("The "),jo=a("code"),dr=p("ORTModelForSequenceClassification"),cr=p(" forward method, overrides the "),Ro=a("code"),ur=p("__call__"),fr=p(" special method."),hr=f(),w(Ne.$$.fragment),gr=f(),w(Ie.$$.fragment),_r=f(),w(Le.$$.fragment),$r=f(),w(De.$$.fragment),On=f(),ge=a("h2"),Qe=a("a"),Fo=a("span"),w(bt.$$.fragment),kr=f(),Co=a("span"),vr=p("ORTModelForTokenClassification"),yn=f(),N=a("div"),w(Mt.$$.fragment),xr=f(),zo=a("p"),wr=p(`Onnx 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.`),Tr=f(),Ot=a("p"),br=p("This model inherits from [~"),Po=a("code"),Mr=p("onnxruntime.modeling_ort.ORTModel"),Or=p(`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving)`),yr=f(),Ao=a("p"),qr=p("Token Classification model for ONNX."),Er=f(),W=a("div"),w(yt.$$.fragment),jr=f(),_e=a("p"),Rr=p("The "),So=a("code"),Fr=p("ORTModelForTokenClassification"),Cr=p(" forward method, overrides the "),No=a("code"),zr=p("__call__"),Pr=p(" special method."),Ar=f(),w(Xe.$$.fragment),Sr=f(),w(He.$$.fragment),Nr=f(),w(We.$$.fragment),qn=f(),$e=a("h2"),Be=a("a"),Io=a("span"),w(qt.$$.fragment),Ir=f(),Lo=a("span"),Lr=p("ORTModelForCausalLM"),En=f(),F=a("div"),w(Et.$$.fragment),Dr=f(),Do=a("p"),Qr=p(`Onnx Model with a causal language modeling head on top (linear layer with weights tied to the input
embeddings).`),Xr=f(),jt=a("p"),Hr=p("This model inherits from [~"),Qo=a("code"),Wr=p("onnxruntime.modeling_ort.ORTModel"),Br=p(`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving)`),Vr=f(),Xo=a("p"),Ur=p("Causal LM model for ONNX."),Gr=f(),B=a("div"),w(Rt.$$.fragment),Jr=f(),ke=a("p"),Yr=p("The "),Ho=a("code"),Kr=p("ORTModelForCausalLM"),Zr=p(" forward method, overrides the "),Wo=a("code"),ea=p("__call__"),ta=p(" special method."),oa=f(),w(Ve.$$.fragment),na=f(),w(Ue.$$.fragment),sa=f(),w(Ge.$$.fragment),ra=f(),Je=a("div"),w(Ft.$$.fragment),aa=f(),Ct=a("p"),ia=p("Implement in subclasses of "),Bo=a("code"),la=p("PreTrainedModel"),pa=p(" for custom behavior to prepare inputs in the generate method."),jn=f(),ve=a("h2"),Ye=a("a"),Vo=a("span"),w(zt.$$.fragment),ma=f(),Uo=a("span"),da=p("ORTModelForSeq2SeqLM"),Rn=f(),K=a("div"),w(Pt.$$.fragment),ca=f(),Go=a("p"),ua=p("Sequence-to-sequence model with a language modeling head for ONNX Runtime inference."),fa=f(),V=a("div"),w(At.$$.fragment),ha=f(),xe=a("p"),ga=p("The "),Jo=a("code"),_a=p("ORTModelForSeq2SeqLM"),$a=p(" forward method, overrides the "),Yo=a("code"),ka=p("__call__"),va=p(" special method."),xa=f(),w(Ke.$$.fragment),wa=f(),w(Ze.$$.fragment),Ta=f(),w(et.$$.fragment),Fn=f(),we=a("h2"),tt=a("a"),Ko=a("span"),w(St.$$.fragment),ba=f(),Zo=a("span"),Ma=p("ORTModelForImageClassification"),Cn=f(),I=a("div"),w(Nt.$$.fragment),Oa=f(),en=a("p"),ya=p("Onnx Model for image-classification tasks."),qa=f(),It=a("p"),Ea=p("This model inherits from [~"),tn=a("code"),ja=p("onnxruntime.modeling_ort.ORTModel"),Ra=p(`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving)`),Fa=f(),on=a("p"),Ca=p("Image Classification model for ONNX."),za=f(),U=a("div"),w(Lt.$$.fragment),Pa=f(),Te=a("p"),Aa=p("The "),nn=a("code"),Sa=p("ORTModelForImageClassification"),Na=p(" forward method, overrides the "),sn=a("code"),Ia=p("__call__"),La=p(" special method."),Da=f(),w(ot.$$.fragment),Qa=f(),w(nt.$$.fragment),Xa=f(),w(st.$$.fragment),this.h()},l(t){const $=Wi('[data-svelte="svelte-1phssyn"]',document.head);s=i($,"META",{name:!0,content:!0}),$.forEach(o),_=h(t),d=i(t,"H1",{class:!0});var Dt=l(d);u=i(Dt,"A",{id:!0,class:!0,href:!0});var rn=l(u);g=i(rn,"SPAN",{});var an=l(g);T(n.$$.fragment,an),an.forEach(o),rn.forEach(o),r=h(Dt),x=i(Dt,"SPAN",{});var ln=l(x);c=m(ln,"Models"),ln.forEach(o),Dt.forEach(o),k=h(t),j=i(t,"H2",{class:!0});var Qt=l(j);Me=i(Qt,"A",{id:!0,class:!0,href:!0});var pn=l(Me);so=i(pn,"SPAN",{});var mn=l(so);T(rt.$$.fragment,mn),mn.forEach(o),pn.forEach(o),Gn=h(Qt),ro=i(Qt,"SPAN",{});var dn=l(ro);Jn=m(dn,"ORTModel"),dn.forEach(o),Qt.forEach(o),kn=h(t),z=i(t,"DIV",{class:!0});var G=l(z);T(at.$$.fragment,G),Yn=h(G),it=i(G,"P",{});var Xt=l(it);Kn=m(Xt,`Base ORTModel class for implementing models using ONNX Runtime. The ORTModel implements generic methods for interacting
with the Hugging Face Hub as well as exporting vanilla transformers models to ONNX using `),ao=i(Xt,"CODE",{});var cn=l(ao);Zn=m(cn,"transformers.onnx"),cn.forEach(o),es=m(Xt,` toolchain.
The ORTModel implements additionally generic methods for optimizing and quantizing Onnx models.`),Xt.forEach(o),ts=h(G),Oe=i(G,"DIV",{class:!0});var Ht=l(Oe);T(lt.$$.fragment,Ht),os=h(Ht),io=i(Ht,"P",{});var un=l(io);ns=m(un,"Instantiate a pretrained model from a pre-trained model configuration."),un.forEach(o),Ht.forEach(o),ss=h(G),ye=i(G,"DIV",{class:!0});var Wt=l(ye);T(pt.$$.fragment,Wt),rs=h(Wt),mt=i(Wt,"P",{});var Bt=l(mt);as=m(Bt,"Loads an ONNX Inference session with a given provider. Default provider is "),lo=i(Bt,"CODE",{});var fn=l(lo);is=m(fn,"CPUExecutionProvider"),fn.forEach(o),ls=m(Bt," to match the default behaviour in PyTorch/TensorFlow/JAX."),Bt.forEach(o),Wt.forEach(o),ps=h(G),qe=i(G,"DIV",{class:!0});var Vt=l(qe);T(dt.$$.fragment,Vt),ms=h(Vt),po=i(Vt,"P",{});var hn=l(po);ds=m(hn,"Changes the ONNX Runtime provider according to the device."),hn.forEach(o),Vt.forEach(o),G.forEach(o),vn=h(t),me=i(t,"H2",{class:!0});var Ut=l(me);Ee=i(Ut,"A",{id:!0,class:!0,href:!0});var gn=l(Ee);mo=i(gn,"SPAN",{});var _n=l(mo);T(ct.$$.fragment,_n),_n.forEach(o),gn.forEach(o),cs=h(Ut),co=i(Ut,"SPAN",{});var $n=l(co);us=m($n,"ORTModelForFeatureExtraction"),$n.forEach(o),Ut.forEach(o),xn=h(t),P=i(t,"DIV",{class:!0});var Z=l(P);T(ut.$$.fragment,Z),fs=h(Z),uo=i(Z,"P",{});var Ha=l(uo);hs=m(Ha,"Onnx Model with a MaskedLMOutput for feature-extraction tasks."),Ha.forEach(o),gs=h(Z),ft=i(Z,"P",{});var Pn=l(ft);_s=m(Pn,"This model inherits from [~"),fo=i(Pn,"CODE",{});var Wa=l(fo);$s=m(Wa,"onnxruntime.modeling_ort.ORTModel"),Wa.forEach(o),ks=m(Pn,`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving)`),Pn.forEach(o),vs=h(Z),ho=i(Z,"P",{});var Ba=l(ho);xs=m(Ba,"Feature Extraction model for ONNX."),Ba.forEach(o),ws=h(Z),X=i(Z,"DIV",{class:!0});var ee=l(X);T(ht.$$.fragment,ee),Ts=h(ee),de=i(ee,"P",{});var Jt=l(de);bs=m(Jt,"The "),go=i(Jt,"CODE",{});var Va=l(go);Ms=m(Va,"ORTModelForFeatureExtraction"),Va.forEach(o),Os=m(Jt," forward method, overrides the "),_o=i(Jt,"CODE",{});var Ua=l(_o);ys=m(Ua,"__call__"),Ua.forEach(o),qs=m(Jt," special method."),Jt.forEach(o),Es=h(ee),T(je.$$.fragment,ee),js=h(ee),T(Re.$$.fragment,ee),Rs=h(ee),T(Fe.$$.fragment,ee),ee.forEach(o),Z.forEach(o),wn=h(t),ce=i(t,"H2",{class:!0});var An=l(ce);Ce=i(An,"A",{id:!0,class:!0,href:!0});var Ga=l(Ce);$o=i(Ga,"SPAN",{});var Ja=l($o);T(gt.$$.fragment,Ja),Ja.forEach(o),Ga.forEach(o),Fs=h(An),ko=i(An,"SPAN",{});var Ya=l(ko);Cs=m(Ya,"ORTModelForQuestionAnswering"),Ya.forEach(o),An.forEach(o),Tn=h(t),A=i(t,"DIV",{class:!0});var te=l(A);T(_t.$$.fragment,te),zs=h(te),vo=i(te,"P",{});var Ka=l(vo);Ps=m(Ka,"Onnx Model with a QuestionAnsweringModelOutput for extractive question-answering tasks like SQuAD."),Ka.forEach(o),As=h(te),$t=i(te,"P",{});var Sn=l($t);Ss=m(Sn,"This model inherits from [~"),xo=i(Sn,"CODE",{});var Za=l(xo);Ns=m(Za,"onnxruntime.modeling_ort.ORTModel"),Za.forEach(o),Is=m(Sn,`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving)`),Sn.forEach(o),Ls=h(te),wo=i(te,"P",{});var ei=l(wo);Ds=m(ei,"Question Answering model for ONNX."),ei.forEach(o),Qs=h(te),H=i(te,"DIV",{class:!0});var oe=l(H);T(kt.$$.fragment,oe),Xs=h(oe),ue=i(oe,"P",{});var Yt=l(ue);Hs=m(Yt,"The "),To=i(Yt,"CODE",{});var ti=l(To);Ws=m(ti,"ORTModelForQuestionAnswering"),ti.forEach(o),Bs=m(Yt," forward method, overrides the "),bo=i(Yt,"CODE",{});var oi=l(bo);Vs=m(oi,"__call__"),oi.forEach(o),Us=m(Yt," special method."),Yt.forEach(o),Gs=h(oe),T(ze.$$.fragment,oe),Js=h(oe),T(Pe.$$.fragment,oe),Ys=h(oe),T(Ae.$$.fragment,oe),oe.forEach(o),te.forEach(o),bn=h(t),fe=i(t,"H2",{class:!0});var Nn=l(fe);Se=i(Nn,"A",{id:!0,class:!0,href:!0});var ni=l(Se);Mo=i(ni,"SPAN",{});var si=l(Mo);T(vt.$$.fragment,si),si.forEach(o),ni.forEach(o),Ks=h(Nn),Oo=i(Nn,"SPAN",{});var ri=l(Oo);Zs=m(ri,"ORTModelForSequenceClassification"),ri.forEach(o),Nn.forEach(o),Mn=h(t),S=i(t,"DIV",{class:!0});var ne=l(S);T(xt.$$.fragment,ne),er=h(ne),yo=i(ne,"P",{});var ai=l(yo);tr=m(ai,`Onnx Model with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),ai.forEach(o),or=h(ne),wt=i(ne,"P",{});var In=l(wt);nr=m(In,"This model inherits from [~"),qo=i(In,"CODE",{});var ii=l(qo);sr=m(ii,"onnxruntime.modeling_ort.ORTModel"),ii.forEach(o),rr=m(In,`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving)`),In.forEach(o),ar=h(ne),Eo=i(ne,"P",{});var li=l(Eo);ir=m(li,"Sequence Classification model for ONNX."),li.forEach(o),lr=h(ne),C=i(ne,"DIV",{class:!0});var J=l(C);T(Tt.$$.fragment,J),pr=h(J),he=i(J,"P",{});var Kt=l(he);mr=m(Kt,"The "),jo=i(Kt,"CODE",{});var pi=l(jo);dr=m(pi,"ORTModelForSequenceClassification"),pi.forEach(o),cr=m(Kt," forward method, overrides the "),Ro=i(Kt,"CODE",{});var mi=l(Ro);ur=m(mi,"__call__"),mi.forEach(o),fr=m(Kt," special method."),Kt.forEach(o),hr=h(J),T(Ne.$$.fragment,J),gr=h(J),T(Ie.$$.fragment,J),_r=h(J),T(Le.$$.fragment,J),$r=h(J),T(De.$$.fragment,J),J.forEach(o),ne.forEach(o),On=h(t),ge=i(t,"H2",{class:!0});var Ln=l(ge);Qe=i(Ln,"A",{id:!0,class:!0,href:!0});var di=l(Qe);Fo=i(di,"SPAN",{});var ci=l(Fo);T(bt.$$.fragment,ci),ci.forEach(o),di.forEach(o),kr=h(Ln),Co=i(Ln,"SPAN",{});var ui=l(Co);vr=m(ui,"ORTModelForTokenClassification"),ui.forEach(o),Ln.forEach(o),yn=h(t),N=i(t,"DIV",{class:!0});var se=l(N);T(Mt.$$.fragment,se),xr=h(se),zo=i(se,"P",{});var fi=l(zo);wr=m(fi,`Onnx 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.`),fi.forEach(o),Tr=h(se),Ot=i(se,"P",{});var Dn=l(Ot);br=m(Dn,"This model inherits from [~"),Po=i(Dn,"CODE",{});var hi=l(Po);Mr=m(hi,"onnxruntime.modeling_ort.ORTModel"),hi.forEach(o),Or=m(Dn,`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving)`),Dn.forEach(o),yr=h(se),Ao=i(se,"P",{});var gi=l(Ao);qr=m(gi,"Token Classification model for ONNX."),gi.forEach(o),Er=h(se),W=i(se,"DIV",{class:!0});var re=l(W);T(yt.$$.fragment,re),jr=h(re),_e=i(re,"P",{});var Zt=l(_e);Rr=m(Zt,"The "),So=i(Zt,"CODE",{});var _i=l(So);Fr=m(_i,"ORTModelForTokenClassification"),_i.forEach(o),Cr=m(Zt," forward method, overrides the "),No=i(Zt,"CODE",{});var $i=l(No);zr=m($i,"__call__"),$i.forEach(o),Pr=m(Zt," special method."),Zt.forEach(o),Ar=h(re),T(Xe.$$.fragment,re),Sr=h(re),T(He.$$.fragment,re),Nr=h(re),T(We.$$.fragment,re),re.forEach(o),se.forEach(o),qn=h(t),$e=i(t,"H2",{class:!0});var Qn=l($e);Be=i(Qn,"A",{id:!0,class:!0,href:!0});var ki=l(Be);Io=i(ki,"SPAN",{});var vi=l(Io);T(qt.$$.fragment,vi),vi.forEach(o),ki.forEach(o),Ir=h(Qn),Lo=i(Qn,"SPAN",{});var xi=l(Lo);Lr=m(xi,"ORTModelForCausalLM"),xi.forEach(o),Qn.forEach(o),En=h(t),F=i(t,"DIV",{class:!0});var Y=l(F);T(Et.$$.fragment,Y),Dr=h(Y),Do=i(Y,"P",{});var wi=l(Do);Qr=m(wi,`Onnx Model with a causal language modeling head on top (linear layer with weights tied to the input
embeddings).`),wi.forEach(o),Xr=h(Y),jt=i(Y,"P",{});var Xn=l(jt);Hr=m(Xn,"This model inherits from [~"),Qo=i(Xn,"CODE",{});var Ti=l(Qo);Wr=m(Ti,"onnxruntime.modeling_ort.ORTModel"),Ti.forEach(o),Br=m(Xn,`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving)`),Xn.forEach(o),Vr=h(Y),Xo=i(Y,"P",{});var bi=l(Xo);Ur=m(bi,"Causal LM model for ONNX."),bi.forEach(o),Gr=h(Y),B=i(Y,"DIV",{class:!0});var ae=l(B);T(Rt.$$.fragment,ae),Jr=h(ae),ke=i(ae,"P",{});var eo=l(ke);Yr=m(eo,"The "),Ho=i(eo,"CODE",{});var Mi=l(Ho);Kr=m(Mi,"ORTModelForCausalLM"),Mi.forEach(o),Zr=m(eo," forward method, overrides the "),Wo=i(eo,"CODE",{});var Oi=l(Wo);ea=m(Oi,"__call__"),Oi.forEach(o),ta=m(eo," special method."),eo.forEach(o),oa=h(ae),T(Ve.$$.fragment,ae),na=h(ae),T(Ue.$$.fragment,ae),sa=h(ae),T(Ge.$$.fragment,ae),ae.forEach(o),ra=h(Y),Je=i(Y,"DIV",{class:!0});var Hn=l(Je);T(Ft.$$.fragment,Hn),aa=h(Hn),Ct=i(Hn,"P",{});var Wn=l(Ct);ia=m(Wn,"Implement in subclasses of "),Bo=i(Wn,"CODE",{});var yi=l(Bo);la=m(yi,"PreTrainedModel"),yi.forEach(o),pa=m(Wn," for custom behavior to prepare inputs in the generate method."),Wn.forEach(o),Hn.forEach(o),Y.forEach(o),jn=h(t),ve=i(t,"H2",{class:!0});var Bn=l(ve);Ye=i(Bn,"A",{id:!0,class:!0,href:!0});var qi=l(Ye);Vo=i(qi,"SPAN",{});var Ei=l(Vo);T(zt.$$.fragment,Ei),Ei.forEach(o),qi.forEach(o),ma=h(Bn),Uo=i(Bn,"SPAN",{});var ji=l(Uo);da=m(ji,"ORTModelForSeq2SeqLM"),ji.forEach(o),Bn.forEach(o),Rn=h(t),K=i(t,"DIV",{class:!0});var to=l(K);T(Pt.$$.fragment,to),ca=h(to),Go=i(to,"P",{});var Ri=l(Go);ua=m(Ri,"Sequence-to-sequence model with a language modeling head for ONNX Runtime inference."),Ri.forEach(o),fa=h(to),V=i(to,"DIV",{class:!0});var ie=l(V);T(At.$$.fragment,ie),ha=h(ie),xe=i(ie,"P",{});var oo=l(xe);ga=m(oo,"The "),Jo=i(oo,"CODE",{});var Fi=l(Jo);_a=m(Fi,"ORTModelForSeq2SeqLM"),Fi.forEach(o),$a=m(oo," forward method, overrides the "),Yo=i(oo,"CODE",{});var Ci=l(Yo);ka=m(Ci,"__call__"),Ci.forEach(o),va=m(oo," special method."),oo.forEach(o),xa=h(ie),T(Ke.$$.fragment,ie),wa=h(ie),T(Ze.$$.fragment,ie),Ta=h(ie),T(et.$$.fragment,ie),ie.forEach(o),to.forEach(o),Fn=h(t),we=i(t,"H2",{class:!0});var Vn=l(we);tt=i(Vn,"A",{id:!0,class:!0,href:!0});var zi=l(tt);Ko=i(zi,"SPAN",{});var Pi=l(Ko);T(St.$$.fragment,Pi),Pi.forEach(o),zi.forEach(o),ba=h(Vn),Zo=i(Vn,"SPAN",{});var Ai=l(Zo);Ma=m(Ai,"ORTModelForImageClassification"),Ai.forEach(o),Vn.forEach(o),Cn=h(t),I=i(t,"DIV",{class:!0});var le=l(I);T(Nt.$$.fragment,le),Oa=h(le),en=i(le,"P",{});var Si=l(en);ya=m(Si,"Onnx Model for image-classification tasks."),Si.forEach(o),qa=h(le),It=i(le,"P",{});var Un=l(It);Ea=m(Un,"This model inherits from [~"),tn=i(Un,"CODE",{});var Ni=l(tn);ja=m(Ni,"onnxruntime.modeling_ort.ORTModel"),Ni.forEach(o),Ra=m(Un,`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving)`),Un.forEach(o),Fa=h(le),on=i(le,"P",{});var Ii=l(on);Ca=m(Ii,"Image Classification model for ONNX."),Ii.forEach(o),za=h(le),U=i(le,"DIV",{class:!0});var pe=l(U);T(Lt.$$.fragment,pe),Pa=h(pe),Te=i(pe,"P",{});var no=l(Te);Aa=m(no,"The "),nn=i(no,"CODE",{});var Li=l(nn);Sa=m(Li,"ORTModelForImageClassification"),Li.forEach(o),Na=m(no," forward method, overrides the "),sn=i(no,"CODE",{});var Di=l(sn);Ia=m(Di,"__call__"),Di.forEach(o),La=m(no," special method."),no.forEach(o),Da=h(pe),T(ot.$$.fragment,pe),Qa=h(pe),T(nt.$$.fragment,pe),Xa=h(pe),T(st.$$.fragment,pe),pe.forEach(o),le.forEach(o),this.h()},h(){q(s,"name","hf:doc:metadata"),q(s,"content",JSON.stringify(gl)),q(u,"id","models"),q(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"),q(u,"href","#models"),q(d,"class","relative group"),q(Me,"id","optimum.onnxruntime.ORTModel"),q(Me,"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"),q(Me,"href","#optimum.onnxruntime.ORTModel"),q(j,"class","relative group"),q(Oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(Ee,"id","optimum.onnxruntime.ORTModelForFeatureExtraction"),q(Ee,"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"),q(Ee,"href","#optimum.onnxruntime.ORTModelForFeatureExtraction"),q(me,"class","relative group"),q(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(Ce,"id","optimum.onnxruntime.ORTModelForQuestionAnswering"),q(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"),q(Ce,"href","#optimum.onnxruntime.ORTModelForQuestionAnswering"),q(ce,"class","relative group"),q(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(Se,"id","optimum.onnxruntime.ORTModelForSequenceClassification"),q(Se,"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"),q(Se,"href","#optimum.onnxruntime.ORTModelForSequenceClassification"),q(fe,"class","relative group"),q(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(Qe,"id","optimum.onnxruntime.ORTModelForTokenClassification"),q(Qe,"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"),q(Qe,"href","#optimum.onnxruntime.ORTModelForTokenClassification"),q(ge,"class","relative group"),q(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(Be,"id","optimum.onnxruntime.ORTModelForCausalLM"),q(Be,"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"),q(Be,"href","#optimum.onnxruntime.ORTModelForCausalLM"),q($e,"class","relative group"),q(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(Je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(Ye,"id","optimum.onnxruntime.ORTModelForSeq2SeqLM"),q(Ye,"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"),q(Ye,"href","#optimum.onnxruntime.ORTModelForSeq2SeqLM"),q(ve,"class","relative group"),q(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(tt,"id","optimum.onnxruntime.ORTModelForImageClassification"),q(tt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),q(tt,"href","#optimum.onnxruntime.ORTModelForImageClassification"),q(we,"class","relative group"),q(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(I,"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,$){e(document.head,s),v(t,_,$),v(t,d,$),e(d,u),e(u,g),b(n,g,null),e(d,r),e(d,x),e(x,c),v(t,k,$),v(t,j,$),e(j,Me),e(Me,so),b(rt,so,null),e(j,Gn),e(j,ro),e(ro,Jn),v(t,kn,$),v(t,z,$),b(at,z,null),e(z,Yn),e(z,it),e(it,Kn),e(it,ao),e(ao,Zn),e(it,es),e(z,ts),e(z,Oe),b(lt,Oe,null),e(Oe,os),e(Oe,io),e(io,ns),e(z,ss),e(z,ye),b(pt,ye,null),e(ye,rs),e(ye,mt),e(mt,as),e(mt,lo),e(lo,is),e(mt,ls),e(z,ps),e(z,qe),b(dt,qe,null),e(qe,ms),e(qe,po),e(po,ds),v(t,vn,$),v(t,me,$),e(me,Ee),e(Ee,mo),b(ct,mo,null),e(me,cs),e(me,co),e(co,us),v(t,xn,$),v(t,P,$),b(ut,P,null),e(P,fs),e(P,uo),e(uo,hs),e(P,gs),e(P,ft),e(ft,_s),e(ft,fo),e(fo,$s),e(ft,ks),e(P,vs),e(P,ho),e(ho,xs),e(P,ws),e(P,X),b(ht,X,null),e(X,Ts),e(X,de),e(de,bs),e(de,go),e(go,Ms),e(de,Os),e(de,_o),e(_o,ys),e(de,qs),e(X,Es),b(je,X,null),e(X,js),b(Re,X,null),e(X,Rs),b(Fe,X,null),v(t,wn,$),v(t,ce,$),e(ce,Ce),e(Ce,$o),b(gt,$o,null),e(ce,Fs),e(ce,ko),e(ko,Cs),v(t,Tn,$),v(t,A,$),b(_t,A,null),e(A,zs),e(A,vo),e(vo,Ps),e(A,As),e(A,$t),e($t,Ss),e($t,xo),e(xo,Ns),e($t,Is),e(A,Ls),e(A,wo),e(wo,Ds),e(A,Qs),e(A,H),b(kt,H,null),e(H,Xs),e(H,ue),e(ue,Hs),e(ue,To),e(To,Ws),e(ue,Bs),e(ue,bo),e(bo,Vs),e(ue,Us),e(H,Gs),b(ze,H,null),e(H,Js),b(Pe,H,null),e(H,Ys),b(Ae,H,null),v(t,bn,$),v(t,fe,$),e(fe,Se),e(Se,Mo),b(vt,Mo,null),e(fe,Ks),e(fe,Oo),e(Oo,Zs),v(t,Mn,$),v(t,S,$),b(xt,S,null),e(S,er),e(S,yo),e(yo,tr),e(S,or),e(S,wt),e(wt,nr),e(wt,qo),e(qo,sr),e(wt,rr),e(S,ar),e(S,Eo),e(Eo,ir),e(S,lr),e(S,C),b(Tt,C,null),e(C,pr),e(C,he),e(he,mr),e(he,jo),e(jo,dr),e(he,cr),e(he,Ro),e(Ro,ur),e(he,fr),e(C,hr),b(Ne,C,null),e(C,gr),b(Ie,C,null),e(C,_r),b(Le,C,null),e(C,$r),b(De,C,null),v(t,On,$),v(t,ge,$),e(ge,Qe),e(Qe,Fo),b(bt,Fo,null),e(ge,kr),e(ge,Co),e(Co,vr),v(t,yn,$),v(t,N,$),b(Mt,N,null),e(N,xr),e(N,zo),e(zo,wr),e(N,Tr),e(N,Ot),e(Ot,br),e(Ot,Po),e(Po,Mr),e(Ot,Or),e(N,yr),e(N,Ao),e(Ao,qr),e(N,Er),e(N,W),b(yt,W,null),e(W,jr),e(W,_e),e(_e,Rr),e(_e,So),e(So,Fr),e(_e,Cr),e(_e,No),e(No,zr),e(_e,Pr),e(W,Ar),b(Xe,W,null),e(W,Sr),b(He,W,null),e(W,Nr),b(We,W,null),v(t,qn,$),v(t,$e,$),e($e,Be),e(Be,Io),b(qt,Io,null),e($e,Ir),e($e,Lo),e(Lo,Lr),v(t,En,$),v(t,F,$),b(Et,F,null),e(F,Dr),e(F,Do),e(Do,Qr),e(F,Xr),e(F,jt),e(jt,Hr),e(jt,Qo),e(Qo,Wr),e(jt,Br),e(F,Vr),e(F,Xo),e(Xo,Ur),e(F,Gr),e(F,B),b(Rt,B,null),e(B,Jr),e(B,ke),e(ke,Yr),e(ke,Ho),e(Ho,Kr),e(ke,Zr),e(ke,Wo),e(Wo,ea),e(ke,ta),e(B,oa),b(Ve,B,null),e(B,na),b(Ue,B,null),e(B,sa),b(Ge,B,null),e(F,ra),e(F,Je),b(Ft,Je,null),e(Je,aa),e(Je,Ct),e(Ct,ia),e(Ct,Bo),e(Bo,la),e(Ct,pa),v(t,jn,$),v(t,ve,$),e(ve,Ye),e(Ye,Vo),b(zt,Vo,null),e(ve,ma),e(ve,Uo),e(Uo,da),v(t,Rn,$),v(t,K,$),b(Pt,K,null),e(K,ca),e(K,Go),e(Go,ua),e(K,fa),e(K,V),b(At,V,null),e(V,ha),e(V,xe),e(xe,ga),e(xe,Jo),e(Jo,_a),e(xe,$a),e(xe,Yo),e(Yo,ka),e(xe,va),e(V,xa),b(Ke,V,null),e(V,wa),b(Ze,V,null),e(V,Ta),b(et,V,null),v(t,Fn,$),v(t,we,$),e(we,tt),e(tt,Ko),b(St,Ko,null),e(we,ba),e(we,Zo),e(Zo,Ma),v(t,Cn,$),v(t,I,$),b(Nt,I,null),e(I,Oa),e(I,en),e(en,ya),e(I,qa),e(I,It),e(It,Ea),e(It,tn),e(tn,ja),e(It,Ra),e(I,Fa),e(I,on),e(on,Ca),e(I,za),e(I,U),b(Lt,U,null),e(U,Pa),e(U,Te),e(Te,Aa),e(Te,nn),e(nn,Sa),e(Te,Na),e(Te,sn),e(sn,Ia),e(Te,La),e(U,Da),b(ot,U,null),e(U,Qa),b(nt,U,null),e(U,Xa),b(st,U,null),zn=!0},p(t,[$]){const Dt={};$&2&&(Dt.$$scope={dirty:$,ctx:t}),je.$set(Dt);const rn={};$&2&&(rn.$$scope={dirty:$,ctx:t}),Re.$set(rn);const an={};$&2&&(an.$$scope={dirty:$,ctx:t}),Fe.$set(an);const ln={};$&2&&(ln.$$scope={dirty:$,ctx:t}),ze.$set(ln);const Qt={};$&2&&(Qt.$$scope={dirty:$,ctx:t}),Pe.$set(Qt);const pn={};$&2&&(pn.$$scope={dirty:$,ctx:t}),Ae.$set(pn);const mn={};$&2&&(mn.$$scope={dirty:$,ctx:t}),Ne.$set(mn);const dn={};$&2&&(dn.$$scope={dirty:$,ctx:t}),Ie.$set(dn);const G={};$&2&&(G.$$scope={dirty:$,ctx:t}),Le.$set(G);const Xt={};$&2&&(Xt.$$scope={dirty:$,ctx:t}),De.$set(Xt);const cn={};$&2&&(cn.$$scope={dirty:$,ctx:t}),Xe.$set(cn);const Ht={};$&2&&(Ht.$$scope={dirty:$,ctx:t}),He.$set(Ht);const un={};$&2&&(un.$$scope={dirty:$,ctx:t}),We.$set(un);const Wt={};$&2&&(Wt.$$scope={dirty:$,ctx:t}),Ve.$set(Wt);const Bt={};$&2&&(Bt.$$scope={dirty:$,ctx:t}),Ue.$set(Bt);const fn={};$&2&&(fn.$$scope={dirty:$,ctx:t}),Ge.$set(fn);const Vt={};$&2&&(Vt.$$scope={dirty:$,ctx:t}),Ke.$set(Vt);const hn={};$&2&&(hn.$$scope={dirty:$,ctx:t}),Ze.$set(hn);const Ut={};$&2&&(Ut.$$scope={dirty:$,ctx:t}),et.$set(Ut);const gn={};$&2&&(gn.$$scope={dirty:$,ctx:t}),ot.$set(gn);const _n={};$&2&&(_n.$$scope={dirty:$,ctx:t}),nt.$set(_n);const $n={};$&2&&($n.$$scope={dirty:$,ctx:t}),st.$set($n)},i(t){zn||(M(n.$$.fragment,t),M(rt.$$.fragment,t),M(at.$$.fragment,t),M(lt.$$.fragment,t),M(pt.$$.fragment,t),M(dt.$$.fragment,t),M(ct.$$.fragment,t),M(ut.$$.fragment,t),M(ht.$$.fragment,t),M(je.$$.fragment,t),M(Re.$$.fragment,t),M(Fe.$$.fragment,t),M(gt.$$.fragment,t),M(_t.$$.fragment,t),M(kt.$$.fragment,t),M(ze.$$.fragment,t),M(Pe.$$.fragment,t),M(Ae.$$.fragment,t),M(vt.$$.fragment,t),M(xt.$$.fragment,t),M(Tt.$$.fragment,t),M(Ne.$$.fragment,t),M(Ie.$$.fragment,t),M(Le.$$.fragment,t),M(De.$$.fragment,t),M(bt.$$.fragment,t),M(Mt.$$.fragment,t),M(yt.$$.fragment,t),M(Xe.$$.fragment,t),M(He.$$.fragment,t),M(We.$$.fragment,t),M(qt.$$.fragment,t),M(Et.$$.fragment,t),M(Rt.$$.fragment,t),M(Ve.$$.fragment,t),M(Ue.$$.fragment,t),M(Ge.$$.fragment,t),M(Ft.$$.fragment,t),M(zt.$$.fragment,t),M(Pt.$$.fragment,t),M(At.$$.fragment,t),M(Ke.$$.fragment,t),M(Ze.$$.fragment,t),M(et.$$.fragment,t),M(St.$$.fragment,t),M(Nt.$$.fragment,t),M(Lt.$$.fragment,t),M(ot.$$.fragment,t),M(nt.$$.fragment,t),M(st.$$.fragment,t),zn=!0)},o(t){O(n.$$.fragment,t),O(rt.$$.fragment,t),O(at.$$.fragment,t),O(lt.$$.fragment,t),O(pt.$$.fragment,t),O(dt.$$.fragment,t),O(ct.$$.fragment,t),O(ut.$$.fragment,t),O(ht.$$.fragment,t),O(je.$$.fragment,t),O(Re.$$.fragment,t),O(Fe.$$.fragment,t),O(gt.$$.fragment,t),O(_t.$$.fragment,t),O(kt.$$.fragment,t),O(ze.$$.fragment,t),O(Pe.$$.fragment,t),O(Ae.$$.fragment,t),O(vt.$$.fragment,t),O(xt.$$.fragment,t),O(Tt.$$.fragment,t),O(Ne.$$.fragment,t),O(Ie.$$.fragment,t),O(Le.$$.fragment,t),O(De.$$.fragment,t),O(bt.$$.fragment,t),O(Mt.$$.fragment,t),O(yt.$$.fragment,t),O(Xe.$$.fragment,t),O(He.$$.fragment,t),O(We.$$.fragment,t),O(qt.$$.fragment,t),O(Et.$$.fragment,t),O(Rt.$$.fragment,t),O(Ve.$$.fragment,t),O(Ue.$$.fragment,t),O(Ge.$$.fragment,t),O(Ft.$$.fragment,t),O(zt.$$.fragment,t),O(Pt.$$.fragment,t),O(At.$$.fragment,t),O(Ke.$$.fragment,t),O(Ze.$$.fragment,t),O(et.$$.fragment,t),O(St.$$.fragment,t),O(Nt.$$.fragment,t),O(Lt.$$.fragment,t),O(ot.$$.fragment,t),O(nt.$$.fragment,t),O(st.$$.fragment,t),zn=!1},d(t){o(s),t&&o(_),t&&o(d),y(n),t&&o(k),t&&o(j),y(rt),t&&o(kn),t&&o(z),y(at),y(lt),y(pt),y(dt),t&&o(vn),t&&o(me),y(ct),t&&o(xn),t&&o(P),y(ut),y(ht),y(je),y(Re),y(Fe),t&&o(wn),t&&o(ce),y(gt),t&&o(Tn),t&&o(A),y(_t),y(kt),y(ze),y(Pe),y(Ae),t&&o(bn),t&&o(fe),y(vt),t&&o(Mn),t&&o(S),y(xt),y(Tt),y(Ne),y(Ie),y(Le),y(De),t&&o(On),t&&o(ge),y(bt),t&&o(yn),t&&o(N),y(Mt),y(yt),y(Xe),y(He),y(We),t&&o(qn),t&&o($e),y(qt),t&&o(En),t&&o(F),y(Et),y(Rt),y(Ve),y(Ue),y(Ge),y(Ft),t&&o(jn),t&&o(ve),y(zt),t&&o(Rn),t&&o(K),y(Pt),y(At),y(Ke),y(Ze),y(et),t&&o(Fn),t&&o(we),y(St),t&&o(Cn),t&&o(I),y(Nt),y(Lt),y(ot),y(nt),y(st)}}}const gl={local:"models",sections:[{local:"optimum.onnxruntime.ORTModel",title:"ORTModel"},{local:"optimum.onnxruntime.ORTModelForFeatureExtraction",title:"ORTModelForFeatureExtraction"},{local:"optimum.onnxruntime.ORTModelForQuestionAnswering",title:"ORTModelForQuestionAnswering"},{local:"optimum.onnxruntime.ORTModelForSequenceClassification",title:"ORTModelForSequenceClassification"},{local:"optimum.onnxruntime.ORTModelForTokenClassification",title:"ORTModelForTokenClassification"},{local:"optimum.onnxruntime.ORTModelForCausalLM",title:"ORTModelForCausalLM"},{local:"optimum.onnxruntime.ORTModelForSeq2SeqLM",title:"ORTModelForSeq2SeqLM"},{local:"optimum.onnxruntime.ORTModelForImageClassification",title:"ORTModelForImageClassification"}],title:"Models"};function _l(E){return Bi(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class bl extends Qi{constructor(s){super();Xi(this,s,_l,hl,Hi,{})}}export{bl as default,gl as metadata};
