import{S as Zr,i as Nr,s as Pr,e as n,k as p,w as v,t as i,M as Sr,c as s,d as o,m as h,a,x as T,h as l,b as c,G as e,g as _,y as k,q as w,o as M,B,v as Rr,L as Pt}from"../../chunks/vendor-hf-doc-builder.js";import{T as pn}from"../../chunks/Tip-hf-doc-builder.js";import{D as N}from"../../chunks/Docstring-hf-doc-builder.js";import{C as St}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as re}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Nt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Vr(G){let d,y;return d=new St({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJpb0dwdE1vZGVsJTJDJTIwQmlvR3B0Q29uZmlnJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEJpb0dQVCUyMG1pY3Jvc29mdCUyRmJpb2dwdCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBCaW9HcHRDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMGZyb20lMjB0aGUlMjBtaWNyb3NvZnQlMkZiaW9ncHQlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMEJpb0dwdE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BioGptModel, BioGptConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BioGPT microsoft/biogpt style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BioGptConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the microsoft/biogpt style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BioGptModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){v(d.$$.fragment)},l(u){T(d.$$.fragment,u)},m(u,f){k(d,u,f),y=!0},p:Pt,i(u){y||(w(d.$$.fragment,u),y=!0)},o(u){M(d.$$.fragment,u),y=!1},d(u){B(d,u)}}}function Ar(G){let d,y,u,f,b;return{c(){d=n("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),f=i("Module"),b=i(`
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(r){d=s(r,"P",{});var g=a(d);y=l(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(g,"CODE",{});var $=a(u);f=l($,"Module"),$.forEach(o),b=l(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(o)},m(r,g){_(r,d,g),e(d,y),e(d,u),e(u,f),e(d,b)},d(r){r&&o(d)}}}function Hr(G){let d,y,u,f,b;return f=new St({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBCaW9HcHRNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGYmlvZ3B0JTIyKSUwQW1vZGVsJTIwJTNEJTIwQmlvR3B0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmJpb2dwdCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BioGptModel
<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;microsoft/biogpt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BioGptModel.from_pretrained(<span class="hljs-string">&quot;microsoft/biogpt&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){d=n("p"),y=i("Example:"),u=p(),v(f.$$.fragment)},l(r){d=s(r,"P",{});var g=a(d);y=l(g,"Example:"),g.forEach(o),u=h(r),T(f.$$.fragment,r)},m(r,g){_(r,d,g),e(d,y),_(r,u,g),k(f,r,g),b=!0},p:Pt,i(r){b||(w(f.$$.fragment,r),b=!0)},o(r){M(f.$$.fragment,r),b=!1},d(r){r&&o(d),r&&o(u),B(f,r)}}}function Lr(G){let d,y,u,f,b;return{c(){d=n("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),f=i("Module"),b=i(`
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(r){d=s(r,"P",{});var g=a(d);y=l(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(g,"CODE",{});var $=a(u);f=l($,"Module"),$.forEach(o),b=l(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(o)},m(r,g){_(r,d,g),e(d,y),e(d,u),e(u,f),e(d,b)},d(r){r&&o(d)}}}function Qr(G){let d,y,u,f,b;return f=new St({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEJpb0dwdEZvckNhdXNhbExNJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGYmlvZ3B0JTIyKSUwQW1vZGVsJTIwJTNEJTIwQmlvR3B0Rm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmJpb2dwdCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzJTJDJTIwbGFiZWxzJTNEaW5wdXRzJTVCJTIyaW5wdXRfaWRzJTIyJTVEKSUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3MlMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BioGptForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;microsoft/biogpt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BioGptForCausalLM.from_pretrained(<span class="hljs-string">&quot;microsoft/biogpt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=inputs[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=n("p"),y=i("Example:"),u=p(),v(f.$$.fragment)},l(r){d=s(r,"P",{});var g=a(d);y=l(g,"Example:"),g.forEach(o),u=h(r),T(f.$$.fragment,r)},m(r,g){_(r,d,g),e(d,y),_(r,u,g),k(f,r,g),b=!0},p:Pt,i(r){b||(w(f.$$.fragment,r),b=!0)},o(r){M(f.$$.fragment,r),b=!1},d(r){r&&o(d),r&&o(u),B(f,r)}}}function Yr(G){let d,y,u,f,b;return{c(){d=n("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),f=i("Module"),b=i(`
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(r){d=s(r,"P",{});var g=a(d);y=l(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(g,"CODE",{});var $=a(u);f=l($,"Module"),$.forEach(o),b=l(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(o)},m(r,g){_(r,d,g),e(d,y),e(d,u),e(u,f),e(d,b)},d(r){r&&o(d)}}}function Or(G){let d,y,u,f,b;return f=new St({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBCaW9HcHRGb3JUb2tlbkNsYXNzaWZpY2F0aW9uJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZiaW9ncHQlMjIpJTBBbW9kZWwlMjAlM0QlMjBCaW9HcHRGb3JUb2tlbkNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZiaW9ncHQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUwQSUyMCUyMCUyMCUyMCUyMkh1Z2dpbmdGYWNlJTIwaXMlMjBhJTIwY29tcGFueSUyMGJhc2VkJTIwaW4lMjBQYXJpcyUyMGFuZCUyME5ldyUyMFlvcmslMjIlMkMlMjBhZGRfc3BlY2lhbF90b2tlbnMlM0RGYWxzZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMEEpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTIwJTNEJTIwbG9naXRzLmFyZ21heCgtMSklMEElMEElMjMlMjBOb3RlJTIwdGhhdCUyMHRva2VucyUyMGFyZSUyMGNsYXNzaWZpZWQlMjByYXRoZXIlMjB0aGVuJTIwaW5wdXQlMjB3b3JkcyUyMHdoaWNoJTIwbWVhbnMlMjB0aGF0JTBBJTIzJTIwdGhlcmUlMjBtaWdodCUyMGJlJTIwbW9yZSUyMHByZWRpY3RlZCUyMHRva2VuJTIwY2xhc3NlcyUyMHRoYW4lMjB3b3Jkcy4lMEElMjMlMjBNdWx0aXBsZSUyMHRva2VuJTIwY2xhc3NlcyUyMG1pZ2h0JTIwYWNjb3VudCUyMGZvciUyMHRoZSUyMHNhbWUlMjB3b3JkJTBBcHJlZGljdGVkX3Rva2Vuc19jbGFzc2VzJTIwJTNEJTIwJTVCbW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCdC5pdGVtKCklNUQlMjBmb3IlMjB0JTIwaW4lMjBwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTVCMCU1RCU1RCUwQSUwQWxhYmVscyUyMCUzRCUyMHByZWRpY3RlZF90b2tlbl9jbGFzc19pZHMlMEFsb3NzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBsYWJlbHMlM0RsYWJlbHMpLmxvc3M=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BioGptForTokenClassification
<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;microsoft/biogpt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BioGptForTokenClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/biogpt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;HuggingFace is a company based in Paris and New York&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_class_ids = logits.argmax(-<span class="hljs-number">1</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;microsoft/biogpt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BioGptForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/biogpt&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()

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

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=n("p"),y=i("Example of single-label classification:"),u=p(),v(f.$$.fragment)},l(r){d=s(r,"P",{});var g=a(d);y=l(g,"Example of single-label classification:"),g.forEach(o),u=h(r),T(f.$$.fragment,r)},m(r,g){_(r,d,g),e(d,y),_(r,u,g),k(f,r,g),b=!0},p:Pt,i(r){b||(w(f.$$.fragment,r),b=!0)},o(r){M(f.$$.fragment,r),b=!1},d(r){r&&o(d),r&&o(u),B(f,r)}}}function Kr(G){let d,y,u,f,b;return f=new St({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEJpb0dwdEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZiaW9ncHQlMjIpJTBBbW9kZWwlMjAlM0QlMjBCaW9HcHRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZiaW9ncHQlMjIlMkMlMjBwcm9ibGVtX3R5cGUlM0QlMjJtdWx0aV9sYWJlbF9jbGFzc2lmaWNhdGlvbiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWRzJTIwJTNEJTIwdG9yY2guYXJhbmdlKDAlMkMlMjBsb2dpdHMuc2hhcGUlNUItMSU1RCklNUJ0b3JjaC5zaWdtb2lkKGxvZ2l0cykuc3F1ZWV6ZShkaW0lM0QwKSUyMCUzRSUyMDAuNSU1RCUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyMEJpb0dwdEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMm1pY3Jvc29mdCUyRmJpb2dwdCUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BioGptForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;microsoft/biogpt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BioGptForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/biogpt&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_ids = torch.arange(<span class="hljs-number">0</span>, logits.shape[-<span class="hljs-number">1</span>])[torch.sigmoid(logits).squeeze(dim=<span class="hljs-number">0</span>) &gt; <span class="hljs-number">0.5</span>]

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

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.<span class="hljs-built_in">sum</span>(
<span class="hljs-meta">... </span>    torch.nn.functional.one_hot(predicted_class_ids[<span class="hljs-literal">None</span>, :].clone(), num_classes=num_labels), dim=<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>).to(torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=n("p"),y=i("Example of multi-label classification:"),u=p(),v(f.$$.fragment)},l(r){d=s(r,"P",{});var g=a(d);y=l(g,"Example of multi-label classification:"),g.forEach(o),u=h(r),T(f.$$.fragment,r)},m(r,g){_(r,d,g),e(d,y),_(r,u,g),k(f,r,g),b=!0},p:Pt,i(r){b||(w(f.$$.fragment,r),b=!0)},o(r){M(f.$$.fragment,r),b=!1},d(r){r&&o(d),r&&o(u),B(f,r)}}}function ei(G){let d,y,u,f,b,r,g,$,hn,zo,A,ie,Rt,Ee,un,Vt,mn,jo,le,fn,Fe,gn,_n,Eo,ut,bn,Fo,mt,At,yn,xo,ft,vn,Uo,P,Ht,Tn,kn,Lt,wn,Mn,xe,Bn,Qt,Gn,$n,Wo,S,Cn,Ue,Jn,zn,We,jn,En,qo,H,de,Yt,qe,Fn,Ot,xn,Io,gt,Xt,_t,Un,Zo,L,ce,Dt,Ie,Wn,Kt,qn,No,z,Ze,In,Q,Zn,bt,Nn,Pn,Ne,Sn,Rn,Vn,Y,An,yt,Hn,Ln,vt,Qn,Yn,On,pe,Po,O,he,eo,Pe,Xn,to,Dn,So,j,Se,Kn,oo,es,ts,Re,os,Tt,ns,ss,as,kt,Ve,Ro,X,ue,no,Ae,rs,so,is,Vo,I,He,ls,Le,ds,Qe,cs,ps,hs,x,Ye,us,D,ms,wt,fs,gs,ao,_s,bs,ys,me,vs,fe,Ao,K,ge,ro,Oe,Ts,io,ks,Ho,Z,Xe,ws,ee,Ms,lo,Bs,Gs,De,$s,Cs,Js,U,Ke,zs,te,js,Mt,Es,Fs,co,xs,Us,Ws,_e,qs,be,Lo,oe,ye,po,et,Is,ho,Zs,Qo,E,tt,Ns,uo,Ps,Ss,ot,Rs,nt,Vs,As,Hs,W,st,Ls,ne,Qs,Bt,Ys,Os,mo,Xs,Ds,Ks,ve,ea,Te,Yo,se,ke,fo,at,ta,go,oa,Oo,C,rt,na,_o,sa,aa,Gt,$t,ra,ia,la,F,da,bo,ca,pa,yo,ha,ua,vo,ma,fa,To,ga,_a,ba,it,ya,lt,va,Ta,ka,J,dt,wa,ae,Ma,Ct,Ba,Ga,ko,$a,Ca,Ja,we,za,Me,ja,Be,Xo;return r=new re({}),Ee=new re({}),qe=new re({}),Ie=new re({}),Ze=new N({props:{name:"class transformers.BioGptConfig",anchor:"transformers.BioGptConfig",parameters:[{name:"vocab_size",val:" = 42384"},{name:"hidden_size",val:" = 1024"},{name:"num_hidden_layers",val:" = 24"},{name:"num_attention_heads",val:" = 16"},{name:"intermediate_size",val:" = 4096"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 1024"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"scale_embedding",val:" = True"},{name:"use_cache",val:" = True"},{name:"layerdrop",val:" = 0.0"},{name:"activation_dropout",val:" = 0.0"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BioGptConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 42384) &#x2014;
Vocabulary size of the BioGPT model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.33.0/en/model_doc/biogpt#transformers.BioGptModel">BioGptModel</a>.`,name:"vocab_size"},{anchor:"transformers.BioGptConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimension of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.BioGptConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 24) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.BioGptConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.BioGptConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimension of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.BioGptConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.BioGptConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.BioGptConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.BioGptConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.BioGptConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.BioGptConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.BioGptConfig.scale_embedding",description:`<strong>scale_embedding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Scale embeddings by diving by sqrt(d_model).`,name:"scale_embedding"},{anchor:"transformers.BioGptConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.BioGptConfig.layerdrop",description:`<strong>layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Please refer to the paper about LayerDrop: <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a> for further details`,name:"layerdrop"},{anchor:"transformers.BioGptConfig.activation_dropout",description:`<strong>activation_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for activations inside the fully connected layer.`,name:"activation_dropout"},{anchor:"transformers.BioGptConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Padding token id.`,name:"pad_token_id"},{anchor:"transformers.BioGptConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Beginning of stream token id.`,name:"bos_token_id"},{anchor:"transformers.BioGptConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
End of stream token id.
Example &#x2014;`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/biogpt/configuration_biogpt.py#L29"}}),pe=new Nt({props:{anchor:"transformers.BioGptConfig.example",$$slots:{default:[Vr]},$$scope:{ctx:G}}}),Pe=new re({}),Se=new N({props:{name:"class transformers.BioGptTokenizer",anchor:"transformers.BioGptTokenizer",parameters:[{name:"vocab_file",val:""},{name:"merges_file",val:""},{name:"unk_token",val:" = '<unk>'"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"pad_token",val:" = '<pad>'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BioGptTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.BioGptTokenizer.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Merges file.`,name:"merges_file"},{anchor:"transformers.BioGptTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.BioGptTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the beginning of
sequence. The token used is the <code>cls_token</code>.</p>

					</div>`,name:"bos_token"},{anchor:"transformers.BioGptTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.BioGptTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.BioGptTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/biogpt/tokenization_biogpt.py#L56"}}),Ve=new N({props:{name:"save_vocabulary",anchor:"transformers.BioGptTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/biogpt/tokenization_biogpt.py#L326"}}),Ae=new re({}),He=new N({props:{name:"class transformers.BioGptModel",anchor:"transformers.BioGptModel",parameters:[{name:"config",val:": BioGptConfig"}],parametersDescription:[{anchor:"transformers.BioGptModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/biogpt#transformers.BioGptConfig">~BioGptConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/biogpt/modeling_biogpt.py#L453"}}),Ye=new N({props:{name:"forward",anchor:"transformers.BioGptModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BioGptModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BioGptModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BioGptModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BioGptModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BioGptModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>. inputs_embeds (<code>torch.FloatTensor</code> of shape
<code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>): Optionally, instead of passing <code>input_ids</code> you
can choose to directly pass an embedded representation. This is useful if you want more control over how to
convert <code>input_ids</code> indices into associated vectors than the model&#x2019;s internal embedding lookup matrix.`,name:"past_key_values"},{anchor:"transformers.BioGptModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.BioGptModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BioGptModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BioGptModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/biogpt/modeling_biogpt.py#L503",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.33.0/en/model_doc/biogpt#transformers.BioGptConfig"
>BioGptConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),me=new pn({props:{$$slots:{default:[Ar]},$$scope:{ctx:G}}}),fe=new Nt({props:{anchor:"transformers.BioGptModel.forward.example",$$slots:{default:[Hr]},$$scope:{ctx:G}}}),Oe=new re({}),Xe=new N({props:{name:"class transformers.BioGptForCausalLM",anchor:"transformers.BioGptForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BioGptForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/biogpt#transformers.BioGptConfig">~BioGptConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/biogpt/modeling_biogpt.py#L648"}}),Ke=new N({props:{name:"forward",anchor:"transformers.BioGptForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BioGptForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BioGptForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BioGptForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BioGptForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BioGptForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>. inputs_embeds (<code>torch.FloatTensor</code> of shape
<code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>): Optionally, instead of passing <code>input_ids</code> you
can choose to directly pass an embedded representation. This is useful if you want more control over how to
convert <code>input_ids</code> indices into associated vectors than the model&#x2019;s internal embedding lookup matrix.`,name:"past_key_values"},{anchor:"transformers.BioGptForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.BioGptForCausalLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BioGptForCausalLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BioGptForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BioGptForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for language modeling. Note that the labels <strong>are shifted</strong> inside the model, i.e. you can set
<code>labels = input_ids</code> Indices are selected in <code>[-100, 0, ..., config.vocab_size]</code> All labels set to <code>-100</code>
are ignored (masked), the loss is only computed for labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/biogpt/modeling_biogpt.py#L666",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.33.0/en/model_doc/biogpt#transformers.BioGptConfig"
>BioGptConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),_e=new pn({props:{$$slots:{default:[Lr]},$$scope:{ctx:G}}}),be=new Nt({props:{anchor:"transformers.BioGptForCausalLM.forward.example",$$slots:{default:[Qr]},$$scope:{ctx:G}}}),et=new re({}),tt=new N({props:{name:"class transformers.BioGptForTokenClassification",anchor:"transformers.BioGptForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BioGptForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/biogpt#transformers.BioGptConfig">~BioGptConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/biogpt/modeling_biogpt.py#L766"}}),st=new N({props:{name:"forward",anchor:"transformers.BioGptForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BioGptForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BioGptForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BioGptForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BioGptForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>({0}, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BioGptForTokenClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>. inputs_embeds (<code>torch.FloatTensor</code> of shape
<code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>): Optionally, instead of passing <code>input_ids</code> you
can choose to directly pass an embedded representation. This is useful if you want more control over how to
convert <code>input_ids</code> indices into associated vectors than the model&#x2019;s internal embedding lookup matrix.`,name:"past_key_values"},{anchor:"transformers.BioGptForTokenClassification.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.BioGptForTokenClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BioGptForTokenClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BioGptForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BioGptForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/biogpt/modeling_biogpt.py#L781",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.33.0/en/model_doc/biogpt#transformers.BioGptConfig"
>BioGptConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ve=new pn({props:{$$slots:{default:[Yr]},$$scope:{ctx:G}}}),Te=new Nt({props:{anchor:"transformers.BioGptForTokenClassification.forward.example",$$slots:{default:[Or]},$$scope:{ctx:G}}}),at=new re({}),rt=new N({props:{name:"class transformers.BioGptForSequenceClassification",anchor:"transformers.BioGptForSequenceClassification",parameters:[{name:"config",val:": BioGptConfig"}],parametersDescription:[{anchor:"transformers.BioGptForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/biogpt#transformers.BioGptConfig">~BioGptConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/biogpt/modeling_biogpt.py#L866"}}),dt=new N({props:{name:"forward",anchor:"transformers.BioGptForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BioGptForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BioGptForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BioGptForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BioGptForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>({0}, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BioGptForSequenceClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>. inputs_embeds (<code>torch.FloatTensor</code> of shape
<code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>): Optionally, instead of passing <code>input_ids</code> you
can choose to directly pass an embedded representation. This is useful if you want more control over how to
convert <code>input_ids</code> indices into associated vectors than the model&#x2019;s internal embedding lookup matrix.`,name:"past_key_values"},{anchor:"transformers.BioGptForSequenceClassification.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.BioGptForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BioGptForSequenceClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BioGptForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BioGptForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/biogpt/modeling_biogpt.py#L876",returnDescription:`
<p>A <code>transformers.modeling_outputs.SequenceClassifierOutputWithPast</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.33.0/en/model_doc/biogpt#transformers.BioGptConfig"
>BioGptConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>)</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_outputs.SequenceClassifierOutputWithPast</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),we=new pn({props:{$$slots:{default:[Xr]},$$scope:{ctx:G}}}),Me=new Nt({props:{anchor:"transformers.BioGptForSequenceClassification.forward.example",$$slots:{default:[Dr]},$$scope:{ctx:G}}}),Be=new Nt({props:{anchor:"transformers.BioGptForSequenceClassification.forward.example-2",$$slots:{default:[Kr]},$$scope:{ctx:G}}}),{c(){d=n("meta"),y=p(),u=n("h1"),f=n("a"),b=n("span"),v(r.$$.fragment),g=p(),$=n("span"),hn=i("BioGPT"),zo=p(),A=n("h2"),ie=n("a"),Rt=n("span"),v(Ee.$$.fragment),un=p(),Vt=n("span"),mn=i("Overview"),jo=p(),le=n("p"),fn=i("The BioGPT model was proposed in "),Fe=n("a"),gn=i("BioGPT: generative pre-trained transformer for biomedical text generation and mining"),_n=i(" by Renqian Luo, Liai Sun, Yingce Xia, Tao Qin, Sheng Zhang, Hoifung Poon and Tie-Yan Liu. BioGPT is a domain-specific generative pre-trained Transformer language model for biomedical text generation and mining. BioGPT follows the Transformer language model backbone, and is pre-trained on 15M PubMed abstracts from scratch."),Eo=p(),ut=n("p"),bn=i("The abstract from the paper is the following:"),Fo=p(),mt=n("p"),At=n("em"),yn=i("Pre-trained language models have attracted increasing attention in the biomedical domain, inspired by their great success in the general natural language domain. Among the two main branches of pre-trained language models in the general language domain, i.e. BERT (and its variants) and GPT (and its variants), the first one has been extensively studied in the biomedical domain, such as BioBERT and PubMedBERT. While they have achieved great success on a variety of discriminative downstream biomedical tasks, the lack of generation ability constrains their application scope. In this paper, we propose BioGPT, a domain-specific generative Transformer language model pre-trained on large-scale biomedical literature. We evaluate BioGPT on six biomedical natural language processing tasks and demonstrate that our model outperforms previous models on most tasks. Especially, we get 44.98%, 38.42% and 40.76% F1 score on BC5CDR, KD-DTI and DDI end-to-end relation extraction tasks, respectively, and 78.2% accuracy on PubMedQA, creating a new record. Our case study on text generation further demonstrates the advantage of BioGPT on biomedical literature to generate fluent descriptions for biomedical terms."),xo=p(),ft=n("p"),vn=i("Tips:"),Uo=p(),P=n("ul"),Ht=n("li"),Tn=i("BioGPT is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than the left."),kn=p(),Lt=n("li"),wn=i("BioGPT was trained with a causal language modeling (CLM) objective and is therefore powerful at predicting the next token in a sequence. Leveraging this feature allows BioGPT to generate syntactically coherent text as it can be observed in the run_generation.py example script."),Mn=p(),xe=n("li"),Bn=i("The model can take the "),Qt=n("code"),Gn=i("past_key_values"),$n=i(" (for PyTorch) as input, which is the previously computed key/value attention pairs. Using this (past_key_values or past) value prevents the model from re-computing pre-computed values in the context of text generation. For PyTorch, see past_key_values argument of the BioGptForCausalLM.forward() method for more information on its usage."),Wo=p(),S=n("p"),Cn=i("This model was contributed by "),Ue=n("a"),Jn=i("kamalkraj"),zn=i(". The original code can be found "),We=n("a"),jn=i("here"),En=i("."),qo=p(),H=n("h2"),de=n("a"),Yt=n("span"),v(qe.$$.fragment),Fn=p(),Ot=n("span"),xn=i("Documentation resources"),Io=p(),gt=n("ul"),Xt=n("li"),_t=n("a"),Un=i("Causal language modeling task guide"),Zo=p(),L=n("h2"),ce=n("a"),Dt=n("span"),v(Ie.$$.fragment),Wn=p(),Kt=n("span"),qn=i("BioGptConfig"),No=p(),z=n("div"),v(Ze.$$.fragment),In=p(),Q=n("p"),Zn=i("This is the configuration class to store the configuration of a "),bt=n("a"),Nn=i("BioGptModel"),Pn=i(`. It is used to instantiate an
BioGPT model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the BioGPT
`),Ne=n("a"),Sn=i("microsoft/biogpt"),Rn=i(" architecture."),Vn=p(),Y=n("p"),An=i("Configuration objects inherit from "),yt=n("a"),Hn=i("PretrainedConfig"),Ln=i(` and can be used to control the model outputs. Read the
documentation from `),vt=n("a"),Qn=i("PretrainedConfig"),Yn=i(" for more information."),On=p(),v(pe.$$.fragment),Po=p(),O=n("h2"),he=n("a"),eo=n("span"),v(Pe.$$.fragment),Xn=p(),to=n("span"),Dn=i("BioGptTokenizer"),So=p(),j=n("div"),v(Se.$$.fragment),Kn=p(),oo=n("p"),es=i("Construct an FAIRSEQ Transformer tokenizer. Moses tokenization followed by Byte-Pair Encoding."),ts=p(),Re=n("p"),os=i("This tokenizer inherits from "),Tt=n("a"),ns=i("PreTrainedTokenizer"),ss=i(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),as=p(),kt=n("div"),v(Ve.$$.fragment),Ro=p(),X=n("h2"),ue=n("a"),no=n("span"),v(Ae.$$.fragment),rs=p(),so=n("span"),is=i("BioGptModel"),Vo=p(),I=n("div"),v(He.$$.fragment),ls=p(),Le=n("p"),ds=i(`The bare BioGPT Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Qe=n("a"),cs=i("torch.nn.Module"),ps=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),hs=p(),x=n("div"),v(Ye.$$.fragment),us=p(),D=n("p"),ms=i("The "),wt=n("a"),fs=i("BioGptModel"),gs=i(" forward method, overrides the "),ao=n("code"),_s=i("__call__"),bs=i(" special method."),ys=p(),v(me.$$.fragment),vs=p(),v(fe.$$.fragment),Ao=p(),K=n("h2"),ge=n("a"),ro=n("span"),v(Oe.$$.fragment),Ts=p(),io=n("span"),ks=i("BioGptForCausalLM"),Ho=p(),Z=n("div"),v(Xe.$$.fragment),ws=p(),ee=n("p"),Ms=i("BioGPT Model with a "),lo=n("code"),Bs=i("language modeling"),Gs=i(` head on top for CLM fine-tuning.
This model is a PyTorch `),De=n("a"),$s=i("torch.nn.Module"),Cs=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Js=p(),U=n("div"),v(Ke.$$.fragment),zs=p(),te=n("p"),js=i("The "),Mt=n("a"),Es=i("BioGptForCausalLM"),Fs=i(" forward method, overrides the "),co=n("code"),xs=i("__call__"),Us=i(" special method."),Ws=p(),v(_e.$$.fragment),qs=p(),v(be.$$.fragment),Lo=p(),oe=n("h2"),ye=n("a"),po=n("span"),v(et.$$.fragment),Is=p(),ho=n("span"),Zs=i("BioGptForTokenClassification"),Qo=p(),E=n("div"),v(tt.$$.fragment),Ns=p(),uo=n("p"),Ps=i(`BioGPT 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.`),Ss=p(),ot=n("p"),Rs=i("This model is a PyTorch "),nt=n("a"),Vs=i("torch.nn.Module"),As=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Hs=p(),W=n("div"),v(st.$$.fragment),Ls=p(),ne=n("p"),Qs=i("The "),Bt=n("a"),Ys=i("BioGptForTokenClassification"),Os=i(" forward method, overrides the "),mo=n("code"),Xs=i("__call__"),Ds=i(" special method."),Ks=p(),v(ve.$$.fragment),ea=p(),v(Te.$$.fragment),Yo=p(),se=n("h2"),ke=n("a"),fo=n("span"),v(at.$$.fragment),ta=p(),go=n("span"),oa=i("BioGptForSequenceClassification"),Oo=p(),C=n("div"),v(rt.$$.fragment),na=p(),_o=n("p"),sa=i("The BioGpt Model transformer with a sequence classification head on top (linear layer)."),aa=p(),Gt=n("p"),$t=n("a"),ra=i("BioGptForSequenceClassification"),ia=i(` uses the last token in order to do the classification, as other causal models
(e.g. GPT-2) do.`),la=p(),F=n("p"),da=i(`Since it does classification on the last token, it is required to know the position of the last token. If a
`),bo=n("code"),ca=i("pad_token_id"),pa=i(` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),yo=n("code"),ha=i("pad_token_id"),ua=i(` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),vo=n("code"),ma=i("inputs_embeds"),fa=i(" are passed instead of "),To=n("code"),ga=i("input_ids"),_a=i(`, it does the same (take the last value in
each row of the batch).`),ba=p(),it=n("p"),ya=i("This model is a PyTorch "),lt=n("a"),va=i("torch.nn.Module"),Ta=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ka=p(),J=n("div"),v(dt.$$.fragment),wa=p(),ae=n("p"),Ma=i("The "),Ct=n("a"),Ba=i("BioGptForSequenceClassification"),Ga=i(" forward method, overrides the "),ko=n("code"),$a=i("__call__"),Ca=i(" special method."),Ja=p(),v(we.$$.fragment),za=p(),v(Me.$$.fragment),ja=p(),v(Be.$$.fragment),this.h()},l(t){const m=Sr('[data-svelte="svelte-1phssyn"]',document.head);d=s(m,"META",{name:!0,content:!0}),m.forEach(o),y=h(t),u=s(t,"H1",{class:!0});var ct=a(u);f=s(ct,"A",{id:!0,class:!0,href:!0});var wo=a(f);b=s(wo,"SPAN",{});var Mo=a(b);T(r.$$.fragment,Mo),Mo.forEach(o),wo.forEach(o),g=h(ct),$=s(ct,"SPAN",{});var Bo=a($);hn=l(Bo,"BioGPT"),Bo.forEach(o),ct.forEach(o),zo=h(t),A=s(t,"H2",{class:!0});var pt=a(A);ie=s(pt,"A",{id:!0,class:!0,href:!0});var Go=a(ie);Rt=s(Go,"SPAN",{});var $o=a(Rt);T(Ee.$$.fragment,$o),$o.forEach(o),Go.forEach(o),un=h(pt),Vt=s(pt,"SPAN",{});var Co=a(Vt);mn=l(Co,"Overview"),Co.forEach(o),pt.forEach(o),jo=h(t),le=s(t,"P",{});var ht=a(le);fn=l(ht,"The BioGPT model was proposed in "),Fe=s(ht,"A",{href:!0,rel:!0});var Jo=a(Fe);gn=l(Jo,"BioGPT: generative pre-trained transformer for biomedical text generation and mining"),Jo.forEach(o),_n=l(ht," by Renqian Luo, Liai Sun, Yingce Xia, Tao Qin, Sheng Zhang, Hoifung Poon and Tie-Yan Liu. BioGPT is a domain-specific generative pre-trained Transformer language model for biomedical text generation and mining. BioGPT follows the Transformer language model backbone, and is pre-trained on 15M PubMed abstracts from scratch."),ht.forEach(o),Eo=h(t),ut=s(t,"P",{});var Fa=a(ut);bn=l(Fa,"The abstract from the paper is the following:"),Fa.forEach(o),Fo=h(t),mt=s(t,"P",{});var xa=a(mt);At=s(xa,"EM",{});var Ua=a(At);yn=l(Ua,"Pre-trained language models have attracted increasing attention in the biomedical domain, inspired by their great success in the general natural language domain. Among the two main branches of pre-trained language models in the general language domain, i.e. BERT (and its variants) and GPT (and its variants), the first one has been extensively studied in the biomedical domain, such as BioBERT and PubMedBERT. While they have achieved great success on a variety of discriminative downstream biomedical tasks, the lack of generation ability constrains their application scope. In this paper, we propose BioGPT, a domain-specific generative Transformer language model pre-trained on large-scale biomedical literature. We evaluate BioGPT on six biomedical natural language processing tasks and demonstrate that our model outperforms previous models on most tasks. Especially, we get 44.98%, 38.42% and 40.76% F1 score on BC5CDR, KD-DTI and DDI end-to-end relation extraction tasks, respectively, and 78.2% accuracy on PubMedQA, creating a new record. Our case study on text generation further demonstrates the advantage of BioGPT on biomedical literature to generate fluent descriptions for biomedical terms."),Ua.forEach(o),xa.forEach(o),xo=h(t),ft=s(t,"P",{});var Wa=a(ft);vn=l(Wa,"Tips:"),Wa.forEach(o),Uo=h(t),P=s(t,"UL",{});var Jt=a(P);Ht=s(Jt,"LI",{});var qa=a(Ht);Tn=l(qa,"BioGPT is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right rather than the left."),qa.forEach(o),kn=h(Jt),Lt=s(Jt,"LI",{});var Ia=a(Lt);wn=l(Ia,"BioGPT was trained with a causal language modeling (CLM) objective and is therefore powerful at predicting the next token in a sequence. Leveraging this feature allows BioGPT to generate syntactically coherent text as it can be observed in the run_generation.py example script."),Ia.forEach(o),Mn=h(Jt),xe=s(Jt,"LI",{});var Do=a(xe);Bn=l(Do,"The model can take the "),Qt=s(Do,"CODE",{});var Za=a(Qt);Gn=l(Za,"past_key_values"),Za.forEach(o),$n=l(Do," (for PyTorch) as input, which is the previously computed key/value attention pairs. Using this (past_key_values or past) value prevents the model from re-computing pre-computed values in the context of text generation. For PyTorch, see past_key_values argument of the BioGptForCausalLM.forward() method for more information on its usage."),Do.forEach(o),Jt.forEach(o),Wo=h(t),S=s(t,"P",{});var zt=a(S);Cn=l(zt,"This model was contributed by "),Ue=s(zt,"A",{href:!0,rel:!0});var Na=a(Ue);Jn=l(Na,"kamalkraj"),Na.forEach(o),zn=l(zt,". The original code can be found "),We=s(zt,"A",{href:!0,rel:!0});var Pa=a(We);jn=l(Pa,"here"),Pa.forEach(o),En=l(zt,"."),zt.forEach(o),qo=h(t),H=s(t,"H2",{class:!0});var Ko=a(H);de=s(Ko,"A",{id:!0,class:!0,href:!0});var Sa=a(de);Yt=s(Sa,"SPAN",{});var Ra=a(Yt);T(qe.$$.fragment,Ra),Ra.forEach(o),Sa.forEach(o),Fn=h(Ko),Ot=s(Ko,"SPAN",{});var Va=a(Ot);xn=l(Va,"Documentation resources"),Va.forEach(o),Ko.forEach(o),Io=h(t),gt=s(t,"UL",{});var Aa=a(gt);Xt=s(Aa,"LI",{});var Ha=a(Xt);_t=s(Ha,"A",{href:!0});var La=a(_t);Un=l(La,"Causal language modeling task guide"),La.forEach(o),Ha.forEach(o),Aa.forEach(o),Zo=h(t),L=s(t,"H2",{class:!0});var en=a(L);ce=s(en,"A",{id:!0,class:!0,href:!0});var Qa=a(ce);Dt=s(Qa,"SPAN",{});var Ya=a(Dt);T(Ie.$$.fragment,Ya),Ya.forEach(o),Qa.forEach(o),Wn=h(en),Kt=s(en,"SPAN",{});var Oa=a(Kt);qn=l(Oa,"BioGptConfig"),Oa.forEach(o),en.forEach(o),No=h(t),z=s(t,"DIV",{class:!0});var Ge=a(z);T(Ze.$$.fragment,Ge),In=h(Ge),Q=s(Ge,"P",{});var jt=a(Q);Zn=l(jt,"This is the configuration class to store the configuration of a "),bt=s(jt,"A",{href:!0});var Xa=a(bt);Nn=l(Xa,"BioGptModel"),Xa.forEach(o),Pn=l(jt,`. It is used to instantiate an
BioGPT model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the BioGPT
`),Ne=s(jt,"A",{href:!0,rel:!0});var Da=a(Ne);Sn=l(Da,"microsoft/biogpt"),Da.forEach(o),Rn=l(jt," architecture."),jt.forEach(o),Vn=h(Ge),Y=s(Ge,"P",{});var Et=a(Y);An=l(Et,"Configuration objects inherit from "),yt=s(Et,"A",{href:!0});var Ka=a(yt);Hn=l(Ka,"PretrainedConfig"),Ka.forEach(o),Ln=l(Et,` and can be used to control the model outputs. Read the
documentation from `),vt=s(Et,"A",{href:!0});var er=a(vt);Qn=l(er,"PretrainedConfig"),er.forEach(o),Yn=l(Et," for more information."),Et.forEach(o),On=h(Ge),T(pe.$$.fragment,Ge),Ge.forEach(o),Po=h(t),O=s(t,"H2",{class:!0});var tn=a(O);he=s(tn,"A",{id:!0,class:!0,href:!0});var tr=a(he);eo=s(tr,"SPAN",{});var or=a(eo);T(Pe.$$.fragment,or),or.forEach(o),tr.forEach(o),Xn=h(tn),to=s(tn,"SPAN",{});var nr=a(to);Dn=l(nr,"BioGptTokenizer"),nr.forEach(o),tn.forEach(o),So=h(t),j=s(t,"DIV",{class:!0});var $e=a(j);T(Se.$$.fragment,$e),Kn=h($e),oo=s($e,"P",{});var sr=a(oo);es=l(sr,"Construct an FAIRSEQ Transformer tokenizer. Moses tokenization followed by Byte-Pair Encoding."),sr.forEach(o),ts=h($e),Re=s($e,"P",{});var on=a(Re);os=l(on,"This tokenizer inherits from "),Tt=s(on,"A",{href:!0});var ar=a(Tt);ns=l(ar,"PreTrainedTokenizer"),ar.forEach(o),ss=l(on,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),on.forEach(o),as=h($e),kt=s($e,"DIV",{class:!0});var rr=a(kt);T(Ve.$$.fragment,rr),rr.forEach(o),$e.forEach(o),Ro=h(t),X=s(t,"H2",{class:!0});var nn=a(X);ue=s(nn,"A",{id:!0,class:!0,href:!0});var ir=a(ue);no=s(ir,"SPAN",{});var lr=a(no);T(Ae.$$.fragment,lr),lr.forEach(o),ir.forEach(o),rs=h(nn),so=s(nn,"SPAN",{});var dr=a(so);is=l(dr,"BioGptModel"),dr.forEach(o),nn.forEach(o),Vo=h(t),I=s(t,"DIV",{class:!0});var Ft=a(I);T(He.$$.fragment,Ft),ls=h(Ft),Le=s(Ft,"P",{});var sn=a(Le);ds=l(sn,`The bare BioGPT Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Qe=s(sn,"A",{href:!0,rel:!0});var cr=a(Qe);cs=l(cr,"torch.nn.Module"),cr.forEach(o),ps=l(sn,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),sn.forEach(o),hs=h(Ft),x=s(Ft,"DIV",{class:!0});var Ce=a(x);T(Ye.$$.fragment,Ce),us=h(Ce),D=s(Ce,"P",{});var xt=a(D);ms=l(xt,"The "),wt=s(xt,"A",{href:!0});var pr=a(wt);fs=l(pr,"BioGptModel"),pr.forEach(o),gs=l(xt," forward method, overrides the "),ao=s(xt,"CODE",{});var hr=a(ao);_s=l(hr,"__call__"),hr.forEach(o),bs=l(xt," special method."),xt.forEach(o),ys=h(Ce),T(me.$$.fragment,Ce),vs=h(Ce),T(fe.$$.fragment,Ce),Ce.forEach(o),Ft.forEach(o),Ao=h(t),K=s(t,"H2",{class:!0});var an=a(K);ge=s(an,"A",{id:!0,class:!0,href:!0});var ur=a(ge);ro=s(ur,"SPAN",{});var mr=a(ro);T(Oe.$$.fragment,mr),mr.forEach(o),ur.forEach(o),Ts=h(an),io=s(an,"SPAN",{});var fr=a(io);ks=l(fr,"BioGptForCausalLM"),fr.forEach(o),an.forEach(o),Ho=h(t),Z=s(t,"DIV",{class:!0});var Ut=a(Z);T(Xe.$$.fragment,Ut),ws=h(Ut),ee=s(Ut,"P",{});var Wt=a(ee);Ms=l(Wt,"BioGPT Model with a "),lo=s(Wt,"CODE",{});var gr=a(lo);Bs=l(gr,"language modeling"),gr.forEach(o),Gs=l(Wt,` head on top for CLM fine-tuning.
This model is a PyTorch `),De=s(Wt,"A",{href:!0,rel:!0});var _r=a(De);$s=l(_r,"torch.nn.Module"),_r.forEach(o),Cs=l(Wt,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Wt.forEach(o),Js=h(Ut),U=s(Ut,"DIV",{class:!0});var Je=a(U);T(Ke.$$.fragment,Je),zs=h(Je),te=s(Je,"P",{});var qt=a(te);js=l(qt,"The "),Mt=s(qt,"A",{href:!0});var br=a(Mt);Es=l(br,"BioGptForCausalLM"),br.forEach(o),Fs=l(qt," forward method, overrides the "),co=s(qt,"CODE",{});var yr=a(co);xs=l(yr,"__call__"),yr.forEach(o),Us=l(qt," special method."),qt.forEach(o),Ws=h(Je),T(_e.$$.fragment,Je),qs=h(Je),T(be.$$.fragment,Je),Je.forEach(o),Ut.forEach(o),Lo=h(t),oe=s(t,"H2",{class:!0});var rn=a(oe);ye=s(rn,"A",{id:!0,class:!0,href:!0});var vr=a(ye);po=s(vr,"SPAN",{});var Tr=a(po);T(et.$$.fragment,Tr),Tr.forEach(o),vr.forEach(o),Is=h(rn),ho=s(rn,"SPAN",{});var kr=a(ho);Zs=l(kr,"BioGptForTokenClassification"),kr.forEach(o),rn.forEach(o),Qo=h(t),E=s(t,"DIV",{class:!0});var ze=a(E);T(tt.$$.fragment,ze),Ns=h(ze),uo=s(ze,"P",{});var wr=a(uo);Ps=l(wr,`BioGPT 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.`),wr.forEach(o),Ss=h(ze),ot=s(ze,"P",{});var ln=a(ot);Rs=l(ln,"This model is a PyTorch "),nt=s(ln,"A",{href:!0,rel:!0});var Mr=a(nt);Vs=l(Mr,"torch.nn.Module"),Mr.forEach(o),As=l(ln,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ln.forEach(o),Hs=h(ze),W=s(ze,"DIV",{class:!0});var je=a(W);T(st.$$.fragment,je),Ls=h(je),ne=s(je,"P",{});var It=a(ne);Qs=l(It,"The "),Bt=s(It,"A",{href:!0});var Br=a(Bt);Ys=l(Br,"BioGptForTokenClassification"),Br.forEach(o),Os=l(It," forward method, overrides the "),mo=s(It,"CODE",{});var Gr=a(mo);Xs=l(Gr,"__call__"),Gr.forEach(o),Ds=l(It," special method."),It.forEach(o),Ks=h(je),T(ve.$$.fragment,je),ea=h(je),T(Te.$$.fragment,je),je.forEach(o),ze.forEach(o),Yo=h(t),se=s(t,"H2",{class:!0});var dn=a(se);ke=s(dn,"A",{id:!0,class:!0,href:!0});var $r=a(ke);fo=s($r,"SPAN",{});var Cr=a(fo);T(at.$$.fragment,Cr),Cr.forEach(o),$r.forEach(o),ta=h(dn),go=s(dn,"SPAN",{});var Jr=a(go);oa=l(Jr,"BioGptForSequenceClassification"),Jr.forEach(o),dn.forEach(o),Oo=h(t),C=s(t,"DIV",{class:!0});var q=a(C);T(rt.$$.fragment,q),na=h(q),_o=s(q,"P",{});var zr=a(_o);sa=l(zr,"The BioGpt Model transformer with a sequence classification head on top (linear layer)."),zr.forEach(o),aa=h(q),Gt=s(q,"P",{});var Ea=a(Gt);$t=s(Ea,"A",{href:!0});var jr=a($t);ra=l(jr,"BioGptForSequenceClassification"),jr.forEach(o),ia=l(Ea,` uses the last token in order to do the classification, as other causal models
(e.g. GPT-2) do.`),Ea.forEach(o),la=h(q),F=s(q,"P",{});var R=a(F);da=l(R,`Since it does classification on the last token, it is required to know the position of the last token. If a
`),bo=s(R,"CODE",{});var Er=a(bo);ca=l(Er,"pad_token_id"),Er.forEach(o),pa=l(R,` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),yo=s(R,"CODE",{});var Fr=a(yo);ha=l(Fr,"pad_token_id"),Fr.forEach(o),ua=l(R,` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),vo=s(R,"CODE",{});var xr=a(vo);ma=l(xr,"inputs_embeds"),xr.forEach(o),fa=l(R," are passed instead of "),To=s(R,"CODE",{});var Ur=a(To);ga=l(Ur,"input_ids"),Ur.forEach(o),_a=l(R,`, it does the same (take the last value in
each row of the batch).`),R.forEach(o),ba=h(q),it=s(q,"P",{});var cn=a(it);ya=l(cn,"This model is a PyTorch "),lt=s(cn,"A",{href:!0,rel:!0});var Wr=a(lt);va=l(Wr,"torch.nn.Module"),Wr.forEach(o),Ta=l(cn,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),cn.forEach(o),ka=h(q),J=s(q,"DIV",{class:!0});var V=a(J);T(dt.$$.fragment,V),wa=h(V),ae=s(V,"P",{});var Zt=a(ae);Ma=l(Zt,"The "),Ct=s(Zt,"A",{href:!0});var qr=a(Ct);Ba=l(qr,"BioGptForSequenceClassification"),qr.forEach(o),Ga=l(Zt," forward method, overrides the "),ko=s(Zt,"CODE",{});var Ir=a(ko);$a=l(Ir,"__call__"),Ir.forEach(o),Ca=l(Zt," special method."),Zt.forEach(o),Ja=h(V),T(we.$$.fragment,V),za=h(V),T(Me.$$.fragment,V),ja=h(V),T(Be.$$.fragment,V),V.forEach(o),q.forEach(o),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(ti)),c(f,"id","biogpt"),c(f,"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"),c(f,"href","#biogpt"),c(u,"class","relative group"),c(ie,"id","overview"),c(ie,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ie,"href","#overview"),c(A,"class","relative group"),c(Fe,"href","https://academic.oup.com/bib/advance-article/doi/10.1093/bib/bbac409/6713511?guestAccessKey=a66d9b5d-4f83-4017-bb52-405815c907b9"),c(Fe,"rel","nofollow"),c(Ue,"href","https://huggingface.co/kamalkraj"),c(Ue,"rel","nofollow"),c(We,"href","https://github.com/microsoft/BioGPT"),c(We,"rel","nofollow"),c(de,"id","documentation-resources"),c(de,"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"),c(de,"href","#documentation-resources"),c(H,"class","relative group"),c(_t,"href","../tasks/language_modeling"),c(ce,"id","transformers.BioGptConfig"),c(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"),c(ce,"href","#transformers.BioGptConfig"),c(L,"class","relative group"),c(bt,"href","/docs/transformers/v4.33.0/en/model_doc/biogpt#transformers.BioGptModel"),c(Ne,"href","https://huggingface.co/microsoft/biogpt"),c(Ne,"rel","nofollow"),c(yt,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(vt,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(he,"id","transformers.BioGptTokenizer"),c(he,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(he,"href","#transformers.BioGptTokenizer"),c(O,"class","relative group"),c(Tt,"href","/docs/transformers/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),c(kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ue,"id","transformers.BioGptModel"),c(ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ue,"href","#transformers.BioGptModel"),c(X,"class","relative group"),c(Qe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Qe,"rel","nofollow"),c(wt,"href","/docs/transformers/v4.33.0/en/model_doc/biogpt#transformers.BioGptModel"),c(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ge,"id","transformers.BioGptForCausalLM"),c(ge,"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"),c(ge,"href","#transformers.BioGptForCausalLM"),c(K,"class","relative group"),c(De,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(De,"rel","nofollow"),c(Mt,"href","/docs/transformers/v4.33.0/en/model_doc/biogpt#transformers.BioGptForCausalLM"),c(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ye,"id","transformers.BioGptForTokenClassification"),c(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"),c(ye,"href","#transformers.BioGptForTokenClassification"),c(oe,"class","relative group"),c(nt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(nt,"rel","nofollow"),c(Bt,"href","/docs/transformers/v4.33.0/en/model_doc/biogpt#transformers.BioGptForTokenClassification"),c(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ke,"id","transformers.BioGptForSequenceClassification"),c(ke,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ke,"href","#transformers.BioGptForSequenceClassification"),c(se,"class","relative group"),c($t,"href","/docs/transformers/v4.33.0/en/model_doc/biogpt#transformers.BioGptForSequenceClassification"),c(lt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(lt,"rel","nofollow"),c(Ct,"href","/docs/transformers/v4.33.0/en/model_doc/biogpt#transformers.BioGptForSequenceClassification"),c(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(C,"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,m){e(document.head,d),_(t,y,m),_(t,u,m),e(u,f),e(f,b),k(r,b,null),e(u,g),e(u,$),e($,hn),_(t,zo,m),_(t,A,m),e(A,ie),e(ie,Rt),k(Ee,Rt,null),e(A,un),e(A,Vt),e(Vt,mn),_(t,jo,m),_(t,le,m),e(le,fn),e(le,Fe),e(Fe,gn),e(le,_n),_(t,Eo,m),_(t,ut,m),e(ut,bn),_(t,Fo,m),_(t,mt,m),e(mt,At),e(At,yn),_(t,xo,m),_(t,ft,m),e(ft,vn),_(t,Uo,m),_(t,P,m),e(P,Ht),e(Ht,Tn),e(P,kn),e(P,Lt),e(Lt,wn),e(P,Mn),e(P,xe),e(xe,Bn),e(xe,Qt),e(Qt,Gn),e(xe,$n),_(t,Wo,m),_(t,S,m),e(S,Cn),e(S,Ue),e(Ue,Jn),e(S,zn),e(S,We),e(We,jn),e(S,En),_(t,qo,m),_(t,H,m),e(H,de),e(de,Yt),k(qe,Yt,null),e(H,Fn),e(H,Ot),e(Ot,xn),_(t,Io,m),_(t,gt,m),e(gt,Xt),e(Xt,_t),e(_t,Un),_(t,Zo,m),_(t,L,m),e(L,ce),e(ce,Dt),k(Ie,Dt,null),e(L,Wn),e(L,Kt),e(Kt,qn),_(t,No,m),_(t,z,m),k(Ze,z,null),e(z,In),e(z,Q),e(Q,Zn),e(Q,bt),e(bt,Nn),e(Q,Pn),e(Q,Ne),e(Ne,Sn),e(Q,Rn),e(z,Vn),e(z,Y),e(Y,An),e(Y,yt),e(yt,Hn),e(Y,Ln),e(Y,vt),e(vt,Qn),e(Y,Yn),e(z,On),k(pe,z,null),_(t,Po,m),_(t,O,m),e(O,he),e(he,eo),k(Pe,eo,null),e(O,Xn),e(O,to),e(to,Dn),_(t,So,m),_(t,j,m),k(Se,j,null),e(j,Kn),e(j,oo),e(oo,es),e(j,ts),e(j,Re),e(Re,os),e(Re,Tt),e(Tt,ns),e(Re,ss),e(j,as),e(j,kt),k(Ve,kt,null),_(t,Ro,m),_(t,X,m),e(X,ue),e(ue,no),k(Ae,no,null),e(X,rs),e(X,so),e(so,is),_(t,Vo,m),_(t,I,m),k(He,I,null),e(I,ls),e(I,Le),e(Le,ds),e(Le,Qe),e(Qe,cs),e(Le,ps),e(I,hs),e(I,x),k(Ye,x,null),e(x,us),e(x,D),e(D,ms),e(D,wt),e(wt,fs),e(D,gs),e(D,ao),e(ao,_s),e(D,bs),e(x,ys),k(me,x,null),e(x,vs),k(fe,x,null),_(t,Ao,m),_(t,K,m),e(K,ge),e(ge,ro),k(Oe,ro,null),e(K,Ts),e(K,io),e(io,ks),_(t,Ho,m),_(t,Z,m),k(Xe,Z,null),e(Z,ws),e(Z,ee),e(ee,Ms),e(ee,lo),e(lo,Bs),e(ee,Gs),e(ee,De),e(De,$s),e(ee,Cs),e(Z,Js),e(Z,U),k(Ke,U,null),e(U,zs),e(U,te),e(te,js),e(te,Mt),e(Mt,Es),e(te,Fs),e(te,co),e(co,xs),e(te,Us),e(U,Ws),k(_e,U,null),e(U,qs),k(be,U,null),_(t,Lo,m),_(t,oe,m),e(oe,ye),e(ye,po),k(et,po,null),e(oe,Is),e(oe,ho),e(ho,Zs),_(t,Qo,m),_(t,E,m),k(tt,E,null),e(E,Ns),e(E,uo),e(uo,Ps),e(E,Ss),e(E,ot),e(ot,Rs),e(ot,nt),e(nt,Vs),e(ot,As),e(E,Hs),e(E,W),k(st,W,null),e(W,Ls),e(W,ne),e(ne,Qs),e(ne,Bt),e(Bt,Ys),e(ne,Os),e(ne,mo),e(mo,Xs),e(ne,Ds),e(W,Ks),k(ve,W,null),e(W,ea),k(Te,W,null),_(t,Yo,m),_(t,se,m),e(se,ke),e(ke,fo),k(at,fo,null),e(se,ta),e(se,go),e(go,oa),_(t,Oo,m),_(t,C,m),k(rt,C,null),e(C,na),e(C,_o),e(_o,sa),e(C,aa),e(C,Gt),e(Gt,$t),e($t,ra),e(Gt,ia),e(C,la),e(C,F),e(F,da),e(F,bo),e(bo,ca),e(F,pa),e(F,yo),e(yo,ha),e(F,ua),e(F,vo),e(vo,ma),e(F,fa),e(F,To),e(To,ga),e(F,_a),e(C,ba),e(C,it),e(it,ya),e(it,lt),e(lt,va),e(it,Ta),e(C,ka),e(C,J),k(dt,J,null),e(J,wa),e(J,ae),e(ae,Ma),e(ae,Ct),e(Ct,Ba),e(ae,Ga),e(ae,ko),e(ko,$a),e(ae,Ca),e(J,Ja),k(we,J,null),e(J,za),k(Me,J,null),e(J,ja),k(Be,J,null),Xo=!0},p(t,[m]){const ct={};m&2&&(ct.$$scope={dirty:m,ctx:t}),pe.$set(ct);const wo={};m&2&&(wo.$$scope={dirty:m,ctx:t}),me.$set(wo);const Mo={};m&2&&(Mo.$$scope={dirty:m,ctx:t}),fe.$set(Mo);const Bo={};m&2&&(Bo.$$scope={dirty:m,ctx:t}),_e.$set(Bo);const pt={};m&2&&(pt.$$scope={dirty:m,ctx:t}),be.$set(pt);const Go={};m&2&&(Go.$$scope={dirty:m,ctx:t}),ve.$set(Go);const $o={};m&2&&($o.$$scope={dirty:m,ctx:t}),Te.$set($o);const Co={};m&2&&(Co.$$scope={dirty:m,ctx:t}),we.$set(Co);const ht={};m&2&&(ht.$$scope={dirty:m,ctx:t}),Me.$set(ht);const Jo={};m&2&&(Jo.$$scope={dirty:m,ctx:t}),Be.$set(Jo)},i(t){Xo||(w(r.$$.fragment,t),w(Ee.$$.fragment,t),w(qe.$$.fragment,t),w(Ie.$$.fragment,t),w(Ze.$$.fragment,t),w(pe.$$.fragment,t),w(Pe.$$.fragment,t),w(Se.$$.fragment,t),w(Ve.$$.fragment,t),w(Ae.$$.fragment,t),w(He.$$.fragment,t),w(Ye.$$.fragment,t),w(me.$$.fragment,t),w(fe.$$.fragment,t),w(Oe.$$.fragment,t),w(Xe.$$.fragment,t),w(Ke.$$.fragment,t),w(_e.$$.fragment,t),w(be.$$.fragment,t),w(et.$$.fragment,t),w(tt.$$.fragment,t),w(st.$$.fragment,t),w(ve.$$.fragment,t),w(Te.$$.fragment,t),w(at.$$.fragment,t),w(rt.$$.fragment,t),w(dt.$$.fragment,t),w(we.$$.fragment,t),w(Me.$$.fragment,t),w(Be.$$.fragment,t),Xo=!0)},o(t){M(r.$$.fragment,t),M(Ee.$$.fragment,t),M(qe.$$.fragment,t),M(Ie.$$.fragment,t),M(Ze.$$.fragment,t),M(pe.$$.fragment,t),M(Pe.$$.fragment,t),M(Se.$$.fragment,t),M(Ve.$$.fragment,t),M(Ae.$$.fragment,t),M(He.$$.fragment,t),M(Ye.$$.fragment,t),M(me.$$.fragment,t),M(fe.$$.fragment,t),M(Oe.$$.fragment,t),M(Xe.$$.fragment,t),M(Ke.$$.fragment,t),M(_e.$$.fragment,t),M(be.$$.fragment,t),M(et.$$.fragment,t),M(tt.$$.fragment,t),M(st.$$.fragment,t),M(ve.$$.fragment,t),M(Te.$$.fragment,t),M(at.$$.fragment,t),M(rt.$$.fragment,t),M(dt.$$.fragment,t),M(we.$$.fragment,t),M(Me.$$.fragment,t),M(Be.$$.fragment,t),Xo=!1},d(t){o(d),t&&o(y),t&&o(u),B(r),t&&o(zo),t&&o(A),B(Ee),t&&o(jo),t&&o(le),t&&o(Eo),t&&o(ut),t&&o(Fo),t&&o(mt),t&&o(xo),t&&o(ft),t&&o(Uo),t&&o(P),t&&o(Wo),t&&o(S),t&&o(qo),t&&o(H),B(qe),t&&o(Io),t&&o(gt),t&&o(Zo),t&&o(L),B(Ie),t&&o(No),t&&o(z),B(Ze),B(pe),t&&o(Po),t&&o(O),B(Pe),t&&o(So),t&&o(j),B(Se),B(Ve),t&&o(Ro),t&&o(X),B(Ae),t&&o(Vo),t&&o(I),B(He),B(Ye),B(me),B(fe),t&&o(Ao),t&&o(K),B(Oe),t&&o(Ho),t&&o(Z),B(Xe),B(Ke),B(_e),B(be),t&&o(Lo),t&&o(oe),B(et),t&&o(Qo),t&&o(E),B(tt),B(st),B(ve),B(Te),t&&o(Yo),t&&o(se),B(at),t&&o(Oo),t&&o(C),B(rt),B(dt),B(we),B(Me),B(Be)}}}const ti={local:"biogpt",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.BioGptConfig",title:"BioGptConfig"},{local:"transformers.BioGptTokenizer",title:"BioGptTokenizer"},{local:"transformers.BioGptModel",title:"BioGptModel"},{local:"transformers.BioGptForCausalLM",title:"BioGptForCausalLM"},{local:"transformers.BioGptForTokenClassification",title:"BioGptForTokenClassification"},{local:"transformers.BioGptForSequenceClassification",title:"BioGptForSequenceClassification"}],title:"BioGPT"};function oi(G){return Rr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class di extends Zr{constructor(d){super();Nr(this,d,oi,ei,Pr,{})}}export{di as default,ti as metadata};
