import{S as mc,i as uc,s as fc,e as n,k as p,w as y,t as r,M as gc,c as s,d as t,m as h,a,x as w,h as l,b as c,G as e,g as _,y as T,q as k,o as M,B as $,v as _c,L as nt}from"../../chunks/vendor-hf-doc-builder.js";import{T as Pt}from"../../chunks/Tip-hf-doc-builder.js";import{D as O}from"../../chunks/Docstring-hf-doc-builder.js";import{C as st}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ne}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as tt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as bc}from"../../chunks/PipelineTag-hf-doc-builder.js";function vc(B){let d,v,g,u,b;return u=new st({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJsb29tQ29uZmlnJTJDJTIwQmxvb21Nb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBCbG9vbSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwQmxvb21Db25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwQmxvb21Nb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BloomConfig, BloomModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Bloom configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BloomConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BloomModel(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(){d=n("p"),v=r("Example:"),g=p(),y(u.$$.fragment)},l(i){d=s(i,"P",{});var m=a(d);v=l(m,"Example:"),m.forEach(t),g=h(i),w(u.$$.fragment,i)},m(i,m){_(i,d,m),e(d,v),_(i,g,m),T(u,i,m),b=!0},p:nt,i(i){b||(k(u.$$.fragment,i),b=!0)},o(i){M(u.$$.fragment,i),b=!1},d(i){i&&t(d),i&&t(g),$(u,i)}}}function yc(B){let d,v,g,u,b;return{c(){d=n("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),u=r("Module"),b=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){d=s(i,"P",{});var m=a(d);v=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(m,"CODE",{});var C=a(g);u=l(C,"Module"),C.forEach(t),b=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(i,m){_(i,d,m),e(d,v),e(d,g),e(g,u),e(d,b)},d(i){i&&t(d)}}}function wc(B){let d,v,g,u,b;return u=new st({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBCbG9vbU1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJiaWdzY2llbmNlJTJGYmxvb20tNTYwbSUyMiklMEFtb2RlbCUyMCUzRCUyMEJsb29tTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmJpZ3NjaWVuY2UlMkZibG9vbS01NjBtJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BloomModel
<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;bigscience/bloom-560m&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BloomModel.from_pretrained(<span class="hljs-string">&quot;bigscience/bloom-560m&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"),v=r("Example:"),g=p(),y(u.$$.fragment)},l(i){d=s(i,"P",{});var m=a(d);v=l(m,"Example:"),m.forEach(t),g=h(i),w(u.$$.fragment,i)},m(i,m){_(i,d,m),e(d,v),_(i,g,m),T(u,i,m),b=!0},p:nt,i(i){b||(k(u.$$.fragment,i),b=!0)},o(i){M(u.$$.fragment,i),b=!1},d(i){i&&t(d),i&&t(g),$(u,i)}}}function Tc(B){let d,v,g,u,b;return u=new st({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJsb29tVG9rZW5pemVyRmFzdCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEJsb29tVG9rZW5pemVyRmFzdC5mcm9tX3ByZXRyYWluZWQoJTIyYmlnc2NpZW5jZSUyRmJsb29tJTIyKSUwQXRva2VuaXplciglMjJIZWxsbyUyMHdvcmxkJTIyKSU1QiUyMmlucHV0X2lkcyUyMiU1RCUwQSUwQXRva2VuaXplciglMjIlMjBIZWxsbyUyMHdvcmxkJTIyKSU1QiUyMmlucHV0X2lkcyUyMiU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BloomTokenizerFast

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BloomTokenizerFast.from_pretrained(<span class="hljs-string">&quot;bigscience/bloom&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot;Hello world&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">59414</span>, <span class="hljs-number">8876</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot; Hello world&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">86153</span>, <span class="hljs-number">8876</span>]`}}),{c(){d=n("p"),v=r("be encoded differently whether it is at the beginning of the sentence (without space) or not:"),g=p(),y(u.$$.fragment)},l(i){d=s(i,"P",{});var m=a(d);v=l(m,"be encoded differently whether it is at the beginning of the sentence (without space) or not:"),m.forEach(t),g=h(i),w(u.$$.fragment,i)},m(i,m){_(i,d,m),e(d,v),_(i,g,m),T(u,i,m),b=!0},p:nt,i(i){b||(k(u.$$.fragment,i),b=!0)},o(i){M(u.$$.fragment,i),b=!1},d(i){i&&t(d),i&&t(g),$(u,i)}}}function kc(B){let d,v,g,u,b,i,m,C;return{c(){d=n("p"),v=r("When used with "),g=n("code"),u=r("is_split_into_words=True"),b=r(", this tokenizer needs to be instantiated with "),i=n("code"),m=r("add_prefix_space=True"),C=r(".")},l(se){d=s(se,"P",{});var q=a(d);v=l(q,"When used with "),g=s(q,"CODE",{});var P=a(g);u=l(P,"is_split_into_words=True"),P.forEach(t),b=l(q,", this tokenizer needs to be instantiated with "),i=s(q,"CODE",{});var L=a(i);m=l(L,"add_prefix_space=True"),L.forEach(t),C=l(q,"."),q.forEach(t)},m(se,q){_(se,d,q),e(d,v),e(d,g),e(g,u),e(d,b),e(d,i),e(i,m),e(d,C)},d(se){se&&t(d)}}}function Mc(B){let d,v,g,u,b;return{c(){d=n("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),u=r("Module"),b=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){d=s(i,"P",{});var m=a(d);v=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(m,"CODE",{});var C=a(g);u=l(C,"Module"),C.forEach(t),b=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(i,m){_(i,d,m),e(d,v),e(d,g),e(g,u),e(d,b)},d(i){i&&t(d)}}}function $c(B){let d,v,g,u,b;return u=new st({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEJsb29tRm9yQ2F1c2FsTE0lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJiaWdzY2llbmNlJTJGYmxvb20tNTYwbSUyMiklMEFtb2RlbCUyMCUzRCUyMEJsb29tRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmJpZ3NjaWVuY2UlMkZibG9vbS01NjBtJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBsYWJlbHMlM0RpbnB1dHMlNUIlMjJpbnB1dF9pZHMlMjIlNUQpJTBBbG9zcyUyMCUzRCUyMG91dHB1dHMubG9zcyUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRz",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, BloomForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bigscience/bloom-560m&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BloomForCausalLM.from_pretrained(<span class="hljs-string">&quot;bigscience/bloom-560m&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"),v=r("Example:"),g=p(),y(u.$$.fragment)},l(i){d=s(i,"P",{});var m=a(d);v=l(m,"Example:"),m.forEach(t),g=h(i),w(u.$$.fragment,i)},m(i,m){_(i,d,m),e(d,v),_(i,g,m),T(u,i,m),b=!0},p:nt,i(i){b||(k(u.$$.fragment,i),b=!0)},o(i){M(u.$$.fragment,i),b=!1},d(i){i&&t(d),i&&t(g),$(u,i)}}}function Bc(B){let d,v,g,u,b;return{c(){d=n("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),u=r("Module"),b=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){d=s(i,"P",{});var m=a(d);v=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(m,"CODE",{});var C=a(g);u=l(C,"Module"),C.forEach(t),b=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(i,m){_(i,d,m),e(d,v),e(d,g),e(g,u),e(d,b)},d(i){i&&t(d)}}}function Cc(B){let d,v,g,u,b;return u=new st({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEJsb29tRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmJpZ3NjaWVuY2UlMkZibG9vbS01NjBtJTIyKSUwQW1vZGVsJTIwJTNEJTIwQmxvb21Gb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJiaWdzY2llbmNlJTJGYmxvb20tNTYwbSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWQlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KCkuaXRlbSgpJTBBJTBBJTIzJTIwVG8lMjB0cmFpbiUyMGElMjBtb2RlbCUyMG9uJTIwJTYwbnVtX2xhYmVscyU2MCUyMGNsYXNzZXMlMkMlMjB5b3UlMjBjYW4lMjBwYXNzJTIwJTYwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMlNjAlMjB0byUyMCU2MC5mcm9tX3ByZXRyYWluZWQoLi4uKSU2MCUwQW51bV9sYWJlbHMlMjAlM0QlMjBsZW4obW9kZWwuY29uZmlnLmlkMmxhYmVsKSUwQW1vZGVsJTIwJTNEJTIwQmxvb21Gb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJiaWdzY2llbmNlJTJGYmxvb20tNTYwbSUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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, BloomForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bigscience/bloom-560m&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BloomForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;bigscience/bloom-560m&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 = BloomForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;bigscience/bloom-560m&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"),v=r("Example of single-label classification:"),g=p(),y(u.$$.fragment)},l(i){d=s(i,"P",{});var m=a(d);v=l(m,"Example of single-label classification:"),m.forEach(t),g=h(i),w(u.$$.fragment,i)},m(i,m){_(i,d,m),e(d,v),_(i,g,m),T(u,i,m),b=!0},p:nt,i(i){b||(k(u.$$.fragment,i),b=!0)},o(i){M(u.$$.fragment,i),b=!1},d(i){i&&t(d),i&&t(g),$(u,i)}}}function Ec(B){let d,v,g,u,b;return u=new st({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEJsb29tRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmJpZ3NjaWVuY2UlMkZibG9vbS01NjBtJTIyKSUwQW1vZGVsJTIwJTNEJTIwQmxvb21Gb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJiaWdzY2llbmNlJTJGYmxvb20tNTYwbSUyMiUyQyUyMHByb2JsZW1fdHlwZSUzRCUyMm11bHRpX2xhYmVsX2NsYXNzaWZpY2F0aW9uJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQXByZWRpY3RlZF9jbGFzc19pZHMlMjAlM0QlMjB0b3JjaC5hcmFuZ2UoMCUyQyUyMGxvZ2l0cy5zaGFwZSU1Qi0xJTVEKSU1QnRvcmNoLnNpZ21vaWQobG9naXRzKS5zcXVlZXplKGRpbSUzRDApJTIwJTNFJTIwMC41JTVEJTBBJTBBJTIzJTIwVG8lMjB0cmFpbiUyMGElMjBtb2RlbCUyMG9uJTIwJTYwbnVtX2xhYmVscyU2MCUyMGNsYXNzZXMlMkMlMjB5b3UlMjBjYW4lMjBwYXNzJTIwJTYwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMlNjAlMjB0byUyMCU2MC5mcm9tX3ByZXRyYWluZWQoLi4uKSU2MCUwQW51bV9sYWJlbHMlMjAlM0QlMjBsZW4obW9kZWwuY29uZmlnLmlkMmxhYmVsKSUwQW1vZGVsJTIwJTNEJTIwQmxvb21Gb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJiaWdzY2llbmNlJTJGYmxvb20tNTYwbSUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",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, BloomForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bigscience/bloom-560m&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BloomForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;bigscience/bloom-560m&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 = BloomForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;bigscience/bloom-560m&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"),v=r("Example of multi-label classification:"),g=p(),y(u.$$.fragment)},l(i){d=s(i,"P",{});var m=a(d);v=l(m,"Example of multi-label classification:"),m.forEach(t),g=h(i),w(u.$$.fragment,i)},m(i,m){_(i,d,m),e(d,v),_(i,g,m),T(u,i,m),b=!0},p:nt,i(i){b||(k(u.$$.fragment,i),b=!0)},o(i){M(u.$$.fragment,i),b=!1},d(i){i&&t(d),i&&t(g),$(u,i)}}}function Fc(B){let d,v,g,u,b;return{c(){d=n("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),u=r("Module"),b=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){d=s(i,"P",{});var m=a(d);v=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(m,"CODE",{});var C=a(g);u=l(C,"Module"),C.forEach(t),b=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(i,m){_(i,d,m),e(d,v),e(d,g),e(g,u),e(d,b)},d(i){i&&t(d)}}}function zc(B){let d,v,g,u,b;return u=new st({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBCbG9vbUZvclRva2VuQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmJpZ3NjaWVuY2UlMkZibG9vbS01NjBtJTIyKSUwQW1vZGVsJTIwJTNEJTIwQmxvb21Gb3JUb2tlbkNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJiaWdzY2llbmNlJTJGYmxvb20tNTYwbSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTBBJTIwJTIwJTIwJTIwJTIySHVnZ2luZ0ZhY2UlMjBpcyUyMGElMjBjb21wYW55JTIwYmFzZWQlMjBpbiUyMFBhcmlzJTIwYW5kJTIwTmV3JTIwWW9yayUyMiUyQyUyMGFkZF9zcGVjaWFsX3Rva2VucyUzREZhbHNlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUwQSklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQXByZWRpY3RlZF90b2tlbl9jbGFzc19pZHMlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KC0xKSUwQSUwQSUyMyUyME5vdGUlMjB0aGF0JTIwdG9rZW5zJTIwYXJlJTIwY2xhc3NpZmllZCUyMHJhdGhlciUyMHRoZW4lMjBpbnB1dCUyMHdvcmRzJTIwd2hpY2glMjBtZWFucyUyMHRoYXQlMEElMjMlMjB0aGVyZSUyMG1pZ2h0JTIwYmUlMjBtb3JlJTIwcHJlZGljdGVkJTIwdG9rZW4lMjBjbGFzc2VzJTIwdGhhbiUyMHdvcmRzLiUwQSUyMyUyME11bHRpcGxlJTIwdG9rZW4lMjBjbGFzc2VzJTIwbWlnaHQlMjBhY2NvdW50JTIwZm9yJTIwdGhlJTIwc2FtZSUyMHdvcmQlMEFwcmVkaWN0ZWRfdG9rZW5zX2NsYXNzZXMlMjAlM0QlMjAlNUJtb2RlbC5jb25maWcuaWQybGFiZWwlNUJ0Lml0ZW0oKSU1RCUyMGZvciUyMHQlMjBpbiUyMHByZWRpY3RlZF90b2tlbl9jbGFzc19pZHMlNUIwJTVEJTVEJTBBJTBBbGFiZWxzJTIwJTNEJTIwcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BloomForTokenClassification
<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;bigscience/bloom-560m&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BloomForTokenClassification.from_pretrained(<span class="hljs-string">&quot;bigscience/bloom-560m&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"),v=r("Example:"),g=p(),y(u.$$.fragment)},l(i){d=s(i,"P",{});var m=a(d);v=l(m,"Example:"),m.forEach(t),g=h(i),w(u.$$.fragment,i)},m(i,m){_(i,d,m),e(d,v),_(i,g,m),T(u,i,m),b=!0},p:nt,i(i){b||(k(u.$$.fragment,i),b=!0)},o(i){M(u.$$.fragment,i),b=!1},d(i){i&&t(d),i&&t(g),$(u,i)}}}function Jc(B){let d,v,g,u,b;return{c(){d=n("p"),v=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n("code"),u=r("Module"),b=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){d=s(i,"P",{});var m=a(d);v=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(m,"CODE",{});var C=a(g);u=l(C,"Module"),C.forEach(t),b=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(i,m){_(i,d,m),e(d,v),e(d,g),e(g,u),e(d,b)},d(i){i&&t(d)}}}function jc(B){let d,v,g,u,b,i,m,C,se,q,P,L,Gt,Xe,Ps,Vt,Gs,Vn,we,Vs,Ye,Qs,Rs,Qn,z,Qt,He,Os,Ls,Rt,De,Xs,Ys,Ot,Ke,Hs,Ds,Lt,eo,Ks,ea,Xt,oo,oa,ta,at,to,na,sa,Rn,ae,Te,Yt,no,aa,Ht,ra,On,rt,la,Ln,so,Xn,lt,X,it,ia,da,ao,ca,pa,ro,ha,ma,Yn,dt,ua,Hn,G,Dt,ct,fa,ga,Kt,pt,_a,ba,en,ht,va,ya,on,mt,wa,Dn,ut,Ta,Kn,ke,lo,ka,io,Ma,$a,Ba,co,Ca,po,Ea,Fa,es,ft,za,os,gt,ho,Ja,mo,ja,Ua,ts,re,Me,tn,uo,xa,nn,Ia,ns,A,fo,Wa,le,Na,_t,Za,qa,go,Aa,Sa,Pa,ie,Ga,bt,Va,Qa,vt,Ra,Oa,La,$e,ss,de,Be,sn,_o,Xa,an,Ya,as,J,bo,Ha,rn,Da,Ka,vo,er,yt,or,tr,nr,yo,sr,wo,ar,rr,lr,V,To,ir,ce,dr,wt,cr,pr,ln,hr,mr,ur,Ce,fr,Ee,rs,pe,Fe,dn,ko,gr,cn,_r,ls,E,Mo,br,$o,vr,pn,yr,wr,Tr,hn,kr,Mr,ze,$r,Bo,Br,mn,Cr,Er,Fr,Je,zr,Co,Jr,Tt,jr,Ur,is,he,je,un,Eo,xr,fn,Ir,ds,j,Fo,Wr,gn,Nr,Zr,zo,qr,kt,Ar,Sr,Pr,Jo,Gr,jo,Vr,Qr,Rr,Q,Uo,Or,me,Lr,Mt,Xr,Yr,_n,Hr,Dr,Kr,Ue,el,xe,cs,ue,Ie,bn,xo,ol,vn,tl,ps,F,Io,nl,yn,sl,al,$t,Bt,rl,ll,il,S,dl,wn,cl,pl,Tn,hl,ml,kn,ul,fl,Mn,gl,_l,bl,Wo,vl,Ct,yl,wl,Tl,No,kl,Zo,Ml,$l,Bl,W,qo,Cl,fe,El,Et,Fl,zl,$n,Jl,jl,Ul,We,xl,Ne,Il,Ze,hs,ge,qe,Bn,Ao,Wl,Cn,Nl,ms,U,So,Zl,En,ql,Al,Po,Sl,Ft,Pl,Gl,Vl,Go,Ql,Vo,Rl,Ol,Ll,R,Qo,Xl,_e,Yl,zt,Hl,Dl,Fn,Kl,ei,oi,Ae,ti,Se,us,be,Pe,zn,Ro,ni,Jn,si,fs,x,Oo,ai,ve,ri,jn,li,ii,Un,di,ci,pi,Lo,hi,Jt,mi,ui,fi,Xo,gi,Yo,_i,bi,vi,Y,Ho,yi,ye,wi,jt,Ti,ki,xn,Mi,$i,Bi,Ge,gs;return i=new ne({}),Xe=new ne({}),no=new ne({}),so=new bc({props:{pipeline:"text-generation"}}),uo=new ne({}),fo=new O({props:{name:"class transformers.BloomConfig",anchor:"transformers.BloomConfig",parameters:[{name:"vocab_size",val:" = 250880"},{name:"hidden_size",val:" = 64"},{name:"n_layer",val:" = 2"},{name:"n_head",val:" = 8"},{name:"layer_norm_epsilon",val:" = 1e-05"},{name:"initializer_range",val:" = 0.02"},{name:"use_cache",val:" = True"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"apply_residual_connection_post_layernorm",val:" = False"},{name:"hidden_dropout",val:" = 0.0"},{name:"attention_dropout",val:" = 0.0"},{name:"pretraining_tp",val:" = 1"},{name:"slow_but_exact",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BloomConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 250880) &#x2014;
Vocabulary size of the Bloom model. Defines the maximum number of different tokens that can be represented
by the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.31.0/en/model_doc/bloom#transformers.BloomModel">BloomModel</a>. Check <a href="https://huggingface.co/bigscience/bloom/discussions/120#633d28389addb8530b406c2a" rel="nofollow">this
discussion</a> on how the
<code>vocab_size</code> has been defined.`,name:"vocab_size"},{anchor:"transformers.BloomConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Dimensionality of the embeddings and hidden states.`,name:"hidden_size"},{anchor:"transformers.BloomConfig.n_layer",description:`<strong>n_layer</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"n_layer"},{anchor:"transformers.BloomConfig.n_head",description:`<strong>n_head</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"n_head"},{anchor:"transformers.BloomConfig.layer_norm_epsilon",description:`<strong>layer_norm_epsilon</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon to use in the layer normalization layers.`,name:"layer_norm_epsilon"},{anchor:"transformers.BloomConfig.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.BloomConfig.apply_residual_connection_post_layernorm",description:`<strong>apply_residual_connection_post_layernorm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If enabled, use the layer norm of the hidden states as the residual in the transformer blocks`,name:"apply_residual_connection_post_layernorm"},{anchor:"transformers.BloomConfig.hidden_dropout",description:`<strong>hidden_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Dropout rate of the dropout function on the bias dropout.`,name:"hidden_dropout"},{anchor:"transformers.BloomConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Dropout rate applied to the attention probs`,name:"attention_dropout"},{anchor:"transformers.BloomConfig.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).`,name:"use_cache"},{anchor:"transformers.BloomConfig.pretraining_tp",description:`<strong>pretraining_tp</strong> (<code>int</code>, <em>optional</em>, defaults to <code>1</code>) &#x2014;
Experimental feature. Tensor parallelism rank used during pretraining with Megatron. Please refer to <a href="https://huggingface.co/docs/transformers/parallelism" rel="nofollow">this
document</a> to understand more about it. This value is
necessary to ensure exact reproducibility of the pretraining results. Please refer to <a href="https://github.com/pytorch/pytorch/issues/76232" rel="nofollow">this
issue</a>. Note also that this is enabled only when
<code>slow_but_exact=True</code>.`,name:"pretraining_tp"},{anchor:"transformers.BloomConfig.slow_but_exact",description:`<strong>slow_but_exact</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Experimental feature. Whether to use slow but exact implementation of the attention mechanism. While
merging the TP rank tensors, due to slicing operations the results may be slightly different between the
model trained on Megatron and our model. Please refer to <a href="https://github.com/pytorch/pytorch/issues/76232" rel="nofollow">this
issue</a>. A solution to obtain more accurate results is to
enable this feature. Enabling this will hurt the computational time of the inference. Will be probably
resolved in the future once the main model has been fine-tuned with TP_rank=1.`,name:"slow_but_exact"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bloom/configuration_bloom.py#L42"}}),$e=new tt({props:{anchor:"transformers.BloomConfig.example",$$slots:{default:[vc]},$$scope:{ctx:B}}}),_o=new ne({}),bo=new O({props:{name:"class transformers.BloomModel",anchor:"transformers.BloomModel",parameters:[{name:"config",val:": BloomConfig"}],parametersDescription:[{anchor:"transformers.BloomModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bloom#transformers.BloomConfig">BloomConfig</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.31.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.31.0/src/transformers/models/bloom/modeling_bloom.py#L617"}}),To=new O({props:{name:"forward",anchor:"transformers.BloomModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[torch.Tensor, torch.Tensor], ...], NoneType] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"inputs_embeds",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"},{name:"**deprecated_arguments",val:""}],parametersDescription:[{anchor:"transformers.BloomModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else <code>past_key_values[0][0].shape[2]</code>
(<code>sequence_length</code> of input past key value states). Indices of input sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only <code>input_ids</code> that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.BloomModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[torch.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
Contains precomputed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as <code>input_ids</code> as they have already been computed.</p>
<p>Each element of <code>past_key_values</code> is a tuple (past_key, past_value):</p>
<ul>
<li>past_key: [batch_size * num_heads, head_dim, kv_length]</li>
<li>past_value: [batch_size * num_heads, kv_length, head_dim]</li>
</ul>`,name:"past_key_values"},{anchor:"transformers.BloomModel.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.BloomModel.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.BloomModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>inputs_embeds</code> have to be input (see
<code>past_key_values</code>).`,name:"inputs_embeds"},{anchor:"transformers.BloomModel.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.BloomModel.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.BloomModel.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.BloomModel.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.31.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.31.0/src/transformers/models/bloom/modeling_bloom.py#L670",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.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.31.0/en/model_doc/bloom#transformers.BloomConfig"
>BloomConfig</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.31.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ce=new Pt({props:{$$slots:{default:[yc]},$$scope:{ctx:B}}}),Ee=new tt({props:{anchor:"transformers.BloomModel.forward.example",$$slots:{default:[wc]},$$scope:{ctx:B}}}),ko=new ne({}),Mo=new O({props:{name:"class transformers.BloomTokenizerFast",anchor:"transformers.BloomTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"merges_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"unk_token",val:" = '<unk>'"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"pad_token",val:" = '<pad>'"},{name:"add_prefix_space",val:" = False"},{name:"clean_up_tokenization_spaces",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BloomTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.BloomTokenizerFast.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.BloomTokenizerFast.errors",description:`<strong>errors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;replace&quot;</code>) &#x2014;
Paradigm to follow when decoding bytes to UTF-8. See
<a href="https://docs.python.org/3/library/stdtypes.html#bytes.decode" rel="nofollow">bytes.decode</a> for more information.`,name:"errors"},{anchor:"transformers.BloomTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|endoftext|&gt;</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.BloomTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|endoftext|&gt;</code>) &#x2014;
The beginning of sequence token.`,name:"bos_token"},{anchor:"transformers.BloomTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|endoftext|&gt;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.BloomTokenizerFast.add_prefix_space",description:`<strong>add_prefix_space</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add an initial space to the input. This allows to treat the leading word just as any
other word. (Bloom tokenizer detect beginning of words by the preceding space).`,name:"add_prefix_space"},{anchor:"transformers.BloomTokenizerFast.trim_offsets",description:`<strong>trim_offsets</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the post-processing step should trim offsets to avoid including whitespaces.`,name:"trim_offsets"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bloom/tokenization_bloom_fast.py#L49"}}),ze=new tt({props:{anchor:"transformers.BloomTokenizerFast.example",$$slots:{default:[Tc]},$$scope:{ctx:B}}}),Je=new Pt({props:{$$slots:{default:[kc]},$$scope:{ctx:B}}}),Eo=new ne({}),Fo=new O({props:{name:"class transformers.BloomForCausalLM",anchor:"transformers.BloomForCausalLM",parameters:[{name:"config",val:": BloomConfig"}],parametersDescription:[{anchor:"transformers.BloomForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bloom#transformers.BloomConfig">BloomConfig</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.31.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.31.0/src/transformers/models/bloom/modeling_bloom.py#L822"}}),Uo=new O({props:{name:"forward",anchor:"transformers.BloomForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[torch.Tensor, torch.Tensor], ...], NoneType] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"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"},{name:"**deprecated_arguments",val:""}],parametersDescription:[{anchor:"transformers.BloomForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else <code>past_key_values[0][0].shape[2]</code>
(<code>sequence_length</code> of input past key value states). Indices of input sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only <code>input_ids</code> that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.BloomForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[torch.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
Contains precomputed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as <code>input_ids</code> as they have already been computed.</p>
<p>Each element of <code>past_key_values</code> is a tuple (past_key, past_value):</p>
<ul>
<li>past_key: [batch_size * num_heads, head_dim, kv_length]</li>
<li>past_value: [batch_size * num_heads, kv_length, head_dim]</li>
</ul>`,name:"past_key_values"},{anchor:"transformers.BloomForCausalLM.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.BloomForCausalLM.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.BloomForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>inputs_embeds</code> have to be input (see
<code>past_key_values</code>).`,name:"inputs_embeds"},{anchor:"transformers.BloomForCausalLM.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.BloomForCausalLM.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.BloomForCausalLM.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.BloomForCausalLM.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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BloomForCausalLM.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.31.0/src/transformers/models/bloom/modeling_bloom.py#L870",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.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.31.0/en/model_doc/bloom#transformers.BloomConfig"
>BloomConfig</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.31.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ue=new Pt({props:{$$slots:{default:[Mc]},$$scope:{ctx:B}}}),xe=new tt({props:{anchor:"transformers.BloomForCausalLM.forward.example",$$slots:{default:[$c]},$$scope:{ctx:B}}}),xo=new ne({}),Io=new O({props:{name:"class transformers.BloomForSequenceClassification",anchor:"transformers.BloomForSequenceClassification",parameters:[{name:"config",val:": BloomConfig"}],parametersDescription:[{anchor:"transformers.BloomForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bloom#transformers.BloomConfig">BloomConfig</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.31.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.31.0/src/transformers/models/bloom/modeling_bloom.py#L990"}}),qo=new O({props:{name:"forward",anchor:"transformers.BloomForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[torch.Tensor, torch.Tensor], ...], NoneType] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"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"},{name:"**deprecated_arguments",val:""}],parametersDescription:[{anchor:"transformers.BloomForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else <code>past_key_values[0][0].shape[2]</code>
(<code>sequence_length</code> of input past key value states). Indices of input sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only <code>input_ids</code> that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.BloomForSequenceClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[torch.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
Contains precomputed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as <code>input_ids</code> as they have already been computed.</p>
<p>Each element of <code>past_key_values</code> is a tuple (past_key, past_value):</p>
<ul>
<li>past_key: [batch_size * num_heads, head_dim, kv_length]</li>
<li>past_value: [batch_size * num_heads, kv_length, head_dim]</li>
</ul>`,name:"past_key_values"},{anchor:"transformers.BloomForSequenceClassification.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.BloomForSequenceClassification.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.BloomForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>inputs_embeds</code> have to be input (see
<code>past_key_values</code>).`,name:"inputs_embeds"},{anchor:"transformers.BloomForSequenceClassification.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.BloomForSequenceClassification.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.BloomForSequenceClassification.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.BloomForSequenceClassification.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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BloomForSequenceClassification.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.31.0/src/transformers/models/bloom/modeling_bloom.py#L1000",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.31.0/en/model_doc/bloom#transformers.BloomConfig"
>BloomConfig</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 Pt({props:{$$slots:{default:[Bc]},$$scope:{ctx:B}}}),Ne=new tt({props:{anchor:"transformers.BloomForSequenceClassification.forward.example",$$slots:{default:[Cc]},$$scope:{ctx:B}}}),Ze=new tt({props:{anchor:"transformers.BloomForSequenceClassification.forward.example-2",$$slots:{default:[Ec]},$$scope:{ctx:B}}}),Ao=new ne({}),So=new O({props:{name:"class transformers.BloomForTokenClassification",anchor:"transformers.BloomForTokenClassification",parameters:[{name:"config",val:": BloomConfig"}],parametersDescription:[{anchor:"transformers.BloomForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bloom#transformers.BloomConfig">BloomConfig</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.31.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.31.0/src/transformers/models/bloom/modeling_bloom.py#L1116"}}),Qo=new O({props:{name:"forward",anchor:"transformers.BloomForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[torch.Tensor, torch.Tensor], ...], NoneType] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"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"},{name:"**deprecated_arguments",val:""}],parametersDescription:[{anchor:"transformers.BloomForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else <code>past_key_values[0][0].shape[2]</code>
(<code>sequence_length</code> of input past key value states). Indices of input sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only <code>input_ids</code> that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.BloomForTokenClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[torch.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
Contains precomputed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as <code>input_ids</code> as they have already been computed.</p>
<p>Each element of <code>past_key_values</code> is a tuple (past_key, past_value):</p>
<ul>
<li>past_key: [batch_size * num_heads, head_dim, kv_length]</li>
<li>past_value: [batch_size * num_heads, kv_length, head_dim]</li>
</ul>`,name:"past_key_values"},{anchor:"transformers.BloomForTokenClassification.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.BloomForTokenClassification.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.BloomForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>inputs_embeds</code> have to be input (see
<code>past_key_values</code>).`,name:"inputs_embeds"},{anchor:"transformers.BloomForTokenClassification.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.BloomForTokenClassification.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.BloomForTokenClassification.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.BloomForTokenClassification.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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BloomForTokenClassification.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.31.0/src/transformers/models/bloom/modeling_bloom.py#L1134",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.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.31.0/en/model_doc/bloom#transformers.BloomConfig"
>BloomConfig</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.31.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ae=new Pt({props:{$$slots:{default:[Fc]},$$scope:{ctx:B}}}),Se=new tt({props:{anchor:"transformers.BloomForTokenClassification.forward.example",$$slots:{default:[zc]},$$scope:{ctx:B}}}),Ro=new ne({}),Oo=new O({props:{name:"class transformers.BloomForQuestionAnswering",anchor:"transformers.BloomForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BloomForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/bloom#transformers.BloomConfig">BloomConfig</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.31.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.31.0/src/transformers/models/bloom/modeling_bloom.py#L1217"}}),Ho=new O({props:{name:"forward",anchor:"transformers.BloomForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = 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.BloomForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
<code>input_ids_length</code> = <code>sequence_length</code> if <code>past_key_values</code> is <code>None</code> else <code>past_key_values[0][0].shape[2]</code>
(<code>sequence_length</code> of input past key value states). Indices of input sequence tokens in the vocabulary.</p>
<p>If <code>past_key_values</code> is used, only <code>input_ids</code> that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.BloomForQuestionAnswering.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[torch.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
Contains precomputed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as <code>input_ids</code> as they have already been computed.</p>
<p>Each element of <code>past_key_values</code> is a tuple (past_key, past_value):</p>
<ul>
<li>past_key: [batch_size * num_heads, head_dim, kv_length]</li>
<li>past_value: [batch_size * num_heads, kv_length, head_dim]</li>
</ul>`,name:"past_key_values"},{anchor:"transformers.BloomForQuestionAnswering.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.BloomForQuestionAnswering.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.BloomForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>inputs_embeds</code> have to be input (see
<code>past_key_values</code>).`,name:"inputs_embeds"},{anchor:"transformers.BloomForQuestionAnswering.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.BloomForQuestionAnswering.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.BloomForQuestionAnswering.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.BloomForQuestionAnswering.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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BloomForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.BloomForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/bloom/modeling_bloom.py#L1226"}}),Ge=new Pt({props:{$$slots:{default:[Jc]},$$scope:{ctx:B}}}),{c(){d=n("meta"),v=p(),g=n("h1"),u=n("a"),b=n("span"),y(i.$$.fragment),m=p(),C=n("span"),se=r("BLOOM"),q=p(),P=n("h2"),L=n("a"),Gt=n("span"),y(Xe.$$.fragment),Ps=p(),Vt=n("span"),Gs=r("Overview"),Vn=p(),we=n("p"),Vs=r("The BLOOM model has been proposed with its various versions through the "),Ye=n("a"),Qs=r("BigScience Workshop"),Rs=r(`. BigScience is inspired by other open science initiatives where researchers have pooled their time and resources to collectively achieve a higher impact.
The architecture of BLOOM is essentially similar to GPT3 (auto-regressive model for next token prediction), but has been trained on 46 different languages and 13 programming languages.
Several smaller versions of the models have been trained on the same dataset. BLOOM is available in the following versions:`),Qn=p(),z=n("ul"),Qt=n("li"),He=n("a"),Os=r("bloom-560m"),Ls=p(),Rt=n("li"),De=n("a"),Xs=r("bloom-1b1"),Ys=p(),Ot=n("li"),Ke=n("a"),Hs=r("bloom-1b7"),Ds=p(),Lt=n("li"),eo=n("a"),Ks=r("bloom-3b"),ea=p(),Xt=n("li"),oo=n("a"),oa=r("bloom-7b1"),ta=p(),at=n("li"),to=n("a"),na=r("bloom"),sa=r(" (176B parameters)"),Rn=p(),ae=n("h2"),Te=n("a"),Yt=n("span"),y(no.$$.fragment),aa=p(),Ht=n("span"),ra=r("Resources"),On=p(),rt=n("p"),la=r("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with BLOOM. If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),Ln=p(),y(so.$$.fragment),Xn=p(),lt=n("ul"),X=n("li"),it=n("a"),ia=r("BloomForCausalLM"),da=r(" is supported by this "),ao=n("a"),ca=r("causal language modeling example script"),pa=r(" and "),ro=n("a"),ha=r("notebook"),ma=r("."),Yn=p(),dt=n("p"),ua=r("See also:"),Hn=p(),G=n("ul"),Dt=n("li"),ct=n("a"),fa=r("Causal language modeling task guide"),ga=p(),Kt=n("li"),pt=n("a"),_a=r("Text classification task guide"),ba=p(),en=n("li"),ht=n("a"),va=r("Token classification task guide"),ya=p(),on=n("li"),mt=n("a"),wa=r("Question answering task guide"),Dn=p(),ut=n("p"),Ta=r("\u26A1\uFE0F Inference"),Kn=p(),ke=n("ul"),lo=n("li"),ka=r("A blog on "),io=n("a"),Ma=r("Optimization story: Bloom inference"),$a=r("."),Ba=p(),co=n("li"),Ca=r("A blog on "),po=n("a"),Ea=r("Incredibly Fast BLOOM Inference with DeepSpeed and Accelerate"),Fa=r("."),es=p(),ft=n("p"),za=r("\u2699\uFE0F Training"),os=p(),gt=n("ul"),ho=n("li"),Ja=r("A blog on "),mo=n("a"),ja=r("The Technology Behind BLOOM Training"),Ua=r("."),ts=p(),re=n("h2"),Me=n("a"),tn=n("span"),y(uo.$$.fragment),xa=p(),nn=n("span"),Ia=r("BloomConfig"),ns=p(),A=n("div"),y(fo.$$.fragment),Wa=p(),le=n("p"),Na=r("This is the configuration class to store the configuration of a "),_t=n("a"),Za=r("BloomModel"),qa=r(`. It is used to instantiate a Bloom
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to the Bloom architecture
`),go=n("a"),Aa=r("bigscience/bloom"),Sa=r("."),Pa=p(),ie=n("p"),Ga=r("Configuration objects inherit from "),bt=n("a"),Va=r("PretrainedConfig"),Qa=r(` and can be used to control the model outputs. Read the
documentation from `),vt=n("a"),Ra=r("PretrainedConfig"),Oa=r(" for more information."),La=p(),y($e.$$.fragment),ss=p(),de=n("h2"),Be=n("a"),sn=n("span"),y(_o.$$.fragment),Xa=p(),an=n("span"),Ya=r("BloomModel"),as=p(),J=n("div"),y(bo.$$.fragment),Ha=p(),rn=n("p"),Da=r("The bare Bloom Model transformer outputting raw hidden-states without any specific head on top."),Ka=p(),vo=n("p"),er=r("This model inherits from "),yt=n("a"),or=r("PreTrainedModel"),tr=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),nr=p(),yo=n("p"),sr=r("This model is also a PyTorch "),wo=n("a"),ar=r("torch.nn.Module"),rr=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),lr=p(),V=n("div"),y(To.$$.fragment),ir=p(),ce=n("p"),dr=r("The "),wt=n("a"),cr=r("BloomModel"),pr=r(" forward method, overrides the "),ln=n("code"),hr=r("__call__"),mr=r(" special method."),ur=p(),y(Ce.$$.fragment),fr=p(),y(Ee.$$.fragment),rs=p(),pe=n("h2"),Fe=n("a"),dn=n("span"),y(ko.$$.fragment),gr=p(),cn=n("span"),_r=r("BloomTokenizerFast"),ls=p(),E=n("div"),y(Mo.$$.fragment),br=p(),$o=n("p"),vr=r("Construct a \u201Cfast\u201D Bloom tokenizer (backed by HuggingFace\u2019s "),pn=n("em"),yr=r("tokenizers"),wr=r(` library). Based on byte-level
Byte-Pair-Encoding.`),Tr=p(),hn=n("p"),kr=r("This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),Mr=p(),y(ze.$$.fragment),$r=p(),Bo=n("p"),Br=r("You can get around that behavior by passing "),mn=n("code"),Cr=r("add_prefix_space=True"),Er=r(` when instantiating this tokenizer, but since
the model was not pretrained this way, it might yield a decrease in performance.`),Fr=p(),y(Je.$$.fragment),zr=p(),Co=n("p"),Jr=r("This tokenizer inherits from "),Tt=n("a"),jr=r("PreTrainedTokenizerFast"),Ur=r(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),is=p(),he=n("h2"),je=n("a"),un=n("span"),y(Eo.$$.fragment),xr=p(),fn=n("span"),Ir=r("BloomForCausalLM"),ds=p(),j=n("div"),y(Fo.$$.fragment),Wr=p(),gn=n("p"),Nr=r(`The Bloom Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),Zr=p(),zo=n("p"),qr=r("This model inherits from "),kt=n("a"),Ar=r("PreTrainedModel"),Sr=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),Pr=p(),Jo=n("p"),Gr=r("This model is also a PyTorch "),jo=n("a"),Vr=r("torch.nn.Module"),Qr=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Rr=p(),Q=n("div"),y(Uo.$$.fragment),Or=p(),me=n("p"),Lr=r("The "),Mt=n("a"),Xr=r("BloomForCausalLM"),Yr=r(" forward method, overrides the "),_n=n("code"),Hr=r("__call__"),Dr=r(" special method."),Kr=p(),y(Ue.$$.fragment),el=p(),y(xe.$$.fragment),cs=p(),ue=n("h2"),Ie=n("a"),bn=n("span"),y(xo.$$.fragment),ol=p(),vn=n("span"),tl=r("BloomForSequenceClassification"),ps=p(),F=n("div"),y(Io.$$.fragment),nl=p(),yn=n("p"),sl=r("The Bloom Model transformer with a sequence classification head on top (linear layer)."),al=p(),$t=n("p"),Bt=n("a"),rl=r("BloomForSequenceClassification"),ll=r(` uses the last token in order to do the classification, as other causal models
(e.g. GPT-1) do.`),il=p(),S=n("p"),dl=r(`Since it does classification on the last token, it requires to know the position of the last token. If a
`),wn=n("code"),cl=r("pad_token_id"),pl=r(` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),Tn=n("code"),hl=r("pad_token_id"),ml=r(` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),kn=n("code"),ul=r("inputs_embeds"),fl=r(" are passed instead of "),Mn=n("code"),gl=r("input_ids"),_l=r(`, it does the same (take the last value in
each row of the batch).`),bl=p(),Wo=n("p"),vl=r("This model inherits from "),Ct=n("a"),yl=r("PreTrainedModel"),wl=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),Tl=p(),No=n("p"),kl=r("This model is also a PyTorch "),Zo=n("a"),Ml=r("torch.nn.Module"),$l=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Bl=p(),W=n("div"),y(qo.$$.fragment),Cl=p(),fe=n("p"),El=r("The "),Et=n("a"),Fl=r("BloomForSequenceClassification"),zl=r(" forward method, overrides the "),$n=n("code"),Jl=r("__call__"),jl=r(" special method."),Ul=p(),y(We.$$.fragment),xl=p(),y(Ne.$$.fragment),Il=p(),y(Ze.$$.fragment),hs=p(),ge=n("h2"),qe=n("a"),Bn=n("span"),y(Ao.$$.fragment),Wl=p(),Cn=n("span"),Nl=r("BloomForTokenClassification"),ms=p(),U=n("div"),y(So.$$.fragment),Zl=p(),En=n("p"),ql=r(`Bloom 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.`),Al=p(),Po=n("p"),Sl=r("This model inherits from "),Ft=n("a"),Pl=r("PreTrainedModel"),Gl=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),Vl=p(),Go=n("p"),Ql=r("This model is also a PyTorch "),Vo=n("a"),Rl=r("torch.nn.Module"),Ol=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ll=p(),R=n("div"),y(Qo.$$.fragment),Xl=p(),_e=n("p"),Yl=r("The "),zt=n("a"),Hl=r("BloomForTokenClassification"),Dl=r(" forward method, overrides the "),Fn=n("code"),Kl=r("__call__"),ei=r(" special method."),oi=p(),y(Ae.$$.fragment),ti=p(),y(Se.$$.fragment),us=p(),be=n("h2"),Pe=n("a"),zn=n("span"),y(Ro.$$.fragment),ni=p(),Jn=n("span"),si=r("BloomForQuestionAnswering"),fs=p(),x=n("div"),y(Oo.$$.fragment),ai=p(),ve=n("p"),ri=r(`The BLOOM Model transformer with a span classification head on top for extractive question-answering tasks like
SQuAD (a linear layers on top of the hidden-states output to compute `),jn=n("code"),li=r("span start logits"),ii=r(" and "),Un=n("code"),di=r("span end logits"),ci=r(")."),pi=p(),Lo=n("p"),hi=r("This model inherits from "),Jt=n("a"),mi=r("PreTrainedModel"),ui=r(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),fi=p(),Xo=n("p"),gi=r("This model is also a PyTorch "),Yo=n("a"),_i=r("torch.nn.Module"),bi=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),vi=p(),Y=n("div"),y(Ho.$$.fragment),yi=p(),ye=n("p"),wi=r("The "),jt=n("a"),Ti=r("BloomForQuestionAnswering"),ki=r(" forward method, overrides the "),xn=n("code"),Mi=r("__call__"),$i=r(" special method."),Bi=p(),y(Ge.$$.fragment),this.h()},l(o){const f=gc('[data-svelte="svelte-1phssyn"]',document.head);d=s(f,"META",{name:!0,content:!0}),f.forEach(t),v=h(o),g=s(o,"H1",{class:!0});var Do=a(g);u=s(Do,"A",{id:!0,class:!0,href:!0});var In=a(u);b=s(In,"SPAN",{});var Wn=a(b);w(i.$$.fragment,Wn),Wn.forEach(t),In.forEach(t),m=h(Do),C=s(Do,"SPAN",{});var Nn=a(C);se=l(Nn,"BLOOM"),Nn.forEach(t),Do.forEach(t),q=h(o),P=s(o,"H2",{class:!0});var Ko=a(P);L=s(Ko,"A",{id:!0,class:!0,href:!0});var Zn=a(L);Gt=s(Zn,"SPAN",{});var qn=a(Gt);w(Xe.$$.fragment,qn),qn.forEach(t),Zn.forEach(t),Ps=h(Ko),Vt=s(Ko,"SPAN",{});var An=a(Vt);Gs=l(An,"Overview"),An.forEach(t),Ko.forEach(t),Vn=h(o),we=s(o,"P",{});var et=a(we);Vs=l(et,"The BLOOM model has been proposed with its various versions through the "),Ye=s(et,"A",{href:!0,rel:!0});var Sn=a(Ye);Qs=l(Sn,"BigScience Workshop"),Sn.forEach(t),Rs=l(et,`. BigScience is inspired by other open science initiatives where researchers have pooled their time and resources to collectively achieve a higher impact.
The architecture of BLOOM is essentially similar to GPT3 (auto-regressive model for next token prediction), but has been trained on 46 different languages and 13 programming languages.
Several smaller versions of the models have been trained on the same dataset. BLOOM is available in the following versions:`),et.forEach(t),Qn=h(o),z=s(o,"UL",{});var I=a(z);Qt=s(I,"LI",{});var Pn=a(Qt);He=s(Pn,"A",{href:!0,rel:!0});var Gn=a(He);Os=l(Gn,"bloom-560m"),Gn.forEach(t),Pn.forEach(t),Ls=h(I),Rt=s(I,"LI",{});var Fi=a(Rt);De=s(Fi,"A",{href:!0,rel:!0});var zi=a(De);Xs=l(zi,"bloom-1b1"),zi.forEach(t),Fi.forEach(t),Ys=h(I),Ot=s(I,"LI",{});var Ji=a(Ot);Ke=s(Ji,"A",{href:!0,rel:!0});var ji=a(Ke);Hs=l(ji,"bloom-1b7"),ji.forEach(t),Ji.forEach(t),Ds=h(I),Lt=s(I,"LI",{});var Ui=a(Lt);eo=s(Ui,"A",{href:!0,rel:!0});var xi=a(eo);Ks=l(xi,"bloom-3b"),xi.forEach(t),Ui.forEach(t),ea=h(I),Xt=s(I,"LI",{});var Ii=a(Xt);oo=s(Ii,"A",{href:!0,rel:!0});var Wi=a(oo);oa=l(Wi,"bloom-7b1"),Wi.forEach(t),Ii.forEach(t),ta=h(I),at=s(I,"LI",{});var Ci=a(at);to=s(Ci,"A",{href:!0,rel:!0});var Ni=a(to);na=l(Ni,"bloom"),Ni.forEach(t),sa=l(Ci," (176B parameters)"),Ci.forEach(t),I.forEach(t),Rn=h(o),ae=s(o,"H2",{class:!0});var _s=a(ae);Te=s(_s,"A",{id:!0,class:!0,href:!0});var Zi=a(Te);Yt=s(Zi,"SPAN",{});var qi=a(Yt);w(no.$$.fragment,qi),qi.forEach(t),Zi.forEach(t),aa=h(_s),Ht=s(_s,"SPAN",{});var Ai=a(Ht);ra=l(Ai,"Resources"),Ai.forEach(t),_s.forEach(t),On=h(o),rt=s(o,"P",{});var Si=a(rt);la=l(Si,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with BLOOM. If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),Si.forEach(t),Ln=h(o),w(so.$$.fragment,o),Xn=h(o),lt=s(o,"UL",{});var Pi=a(lt);X=s(Pi,"LI",{});var ot=a(X);it=s(ot,"A",{href:!0});var Gi=a(it);ia=l(Gi,"BloomForCausalLM"),Gi.forEach(t),da=l(ot," is supported by this "),ao=s(ot,"A",{href:!0,rel:!0});var Vi=a(ao);ca=l(Vi,"causal language modeling example script"),Vi.forEach(t),pa=l(ot," and "),ro=s(ot,"A",{href:!0,rel:!0});var Qi=a(ro);ha=l(Qi,"notebook"),Qi.forEach(t),ma=l(ot,"."),ot.forEach(t),Pi.forEach(t),Yn=h(o),dt=s(o,"P",{});var Ri=a(dt);ua=l(Ri,"See also:"),Ri.forEach(t),Hn=h(o),G=s(o,"UL",{});var Ve=a(G);Dt=s(Ve,"LI",{});var Oi=a(Dt);ct=s(Oi,"A",{href:!0});var Li=a(ct);fa=l(Li,"Causal language modeling task guide"),Li.forEach(t),Oi.forEach(t),ga=h(Ve),Kt=s(Ve,"LI",{});var Xi=a(Kt);pt=s(Xi,"A",{href:!0});var Yi=a(pt);_a=l(Yi,"Text classification task guide"),Yi.forEach(t),Xi.forEach(t),ba=h(Ve),en=s(Ve,"LI",{});var Hi=a(en);ht=s(Hi,"A",{href:!0});var Di=a(ht);va=l(Di,"Token classification task guide"),Di.forEach(t),Hi.forEach(t),ya=h(Ve),on=s(Ve,"LI",{});var Ki=a(on);mt=s(Ki,"A",{href:!0});var ed=a(mt);wa=l(ed,"Question answering task guide"),ed.forEach(t),Ki.forEach(t),Ve.forEach(t),Dn=h(o),ut=s(o,"P",{});var od=a(ut);Ta=l(od,"\u26A1\uFE0F Inference"),od.forEach(t),Kn=h(o),ke=s(o,"UL",{});var bs=a(ke);lo=s(bs,"LI",{});var vs=a(lo);ka=l(vs,"A blog on "),io=s(vs,"A",{href:!0,rel:!0});var td=a(io);Ma=l(td,"Optimization story: Bloom inference"),td.forEach(t),$a=l(vs,"."),vs.forEach(t),Ba=h(bs),co=s(bs,"LI",{});var ys=a(co);Ca=l(ys,"A blog on "),po=s(ys,"A",{href:!0,rel:!0});var nd=a(po);Ea=l(nd,"Incredibly Fast BLOOM Inference with DeepSpeed and Accelerate"),nd.forEach(t),Fa=l(ys,"."),ys.forEach(t),bs.forEach(t),es=h(o),ft=s(o,"P",{});var sd=a(ft);za=l(sd,"\u2699\uFE0F Training"),sd.forEach(t),os=h(o),gt=s(o,"UL",{});var ad=a(gt);ho=s(ad,"LI",{});var ws=a(ho);Ja=l(ws,"A blog on "),mo=s(ws,"A",{href:!0,rel:!0});var rd=a(mo);ja=l(rd,"The Technology Behind BLOOM Training"),rd.forEach(t),Ua=l(ws,"."),ws.forEach(t),ad.forEach(t),ts=h(o),re=s(o,"H2",{class:!0});var Ts=a(re);Me=s(Ts,"A",{id:!0,class:!0,href:!0});var ld=a(Me);tn=s(ld,"SPAN",{});var id=a(tn);w(uo.$$.fragment,id),id.forEach(t),ld.forEach(t),xa=h(Ts),nn=s(Ts,"SPAN",{});var dd=a(nn);Ia=l(dd,"BloomConfig"),dd.forEach(t),Ts.forEach(t),ns=h(o),A=s(o,"DIV",{class:!0});var Qe=a(A);w(fo.$$.fragment,Qe),Wa=h(Qe),le=s(Qe,"P",{});var Ut=a(le);Na=l(Ut,"This is the configuration class to store the configuration of a "),_t=s(Ut,"A",{href:!0});var cd=a(_t);Za=l(cd,"BloomModel"),cd.forEach(t),qa=l(Ut,`. It is used to instantiate a Bloom
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to the Bloom architecture
`),go=s(Ut,"A",{href:!0,rel:!0});var pd=a(go);Aa=l(pd,"bigscience/bloom"),pd.forEach(t),Sa=l(Ut,"."),Ut.forEach(t),Pa=h(Qe),ie=s(Qe,"P",{});var xt=a(ie);Ga=l(xt,"Configuration objects inherit from "),bt=s(xt,"A",{href:!0});var hd=a(bt);Va=l(hd,"PretrainedConfig"),hd.forEach(t),Qa=l(xt,` and can be used to control the model outputs. Read the
documentation from `),vt=s(xt,"A",{href:!0});var md=a(vt);Ra=l(md,"PretrainedConfig"),md.forEach(t),Oa=l(xt," for more information."),xt.forEach(t),La=h(Qe),w($e.$$.fragment,Qe),Qe.forEach(t),ss=h(o),de=s(o,"H2",{class:!0});var ks=a(de);Be=s(ks,"A",{id:!0,class:!0,href:!0});var ud=a(Be);sn=s(ud,"SPAN",{});var fd=a(sn);w(_o.$$.fragment,fd),fd.forEach(t),ud.forEach(t),Xa=h(ks),an=s(ks,"SPAN",{});var gd=a(an);Ya=l(gd,"BloomModel"),gd.forEach(t),ks.forEach(t),as=h(o),J=s(o,"DIV",{class:!0});var H=a(J);w(bo.$$.fragment,H),Ha=h(H),rn=s(H,"P",{});var _d=a(rn);Da=l(_d,"The bare Bloom Model transformer outputting raw hidden-states without any specific head on top."),_d.forEach(t),Ka=h(H),vo=s(H,"P",{});var Ms=a(vo);er=l(Ms,"This model inherits from "),yt=s(Ms,"A",{href:!0});var bd=a(yt);or=l(bd,"PreTrainedModel"),bd.forEach(t),tr=l(Ms,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),Ms.forEach(t),nr=h(H),yo=s(H,"P",{});var $s=a(yo);sr=l($s,"This model is also a PyTorch "),wo=s($s,"A",{href:!0,rel:!0});var vd=a(wo);ar=l(vd,"torch.nn.Module"),vd.forEach(t),rr=l($s,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),$s.forEach(t),lr=h(H),V=s(H,"DIV",{class:!0});var Re=a(V);w(To.$$.fragment,Re),ir=h(Re),ce=s(Re,"P",{});var It=a(ce);dr=l(It,"The "),wt=s(It,"A",{href:!0});var yd=a(wt);cr=l(yd,"BloomModel"),yd.forEach(t),pr=l(It," forward method, overrides the "),ln=s(It,"CODE",{});var wd=a(ln);hr=l(wd,"__call__"),wd.forEach(t),mr=l(It," special method."),It.forEach(t),ur=h(Re),w(Ce.$$.fragment,Re),fr=h(Re),w(Ee.$$.fragment,Re),Re.forEach(t),H.forEach(t),rs=h(o),pe=s(o,"H2",{class:!0});var Bs=a(pe);Fe=s(Bs,"A",{id:!0,class:!0,href:!0});var Td=a(Fe);dn=s(Td,"SPAN",{});var kd=a(dn);w(ko.$$.fragment,kd),kd.forEach(t),Td.forEach(t),gr=h(Bs),cn=s(Bs,"SPAN",{});var Md=a(cn);_r=l(Md,"BloomTokenizerFast"),Md.forEach(t),Bs.forEach(t),ls=h(o),E=s(o,"DIV",{class:!0});var N=a(E);w(Mo.$$.fragment,N),br=h(N),$o=s(N,"P",{});var Cs=a($o);vr=l(Cs,"Construct a \u201Cfast\u201D Bloom tokenizer (backed by HuggingFace\u2019s "),pn=s(Cs,"EM",{});var $d=a(pn);yr=l($d,"tokenizers"),$d.forEach(t),wr=l(Cs,` library). Based on byte-level
Byte-Pair-Encoding.`),Cs.forEach(t),Tr=h(N),hn=s(N,"P",{});var Bd=a(hn);kr=l(Bd,"This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),Bd.forEach(t),Mr=h(N),w(ze.$$.fragment,N),$r=h(N),Bo=s(N,"P",{});var Es=a(Bo);Br=l(Es,"You can get around that behavior by passing "),mn=s(Es,"CODE",{});var Cd=a(mn);Cr=l(Cd,"add_prefix_space=True"),Cd.forEach(t),Er=l(Es,` when instantiating this tokenizer, but since
the model was not pretrained this way, it might yield a decrease in performance.`),Es.forEach(t),Fr=h(N),w(Je.$$.fragment,N),zr=h(N),Co=s(N,"P",{});var Fs=a(Co);Jr=l(Fs,"This tokenizer inherits from "),Tt=s(Fs,"A",{href:!0});var Ed=a(Tt);jr=l(Ed,"PreTrainedTokenizerFast"),Ed.forEach(t),Ur=l(Fs,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Fs.forEach(t),N.forEach(t),is=h(o),he=s(o,"H2",{class:!0});var zs=a(he);je=s(zs,"A",{id:!0,class:!0,href:!0});var Fd=a(je);un=s(Fd,"SPAN",{});var zd=a(un);w(Eo.$$.fragment,zd),zd.forEach(t),Fd.forEach(t),xr=h(zs),fn=s(zs,"SPAN",{});var Jd=a(fn);Ir=l(Jd,"BloomForCausalLM"),Jd.forEach(t),zs.forEach(t),ds=h(o),j=s(o,"DIV",{class:!0});var D=a(j);w(Fo.$$.fragment,D),Wr=h(D),gn=s(D,"P",{});var jd=a(gn);Nr=l(jd,`The Bloom Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`),jd.forEach(t),Zr=h(D),zo=s(D,"P",{});var Js=a(zo);qr=l(Js,"This model inherits from "),kt=s(Js,"A",{href:!0});var Ud=a(kt);Ar=l(Ud,"PreTrainedModel"),Ud.forEach(t),Sr=l(Js,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),Js.forEach(t),Pr=h(D),Jo=s(D,"P",{});var js=a(Jo);Gr=l(js,"This model is also a PyTorch "),jo=s(js,"A",{href:!0,rel:!0});var xd=a(jo);Vr=l(xd,"torch.nn.Module"),xd.forEach(t),Qr=l(js,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),js.forEach(t),Rr=h(D),Q=s(D,"DIV",{class:!0});var Oe=a(Q);w(Uo.$$.fragment,Oe),Or=h(Oe),me=s(Oe,"P",{});var Wt=a(me);Lr=l(Wt,"The "),Mt=s(Wt,"A",{href:!0});var Id=a(Mt);Xr=l(Id,"BloomForCausalLM"),Id.forEach(t),Yr=l(Wt," forward method, overrides the "),_n=s(Wt,"CODE",{});var Wd=a(_n);Hr=l(Wd,"__call__"),Wd.forEach(t),Dr=l(Wt," special method."),Wt.forEach(t),Kr=h(Oe),w(Ue.$$.fragment,Oe),el=h(Oe),w(xe.$$.fragment,Oe),Oe.forEach(t),D.forEach(t),cs=h(o),ue=s(o,"H2",{class:!0});var Us=a(ue);Ie=s(Us,"A",{id:!0,class:!0,href:!0});var Nd=a(Ie);bn=s(Nd,"SPAN",{});var Zd=a(bn);w(xo.$$.fragment,Zd),Zd.forEach(t),Nd.forEach(t),ol=h(Us),vn=s(Us,"SPAN",{});var qd=a(vn);tl=l(qd,"BloomForSequenceClassification"),qd.forEach(t),Us.forEach(t),ps=h(o),F=s(o,"DIV",{class:!0});var Z=a(F);w(Io.$$.fragment,Z),nl=h(Z),yn=s(Z,"P",{});var Ad=a(yn);sl=l(Ad,"The Bloom Model transformer with a sequence classification head on top (linear layer)."),Ad.forEach(t),al=h(Z),$t=s(Z,"P",{});var Ei=a($t);Bt=s(Ei,"A",{href:!0});var Sd=a(Bt);rl=l(Sd,"BloomForSequenceClassification"),Sd.forEach(t),ll=l(Ei,` uses the last token in order to do the classification, as other causal models
(e.g. GPT-1) do.`),Ei.forEach(t),il=h(Z),S=s(Z,"P",{});var K=a(S);dl=l(K,`Since it does classification on the last token, it requires to know the position of the last token. If a
`),wn=s(K,"CODE",{});var Pd=a(wn);cl=l(Pd,"pad_token_id"),Pd.forEach(t),pl=l(K,` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),Tn=s(K,"CODE",{});var Gd=a(Tn);hl=l(Gd,"pad_token_id"),Gd.forEach(t),ml=l(K,` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),kn=s(K,"CODE",{});var Vd=a(kn);ul=l(Vd,"inputs_embeds"),Vd.forEach(t),fl=l(K," are passed instead of "),Mn=s(K,"CODE",{});var Qd=a(Mn);gl=l(Qd,"input_ids"),Qd.forEach(t),_l=l(K,`, it does the same (take the last value in
each row of the batch).`),K.forEach(t),bl=h(Z),Wo=s(Z,"P",{});var xs=a(Wo);vl=l(xs,"This model inherits from "),Ct=s(xs,"A",{href:!0});var Rd=a(Ct);yl=l(Rd,"PreTrainedModel"),Rd.forEach(t),wl=l(xs,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),xs.forEach(t),Tl=h(Z),No=s(Z,"P",{});var Is=a(No);kl=l(Is,"This model is also a PyTorch "),Zo=s(Is,"A",{href:!0,rel:!0});var Od=a(Zo);Ml=l(Od,"torch.nn.Module"),Od.forEach(t),$l=l(Is,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Is.forEach(t),Bl=h(Z),W=s(Z,"DIV",{class:!0});var ee=a(W);w(qo.$$.fragment,ee),Cl=h(ee),fe=s(ee,"P",{});var Nt=a(fe);El=l(Nt,"The "),Et=s(Nt,"A",{href:!0});var Ld=a(Et);Fl=l(Ld,"BloomForSequenceClassification"),Ld.forEach(t),zl=l(Nt," forward method, overrides the "),$n=s(Nt,"CODE",{});var Xd=a($n);Jl=l(Xd,"__call__"),Xd.forEach(t),jl=l(Nt," special method."),Nt.forEach(t),Ul=h(ee),w(We.$$.fragment,ee),xl=h(ee),w(Ne.$$.fragment,ee),Il=h(ee),w(Ze.$$.fragment,ee),ee.forEach(t),Z.forEach(t),hs=h(o),ge=s(o,"H2",{class:!0});var Ws=a(ge);qe=s(Ws,"A",{id:!0,class:!0,href:!0});var Yd=a(qe);Bn=s(Yd,"SPAN",{});var Hd=a(Bn);w(Ao.$$.fragment,Hd),Hd.forEach(t),Yd.forEach(t),Wl=h(Ws),Cn=s(Ws,"SPAN",{});var Dd=a(Cn);Nl=l(Dd,"BloomForTokenClassification"),Dd.forEach(t),Ws.forEach(t),ms=h(o),U=s(o,"DIV",{class:!0});var oe=a(U);w(So.$$.fragment,oe),Zl=h(oe),En=s(oe,"P",{});var Kd=a(En);ql=l(Kd,`Bloom 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.`),Kd.forEach(t),Al=h(oe),Po=s(oe,"P",{});var Ns=a(Po);Sl=l(Ns,"This model inherits from "),Ft=s(Ns,"A",{href:!0});var ec=a(Ft);Pl=l(ec,"PreTrainedModel"),ec.forEach(t),Gl=l(Ns,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),Ns.forEach(t),Vl=h(oe),Go=s(oe,"P",{});var Zs=a(Go);Ql=l(Zs,"This model is also a PyTorch "),Vo=s(Zs,"A",{href:!0,rel:!0});var oc=a(Vo);Rl=l(oc,"torch.nn.Module"),oc.forEach(t),Ol=l(Zs,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Zs.forEach(t),Ll=h(oe),R=s(oe,"DIV",{class:!0});var Le=a(R);w(Qo.$$.fragment,Le),Xl=h(Le),_e=s(Le,"P",{});var Zt=a(_e);Yl=l(Zt,"The "),zt=s(Zt,"A",{href:!0});var tc=a(zt);Hl=l(tc,"BloomForTokenClassification"),tc.forEach(t),Dl=l(Zt," forward method, overrides the "),Fn=s(Zt,"CODE",{});var nc=a(Fn);Kl=l(nc,"__call__"),nc.forEach(t),ei=l(Zt," special method."),Zt.forEach(t),oi=h(Le),w(Ae.$$.fragment,Le),ti=h(Le),w(Se.$$.fragment,Le),Le.forEach(t),oe.forEach(t),us=h(o),be=s(o,"H2",{class:!0});var qs=a(be);Pe=s(qs,"A",{id:!0,class:!0,href:!0});var sc=a(Pe);zn=s(sc,"SPAN",{});var ac=a(zn);w(Ro.$$.fragment,ac),ac.forEach(t),sc.forEach(t),ni=h(qs),Jn=s(qs,"SPAN",{});var rc=a(Jn);si=l(rc,"BloomForQuestionAnswering"),rc.forEach(t),qs.forEach(t),fs=h(o),x=s(o,"DIV",{class:!0});var te=a(x);w(Oo.$$.fragment,te),ai=h(te),ve=s(te,"P",{});var qt=a(ve);ri=l(qt,`The BLOOM Model transformer with a span classification head on top for extractive question-answering tasks like
SQuAD (a linear layers on top of the hidden-states output to compute `),jn=s(qt,"CODE",{});var lc=a(jn);li=l(lc,"span start logits"),lc.forEach(t),ii=l(qt," and "),Un=s(qt,"CODE",{});var ic=a(Un);di=l(ic,"span end logits"),ic.forEach(t),ci=l(qt,")."),qt.forEach(t),pi=h(te),Lo=s(te,"P",{});var As=a(Lo);hi=l(As,"This model inherits from "),Jt=s(As,"A",{href:!0});var dc=a(Jt);mi=l(dc,"PreTrainedModel"),dc.forEach(t),ui=l(As,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings etc.)`),As.forEach(t),fi=h(te),Xo=s(te,"P",{});var Ss=a(Xo);gi=l(Ss,"This model is also a PyTorch "),Yo=s(Ss,"A",{href:!0,rel:!0});var cc=a(Yo);_i=l(cc,"torch.nn.Module"),cc.forEach(t),bi=l(Ss,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ss.forEach(t),vi=h(te),Y=s(te,"DIV",{class:!0});var At=a(Y);w(Ho.$$.fragment,At),yi=h(At),ye=s(At,"P",{});var St=a(ye);wi=l(St,"The "),jt=s(St,"A",{href:!0});var pc=a(jt);Ti=l(pc,"BloomForQuestionAnswering"),pc.forEach(t),ki=l(St," forward method, overrides the "),xn=s(St,"CODE",{});var hc=a(xn);Mi=l(hc,"__call__"),hc.forEach(t),$i=l(St," special method."),St.forEach(t),Bi=h(At),w(Ge.$$.fragment,At),At.forEach(t),te.forEach(t),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(Uc)),c(u,"id","bloom"),c(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(u,"href","#bloom"),c(g,"class","relative group"),c(L,"id","overview"),c(L,"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(L,"href","#overview"),c(P,"class","relative group"),c(Ye,"href","https://bigscience.huggingface.co/"),c(Ye,"rel","nofollow"),c(He,"href","https://huggingface.co/bigscience/bloom-560m"),c(He,"rel","nofollow"),c(De,"href","https://huggingface.co/bigscience/bloom-1b1"),c(De,"rel","nofollow"),c(Ke,"href","https://huggingface.co/bigscience/bloom-1b7"),c(Ke,"rel","nofollow"),c(eo,"href","https://huggingface.co/bigscience/bloom-3b"),c(eo,"rel","nofollow"),c(oo,"href","https://huggingface.co/bigscience/bloom-7b1"),c(oo,"rel","nofollow"),c(to,"href","https://huggingface.co/bigscience/bloom"),c(to,"rel","nofollow"),c(Te,"id","resources"),c(Te,"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(Te,"href","#resources"),c(ae,"class","relative group"),c(it,"href","/docs/transformers/v4.31.0/en/model_doc/bloom#transformers.BloomForCausalLM"),c(ao,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/language-modeling#gpt-2gpt-and-causal-language-modeling"),c(ao,"rel","nofollow"),c(ro,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling.ipynb"),c(ro,"rel","nofollow"),c(ct,"href","../tasks/language_modeling"),c(pt,"href","../tasks/sequence_classification"),c(ht,"href","../tasks/token_classification"),c(mt,"href","../tasks/question_answering"),c(io,"href","https://huggingface.co/blog/bloom-inference-optimization"),c(io,"rel","nofollow"),c(po,"href","https://huggingface.co/blog/bloom-inference-pytorch-scripts"),c(po,"rel","nofollow"),c(mo,"href","https://huggingface.co/blog/bloom-megatron-deepspeed"),c(mo,"rel","nofollow"),c(Me,"id","transformers.BloomConfig"),c(Me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Me,"href","#transformers.BloomConfig"),c(re,"class","relative group"),c(_t,"href","/docs/transformers/v4.31.0/en/model_doc/bloom#transformers.BloomModel"),c(go,"href","https://huggingface.co/bigscience/bloom"),c(go,"rel","nofollow"),c(bt,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(vt,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Be,"id","transformers.BloomModel"),c(Be,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Be,"href","#transformers.BloomModel"),c(de,"class","relative group"),c(yt,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),c(wo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(wo,"rel","nofollow"),c(wt,"href","/docs/transformers/v4.31.0/en/model_doc/bloom#transformers.BloomModel"),c(V,"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(Fe,"id","transformers.BloomTokenizerFast"),c(Fe,"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(Fe,"href","#transformers.BloomTokenizerFast"),c(pe,"class","relative group"),c(Tt,"href","/docs/transformers/v4.31.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),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(je,"id","transformers.BloomForCausalLM"),c(je,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(je,"href","#transformers.BloomForCausalLM"),c(he,"class","relative group"),c(kt,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),c(jo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(jo,"rel","nofollow"),c(Mt,"href","/docs/transformers/v4.31.0/en/model_doc/bloom#transformers.BloomForCausalLM"),c(Q,"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(Ie,"id","transformers.BloomForSequenceClassification"),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","#transformers.BloomForSequenceClassification"),c(ue,"class","relative group"),c(Bt,"href","/docs/transformers/v4.31.0/en/model_doc/bloom#transformers.BloomForSequenceClassification"),c(Ct,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),c(Zo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Zo,"rel","nofollow"),c(Et,"href","/docs/transformers/v4.31.0/en/model_doc/bloom#transformers.BloomForSequenceClassification"),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(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(qe,"id","transformers.BloomForTokenClassification"),c(qe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(qe,"href","#transformers.BloomForTokenClassification"),c(ge,"class","relative group"),c(Ft,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),c(Vo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Vo,"rel","nofollow"),c(zt,"href","/docs/transformers/v4.31.0/en/model_doc/bloom#transformers.BloomForTokenClassification"),c(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(Pe,"id","transformers.BloomForQuestionAnswering"),c(Pe,"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(Pe,"href","#transformers.BloomForQuestionAnswering"),c(be,"class","relative group"),c(Jt,"href","/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel"),c(Yo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Yo,"rel","nofollow"),c(jt,"href","/docs/transformers/v4.31.0/en/model_doc/bloom#transformers.BloomForQuestionAnswering"),c(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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")},m(o,f){e(document.head,d),_(o,v,f),_(o,g,f),e(g,u),e(u,b),T(i,b,null),e(g,m),e(g,C),e(C,se),_(o,q,f),_(o,P,f),e(P,L),e(L,Gt),T(Xe,Gt,null),e(P,Ps),e(P,Vt),e(Vt,Gs),_(o,Vn,f),_(o,we,f),e(we,Vs),e(we,Ye),e(Ye,Qs),e(we,Rs),_(o,Qn,f),_(o,z,f),e(z,Qt),e(Qt,He),e(He,Os),e(z,Ls),e(z,Rt),e(Rt,De),e(De,Xs),e(z,Ys),e(z,Ot),e(Ot,Ke),e(Ke,Hs),e(z,Ds),e(z,Lt),e(Lt,eo),e(eo,Ks),e(z,ea),e(z,Xt),e(Xt,oo),e(oo,oa),e(z,ta),e(z,at),e(at,to),e(to,na),e(at,sa),_(o,Rn,f),_(o,ae,f),e(ae,Te),e(Te,Yt),T(no,Yt,null),e(ae,aa),e(ae,Ht),e(Ht,ra),_(o,On,f),_(o,rt,f),e(rt,la),_(o,Ln,f),T(so,o,f),_(o,Xn,f),_(o,lt,f),e(lt,X),e(X,it),e(it,ia),e(X,da),e(X,ao),e(ao,ca),e(X,pa),e(X,ro),e(ro,ha),e(X,ma),_(o,Yn,f),_(o,dt,f),e(dt,ua),_(o,Hn,f),_(o,G,f),e(G,Dt),e(Dt,ct),e(ct,fa),e(G,ga),e(G,Kt),e(Kt,pt),e(pt,_a),e(G,ba),e(G,en),e(en,ht),e(ht,va),e(G,ya),e(G,on),e(on,mt),e(mt,wa),_(o,Dn,f),_(o,ut,f),e(ut,Ta),_(o,Kn,f),_(o,ke,f),e(ke,lo),e(lo,ka),e(lo,io),e(io,Ma),e(lo,$a),e(ke,Ba),e(ke,co),e(co,Ca),e(co,po),e(po,Ea),e(co,Fa),_(o,es,f),_(o,ft,f),e(ft,za),_(o,os,f),_(o,gt,f),e(gt,ho),e(ho,Ja),e(ho,mo),e(mo,ja),e(ho,Ua),_(o,ts,f),_(o,re,f),e(re,Me),e(Me,tn),T(uo,tn,null),e(re,xa),e(re,nn),e(nn,Ia),_(o,ns,f),_(o,A,f),T(fo,A,null),e(A,Wa),e(A,le),e(le,Na),e(le,_t),e(_t,Za),e(le,qa),e(le,go),e(go,Aa),e(le,Sa),e(A,Pa),e(A,ie),e(ie,Ga),e(ie,bt),e(bt,Va),e(ie,Qa),e(ie,vt),e(vt,Ra),e(ie,Oa),e(A,La),T($e,A,null),_(o,ss,f),_(o,de,f),e(de,Be),e(Be,sn),T(_o,sn,null),e(de,Xa),e(de,an),e(an,Ya),_(o,as,f),_(o,J,f),T(bo,J,null),e(J,Ha),e(J,rn),e(rn,Da),e(J,Ka),e(J,vo),e(vo,er),e(vo,yt),e(yt,or),e(vo,tr),e(J,nr),e(J,yo),e(yo,sr),e(yo,wo),e(wo,ar),e(yo,rr),e(J,lr),e(J,V),T(To,V,null),e(V,ir),e(V,ce),e(ce,dr),e(ce,wt),e(wt,cr),e(ce,pr),e(ce,ln),e(ln,hr),e(ce,mr),e(V,ur),T(Ce,V,null),e(V,fr),T(Ee,V,null),_(o,rs,f),_(o,pe,f),e(pe,Fe),e(Fe,dn),T(ko,dn,null),e(pe,gr),e(pe,cn),e(cn,_r),_(o,ls,f),_(o,E,f),T(Mo,E,null),e(E,br),e(E,$o),e($o,vr),e($o,pn),e(pn,yr),e($o,wr),e(E,Tr),e(E,hn),e(hn,kr),e(E,Mr),T(ze,E,null),e(E,$r),e(E,Bo),e(Bo,Br),e(Bo,mn),e(mn,Cr),e(Bo,Er),e(E,Fr),T(Je,E,null),e(E,zr),e(E,Co),e(Co,Jr),e(Co,Tt),e(Tt,jr),e(Co,Ur),_(o,is,f),_(o,he,f),e(he,je),e(je,un),T(Eo,un,null),e(he,xr),e(he,fn),e(fn,Ir),_(o,ds,f),_(o,j,f),T(Fo,j,null),e(j,Wr),e(j,gn),e(gn,Nr),e(j,Zr),e(j,zo),e(zo,qr),e(zo,kt),e(kt,Ar),e(zo,Sr),e(j,Pr),e(j,Jo),e(Jo,Gr),e(Jo,jo),e(jo,Vr),e(Jo,Qr),e(j,Rr),e(j,Q),T(Uo,Q,null),e(Q,Or),e(Q,me),e(me,Lr),e(me,Mt),e(Mt,Xr),e(me,Yr),e(me,_n),e(_n,Hr),e(me,Dr),e(Q,Kr),T(Ue,Q,null),e(Q,el),T(xe,Q,null),_(o,cs,f),_(o,ue,f),e(ue,Ie),e(Ie,bn),T(xo,bn,null),e(ue,ol),e(ue,vn),e(vn,tl),_(o,ps,f),_(o,F,f),T(Io,F,null),e(F,nl),e(F,yn),e(yn,sl),e(F,al),e(F,$t),e($t,Bt),e(Bt,rl),e($t,ll),e(F,il),e(F,S),e(S,dl),e(S,wn),e(wn,cl),e(S,pl),e(S,Tn),e(Tn,hl),e(S,ml),e(S,kn),e(kn,ul),e(S,fl),e(S,Mn),e(Mn,gl),e(S,_l),e(F,bl),e(F,Wo),e(Wo,vl),e(Wo,Ct),e(Ct,yl),e(Wo,wl),e(F,Tl),e(F,No),e(No,kl),e(No,Zo),e(Zo,Ml),e(No,$l),e(F,Bl),e(F,W),T(qo,W,null),e(W,Cl),e(W,fe),e(fe,El),e(fe,Et),e(Et,Fl),e(fe,zl),e(fe,$n),e($n,Jl),e(fe,jl),e(W,Ul),T(We,W,null),e(W,xl),T(Ne,W,null),e(W,Il),T(Ze,W,null),_(o,hs,f),_(o,ge,f),e(ge,qe),e(qe,Bn),T(Ao,Bn,null),e(ge,Wl),e(ge,Cn),e(Cn,Nl),_(o,ms,f),_(o,U,f),T(So,U,null),e(U,Zl),e(U,En),e(En,ql),e(U,Al),e(U,Po),e(Po,Sl),e(Po,Ft),e(Ft,Pl),e(Po,Gl),e(U,Vl),e(U,Go),e(Go,Ql),e(Go,Vo),e(Vo,Rl),e(Go,Ol),e(U,Ll),e(U,R),T(Qo,R,null),e(R,Xl),e(R,_e),e(_e,Yl),e(_e,zt),e(zt,Hl),e(_e,Dl),e(_e,Fn),e(Fn,Kl),e(_e,ei),e(R,oi),T(Ae,R,null),e(R,ti),T(Se,R,null),_(o,us,f),_(o,be,f),e(be,Pe),e(Pe,zn),T(Ro,zn,null),e(be,ni),e(be,Jn),e(Jn,si),_(o,fs,f),_(o,x,f),T(Oo,x,null),e(x,ai),e(x,ve),e(ve,ri),e(ve,jn),e(jn,li),e(ve,ii),e(ve,Un),e(Un,di),e(ve,ci),e(x,pi),e(x,Lo),e(Lo,hi),e(Lo,Jt),e(Jt,mi),e(Lo,ui),e(x,fi),e(x,Xo),e(Xo,gi),e(Xo,Yo),e(Yo,_i),e(Xo,bi),e(x,vi),e(x,Y),T(Ho,Y,null),e(Y,yi),e(Y,ye),e(ye,wi),e(ye,jt),e(jt,Ti),e(ye,ki),e(ye,xn),e(xn,Mi),e(ye,$i),e(Y,Bi),T(Ge,Y,null),gs=!0},p(o,[f]){const Do={};f&2&&(Do.$$scope={dirty:f,ctx:o}),$e.$set(Do);const In={};f&2&&(In.$$scope={dirty:f,ctx:o}),Ce.$set(In);const Wn={};f&2&&(Wn.$$scope={dirty:f,ctx:o}),Ee.$set(Wn);const Nn={};f&2&&(Nn.$$scope={dirty:f,ctx:o}),ze.$set(Nn);const Ko={};f&2&&(Ko.$$scope={dirty:f,ctx:o}),Je.$set(Ko);const Zn={};f&2&&(Zn.$$scope={dirty:f,ctx:o}),Ue.$set(Zn);const qn={};f&2&&(qn.$$scope={dirty:f,ctx:o}),xe.$set(qn);const An={};f&2&&(An.$$scope={dirty:f,ctx:o}),We.$set(An);const et={};f&2&&(et.$$scope={dirty:f,ctx:o}),Ne.$set(et);const Sn={};f&2&&(Sn.$$scope={dirty:f,ctx:o}),Ze.$set(Sn);const I={};f&2&&(I.$$scope={dirty:f,ctx:o}),Ae.$set(I);const Pn={};f&2&&(Pn.$$scope={dirty:f,ctx:o}),Se.$set(Pn);const Gn={};f&2&&(Gn.$$scope={dirty:f,ctx:o}),Ge.$set(Gn)},i(o){gs||(k(i.$$.fragment,o),k(Xe.$$.fragment,o),k(no.$$.fragment,o),k(so.$$.fragment,o),k(uo.$$.fragment,o),k(fo.$$.fragment,o),k($e.$$.fragment,o),k(_o.$$.fragment,o),k(bo.$$.fragment,o),k(To.$$.fragment,o),k(Ce.$$.fragment,o),k(Ee.$$.fragment,o),k(ko.$$.fragment,o),k(Mo.$$.fragment,o),k(ze.$$.fragment,o),k(Je.$$.fragment,o),k(Eo.$$.fragment,o),k(Fo.$$.fragment,o),k(Uo.$$.fragment,o),k(Ue.$$.fragment,o),k(xe.$$.fragment,o),k(xo.$$.fragment,o),k(Io.$$.fragment,o),k(qo.$$.fragment,o),k(We.$$.fragment,o),k(Ne.$$.fragment,o),k(Ze.$$.fragment,o),k(Ao.$$.fragment,o),k(So.$$.fragment,o),k(Qo.$$.fragment,o),k(Ae.$$.fragment,o),k(Se.$$.fragment,o),k(Ro.$$.fragment,o),k(Oo.$$.fragment,o),k(Ho.$$.fragment,o),k(Ge.$$.fragment,o),gs=!0)},o(o){M(i.$$.fragment,o),M(Xe.$$.fragment,o),M(no.$$.fragment,o),M(so.$$.fragment,o),M(uo.$$.fragment,o),M(fo.$$.fragment,o),M($e.$$.fragment,o),M(_o.$$.fragment,o),M(bo.$$.fragment,o),M(To.$$.fragment,o),M(Ce.$$.fragment,o),M(Ee.$$.fragment,o),M(ko.$$.fragment,o),M(Mo.$$.fragment,o),M(ze.$$.fragment,o),M(Je.$$.fragment,o),M(Eo.$$.fragment,o),M(Fo.$$.fragment,o),M(Uo.$$.fragment,o),M(Ue.$$.fragment,o),M(xe.$$.fragment,o),M(xo.$$.fragment,o),M(Io.$$.fragment,o),M(qo.$$.fragment,o),M(We.$$.fragment,o),M(Ne.$$.fragment,o),M(Ze.$$.fragment,o),M(Ao.$$.fragment,o),M(So.$$.fragment,o),M(Qo.$$.fragment,o),M(Ae.$$.fragment,o),M(Se.$$.fragment,o),M(Ro.$$.fragment,o),M(Oo.$$.fragment,o),M(Ho.$$.fragment,o),M(Ge.$$.fragment,o),gs=!1},d(o){t(d),o&&t(v),o&&t(g),$(i),o&&t(q),o&&t(P),$(Xe),o&&t(Vn),o&&t(we),o&&t(Qn),o&&t(z),o&&t(Rn),o&&t(ae),$(no),o&&t(On),o&&t(rt),o&&t(Ln),$(so,o),o&&t(Xn),o&&t(lt),o&&t(Yn),o&&t(dt),o&&t(Hn),o&&t(G),o&&t(Dn),o&&t(ut),o&&t(Kn),o&&t(ke),o&&t(es),o&&t(ft),o&&t(os),o&&t(gt),o&&t(ts),o&&t(re),$(uo),o&&t(ns),o&&t(A),$(fo),$($e),o&&t(ss),o&&t(de),$(_o),o&&t(as),o&&t(J),$(bo),$(To),$(Ce),$(Ee),o&&t(rs),o&&t(pe),$(ko),o&&t(ls),o&&t(E),$(Mo),$(ze),$(Je),o&&t(is),o&&t(he),$(Eo),o&&t(ds),o&&t(j),$(Fo),$(Uo),$(Ue),$(xe),o&&t(cs),o&&t(ue),$(xo),o&&t(ps),o&&t(F),$(Io),$(qo),$(We),$(Ne),$(Ze),o&&t(hs),o&&t(ge),$(Ao),o&&t(ms),o&&t(U),$(So),$(Qo),$(Ae),$(Se),o&&t(us),o&&t(be),$(Ro),o&&t(fs),o&&t(x),$(Oo),$(Ho),$(Ge)}}}const Uc={local:"bloom",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.BloomConfig",title:"BloomConfig"},{local:"transformers.BloomModel",title:"BloomModel"},{local:"transformers.BloomTokenizerFast",title:"BloomTokenizerFast"},{local:"transformers.BloomForCausalLM",title:"BloomForCausalLM"},{local:"transformers.BloomForSequenceClassification",title:"BloomForSequenceClassification"},{local:"transformers.BloomForTokenClassification",title:"BloomForTokenClassification"},{local:"transformers.BloomForQuestionAnswering",title:"BloomForQuestionAnswering"}],title:"BLOOM"};function xc(B){return _c(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Pc extends mc{constructor(d){super();uc(this,d,xc,jc,fc,{})}}export{Pc as default,Uc as metadata};
