Buckets:
| import{s as gn,o as _n,n as E}from"../chunks/scheduler.31fdf58d.js";import{S as bn,i as kn,e as p,s as r,c as h,h as yn,a as m,d as s,b as a,f as J,j as u,g as f,k as z,l as d,m as i,n as g,t as _,o as b,p as k}from"../chunks/index.2f76fdf0.js";import{T as gt}from"../chunks/Tip.8d349121.js";import{C as Tn}from"../chunks/CopyLLMTxtMenu.ff482081.js";import{D as N}from"../chunks/Docstring.2ffe4171.js";import{C as Ee}from"../chunks/CodeBlock.ab12f8e1.js";import{E as ht}from"../chunks/ExampleCodeBlock.1360320a.js";import{H as R,E as Mn}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.71f274cc.js";function vn(v){let t,y="Example:",l,c,T;return c=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJsZW5kZXJib3RDb25maWclMkMlMjBCbGVuZGVyYm90TW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQmxlbmRlcmJvdCUyMGZhY2Vib29rJTJGYmxlbmRlcmJvdC0zQiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBCbGVuZGVyYm90Q29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMGZhY2Vib29rJTJGYmxlbmRlcmJvdC0zQiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwQmxlbmRlcmJvdE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BlenderbotConfig, BlenderbotModel | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Initializing a Blenderbot facebook/blenderbot-3B style configuration</span> | |
| <span class="hljs-meta">>>> </span>configuration = BlenderbotConfig() | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Initializing a model (with random weights) from the facebook/blenderbot-3B style configuration</span> | |
| <span class="hljs-meta">>>> </span>model = BlenderbotModel(configuration) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Accessing the model configuration</span> | |
| <span class="hljs-meta">>>> </span>configuration = model.config`,wrap:!1}}),{c(){t=p("p"),t.textContent=y,l=r(),h(c.$$.fragment)},l(n){t=m(n,"P",{"data-svelte-h":!0}),u(t)!=="svelte-11lpom8"&&(t.textContent=y),l=a(n),f(c.$$.fragment,n)},m(n,M){i(n,t,M),i(n,l,M),g(c,n,M),T=!0},p:E,i(n){T||(_(c.$$.fragment,n),T=!0)},o(n){b(c.$$.fragment,n),T=!1},d(n){n&&(s(t),s(l)),k(c,n)}}}function wn(v){let t,y="be encoded differently whether it is at the beginning of the sentence (without space) or not:",l,c,T;return c=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJsZW5kZXJib3RUb2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBCbGVuZGVyYm90VG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmJsZW5kZXJib3QtM0IlMjIpJTBBdG9rZW5pemVyLmFkZF9wcmVmaXhfc3BhY2UlMjAlM0QlMjBGYWxzZSUwQXRva2VuaXplciglMjJIZWxsbyUyMHdvcmxkJTIyKSU1QiUyMmlucHV0X2lkcyUyMiU1RCUwQSUwQXRva2VuaXplciglMjIlMjBIZWxsbyUyMHdvcmxkJTIyKSU1QiUyMmlucHV0X2lkcyUyMiU1RA==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BlenderbotTokenizer | |
| <span class="hljs-meta">>>> </span>tokenizer = BlenderbotTokenizer.from_pretrained(<span class="hljs-string">"facebook/blenderbot-3B"</span>) | |
| <span class="hljs-meta">>>> </span>tokenizer.add_prefix_space = <span class="hljs-literal">False</span> | |
| <span class="hljs-meta">>>> </span>tokenizer(<span class="hljs-string">"Hello world"</span>)[<span class="hljs-string">"input_ids"</span>] | |
| [<span class="hljs-number">47</span>, <span class="hljs-number">921</span>, <span class="hljs-number">86</span>, <span class="hljs-number">1085</span>, <span class="hljs-number">2</span>] | |
| <span class="hljs-meta">>>> </span>tokenizer(<span class="hljs-string">" Hello world"</span>)[<span class="hljs-string">"input_ids"</span>] | |
| [<span class="hljs-number">6950</span>, <span class="hljs-number">1085</span>, <span class="hljs-number">2</span>]`,wrap:!1}}),{c(){t=p("p"),t.textContent=y,l=r(),h(c.$$.fragment)},l(n){t=m(n,"P",{"data-svelte-h":!0}),u(t)!=="svelte-12atnao"&&(t.textContent=y),l=a(n),f(c.$$.fragment,n)},m(n,M){i(n,t,M),i(n,l,M),g(c,n,M),T=!0},p:E,i(n){T||(_(c.$$.fragment,n),T=!0)},o(n){b(c.$$.fragment,n),T=!1},d(n){n&&(s(t),s(l)),k(c,n)}}}function $n(v){let t,y="When used with <code>is_split_into_words=True</code>, this tokenizer will add a space before each word (even the first one).";return{c(){t=p("p"),t.innerHTML=y},l(l){t=m(l,"P",{"data-svelte-h":!0}),u(t)!=="svelte-jhmxzm"&&(t.innerHTML=y)},m(l,c){i(l,t,c)},p:E,d(l){l&&s(t)}}}function Bn(v){let t,y="be encoded differently whether it is at the beginning of the sentence (without space) or not:",l,c,T;return c=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJsZW5kZXJib3RUb2tlbml6ZXJGYXN0JTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQmxlbmRlcmJvdFRva2VuaXplckZhc3QuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGYmxlbmRlcmJvdC0zQiUyMiklMEF0b2tlbml6ZXIoJTIySGVsbG8lMjB3b3JsZCUyMiklNUIlMjJpbnB1dF9pZHMlMjIlNUQlMEElMEF0b2tlbml6ZXIoJTIyJTIwSGVsbG8lMjB3b3JsZCUyMiklNUIlMjJpbnB1dF9pZHMlMjIlNUQ=",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BlenderbotTokenizerFast | |
| <span class="hljs-meta">>>> </span>tokenizer = BlenderbotTokenizerFast.from_pretrained(<span class="hljs-string">"facebook/blenderbot-3B"</span>) | |
| <span class="hljs-meta">>>> </span>tokenizer(<span class="hljs-string">"Hello world"</span>)[<span class="hljs-string">"input_ids"</span>] | |
| [<span class="hljs-number">6950</span>, <span class="hljs-number">1085</span>, <span class="hljs-number">2</span>] | |
| <span class="hljs-meta">>>> </span>tokenizer(<span class="hljs-string">" Hello world"</span>)[<span class="hljs-string">"input_ids"</span>] | |
| [<span class="hljs-number">6950</span>, <span class="hljs-number">1085</span>, <span class="hljs-number">2</span>]`,wrap:!1}}),{c(){t=p("p"),t.textContent=y,l=r(),h(c.$$.fragment)},l(n){t=m(n,"P",{"data-svelte-h":!0}),u(t)!=="svelte-12atnao"&&(t.textContent=y),l=a(n),f(c.$$.fragment,n)},m(n,M){i(n,t,M),i(n,l,M),g(c,n,M),T=!0},p:E,i(n){T||(_(c.$$.fragment,n),T=!0)},o(n){b(c.$$.fragment,n),T=!1},d(n){n&&(s(t),s(l)),k(c,n)}}}function xn(v){let t,y="When used with <code>is_split_into_words=True</code>, this tokenizer needs to be instantiated with <code>add_prefix_space=True</code>.";return{c(){t=p("p"),t.innerHTML=y},l(l){t=m(l,"P",{"data-svelte-h":!0}),u(t)!=="svelte-9gg91e"&&(t.innerHTML=y)},m(l,c){i(l,t,c)},p:E,d(l){l&&s(t)}}}function Cn(v){let t,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code> | |
| instance afterwards instead of this since the former takes care of running the pre and post processing steps while | |
| the latter silently ignores them.`;return{c(){t=p("p"),t.innerHTML=y},l(l){t=m(l,"P",{"data-svelte-h":!0}),u(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(l,c){i(l,t,c)},p:E,d(l){l&&s(t)}}}function jn(v){let t,y="Example:",l,c,T;return c=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBCbGVuZGVyYm90TW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEJsZW5kZXJib3RNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZibGVuZGVyYm90LTQwME0tZGlzdGlsbCUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmJsZW5kZXJib3QtNDAwTS1kaXN0aWxsJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJTdHVkaWVzJTIwaGF2ZSUyMGJlZW4lMjBzaG93biUyMHRoYXQlMjBvd25pbmclMjBhJTIwZG9nJTIwaXMlMjBnb29kJTIwZm9yJTIweW91JTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFkZWNvZGVyX2lucHV0X2lkcyUyMCUzRCUyMHRva2VuaXplciglMjJTdHVkaWVzJTIwc2hvdyUyMHRoYXQlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5pbnB1dF9pZHMlMjAlMjAlMjMlMjBCYXRjaCUyMHNpemUlMjAxJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0X2lkcyUzRGlucHV0cy5pbnB1dF9pZHMlMkMlMjBkZWNvZGVyX2lucHV0X2lkcyUzRGRlY29kZXJfaW5wdXRfaWRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BlenderbotModel | |
| <span class="hljs-meta">>>> </span>model = BlenderbotModel.from_pretrained(<span class="hljs-string">"facebook/blenderbot-400M-distill"</span>) | |
| <span class="hljs-meta">>>> </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">"facebook/blenderbot-400M-distill"</span>) | |
| <span class="hljs-meta">>>> </span>inputs = tokenizer(<span class="hljs-string">"Studies have been shown that owning a dog is good for you"</span>, return_tensors=<span class="hljs-string">"pt"</span>) | |
| <span class="hljs-meta">>>> </span>decoder_input_ids = tokenizer(<span class="hljs-string">"Studies show that"</span>, return_tensors=<span class="hljs-string">"pt"</span>).input_ids <span class="hljs-comment"># Batch size 1</span> | |
| <span class="hljs-meta">>>> </span>outputs = model(input_ids=inputs.input_ids, decoder_input_ids=decoder_input_ids) | |
| <span class="hljs-meta">>>> </span>last_hidden_states = outputs.last_hidden_state | |
| <span class="hljs-meta">>>> </span><span class="hljs-built_in">list</span>(last_hidden_states.shape) | |
| [<span class="hljs-number">1</span>, <span class="hljs-number">6</span>, <span class="hljs-number">1280</span>]`,wrap:!1}}),{c(){t=p("p"),t.textContent=y,l=r(),h(c.$$.fragment)},l(n){t=m(n,"P",{"data-svelte-h":!0}),u(t)!=="svelte-11lpom8"&&(t.textContent=y),l=a(n),f(c.$$.fragment,n)},m(n,M){i(n,t,M),i(n,l,M),g(c,n,M),T=!0},p:E,i(n){T||(_(c.$$.fragment,n),T=!0)},o(n){b(c.$$.fragment,n),T=!1},d(n){n&&(s(t),s(l)),k(c,n)}}}function zn(v){let t,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code> | |
| instance afterwards instead of this since the former takes care of running the pre and post processing steps while | |
| the latter silently ignores them.`;return{c(){t=p("p"),t.innerHTML=y},l(l){t=m(l,"P",{"data-svelte-h":!0}),u(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(l,c){i(l,t,c)},p:E,d(l){l&&s(t)}}}function qn(v){let t,y="Example conversation:",l,c,T;return c=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBCbGVuZGVyYm90Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uJTBBJTBBbW5hbWUlMjAlM0QlMjAlMjJmYWNlYm9vayUyRmJsZW5kZXJib3QtNDAwTS1kaXN0aWxsJTIyJTBBbW9kZWwlMjAlM0QlMjBCbGVuZGVyYm90Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZChtbmFtZSklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZChtbmFtZSklMEFVVFRFUkFOQ0UlMjAlM0QlMjAlMjJNeSUyMGZyaWVuZHMlMjBhcmUlMjBjb29sJTIwYnV0JTIwdGhleSUyMGVhdCUyMHRvbyUyMG1hbnklMjBjYXJicy4lMjIlMEFwcmludCglMjJIdW1hbiUzQSUyMCUyMiUyQyUyMFVUVEVSQU5DRSklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCVVRURVJBTkNFJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFyZXBseV9pZHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKmlucHV0cyklMEFwcmludCglMjJCb3QlM0ElMjAlMjIlMkMlMjB0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKHJlcGx5X2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSU1QjAlNUQpJTBBJTBBUkVQTFklMjAlM0QlMjAlMjJJJ20lMjBub3QlMjBzdXJlJTIyJTBBcHJpbnQoJTIySHVtYW4lM0ElMjAlMjIlMkMlMjBSRVBMWSklMEElMEFORVhUX1VUVEVSQU5DRSUyMCUzRCUyMCglMEElMjAlMjAlMjAlMjAlMjJNeSUyMGZyaWVuZHMlMjBhcmUlMjBjb29sJTIwYnV0JTIwdGhleSUyMGVhdCUyMHRvbyUyMG1hbnklMjBjYXJicy4lM0MlMkZzJTNFJTIwJTNDcyUzRVRoYXQncyUyMHVuZm9ydHVuYXRlLiUyMCUyMiUwQSUyMCUyMCUyMCUyMCUyMkFyZSUyMHRoZXklMjB0cnlpbmclMjB0byUyMGxvc2UlMjB3ZWlnaHQlMjBvciUyMGFyZSUyMHRoZXklMjBqdXN0JTIwdHJ5aW5nJTIwdG8lMjBiZSUyMGhlYWx0aGllciUzRiUzQyUyRnMlM0UlMjAlMjIlMEElMjAlMjAlMjAlMjAlMjIlM0NzJTNFJTIwSSdtJTIwbm90JTIwc3VyZS4lMjIlMEEpJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCU1Qk5FWFRfVVRURVJBTkNFJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFuZXh0X3JlcGx5X2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzKSUwQXByaW50KCUyMkJvdCUzQSUyMCUyMiUyQyUyMHRva2VuaXplci5iYXRjaF9kZWNvZGUobmV4dF9yZXBseV9pZHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklNUIwJTVEKQ==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BlenderbotForConditionalGeneration | |
| <span class="hljs-meta">>>> </span>mname = <span class="hljs-string">"facebook/blenderbot-400M-distill"</span> | |
| <span class="hljs-meta">>>> </span>model = BlenderbotForConditionalGeneration.from_pretrained(mname) | |
| <span class="hljs-meta">>>> </span>tokenizer = AutoTokenizer.from_pretrained(mname) | |
| <span class="hljs-meta">>>> </span>UTTERANCE = <span class="hljs-string">"My friends are cool but they eat too many carbs."</span> | |
| <span class="hljs-meta">>>> </span><span class="hljs-built_in">print</span>(<span class="hljs-string">"Human: "</span>, UTTERANCE) | |
| Human: My friends are cool but they eat too many carbs. | |
| <span class="hljs-meta">>>> </span>inputs = tokenizer([UTTERANCE], return_tensors=<span class="hljs-string">"pt"</span>) | |
| <span class="hljs-meta">>>> </span>reply_ids = model.generate(**inputs) | |
| <span class="hljs-meta">>>> </span><span class="hljs-built_in">print</span>(<span class="hljs-string">"Bot: "</span>, tokenizer.batch_decode(reply_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]) | |
| Bot: That<span class="hljs-string">'s unfortunate. Are they trying to lose weight or are they just trying to be healthier? | |
| >>> REPLY = "I'</span>m <span class="hljs-keyword">not</span> sure<span class="hljs-string">" | |
| >>> print("</span>Human: <span class="hljs-string">", REPLY) | |
| Human: I'm not sure | |
| >>> NEXT_UTTERANCE = ( | |
| ... "</span>My friends are cool but they eat too many carbs.</s> <s>That<span class="hljs-string">'s unfortunate. " | |
| ... "Are they trying to lose weight or are they just trying to be healthier?</s> " | |
| ... "<s> I'</span>m <span class="hljs-keyword">not</span> sure.<span class="hljs-string">" | |
| ... ) | |
| >>> inputs = tokenizer([NEXT_UTTERANCE], return_tensors="</span>pt<span class="hljs-string">") | |
| >>> next_reply_ids = model.generate(**inputs) | |
| >>> print("</span>Bot: <span class="hljs-string">", tokenizer.batch_decode(next_reply_ids, skip_special_tokens=True)[0]) | |
| Bot: I see. Well, it's good that they're trying to change their eating habits.</span>`,wrap:!1}}),{c(){t=p("p"),t.textContent=y,l=r(),h(c.$$.fragment)},l(n){t=m(n,"P",{"data-svelte-h":!0}),u(t)!=="svelte-1h939jd"&&(t.textContent=y),l=a(n),f(c.$$.fragment,n)},m(n,M){i(n,t,M),i(n,l,M),g(c,n,M),T=!0},p:E,i(n){T||(_(c.$$.fragment,n),T=!0)},o(n){b(c.$$.fragment,n),T=!1},d(n){n&&(s(t),s(l)),k(c,n)}}}function Fn(v){let t,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code> | |
| instance afterwards instead of this since the former takes care of running the pre and post processing steps while | |
| the latter silently ignores them.`;return{c(){t=p("p"),t.innerHTML=y},l(l){t=m(l,"P",{"data-svelte-h":!0}),u(t)!=="svelte-fincs2"&&(t.innerHTML=y)},m(l,c){i(l,t,c)},p:E,d(l){l&&s(t)}}}function Un(v){let t,y="Example:",l,c,T;return c=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBCbGVuZGVyYm90Rm9yQ2F1c2FsTE0lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmJsZW5kZXJib3QtNDAwTS1kaXN0aWxsJTIyKSUwQW1vZGVsJTIwJTNEJTIwQmxlbmRlcmJvdEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmJsZW5kZXJib3QtNDAwTS1kaXN0aWxsJTIyJTJDJTIwYWRkX2Nyb3NzX2F0dGVudGlvbiUzREZhbHNlKSUwQWFzc2VydCUyMG1vZGVsLmNvbmZpZy5pc19kZWNvZGVyJTJDJTIwZiUyMiU3Qm1vZGVsLl9fY2xhc3NfXyU3RCUyMGhhcyUyMHRvJTIwYmUlMjBjb25maWd1cmVkJTIwYXMlMjBhJTIwZGVjb2Rlci4lMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRzJTBBZXhwZWN0ZWRfc2hhcGUlMjAlM0QlMjAlNUIxJTJDJTIwaW5wdXRzLmlucHV0X2lkcy5zaGFwZSU1Qi0xJTVEJTJDJTIwbW9kZWwuY29uZmlnLnZvY2FiX3NpemUlNUQlMEFsaXN0KGxvZ2l0cy5zaGFwZSklMjAlM0QlM0QlMjBleHBlY3RlZF9zaGFwZQ==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, BlenderbotForCausalLM | |
| <span class="hljs-meta">>>> </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">"facebook/blenderbot-400M-distill"</span>) | |
| <span class="hljs-meta">>>> </span>model = BlenderbotForCausalLM.from_pretrained(<span class="hljs-string">"facebook/blenderbot-400M-distill"</span>, add_cross_attention=<span class="hljs-literal">False</span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">assert</span> model.config.is_decoder, <span class="hljs-string">f"<span class="hljs-subst">{model.__class__}</span> has to be configured as a decoder."</span> | |
| <span class="hljs-meta">>>> </span>inputs = tokenizer(<span class="hljs-string">"Hello, my dog is cute"</span>, return_tensors=<span class="hljs-string">"pt"</span>) | |
| <span class="hljs-meta">>>> </span>outputs = model(**inputs) | |
| <span class="hljs-meta">>>> </span>logits = outputs.logits | |
| <span class="hljs-meta">>>> </span>expected_shape = [<span class="hljs-number">1</span>, inputs.input_ids.shape[-<span class="hljs-number">1</span>], model.config.vocab_size] | |
| <span class="hljs-meta">>>> </span><span class="hljs-built_in">list</span>(logits.shape) == expected_shape | |
| <span class="hljs-literal">True</span>`,wrap:!1}}),{c(){t=p("p"),t.textContent=y,l=r(),h(c.$$.fragment)},l(n){t=m(n,"P",{"data-svelte-h":!0}),u(t)!=="svelte-11lpom8"&&(t.textContent=y),l=a(n),f(c.$$.fragment,n)},m(n,M){i(n,t,M),i(n,l,M),g(c,n,M),T=!0},p:E,i(n){T||(_(c.$$.fragment,n),T=!0)},o(n){b(c.$$.fragment,n),T=!1},d(n){n&&(s(t),s(l)),k(c,n)}}}function Jn(v){let t,y,l,c,T,n="<em>This model was released on 2020-04-28 and added to Hugging Face Transformers on 2020-11-16.</em>",M,de,_t,le,bt,D,Zo='<img alt="PyTorch" src="https://img.shields.io/badge/PyTorch-DE3412?style=flat&logo=pytorch&logoColor=white"/> <img alt="FlashAttention" src="https://img.shields.io/badge/%E2%9A%A1%EF%B8%8E%20FlashAttention-eae0c8?style=flat"/> <img alt="SDPA" src="https://img.shields.io/badge/SDPA-DE3412?style=flat&logo=pytorch&logoColor=white"/>',kt,ce,yt,pe,Wo=`The Blender chatbot model was proposed in <a href="https://huggingface.co/papers/2004.13637" rel="nofollow">Recipes for building an open-domain chatbot</a> Stephen Roller, Emily Dinan, Naman Goyal, Da Ju, Mary Williamson, Yinhan Liu, | |
| Jing Xu, Myle Ott, Kurt Shuster, Eric M. Smith, Y-Lan Boureau, Jason Weston on 30 Apr 2020.`,Tt,me,Io="The abstract of the paper is the following:",Mt,ue,Go=`<em>Building open-domain chatbots is a challenging area for machine learning research. While prior work has shown that | |
| scaling neural models in the number of parameters and the size of the data they are trained on gives improved results, | |
| we show that other ingredients are important for a high-performing chatbot. Good conversation requires a number of | |
| skills that an expert conversationalist blends in a seamless way: providing engaging talking points and listening to | |
| their partners, and displaying knowledge, empathy and personality appropriately, while maintaining a consistent | |
| persona. We show that large scale models can learn these skills when given appropriate training data and choice of | |
| generation strategy. We build variants of these recipes with 90M, 2.7B and 9.4B parameter models, and make our models | |
| and code publicly available. Human evaluations show our best models are superior to existing approaches in multi-turn | |
| dialogue in terms of engagingness and humanness measurements. We then discuss the limitations of this work by analyzing | |
| failure cases of our models.</em>`,vt,he,Ho='This model was contributed by <a href="https://huggingface.co/sshleifer" rel="nofollow">sshleifer</a>. The authors’ code can be found <a href="https://github.com/facebookresearch/ParlAI" rel="nofollow">here</a> .',wt,fe,$t,ge,Vo=`Blenderbot is a model with absolute position embeddings so it’s usually advised to pad the inputs on the right | |
| rather than the left.`,Bt,_e,Lo="An example:",xt,be,Ct,ke,jt,ye,No=`<li>Blenderbot uses a standard <a href="https://huggingface.co/papers/1706.03762" rel="nofollow">seq2seq model transformer</a> based architecture.</li> <li>Available checkpoints can be found in the <a href="https://huggingface.co/models?search=blenderbot" rel="nofollow">model hub</a>.</li> <li>This is the <em>default</em> Blenderbot model class. However, some smaller checkpoints, such as | |
| <code>facebook/blenderbot_small_90M</code>, have a different architecture and consequently should be used with | |
| <a href="blenderbot-small">BlenderbotSmall</a>.</li>`,zt,Te,qt,Me,Ro='<li><a href="../tasks/language_modeling">Causal language modeling task guide</a></li> <li><a href="../tasks/translation">Translation task guide</a></li> <li><a href="../tasks/summarization">Summarization task guide</a></li>',Ft,ve,Ut,q,we,Qt,Xe,Eo=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_33892/en/model_doc/blenderbot#transformers.BlenderbotModel">BlenderbotModel</a>. It is used to instantiate an | |
| Blenderbot model according to the specified arguments, defining the model architecture. Instantiating a | |
| configuration with the defaults will yield a similar configuration to that of the Blenderbot | |
| <a href="https://huggingface.co/facebook/blenderbot-3B" rel="nofollow">facebook/blenderbot-3B</a> architecture.`,Dt,Se,Xo=`Configuration objects inherit from <a href="/docs/transformers/pr_33892/en/main_classes/configuration#transformers.PreTrainedConfig">PreTrainedConfig</a> and can be used to control the model outputs. Read the | |
| documentation from <a href="/docs/transformers/pr_33892/en/main_classes/configuration#transformers.PreTrainedConfig">PreTrainedConfig</a> for more information.`,Yt,Y,Jt,$e,Zt,w,Be,Ot,Pe,So="Constructs a Blenderbot tokenizer, derived from the GPT-2 tokenizer, using byte-level Byte-Pair-Encoding.",Kt,Ae,Po="This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will",eo,O,to,Qe,Ao=`You can get around that behavior by passing <code>add_prefix_space=True</code> when instantiating this tokenizer or when you | |
| call it on some text, but since the model was not pretrained this way, it might yield a decrease in performance.`,oo,K,no,De,Qo=`This tokenizer inherits from <a href="/docs/transformers/pr_33892/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a> which contains most of the main methods. Users should refer to | |
| this superclass for more information regarding those methods.`,so,X,xe,ro,Ye,Do=`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and | |
| adding special tokens. A Blenderbot sequence has the following format:`,ao,Oe,Yo="<li>single sequence: <code>X </s></code></li>",Wt,Ce,It,$,je,io,Ke,Oo=`Construct a “fast” Blenderbot tokenizer (backed by HuggingFace’s <em>tokenizers</em> library), derived from the GPT-2 | |
| tokenizer, using byte-level Byte-Pair-Encoding.`,lo,et,Ko="This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will",co,ee,po,tt,en=`You can get around that behavior by passing <code>add_prefix_space=True</code> when instantiating this tokenizer or when you | |
| call it on some text, but since the model was not pretrained this way, it might yield a decrease in performance.`,mo,te,uo,ot,tn=`This tokenizer inherits from <a href="/docs/transformers/pr_33892/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a> which contains most of the main methods. Users should | |
| refer to this superclass for more information regarding those methods.`,ho,S,ze,fo,nt,on=`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and | |
| adding special tokens. A Blenderbot sequence has the following format:`,go,st,nn="<li>single sequence: <code>X </s></code></li>",Gt,qe,Ht,Fe,sn='See <a href="/docs/transformers/pr_33892/en/model_doc/bart#transformers.BartModel">BartModel</a> for arguments to <em>forward</em> and <em>generate</em>',Vt,C,Ue,_o,rt,rn="The bare Blenderbot Model outputting raw hidden-states without any specific head on top.",bo,at,an=`This model inherits from <a href="/docs/transformers/pr_33892/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the | |
| library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads | |
| etc.)`,ko,it,dn=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. | |
| Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage | |
| and behavior.`,yo,Z,Je,To,dt,ln='The <a href="/docs/transformers/pr_33892/en/model_doc/blenderbot#transformers.BlenderbotModel">BlenderbotModel</a> forward method, overrides the <code>__call__</code> special method.',Mo,oe,vo,ne,Lt,Ze,Nt,We,cn='See <a href="/docs/transformers/pr_33892/en/model_doc/bart#transformers.BartForConditionalGeneration">BartForConditionalGeneration</a> for arguments to <em>forward</em> and <em>generate</em>',Rt,j,Ie,wo,lt,pn="The Blenderbot Model with a language modeling head. Can be used for summarization.",$o,ct,mn=`This model inherits from <a href="/docs/transformers/pr_33892/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the | |
| library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads | |
| etc.)`,Bo,pt,un=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. | |
| Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage | |
| and behavior.`,xo,W,Ge,Co,mt,hn='The <a href="/docs/transformers/pr_33892/en/model_doc/blenderbot#transformers.BlenderbotForConditionalGeneration">BlenderbotForConditionalGeneration</a> forward method, overrides the <code>__call__</code> special method.',jo,se,zo,re,Et,He,Xt,P,Ve,qo,I,Le,Fo,ut,fn='The <a href="/docs/transformers/pr_33892/en/model_doc/blenderbot#transformers.BlenderbotForCausalLM">BlenderbotForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',Uo,ae,Jo,ie,St,Ne,Pt,ft,At;return de=new Tn({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),le=new R({props:{title:"Blenderbot",local:"blenderbot",headingTag:"h1"}}),ce=new R({props:{title:"Overview",local:"overview",headingTag:"h2"}}),fe=new R({props:{title:"Usage tips and example",local:"usage-tips-and-example",headingTag:"h2"}}),be=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJsZW5kZXJib3RUb2tlbml6ZXIlMkMlMjBCbGVuZGVyYm90Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uJTBBJTBBbW5hbWUlMjAlM0QlMjAlMjJmYWNlYm9vayUyRmJsZW5kZXJib3QtNDAwTS1kaXN0aWxsJTIyJTBBbW9kZWwlMjAlM0QlMjBCbGVuZGVyYm90Rm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZChtbmFtZSklMEF0b2tlbml6ZXIlMjAlM0QlMjBCbGVuZGVyYm90VG9rZW5pemVyLmZyb21fcHJldHJhaW5lZChtbmFtZSklMEFVVFRFUkFOQ0UlMjAlM0QlMjAlMjJNeSUyMGZyaWVuZHMlMjBhcmUlMjBjb29sJTIwYnV0JTIwdGhleSUyMGVhdCUyMHRvbyUyMG1hbnklMjBjYXJicy4lMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCVVRURVJBTkNFJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFyZXBseV9pZHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKmlucHV0cyklMEFwcmludCh0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKHJlcGx5X2lkcykp",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BlenderbotTokenizer, BlenderbotForConditionalGeneration | |
| <span class="hljs-meta">>>> </span>mname = <span class="hljs-string">"facebook/blenderbot-400M-distill"</span> | |
| <span class="hljs-meta">>>> </span>model = BlenderbotForConditionalGeneration.from_pretrained(mname) | |
| <span class="hljs-meta">>>> </span>tokenizer = BlenderbotTokenizer.from_pretrained(mname) | |
| <span class="hljs-meta">>>> </span>UTTERANCE = <span class="hljs-string">"My friends are cool but they eat too many carbs."</span> | |
| <span class="hljs-meta">>>> </span>inputs = tokenizer([UTTERANCE], return_tensors=<span class="hljs-string">"pt"</span>) | |
| <span class="hljs-meta">>>> </span>reply_ids = model.generate(**inputs) | |
| <span class="hljs-meta">>>> </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(reply_ids)) | |
| [<span class="hljs-string">"<s> That's unfortunate. Are they trying to lose weight or are they just trying to be healthier?</s>"</span>]`,wrap:!1}}),ke=new R({props:{title:"Implementation Notes",local:"implementation-notes",headingTag:"h2"}}),Te=new R({props:{title:"Resources",local:"resources",headingTag:"h2"}}),ve=new R({props:{title:"BlenderbotConfig",local:"transformers.BlenderbotConfig",headingTag:"h2"}}),we=new N({props:{name:"class transformers.BlenderbotConfig",anchor:"transformers.BlenderbotConfig",parameters:[{name:"vocab_size",val:" = 8008"},{name:"max_position_embeddings",val:" = 128"},{name:"encoder_layers",val:" = 2"},{name:"encoder_ffn_dim",val:" = 10240"},{name:"encoder_attention_heads",val:" = 32"},{name:"decoder_layers",val:" = 24"},{name:"decoder_ffn_dim",val:" = 10240"},{name:"decoder_attention_heads",val:" = 32"},{name:"encoder_layerdrop",val:" = 0.0"},{name:"decoder_layerdrop",val:" = 0.0"},{name:"use_cache",val:" = True"},{name:"is_encoder_decoder",val:" = True"},{name:"activation_function",val:" = 'gelu'"},{name:"d_model",val:" = 2560"},{name:"dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.0"},{name:"activation_dropout",val:" = 0.0"},{name:"init_std",val:" = 0.02"},{name:"decoder_start_token_id",val:" = 1"},{name:"scale_embedding",val:" = False"},{name:"pad_token_id",val:" = 0"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"encoder_no_repeat_ngram_size",val:" = 3"},{name:"forced_eos_token_id",val:" = 2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BlenderbotConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50265) — | |
| Vocabulary size of the Blenderbot model. Defines the number of different tokens that can be represented by | |
| the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/pr_33892/en/model_doc/blenderbot#transformers.BlenderbotModel">BlenderbotModel</a> or <code>TFBlenderbotModel</code>.`,name:"vocab_size"},{anchor:"transformers.BlenderbotConfig.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) — | |
| Dimensionality of the layers and the pooler layer.`,name:"d_model"},{anchor:"transformers.BlenderbotConfig.encoder_layers",description:`<strong>encoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) — | |
| Number of encoder layers.`,name:"encoder_layers"},{anchor:"transformers.BlenderbotConfig.decoder_layers",description:`<strong>decoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) — | |
| Number of decoder layers.`,name:"decoder_layers"},{anchor:"transformers.BlenderbotConfig.encoder_attention_heads",description:`<strong>encoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) — | |
| Number of attention heads for each attention layer in the Transformer encoder.`,name:"encoder_attention_heads"},{anchor:"transformers.BlenderbotConfig.decoder_attention_heads",description:`<strong>decoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) — | |
| Number of attention heads for each attention layer in the Transformer decoder.`,name:"decoder_attention_heads"},{anchor:"transformers.BlenderbotConfig.decoder_ffn_dim",description:`<strong>decoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) — | |
| Dimensionality of the “intermediate” (often named feed-forward) layer in decoder.`,name:"decoder_ffn_dim"},{anchor:"transformers.BlenderbotConfig.encoder_ffn_dim",description:`<strong>encoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) — | |
| Dimensionality of the “intermediate” (often named feed-forward) layer in decoder.`,name:"encoder_ffn_dim"},{anchor:"transformers.BlenderbotConfig.activation_function",description:`<strong>activation_function</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>"gelu"</code>) — | |
| The non-linear activation function (function or string) in the encoder and pooler. If string, <code>"gelu"</code>, | |
| <code>"relu"</code>, <code>"silu"</code> and <code>"gelu_new"</code> are supported.`,name:"activation_function"},{anchor:"transformers.BlenderbotConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) — | |
| The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.BlenderbotConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.BlenderbotConfig.activation_dropout",description:`<strong>activation_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| The dropout ratio for activations inside the fully connected layer.`,name:"activation_dropout"},{anchor:"transformers.BlenderbotConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 128) — | |
| The maximum sequence length that this model might ever be used with. Typically set this to something large | |
| just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.BlenderbotConfig.init_std",description:`<strong>init_std</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) — | |
| The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"init_std"},{anchor:"transformers.BlenderbotConfig.encoder_layerdrop",description:`<strong>encoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| The LayerDrop probability for the encoder. See the [LayerDrop paper](see <a href="https://huggingface.co/papers/1909.11556" rel="nofollow">https://huggingface.co/papers/1909.11556</a>) | |
| for more details.`,name:"encoder_layerdrop"},{anchor:"transformers.BlenderbotConfig.decoder_layerdrop",description:`<strong>decoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| The LayerDrop probability for the decoder. See the [LayerDrop paper](see <a href="https://huggingface.co/papers/1909.11556" rel="nofollow">https://huggingface.co/papers/1909.11556</a>) | |
| for more details.`,name:"decoder_layerdrop"},{anchor:"transformers.BlenderbotConfig.scale_embedding",description:`<strong>scale_embedding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Scale embeddings by diving by sqrt(d_model).`,name:"scale_embedding"},{anchor:"transformers.BlenderbotConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not the model should return the last key/values attentions (not used by all models)`,name:"use_cache"},{anchor:"transformers.BlenderbotConfig.forced_eos_token_id",description:`<strong>forced_eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 2) — | |
| The id of the token to force as the last generated token when <code>max_length</code> is reached. Usually set to | |
| <code>eos_token_id</code>.`,name:"forced_eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/vr_33892/src/transformers/models/blenderbot/configuration_blenderbot.py#L32"}}),Y=new ht({props:{anchor:"transformers.BlenderbotConfig.example",$$slots:{default:[vn]},$$scope:{ctx:v}}}),$e=new R({props:{title:"BlenderbotTokenizer",local:"transformers.BlenderbotTokenizer",headingTag:"h2"}}),Be=new N({props:{name:"class transformers.BlenderbotTokenizer",anchor:"transformers.BlenderbotTokenizer",parameters:[{name:"vocab_file",val:""},{name:"merges_file",val:""},{name:"errors",val:" = 'replace'"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"add_prefix_space",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BlenderbotTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) — | |
| Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.BlenderbotTokenizer.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) — | |
| Path to the merges file.`,name:"merges_file"},{anchor:"transformers.BlenderbotTokenizer.errors",description:`<strong>errors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"replace"</code>) — | |
| 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.BlenderbotTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"<s>"</code>) — | |
| The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.</p> | |
| <div class="course-tip bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400"> | |
| <p>When building a sequence using special tokens, this is not the token that is used for the beginning of | |
| sequence. The token used is the <code>cls_token</code>.</p> | |
| </div>`,name:"bos_token"},{anchor:"transformers.BlenderbotTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"</s>"</code>) — | |
| The end of sequence token.</p> | |
| <div class="course-tip bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400"> | |
| <p>When building a sequence using special tokens, this is not the token that is used for the end of sequence. | |
| The token used is the <code>sep_token</code>.</p> | |
| </div>`,name:"eos_token"},{anchor:"transformers.BlenderbotTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"</s>"</code>) — | |
| The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for | |
| sequence classification or for a text and a question for question answering. It is also used as the last | |
| token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.BlenderbotTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"<s>"</code>) — | |
| The classifier token which is used when doing sequence classification (classification of the whole sequence | |
| instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.BlenderbotTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"<unk>"</code>) — | |
| 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.BlenderbotTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"<pad>"</code>) — | |
| The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.BlenderbotTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"<mask>"</code>) — | |
| The token used for masking values. This is the token used when training this model with masked language | |
| modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.BlenderbotTokenizer.add_prefix_space",description:`<strong>add_prefix_space</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether or not to add an initial space to the input. This allows to treat the leading word just as any | |
| other word. (Blenderbot tokenizer detect beginning of words by the preceding space).`,name:"add_prefix_space"}],source:"https://github.com/huggingface/transformers/blob/vr_33892/src/transformers/models/blenderbot/tokenization_blenderbot.py#L79"}}),O=new ht({props:{anchor:"transformers.BlenderbotTokenizer.example",$$slots:{default:[wn]},$$scope:{ctx:v}}}),K=new gt({props:{$$slots:{default:[$n]},$$scope:{ctx:v}}}),xe=new N({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.BlenderbotTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": list"},{name:"token_ids_1",val:": typing.Optional[list[int]] = None"}],parametersDescription:[{anchor:"transformers.BlenderbotTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>list[int]</code>) — | |
| List of IDs to which the special tokens will be added`,name:"token_ids_0"},{anchor:"transformers.BlenderbotTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>list[int]</code>, <em>optional</em>) — | |
| Will be ignored`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/vr_33892/src/transformers/models/blenderbot/tokenization_blenderbot.py#L393",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>list of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>list[int]</code></p> | |
| `}}),Ce=new R({props:{title:"BlenderbotTokenizerFast",local:"transformers.BlenderbotTokenizerFast",headingTag:"h2"}}),je=new N({props:{name:"class transformers.BlenderbotTokenizerFast",anchor:"transformers.BlenderbotTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"merges_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"errors",val:" = 'replace'"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"add_prefix_space",val:" = False"},{name:"trim_offsets",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BlenderbotTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) — | |
| Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.BlenderbotTokenizerFast.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) — | |
| Path to the merges file.`,name:"merges_file"},{anchor:"transformers.BlenderbotTokenizerFast.errors",description:`<strong>errors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"replace"</code>) — | |
| 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.BlenderbotTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"<s>"</code>) — | |
| The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.</p> | |
| <div class="course-tip bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400"> | |
| <p>When building a sequence using special tokens, this is not the token that is used for the beginning of | |
| sequence. The token used is the <code>cls_token</code>.</p> | |
| </div>`,name:"bos_token"},{anchor:"transformers.BlenderbotTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"</s>"</code>) — | |
| The end of sequence token.</p> | |
| <div class="course-tip bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400"> | |
| <p>When building a sequence using special tokens, this is not the token that is used for the end of sequence. | |
| The token used is the <code>sep_token</code>.</p> | |
| </div>`,name:"eos_token"},{anchor:"transformers.BlenderbotTokenizerFast.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"</s>"</code>) — | |
| The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for | |
| sequence classification or for a text and a question for question answering. It is also used as the last | |
| token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.BlenderbotTokenizerFast.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"<s>"</code>) — | |
| The classifier token which is used when doing sequence classification (classification of the whole sequence | |
| instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.BlenderbotTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"<unk>"</code>) — | |
| 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.BlenderbotTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"<pad>"</code>) — | |
| The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.BlenderbotTokenizerFast.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"<mask>"</code>) — | |
| The token used for masking values. This is the token used when training this model with masked language | |
| modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.BlenderbotTokenizerFast.add_prefix_space",description:`<strong>add_prefix_space</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether or not to add an initial space to the input. This allows to treat the leading word just as any | |
| other word. (Blenderbot tokenizer detect beginning of words by the preceding space).`,name:"add_prefix_space"},{anchor:"transformers.BlenderbotTokenizerFast.trim_offsets",description:`<strong>trim_offsets</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether the post processing step should trim offsets to avoid including whitespaces.`,name:"trim_offsets"}],source:"https://github.com/huggingface/transformers/blob/vr_33892/src/transformers/models/blenderbot/tokenization_blenderbot_fast.py#L38"}}),ee=new ht({props:{anchor:"transformers.BlenderbotTokenizerFast.example",$$slots:{default:[Bn]},$$scope:{ctx:v}}}),te=new gt({props:{$$slots:{default:[xn]},$$scope:{ctx:v}}}),ze=new N({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.BlenderbotTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": list"},{name:"token_ids_1",val:": typing.Optional[list[int]] = None"}],parametersDescription:[{anchor:"transformers.BlenderbotTokenizerFast.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>list[int]</code>) — | |
| List of IDs to which the special tokens will be added`,name:"token_ids_0"},{anchor:"transformers.BlenderbotTokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>list[int]</code>, <em>optional</em>) — | |
| Will be ignored`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/vr_33892/src/transformers/models/blenderbot/tokenization_blenderbot_fast.py#L267",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>list of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>list[int]</code></p> | |
| `}}),qe=new R({props:{title:"BlenderbotModel",local:"transformers.BlenderbotModel",headingTag:"h2"}}),Ue=new N({props:{name:"class transformers.BlenderbotModel",anchor:"transformers.BlenderbotModel",parameters:[{name:"config",val:": BlenderbotConfig"}],parametersDescription:[{anchor:"transformers.BlenderbotModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_33892/en/model_doc/blenderbot#transformers.BlenderbotConfig">BlenderbotConfig</a>) — | |
| 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/pr_33892/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/vr_33892/src/transformers/models/blenderbot/modeling_blenderbot.py#L854"}}),Je=new N({props:{name:"forward",anchor:"transformers.BlenderbotModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"encoder_outputs",val:": typing.Union[tuple, transformers.modeling_outputs.BaseModelOutput, NoneType] = None"},{name:"past_key_values",val:": typing.Optional[transformers.cache_utils.Cache] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = 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:"cache_position",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"transformers.BlenderbotModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) — | |
| Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p> | |
| <p>Indices can be obtained using <a href="/docs/transformers/pr_33892/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_33892/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and | |
| <a href="/docs/transformers/pr_33892/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p> | |
| <p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BlenderbotModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) — | |
| 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.BlenderbotModel.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) — | |
| Indices of decoder input sequence tokens in the vocabulary.</p> | |
| <p>Indices can be obtained using <a href="/docs/transformers/pr_33892/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_33892/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and | |
| <a href="/docs/transformers/pr_33892/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p> | |
| <p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p> | |
| <p>Blenderbot uses the <code>bos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If | |
| <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see | |
| <code>past_key_values</code>).`,name:"decoder_input_ids"},{anchor:"transformers.BlenderbotModel.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) — | |
| Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also | |
| be used by default.`,name:"decoder_attention_mask"},{anchor:"transformers.BlenderbotModel.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>Union[tuple, ~modeling_outputs.BaseModelOutput, NoneType]</code>) — | |
| Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>) | |
| <code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of | |
| hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.BlenderbotModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>~cache_utils.Cache</code>, <em>optional</em>) — | |
| Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention | |
| blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code> | |
| returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p> | |
| <p>Only <a href="/docs/transformers/pr_33892/en/internal/generation_utils#transformers.Cache">Cache</a> instance is allowed as input, see our <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>. | |
| If no <code>past_key_values</code> are passed, <a href="/docs/transformers/pr_33892/en/internal/generation_utils#transformers.DynamicCache">DynamicCache</a> will be initialized by default.</p> | |
| <p>The model will output the same cache format that is fed as input.</p> | |
| <p>If <code>past_key_values</code> are used, the user is expected to input only unprocessed <code>input_ids</code> (those that don’t | |
| have their past key value states given to this model) of shape <code>(batch_size, unprocessed_length)</code> instead of all <code>input_ids</code> | |
| of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.BlenderbotModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) — | |
| Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This | |
| is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the | |
| model’s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BlenderbotModel.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>) — | |
| Optionally, instead of passing <code>decoder_input_ids</code> you can choose to directly pass an embedded | |
| representation. If <code>past_key_values</code> is used, optionally only the last <code>decoder_inputs_embeds</code> have to be | |
| input (see <code>past_key_values</code>). This is useful if you want more control over how to convert | |
| <code>decoder_input_ids</code> indices into associated vectors than the model’s internal embedding lookup matrix.</p> | |
| <p>If <code>decoder_input_ids</code> and <code>decoder_inputs_embeds</code> are both unset, <code>decoder_inputs_embeds</code> takes the value | |
| of <code>inputs_embeds</code>.`,name:"decoder_inputs_embeds"},{anchor:"transformers.BlenderbotModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.BlenderbotModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.BlenderbotModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.BlenderbotModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return a <a href="/docs/transformers/pr_33892/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BlenderbotModel.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.Tensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) — | |
| Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>, | |
| this tensor is not affected by padding. It is used to update the cache in the correct position and to infer | |
| the complete sequence length.`,name:"cache_position"}],source:"https://github.com/huggingface/transformers/blob/vr_33892/src/transformers/models/blenderbot/modeling_blenderbot.py#L893",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <a | |
| href="/docs/transformers/pr_33892/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput" | |
| >transformers.modeling_outputs.Seq2SeqModelOutput</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/pr_33892/en/model_doc/blenderbot#transformers.BlenderbotConfig" | |
| >BlenderbotConfig</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>) — Sequence of hidden-states at the output of the last layer of the decoder 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>EncoderDecoderCache</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — It is a <a | |
| href="/docs/transformers/pr_33892/en/internal/generation_utils#transformers.EncoderDecoderCache" | |
| >EncoderDecoderCache</a> instance. For more details, see our <a | |
| href="https://huggingface.co/docs/transformers/en/kv_cache" | |
| rel="nofollow" | |
| >kv cache guide</a>.</p> | |
| <p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention | |
| blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p> | |
| </li> | |
| <li> | |
| <p><strong>decoder_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>) — 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 decoder at the output of each layer plus the optional initial embedding outputs.</p> | |
| </li> | |
| <li> | |
| <p><strong>decoder_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>) — 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, 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>) — 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’s cross-attention layer, after the attention softmax, used to compute the | |
| weighted average in the cross-attention heads.</p> | |
| </li> | |
| <li> | |
| <p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) — Sequence of hidden-states at the output of the last layer of the encoder of the model.</p> | |
| </li> | |
| <li> | |
| <p><strong>encoder_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>) — 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 encoder at the output of each layer plus the optional initial embedding outputs.</p> | |
| </li> | |
| <li> | |
| <p><strong>encoder_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>) — 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 encoder, after the attention softmax, used to compute the weighted average in the | |
| self-attention heads.</p> | |
| </li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/transformers/pr_33892/en/main_classes/output#transformers.modeling_outputs.Seq2SeqModelOutput" | |
| >transformers.modeling_outputs.Seq2SeqModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p> | |
| `}}),oe=new gt({props:{$$slots:{default:[Cn]},$$scope:{ctx:v}}}),ne=new ht({props:{anchor:"transformers.BlenderbotModel.forward.example",$$slots:{default:[jn]},$$scope:{ctx:v}}}),Ze=new R({props:{title:"BlenderbotForConditionalGeneration",local:"transformers.BlenderbotForConditionalGeneration",headingTag:"h2"}}),Ie=new N({props:{name:"class transformers.BlenderbotForConditionalGeneration",anchor:"transformers.BlenderbotForConditionalGeneration",parameters:[{name:"config",val:": BlenderbotConfig"}],parametersDescription:[{anchor:"transformers.BlenderbotForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_33892/en/model_doc/blenderbot#transformers.BlenderbotConfig">BlenderbotConfig</a>) — | |
| 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/pr_33892/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/vr_33892/src/transformers/models/blenderbot/modeling_blenderbot.py#L1001"}}),Ge=new N({props:{name:"forward",anchor:"transformers.BlenderbotForConditionalGeneration.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"encoder_outputs",val:": typing.Union[tuple, transformers.modeling_outputs.BaseModelOutput, NoneType] = None"},{name:"past_key_values",val:": typing.Optional[transformers.cache_utils.Cache] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"cache_position",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"transformers.BlenderbotForConditionalGeneration.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) — | |
| Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p> | |
| <p>Indices can be obtained using <a href="/docs/transformers/pr_33892/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_33892/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and | |
| <a href="/docs/transformers/pr_33892/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p> | |
| <p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BlenderbotForConditionalGeneration.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) — | |
| 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.BlenderbotForConditionalGeneration.forward.decoder_input_ids",description:`<strong>decoder_input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) — | |
| Indices of decoder input sequence tokens in the vocabulary.</p> | |
| <p>Indices can be obtained using <a href="/docs/transformers/pr_33892/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_33892/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and | |
| <a href="/docs/transformers/pr_33892/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p> | |
| <p><a href="../glossary#decoder-input-ids">What are decoder input IDs?</a></p> | |
| <p>Blenderbot uses the <code>bos_token_id</code> as the starting token for <code>decoder_input_ids</code> generation. If | |
| <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see | |
| <code>past_key_values</code>).`,name:"decoder_input_ids"},{anchor:"transformers.BlenderbotForConditionalGeneration.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_sequence_length)</code>, <em>optional</em>) — | |
| Default behavior: generate a tensor that ignores pad tokens in <code>decoder_input_ids</code>. Causal mask will also | |
| be used by default.`,name:"decoder_attention_mask"},{anchor:"transformers.BlenderbotForConditionalGeneration.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>Union[tuple, ~modeling_outputs.BaseModelOutput, NoneType]</code>) — | |
| Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>) | |
| <code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of | |
| hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.BlenderbotForConditionalGeneration.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>~cache_utils.Cache</code>, <em>optional</em>) — | |
| Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention | |
| blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code> | |
| returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p> | |
| <p>Only <a href="/docs/transformers/pr_33892/en/internal/generation_utils#transformers.Cache">Cache</a> instance is allowed as input, see our <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>. | |
| If no <code>past_key_values</code> are passed, <a href="/docs/transformers/pr_33892/en/internal/generation_utils#transformers.DynamicCache">DynamicCache</a> will be initialized by default.</p> | |
| <p>The model will output the same cache format that is fed as input.</p> | |
| <p>If <code>past_key_values</code> are used, the user is expected to input only unprocessed <code>input_ids</code> (those that don’t | |
| have their past key value states given to this model) of shape <code>(batch_size, unprocessed_length)</code> instead of all <code>input_ids</code> | |
| of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.BlenderbotForConditionalGeneration.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) — | |
| Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This | |
| is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the | |
| model’s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BlenderbotForConditionalGeneration.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, target_sequence_length, hidden_size)</code>, <em>optional</em>) — | |
| Optionally, instead of passing <code>decoder_input_ids</code> you can choose to directly pass an embedded | |
| representation. If <code>past_key_values</code> is used, optionally only the last <code>decoder_inputs_embeds</code> have to be | |
| input (see <code>past_key_values</code>). This is useful if you want more control over how to convert | |
| <code>decoder_input_ids</code> indices into associated vectors than the model’s internal embedding lookup matrix.</p> | |
| <p>If <code>decoder_input_ids</code> and <code>decoder_inputs_embeds</code> are both unset, <code>decoder_inputs_embeds</code> takes the value | |
| of <code>inputs_embeds</code>.`,name:"decoder_inputs_embeds"},{anchor:"transformers.BlenderbotForConditionalGeneration.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) — | |
| Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored | |
| (masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"},{anchor:"transformers.BlenderbotForConditionalGeneration.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.BlenderbotForConditionalGeneration.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.BlenderbotForConditionalGeneration.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.BlenderbotForConditionalGeneration.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return a <a href="/docs/transformers/pr_33892/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BlenderbotForConditionalGeneration.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.Tensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) — | |
| Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>, | |
| this tensor is not affected by padding. It is used to update the cache in the correct position and to infer | |
| the complete sequence length.`,name:"cache_position"}],source:"https://github.com/huggingface/transformers/blob/vr_33892/src/transformers/models/blenderbot/modeling_blenderbot.py#L1050",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <a | |
| href="/docs/transformers/pr_33892/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput" | |
| >transformers.modeling_outputs.Seq2SeqLMOutput</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/pr_33892/en/model_doc/blenderbot#transformers.BlenderbotConfig" | |
| >BlenderbotConfig</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) — Language modeling loss.</p> | |
| </li> | |
| <li> | |
| <p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) — Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p> | |
| </li> | |
| <li> | |
| <p><strong>past_key_values</strong> (<code>EncoderDecoderCache</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — It is a <a | |
| href="/docs/transformers/pr_33892/en/internal/generation_utils#transformers.EncoderDecoderCache" | |
| >EncoderDecoderCache</a> instance. For more details, see our <a | |
| href="https://huggingface.co/docs/transformers/en/kv_cache" | |
| rel="nofollow" | |
| >kv cache guide</a>.</p> | |
| <p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention | |
| blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p> | |
| </li> | |
| <li> | |
| <p><strong>decoder_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>) — 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 decoder at the output of each layer plus the initial embedding outputs.</p> | |
| </li> | |
| <li> | |
| <p><strong>decoder_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>) — 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, 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>) — 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’s cross-attention layer, after the attention softmax, used to compute the | |
| weighted average in the cross-attention heads.</p> | |
| </li> | |
| <li> | |
| <p><strong>encoder_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) — Sequence of hidden-states at the output of the last layer of the encoder of the model.</p> | |
| </li> | |
| <li> | |
| <p><strong>encoder_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>) — 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 encoder at the output of each layer plus the initial embedding outputs.</p> | |
| </li> | |
| <li> | |
| <p><strong>encoder_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>) — 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 encoder, after the attention softmax, used to compute the weighted average in the | |
| self-attention heads.</p> | |
| </li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/transformers/pr_33892/en/main_classes/output#transformers.modeling_outputs.Seq2SeqLMOutput" | |
| >transformers.modeling_outputs.Seq2SeqLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p> | |
| `}}),se=new gt({props:{$$slots:{default:[zn]},$$scope:{ctx:v}}}),re=new ht({props:{anchor:"transformers.BlenderbotForConditionalGeneration.forward.example",$$slots:{default:[qn]},$$scope:{ctx:v}}}),He=new R({props:{title:"BlenderbotForCausalLM",local:"transformers.BlenderbotForCausalLM",headingTag:"h2"}}),Ve=new N({props:{name:"class transformers.BlenderbotForCausalLM",anchor:"transformers.BlenderbotForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_33892/src/transformers/models/blenderbot/modeling_blenderbot.py#L1186"}}),Le=new N({props:{name:"forward",anchor:"transformers.BlenderbotForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Optional[transformers.cache_utils.Cache] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"cache_position",val:": typing.Optional[torch.LongTensor] = None"},{name:"logits_to_keep",val:": typing.Union[int, torch.Tensor] = 0"}],parametersDescription:[{anchor:"transformers.BlenderbotForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) — | |
| Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p> | |
| <p>Indices can be obtained using <a href="/docs/transformers/pr_33892/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_33892/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and | |
| <a href="/docs/transformers/pr_33892/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p> | |
| <p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BlenderbotForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) — | |
| 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.BlenderbotForCausalLM.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) — | |
| Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention | |
| if the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.BlenderbotForCausalLM.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) — | |
| Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in | |
| the cross-attention if the model is configured as a decoder. 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>`,name:"encoder_attention_mask"},{anchor:"transformers.BlenderbotForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>~cache_utils.Cache</code>, <em>optional</em>) — | |
| Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention | |
| blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code> | |
| returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p> | |
| <p>Only <a href="/docs/transformers/pr_33892/en/internal/generation_utils#transformers.Cache">Cache</a> instance is allowed as input, see our <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>. | |
| If no <code>past_key_values</code> are passed, <a href="/docs/transformers/pr_33892/en/internal/generation_utils#transformers.DynamicCache">DynamicCache</a> will be initialized by default.</p> | |
| <p>The model will output the same cache format that is fed as input.</p> | |
| <p>If <code>past_key_values</code> are used, the user is expected to input only unprocessed <code>input_ids</code> (those that don’t | |
| have their past key value states given to this model) of shape <code>(batch_size, unprocessed_length)</code> instead of all <code>input_ids</code> | |
| of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.BlenderbotForCausalLM.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>) — | |
| 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’s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BlenderbotForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) — | |
| Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored | |
| (masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"},{anchor:"transformers.BlenderbotForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.BlenderbotForCausalLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.BlenderbotForCausalLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.BlenderbotForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return a <a href="/docs/transformers/pr_33892/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.BlenderbotForCausalLM.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) — | |
| Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>, | |
| this tensor is not affected by padding. It is used to update the cache in the correct position and to infer | |
| the complete sequence length.`,name:"cache_position"},{anchor:"transformers.BlenderbotForCausalLM.forward.logits_to_keep",description:`<strong>logits_to_keep</strong> (<code>Union[int, torch.Tensor]</code>, defaults to <code>0</code>) — | |
| If an <code>int</code>, compute logits for the last <code>logits_to_keep</code> tokens. If <code>0</code>, calculate logits for all | |
| <code>input_ids</code> (special case). Only last token logits are needed for generation, and calculating them only for that | |
| token can save memory, which becomes pretty significant for long sequences or large vocabulary size. | |
| If a <code>torch.Tensor</code>, must be 1D corresponding to the indices to keep in the sequence length dimension. | |
| This is useful when using packed tensor format (single dimension for batch and sequence length).`,name:"logits_to_keep"}],source:"https://github.com/huggingface/transformers/blob/vr_33892/src/transformers/models/blenderbot/modeling_blenderbot.py#L1212",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <a | |
| href="/docs/transformers/pr_33892/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/pr_33892/en/model_doc/blenderbot#transformers.BlenderbotConfig" | |
| >BlenderbotConfig</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) — 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>) — 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>) — 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>) — 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>) — 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>Cache</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — It is a <a | |
| href="/docs/transformers/pr_33892/en/internal/generation_utils#transformers.Cache" | |
| >Cache</a> instance. For more details, see our <a | |
| href="https://huggingface.co/docs/transformers/en/kv_cache" | |
| rel="nofollow" | |
| >kv cache guide</a>.</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:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/transformers/pr_33892/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions" | |
| >transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p> | |
| `}}),ae=new gt({props:{$$slots:{default:[Fn]},$$scope:{ctx:v}}}),ie=new ht({props:{anchor:"transformers.BlenderbotForCausalLM.forward.example",$$slots:{default:[Un]},$$scope:{ctx:v}}}),Ne=new Mn({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/blenderbot.md"}}),{c(){t=p("meta"),y=r(),l=p("p"),c=r(),T=p("p"),T.innerHTML=n,M=r(),h(de.$$.fragment),_t=r(),h(le.$$.fragment),bt=r(),D=p("div"),D.innerHTML=Zo,kt=r(),h(ce.$$.fragment),yt=r(),pe=p("p"),pe.innerHTML=Wo,Tt=r(),me=p("p"),me.textContent=Io,Mt=r(),ue=p("p"),ue.innerHTML=Go,vt=r(),he=p("p"),he.innerHTML=Ho,wt=r(),h(fe.$$.fragment),$t=r(),ge=p("p"),ge.textContent=Vo,Bt=r(),_e=p("p"),_e.textContent=Lo,xt=r(),h(be.$$.fragment),Ct=r(),h(ke.$$.fragment),jt=r(),ye=p("ul"),ye.innerHTML=No,zt=r(),h(Te.$$.fragment),qt=r(),Me=p("ul"),Me.innerHTML=Ro,Ft=r(),h(ve.$$.fragment),Ut=r(),q=p("div"),h(we.$$.fragment),Qt=r(),Xe=p("p"),Xe.innerHTML=Eo,Dt=r(),Se=p("p"),Se.innerHTML=Xo,Yt=r(),h(Y.$$.fragment),Jt=r(),h($e.$$.fragment),Zt=r(),w=p("div"),h(Be.$$.fragment),Ot=r(),Pe=p("p"),Pe.textContent=So,Kt=r(),Ae=p("p"),Ae.textContent=Po,eo=r(),h(O.$$.fragment),to=r(),Qe=p("p"),Qe.innerHTML=Ao,oo=r(),h(K.$$.fragment),no=r(),De=p("p"),De.innerHTML=Qo,so=r(),X=p("div"),h(xe.$$.fragment),ro=r(),Ye=p("p"),Ye.textContent=Do,ao=r(),Oe=p("ul"),Oe.innerHTML=Yo,Wt=r(),h(Ce.$$.fragment),It=r(),$=p("div"),h(je.$$.fragment),io=r(),Ke=p("p"),Ke.innerHTML=Oo,lo=r(),et=p("p"),et.textContent=Ko,co=r(),h(ee.$$.fragment),po=r(),tt=p("p"),tt.innerHTML=en,mo=r(),h(te.$$.fragment),uo=r(),ot=p("p"),ot.innerHTML=tn,ho=r(),S=p("div"),h(ze.$$.fragment),fo=r(),nt=p("p"),nt.textContent=on,go=r(),st=p("ul"),st.innerHTML=nn,Gt=r(),h(qe.$$.fragment),Ht=r(),Fe=p("p"),Fe.innerHTML=sn,Vt=r(),C=p("div"),h(Ue.$$.fragment),_o=r(),rt=p("p"),rt.textContent=rn,bo=r(),at=p("p"),at.innerHTML=an,ko=r(),it=p("p"),it.innerHTML=dn,yo=r(),Z=p("div"),h(Je.$$.fragment),To=r(),dt=p("p"),dt.innerHTML=ln,Mo=r(),h(oe.$$.fragment),vo=r(),h(ne.$$.fragment),Lt=r(),h(Ze.$$.fragment),Nt=r(),We=p("p"),We.innerHTML=cn,Rt=r(),j=p("div"),h(Ie.$$.fragment),wo=r(),lt=p("p"),lt.textContent=pn,$o=r(),ct=p("p"),ct.innerHTML=mn,Bo=r(),pt=p("p"),pt.innerHTML=un,xo=r(),W=p("div"),h(Ge.$$.fragment),Co=r(),mt=p("p"),mt.innerHTML=hn,jo=r(),h(se.$$.fragment),zo=r(),h(re.$$.fragment),Et=r(),h(He.$$.fragment),Xt=r(),P=p("div"),h(Ve.$$.fragment),qo=r(),I=p("div"),h(Le.$$.fragment),Fo=r(),ut=p("p"),ut.innerHTML=fn,Uo=r(),h(ae.$$.fragment),Jo=r(),h(ie.$$.fragment),St=r(),h(Ne.$$.fragment),Pt=r(),ft=p("p"),this.h()},l(e){const o=yn("svelte-u9bgzb",document.head);t=m(o,"META",{name:!0,content:!0}),o.forEach(s),y=a(e),l=m(e,"P",{}),J(l).forEach(s),c=a(e),T=m(e,"P",{"data-svelte-h":!0}),u(T)!=="svelte-1aysrmb"&&(T.innerHTML=n),M=a(e),f(de.$$.fragment,e),_t=a(e),f(le.$$.fragment,e),bt=a(e),D=m(e,"DIV",{class:!0,"data-svelte-h":!0}),u(D)!=="svelte-b95w5j"&&(D.innerHTML=Zo),kt=a(e),f(ce.$$.fragment,e),yt=a(e),pe=m(e,"P",{"data-svelte-h":!0}),u(pe)!=="svelte-13bjtiw"&&(pe.innerHTML=Wo),Tt=a(e),me=m(e,"P",{"data-svelte-h":!0}),u(me)!=="svelte-wu27l3"&&(me.textContent=Io),Mt=a(e),ue=m(e,"P",{"data-svelte-h":!0}),u(ue)!=="svelte-1t366g8"&&(ue.innerHTML=Go),vt=a(e),he=m(e,"P",{"data-svelte-h":!0}),u(he)!=="svelte-1m719jj"&&(he.innerHTML=Ho),wt=a(e),f(fe.$$.fragment,e),$t=a(e),ge=m(e,"P",{"data-svelte-h":!0}),u(ge)!=="svelte-c524ca"&&(ge.textContent=Vo),Bt=a(e),_e=m(e,"P",{"data-svelte-h":!0}),u(_e)!=="svelte-839ylp"&&(_e.textContent=Lo),xt=a(e),f(be.$$.fragment,e),Ct=a(e),f(ke.$$.fragment,e),jt=a(e),ye=m(e,"UL",{"data-svelte-h":!0}),u(ye)!=="svelte-egkfu8"&&(ye.innerHTML=No),zt=a(e),f(Te.$$.fragment,e),qt=a(e),Me=m(e,"UL",{"data-svelte-h":!0}),u(Me)!=="svelte-jwyjs9"&&(Me.innerHTML=Ro),Ft=a(e),f(ve.$$.fragment,e),Ut=a(e),q=m(e,"DIV",{class:!0});var G=J(q);f(we.$$.fragment,G),Qt=a(G),Xe=m(G,"P",{"data-svelte-h":!0}),u(Xe)!=="svelte-myo27z"&&(Xe.innerHTML=Eo),Dt=a(G),Se=m(G,"P",{"data-svelte-h":!0}),u(Se)!=="svelte-4qb4zf"&&(Se.innerHTML=Xo),Yt=a(G),f(Y.$$.fragment,G),G.forEach(s),Jt=a(e),f($e.$$.fragment,e),Zt=a(e),w=m(e,"DIV",{class:!0});var B=J(w);f(Be.$$.fragment,B),Ot=a(B),Pe=m(B,"P",{"data-svelte-h":!0}),u(Pe)!=="svelte-7wwln4"&&(Pe.textContent=So),Kt=a(B),Ae=m(B,"P",{"data-svelte-h":!0}),u(Ae)!=="svelte-1s077p3"&&(Ae.textContent=Po),eo=a(B),f(O.$$.fragment,B),to=a(B),Qe=m(B,"P",{"data-svelte-h":!0}),u(Qe)!=="svelte-1jfcabo"&&(Qe.innerHTML=Ao),oo=a(B),f(K.$$.fragment,B),no=a(B),De=m(B,"P",{"data-svelte-h":!0}),u(De)!=="svelte-1yywzbj"&&(De.innerHTML=Qo),so=a(B),X=m(B,"DIV",{class:!0});var A=J(X);f(xe.$$.fragment,A),ro=a(A),Ye=m(A,"P",{"data-svelte-h":!0}),u(Ye)!=="svelte-kc5n5c"&&(Ye.textContent=Do),ao=a(A),Oe=m(A,"UL",{"data-svelte-h":!0}),u(Oe)!=="svelte-g8j1jo"&&(Oe.innerHTML=Yo),A.forEach(s),B.forEach(s),Wt=a(e),f(Ce.$$.fragment,e),It=a(e),$=m(e,"DIV",{class:!0});var x=J($);f(je.$$.fragment,x),io=a(x),Ke=m(x,"P",{"data-svelte-h":!0}),u(Ke)!=="svelte-mpku7q"&&(Ke.innerHTML=Oo),lo=a(x),et=m(x,"P",{"data-svelte-h":!0}),u(et)!=="svelte-1s077p3"&&(et.textContent=Ko),co=a(x),f(ee.$$.fragment,x),po=a(x),tt=m(x,"P",{"data-svelte-h":!0}),u(tt)!=="svelte-1jfcabo"&&(tt.innerHTML=en),mo=a(x),f(te.$$.fragment,x),uo=a(x),ot=m(x,"P",{"data-svelte-h":!0}),u(ot)!=="svelte-nshmcj"&&(ot.innerHTML=tn),ho=a(x),S=m(x,"DIV",{class:!0});var Q=J(S);f(ze.$$.fragment,Q),fo=a(Q),nt=m(Q,"P",{"data-svelte-h":!0}),u(nt)!=="svelte-kc5n5c"&&(nt.textContent=on),go=a(Q),st=m(Q,"UL",{"data-svelte-h":!0}),u(st)!=="svelte-g8j1jo"&&(st.innerHTML=nn),Q.forEach(s),x.forEach(s),Gt=a(e),f(qe.$$.fragment,e),Ht=a(e),Fe=m(e,"P",{"data-svelte-h":!0}),u(Fe)!=="svelte-1exqr7h"&&(Fe.innerHTML=sn),Vt=a(e),C=m(e,"DIV",{class:!0});var F=J(C);f(Ue.$$.fragment,F),_o=a(F),rt=m(F,"P",{"data-svelte-h":!0}),u(rt)!=="svelte-w0tdit"&&(rt.textContent=rn),bo=a(F),at=m(F,"P",{"data-svelte-h":!0}),u(at)!=="svelte-1sprpjx"&&(at.innerHTML=an),ko=a(F),it=m(F,"P",{"data-svelte-h":!0}),u(it)!=="svelte-hswkmf"&&(it.innerHTML=dn),yo=a(F),Z=m(F,"DIV",{class:!0});var H=J(Z);f(Je.$$.fragment,H),To=a(H),dt=m(H,"P",{"data-svelte-h":!0}),u(dt)!=="svelte-1yoq7vf"&&(dt.innerHTML=ln),Mo=a(H),f(oe.$$.fragment,H),vo=a(H),f(ne.$$.fragment,H),H.forEach(s),F.forEach(s),Lt=a(e),f(Ze.$$.fragment,e),Nt=a(e),We=m(e,"P",{"data-svelte-h":!0}),u(We)!=="svelte-1s6kduh"&&(We.innerHTML=cn),Rt=a(e),j=m(e,"DIV",{class:!0});var U=J(j);f(Ie.$$.fragment,U),wo=a(U),lt=m(U,"P",{"data-svelte-h":!0}),u(lt)!=="svelte-1gxq22f"&&(lt.textContent=pn),$o=a(U),ct=m(U,"P",{"data-svelte-h":!0}),u(ct)!=="svelte-1sprpjx"&&(ct.innerHTML=mn),Bo=a(U),pt=m(U,"P",{"data-svelte-h":!0}),u(pt)!=="svelte-hswkmf"&&(pt.innerHTML=un),xo=a(U),W=m(U,"DIV",{class:!0});var V=J(W);f(Ge.$$.fragment,V),Co=a(V),mt=m(V,"P",{"data-svelte-h":!0}),u(mt)!=="svelte-8d7tpr"&&(mt.innerHTML=hn),jo=a(V),f(se.$$.fragment,V),zo=a(V),f(re.$$.fragment,V),V.forEach(s),U.forEach(s),Et=a(e),f(He.$$.fragment,e),Xt=a(e),P=m(e,"DIV",{class:!0});var Re=J(P);f(Ve.$$.fragment,Re),qo=a(Re),I=m(Re,"DIV",{class:!0});var L=J(I);f(Le.$$.fragment,L),Fo=a(L),ut=m(L,"P",{"data-svelte-h":!0}),u(ut)!=="svelte-k3e4sb"&&(ut.innerHTML=fn),Uo=a(L),f(ae.$$.fragment,L),Jo=a(L),f(ie.$$.fragment,L),L.forEach(s),Re.forEach(s),St=a(e),f(Ne.$$.fragment,e),Pt=a(e),ft=m(e,"P",{}),J(ft).forEach(s),this.h()},h(){z(t,"name","hf:doc:metadata"),z(t,"content",Zn),z(D,"class","flex flex-wrap space-x-1"),z(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),z(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),z(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),z(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),z($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),z(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),z(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),z(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),z(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),z(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),z(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,o){d(document.head,t),i(e,y,o),i(e,l,o),i(e,c,o),i(e,T,o),i(e,M,o),g(de,e,o),i(e,_t,o),g(le,e,o),i(e,bt,o),i(e,D,o),i(e,kt,o),g(ce,e,o),i(e,yt,o),i(e,pe,o),i(e,Tt,o),i(e,me,o),i(e,Mt,o),i(e,ue,o),i(e,vt,o),i(e,he,o),i(e,wt,o),g(fe,e,o),i(e,$t,o),i(e,ge,o),i(e,Bt,o),i(e,_e,o),i(e,xt,o),g(be,e,o),i(e,Ct,o),g(ke,e,o),i(e,jt,o),i(e,ye,o),i(e,zt,o),g(Te,e,o),i(e,qt,o),i(e,Me,o),i(e,Ft,o),g(ve,e,o),i(e,Ut,o),i(e,q,o),g(we,q,null),d(q,Qt),d(q,Xe),d(q,Dt),d(q,Se),d(q,Yt),g(Y,q,null),i(e,Jt,o),g($e,e,o),i(e,Zt,o),i(e,w,o),g(Be,w,null),d(w,Ot),d(w,Pe),d(w,Kt),d(w,Ae),d(w,eo),g(O,w,null),d(w,to),d(w,Qe),d(w,oo),g(K,w,null),d(w,no),d(w,De),d(w,so),d(w,X),g(xe,X,null),d(X,ro),d(X,Ye),d(X,ao),d(X,Oe),i(e,Wt,o),g(Ce,e,o),i(e,It,o),i(e,$,o),g(je,$,null),d($,io),d($,Ke),d($,lo),d($,et),d($,co),g(ee,$,null),d($,po),d($,tt),d($,mo),g(te,$,null),d($,uo),d($,ot),d($,ho),d($,S),g(ze,S,null),d(S,fo),d(S,nt),d(S,go),d(S,st),i(e,Gt,o),g(qe,e,o),i(e,Ht,o),i(e,Fe,o),i(e,Vt,o),i(e,C,o),g(Ue,C,null),d(C,_o),d(C,rt),d(C,bo),d(C,at),d(C,ko),d(C,it),d(C,yo),d(C,Z),g(Je,Z,null),d(Z,To),d(Z,dt),d(Z,Mo),g(oe,Z,null),d(Z,vo),g(ne,Z,null),i(e,Lt,o),g(Ze,e,o),i(e,Nt,o),i(e,We,o),i(e,Rt,o),i(e,j,o),g(Ie,j,null),d(j,wo),d(j,lt),d(j,$o),d(j,ct),d(j,Bo),d(j,pt),d(j,xo),d(j,W),g(Ge,W,null),d(W,Co),d(W,mt),d(W,jo),g(se,W,null),d(W,zo),g(re,W,null),i(e,Et,o),g(He,e,o),i(e,Xt,o),i(e,P,o),g(Ve,P,null),d(P,qo),d(P,I),g(Le,I,null),d(I,Fo),d(I,ut),d(I,Uo),g(ae,I,null),d(I,Jo),g(ie,I,null),i(e,St,o),g(Ne,e,o),i(e,Pt,o),i(e,ft,o),At=!0},p(e,[o]){const G={};o&2&&(G.$$scope={dirty:o,ctx:e}),Y.$set(G);const B={};o&2&&(B.$$scope={dirty:o,ctx:e}),O.$set(B);const A={};o&2&&(A.$$scope={dirty:o,ctx:e}),K.$set(A);const x={};o&2&&(x.$$scope={dirty:o,ctx:e}),ee.$set(x);const Q={};o&2&&(Q.$$scope={dirty:o,ctx:e}),te.$set(Q);const F={};o&2&&(F.$$scope={dirty:o,ctx:e}),oe.$set(F);const H={};o&2&&(H.$$scope={dirty:o,ctx:e}),ne.$set(H);const U={};o&2&&(U.$$scope={dirty:o,ctx:e}),se.$set(U);const V={};o&2&&(V.$$scope={dirty:o,ctx:e}),re.$set(V);const Re={};o&2&&(Re.$$scope={dirty:o,ctx:e}),ae.$set(Re);const L={};o&2&&(L.$$scope={dirty:o,ctx:e}),ie.$set(L)},i(e){At||(_(de.$$.fragment,e),_(le.$$.fragment,e),_(ce.$$.fragment,e),_(fe.$$.fragment,e),_(be.$$.fragment,e),_(ke.$$.fragment,e),_(Te.$$.fragment,e),_(ve.$$.fragment,e),_(we.$$.fragment,e),_(Y.$$.fragment,e),_($e.$$.fragment,e),_(Be.$$.fragment,e),_(O.$$.fragment,e),_(K.$$.fragment,e),_(xe.$$.fragment,e),_(Ce.$$.fragment,e),_(je.$$.fragment,e),_(ee.$$.fragment,e),_(te.$$.fragment,e),_(ze.$$.fragment,e),_(qe.$$.fragment,e),_(Ue.$$.fragment,e),_(Je.$$.fragment,e),_(oe.$$.fragment,e),_(ne.$$.fragment,e),_(Ze.$$.fragment,e),_(Ie.$$.fragment,e),_(Ge.$$.fragment,e),_(se.$$.fragment,e),_(re.$$.fragment,e),_(He.$$.fragment,e),_(Ve.$$.fragment,e),_(Le.$$.fragment,e),_(ae.$$.fragment,e),_(ie.$$.fragment,e),_(Ne.$$.fragment,e),At=!0)},o(e){b(de.$$.fragment,e),b(le.$$.fragment,e),b(ce.$$.fragment,e),b(fe.$$.fragment,e),b(be.$$.fragment,e),b(ke.$$.fragment,e),b(Te.$$.fragment,e),b(ve.$$.fragment,e),b(we.$$.fragment,e),b(Y.$$.fragment,e),b($e.$$.fragment,e),b(Be.$$.fragment,e),b(O.$$.fragment,e),b(K.$$.fragment,e),b(xe.$$.fragment,e),b(Ce.$$.fragment,e),b(je.$$.fragment,e),b(ee.$$.fragment,e),b(te.$$.fragment,e),b(ze.$$.fragment,e),b(qe.$$.fragment,e),b(Ue.$$.fragment,e),b(Je.$$.fragment,e),b(oe.$$.fragment,e),b(ne.$$.fragment,e),b(Ze.$$.fragment,e),b(Ie.$$.fragment,e),b(Ge.$$.fragment,e),b(se.$$.fragment,e),b(re.$$.fragment,e),b(He.$$.fragment,e),b(Ve.$$.fragment,e),b(Le.$$.fragment,e),b(ae.$$.fragment,e),b(ie.$$.fragment,e),b(Ne.$$.fragment,e),At=!1},d(e){e&&(s(y),s(l),s(c),s(T),s(M),s(_t),s(bt),s(D),s(kt),s(yt),s(pe),s(Tt),s(me),s(Mt),s(ue),s(vt),s(he),s(wt),s($t),s(ge),s(Bt),s(_e),s(xt),s(Ct),s(jt),s(ye),s(zt),s(qt),s(Me),s(Ft),s(Ut),s(q),s(Jt),s(Zt),s(w),s(Wt),s(It),s($),s(Gt),s(Ht),s(Fe),s(Vt),s(C),s(Lt),s(Nt),s(We),s(Rt),s(j),s(Et),s(Xt),s(P),s(St),s(Pt),s(ft)),s(t),k(de,e),k(le,e),k(ce,e),k(fe,e),k(be,e),k(ke,e),k(Te,e),k(ve,e),k(we),k(Y),k($e,e),k(Be),k(O),k(K),k(xe),k(Ce,e),k(je),k(ee),k(te),k(ze),k(qe,e),k(Ue),k(Je),k(oe),k(ne),k(Ze,e),k(Ie),k(Ge),k(se),k(re),k(He,e),k(Ve),k(Le),k(ae),k(ie),k(Ne,e)}}}const Zn='{"title":"Blenderbot","local":"blenderbot","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips and example","local":"usage-tips-and-example","sections":[],"depth":2},{"title":"Implementation Notes","local":"implementation-notes","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"BlenderbotConfig","local":"transformers.BlenderbotConfig","sections":[],"depth":2},{"title":"BlenderbotTokenizer","local":"transformers.BlenderbotTokenizer","sections":[],"depth":2},{"title":"BlenderbotTokenizerFast","local":"transformers.BlenderbotTokenizerFast","sections":[],"depth":2},{"title":"BlenderbotModel","local":"transformers.BlenderbotModel","sections":[],"depth":2},{"title":"BlenderbotForConditionalGeneration","local":"transformers.BlenderbotForConditionalGeneration","sections":[],"depth":2},{"title":"BlenderbotForCausalLM","local":"transformers.BlenderbotForCausalLM","sections":[],"depth":2}],"depth":1}';function Wn(v){return _n(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Xn extends bn{constructor(t){super(),kn(this,t,Wn,Jn,gn,{})}}export{Xn as component}; | |
Xet Storage Details
- Size:
- 109 kB
- Xet hash:
- 72c3ef11491ac3938d81f1109976055813eb957961cf124886baee7fe4627e2c
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.