import{S as GU,i as CU,s as NU,e as s,k as c,w as g,t as a,M as XU,c as n,d as o,m as l,a as r,x as u,h as i,b as d,G as e,g as m,y as f,q as _,o as b,B as y,v as RU,L as he}from"../../chunks/vendor-hf-doc-builder.js";import{T as xn}from"../../chunks/Tip-hf-doc-builder.js";import{D as v}from"../../chunks/Docstring-hf-doc-builder.js";import{C as O}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as pe}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as me}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function OU(E){let T,x,$,w,M;return w=new O({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUyQyUyMHNldF9zZWVkJTBBJTBBc2V0X3NlZWQoMCklMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJkaXN0aWxncHQyJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGdwdDIlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkElMjBzZXF1ZW5jZSUzQSUyMDElMkMlMjAyJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEElMjMlMjBXaXRoJTIwc2FtcGxpbmclMkMlMjB0aGUlMjBvdXRwdXQlMjBpcyUyMHVuZXhwZWN0ZWQlMjAtLSUyMHNvbWV0aW1lcyUyMHRvbyUyMHVuZXhwZWN0ZWQuJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwZG9fc2FtcGxlJTNEVHJ1ZSklMEFwcmludCh0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKG91dHB1dHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklNUIwJTVEKSUwQSUwQSUyMyUyMFdpdGglMjBlcHNpbG9uJTIwc2FtcGxpbmclMkMlMjB0aGUlMjBvdXRwdXQlMjBnZXRzJTIwcmVzdHJpY3RlZCUyMHRvJTIwaGlnaC1wcm9iYWJpbGl0eSUyMHRva2Vucy4lMjBOb3RlJTIwdGhhdCUyMHRoaXMlMjBpcyUyMHNpbWlsYXIlMjB0byUwQSUyMyUyMFRvcCUyMFAlMjBzYW1wbGluZyUyQyUyMHdoaWNoJTIwcmVzdHJpY3RzJTIwdG9rZW5zJTIwYmFzZWQlMjBvbiUyMHRoZWlyJTIwY3VtdWxhdGl2ZSUyMHByb2JhYmlsaXR5LiUwQSUyMyUyMFBybyUyMHRpcCUzQSUyMFRoZSUyMHBhcGVyJTIwcmVjb21lbmRzJTIwdXNpbmclMjAlNjBlcHNpbG9uX2N1dG9mZiU2MCUyMHZhbHVlcyUyMGJldHdlZW4lMjAzZS00JTIwYW5kJTIwOWUtNCUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKmlucHV0cyUyQyUyMGRvX3NhbXBsZSUzRFRydWUlMkMlMjBlcHNpbG9uX2N1dG9mZiUzRDAuMSklMEFwcmludCh0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKG91dHB1dHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklNUIwJTVEKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForCausalLM, set_seed

<span class="hljs-meta">&gt;&gt;&gt; </span>set_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;distilgpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;distilgpt2&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;A sequence: 1, 2&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># With sampling, the output is unexpected -- sometimes too unexpected.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(**inputs, do_sample=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(outputs, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
A sequence: <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">0</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2.</span> <span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># With epsilon sampling, the output gets restricted to high-probability tokens. Note that this is similar to</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Top P sampling, which restricts tokens based on their cumulative probability.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Pro tip: The paper recomends using \`epsilon_cutoff\` values between 3e-4 and 9e-4</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(**inputs, do_sample=<span class="hljs-literal">True</span>, epsilon_cutoff=<span class="hljs-number">0.1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(outputs, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
A sequence: <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>, <span class="hljs-number">7</span>, <span class="hljs-number">8</span>, <span class="hljs-number">9</span>`}}),{c(){T=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){T=n(h,"P",{});var k=r(T);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,T,k),e(T,x),m(h,$,k),f(w,h,k),M=!0},p:he,i(h){M||(_(w.$$.fragment,h),M=!0)},o(h){b(w.$$.fragment,h),M=!1},d(h){h&&o(T),h&&o($),y(w,h)}}}function AU(E){let T,x,$,w,M;return w=new O({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUyQyUyMHNldF9zZWVkJTBBJTBBc2V0X3NlZWQoMCklMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJkaXN0aWxncHQyJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGdwdDIlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkElMjBzZXF1ZW5jZSUzQSUyMDElMkMlMjAyJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEElMjMlMjBXaXRoJTIwc2FtcGxpbmclMkMlMjB0aGUlMjBvdXRwdXQlMjBpcyUyMHVuZXhwZWN0ZWQlMjAtLSUyMHNvbWV0aW1lcyUyMHRvbyUyMHVuZXhwZWN0ZWQuJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwZG9fc2FtcGxlJTNEVHJ1ZSklMEFwcmludCh0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKG91dHB1dHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklNUIwJTVEKSUwQSUwQSUyMyUyMFdpdGglMjBldGElMjBzYW1wbGluZyUyQyUyMHRoZSUyMG91dHB1dCUyMGdldHMlMjByZXN0cmljdGVkJTIwdG8lMjBoaWdoLXByb2JhYmlsaXR5JTIwdG9rZW5zLiUyMFlvdSUyMGNhbiUyMHNlZSUyMGl0JTIwYXMlMjBhJTIwZHluYW1pYyUyMGZvcm0lMjBvZiUwQSUyMyUyMGVwc2lsb24lMjBzYW1wbGluZyUyMHRoYXQlMjBhZGFwdHMlMjBpdHMlMjBjdXRvZmYlMjBwcm9iYWJpbGl0eSUyMGJhc2VkJTIwb24lMjB0aGUlMjBlbnRyb3B5JTIwKGhpZ2glMjBlbnRyb3B5JTIwJTNEJTIwbG93ZXIlMjBjdXRvZmYpLiUwQSUyMyUyMFBybyUyMHRpcCUzQSUyMFRoZSUyMHBhcGVyJTIwcmVjb21lbmRzJTIwdXNpbmclMjAlNjBldGFfY3V0b2ZmJTYwJTIwdmFsdWVzJTIwYmV0d2VlbiUyMDNlLTQlMjB0byUyMDRlLTMlMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKippbnB1dHMlMkMlMjBkb19zYW1wbGUlM0RUcnVlJTJDJTIwZXRhX2N1dG9mZiUzRDAuMSklMEFwcmludCh0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKG91dHB1dHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklNUIwJTVEKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForCausalLM, set_seed

<span class="hljs-meta">&gt;&gt;&gt; </span>set_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;distilgpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;distilgpt2&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;A sequence: 1, 2&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># With sampling, the output is unexpected -- sometimes too unexpected.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(**inputs, do_sample=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(outputs, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
A sequence: <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">0</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2.</span> <span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># With eta sampling, the output gets restricted to high-probability tokens. You can see it as a dynamic form of</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># epsilon sampling that adapts its cutoff probability based on the entropy (high entropy = lower cutoff).</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Pro tip: The paper recomends using \`eta_cutoff\` values between 3e-4 to 4e-3</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(**inputs, do_sample=<span class="hljs-literal">True</span>, eta_cutoff=<span class="hljs-number">0.1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(outputs, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
A sequence: <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>, <span class="hljs-number">7</span>, <span class="hljs-number">8</span>, <span class="hljs-number">9</span>`}}),{c(){T=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){T=n(h,"P",{});var k=r(T);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,T,k),e(T,x),m(h,$,k),f(w,h,k),M=!0},p:he,i(h){M||(_(w.$$.fragment,h),M=!0)},o(h){b(w.$$.fragment,h),M=!1},d(h){h&&o(T),h&&o($),y(w,h)}}}function HU(E){let T,x;return{c(){T=s("p"),x=a(`Diverse beam search can be particularly useful in scenarios where a variety of different outputs is desired, rather
than multiple similar sequences. It allows the model to explore different generation paths and provides a broader
coverage of possible outputs.`)},l($){T=n($,"P",{});var w=r(T);x=i(w,`Diverse beam search can be particularly useful in scenarios where a variety of different outputs is desired, rather
than multiple similar sequences. It allows the model to explore different generation paths and provides a broader
coverage of possible outputs.`),w.forEach(o)},m($,w){m($,T,w),e(T,x)},d($){$&&o(T)}}}function QU(E){let T,x;return{c(){T=s("p"),x=a("This logits processor can be resource-intensive, especially when using large models or long sequences.")},l($){T=n($,"P",{});var w=r(T);x=i(w,"This logits processor can be resource-intensive, especially when using large models or long sequences."),w.forEach(o)},m($,w){m($,T,w),e(T,x)},d($){$&&o(T)}}}function YU(E){let T,x,$,w,M;return w=new O({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JTZXEyU2VxTE0lMEFpbXBvcnQlMjB0b3JjaCUwQSUwQSUyMyUyMEluaXRpYWxpemUlMjB0aGUlMjBtb2RlbCUyMGFuZCUyMHRva2VuaXplciUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnQ1LWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JTZXEyU2VxTE0uZnJvbV9wcmV0cmFpbmVkKCUyMnQ1LWJhc2UlMjIpJTBBJTBBJTIzJTIwQSUyMGxvbmclMjB0ZXh0JTIwYWJvdXQlMjB0aGUlMjBzb2xhciUyMHN5c3RlbSUwQXRleHQlMjAlM0QlMjAlMjJUaGUlMjBTb2xhciUyMFN5c3RlbSUyMGlzJTIwYSUyMGdyYXZpdGF0aW9uYWxseSUyMGJvdW5kJTIwc3lzdGVtJTIwY29tcHJpc2luZyUyMHRoZSUyMFN1biUyMGFuZCUyMHRoZSUyMG9iamVjdHMlMjB0aGF0JTIwb3JiaXQlMjBpdCUyQyUyMGVpdGhlciUyMGRpcmVjdGx5JTIwb3IlMjBpbmRpcmVjdGx5LiUyME9mJTIwdGhlJTIwb2JqZWN0cyUyMHRoYXQlMjBvcmJpdCUyMHRoZSUyMFN1biUyMGRpcmVjdGx5JTJDJTIwdGhlJTIwbGFyZ2VzdCUyMGFyZSUyMHRoZSUyMGVpZ2h0JTIwcGxhbmV0cyUyQyUyMHdpdGglMjB0aGUlMjByZW1haW5kZXIlMjBiZWluZyUyMHNtYWxsZXIlMjBvYmplY3RzJTJDJTIwc3VjaCUyMGFzJTIwdGhlJTIwZml2ZSUyMGR3YXJmJTIwcGxhbmV0cyUyMGFuZCUyMHNtYWxsJTIwU29sYXIlMjBTeXN0ZW0lMjBib2RpZXMuJTIwVGhlJTIwU29sYXIlMjBTeXN0ZW0lMjBmb3JtZWQlMjA0LjYlMjBiaWxsaW9uJTIweWVhcnMlMjBhZ28lMjBmcm9tJTIwdGhlJTIwZ3Jhdml0YXRpb25hbCUyMGNvbGxhcHNlJTIwb2YlMjBhJTIwZ2lhbnQlMjBpbnRlcnN0ZWxsYXIlMjBtb2xlY3VsYXIlMjBjbG91ZC4lMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyc3VtbWFyaXplJTNBJTIwJTIyJTIwJTJCJTIwdGV4dCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBJTIzJTIwR2VuZXJhdGUlMjBkaXZlcnNlJTIwc3VtbWFyeSUwQW91dHB1dHNfZGl2ZXJzZSUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCUwQSUyMCUyMCUyMCUyMCoqaW5wdXRzJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2JlYW1fZ3JvdXBzJTNEMiUyQyUwQSUyMCUyMCUyMCUyMGRpdmVyc2l0eV9wZW5hbHR5JTNEMTAuMCUyQyUwQSUyMCUyMCUyMCUyMG1heF9sZW5ndGglM0QxMDAlMkMlMEElMjAlMjAlMjAlMjBudW1fYmVhbXMlM0Q0JTJDJTBBJTIwJTIwJTIwJTIwbnVtX3JldHVybl9zZXF1ZW5jZXMlM0QyJTJDJTBBKSUwQXN1bW1hcmllc19kaXZlcnNlJTIwJTNEJTIwdG9rZW5pemVyLmJhdGNoX2RlY29kZShvdXRwdXRzX2RpdmVyc2UlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklMEElMEElMjMlMjBHZW5lcmF0ZSUyMG5vbi1kaXZlcnNlJTIwc3VtbWFyeSUwQW91dHB1dHNfbm9uX2RpdmVyc2UlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSglMEElMjAlMjAlMjAlMjAqKmlucHV0cyUyQyUwQSUyMCUyMCUyMCUyMG1heF9sZW5ndGglM0QxMDAlMkMlMEElMjAlMjAlMjAlMjBudW1fYmVhbXMlM0Q0JTJDJTBBJTIwJTIwJTIwJTIwbnVtX3JldHVybl9zZXF1ZW5jZXMlM0QyJTJDJTBBKSUwQXN1bW1hcnlfbm9uX2RpdmVyc2UlMjAlM0QlMjB0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKG91dHB1dHNfbm9uX2RpdmVyc2UlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklMEElMEElMjMlMjBXaXRoJTIwJTYwZGl2ZXJzaXR5X3BlbmFsdHklNjAlMkMlMjB0aGUlMjByZXN1bHRpbmclMjBiZWFtcyUyMGFyZSUyMG11Y2glMjBtb3JlJTIwZGl2ZXJzZSUwQXByaW50KHN1bW1hcnlfbm9uX2RpdmVyc2UpJTBBJTBBcHJpbnQoc3VtbWFyaWVzX2RpdmVyc2Up",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForSeq2SeqLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initialize the model and tokenizer</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;t5-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForSeq2SeqLM.from_pretrained(<span class="hljs-string">&quot;t5-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># A long text about the solar system</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;The Solar System is a gravitationally bound system comprising the Sun and the objects that orbit it, either directly or indirectly. Of the objects that orbit the Sun directly, the largest are the eight planets, with the remainder being smaller objects, such as the five dwarf planets and small Solar System bodies. The Solar System formed 4.6 billion years ago from the gravitational collapse of a giant interstellar molecular cloud.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;summarize: &quot;</span> + text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate diverse summary</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs_diverse = model.generate(
<span class="hljs-meta">... </span>    **inputs,
<span class="hljs-meta">... </span>    num_beam_groups=<span class="hljs-number">2</span>,
<span class="hljs-meta">... </span>    diversity_penalty=<span class="hljs-number">10.0</span>,
<span class="hljs-meta">... </span>    max_length=<span class="hljs-number">100</span>,
<span class="hljs-meta">... </span>    num_beams=<span class="hljs-number">4</span>,
<span class="hljs-meta">... </span>    num_return_sequences=<span class="hljs-number">2</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>summaries_diverse = tokenizer.batch_decode(outputs_diverse, skip_special_tokens=<span class="hljs-literal">True</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate non-diverse summary</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs_non_diverse = model.generate(
<span class="hljs-meta">... </span>    **inputs,
<span class="hljs-meta">... </span>    max_length=<span class="hljs-number">100</span>,
<span class="hljs-meta">... </span>    num_beams=<span class="hljs-number">4</span>,
<span class="hljs-meta">... </span>    num_return_sequences=<span class="hljs-number">2</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>summary_non_diverse = tokenizer.batch_decode(outputs_non_diverse, skip_special_tokens=<span class="hljs-literal">True</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># With \`diversity_penalty\`, the resulting beams are much more diverse</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(summary_non_diverse)
[<span class="hljs-string">&#x27;the solar system formed 4.6 billion years ago from the collapse of a giant interstellar molecular cloud. of the objects that orbit the Sun directly, the largest are the eight planets.&#x27;</span>,
<span class="hljs-string">&#x27;the Solar System formed 4.6 billion years ago from the collapse of a giant interstellar molecular cloud. of the objects that orbit the Sun directly, the largest are the eight planets.&#x27;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(summaries_diverse)
[<span class="hljs-string">&#x27;the solar system formed 4.6 billion years ago from the collapse of a giant interstellar molecular cloud. of the objects that orbit the Sun directly, the largest are the eight planets.&#x27;</span>,
<span class="hljs-string">&#x27;the solar system formed 4.6 billion years ago from the collapse of a giant interstellar molecular cloud. of the objects that orbit the Sun directly, the largest are the eight planets. the rest of the objects are smaller objects, such as the five dwarf planets and small solar system bodies.&#x27;</span>]`}}),{c(){T=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){T=n(h,"P",{});var k=r(T);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,T,k),e(T,x),m(h,$,k),f(w,h,k),M=!0},p:he,i(h){M||(_(w.$$.fragment,h),M=!0)},o(h){b(w.$$.fragment,h),M=!1},d(h){h&&o(T),h&&o($),y(w,h)}}}function KU(E){let T,x,$,w,M;return w=new O({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGdwdDIlMjIpJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsZ3B0MiUyMiklMEFtb2RlbC5jb25maWcucGFkX3Rva2VuX2lkJTIwJTNEJTIwbW9kZWwuY29uZmlnLmVvc190b2tlbl9pZCUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglNUIlMjJIdWdnaW5nJTIwRmFjZSUyMENvbXBhbnklMjBpcyUyMiU1RCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBJTIzJTIwSWYlMjB0aGUlMjBtYXhpbXVtJTIwbGVuZ3RoJTIwKGRlZmF1bHQlMjAlM0QlMjAyMCklMjBpcyUyMHNtYWxsZXIlMjB0aGFuJTIwdGhlJTIwbWluaW11bSUyMGxlbmd0aCUyMGNvbnN0cmFpbnQlMkMlMjB0aGUlMjBsYXR0ZXIlMjBpcyUyMGlnbm9yZWQhJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwbWluX25ld190b2tlbnMlM0QzMCklMEFwcmludCh0b2tlbml6ZXIuZGVjb2RlKG91dHB1dHMlNUIwJTVEJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpKSUwQSUwQSUyMyUyMEZvciUyMHRlc3RpbmclMjBwdXJwb3NlcyUyQyUyMGxldCdzJTIwc2V0JTIwJTYwZW9zX3Rva2VuJTYwJTIwdG8lMjAlNjAlMjJjb21wYW55JTIyJTYwJTJDJTIwdGhlJTIwZmlyc3QlMjBnZW5lcmF0ZWQlMjB0b2tlbi4lMjBUaGlzJTIwd2lsbCUyMG1ha2UlMEElMjMlMjBnZW5lcmF0aW9uJTIwZW5kJTIwdGhlcmUuJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwZW9zX3Rva2VuX2lkJTNEMTY2NCklMEFwcmludCh0b2tlbml6ZXIuZGVjb2RlKG91dHB1dHMlNUIwJTVEJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpKSUwQSUwQSUyMyUyMEluY3JlYXNpbmclMjAlNjBtaW5fbmV3X3Rva2VucyU2MCUyMHdpbGwlMjBtYWtlJTIwZ2VuZXJhdGlvbiUyMGlnbm9yZSUyMG9jY3VyZW5jZXMlMjAlNjAlMjJjb21wYW55JTIyJTYwJTIwKGVvcyUyMHRva2VuKSUyMGJlZm9yZSUyMHRoZSUwQSUyMyUyMG1pbmltdW0lMjBsZW5ndGglMjBjb25kaXRpb24lMjBpcyUyMGhvbm9yZWQuJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwbWluX25ld190b2tlbnMlM0QyJTJDJTIwZW9zX3Rva2VuX2lkJTNEMTY2NCklMEFwcmludCh0b2tlbml6ZXIuZGVjb2RlKG91dHB1dHMlNUIwJTVEJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;distilgpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;distilgpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.pad_token_id = model.config.eos_token_id
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;Hugging Face Company is&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># If the maximum length (default = 20) is smaller than the minimum length constraint, the latter is ignored!</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(**inputs, min_new_tokens=<span class="hljs-number">30</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(outputs[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>))
Hugging Face Company <span class="hljs-keyword">is</span> a company that has been working on a new product <span class="hljs-keyword">for</span> the past year.

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># For testing purposes, let&#x27;s set \`eos_token\` to \`&quot;company&quot;\`, the first generated token. This will make</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># generation end there.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(**inputs, eos_token_id=<span class="hljs-number">1664</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(outputs[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>))
Hugging Face Company <span class="hljs-keyword">is</span> a company

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Increasing \`min_new_tokens\` will make generation ignore occurences \`&quot;company&quot;\` (eos token) before the</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># minimum length condition is honored.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(**inputs, min_new_tokens=<span class="hljs-number">2</span>, eos_token_id=<span class="hljs-number">1664</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(outputs[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>))
Hugging Face Company <span class="hljs-keyword">is</span> a new company`}}),{c(){T=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){T=n(h,"P",{});var k=r(T);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,T,k),e(T,x),m(h,$,k),f(w,h,k),M=!0},p:he,i(h){M||(_(w.$$.fragment,h),M=!0)},o(h){b(w.$$.fragment,h),M=!1},d(h){h&&o(T),h&&o($),y(w,h)}}}function eB(E){let T,x,$,w,M,h,k,Z,U,B,F,W,oe,Ue,S,se,Be;return{c(){T=s("p"),x=a(`In order to get the token ids of the words that should not appear in the generated text, make sure to set
`),$=s("code"),w=a("add_prefix_space=True"),M=a(" when initializing the tokenizer, and use "),h=s("code"),k=a("tokenizer(bad_words, add_special_tokens=False).input_ids"),Z=a(". The "),U=s("code"),B=a("add_prefix_space"),F=a(` argument is only supported for some slow tokenizers,
as fast tokenizers\u2019 prefixing behaviours come from `),W=s("code"),oe=a("pre tokenizers"),Ue=a(`. Read more
`),S=s("a"),se=a("here"),Be=a("."),this.h()},l(A){T=n(A,"P",{});var j=r(T);x=i(j,`In order to get the token ids of the words that should not appear in the generated text, make sure to set
`),$=n(j,"CODE",{});var Kt=r($);w=i(Kt,"add_prefix_space=True"),Kt.forEach(o),M=i(j," when initializing the tokenizer, and use "),h=n(j,"CODE",{});var eo=r(h);k=i(eo,"tokenizer(bad_words, add_special_tokens=False).input_ids"),eo.forEach(o),Z=i(j,". The "),U=n(j,"CODE",{});var xe=r(U);B=i(xe,"add_prefix_space"),xe.forEach(o),F=i(j,` argument is only supported for some slow tokenizers,
as fast tokenizers\u2019 prefixing behaviours come from `),W=n(j,"CODE",{});var to=r(W);oe=i(to,"pre tokenizers"),to.forEach(o),Ue=i(j,`. Read more
`),S=n(j,"A",{href:!0,rel:!0});var oo=r(S);se=i(oo,"here"),oo.forEach(o),Be=i(j,"."),j.forEach(o),this.h()},h(){d(S,"href","https://huggingface.co/docs/tokenizers/api/pre-tokenizers"),d(S,"rel","nofollow")},m(A,j){m(A,T,j),e(T,x),e(T,$),e($,w),e(T,M),e(T,h),e(h,k),e(T,Z),e(T,U),e(U,B),e(T,F),e(T,W),e(W,oe),e(T,Ue),e(T,S),e(S,se),e(T,Be)},d(A){A&&o(T)}}}function tB(E){let T,x,$,w,M;return w=new O({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmdwdDIlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ3B0MiUyMiklMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCJTIySW4lMjBhJTIwd29yZCUyQyUyMHRoZSUyMGNha2UlMjBpcyUyMGElMjIlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQW91dHB1dF9pZHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZShpbnB1dHMlNUIlMjJpbnB1dF9pZHMlMjIlNUQlMkMlMjBtYXhfbmV3X3Rva2VucyUzRDUlMkMlMjBwYWRfdG9rZW5faWQlM0R0b2tlbml6ZXIuZW9zX3Rva2VuX2lkKSUwQXByaW50KHRva2VuaXplci5iYXRjaF9kZWNvZGUob3V0cHV0X2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSU1QjAlNUQpJTBBJTBBJTIzJTIwTm93JTIwbGV0J3MlMjB0YWtlJTIwdGhlJTIwYmFkJTIwd29yZHMlMjBvdXQuJTIwUGxlYXNlJTIwbm90ZSUyMHRoYXQlMjB0aGUlMjB0b2tlbml6ZXIlMjBpcyUyMGluaXRpYWxpemVkJTIwZGlmZmVyZW50bHklMEF0b2tlbml6ZXJfd2l0aF9wcmVmaXhfc3BhY2UlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJncHQyJTIyJTJDJTIwYWRkX3ByZWZpeF9zcGFjZSUzRFRydWUpJTBBJTBBJTBBZGVmJTIwZ2V0X3Rva2Vuc19hc19saXN0KHdvcmRfbGlzdCklM0ElMEElMjAlMjAlMjAlMjAlMjJDb252ZXJ0cyUyMGElMjBzZXF1ZW5jZSUyMG9mJTIwd29yZHMlMjBpbnRvJTIwYSUyMGxpc3QlMjBvZiUyMHRva2VucyUyMiUwQSUyMCUyMCUyMCUyMHRva2Vuc19saXN0JTIwJTNEJTIwJTVCJTVEJTBBJTIwJTIwJTIwJTIwZm9yJTIwd29yZCUyMGluJTIwd29yZF9saXN0JTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwdG9rZW5pemVkX3dvcmQlMjAlM0QlMjB0b2tlbml6ZXJfd2l0aF9wcmVmaXhfc3BhY2UoJTVCd29yZCU1RCUyQyUyMGFkZF9zcGVjaWFsX3Rva2VucyUzREZhbHNlKS5pbnB1dF9pZHMlNUIwJTVEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwdG9rZW5zX2xpc3QuYXBwZW5kKHRva2VuaXplZF93b3JkKSUwQSUyMCUyMCUyMCUyMHJldHVybiUyMHRva2Vuc19saXN0JTBBJTBBJTBBYmFkX3dvcmRzX2lkcyUyMCUzRCUyMGdldF90b2tlbnNfYXNfbGlzdCh3b3JkX2xpc3QlM0QlNUIlMjJtZXNzJTIyJTVEKSUwQW91dHB1dF9pZHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSglMEElMjAlMjAlMjAlMjBpbnB1dHMlNUIlMjJpbnB1dF9pZHMlMjIlNUQlMkMlMjBtYXhfbmV3X3Rva2VucyUzRDUlMkMlMjBiYWRfd29yZHNfaWRzJTNEYmFkX3dvcmRzX2lkcyUyQyUyMHBhZF90b2tlbl9pZCUzRHRva2VuaXplci5lb3NfdG9rZW5faWQlMEEpJTBBcHJpbnQodG9rZW5pemVyLmJhdGNoX2RlY29kZShvdXRwdXRfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTVCMCU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;In a word, the cake is a&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>output_ids = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], max_new_tokens=<span class="hljs-number">5</span>, pad_token_id=tokenizer.eos_token_id)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(output_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
In a word, the cake <span class="hljs-keyword">is</span> a bit of a mess.

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Now let&#x27;s take the bad words out. Please note that the tokenizer is initialized differently</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer_with_prefix_space = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>, add_prefix_space=<span class="hljs-literal">True</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">get_tokens_as_list</span>(<span class="hljs-params">word_list</span>):
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Converts a sequence of words into a list of tokens&quot;</span>
<span class="hljs-meta">... </span>    tokens_list = []
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> word <span class="hljs-keyword">in</span> word_list:
<span class="hljs-meta">... </span>        tokenized_word = tokenizer_with_prefix_space([word], add_special_tokens=<span class="hljs-literal">False</span>).input_ids[<span class="hljs-number">0</span>]
<span class="hljs-meta">... </span>        tokens_list.append(tokenized_word)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> tokens_list


<span class="hljs-meta">&gt;&gt;&gt; </span>bad_words_ids = get_tokens_as_list(word_list=[<span class="hljs-string">&quot;mess&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>output_ids = model.generate(
<span class="hljs-meta">... </span>    inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], max_new_tokens=<span class="hljs-number">5</span>, bad_words_ids=bad_words_ids, pad_token_id=tokenizer.eos_token_id
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(output_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
In a word, the cake <span class="hljs-keyword">is</span> a bit of a surprise.`}}),{c(){T=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){T=n(h,"P",{});var k=r(T);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,T,k),e(T,x),m(h,$,k),f(w,h,k),M=!0},p:he,i(h){M||(_(w.$$.fragment,h),M=!0)},o(h){b(w.$$.fragment,h),M=!1},d(h){h&&o(T),h&&o($),y(w,h)}}}function oB(E){let T,x,$,w;return{c(){T=s("p"),x=a(`Use n-gram penalties with care. For instance, penalizing 2-grams (bigrams) in an article about the city of New York
might lead to undesirable outcomes where the city\u2019s name appears only once in the entire text.
`),$=s("a"),w=a("Reference"),this.h()},l(M){T=n(M,"P",{});var h=r(T);x=i(h,`Use n-gram penalties with care. For instance, penalizing 2-grams (bigrams) in an article about the city of New York
might lead to undesirable outcomes where the city\u2019s name appears only once in the entire text.
`),$=n(h,"A",{href:!0,rel:!0});var k=r($);w=i(k,"Reference"),k.forEach(o),h.forEach(o),this.h()},h(){d($,"href","https://huggingface.co/blog/how-to-generate"),d($,"rel","nofollow")},m(M,h){m(M,T,h),e(T,x),e(T,$),e($,w)},d(M){M&&o(T)}}}function sB(E){let T,x,$,w,M;return w=new O({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGdwdDIlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsZ3B0MiUyMiklMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCJTIyVG9kYXklMjBJJTIyJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEFvdXRwdXQlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKmlucHV0cyklMEFwcmludCh0b2tlbml6ZXIuZGVjb2RlKG91dHB1dCU1QjAlNUQlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSkpJTBBJTBBJTIzJTIwTm93JTIwbGV0J3MlMjBhZGQlMjBuZ3JhbSUyMHNpemUlMjB1c2luZyUyMCU2MG5vX3JlcGVhdF9uZ3JhbV9zaXplJTYwLiUyMFRoaXMlMjBzdG9wcyUyMHRoZSUyMHJlcGV0aXRpb25zJTIwKCUyMkklRTIlODAlOTltJTIyKSUyMGluJTIwdGhlJTIwb3V0cHV0LiUwQW91dHB1dCUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwbm9fcmVwZWF0X25ncmFtX3NpemUlM0QyKSUwQXByaW50KHRva2VuaXplci5kZWNvZGUob3V0cHV0JTVCMCU1RCUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;distilgpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;distilgpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;Today I&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>output = model.generate(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(output[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>))
Today I\u2019m <span class="hljs-keyword">not</span> sure <span class="hljs-keyword">if</span> I\u2019m going to be able to do it.

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Now let&#x27;s add ngram size using \`no_repeat_ngram_size\`. This stops the repetitions (&quot;I\u2019m&quot;) in the output.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>output = model.generate(**inputs, no_repeat_ngram_size=<span class="hljs-number">2</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.decode(output[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>))
Today I\u2019m <span class="hljs-keyword">not</span> sure <span class="hljs-keyword">if</span> I can get a better understanding of the nature of this issue`}}),{c(){T=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){T=n(h,"P",{});var k=r(T);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,T,k),e(T,x),m(h,$,k),f(w,h,k),M=!0},p:he,i(h){M||(_(w.$$.fragment,h),M=!0)},o(h){b(w.$$.fragment,h),M=!1},d(h){h&&o(T),h&&o($),y(w,h)}}}function nB(E){let T,x,$,w,M;return w=new O({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMHRoZSUyMG1vZGVsJTIwYW5kJTIwdG9rZW5pemVyJTIwZm9yJTIwaXQlMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJkaXN0aWxncHQyJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGdwdDIlMjIpJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCU1QiUyMkknbSUyMG5vdCUyMGdvaW5nJTIwdG8lMjIlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMyUyMFRoaXMlMjBzaG93cyUyMGElMjBub3JtYWwlMjBnZW5lcmF0ZSUyMHdpdGhvdXQlMjBhbnklMjBzcGVjaWZpYyUyMHBhcmFtZXRlcnMlMEFzdW1tYXJ5X2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzKSUwQXByaW50KHRva2VuaXplci5iYXRjaF9kZWNvZGUoc3VtbWFyeV9pZHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklNUIwJTVEKSUwQSUwQSUyMyUyMFRoaXMlMjBnZW5lcmF0ZXMlMjBhJTIwcGVuYWx0eSUyMGZvciUyMHJlcGVhdGVkJTIwdG9rZW5zJTBBcGVuYWxpemVkX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwcmVwZXRpdGlvbl9wZW5hbHR5JTNEMS4xKSUwQXByaW50KHRva2VuaXplci5iYXRjaF9kZWNvZGUocGVuYWxpemVkX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSU1QjAlNUQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing the model and tokenizer for it</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;distilgpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;distilgpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;I&#x27;m not going to&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># This shows a normal generate without any specific parameters</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>summary_ids = model.generate(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(summary_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
I<span class="hljs-string">&#x27;m not going to be able to do that. I&#x27;</span>m going to be able to do that

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># This generates a penalty for repeated tokens</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>penalized_ids = model.generate(**inputs, repetition_penalty=<span class="hljs-number">1.1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(penalized_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
I<span class="hljs-string">&#x27;m not going to be able to do that. I&#x27;</span>ll just have to go out <span class="hljs-keyword">and</span> play`}}),{c(){T=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){T=n(h,"P",{});var k=r(T);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,T,k),e(T,x),m(h,$,k),f(w,h,k),M=!0},p:he,i(h){M||(_(w.$$.fragment,h),M=!0)},o(h){b(w.$$.fragment,h),M=!1},d(h){h&&o(T),h&&o($),y(w,h)}}}function rB(E){let T,x,$,w,M,h,k,Z,U,B,F,W,oe,Ue,S,se,Be;return{c(){T=s("p"),x=a("In order to get the token ids of the sequences that you want to bias, make sure to set "),$=s("code"),w=a("add_prefix_space=True"),M=a(` when
initializing the tokenizer, and use `),h=s("code"),k=a("tokenizer(bad_words, add_special_tokens=False).input_ids"),Z=a(`. The
`),U=s("code"),B=a("add_prefix_space"),F=a(` argument is only supported for some slow tokenizers, as fast tokenizers\u2019 prefixing behaviours
come from `),W=s("code"),oe=a("pre tokenizers"),Ue=a(". Read more "),S=s("a"),se=a("here"),Be=a("."),this.h()},l(A){T=n(A,"P",{});var j=r(T);x=i(j,"In order to get the token ids of the sequences that you want to bias, make sure to set "),$=n(j,"CODE",{});var Kt=r($);w=i(Kt,"add_prefix_space=True"),Kt.forEach(o),M=i(j,` when
initializing the tokenizer, and use `),h=n(j,"CODE",{});var eo=r(h);k=i(eo,"tokenizer(bad_words, add_special_tokens=False).input_ids"),eo.forEach(o),Z=i(j,`. The
`),U=n(j,"CODE",{});var xe=r(U);B=i(xe,"add_prefix_space"),xe.forEach(o),F=i(j,` argument is only supported for some slow tokenizers, as fast tokenizers\u2019 prefixing behaviours
come from `),W=n(j,"CODE",{});var to=r(W);oe=i(to,"pre tokenizers"),to.forEach(o),Ue=i(j,". Read more "),S=n(j,"A",{href:!0,rel:!0});var oo=r(S);se=i(oo,"here"),oo.forEach(o),Be=i(j,"."),j.forEach(o),this.h()},h(){d(S,"href","https://huggingface.co/docs/tokenizers/api/pre-tokenizers"),d(S,"rel","nofollow")},m(A,j){m(A,T,j),e(T,x),e(T,$),e($,w),e(T,M),e(T,h),e(h,k),e(T,Z),e(T,U),e(U,B),e(T,F),e(T,W),e(W,oe),e(T,Ue),e(T,S),e(S,se),e(T,Be)},d(A){A&&o(T)}}}function aB(E){let T,x,$,w,M;return w=new O({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmdwdDIlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ3B0MiUyMiklMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCJTIyVGhlJTIwZnVsbCUyMG5hbWUlMjBvZiUyMERvbmFsZCUyMGlzJTIwRG9uYWxkJTIyJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEFzdW1tYXJ5X2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCUyQyUyMG1heF9uZXdfdG9rZW5zJTNENCklMEFwcmludCh0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKHN1bW1hcnlfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTVCMCU1RCklMEElMEElMjMlMjBOb3clMjBsZXQncyUyMGNvbnRyb2wlMjBnZW5lcmF0aW9uJTIwdGhyb3VnaCUyMGElMjBiaWFzLiUyMFBsZWFzZSUyMG5vdGUlMjB0aGF0JTIwdGhlJTIwdG9rZW5pemVyJTIwaXMlMjBpbml0aWFsaXplZCUyMGRpZmZlcmVudGx5ISUwQXRva2VuaXplcl93aXRoX3ByZWZpeF9zcGFjZSUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdwdDIlMjIlMkMlMjBhZGRfcHJlZml4X3NwYWNlJTNEVHJ1ZSklMEElMEElMEFkZWYlMjBnZXRfdG9rZW5zX2FzX3R1cGxlKHdvcmQpJTNBJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwdHVwbGUodG9rZW5pemVyX3dpdGhfcHJlZml4X3NwYWNlKCU1QndvcmQlNUQlMkMlMjBhZGRfc3BlY2lhbF90b2tlbnMlM0RGYWxzZSkuaW5wdXRfaWRzJTVCMCU1RCklMEElMEElMEElMjMlMjBJZiUyMHdlJTIwYWRkJTIwYSUyMG5lZ2F0aXZlJTIwYmlhcyUyMHdpdGhvdXQlMjBiZWFtJTIwc2VhcmNoJTJDJTIwaXQlMjBtYXklMjBiZWNvbWUlMjAlMjJzdHVjayUyMiUyMGluJTIwYSUyMHByZWZpeCUyMHdpdGhvdXQlMjBnb29kJTIwY29udGludWF0aW9ucyUwQXNlcXVlbmNlX2JpYXMlMjAlM0QlMjAlN0JnZXRfdG9rZW5zX2FzX3R1cGxlKCUyMlRydW1wJTIyKSUzQSUyMC0xMC4wJTdEJTBBYmlhc2VkX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCUyQyUyMG1heF9uZXdfdG9rZW5zJTNENCUyQyUyMHNlcXVlbmNlX2JpYXMlM0RzZXF1ZW5jZV9iaWFzKSUwQXByaW50KHRva2VuaXplci5iYXRjaF9kZWNvZGUoYmlhc2VkX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSU1QjAlNUQpJTBBJTBBYmlhc2VkX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCUyQyUyMG1heF9uZXdfdG9rZW5zJTNENCUyQyUyMG51bV9iZWFtcyUzRDQlMkMlMjBzZXF1ZW5jZV9iaWFzJTNEc2VxdWVuY2VfYmlhcyklMEFwcmludCh0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKGJpYXNlZF9pZHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklNUIwJTVEKSUwQSUwQSUyMyUyMFdlJTIwY2FuJTIwYWxzbyUyMGFkZCUyMGElMjBwb3NpdGl2ZSUyMGJpYXMlMjB0byUyMG51ZGdlJTIwdGhlJTIwbW9kZWwlMjB0b3dhcmRzJTIwc3BlY2lmaWMlMjB0b2tlbnMlMjBvciUyMGNvbnRpbnVhdGlvbnMlMEFzZXF1ZW5jZV9iaWFzJTIwJTNEJTIwJTdCZ2V0X3Rva2Vuc19hc190dXBsZSglMjJEb25hbGQlMjBEdWNrJTIyKSUzQSUyMDEwLjAlN0QlMEFiaWFzZWRfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRzJTVCJTIyaW5wdXRfaWRzJTIyJTVEJTJDJTIwbWF4X25ld190b2tlbnMlM0Q0JTJDJTIwbnVtX2JlYW1zJTNENCUyQyUyMHNlcXVlbmNlX2JpYXMlM0RzZXF1ZW5jZV9iaWFzKSUwQXByaW50KHRva2VuaXplci5iYXRjaF9kZWNvZGUoYmlhc2VkX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSU1QjAlNUQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;The full name of Donald is Donald&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>summary_ids = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], max_new_tokens=<span class="hljs-number">4</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(summary_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
The full name of Donald <span class="hljs-keyword">is</span> Donald J. Trump Jr

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Now let&#x27;s control generation through a bias. Please note that the tokenizer is initialized differently!</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer_with_prefix_space = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>, add_prefix_space=<span class="hljs-literal">True</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">get_tokens_as_tuple</span>(<span class="hljs-params">word</span>):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> <span class="hljs-built_in">tuple</span>(tokenizer_with_prefix_space([word], add_special_tokens=<span class="hljs-literal">False</span>).input_ids[<span class="hljs-number">0</span>])


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># If we add a negative bias without beam search, it may become &quot;stuck&quot; in a prefix without good continuations</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>sequence_bias = {get_tokens_as_tuple(<span class="hljs-string">&quot;Trump&quot;</span>): -<span class="hljs-number">10.0</span>}
<span class="hljs-meta">&gt;&gt;&gt; </span>biased_ids = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], max_new_tokens=<span class="hljs-number">4</span>, sequence_bias=sequence_bias)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(biased_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
The full name of Donald <span class="hljs-keyword">is</span> Donald J. Donald,

<span class="hljs-meta">&gt;&gt;&gt; </span>biased_ids = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], max_new_tokens=<span class="hljs-number">4</span>, num_beams=<span class="hljs-number">4</span>, sequence_bias=sequence_bias)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(biased_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
The full name of Donald <span class="hljs-keyword">is</span> Donald Rumsfeld,

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># We can also add a positive bias to nudge the model towards specific tokens or continuations</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>sequence_bias = {get_tokens_as_tuple(<span class="hljs-string">&quot;Donald Duck&quot;</span>): <span class="hljs-number">10.0</span>}
<span class="hljs-meta">&gt;&gt;&gt; </span>biased_ids = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], max_new_tokens=<span class="hljs-number">4</span>, num_beams=<span class="hljs-number">4</span>, sequence_bias=sequence_bias)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(biased_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
The full name of Donald <span class="hljs-keyword">is</span> Donald Duck.`}}),{c(){T=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){T=n(h,"P",{});var k=r(T);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,T,k),e(T,x),m(h,$,k),f(w,h,k),M=!0},p:he,i(h){M||(_(w.$$.fragment,h),M=!0)},o(h){b(w.$$.fragment,h),M=!1},d(h){h&&o(T),h&&o($),y(w,h)}}}function iB(E){let T,x,$,w,M,h,k,Z;return{c(){T=s("p"),x=a("Make sure that "),$=s("code"),w=a("do_sample=True"),M=a(" is included in the "),h=s("code"),k=a("generate"),Z=a(` arguments otherwise the temperature value won\u2019t have
any effect.`)},l(U){T=n(U,"P",{});var B=r(T);x=i(B,"Make sure that "),$=n(B,"CODE",{});var F=r($);w=i(F,"do_sample=True"),F.forEach(o),M=i(B," is included in the "),h=n(B,"CODE",{});var W=r(h);k=i(W,"generate"),W.forEach(o),Z=i(B,` arguments otherwise the temperature value won\u2019t have
any effect.`),B.forEach(o)},m(U,B){m(U,T,B),e(T,x),e(T,$),e($,w),e(T,M),e(T,h),e(h,k),e(T,Z)},d(U){U&&o(T)}}}function cB(E){let T,x,$,w,M;return w=new O({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwc2V0X3NlZWQlMEElMEFzZXRfc2VlZCgwKSUyMCUyMCUyMyUyMGZvciUyMHJlcHJvZHVjaWJpbGl0eSUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdwdDIlMjIpJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIyZ3B0MiUyMiklMEFtb2RlbC5jb25maWcucGFkX3Rva2VuX2lkJTIwJTNEJTIwbW9kZWwuY29uZmlnLmVvc190b2tlbl9pZCUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglNUIlMjJIdWdnaW5nJTIwRmFjZSUyMENvbXBhbnklMjBpcyUyMiU1RCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBJTIzJTIwV2l0aCUyMHRlbXBlcmF0dXJlJTNEMS4wJTJDJTIwdGhlJTIwZGVmYXVsdCUyQyUyMHdlJTIwY29uc2lzdGVudGx5JTIwZ2V0JTIwcmFuZG9tJTIwb3V0cHV0cyUyMGR1ZSUyMHRvJTIwcmFuZG9tJTIwc2FtcGxpbmcuJTBBZ2VuZXJhdGVfa3dhcmdzJTIwJTNEJTIwJTdCJTIybWF4X25ld190b2tlbnMlMjIlM0ElMjAxMCUyQyUyMCUyMmRvX3NhbXBsZSUyMiUzQSUyMFRydWUlMkMlMjAlMjJ0ZW1wZXJhdHVyZSUyMiUzQSUyMDEuMCUyQyUyMCUyMm51bV9yZXR1cm5fc2VxdWVuY2VzJTIyJTNBJTIwMiU3RCUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKmlucHV0cyUyQyUyMCoqZ2VuZXJhdGVfa3dhcmdzKSUwQXByaW50KHRva2VuaXplci5iYXRjaF9kZWNvZGUob3V0cHV0cyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSklMEElMEElMjMlMjBIb3dldmVyJTJDJTIwd2l0aCUyMHRlbXBlcmF0dXJlJTIwY2xvc2UlMjB0byUyMDAlMkMlMjBpdCUyMGFwcHJveGltYXRlcyUyMGdyZWVkeSUyMGRlY29kaW5nJTIwc3RyYXRlZ2llcyUyMChpbnZhcmlhbnQpJTBBZ2VuZXJhdGVfa3dhcmdzJTVCJTIydGVtcGVyYXR1cmUlMjIlNUQlMjAlM0QlMjAwLjAwMDElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKippbnB1dHMlMkMlMjAqKmdlbmVyYXRlX2t3YXJncyklMEFwcmludCh0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKG91dHB1dHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSkp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForCausalLM, set_seed

<span class="hljs-meta">&gt;&gt;&gt; </span>set_seed(<span class="hljs-number">0</span>)  <span class="hljs-comment"># for reproducibility</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.pad_token_id = model.config.eos_token_id
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;Hugging Face Company is&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># With temperature=1.0, the default, we consistently get random outputs due to random sampling.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generate_kwargs = {<span class="hljs-string">&quot;max_new_tokens&quot;</span>: <span class="hljs-number">10</span>, <span class="hljs-string">&quot;do_sample&quot;</span>: <span class="hljs-literal">True</span>, <span class="hljs-string">&quot;temperature&quot;</span>: <span class="hljs-number">1.0</span>, <span class="hljs-string">&quot;num_return_sequences&quot;</span>: <span class="hljs-number">2</span>}
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(**inputs, **generate_kwargs)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(outputs, skip_special_tokens=<span class="hljs-literal">True</span>))
[<span class="hljs-string">&#x27;Hugging Face Company is a joint venture between GEO Group, one of&#x27;</span>,
<span class="hljs-string">&#x27;Hugging Face Company is not an exact science \u2013 but what we believe does&#x27;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># However, with temperature close to 0, it approximates greedy decoding strategies (invariant)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generate_kwargs[<span class="hljs-string">&quot;temperature&quot;</span>] = <span class="hljs-number">0.0001</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(**inputs, **generate_kwargs)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(outputs, skip_special_tokens=<span class="hljs-literal">True</span>))
[<span class="hljs-string">&#x27;Hugging Face Company is a company that has been around for over 20 years&#x27;</span>,
<span class="hljs-string">&#x27;Hugging Face Company is a company that has been around for over 20 years&#x27;</span>]`}}),{c(){T=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){T=n(h,"P",{});var k=r(T);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,T,k),e(T,x),m(h,$,k),f(w,h,k),M=!0},p:he,i(h){M||(_(w.$$.fragment,h),M=!0)},o(h){b(w.$$.fragment,h),M=!1},d(h){h&&o(T),h&&o($),y(w,h)}}}function lB(E){let T,x,$,w,M;return w=new O({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUyQyUyMHNldF9zZWVkJTBBJTBBc2V0X3NlZWQoMCklMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJkaXN0aWxncHQyJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGdwdDIlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkElMjBzZXF1ZW5jZSUzQSUyMDElMkMlMjAyJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEElMjMlMjBXaXRoJTIwc2FtcGxpbmclMkMlMjB0aGUlMjBvdXRwdXQlMjBpcyUyMHVuZXhwZWN0ZWQlMjAtLSUyMHNvbWV0aW1lcyUyMHRvbyUyMHVuZXhwZWN0ZWQuJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwZG9fc2FtcGxlJTNEVHJ1ZSklMEFwcmludCh0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKG91dHB1dHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklNUIwJTVEKSUwQSUwQSUyMyUyMFdpdGglMjAlNjB0b3BfcCU2MCUyMHNhbXBsaW5nJTJDJTIwdGhlJTIwb3V0cHV0JTIwZ2V0cyUyMHJlc3RyaWN0ZWQlMjB0byUyMGhpZ2gtcHJvYmFiaWxpdHklMjB0b2tlbnMuJTBBJTIzJTIwUHJvJTIwdGlwJTNBJTIwSW4lMjBwcmFjdGljZSUyQyUyMExMTXMlMjB1c2UlMjAlNjB0b3BfcCU2MCUyMGluJTIwdGhlJTIwMC45LTAuOTUlMjByYW5nZS4lMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKippbnB1dHMlMkMlMjBkb19zYW1wbGUlM0RUcnVlJTJDJTIwdG9wX3AlM0QwLjEpJTBBcHJpbnQodG9rZW5pemVyLmJhdGNoX2RlY29kZShvdXRwdXRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTVCMCU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForCausalLM, set_seed

<span class="hljs-meta">&gt;&gt;&gt; </span>set_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;distilgpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;distilgpt2&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;A sequence: 1, 2&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># With sampling, the output is unexpected -- sometimes too unexpected.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(**inputs, do_sample=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(outputs, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
A sequence: <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">0</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2.</span> <span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># With \`top_p\` sampling, the output gets restricted to high-probability tokens.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Pro tip: In practice, LLMs use \`top_p\` in the 0.9-0.95 range.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(**inputs, do_sample=<span class="hljs-literal">True</span>, top_p=<span class="hljs-number">0.1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(outputs, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
A sequence: <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>, <span class="hljs-number">7</span>, <span class="hljs-number">8</span>, <span class="hljs-number">9</span>`}}),{c(){T=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){T=n(h,"P",{});var k=r(T);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,T,k),e(T,x),m(h,$,k),f(w,h,k),M=!0},p:he,i(h){M||(_(w.$$.fragment,h),M=!0)},o(h){b(w.$$.fragment,h),M=!1},d(h){h&&o(T),h&&o($),y(w,h)}}}function dB(E){let T,x,$,w,M;return w=new O({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmdwdDIlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ3B0MiUyMiklMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCJTIyVG9kYXklMkMlMjBhJTIwZHJhZ29uJTIwZmxldyUyMG92ZXIlMjBQYXJpcyUyQyUyMEZyYW5jZSUyQyUyMiU1RCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0JTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRzJTVCJTIyaW5wdXRfaWRzJTIyJTVEJTJDJTIwZ3VpZGFuY2Vfc2NhbGUlM0QxLjUpJTBBdG9rZW5pemVyLmJhdGNoX2RlY29kZShvdXQlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklNUIwJTVEJTBBJTBBJTIzJTIwd2l0aCUyMGElMjBuZWdhdGl2ZSUyMHByb21wdCUwQW5lZ19pbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCJTIyQSUyMHZlcnklMjBoYXBweSUyMGV2ZW50JTIwaGFwcGVuZWQlMkMlMjIlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dCUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCUyQyUyMGd1aWRhbmNlX3NjYWxlJTNEMiUyQyUyMG5lZ2F0aXZlX3Byb21wdF9pZHMlM0RuZWdfaW5wdXRzJTVCJTIyaW5wdXRfaWRzJTIyJTVEKSUwQXRva2VuaXplci5iYXRjaF9kZWNvZGUob3V0JTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTVCMCU1RCUwQSUwQSUyMyUyMHdpdGglMjBhJTIwcG9zaXRpdmUlMjBwcm9tcHQlMEFuZWdfaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCU1QiUyMkElMjB2ZXJ5JTIwaGFwcHklMjBldmVudCUyMGhhcHBlbmVkJTJDJTIyJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXQlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZShpbnB1dHMlNUIlMjJpbnB1dF9pZHMlMjIlNUQlMkMlMjBndWlkYW5jZV9zY2FsZSUzRDAlMkMlMjBuZWdhdGl2ZV9wcm9tcHRfaWRzJTNEbmVnX2lucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCklMEF0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKG91dCUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;Today, a dragon flew over Paris, France,&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>out = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], guidance_scale=<span class="hljs-number">1.5</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(out, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&#x27;Today, a dragon flew over Paris, France, killing at least 50 people and injuring more than 100&#x27;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># with a negative prompt</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>neg_inputs = tokenizer([<span class="hljs-string">&quot;A very happy event happened,&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>out = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], guidance_scale=<span class="hljs-number">2</span>, negative_prompt_ids=neg_inputs[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(out, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&#x27;Today, a dragon flew over Paris, France, killing at least 130 people. French media reported that&#x27;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># with a positive prompt</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>neg_inputs = tokenizer([<span class="hljs-string">&quot;A very happy event happened,&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>out = model.generate(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], guidance_scale=<span class="hljs-number">0</span>, negative_prompt_ids=neg_inputs[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(out, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&quot;Today, a dragon flew over Paris, France, and I&#x27;m very happy to be here. I&quot;</span>`}}),{c(){T=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){T=n(h,"P",{});var k=r(T);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,T,k),e(T,x),m(h,$,k),f(w,h,k),M=!0},p:he,i(h){M||(_(w.$$.fragment,h),M=!0)},o(h){b(w.$$.fragment,h),M=!1},d(h){h&&o(T),h&&o($),y(w,h)}}}function pB(E){let T,x;return T=new O({props:{code:"Y29tcGxldGVkJTIwJTNEJTIwRmFsc2UlMEF3aGlsZSUyMG5vdCUyMGNvbXBsZXRlZCUzQSUwQSUyMCUyMCUyMCUyMF8lMkMlMjBjb21wbGV0ZWQlMjAlM0QlMjBjb25zdHJhaW50LnVwZGF0ZShjb25zdHJhaW50LmFkdmFuY2UoKSk=",highlighted:`completed = <span class="hljs-literal">False</span>
<span class="hljs-keyword">while</span> <span class="hljs-keyword">not</span> completed:
    _, completed = constraint.update(constraint.advance())`}}),{c(){g(T.$$.fragment)},l($){u(T.$$.fragment,$)},m($,w){f(T,$,w),x=!0},p:he,i($){x||(_(T.$$.fragment,$),x=!0)},o($){b(T.$$.fragment,$),x=!1},d($){y(T,$)}}}function mB(E){let T,x;return{c(){T=s("p"),x=a("The API for the streamer classes is still under development and may change in the future.")},l($){T=n($,"P",{});var w=r(T);x=i(w,"The API for the streamer classes is still under development and may change in the future."),w.forEach(o)},m($,w){m($,T,w),e(T,x)},d($){$&&o(T)}}}function hB(E){let T,x,$,w,M;return w=new O({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwQXV0b1Rva2VuaXplciUyQyUyMFRleHRTdHJlYW1lciUwQSUwQXRvayUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdwdDIlMjIpJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIyZ3B0MiUyMiklMEFpbnB1dHMlMjAlM0QlMjB0b2soJTVCJTIyQW4lMjBpbmNyZWFzaW5nJTIwc2VxdWVuY2UlM0ElMjBvbmUlMkMlMjIlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXN0cmVhbWVyJTIwJTNEJTIwVGV4dFN0cmVhbWVyKHRvayklMEElMEElMjMlMjBEZXNwaXRlJTIwcmV0dXJuaW5nJTIwdGhlJTIwdXN1YWwlMjBvdXRwdXQlMkMlMjB0aGUlMjBzdHJlYW1lciUyMHdpbGwlMjBhbHNvJTIwcHJpbnQlMjB0aGUlMjBnZW5lcmF0ZWQlMjB0ZXh0JTIwdG8lMjBzdGRvdXQuJTBBXyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwc3RyZWFtZXIlM0RzdHJlYW1lciUyQyUyMG1heF9uZXdfdG9rZW5zJTNEMjAp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, AutoTokenizer, TextStreamer

<span class="hljs-meta">&gt;&gt;&gt; </span>tok = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tok([<span class="hljs-string">&quot;An increasing sequence: one,&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>streamer = TextStreamer(tok)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Despite returning the usual output, the streamer will also print the generated text to stdout.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>_ = model.generate(**inputs, streamer=streamer, max_new_tokens=<span class="hljs-number">20</span>)
An increasing sequence: one, two, three, four, five, six, seven, eight, nine, ten, eleven,`}}),{c(){T=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){T=n(h,"P",{});var k=r(T);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,T,k),e(T,x),m(h,$,k),f(w,h,k),M=!0},p:he,i(h){M||(_(w.$$.fragment,h),M=!0)},o(h){b(w.$$.fragment,h),M=!1},d(h){h&&o(T),h&&o($),y(w,h)}}}function gB(E){let T,x;return{c(){T=s("p"),x=a("The API for the streamer classes is still under development and may change in the future.")},l($){T=n($,"P",{});var w=r(T);x=i(w,"The API for the streamer classes is still under development and may change in the future."),w.forEach(o)},m($,w){m($,T,w),e(T,x)},d($){$&&o(T)}}}function uB(E){let T,x,$,w,M;return w=new O({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwQXV0b1Rva2VuaXplciUyQyUyMFRleHRJdGVyYXRvclN0cmVhbWVyJTBBZnJvbSUyMHRocmVhZGluZyUyMGltcG9ydCUyMFRocmVhZCUwQSUwQXRvayUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdwdDIlMjIpJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIyZ3B0MiUyMiklMEFpbnB1dHMlMjAlM0QlMjB0b2soJTVCJTIyQW4lMjBpbmNyZWFzaW5nJTIwc2VxdWVuY2UlM0ElMjBvbmUlMkMlMjIlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXN0cmVhbWVyJTIwJTNEJTIwVGV4dEl0ZXJhdG9yU3RyZWFtZXIodG9rKSUwQSUwQSUyMyUyMFJ1biUyMHRoZSUyMGdlbmVyYXRpb24lMjBpbiUyMGElMjBzZXBhcmF0ZSUyMHRocmVhZCUyQyUyMHNvJTIwdGhhdCUyMHdlJTIwY2FuJTIwZmV0Y2glMjB0aGUlMjBnZW5lcmF0ZWQlMjB0ZXh0JTIwaW4lMjBhJTIwbm9uLWJsb2NraW5nJTIwd2F5LiUwQWdlbmVyYXRpb25fa3dhcmdzJTIwJTNEJTIwZGljdChpbnB1dHMlMkMlMjBzdHJlYW1lciUzRHN0cmVhbWVyJTJDJTIwbWF4X25ld190b2tlbnMlM0QyMCklMEF0aHJlYWQlMjAlM0QlMjBUaHJlYWQodGFyZ2V0JTNEbW9kZWwuZ2VuZXJhdGUlMkMlMjBrd2FyZ3MlM0RnZW5lcmF0aW9uX2t3YXJncyklMEF0aHJlYWQuc3RhcnQoKSUwQWdlbmVyYXRlZF90ZXh0JTIwJTNEJTIwJTIyJTIyJTBBZm9yJTIwbmV3X3RleHQlMjBpbiUyMHN0cmVhbWVyJTNBJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdGVkX3RleHQlMjAlMkIlM0QlMjBuZXdfdGV4dCUwQWdlbmVyYXRlZF90ZXh0",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> threading <span class="hljs-keyword">import</span> Thread

<span class="hljs-meta">&gt;&gt;&gt; </span>tok = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tok([<span class="hljs-string">&quot;An increasing sequence: one,&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>streamer = TextIteratorStreamer(tok)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Run the generation in a separate thread, so that we can fetch the generated text in a non-blocking way.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generation_kwargs = <span class="hljs-built_in">dict</span>(inputs, streamer=streamer, max_new_tokens=<span class="hljs-number">20</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>thread = Thread(target=model.generate, kwargs=generation_kwargs)
<span class="hljs-meta">&gt;&gt;&gt; </span>thread.start()
<span class="hljs-meta">&gt;&gt;&gt; </span>generated_text = <span class="hljs-string">&quot;&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> new_text <span class="hljs-keyword">in</span> streamer:
<span class="hljs-meta">... </span>    generated_text += new_text
<span class="hljs-meta">&gt;&gt;&gt; </span>generated_text
<span class="hljs-string">&#x27;An increasing sequence: one, two, three, four, five, six, seven, eight, nine, ten, eleven,&#x27;</span>`}}),{c(){T=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){T=n(h,"P",{});var k=r(T);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,T,k),e(T,x),m(h,$,k),f(w,h,k),M=!0},p:he,i(h){M||(_(w.$$.fragment,h),M=!0)},o(h){b(w.$$.fragment,h),M=!1},d(h){h&&o(T),h&&o($),y(w,h)}}}function fB(E){let T,x,$,w,M,h,k,Z,U,B,F,W,oe,Ue,S,se,Be,A,j,Kt,eo,xe,to,oo,Cc,WT,VT,Nc,ZT,GT,Xc,CT,NT,Rc,XT,RT,t_,Oc,OT,o_,so,Ho,mh,Mn,AT,hh,HT,s_,Me,QT,Ac,YT,KT,Hc,ev,tv,Qc,ov,sv,n_,Yc,nv,r_,En,a_,Pt,rv,gh,av,iv,Kc,cv,lv,i_,Ee,el,uh,dv,pv,mv,tl,fh,hv,gv,uv,ol,_h,fv,_v,bv,sl,bh,yv,Tv,c_,V,vv,yh,wv,$v,Th,kv,xv,vh,Mv,Ev,wh,jv,Fv,$h,Lv,zv,kh,Jv,Iv,l_,ne,Uv,xh,Bv,qv,Mh,Dv,Sv,Eh,Pv,Wv,jh,Vv,Zv,d_,re,Gv,Fh,Cv,Nv,Lh,Xv,Rv,zh,Ov,Av,Jh,Hv,Qv,p_,jn,m_,Qo,Yv,Ih,Kv,e1,h_,ae,t1,Uh,o1,s1,Bh,n1,r1,qh,a1,i1,Dh,c1,l1,g_,nl,d1,u_,no,Yo,Sh,Fn,p1,Ph,m1,f_,ro,Ln,h1,Wh,g1,__,ao,zn,u1,Vh,f1,b_,io,Jn,_1,Zh,b1,y_,co,In,y1,Gh,T1,T_,lo,Un,v1,Ch,w1,v_,po,Bn,$1,Nh,k1,w_,mo,qn,x1,Xh,M1,$_,ho,Dn,E1,Rh,j1,k_,go,Sn,F1,Oh,L1,x_,uo,Pn,z1,Ah,J1,M_,fo,Ko,Hh,Wn,I1,Qh,U1,E_,_o,Vn,B1,Yh,q1,j_,bo,Zn,D1,Kh,S1,F_,yo,Gn,P1,eg,W1,L_,To,Cn,V1,tg,Z1,z_,vo,Nn,G1,og,C1,J_,wo,Xn,N1,sg,X1,I_,$o,Rn,R1,ng,O1,U_,ko,On,A1,rg,H1,B_,xo,An,Q1,ag,Y1,q_,Mo,Hn,K1,ig,e2,D_,Eo,es,cg,Qn,t2,lg,o2,S_,qe,Yn,s2,dg,n2,r2,ts,Kn,a2,pg,i2,P_,De,er,c2,mg,l2,d2,os,tr,p2,hg,m2,W_,Se,or,h2,gg,g2,u2,ss,sr,f2,ug,_2,V_,jo,ns,fg,nr,b2,_g,y2,Z_,rs,T2,rl,v2,w2,G_,Fo,as,bg,rr,$2,yg,k2,C_,Pe,ar,x2,is,al,M2,E2,Tg,j2,F2,L2,il,ir,N_,ge,cr,z2,lr,J2,vg,I2,U2,B2,dr,q2,pr,D2,S2,P2,cl,mr,X_,We,hr,W2,cs,ll,V2,Z2,gr,G2,C2,N2,dl,ur,R_,Ve,fr,X2,pl,ml,R2,O2,A2,hl,_r,O_,ue,br,H2,Wt,gl,Q2,Y2,wg,K2,ew,yr,tw,ow,sw,ls,nw,ul,Tr,A_,fe,vr,rw,D,fl,aw,iw,$g,cw,lw,kg,dw,pw,xg,mw,hw,wr,gw,uw,Mg,fw,_w,Eg,bw,yw,jg,Tw,vw,ww,ds,$w,_l,$r,H_,Ze,kr,kw,bl,yl,xw,Mw,Ew,Tl,xr,Q_,Ge,Mr,jw,vl,wl,Fw,Lw,zw,$l,Er,Y_,Ce,jr,Jw,ps,kl,Iw,Uw,Fg,Bw,qw,Dw,xl,Fr,K_,Ne,Lr,Sw,zr,Pw,Lg,Ww,Vw,Zw,Ml,Jr,eb,L,Ir,Gw,El,jl,Cw,Nw,Xw,Lo,Rw,Fl,Ow,Aw,Ur,Hw,Qw,Yw,ms,Kw,hs,e$,Br,t$,zg,o$,s$,n$,Jg,r$,a$,zo,Ll,Ig,i$,c$,l$,zl,Ug,d$,p$,m$,Jl,Bg,h$,g$,u$,qg,f$,_$,qr,Il,Dg,b$,y$,T$,Ul,Sg,v$,w$,$$,gs,k$,Bl,Dr,tb,Xe,Sr,x$,Vt,ql,M$,E$,Pg,j$,F$,Wg,L$,z$,J$,Dl,Pr,ob,Re,Wr,I$,us,Sl,U$,B$,Pl,q$,D$,S$,Wl,Vr,sb,Oe,Zr,P$,Vg,W$,V$,Vl,Gr,nb,Ae,Cr,Z$,G,G$,Zl,C$,N$,Gl,X$,R$,Zg,O$,A$,Gg,Cg,H$,Q$,Cl,Y$,K$,Nl,ek,tk,ok,Xl,Nr,rb,He,Xr,sk,Ng,nk,rk,Rl,Rr,ab,Qe,Or,ak,Ol,Al,ik,ck,lk,Hl,Ar,ib,_e,Hr,dk,je,Ql,pk,mk,Xg,hk,gk,Rg,uk,fk,Og,_k,bk,yk,fs,Tk,Yl,Qr,cb,H,Yr,vk,Kl,ed,wk,$k,kk,_s,xk,bs,Mk,td,Kr,lb,Q,ea,Ek,Jo,jk,od,Fk,Lk,ta,zk,Jk,Ik,ys,Uk,Ts,Bk,sd,oa,db,Ye,sa,qk,vs,nd,Dk,Sk,na,Pk,Wk,Vk,rd,ra,pb,be,aa,Zk,ws,ad,Gk,Ck,ia,Nk,Xk,Rk,$s,Ok,id,ca,mb,Y,la,Ak,cd,ld,Hk,Qk,Yk,ks,Kk,xs,e0,dd,da,hb,Ke,pa,t0,Fe,pd,o0,s0,Ag,n0,r0,Hg,a0,i0,Qg,c0,l0,d0,md,ma,gb,et,ha,p0,ga,m0,Yg,h0,g0,u0,hd,ua,ub,K,fa,f0,gd,ud,_0,b0,y0,Ms,T0,Es,v0,fd,_a,fb,tt,ba,w0,_d,bd,$0,k0,x0,yd,ya,_b,ye,Ta,M0,Td,vd,E0,j0,F0,js,L0,wd,va,bb,ot,wa,z0,Fs,$d,J0,I0,$a,U0,B0,q0,kd,ka,yb,ee,xa,D0,st,S0,Kg,P0,W0,eu,V0,Z0,tu,G0,C0,N0,Ma,X0,Ea,R0,O0,A0,Ls,H0,xd,ja,Tb,Te,Fa,Q0,La,Y0,ou,K0,ex,tx,za,ox,Ja,sx,nx,rx,Md,Ia,vb,Io,zs,su,Ua,ax,nu,ix,wb,nt,Ba,cx,Ed,jd,lx,dx,px,Fd,qa,$b,rt,Da,mx,Js,Ld,hx,gx,ru,ux,fx,_x,zd,Sa,kb,at,Pa,bx,Uo,yx,au,Tx,vx,iu,wx,$x,kx,Jd,Wa,xb,it,Va,xx,cu,Mx,Ex,Is,Za,jx,lu,Fx,Mb,ct,Ga,Lx,ve,zx,Id,Jx,Ix,du,Ux,Bx,pu,mu,qx,Dx,Ud,Sx,Px,Wx,Bd,Ca,Eb,lt,Na,Vx,hu,Zx,Gx,Us,Xa,Cx,gu,Nx,jb,dt,Ra,Xx,qd,Dd,Rx,Ox,Ax,Sd,Oa,Fb,pt,Aa,Hx,Pd,Wd,Qx,Yx,Kx,Vd,Ha,Lb,mt,Qa,eM,Bs,Zd,tM,oM,Ya,sM,nM,rM,Gd,Ka,zb,ht,ei,aM,Cd,Nd,iM,cM,lM,Xd,ti,Jb,gt,oi,dM,Le,Rd,pM,mM,uu,hM,gM,fu,uM,fM,_u,_M,bM,yM,Od,si,Ib,ut,ni,TM,ri,vM,bu,wM,$M,kM,Ad,ai,Ub,ft,ii,xM,Hd,Qd,MM,EM,jM,Yd,ci,Bb,_t,li,FM,Kd,ep,LM,zM,JM,tp,di,qb,bt,pi,IM,op,sp,UM,BM,qM,np,mi,Db,Bo,qs,yu,hi,DM,Tu,SM,Sb,yt,gi,PM,rp,ap,WM,VM,ZM,ip,ui,Pb,Tt,fi,GM,Ds,cp,CM,NM,vu,XM,RM,OM,lp,_i,Wb,vt,bi,AM,Ss,dp,HM,QM,wu,YM,KM,e4,pp,yi,Vb,wt,Ti,t4,$u,o4,s4,Ps,vi,n4,ku,r4,Zb,$t,wi,a4,C,i4,mp,c4,l4,hp,d4,p4,xu,m4,h4,Mu,Eu,g4,u4,gp,f4,_4,up,b4,y4,T4,fp,$i,Gb,kt,ki,v4,ju,w4,$4,Ws,xi,k4,Fu,x4,Cb,xt,Mi,M4,_p,bp,E4,j4,F4,yp,Ei,Nb,Mt,ji,L4,ze,Tp,z4,J4,Lu,I4,U4,zu,B4,q4,Ju,D4,S4,P4,vp,Fi,Xb,Et,Li,W4,Vs,wp,V4,Z4,Iu,G4,C4,N4,$p,zi,Rb,jt,Ji,X4,kp,xp,R4,O4,A4,Mp,Ii,Ob,Ft,Ui,H4,Ep,jp,Q4,Y4,K4,Fp,Bi,Ab,Lt,qi,eE,Lp,zp,tE,oE,sE,Jp,Di,Hb,zt,Si,nE,Pi,rE,Uu,aE,iE,cE,Ip,Wi,Qb,qo,Zs,Bu,Vi,lE,qu,dE,Yb,Gs,pE,Up,mE,hE,Kb,Jt,Zi,gE,Du,uE,fE,Bp,Gi,ey,Do,Ci,_E,qp,Ni,ty,It,Xi,bE,Ri,yE,Su,TE,vE,wE,Dp,Oi,oy,Ut,Ai,$E,Hi,kE,Pu,xE,ME,EE,Sp,Qi,sy,So,Cs,Wu,Yi,jE,Vu,FE,ny,Ns,LE,Pp,zE,JE,ry,z,Ki,IE,Zu,UE,BE,Gu,qE,DE,Xs,SE,Cu,PE,WE,Rs,ec,VE,Nu,ZE,GE,Os,tc,CE,Xu,NE,XE,As,oc,RE,Ru,OE,AE,Hs,sc,HE,nc,QE,Ou,YE,KE,ej,Qs,rc,tj,Au,oj,sj,Ys,ac,nj,Hu,rj,aj,Zt,ic,ij,cc,cj,Qu,lj,dj,pj,Yu,mj,ay,Po,lc,hj,Wp,Vp,gj,uj,iy,Wo,dc,fj,pc,_j,Zp,bj,yj,cy,we,mc,Tj,Ku,vj,wj,R,hc,$j,ef,kj,xj,Vo,Mj,tf,Ej,jj,of,Fj,Lj,zj,sf,nf,Jj,Ij,Bt,Uj,rf,Bj,qj,af,Dj,Sj,cf,Pj,Wj,Vj,lf,Zj,Gj,Ks,gc,Cj,df,Nj,ly,Zo,en,pf,uc,Xj,mf,Rj,dy,$e,fc,Oj,Go,Aj,Gp,Hj,Qj,Cp,Yj,Kj,eF,Np,_c,tF,Xp,bc,py,N,yc,oF,Rp,Op,sF,nF,rF,Tc,aF,vc,iF,cF,lF,Ap,dF,wc,pF,mF,Hp,$c,hF,Qp,kc,my,ke,xc,gF,Yp,Kp,uF,fF,_F,em,Mc,bF,tm,Ec,hy,Co,tn,hf,jc,yF,gf,TF,gy,qt,Fc,vF,uf,wF,$F,om,kF,Lc,xF,uy,Dt,zc,MF,ff,EF,jF,sm,FF,Jc,LF,fy,No,on,_f,Ic,zF,bf,JF,_y,P,Uc,IF,yf,UF,BF,sn,qF,nn,DF,rn,Bc,SF,Tf,PF,WF,an,qc,VF,vf,ZF,GF,cn,Dc,CF,wf,NF,by,te,Sc,XF,$f,RF,OF,ln,AF,dn,HF,pn,Pc,QF,kf,YF,yy;return h=new pe({}),Mn=new pe({}),En=new O({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEdQVDJUb2tlbml6ZXIlMkMlMjBHUFQyTE1IZWFkTW9kZWwlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBHUFQyVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJncHQyJTIyKSUwQW1vZGVsJTIwJTNEJTIwR1BUMkxNSGVhZE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJncHQyJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIwYW5kJTIwJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFnZW5lcmF0aW9uX291dHB1dCUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwcmV0dXJuX2RpY3RfaW5fZ2VuZXJhdGUlM0RUcnVlJTJDJTIwb3V0cHV0X3Njb3JlcyUzRFRydWUp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GPT2Tokenizer, GPT2LMHeadModel

tokenizer = GPT2Tokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)
model = GPT2LMHeadModel.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)

inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute and &quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
generation_output = model.generate(**inputs, return_dict_in_generate=<span class="hljs-literal">True</span>, output_scores=<span class="hljs-literal">True</span>)`}}),jn=new O({props:{code:"Z2VuZXJhdGlvbl9vdXRwdXQlNUIlM0EyJTVE",highlighted:'generation_output[:<span class="hljs-number">2</span>]'}}),Fn=new pe({}),Ln=new v({props:{name:"class transformers.generation.GreedySearchEncoderDecoderOutput",anchor:"transformers.generation.GreedySearchEncoderDecoderOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for
each generated token), with each tensor of shape <code>(batch_size, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.encoder_hidden_states",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L184"}}),zn=new v({props:{name:"class transformers.generation.GreedySearchDecoderOnlyOutput",anchor:"transformers.generation.GreedySearchDecoderOnlyOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.GreedySearchDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.GreedySearchDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for
each generated token), with each tensor of shape <code>(batch_size, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.GreedySearchDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.GreedySearchDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L88"}}),Jn=new v({props:{name:"class transformers.generation.SampleEncoderDecoderOutput",anchor:"transformers.generation.SampleEncoderDecoderOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.SampleEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for
each generated token), with each tensor of shape <code>(batch_size*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer of the decoder) of shape
<code>(batch_size*num_return_sequences, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.encoder_hidden_states",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size*num_return_sequences, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_return_sequences, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_return_sequences, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L255"}}),In=new v({props:{name:"class transformers.generation.SampleDecoderOnlyOutput",anchor:"transformers.generation.SampleDecoderOnlyOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.SampleDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.SampleDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for
each generated token), with each tensor of shape <code>(batch_size*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.SampleDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(num_return_sequences*batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.SampleDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(num_return_sequences*batch_size, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L226"}}),Un=new v({props:{name:"class transformers.generation.BeamSearchEncoderDecoderOutput",anchor:"transformers.generation.BeamSearchEncoderDecoderOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"sequences_scores",val:": typing.Optional[torch.FloatTensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size*num_return_sequences)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam transition scores for each vocabulary token at each generation step. Beam transition scores consisting
of log probabilities of tokens conditioned on log softmax of previously generated tokens in this beam.
Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>torch.LongTensor</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>torch.LongTensor</code> of shape
<code>(batch_size*num_return_sequences, sequence_length)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.encoder_hidden_states",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size*num_beams*num_return_sequences, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams*num_return_sequences, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams*num_return_sequences, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L333"}}),Bn=new v({props:{name:"class transformers.generation.BeamSearchDecoderOnlyOutput",anchor:"transformers.generation.BeamSearchDecoderOnlyOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"sequences_scores",val:": typing.Optional[torch.FloatTensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size*num_return_sequences)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam transition scores for each vocabulary token at each generation step. Beam transition scores consisting
of log probabilities of tokens conditioned on log softmax of previously generated tokens in this beam.
Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>torch.LongTensor</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>torch.LongTensor</code> of shape
<code>(batch_size*num_return_sequences, sequence_length)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams*num_return_sequences, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L298"}}),qn=new v({props:{name:"class transformers.generation.BeamSampleEncoderDecoderOutput",anchor:"transformers.generation.BeamSampleEncoderDecoderOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"sequences_scores",val:": typing.Optional[torch.FloatTensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_beams, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_return_sequence)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam transition scores for each vocabulary token at each generation step. Beam transition scores consisting
of log probabilities of tokens conditioned on log softmax of previously generated tokens in this beam.
Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams, config.vocab_size)</code>).`,name:"scores"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>torch.LongTensor</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>torch.LongTensor</code> of shape
<code>(batch_size*num_return_sequences, sequence_length)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.encoder_hidden_states",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size*num_beams, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L418"}}),Dn=new v({props:{name:"class transformers.generation.BeamSampleDecoderOnlyOutput",anchor:"transformers.generation.BeamSampleDecoderOnlyOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"sequences_scores",val:": typing.Optional[torch.FloatTensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_return_sequence)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam transition scores for each vocabulary token at each generation step. Beam transition scores consisting
of log probabilities of tokens conditioned on log softmax of previously generated tokens in this beam.
Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>torch.LongTensor</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>torch.LongTensor</code> of shape
<code>(batch_size*num_return_sequences, sequence_length)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L383"}}),Sn=new v({props:{name:"class transformers.generation.ContrastiveSearchEncoderDecoderOutput",anchor:"transformers.generation.ContrastiveSearchEncoderDecoderOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.ContrastiveSearchEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.ContrastiveSearchEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for
each generated token), with each tensor of shape <code>(batch_size, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.ContrastiveSearchEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.ContrastiveSearchEncoderDecoderOutput.encoder_hidden_states",description:`<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>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.ContrastiveSearchEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.ContrastiveSearchEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.ContrastiveSearchEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(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>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L116"}}),Pn=new v({props:{name:"class transformers.generation.ContrastiveSearchDecoderOnlyOutput",anchor:"transformers.generation.ContrastiveSearchDecoderOnlyOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.ContrastiveSearchDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.ContrastiveSearchDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when &#x2014;
<code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for
each generated token), with each tensor of shape <code>(batch_size, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.ContrastiveSearchDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.ContrastiveSearchDecoderOnlyOutput.hidden_states",description:"<strong>hidden_states</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is &#x2014;",name:"hidden_states"},{anchor:"transformers.generation.ContrastiveSearchDecoderOnlyOutput.passed",description:`<strong>passed</strong> or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, generated_length, hidden_size)</code>.`,name:"passed"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L155"}}),Wn=new pe({}),Vn=new v({props:{name:"class transformers.generation.TFGreedySearchEncoderDecoderOutput",anchor:"transformers.generation.TFGreedySearchEncoderDecoderOutput",parameters:[{name:"sequences",val:": Tensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.TFGreedySearchEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.TFGreedySearchEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(tf.Tensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>tf.Tensor</code> with up to <code>max_new_tokens</code> elements (one element for each
generated token), with each tensor of shape <code>(batch_size, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.TFGreedySearchEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.TFGreedySearchEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.TFGreedySearchEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.TFGreedySearchEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.TFGreedySearchEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L86"}}),Zn=new v({props:{name:"class transformers.generation.TFGreedySearchDecoderOnlyOutput",anchor:"transformers.generation.TFGreedySearchDecoderOnlyOutput",parameters:[{name:"sequences",val:": Tensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.TFGreedySearchDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.TFGreedySearchDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(tf.Tensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>tf.Tensor</code> with up to <code>max_new_tokens</code> elements (one element for each
generated token), with each tensor of shape <code>(batch_size, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.TFGreedySearchDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.TFGreedySearchDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L58"}}),Gn=new v({props:{name:"class transformers.generation.TFSampleEncoderDecoderOutput",anchor:"transformers.generation.TFSampleEncoderDecoderOutput",parameters:[{name:"sequences",val:": Tensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.TFSampleEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>tf.Tensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.TFSampleEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(tf.Tensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>tf.Tensor</code> with up to <code>max_new_tokens</code> elements (one element for each
generated token), with each tensor of shape <code>(batch_size*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.TFSampleEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer of the decoder) of shape <code>(batch_size*num_return_sequences, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.TFSampleEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size*num_return_sequences, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.TFSampleEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size*num_return_sequences, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.TFSampleEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.TFSampleEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size*num_return_sequences, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L156"}}),Cn=new v({props:{name:"class transformers.generation.TFSampleDecoderOnlyOutput",anchor:"transformers.generation.TFSampleDecoderOnlyOutput",parameters:[{name:"sequences",val:": Tensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.TFSampleDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>tf.Tensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.TFSampleDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(tf.Tensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>tf.Tensor</code> with up to <code>max_new_tokens</code> elements (one element for each
generated token), with each tensor of shape <code>(batch_size*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.TFSampleDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(num_return_sequences*batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.TFSampleDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(num_return_sequences*batch_size, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L128"}}),Nn=new v({props:{name:"class transformers.generation.TFBeamSearchEncoderDecoderOutput",anchor:"transformers.generation.TFBeamSearchEncoderDecoderOutput",parameters:[{name:"sequences",val:": Tensor = None"},{name:"sequences_scores",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"beam_indices",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.TFBeamSearchEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>tf.Tensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.TFBeamSearchEncoderDecoderOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size*num_return_sequences)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.TFBeamSearchEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(tf.Tensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed beam scores for each vocabulary token at each generation step. Beam scores consisting of log
softmax scores for each vocabulary token and sum of log softmax of previously generated tokens in this
beam. <code>Tuple of </code>tf.Tensor<code>with up to</code>max_new_tokens<code>elements (one element for each generated token), with each tensor of shape</code>(batch_size*num_beams, config.vocab_size)\`.`,name:"scores"},{anchor:"transformers.generation.TFBeamSearchEncoderDecoderOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>tf.Tensor</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>tf.Tensor</code> of shape
<code>(batch_size*num_return_sequences, sequence_length)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.TFBeamSearchEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.TFBeamSearchEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size*num_beams*num_return_sequences, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.TFBeamSearchEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size*num_beams*num_return_sequences, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.TFBeamSearchEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.TFBeamSearchEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size*num_beams*num_return_sequences, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L233"}}),Xn=new v({props:{name:"class transformers.generation.TFBeamSearchDecoderOnlyOutput",anchor:"transformers.generation.TFBeamSearchDecoderOnlyOutput",parameters:[{name:"sequences",val:": Tensor = None"},{name:"sequences_scores",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"beam_indices",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.TFBeamSearchDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>tf.Tensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.TFBeamSearchDecoderOnlyOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size*num_return_sequences)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.TFBeamSearchDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(tf.Tensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed beam scores for each vocabulary token at each generation step. Beam scores consisting of log
softmax scores for each vocabulary token and sum of log softmax of previously generated tokens in this
beam. Tuple of <code>tf.Tensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.TFBeamSearchDecoderOnlyOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>tf.Tensor</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>tf.Tensor</code> of shape
<code>(batch_size*num_return_sequences, sequence_length)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.TFBeamSearchDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size*num_beams, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.TFBeamSearchDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size*num_beams*num_return_sequences, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L198"}}),Rn=new v({props:{name:"class transformers.generation.TFBeamSampleEncoderDecoderOutput",anchor:"transformers.generation.TFBeamSampleEncoderDecoderOutput",parameters:[{name:"sequences",val:": Tensor = None"},{name:"sequences_scores",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"beam_indices",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.TFBeamSampleEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>tf.Tensor</code> of shape <code>(batch_size*num_beams, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.TFBeamSampleEncoderDecoderOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size * num_return_sequence)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.TFBeamSampleEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(tf.Tensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed beam scores for each vocabulary token at each generation step. Beam scores consisting of log
softmax scores for each vocabulary token and sum of log softmax of previously generated tokens in this
beam. Tuple of <code>tf.Tensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.TFBeamSampleEncoderDecoderOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>tf.Tensor</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>tf.Tensor</code> of shape
<code>(batch_size*num_return_sequences, sequence_length)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.TFBeamSampleEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.TFBeamSampleEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size*num_beams, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.TFBeamSampleEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size*num_beams, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.TFBeamSampleEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.TFBeamSampleEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size*num_beams, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L318"}}),On=new v({props:{name:"class transformers.generation.TFBeamSampleDecoderOnlyOutput",anchor:"transformers.generation.TFBeamSampleDecoderOnlyOutput",parameters:[{name:"sequences",val:": Tensor = None"},{name:"sequences_scores",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"beam_indices",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.TFBeamSampleDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>tf.Tensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.TFBeamSampleDecoderOnlyOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size * num_return_sequence)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.TFBeamSampleDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(tf.Tensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed beam scores for each vocabulary token at each generation step. Beam scores consisting of log
softmax scores for each vocabulary token and sum of log softmax of previously generated tokens in this
beam. Tuple of <code>tf.Tensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.TFBeamSampleDecoderOnlyOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>tf.Tensor</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>tf.Tensor</code> of shape
<code>(batch_size*num_return_sequences, sequence_length)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.TFBeamSampleDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size*num_beams, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.TFBeamSampleDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size*num_beams, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L283"}}),An=new v({props:{name:"class transformers.generation.TFContrastiveSearchEncoderDecoderOutput",anchor:"transformers.generation.TFContrastiveSearchEncoderDecoderOutput",parameters:[{name:"sequences",val:": Tensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.TFContrastiveSearchEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.TFContrastiveSearchEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(tf.Tensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>tf.Tensor</code> with up to <code>max_new_tokens</code> elements (one element for each
generated token), with each tensor of shape <code>(batch_size, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.TFContrastiveSearchEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.TFContrastiveSearchEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.TFContrastiveSearchEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.TFContrastiveSearchEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.TFContrastiveSearchEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L394"}}),Hn=new v({props:{name:"class transformers.generation.TFContrastiveSearchDecoderOnlyOutput",anchor:"transformers.generation.TFContrastiveSearchDecoderOnlyOutput",parameters:[{name:"sequences",val:": Tensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.TFContrastiveSearchDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.TFContrastiveSearchDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(tf.Tensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>tf.Tensor</code> with up to <code>max_new_tokens</code> elements (one element for each
generated token), with each tensor of shape <code>(batch_size, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.TFContrastiveSearchDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.TFContrastiveSearchDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L367"}}),Qn=new pe({}),Yn=new v({props:{name:"class transformers.generation.FlaxSampleOutput",anchor:"transformers.generation.FlaxSampleOutput",parameters:[{name:"sequences",val:": Array = None"}],parametersDescription:[{anchor:"transformers.generation.FlaxSampleOutput.sequences",description:`<strong>sequences</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, max_length)</code>) &#x2014;
The generated sequences.`,name:"sequences"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_utils.py#L69"}}),Kn=new v({props:{name:"replace",anchor:"transformers.generation.FlaxSampleOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/flax/struct.py#L111"}}),er=new v({props:{name:"class transformers.generation.FlaxGreedySearchOutput",anchor:"transformers.generation.FlaxGreedySearchOutput",parameters:[{name:"sequences",val:": Array = None"}],parametersDescription:[{anchor:"transformers.generation.FlaxGreedySearchOutput.sequences",description:`<strong>sequences</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, max_length)</code>) &#x2014;
The generated sequences.`,name:"sequences"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_utils.py#L55"}}),tr=new v({props:{name:"replace",anchor:"transformers.generation.FlaxGreedySearchOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/flax/struct.py#L111"}}),or=new v({props:{name:"class transformers.generation.FlaxBeamSearchOutput",anchor:"transformers.generation.FlaxBeamSearchOutput",parameters:[{name:"sequences",val:": Array = None"},{name:"scores",val:": Array = None"}],parametersDescription:[{anchor:"transformers.generation.FlaxBeamSearchOutput.sequences",description:`<strong>sequences</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, max_length)</code>) &#x2014;
The generated sequences.`,name:"sequences"},{anchor:"transformers.generation.FlaxBeamSearchOutput.scores",description:`<strong>scores</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size,)</code>) &#x2014;
The scores (log probabilities) of the generated sequences.`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_utils.py#L83"}}),sr=new v({props:{name:"replace",anchor:"transformers.generation.FlaxBeamSearchOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/flax/struct.py#L111"}}),nr=new pe({}),rr=new pe({}),ar=new v({props:{name:"class transformers.AlternatingCodebooksLogitsProcessor",anchor:"transformers.AlternatingCodebooksLogitsProcessor",parameters:[{name:"input_start_len",val:": int"},{name:"semantic_vocab_size",val:": int"},{name:"codebook_size",val:": int"}],parametersDescription:[{anchor:"transformers.AlternatingCodebooksLogitsProcessor.input_start_len",description:`<strong>input_start_len</strong> (<code>int</code>) &#x2014;
The length of the initial input sequence.`,name:"input_start_len"},{anchor:"transformers.AlternatingCodebooksLogitsProcessor.semantic_vocab_size",description:`<strong>semantic_vocab_size</strong> (<code>int</code>) &#x2014;
Vocabulary size of the semantic part, i.e number of tokens associated to the semantic vocabulary.`,name:"semantic_vocab_size"},{anchor:"transformers.AlternatingCodebooksLogitsProcessor.codebook_size",description:`<strong>codebook_size</strong> (<code>int</code>) &#x2014;
Number of tokens associated to the codebook.`,name:"codebook_size"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1505"}}),ir=new v({props:{name:"__call__",anchor:"transformers.AlternatingCodebooksLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1526"}}),cr=new v({props:{name:"class transformers.ClassifierFreeGuidanceLogitsProcessor",anchor:"transformers.ClassifierFreeGuidanceLogitsProcessor",parameters:[{name:"guidance_scale",val:""}],parametersDescription:[{anchor:"transformers.ClassifierFreeGuidanceLogitsProcessor.guidance_scale",description:`<strong>guidance_scale</strong> (float) &#x2014;
The guidance scale for classifier free guidance (CFG). CFG is enabled by setting <code>guidance_scale &gt; 1</code>.
Higher guidance scale encourages the model to generate samples that are more closely linked to the input
prompt, usually at the expense of poorer quality.`,name:"guidance_scale"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1465"}}),mr=new v({props:{name:"__call__",anchor:"transformers.ClassifierFreeGuidanceLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.ClassifierFreeGuidanceLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ClassifierFreeGuidanceLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1489",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),hr=new v({props:{name:"class transformers.EncoderNoRepeatNGramLogitsProcessor",anchor:"transformers.EncoderNoRepeatNGramLogitsProcessor",parameters:[{name:"encoder_ngram_size",val:": int"},{name:"encoder_input_ids",val:": LongTensor"}],parametersDescription:[{anchor:"transformers.EncoderNoRepeatNGramLogitsProcessor.encoder_ngram_size",description:`<strong>encoder_ngram_size</strong> (<code>int</code>) &#x2014;
All ngrams of size <code>ngram_size</code> can only occur within the encoder input ids.`,name:"encoder_ngram_size"},{anchor:"transformers.EncoderNoRepeatNGramLogitsProcessor.encoder_input_ids",description:`<strong>encoder_input_ids</strong> (<code>int</code>) &#x2014;
The encoder_input_ids that should not be repeated within the decoder ids.`,name:"encoder_input_ids"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L763"}}),ur=new v({props:{name:"__call__",anchor:"transformers.EncoderNoRepeatNGramLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.EncoderNoRepeatNGramLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.EncoderNoRepeatNGramLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L786",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),fr=new v({props:{name:"class transformers.EncoderRepetitionPenaltyLogitsProcessor",anchor:"transformers.EncoderRepetitionPenaltyLogitsProcessor",parameters:[{name:"penalty",val:": float"},{name:"encoder_input_ids",val:": LongTensor"}],parametersDescription:[{anchor:"transformers.EncoderRepetitionPenaltyLogitsProcessor.hallucination_penalty",description:`<strong>hallucination_penalty</strong> (<code>float</code>) &#x2014;
The parameter for hallucination penalty. 1.0 means no penalty.`,name:"hallucination_penalty"},{anchor:"transformers.EncoderRepetitionPenaltyLogitsProcessor.encoder_input_ids",description:`<strong>encoder_input_ids</strong> (<code>torch.LongTensor</code>) &#x2014;
The encoder_input_ids that should not be repeated within the decoder ids.`,name:"encoder_input_ids"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L323"}}),_r=new v({props:{name:"__call__",anchor:"transformers.EncoderRepetitionPenaltyLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.EncoderRepetitionPenaltyLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.EncoderRepetitionPenaltyLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L341",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),br=new v({props:{name:"class transformers.EpsilonLogitsWarper",anchor:"transformers.EpsilonLogitsWarper",parameters:[{name:"epsilon",val:": float"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.EpsilonLogitsWarper.epsilon",description:`<strong>epsilon</strong> (<code>float</code>) &#x2014;
If set to &gt; 0, only the most tokens with probabilities <code>epsilon</code> or higher are kept for generation.`,name:"epsilon"},{anchor:"transformers.EpsilonLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.EpsilonLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L493"}}),ls=new me({props:{anchor:"transformers.EpsilonLogitsWarper.example",$$slots:{default:[OU]},$$scope:{ctx:E}}}),Tr=new v({props:{name:"__call__",anchor:"transformers.EpsilonLogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.EpsilonLogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.EpsilonLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L546",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),vr=new v({props:{name:"class transformers.EtaLogitsWarper",anchor:"transformers.EtaLogitsWarper",parameters:[{name:"epsilon",val:": float"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.EtaLogitsWarper.epsilon",description:`<strong>epsilon</strong> (<code>float</code>) &#x2014;
A float value in the range (0, 1). Hyperparameter used to calculate the dynamic cutoff value, <code>eta</code>. The
suggested values from the paper ranges from 3e-4 to 4e-3 depending on the size of the model.`,name:"epsilon"},{anchor:"transformers.EtaLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All values that are found to be below the dynamic cutoff value, <code>eta</code>, are set to this float value. This
parameter is useful when logits need to be modified for very low probability tokens that should be excluded
from generation entirely.`,name:"filter_value"},{anchor:"transformers.EtaLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Specifies the minimum number of tokens that must be kept for generation, regardless of their probabilities.
For example, if <code>min_tokens_to_keep</code> is set to 1, at least one token will always be kept for generation,
even if all tokens have probabilities below the cutoff <code>eta</code>.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L560"}}),ds=new me({props:{anchor:"transformers.EtaLogitsWarper.example",$$slots:{default:[AU]},$$scope:{ctx:E}}}),$r=new v({props:{name:"__call__",anchor:"transformers.EtaLogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.EtaLogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.EtaLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L623",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),kr=new v({props:{name:"class transformers.ExponentialDecayLengthPenalty",anchor:"transformers.ExponentialDecayLengthPenalty",parameters:[{name:"exponential_decay_length_penalty",val:": typing.Tuple[int, float]"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int]]"},{name:"input_ids_seq_length",val:": int"}],parametersDescription:[{anchor:"transformers.ExponentialDecayLengthPenalty.exponential_decay_length_penalty",description:`<strong>exponential_decay_length_penalty</strong> (<code>tuple(int, float)</code>) &#x2014;
This tuple shall consist of: <code>(start_index, decay_factor)</code> where <code>start_index</code> indicates where penalty
starts and <code>decay_factor</code> represents the factor of exponential decay`,name:"exponential_decay_length_penalty"},{anchor:"transformers.ExponentialDecayLengthPenalty.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"},{anchor:"transformers.ExponentialDecayLengthPenalty.input_ids_seq_length",description:`<strong>input_ids_seq_length</strong> (<code>int</code>) &#x2014;
The length of the input sequence.`,name:"input_ids_seq_length"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1298"}}),xr=new v({props:{name:"__call__",anchor:"transformers.ExponentialDecayLengthPenalty.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.ExponentialDecayLengthPenalty.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ExponentialDecayLengthPenalty.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1325",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Mr=new v({props:{name:"class transformers.ForcedBOSTokenLogitsProcessor",anchor:"transformers.ForcedBOSTokenLogitsProcessor",parameters:[{name:"bos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.ForcedBOSTokenLogitsProcessor.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>) &#x2014;
The id of the token to force as the first generated token.`,name:"bos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1230"}}),Er=new v({props:{name:"__call__",anchor:"transformers.ForcedBOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.ForcedBOSTokenLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ForcedBOSTokenLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1242",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),jr=new v({props:{name:"class transformers.ForcedEOSTokenLogitsProcessor",anchor:"transformers.ForcedEOSTokenLogitsProcessor",parameters:[{name:"max_length",val:": int"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int]]"}],parametersDescription:[{anchor:"transformers.ForcedEOSTokenLogitsProcessor.max_length",description:`<strong>max_length</strong> (<code>int</code>) &#x2014;
The maximum length of the sequence to be generated.`,name:"max_length"},{anchor:"transformers.ForcedEOSTokenLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>) &#x2014;
The id of the token to force as the last generated token when <code>max_length</code> is reached. Optionally, use a
list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1252"}}),Fr=new v({props:{name:"__call__",anchor:"transformers.ForcedEOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.ForcedEOSTokenLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ForcedEOSTokenLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1270",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Lr=new v({props:{name:"class transformers.ForceTokensLogitsProcessor",anchor:"transformers.ForceTokensLogitsProcessor",parameters:[{name:"force_token_map",val:": typing.List[typing.List[int]]"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1380"}}),Jr=new v({props:{name:"__call__",anchor:"transformers.ForceTokensLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.ForceTokensLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ForceTokensLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1388",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Ir=new v({props:{name:"class transformers.HammingDiversityLogitsProcessor",anchor:"transformers.HammingDiversityLogitsProcessor",parameters:[{name:"diversity_penalty",val:": float"},{name:"num_beams",val:": int"},{name:"num_beam_groups",val:": int"}],parametersDescription:[{anchor:"transformers.HammingDiversityLogitsProcessor.diversity_penalty",description:`<strong>diversity_penalty</strong> (<code>float</code>) &#x2014;
This value is subtracted from a beam&#x2019;s score if it generates a token same as any beam from other group at a
particular time. Note that <code>diversity_penalty</code> is only effective if group beam search is enabled. The
penalty applied to a beam&#x2019;s score when it generates a token that has already been chosen by another beam
within the same group during the same time step. A higher <code>diversity_penalty</code> will enforce greater
diversity among the beams, making it less likely for multiple beams to choose the same token. Conversely, a
lower penalty will allow beams to more freely choose similar tokens. Adjusting this value can help strike a
balance between diversity and natural likelihood.`,name:"diversity_penalty"},{anchor:"transformers.HammingDiversityLogitsProcessor.num_beams",description:`<strong>num_beams</strong> (<code>int</code>) &#x2014;
Number of beams used for group beam search. Beam search is a method used that maintains beams (or &#x201C;multiple
hypotheses&#x201D;) at each step, expanding each one and keeping the top-scoring sequences. A higher <code>num_beams</code>
will explore more potential sequences. This can increase chances of finding a high-quality output but also
increases computational cost.`,name:"num_beams"},{anchor:"transformers.HammingDiversityLogitsProcessor.num_beam_groups",description:`<strong>num_beam_groups</strong> (<code>int</code>) &#x2014;
Number of groups to divide <code>num_beams</code> into in order to ensure diversity among different groups of beams.
Each group of beams will operate independently, selecting tokens without considering the choices of other
groups. This division promotes diversity by ensuring that beams within different groups explore different
paths. For instance, if <code>num_beams</code> is 6 and <code>num_beam_groups</code> is 2, there will be 2 groups each containing
3 beams. The choice of <code>num_beam_groups</code> should be made considering the desired level of output diversity
and the total number of beams. See <a href="https://arxiv.org/pdf/1610.02424.pdf" rel="nofollow">this paper</a> for more details.`,name:"num_beam_groups"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1067"}}),ms=new xn({props:{$$slots:{default:[HU]},$$scope:{ctx:E}}}),hs=new xn({props:{warning:!0,$$slots:{default:[QU]},$$scope:{ctx:E}}}),gs=new me({props:{anchor:"transformers.HammingDiversityLogitsProcessor.example",$$slots:{default:[YU]},$$scope:{ctx:E}}}),Dr=new v({props:{name:"__call__",anchor:"transformers.HammingDiversityLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"current_tokens",val:": LongTensor"},{name:"beam_group_idx",val:": int"}],parametersDescription:[{anchor:"transformers.HammingDiversityLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.HammingDiversityLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using
beam search or log softmax for each vocabulary token when using beam search`,name:"scores"},{anchor:"transformers.HammingDiversityLogitsProcessor.__call__.current_tokens",description:`<strong>current_tokens</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary, corresponding to the tokens selected by the other
beam groups in the current generation step.`,name:"current_tokens"},{anchor:"transformers.HammingDiversityLogitsProcessor.__call__.beam_group_idx",description:`<strong>beam_group_idx</strong> (<code>int</code>) &#x2014;
The index of the beam group currently being processed.`,name:"beam_group_idx"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1184",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Sr=new v({props:{name:"class transformers.InfNanRemoveLogitsProcessor",anchor:"transformers.InfNanRemoveLogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1281"}}),Pr=new v({props:{name:"__call__",anchor:"transformers.InfNanRemoveLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.InfNanRemoveLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.InfNanRemoveLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1287",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Wr=new v({props:{name:"class transformers.LogitNormalization",anchor:"transformers.LogitNormalization",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1334"}}),Vr=new v({props:{name:"__call__",anchor:"transformers.LogitNormalization.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.LogitNormalization.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LogitNormalization.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1342",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Zr=new v({props:{name:"class transformers.LogitsProcessor",anchor:"transformers.LogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L44"}}),Gr=new v({props:{name:"__call__",anchor:"transformers.LogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.LogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L47",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Cr=new v({props:{name:"class transformers.LogitsProcessorList",anchor:"transformers.LogitsProcessorList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L64"}}),Nr=new v({props:{name:"__call__",anchor:"transformers.LogitsProcessorList.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LogitsProcessorList.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LogitsProcessorList.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using
beam search or log softmax for each vocabulary token when using beam search`,name:"scores"},{anchor:"transformers.LogitsProcessorList.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional kwargs that are specific to a logits processor.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L71",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Xr=new v({props:{name:"class transformers.LogitsWarper",anchor:"transformers.LogitsWarper",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L54"}}),Rr=new v({props:{name:"__call__",anchor:"transformers.LogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.LogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L57",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Or=new v({props:{name:"class transformers.MinLengthLogitsProcessor",anchor:"transformers.MinLengthLogitsProcessor",parameters:[{name:"min_length",val:": int"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int]]"}],parametersDescription:[{anchor:"transformers.MinLengthLogitsProcessor.min_length",description:`<strong>min_length</strong> (<code>int</code>) &#x2014;
The minimum length below which the score of <code>eos_token_id</code> is set to <code>-float(&quot;Inf&quot;)</code>.`,name:"min_length"},{anchor:"transformers.MinLengthLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L101"}}),Ar=new v({props:{name:"__call__",anchor:"transformers.MinLengthLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.MinLengthLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.MinLengthLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L124",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Hr=new v({props:{name:"class transformers.MinNewTokensLengthLogitsProcessor",anchor:"transformers.MinNewTokensLengthLogitsProcessor",parameters:[{name:"prompt_length_to_skip",val:": int"},{name:"min_new_tokens",val:": int"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int]]"}],parametersDescription:[{anchor:"transformers.MinNewTokensLengthLogitsProcessor.prompt_length_to_skip",description:`<strong>prompt_length_to_skip</strong> (<code>int</code>) &#x2014;
The input tokens length. Not a valid argument when used with <code>generate</code> as it will automatically assign the
input length.`,name:"prompt_length_to_skip"},{anchor:"transformers.MinNewTokensLengthLogitsProcessor.min_new_tokens",description:`<strong>min_new_tokens</strong> (<code>int</code>) &#x2014;
The minimum <em>new</em> tokens length below which the score of <code>eos_token_id</code> is set to <code>-float(&quot;Inf&quot;)</code>.`,name:"min_new_tokens"},{anchor:"transformers.MinNewTokensLengthLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L133"}}),fs=new me({props:{anchor:"transformers.MinNewTokensLengthLogitsProcessor.example",$$slots:{default:[KU]},$$scope:{ctx:E}}}),Qr=new v({props:{name:"__call__",anchor:"transformers.MinNewTokensLengthLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.MinNewTokensLengthLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.MinNewTokensLengthLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L195",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Yr=new v({props:{name:"class transformers.NoBadWordsLogitsProcessor",anchor:"transformers.NoBadWordsLogitsProcessor",parameters:[{name:"bad_words_ids",val:": typing.List[typing.List[int]]"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int]]"}],parametersDescription:[{anchor:"transformers.NoBadWordsLogitsProcessor.bad_words_ids",description:`<strong>bad_words_ids</strong> (<code>List[List[int]]</code>) &#x2014;
List of list of token ids that are not allowed to be generated.`,name:"bad_words_ids"},{anchor:"transformers.NoBadWordsLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L953"}}),_s=new xn({props:{$$slots:{default:[eB]},$$scope:{ctx:E}}}),bs=new me({props:{anchor:"transformers.NoBadWordsLogitsProcessor.example",$$slots:{default:[tB]},$$scope:{ctx:E}}}),Kr=new v({props:{name:"__call__",anchor:"transformers.NoBadWordsLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.NoBadWordsLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.NoBadWordsLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L876",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),ea=new v({props:{name:"class transformers.NoRepeatNGramLogitsProcessor",anchor:"transformers.NoRepeatNGramLogitsProcessor",parameters:[{name:"ngram_size",val:": int"}],parametersDescription:[{anchor:"transformers.NoRepeatNGramLogitsProcessor.ngram_size",description:`<strong>ngram_size</strong> (<code>int</code>) &#x2014;
All ngrams of size <code>ngram_size</code> can only occur once.`,name:"ngram_size"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L706"}}),ys=new xn({props:{$$slots:{default:[oB]},$$scope:{ctx:E}}}),Ts=new me({props:{anchor:"transformers.NoRepeatNGramLogitsProcessor.example",$$slots:{default:[sB]},$$scope:{ctx:E}}}),oa=new v({props:{name:"__call__",anchor:"transformers.NoRepeatNGramLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.NoRepeatNGramLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.NoRepeatNGramLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L752",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),sa=new v({props:{name:"class transformers.PrefixConstrainedLogitsProcessor",anchor:"transformers.PrefixConstrainedLogitsProcessor",parameters:[{name:"prefix_allowed_tokens_fn",val:": typing.Callable[[int, torch.Tensor], typing.List[int]]"},{name:"num_beams",val:": int"}],parametersDescription:[{anchor:"transformers.PrefixConstrainedLogitsProcessor.prefix_allowed_tokens_fn",description:`<strong>prefix_allowed_tokens_fn</strong> (<code>Callable[[int, torch.Tensor], List[int]]</code>) &#x2014;
This function constraints the beam search to allowed tokens only at each step. This function takes 2
arguments <code>inputs_ids</code> and the batch ID <code>batch_id</code>. It has to return a list with the allowed tokens for the
next generation step conditioned on the previously generated tokens <code>inputs_ids</code> and the batch ID
<code>batch_id</code>.`,name:"prefix_allowed_tokens_fn"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1040"}}),ra=new v({props:{name:"__call__",anchor:"transformers.PrefixConstrainedLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.PrefixConstrainedLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.PrefixConstrainedLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1057",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),aa=new v({props:{name:"class transformers.RepetitionPenaltyLogitsProcessor",anchor:"transformers.RepetitionPenaltyLogitsProcessor",parameters:[{name:"penalty",val:": float"}],parametersDescription:[{anchor:"transformers.RepetitionPenaltyLogitsProcessor.repetition_penalty",description:`<strong>repetition_penalty</strong> (<code>float</code>) &#x2014;
The parameter for repetition penalty. 1.0 means no penalty. See <a href="https://arxiv.org/pdf/1909.05858.pdf" rel="nofollow">this
paper</a> for more details.`,name:"repetition_penalty"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L270"}}),$s=new me({props:{anchor:"transformers.RepetitionPenaltyLogitsProcessor.example",$$slots:{default:[nB]},$$scope:{ctx:E}}}),ca=new v({props:{name:"__call__",anchor:"transformers.RepetitionPenaltyLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.RepetitionPenaltyLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.RepetitionPenaltyLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L312",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),la=new v({props:{name:"class transformers.SequenceBiasLogitsProcessor",anchor:"transformers.SequenceBiasLogitsProcessor",parameters:[{name:"sequence_bias",val:": typing.Dict[typing.Tuple[int], float]"}],parametersDescription:[{anchor:"transformers.SequenceBiasLogitsProcessor.sequence_bias",description:`<strong>sequence_bias</strong> (<code>Dict[Tuple[int], float]</code>) &#x2014;
Dictionary that maps a sequence of tokens to its bias term. Positive biases increase the odds of the
sequence being selected, while negative biases do the opposite. If a sequence has a length of 1, its bias
will always be applied. Otherwise, the bias will only be applied if the sequence in question is about to be
completed (in the token selection step after this processor is applied).`,name:"sequence_bias"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L805"}}),ks=new xn({props:{$$slots:{default:[rB]},$$scope:{ctx:E}}}),xs=new me({props:{anchor:"transformers.SequenceBiasLogitsProcessor.example",$$slots:{default:[aB]},$$scope:{ctx:E}}}),da=new v({props:{name:"__call__",anchor:"transformers.SequenceBiasLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.SequenceBiasLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SequenceBiasLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L876",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),pa=new v({props:{name:"class transformers.SuppressTokensAtBeginLogitsProcessor",anchor:"transformers.SuppressTokensAtBeginLogitsProcessor",parameters:[{name:"begin_suppress_tokens",val:""},{name:"begin_index",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1348"}}),ma=new v({props:{name:"__call__",anchor:"transformers.SuppressTokensAtBeginLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.SuppressTokensAtBeginLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SuppressTokensAtBeginLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1359",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),ha=new v({props:{name:"class transformers.SuppressTokensLogitsProcessor",anchor:"transformers.SuppressTokensLogitsProcessor",parameters:[{name:"suppress_tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1367"}}),ua=new v({props:{name:"__call__",anchor:"transformers.SuppressTokensLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.SuppressTokensLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SuppressTokensLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1374",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),fa=new v({props:{name:"class transformers.TemperatureLogitsWarper",anchor:"transformers.TemperatureLogitsWarper",parameters:[{name:"temperature",val:": float"}],parametersDescription:[{anchor:"transformers.TemperatureLogitsWarper.temperature",description:`<strong>temperature</strong> (<code>float</code>) &#x2014;
Strictly positive float value used to modulate the logits distribution. A value smaller than <code>1</code> decreases
randomness (and vice versa), with <code>0</code> being equivalent to shifting all probability mass to the most likely
token.`,name:"temperature"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L205"}}),Ms=new xn({props:{$$slots:{default:[iB]},$$scope:{ctx:E}}}),Es=new me({props:{anchor:"transformers.TemperatureLogitsWarper.example",$$slots:{default:[cB]},$$scope:{ctx:E}}}),_a=new v({props:{name:"__call__",anchor:"transformers.TemperatureLogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.TemperatureLogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TemperatureLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L264",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),ba=new v({props:{name:"class transformers.TopKLogitsWarper",anchor:"transformers.TopKLogitsWarper",parameters:[{name:"top_k",val:": int"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.TopKLogitsWarper.top_k",description:`<strong>top_k</strong> (<code>int</code>) &#x2014;
The number of highest probability vocabulary tokens to keep for top-k-filtering.`,name:"top_k"},{anchor:"transformers.TopKLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.TopKLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L415"}}),ya=new v({props:{name:"__call__",anchor:"transformers.TopKLogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.TopKLogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TopKLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L435",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Ta=new v({props:{name:"class transformers.TopPLogitsWarper",anchor:"transformers.TopPLogitsWarper",parameters:[{name:"top_p",val:": float"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.TopPLogitsWarper.top_p",description:`<strong>top_p</strong> (<code>float</code>) &#x2014;
If set to &lt; 1, only the smallest set of most probable tokens with probabilities that add up to <code>top_p</code> or
higher are kept for generation.`,name:"top_p"},{anchor:"transformers.TopPLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.TopPLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L352"}}),js=new me({props:{anchor:"transformers.TopPLogitsWarper.example",$$slots:{default:[lB]},$$scope:{ctx:E}}}),va=new v({props:{name:"__call__",anchor:"transformers.TopPLogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.TopPLogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TopPLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L399",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),wa=new v({props:{name:"class transformers.TypicalLogitsWarper",anchor:"transformers.TypicalLogitsWarper",parameters:[{name:"mass",val:": float = 0.9"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.TypicalLogitsWarper.mass",description:`<strong>mass</strong> (<code>float</code>) &#x2014;
Value of typical_p between 0 and 1 inclusive, defaults to 0.9.`,name:"mass"},{anchor:"transformers.TypicalLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.TypicalLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L444"}}),ka=new v({props:{name:"__call__",anchor:"transformers.TypicalLogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.TypicalLogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TypicalLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L469",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),xa=new v({props:{name:"class transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor",anchor:"transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor",parameters:[{name:"guidance_scale",val:": float"},{name:"model",val:""},{name:"unconditional_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"unconditional_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = True"}],parametersDescription:[{anchor:"transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>) &#x2014;
The guidance scale for classifier free guidance (CFG). CFG is enabled by setting <code>guidance_scale != 1</code>.
Higher guidance scale encourages the model to generate samples that are more closely linked to the input
prompt, usually at the expense of poorer quality. A value smaller than 1 has the opposite effect, while
making the negative prompt provided with negative_prompt_ids (if any) act as a positive prompt.`,name:"guidance_scale"},{anchor:"transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor.unconditional_ids",description:`<strong>unconditional_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary for the unconditional branch. If unset, will default to
the last token of the prompt.`,name:"unconditional_ids"},{anchor:"transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor.unconditional_attention_mask",description:`<strong>unconditional_attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <strong>optional</strong>) &#x2014;
Attention mask for unconditional_ids.`,name:"unconditional_attention_mask"},{anchor:"transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor.model",description:`<strong>model</strong> (<code>PreTrainedModel</code>) &#x2014;
The model computing the unconditional scores. Supposedly the same as the one computing the conditional
scores. Both models must use the same tokenizer.`,name:"model"},{anchor:"transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor.smooth_factor",description:`<strong>smooth_factor</strong> (<code>float</code>, <strong>optional</strong>) &#x2014;
The interpolation weight for CFG Rescale. 1 means no rescaling, 0 reduces to the conditional scores without
CFG. Turn it lower if the output degenerates.`,name:"smooth_factor"},{anchor:"transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <strong>optional</strong>) &#x2014;
Whether to cache key/values during the negative prompt forward pass.`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1541"}}),Ls=new me({props:{anchor:"transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor.example",$$slots:{default:[dB]},$$scope:{ctx:E}}}),ja=new v({props:{name:"__call__",anchor:"transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor.__call__",parameters:[{name:"input_ids",val:""},{name:"scores",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1650"}}),Fa=new v({props:{name:"class transformers.WhisperTimeStampLogitsProcessor",anchor:"transformers.WhisperTimeStampLogitsProcessor",parameters:[{name:"generate_config",val:""}],parametersDescription:[{anchor:"transformers.WhisperTimeStampLogitsProcessor.generate_config",description:`<strong>generate_config</strong> (<code>GenerateConfig</code>) &#x2014;
The generate config used to generate the output. The following parameters are required:
eos_token_id (<code>int</code>, <em>optional</em>, defaults to 50257):
The id of the <em>end-of-sequence</em> token.
no_timestamps_token_id (<code>int</code>, <em>optional</em>, defaults to 50363):
The id of the <code>&quot;&lt;|notimestamps|&gt;&quot;</code> token.
max_initial_timestamp_index (<code>int</code>, <em>optional</em>, defaults to 1):
Used to set the maximum value of the initial timestamp. This is used to prevent the model from
predicting timestamps that are too far in the future.`,name:"generate_config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1398"}}),Ia=new v({props:{name:"__call__",anchor:"transformers.WhisperTimeStampLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.WhisperTimeStampLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.WhisperTimeStampLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1427",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Ua=new pe({}),Ba=new v({props:{name:"class transformers.TFForcedBOSTokenLogitsProcessor",anchor:"transformers.TFForcedBOSTokenLogitsProcessor",parameters:[{name:"bos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.TFForcedBOSTokenLogitsProcessor.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>) &#x2014;
The id of the token to force as the first generated token.`,name:"bos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L448"}}),qa=new v({props:{name:"__call__",anchor:"transformers.TFForcedBOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L462"}}),Da=new v({props:{name:"class transformers.TFForcedEOSTokenLogitsProcessor",anchor:"transformers.TFForcedEOSTokenLogitsProcessor",parameters:[{name:"max_length",val:": int"},{name:"eos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.TFForcedEOSTokenLogitsProcessor.max_length",description:`<strong>max_length</strong> (<code>int</code>) &#x2014;
The maximum length of the sequence to be generated.`,name:"max_length"},{anchor:"transformers.TFForcedEOSTokenLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>) &#x2014;
The id of the token to force as the last generated token when <code>max_length</code> is reached.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L478"}}),Sa=new v({props:{name:"__call__",anchor:"transformers.TFForcedEOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L495"}}),Pa=new v({props:{name:"class transformers.TFForceTokensLogitsProcessor",anchor:"transformers.TFForceTokensLogitsProcessor",parameters:[{name:"force_token_map",val:": typing.List[typing.List[int]]"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L551"}}),Wa=new v({props:{name:"__call__",anchor:"transformers.TFForceTokensLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L567"}}),Va=new v({props:{name:"class transformers.TFLogitsProcessor",anchor:"transformers.TFLogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L53"}}),Za=new v({props:{name:"__call__",anchor:"transformers.TFLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],parametersDescription:[{anchor:"transformers.TFLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.TFLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search.`,name:"scores"},{anchor:"transformers.TFLogitsProcessor.__call__.cur_len",description:`<strong>cur_len</strong> (<code>int</code>) &#x2014;
The current length of valid input sequence tokens. In the TF implementation, the input_ids&#x2019; sequence length
is the maximum length generate can produce, and we need to know which of its tokens are valid.`,name:"cur_len"},{anchor:"transformers.TFLogitsProcessor.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional logits processor specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L56",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Ga=new v({props:{name:"class transformers.TFLogitsProcessorList",anchor:"transformers.TFLogitsProcessorList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L75"}}),Ca=new v({props:{name:"__call__",anchor:"transformers.TFLogitsProcessorList.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFLogitsProcessorList.__call__.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.TFLogitsProcessorList.__call__.scores",description:`<strong>scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search.`,name:"scores"},{anchor:"transformers.TFLogitsProcessorList.__call__.cur_len",description:`<strong>cur_len</strong> (<code>int</code>) &#x2014;
The current length of valid input sequence tokens. In the TF implementation, the input_ids&#x2019; sequence length
is the maximum length generate can produce, and we need to know which of its tokens are valid.`,name:"cur_len"},{anchor:"transformers.TFLogitsProcessorList.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional logits processor specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L82",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Na=new v({props:{name:"class transformers.TFLogitsWarper",anchor:"transformers.TFLogitsWarper",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L64"}}),Xa=new v({props:{name:"__call__",anchor:"transformers.TFLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],parametersDescription:[{anchor:"transformers.TFLogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.TFLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search.`,name:"scores"},{anchor:"transformers.TFLogitsWarper.__call__.cur_len",description:`<strong>cur_len</strong> (<code>int</code>) &#x2014;
The current length of valid input sequence tokens. In the TF implementation, the input_ids&#x2019; sequence length
is the maximum length generate can produce, and we need to know which of its tokens are valid.`,name:"cur_len"},{anchor:"transformers.TFLogitsWarper.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional logits processor specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L67",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Ra=new v({props:{name:"class transformers.TFMinLengthLogitsProcessor",anchor:"transformers.TFMinLengthLogitsProcessor",parameters:[{name:"min_length",val:": int"},{name:"eos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.TFMinLengthLogitsProcessor.min_length",description:`<strong>min_length</strong> (<code>int</code>) &#x2014;
The minimum length below which the score of <code>eos_token_id</code> is set to <code>-float(&quot;Inf&quot;)</code>.`,name:"min_length"},{anchor:"transformers.TFMinLengthLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>) &#x2014;
The id of the <em>end-of-sequence</em> token.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L202"}}),Oa=new v({props:{name:"__call__",anchor:"transformers.TFMinLengthLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L228"}}),Aa=new v({props:{name:"class transformers.TFNoBadWordsLogitsProcessor",anchor:"transformers.TFNoBadWordsLogitsProcessor",parameters:[{name:"bad_words_ids",val:": typing.List[typing.List[int]]"},{name:"eos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.TFNoBadWordsLogitsProcessor.bad_words_ids",description:`<strong>bad_words_ids</strong> (<code>List[List[int]]</code>) &#x2014;
List of list of token ids that are not allowed to be generated. In order to get the tokens of the words
that should not appear in the generated text, make sure to set <code>add_prefix_space=True</code> when initializing
the tokenizer, and use <code>tokenizer(bad_words, add_special_tokens=False).input_ids</code>. The <code>add_prefix_space</code>
argument is only supported for some slow tokenizers, as fast tokenizers&#x2019; prefixing behaviours come from
<code>pre tokenizers</code>. Read more <a href="https://huggingface.co/docs/tokenizers/api/pre-tokenizers" rel="nofollow">here</a>.`,name:"bad_words_ids"},{anchor:"transformers.TFNoBadWordsLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>) &#x2014;
The id of the <em>end-of-sequence</em> token.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L288"}}),Ha=new v({props:{name:"__call__",anchor:"transformers.TFNoBadWordsLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L367"}}),Qa=new v({props:{name:"class transformers.TFNoRepeatNGramLogitsProcessor",anchor:"transformers.TFNoRepeatNGramLogitsProcessor",parameters:[{name:"ngram_size",val:": int"}],parametersDescription:[{anchor:"transformers.TFNoRepeatNGramLogitsProcessor.ngram_size",description:`<strong>ngram_size</strong> (<code>int</code>) &#x2014;
All ngrams of size <code>ngram_size</code> can only occur once.`,name:"ngram_size"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L388"}}),Ka=new v({props:{name:"__call__",anchor:"transformers.TFNoRepeatNGramLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L427"}}),ei=new v({props:{name:"class transformers.TFRepetitionPenaltyLogitsProcessor",anchor:"transformers.TFRepetitionPenaltyLogitsProcessor",parameters:[{name:"penalty",val:": float"}],parametersDescription:[{anchor:"transformers.TFRepetitionPenaltyLogitsProcessor.repetition_penalty",description:`<strong>repetition_penalty</strong> (<code>float</code>) &#x2014;
The parameter for repetition penalty. 1.0 means no penalty. See <a href="https://arxiv.org/pdf/1909.05858.pdf" rel="nofollow">this
paper</a> for more details.`,name:"repetition_penalty"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L238"}}),ti=new v({props:{name:"__call__",anchor:"transformers.TFRepetitionPenaltyLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L280"}}),oi=new v({props:{name:"class transformers.TFSuppressTokensAtBeginLogitsProcessor",anchor:"transformers.TFSuppressTokensAtBeginLogitsProcessor",parameters:[{name:"begin_suppress_tokens",val:""},{name:"begin_index",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L511"}}),si=new v({props:{name:"__call__",anchor:"transformers.TFSuppressTokensAtBeginLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L522"}}),ni=new v({props:{name:"class transformers.TFSuppressTokensLogitsProcessor",anchor:"transformers.TFSuppressTokensLogitsProcessor",parameters:[{name:"suppress_tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L535"}}),ai=new v({props:{name:"__call__",anchor:"transformers.TFSuppressTokensLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L542"}}),ii=new v({props:{name:"class transformers.TFTemperatureLogitsWarper",anchor:"transformers.TFTemperatureLogitsWarper",parameters:[{name:"temperature",val:": float"}],parametersDescription:[{anchor:"transformers.TFTemperatureLogitsWarper.temperature",description:`<strong>temperature</strong> (<code>float</code>) &#x2014;
The value used to module the logits distribution.`,name:"temperature"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L98"}}),ci=new v({props:{name:"__call__",anchor:"transformers.TFTemperatureLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L113"}}),li=new v({props:{name:"class transformers.TFTopKLogitsWarper",anchor:"transformers.TFTopKLogitsWarper",parameters:[{name:"top_k",val:": int"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.TFTopKLogitsWarper.top_k",description:`<strong>top_k</strong> (<code>int</code>) &#x2014;
The number of highest probability vocabulary tokens to keep for top-k-filtering.`,name:"top_k"},{anchor:"transformers.TFTopKLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.TFTopKLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L118"}}),di=new v({props:{name:"__call__",anchor:"transformers.TFTopKLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L138"}}),pi=new v({props:{name:"class transformers.TFTopPLogitsWarper",anchor:"transformers.TFTopPLogitsWarper",parameters:[{name:"top_p",val:": float"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.TFTopPLogitsWarper.top_p",description:`<strong>top_p</strong> (<code>float</code>) &#x2014;
If set to &lt; 1, only the smallest set of most probable tokens with probabilities that add up to <code>top_p</code> or
higher are kept for generation.`,name:"top_p"},{anchor:"transformers.TFTopPLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.TFTopPLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L146"}}),mi=new v({props:{name:"__call__",anchor:"transformers.TFTopPLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L170"}}),hi=new pe({}),gi=new v({props:{name:"class transformers.FlaxForcedBOSTokenLogitsProcessor",anchor:"transformers.FlaxForcedBOSTokenLogitsProcessor",parameters:[{name:"bos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.FlaxForcedBOSTokenLogitsProcessor.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>) &#x2014;
The id of the token to force as the first generated token.`,name:"bos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L194"}}),ui=new v({props:{name:"__call__",anchor:"transformers.FlaxForcedBOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L206"}}),fi=new v({props:{name:"class transformers.FlaxForcedEOSTokenLogitsProcessor",anchor:"transformers.FlaxForcedEOSTokenLogitsProcessor",parameters:[{name:"max_length",val:": int"},{name:"eos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.FlaxForcedEOSTokenLogitsProcessor.max_length",description:`<strong>max_length</strong> (<code>int</code>) &#x2014;
The maximum length of the sequence to be generated.`,name:"max_length"},{anchor:"transformers.FlaxForcedEOSTokenLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>) &#x2014;
The id of the token to force as the last generated token when <code>max_length</code> is reached.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L216"}}),_i=new v({props:{name:"__call__",anchor:"transformers.FlaxForcedEOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L231"}}),bi=new v({props:{name:"class transformers.FlaxForceTokensLogitsProcessor",anchor:"transformers.FlaxForceTokensLogitsProcessor",parameters:[{name:"force_token_map",val:""}],parametersDescription:[{anchor:"transformers.FlaxForceTokensLogitsProcessor.force_token_map",description:`<strong>force_token_map</strong> (<code>list</code>) &#x2014;
Map giving token ids and indices where they will be forced to be sampled.`,name:"force_token_map"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L315"}}),yi=new v({props:{name:"__call__",anchor:"transformers.FlaxForceTokensLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L337"}}),Ti=new v({props:{name:"class transformers.FlaxLogitsProcessor",anchor:"transformers.FlaxLogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L50"}}),vi=new v({props:{name:"__call__",anchor:"transformers.FlaxLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"}],parametersDescription:[{anchor:"transformers.FlaxLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.FlaxLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"},{anchor:"transformers.FlaxLogitsProcessor.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional logits processor specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L53",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),wi=new v({props:{name:"class transformers.FlaxLogitsProcessorList",anchor:"transformers.FlaxLogitsProcessorList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L72"}}),$i=new v({props:{name:"__call__",anchor:"transformers.FlaxLogitsProcessorList.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxLogitsProcessorList.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.FlaxLogitsProcessorList.__call__.scores",description:`<strong>scores</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"},{anchor:"transformers.FlaxLogitsProcessorList.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional logits processor specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L79",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),ki=new v({props:{name:"class transformers.FlaxLogitsWarper",anchor:"transformers.FlaxLogitsWarper",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L61"}}),xi=new v({props:{name:"__call__",anchor:"transformers.FlaxLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"}],parametersDescription:[{anchor:"transformers.FlaxLogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.FlaxLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"},{anchor:"transformers.FlaxLogitsWarper.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional logits processor specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L64",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Mi=new v({props:{name:"class transformers.FlaxMinLengthLogitsProcessor",anchor:"transformers.FlaxMinLengthLogitsProcessor",parameters:[{name:"min_length",val:": int"},{name:"eos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.FlaxMinLengthLogitsProcessor.min_length",description:`<strong>min_length</strong> (<code>int</code>) &#x2014;
The minimum length below which the score of <code>eos_token_id</code> is set to <code>-float(&quot;Inf&quot;)</code>.`,name:"min_length"},{anchor:"transformers.FlaxMinLengthLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>) &#x2014;
The id of the <em>end-of-sequence</em> token.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L241"}}),Ei=new v({props:{name:"__call__",anchor:"transformers.FlaxMinLengthLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L262"}}),ji=new v({props:{name:"class transformers.FlaxSuppressTokensAtBeginLogitsProcessor",anchor:"transformers.FlaxSuppressTokensAtBeginLogitsProcessor",parameters:[{name:"begin_suppress_tokens",val:""},{name:"begin_index",val:""}],parametersDescription:[{anchor:"transformers.FlaxSuppressTokensAtBeginLogitsProcessor.begin_suppress_tokens",description:`<strong>begin_suppress_tokens</strong> (<code>List[int]</code>) &#x2014;
Tokens to not sample.`,name:"begin_suppress_tokens"},{anchor:"transformers.FlaxSuppressTokensAtBeginLogitsProcessor.begin_index",description:`<strong>begin_index</strong> (<code>int</code>) &#x2014;
Index where the tokens are suppressed.`,name:"begin_index"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L271"}}),Fi=new v({props:{name:"__call__",anchor:"transformers.FlaxSuppressTokensAtBeginLogitsProcessor.__call__",parameters:[{name:"input_ids",val:""},{name:"scores",val:""},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L288"}}),Li=new v({props:{name:"class transformers.FlaxSuppressTokensLogitsProcessor",anchor:"transformers.FlaxSuppressTokensLogitsProcessor",parameters:[{name:"suppress_tokens",val:": list"}],parametersDescription:[{anchor:"transformers.FlaxSuppressTokensLogitsProcessor.suppress_tokens",description:`<strong>suppress_tokens</strong> (<code>list</code>) &#x2014;
Tokens to not sample.`,name:"suppress_tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L296"}}),zi=new v({props:{name:"__call__",anchor:"transformers.FlaxSuppressTokensLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L309"}}),Ji=new v({props:{name:"class transformers.FlaxTemperatureLogitsWarper",anchor:"transformers.FlaxTemperatureLogitsWarper",parameters:[{name:"temperature",val:": float"}],parametersDescription:[{anchor:"transformers.FlaxTemperatureLogitsWarper.temperature",description:`<strong>temperature</strong> (<code>float</code>) &#x2014;
The value used to module the logits distribution.`,name:"temperature"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L95"}}),Ii=new v({props:{name:"__call__",anchor:"transformers.FlaxTemperatureLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L110"}}),Ui=new v({props:{name:"class transformers.FlaxTopKLogitsWarper",anchor:"transformers.FlaxTopKLogitsWarper",parameters:[{name:"top_k",val:": int"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.FlaxTopKLogitsWarper.top_k",description:`<strong>top_k</strong> (<code>int</code>) &#x2014;
The number of highest probability vocabulary tokens to keep for top-k-filtering.`,name:"top_k"},{anchor:"transformers.FlaxTopKLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.FlaxTopKLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L159"}}),Bi=new v({props:{name:"__call__",anchor:"transformers.FlaxTopKLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L179"}}),qi=new v({props:{name:"class transformers.FlaxTopPLogitsWarper",anchor:"transformers.FlaxTopPLogitsWarper",parameters:[{name:"top_p",val:": float"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.FlaxTopPLogitsWarper.top_p",description:`<strong>top_p</strong> (<code>float</code>) &#x2014;
If set to &lt; 1, only the smallest set of most probable tokens with probabilities that add up to <code>top_p</code> or
higher are kept for generation.`,name:"top_p"},{anchor:"transformers.FlaxTopPLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.FlaxTopPLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L115"}}),Di=new v({props:{name:"__call__",anchor:"transformers.FlaxTopPLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L139"}}),Si=new v({props:{name:"class transformers.FlaxWhisperTimeStampLogitsProcessor",anchor:"transformers.FlaxWhisperTimeStampLogitsProcessor",parameters:[{name:"generate_config",val:""},{name:"model_config",val:""},{name:"decoder_input_length",val:""}],parametersDescription:[{anchor:"transformers.FlaxWhisperTimeStampLogitsProcessor.generate_config",description:`<strong>generate_config</strong> (<code>GenerateConfig</code>) &#x2014;
The generate config used to generate the output. The following parameters are required:
eos_token_id (<code>int</code>, <em>optional</em>, defaults to 50257):
The id of the <em>end-of-sequence</em> token.
no_timestamps_token_id (<code>int</code>, <em>optional</em>, defaults to 50363):
The id of the <code>&quot;&lt;|notimestamps|&gt;&quot;</code> token.
max_initial_timestamp_index (<code>int</code>, <em>optional</em>, defaults to 1):
Used to set the maximum value of the initial timestamp. This is used to prevent the model from
predicting timestamps that are too far in the future.`,name:"generate_config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L363"}}),Wi=new v({props:{name:"__call__",anchor:"transformers.FlaxWhisperTimeStampLogitsProcessor.__call__",parameters:[{name:"input_ids",val:""},{name:"scores",val:""},{name:"cur_len",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L397"}}),Vi=new pe({}),Zi=new v({props:{name:"class transformers.StoppingCriteria",anchor:"transformers.StoppingCriteria",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L36"}}),Gi=new v({props:{name:"__call__",anchor:"transformers.StoppingCriteria.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.StoppingCriteria.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.StoppingCriteria.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be scores for each vocabulary token before SoftMax
or scores for each vocabulary token after SoftMax.`,name:"scores"},{anchor:"transformers.StoppingCriteria.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional stopping criteria specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L39",returnDescription:`
<p><code>bool</code>. <code>False</code> indicates we should continue, <code>True</code> indicates we should stop.</p>
`}}),Ci=new v({props:{name:"class transformers.StoppingCriteriaList",anchor:"transformers.StoppingCriteriaList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L124"}}),Ni=new v({props:{name:"__call__",anchor:"transformers.StoppingCriteriaList.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.StoppingCriteriaList.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.StoppingCriteriaList.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be scores for each vocabulary token before SoftMax
or scores for each vocabulary token after SoftMax.`,name:"scores"},{anchor:"transformers.StoppingCriteriaList.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional stopping criteria specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L125",returnDescription:`
<p><code>bool</code>. <code>False</code> indicates we should continue, <code>True</code> indicates we should stop.</p>
`}}),Xi=new v({props:{name:"class transformers.MaxLengthCriteria",anchor:"transformers.MaxLengthCriteria",parameters:[{name:"max_length",val:": int"},{name:"max_position_embeddings",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.MaxLengthCriteria.max_length",description:`<strong>max_length</strong> (<code>int</code>) &#x2014;
The maximum length that the output sequence can have in number of tokens.`,name:"max_length"},{anchor:"transformers.MaxLengthCriteria.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <code>optional</code>) &#x2014;
The maximum model length, as defined by the model&#x2019;s <code>config.max_position_embeddings</code> attribute.`,name:"max_position_embeddings"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L44"}}),Oi=new v({props:{name:"__call__",anchor:"transformers.MaxLengthCriteria.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MaxLengthCriteria.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.MaxLengthCriteria.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be scores for each vocabulary token before SoftMax
or scores for each vocabulary token after SoftMax.`,name:"scores"},{anchor:"transformers.MaxLengthCriteria.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional stopping criteria specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L60",returnDescription:`
<p><code>bool</code>. <code>False</code> indicates we should continue, <code>True</code> indicates we should stop.</p>
`}}),Ai=new v({props:{name:"class transformers.MaxTimeCriteria",anchor:"transformers.MaxTimeCriteria",parameters:[{name:"max_time",val:": float"},{name:"initial_timestamp",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"transformers.MaxTimeCriteria.max_time",description:`<strong>max_time</strong> (<code>float</code>) &#x2014;
The maximum allowed time in seconds for the generation.`,name:"max_time"},{anchor:"transformers.MaxTimeCriteria.initial_time",description:`<strong>initial_time</strong> (<code>float</code>, <em>optional</em>, defaults to <code>time.time()</code>) &#x2014;
The start of the generation allowed time.`,name:"initial_time"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L102"}}),Qi=new v({props:{name:"__call__",anchor:"transformers.MaxTimeCriteria.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MaxTimeCriteria.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.MaxTimeCriteria.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be scores for each vocabulary token before SoftMax
or scores for each vocabulary token after SoftMax.`,name:"scores"},{anchor:"transformers.MaxTimeCriteria.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional stopping criteria specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L119",returnDescription:`
<p><code>bool</code>. <code>False</code> indicates we should continue, <code>True</code> indicates we should stop.</p>
`}}),Yi=new pe({}),Ki=new v({props:{name:"class transformers.Constraint",anchor:"transformers.Constraint",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L5"}}),Xs=new me({props:{anchor:"transformers.Constraint.example",$$slots:{default:[pB]},$$scope:{ctx:E}}}),ec=new v({props:{name:"advance",anchor:"transformers.Constraint.advance",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L48",returnDescription:`
<p>Must be a tensor of a list of indexable tokens, not some integer.</p>
`,returnType:`
<p>token_ids(<code>torch.tensor</code>)</p>
`}}),tc=new v({props:{name:"copy",anchor:"transformers.Constraint.copy",parameters:[{name:"stateful",val:" = False"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L113",returnDescription:`
<p>The same constraint as the one being called from.</p>
`,returnType:`
<p>constraint(<code>Constraint</code>)</p>
`}}),oc=new v({props:{name:"does_advance",anchor:"transformers.Constraint.does_advance",parameters:[{name:"token_id",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L60"}}),sc=new v({props:{name:"remaining",anchor:"transformers.Constraint.remaining",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L104"}}),rc=new v({props:{name:"reset",anchor:"transformers.Constraint.reset",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L94"}}),ac=new v({props:{name:"test",anchor:"transformers.Constraint.test",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L24"}}),ic=new v({props:{name:"update",anchor:"transformers.Constraint.update",parameters:[{name:"token_id",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L69",returnDescription:`
<p>Whether this constraint has become one step closer to being fulfuilled.
completed(<code>bool</code>):
Whether this constraint has been completely fulfilled by this token being generated.
reset (<code>bool</code>):
Whether this constraint has reset its progress by this token being generated.</p>
`,returnType:`
<p>stepped(<code>bool</code>)</p>
`}}),lc=new v({props:{name:"class transformers.PhrasalConstraint",anchor:"transformers.PhrasalConstraint",parameters:[{name:"token_ids",val:": typing.List[int]"}],parametersDescription:[{anchor:"transformers.PhrasalConstraint.token_ids",description:`<strong>token_ids</strong> (<code>List[int]</code>) &#x2014;
The id of the token that must be generated by the output.`,name:"token_ids"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L129"}}),dc=new v({props:{name:"class transformers.DisjunctiveConstraint",anchor:"transformers.DisjunctiveConstraint",parameters:[{name:"nested_token_ids",val:": typing.List[typing.List[int]]"}],parametersDescription:[{anchor:"transformers.DisjunctiveConstraint.nested_token_ids",description:"<strong>nested_token_ids</strong> (<code>List[List[int]]</code>) &#x2014; a list of words, where each word is a list of ids. This constraint",name:"nested_token_ids"},{anchor:"transformers.DisjunctiveConstraint.is",description:"<strong>is</strong> fulfilled by generating just one from the list of words. &#x2014;",name:"is"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L261"}}),mc=new v({props:{name:"class transformers.ConstraintListState",anchor:"transformers.ConstraintListState",parameters:[{name:"constraints",val:": typing.List[transformers.generation.beam_constraints.Constraint]"}],parametersDescription:[{anchor:"transformers.ConstraintListState.constraints",description:`<strong>constraints</strong> (<code>List[Constraint]</code>) &#x2014;
A list of <a href="/docs/transformers/main/en/internal/generation_utils#transformers.Constraint">Constraint</a> objects that must be fulfilled by the beam scorer.`,name:"constraints"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L350"}}),hc=new v({props:{name:"advance",anchor:"transformers.ConstraintListState.advance",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L382"}}),gc=new v({props:{name:"reset",anchor:"transformers.ConstraintListState.reset",parameters:[{name:"token_ids",val:": typing.Optional[typing.List[int]]"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L417"}}),uc=new pe({}),fc=new v({props:{name:"class transformers.BeamScorer",anchor:"transformers.BeamScorer",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L91"}}),_c=new v({props:{name:"process",anchor:"transformers.BeamScorer.process",parameters:[{name:"input_ids",val:": LongTensor"},{name:"next_scores",val:": FloatTensor"},{name:"next_tokens",val:": LongTensor"},{name:"next_indices",val:": LongTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BeamScorer.process.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size * num_beams, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using any class inheriting from <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/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.BeamScorer.process.next_scores",description:`<strong>next_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
Current scores of the top <code>2 * num_beams</code> non-finished beam hypotheses.`,name:"next_scores"},{anchor:"transformers.BeamScorer.process.next_tokens",description:`<strong>next_tokens</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
<code>input_ids</code> of the tokens corresponding to the top <code>2 * num_beams</code> non-finished beam hypotheses.`,name:"next_tokens"},{anchor:"transformers.BeamScorer.process.next_indices",description:`<strong>next_indices</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
Beam indices indicating to which beam hypothesis the <code>next_tokens</code> correspond.`,name:"next_indices"},{anchor:"transformers.BeamScorer.process.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The id of the <em>padding</em> token.`,name:"pad_token_id"},{anchor:"transformers.BeamScorer.process.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>, <em>optional</em>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"},{anchor:"transformers.BeamScorer.process.beam_indices",description:`<strong>beam_indices</strong> (<code>torch.LongTensor</code>, <em>optional</em>) &#x2014;
Beam indices indicating to which beam hypothesis each token correspond.`,name:"beam_indices"},{anchor:"transformers.BeamScorer.process.group_index",description:`<strong>group_index</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The index of the group of beams. Used with <a href="/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.group_beam_search">group_beam_search()</a>.`,name:"group_index"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L97",returnDescription:`
<p>A dictionary composed of the fields as defined above:</p>
<ul>
<li><strong>next_beam_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Updated scores of all
non-finished beams.</li>
<li><strong>next_beam_tokens</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Next tokens to be added
to the non-finished beam_hypotheses.</li>
<li><strong>next_beam_indices</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Beam indices
indicating to which beam the next tokens shall be added.</li>
</ul>
`,returnType:`
<p><code>UserDict</code></p>
`}}),bc=new v({props:{name:"finalize",anchor:"transformers.BeamScorer.finalize",parameters:[{name:"input_ids",val:": LongTensor"},{name:"next_scores",val:": FloatTensor"},{name:"next_tokens",val:": LongTensor"},{name:"next_indices",val:": LongTensor"},{name:"max_length",val:": int"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BeamScorer.finalize.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size * num_beams, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using any class inheriting from <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/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.BeamScorer.finalize.final_beam_scores",description:`<strong>final_beam_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) &#x2014;
The final scores of all non-finished beams.`,name:"final_beam_scores"},{anchor:"transformers.BeamScorer.finalize.final_beam_tokens",description:`<strong>final_beam_tokens</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) &#x2014;
The last tokens to be added to the non-finished beam_hypotheses.`,name:"final_beam_tokens"},{anchor:"transformers.BeamScorer.finalize.final_beam_indices",description:`<strong>final_beam_indices</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) &#x2014;
The beam indices indicating to which beam the <code>final_beam_tokens</code> shall be added.`,name:"final_beam_indices"},{anchor:"transformers.BeamScorer.finalize.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The id of the <em>padding</em> token.`,name:"pad_token_id"},{anchor:"transformers.BeamScorer.finalize.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>, <em>optional</em>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L109",returnDescription:`
<p>The generated sequences.
The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter if all batches finished early
due to the <code>eos_token_id</code>.</p>
`,returnType:`
<p><code>torch.LongTensor</code> of shape <code>(batch_size * num_return_sequences, sequence_length)</code></p>
`}}),yc=new v({props:{name:"class transformers.BeamSearchScorer",anchor:"transformers.BeamSearchScorer",parameters:[{name:"batch_size",val:": int"},{name:"num_beams",val:": int"},{name:"device",val:": device"},{name:"length_penalty",val:": typing.Optional[float] = 1.0"},{name:"do_early_stopping",val:": typing.Union[str, bool, NoneType] = False"},{name:"num_beam_hyps_to_keep",val:": typing.Optional[int] = 1"},{name:"num_beam_groups",val:": typing.Optional[int] = 1"},{name:"max_length",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.BeamSearchScorer.batch_size",description:`<strong>batch_size</strong> (<code>int</code>) &#x2014;
Batch Size of <code>input_ids</code> for which standard beam search decoding is run in parallel.`,name:"batch_size"},{anchor:"transformers.BeamSearchScorer.num_beams",description:`<strong>num_beams</strong> (<code>int</code>) &#x2014;
Number of beams for beam search.`,name:"num_beams"},{anchor:"transformers.BeamSearchScorer.device",description:`<strong>device</strong> (<code>torch.device</code>) &#x2014;
Defines the device type (<em>e.g.</em>, <code>&quot;cpu&quot;</code> or <code>&quot;cuda&quot;</code>) on which this instance of <code>BeamSearchScorer</code> will be
allocated.`,name:"device"},{anchor:"transformers.BeamSearchScorer.length_penalty",description:`<strong>length_penalty</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Exponential penalty to the length that is used with beam-based generation. It is applied as an exponent to
the sequence length, which in turn is used to divide the score of the sequence. Since the score is the log
likelihood of the sequence (i.e. negative), <code>length_penalty</code> &gt; 0.0 promotes longer sequences, while
<code>length_penalty</code> &lt; 0.0 encourages shorter sequences.`,name:"length_penalty"},{anchor:"transformers.BeamSearchScorer.do_early_stopping",description:`<strong>do_early_stopping</strong> (<code>bool</code> or <code>str</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Controls the stopping condition for beam-based methods, like beam-search. It accepts the following values:
<code>True</code>, where the generation stops as soon as there are <code>num_beams</code> complete candidates; <code>False</code>, where an
heuristic is applied and the generation stops when is it very unlikely to find better candidates;
<code>&quot;never&quot;</code>, where the beam search procedure only stops when there cannot be better candidates (canonical
beam search algorithm).`,name:"do_early_stopping"},{anchor:"transformers.BeamSearchScorer.num_beam_hyps_to_keep",description:`<strong>num_beam_hyps_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of beam hypotheses that shall be returned upon calling
<code>~transformer.BeamSearchScorer.finalize</code>.`,name:"num_beam_hyps_to_keep"},{anchor:"transformers.BeamSearchScorer.num_beam_groups",description:`<strong>num_beam_groups</strong> (<code>int</code>) &#x2014;
Number of groups to divide <code>num_beams</code> into in order to ensure diversity among different groups of beams.
See <a href="https://arxiv.org/pdf/1610.02424.pdf" rel="nofollow">this paper</a> for more details.`,name:"num_beam_groups"},{anchor:"transformers.BeamSearchScorer.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The maximum length of the sequence to be generated.`,name:"max_length"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L123"}}),$c=new v({props:{name:"process",anchor:"transformers.BeamSearchScorer.process",parameters:[{name:"input_ids",val:": LongTensor"},{name:"next_scores",val:": FloatTensor"},{name:"next_tokens",val:": LongTensor"},{name:"next_indices",val:": LongTensor"},{name:"pad_token_id",val:": typing.Optional[int] = None"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int], NoneType] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"},{name:"group_index",val:": typing.Optional[int] = 0"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L215"}}),kc=new v({props:{name:"finalize",anchor:"transformers.BeamSearchScorer.finalize",parameters:[{name:"input_ids",val:": LongTensor"},{name:"final_beam_scores",val:": FloatTensor"},{name:"final_beam_tokens",val:": LongTensor"},{name:"final_beam_indices",val:": LongTensor"},{name:"max_length",val:": int"},{name:"pad_token_id",val:": typing.Optional[int] = None"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int], NoneType] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L315"}}),xc=new v({props:{name:"class transformers.ConstrainedBeamSearchScorer",anchor:"transformers.ConstrainedBeamSearchScorer",parameters:[{name:"batch_size",val:": int"},{name:"num_beams",val:": int"},{name:"constraints",val:": typing.List[transformers.generation.beam_constraints.Constraint]"},{name:"device",val:": device"},{name:"length_penalty",val:": typing.Optional[float] = 1.0"},{name:"do_early_stopping",val:": typing.Union[str, bool, NoneType] = False"},{name:"num_beam_hyps_to_keep",val:": typing.Optional[int] = 1"},{name:"num_beam_groups",val:": typing.Optional[int] = 1"},{name:"max_length",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.ConstrainedBeamSearchScorer.batch_size",description:`<strong>batch_size</strong> (<code>int</code>) &#x2014;
Batch Size of <code>input_ids</code> for which standard beam search decoding is run in parallel.`,name:"batch_size"},{anchor:"transformers.ConstrainedBeamSearchScorer.num_beams",description:`<strong>num_beams</strong> (<code>int</code>) &#x2014;
Number of beams for beam search.`,name:"num_beams"},{anchor:"transformers.ConstrainedBeamSearchScorer.constraints",description:`<strong>constraints</strong> (<code>List[Constraint]</code>) &#x2014;
A list of positive constraints represented as <code>Constraint</code> objects that must be fulfilled in the generation
output. For more information, the documentation of <a href="/docs/transformers/main/en/internal/generation_utils#transformers.Constraint">Constraint</a> should be read.`,name:"constraints"},{anchor:"transformers.ConstrainedBeamSearchScorer.device",description:`<strong>device</strong> (<code>torch.device</code>) &#x2014;
Defines the device type (<em>e.g.</em>, <code>&quot;cpu&quot;</code> or <code>&quot;cuda&quot;</code>) on which this instance of <code>BeamSearchScorer</code> will be
allocated.`,name:"device"},{anchor:"transformers.ConstrainedBeamSearchScorer.length_penalty",description:`<strong>length_penalty</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Exponential penalty to the length that is used with beam-based generation. It is applied as an exponent to
the sequence length, which in turn is used to divide the score of the sequence. Since the score is the log
likelihood of the sequence (i.e. negative), <code>length_penalty</code> &gt; 0.0 promotes longer sequences, while
<code>length_penalty</code> &lt; 0.0 encourages shorter sequences.`,name:"length_penalty"},{anchor:"transformers.ConstrainedBeamSearchScorer.do_early_stopping",description:`<strong>do_early_stopping</strong> (<code>bool</code> or <code>str</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Controls the stopping condition for beam-based methods, like beam-search. It accepts the following values:
<code>True</code>, where the generation stops as soon as there are <code>num_beams</code> complete candidates; <code>False</code>, where an
heuristic is applied and the generation stops when is it very unlikely to find better candidates;
<code>&quot;never&quot;</code>, where the beam search procedure only stops when there cannot be better candidates (canonical
beam search algorithm).`,name:"do_early_stopping"},{anchor:"transformers.ConstrainedBeamSearchScorer.num_beam_hyps_to_keep",description:`<strong>num_beam_hyps_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of beam hypotheses that shall be returned upon calling
<code>~transformer.BeamSearchScorer.finalize</code>.`,name:"num_beam_hyps_to_keep"},{anchor:"transformers.ConstrainedBeamSearchScorer.num_beam_groups",description:`<strong>num_beam_groups</strong> (<code>int</code>) &#x2014;
Number of groups to divide <code>num_beams</code> into in order to ensure diversity among different groups of beams.
See <a href="https://arxiv.org/pdf/1610.02424.pdf" rel="nofollow">this paper</a> for more details.`,name:"num_beam_groups"},{anchor:"transformers.ConstrainedBeamSearchScorer.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The maximum length of the sequence to be generated.`,name:"max_length"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L410"}}),Mc=new v({props:{name:"process",anchor:"transformers.ConstrainedBeamSearchScorer.process",parameters:[{name:"input_ids",val:": LongTensor"},{name:"next_scores",val:": FloatTensor"},{name:"next_tokens",val:": LongTensor"},{name:"next_indices",val:": LongTensor"},{name:"scores_for_all_vocab",val:": FloatTensor"},{name:"pad_token_id",val:": typing.Optional[int] = None"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int], NoneType] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"}],parametersDescription:[{anchor:"transformers.ConstrainedBeamSearchScorer.process.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size * num_beams, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using any class inheriting from <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/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.ConstrainedBeamSearchScorer.process.next_scores",description:`<strong>next_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
Current scores of the top <code>2 * num_beams</code> non-finished beam hypotheses.`,name:"next_scores"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.next_tokens",description:`<strong>next_tokens</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
<code>input_ids</code> of the tokens corresponding to the top <code>2 * num_beams</code> non-finished beam hypotheses.`,name:"next_tokens"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.next_indices",description:`<strong>next_indices</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
Beam indices indicating to which beam hypothesis the <code>next_tokens</code> correspond.`,name:"next_indices"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.scores_for_all_vocab",description:`<strong>scores_for_all_vocab</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams, sequence_length)</code>) &#x2014;
The scores of all tokens in the vocabulary for each of the beam hypotheses.`,name:"scores_for_all_vocab"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The id of the <em>padding</em> token.`,name:"pad_token_id"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>, <em>optional</em>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.beam_indices",description:`<strong>beam_indices</strong> (<code>torch.LongTensor</code>, <em>optional</em>) &#x2014;
Beam indices indicating to which beam hypothesis each token correspond.`,name:"beam_indices"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L504",returnDescription:`
<p>A dictionary composed of the fields as defined above:</p>
<ul>
<li>
<p><strong>next_beam_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Updated scores of
all
non-finished beams.</p>
</li>
<li>
<p><strong>next_beam_tokens</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Next tokens to be
added
to the non-finished beam_hypotheses.</p>
</li>
<li>
<p><strong>next_beam_indices</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Beam indices
indicating to which beam the next tokens shall be added.</p>
</li>
</ul>
`,returnType:`
<p><code>UserDict</code></p>
`}}),Ec=new v({props:{name:"finalize",anchor:"transformers.ConstrainedBeamSearchScorer.finalize",parameters:[{name:"input_ids",val:": LongTensor"},{name:"final_beam_scores",val:": FloatTensor"},{name:"final_beam_tokens",val:": LongTensor"},{name:"final_beam_indices",val:": LongTensor"},{name:"max_length",val:": int"},{name:"pad_token_id",val:": typing.Optional[int] = None"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int], NoneType] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L798"}}),jc=new pe({}),Fc=new v({props:{name:"transformers.top_k_top_p_filtering",anchor:"transformers.top_k_top_p_filtering",parameters:[{name:"logits",val:": FloatTensor"},{name:"top_k",val:": int = 0"},{name:"top_p",val:": float = 1.0"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.top_k_top_p_filtering.top_k",description:`<strong>top_k</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If &gt; 0, only keep the top k tokens with highest probability (top-k filtering)`,name:"top_k"},{anchor:"transformers.top_k_top_p_filtering.top_p",description:`<strong>top_p</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
If &lt; 1.0, only keep the top tokens with cumulative probability &gt;= top_p (nucleus filtering). Nucleus
filtering is described in Holtzman et al. (<a href="http://arxiv.org/abs/1904.09751" rel="nofollow">http://arxiv.org/abs/1904.09751</a>)`,name:"top_p"},{anchor:"transformers.top_k_top_p_filtering.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimumber of tokens we keep per batch example in the output.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L4696"}}),zc=new v({props:{name:"transformers.tf_top_k_top_p_filtering",anchor:"transformers.tf_top_k_top_p_filtering",parameters:[{name:"logits",val:""},{name:"top_k",val:" = 0"},{name:"top_p",val:" = 1.0"},{name:"filter_value",val:" = -inf"},{name:"min_tokens_to_keep",val:" = 1"}],parametersDescription:[{anchor:"transformers.tf_top_k_top_p_filtering.top_k",description:`<strong>top_k</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If &gt; 0, only keep the top k tokens with highest probability (top-k filtering)`,name:"top_k"},{anchor:"transformers.tf_top_k_top_p_filtering.top_p",description:`<strong>top_p</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
If &lt; 1.0, only keep the top tokens with cumulative probability &gt;= top_p (nucleus filtering). Nucleus
filtering is described in Holtzman et al. (<a href="http://arxiv.org/abs/1904.09751" rel="nofollow">http://arxiv.org/abs/1904.09751</a>)`,name:"top_p"},{anchor:"transformers.tf_top_k_top_p_filtering.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimumber of tokens we keep per batch example in the output.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L3059"}}),Ic=new pe({}),Uc=new v({props:{name:"class transformers.TextStreamer",anchor:"transformers.TextStreamer",parameters:[{name:"tokenizer",val:": AutoTokenizer"},{name:"skip_prompt",val:": bool = False"},{name:"**decode_kwargs",val:""}],parametersDescription:[{anchor:"transformers.TextStreamer.tokenizer",description:`<strong>tokenizer</strong> (<code>AutoTokenizer</code>) &#x2014;
The tokenized used to decode the tokens.`,name:"tokenizer"},{anchor:"transformers.TextStreamer.skip_prompt",description:`<strong>skip_prompt</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to skip the prompt to <code>.generate()</code> or not. Useful e.g. for chatbots.`,name:"skip_prompt"},{anchor:"transformers.TextStreamer.decode_kwargs",description:`<strong>decode_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Additional keyword arguments to pass to the tokenizer&#x2019;s <code>decode</code> method.`,name:"decode_kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/streamers.py#L38"}}),sn=new xn({props:{warning:!0,$$slots:{default:[mB]},$$scope:{ctx:E}}}),nn=new me({props:{anchor:"transformers.TextStreamer.example",$$slots:{default:[hB]},$$scope:{ctx:E}}}),Bc=new v({props:{name:"end",anchor:"transformers.TextStreamer.end",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/streamers.py#L116"}}),qc=new v({props:{name:"on_finalized_text",anchor:"transformers.TextStreamer.on_finalized_text",parameters:[{name:"text",val:": str"},{name:"stream_end",val:": bool = False"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/streamers.py#L130"}}),Dc=new v({props:{name:"put",anchor:"transformers.TextStreamer.put",parameters:[{name:"value",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/streamers.py#L82"}}),Sc=new v({props:{name:"class transformers.TextIteratorStreamer",anchor:"transformers.TextIteratorStreamer",parameters:[{name:"tokenizer",val:": AutoTokenizer"},{name:"skip_prompt",val:": bool = False"},{name:"timeout",val:": typing.Optional[float] = None"},{name:"**decode_kwargs",val:""}],parametersDescription:[{anchor:"transformers.TextIteratorStreamer.tokenizer",description:`<strong>tokenizer</strong> (<code>AutoTokenizer</code>) &#x2014;
The tokenized used to decode the tokens.`,name:"tokenizer"},{anchor:"transformers.TextIteratorStreamer.skip_prompt",description:`<strong>skip_prompt</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to skip the prompt to <code>.generate()</code> or not. Useful e.g. for chatbots.`,name:"skip_prompt"},{anchor:"transformers.TextIteratorStreamer.timeout",description:`<strong>timeout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The timeout for the text queue. If <code>None</code>, the queue will block indefinitely. Useful to handle exceptions
in <code>.generate()</code>, when it is called in a separate thread.`,name:"timeout"},{anchor:"transformers.TextIteratorStreamer.decode_kwargs",description:`<strong>decode_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Additional keyword arguments to pass to the tokenizer&#x2019;s <code>decode</code> method.`,name:"decode_kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/streamers.py#L159"}}),ln=new xn({props:{warning:!0,$$slots:{default:[gB]},$$scope:{ctx:E}}}),dn=new me({props:{anchor:"transformers.TextIteratorStreamer.example",$$slots:{default:[uB]},$$scope:{ctx:E}}}),Pc=new v({props:{name:"on_finalized_text",anchor:"transformers.TextIteratorStreamer.on_finalized_text",parameters:[{name:"text",val:": str"},{name:"stream_end",val:": bool = False"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/streamers.py#L213"}}),{c(){T=s("meta"),x=c(),$=s("h1"),w=s("a"),M=s("span"),g(h.$$.fragment),k=c(),Z=s("span"),U=a("Utilities for Generation"),B=c(),F=s("p"),W=a("This page lists all the utility functions used by "),oe=s("a"),Ue=a("generate()"),S=a(`,
`),se=s("a"),Be=a("greedy_search()"),A=a(`,
`),j=s("a"),Kt=a("contrastive_search()"),eo=a(`,
`),xe=s("a"),to=a("sample()"),oo=a(`,
`),Cc=s("a"),WT=a("beam_search()"),VT=a(`,
`),Nc=s("a"),ZT=a("beam_sample()"),GT=a(`,
`),Xc=s("a"),CT=a("group_beam_search()"),NT=a(`, and
`),Rc=s("a"),XT=a("constrained_beam_search()"),RT=a("."),t_=c(),Oc=s("p"),OT=a("Most of those are only useful if you are studying the code of the generate methods in the library."),o_=c(),so=s("h2"),Ho=s("a"),mh=s("span"),g(Mn.$$.fragment),AT=c(),hh=s("span"),HT=a("Generate Outputs"),s_=c(),Me=s("p"),QT=a("The output of "),Ac=s("a"),YT=a("generate()"),KT=a(` is an instance of a subclass of
`),Hc=s("a"),ev=a("ModelOutput"),tv=a(`. This output is a data structure containing all the information returned
by `),Qc=s("a"),ov=a("generate()"),sv=a(", but that can also be used as tuple or dictionary."),n_=c(),Yc=s("p"),nv=a("Here\u2019s an example:"),r_=c(),g(En.$$.fragment),a_=c(),Pt=s("p"),rv=a("The "),gh=s("code"),av=a("generation_output"),iv=a(" object is a "),Kc=s("a"),cv=a("GreedySearchDecoderOnlyOutput"),lv=a(`, as we can
see in the documentation of that class below, it means it has the following attributes:`),i_=c(),Ee=s("ul"),el=s("li"),uh=s("code"),dv=a("sequences"),pv=a(": the generated sequences of tokens"),mv=c(),tl=s("li"),fh=s("code"),hv=a("scores"),gv=a(" (optional): the prediction scores of the language modelling head, for each generation step"),uv=c(),ol=s("li"),_h=s("code"),fv=a("hidden_states"),_v=a(" (optional): the hidden states of the model, for each generation step"),bv=c(),sl=s("li"),bh=s("code"),yv=a("attentions"),Tv=a(" (optional): the attention weights of the model, for each generation step"),c_=c(),V=s("p"),vv=a("Here we have the "),yh=s("code"),wv=a("scores"),$v=a(" since we passed along "),Th=s("code"),kv=a("output_scores=True"),xv=a(", but we don\u2019t have "),vh=s("code"),Mv=a("hidden_states"),Ev=a(` and
`),wh=s("code"),jv=a("attentions"),Fv=a(" because we didn\u2019t pass "),$h=s("code"),Lv=a("output_hidden_states=True"),zv=a(" or "),kh=s("code"),Jv=a("output_attentions=True"),Iv=a("."),l_=c(),ne=s("p"),Uv=a(`You can access each attribute as you would usually do, and if that attribute has not been returned by the model, you
will get `),xh=s("code"),Bv=a("None"),qv=a(". Here for instance "),Mh=s("code"),Dv=a("generation_output.scores"),Sv=a(` are all the generated prediction scores of the
language modeling head, and `),Eh=s("code"),Pv=a("generation_output.attentions"),Wv=a(" is "),jh=s("code"),Vv=a("None"),Zv=a("."),d_=c(),re=s("p"),Gv=a("When using our "),Fh=s("code"),Cv=a("generation_output"),Nv=a(" object as a tuple, it only keeps the attributes that don\u2019t have "),Lh=s("code"),Xv=a("None"),Rv=a(` values.
Here, for instance, it has two elements, `),zh=s("code"),Ov=a("loss"),Av=a(" then "),Jh=s("code"),Hv=a("logits"),Qv=a(", so"),p_=c(),g(jn.$$.fragment),m_=c(),Qo=s("p"),Yv=a("will return the tuple "),Ih=s("code"),Kv=a("(generation_output.sequences, generation_output.scores)"),e1=a(" for instance."),h_=c(),ae=s("p"),t1=a("When using our "),Uh=s("code"),o1=a("generation_output"),s1=a(" object as a dictionary, it only keeps the attributes that don\u2019t have "),Bh=s("code"),n1=a("None"),r1=a(`
values. Here, for instance, it has two keys that are `),qh=s("code"),a1=a("sequences"),i1=a(" and "),Dh=s("code"),c1=a("scores"),l1=a("."),g_=c(),nl=s("p"),d1=a("We document here all output types."),u_=c(),no=s("h3"),Yo=s("a"),Sh=s("span"),g(Fn.$$.fragment),p1=c(),Ph=s("span"),m1=a("PyTorch"),f_=c(),ro=s("div"),g(Ln.$$.fragment),h1=c(),Wh=s("p"),g1=a(`Base class for outputs of encoder-decoder generation models using greedy search. Hidden states and attention
weights of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the
encoder_hidden_states attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),__=c(),ao=s("div"),g(zn.$$.fragment),u1=c(),Vh=s("p"),f1=a("Base class for outputs of decoder-only generation models using greedy search."),b_=c(),io=s("div"),g(Jn.$$.fragment),_1=c(),Zh=s("p"),b1=a(`Base class for outputs of encoder-decoder generation models using sampling. Hidden states and attention weights of
the decoder (respectively the encoder) can be accessed via the encoder_attentions and the encoder_hidden_states
attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),y_=c(),co=s("div"),g(In.$$.fragment),y1=c(),Gh=s("p"),T1=a("Base class for outputs of decoder-only generation models using sampling."),T_=c(),lo=s("div"),g(Un.$$.fragment),v1=c(),Ch=s("p"),w1=a(`Base class for outputs of encoder-decoder generation models using beam search. Hidden states and attention weights
of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the encoder_hidden_states
attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),v_=c(),po=s("div"),g(Bn.$$.fragment),$1=c(),Nh=s("p"),k1=a("Base class for outputs of decoder-only generation models using beam search."),w_=c(),mo=s("div"),g(qn.$$.fragment),x1=c(),Xh=s("p"),M1=a(`Base class for outputs of encoder-decoder generation models using beam sampling. Hidden states and attention
weights of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the
encoder_hidden_states attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),$_=c(),ho=s("div"),g(Dn.$$.fragment),E1=c(),Rh=s("p"),j1=a("Base class for outputs of decoder-only generation models using beam sample."),k_=c(),go=s("div"),g(Sn.$$.fragment),F1=c(),Oh=s("p"),L1=a("Base class for outputs of decoder-only generation models using contrastive search."),x_=c(),uo=s("div"),g(Pn.$$.fragment),z1=c(),Ah=s("p"),J1=a("Base class for outputs of decoder-only generation models using contrastive search."),M_=c(),fo=s("h3"),Ko=s("a"),Hh=s("span"),g(Wn.$$.fragment),I1=c(),Qh=s("span"),U1=a("TensorFlow"),E_=c(),_o=s("div"),g(Vn.$$.fragment),B1=c(),Yh=s("p"),q1=a(`Base class for outputs of encoder-decoder generation models using greedy search. Hidden states and attention
weights of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the
encoder_hidden_states attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),j_=c(),bo=s("div"),g(Zn.$$.fragment),D1=c(),Kh=s("p"),S1=a("Base class for outputs of decoder-only generation models using greedy search."),F_=c(),yo=s("div"),g(Gn.$$.fragment),P1=c(),eg=s("p"),W1=a(`Base class for outputs of encoder-decoder generation models using sampling. Hidden states and attention weights of
the decoder (respectively the encoder) can be accessed via the encoder_attentions and the encoder_hidden_states
attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),L_=c(),To=s("div"),g(Cn.$$.fragment),V1=c(),tg=s("p"),Z1=a("Base class for outputs of decoder-only generation models using sampling."),z_=c(),vo=s("div"),g(Nn.$$.fragment),G1=c(),og=s("p"),C1=a(`Base class for outputs of encoder-decoder generation models using beam search. Hidden states and attention weights
of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the encoder_hidden_states
attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),J_=c(),wo=s("div"),g(Xn.$$.fragment),N1=c(),sg=s("p"),X1=a("Base class for outputs of decoder-only generation models using beam search."),I_=c(),$o=s("div"),g(Rn.$$.fragment),R1=c(),ng=s("p"),O1=a(`Base class for outputs of encoder-decoder generation models using beam sampling. Hidden states and attention
weights of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the
encoder_hidden_states attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),U_=c(),ko=s("div"),g(On.$$.fragment),A1=c(),rg=s("p"),H1=a("Base class for outputs of decoder-only generation models using beam sample."),B_=c(),xo=s("div"),g(An.$$.fragment),Q1=c(),ag=s("p"),Y1=a(`Base class for outputs of encoder-decoder generation models using contrastive search. Hidden states and attention
weights of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the
encoder_hidden_states attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),q_=c(),Mo=s("div"),g(Hn.$$.fragment),K1=c(),ig=s("p"),e2=a("Base class for outputs of decoder-only generation models using contrastive search."),D_=c(),Eo=s("h3"),es=s("a"),cg=s("span"),g(Qn.$$.fragment),t2=c(),lg=s("span"),o2=a("FLAX"),S_=c(),qe=s("div"),g(Yn.$$.fragment),s2=c(),dg=s("p"),n2=a("Flax Base class for outputs of decoder-only generation models using sampling."),r2=c(),ts=s("div"),g(Kn.$$.fragment),a2=c(),pg=s("p"),i2=a("\u201CReturns a new object replacing the specified fields with new values."),P_=c(),De=s("div"),g(er.$$.fragment),c2=c(),mg=s("p"),l2=a("Flax Base class for outputs of decoder-only generation models using greedy search."),d2=c(),os=s("div"),g(tr.$$.fragment),p2=c(),hg=s("p"),m2=a("\u201CReturns a new object replacing the specified fields with new values."),W_=c(),Se=s("div"),g(or.$$.fragment),h2=c(),gg=s("p"),g2=a("Flax Base class for outputs of decoder-only generation models using greedy search."),u2=c(),ss=s("div"),g(sr.$$.fragment),f2=c(),ug=s("p"),_2=a("\u201CReturns a new object replacing the specified fields with new values."),V_=c(),jo=s("h2"),ns=s("a"),fg=s("span"),g(nr.$$.fragment),b2=c(),_g=s("span"),y2=a("LogitsProcessor"),Z_=c(),rs=s("p"),T2=a("A "),rl=s("a"),v2=a("LogitsProcessor"),w2=a(` can be used to modify the prediction scores of a language model head for
generation.`),G_=c(),Fo=s("h3"),as=s("a"),bg=s("span"),g(rr.$$.fragment),$2=c(),yg=s("span"),k2=a("PyTorch"),C_=c(),Pe=s("div"),g(ar.$$.fragment),x2=c(),is=s("p"),al=s("a"),M2=a("LogitsProcessor"),E2=a(" enforcing alternated generation between the two codebooks of "),Tg=s("code"),j2=a("Bark"),F2=a("\u2019s fine submodel."),L2=c(),il=s("div"),g(ir.$$.fragment),N_=c(),ge=s("div"),g(cr.$$.fragment),z2=c(),lr=s("p"),J2=a(`Logits processor for classifier free guidance (CFG). The scores are split over the batch dimension,
where the first half correspond to the conditional logits (predicted from the input prompt) and the second half
correspond to the unconditional logits (predicted from an empty or \u2018null\u2019 prompt). The processor computes a
weighted average across the conditional and unconditional logits, parameterised by the `),vg=s("code"),I2=a("guidance_scale"),U2=a("."),B2=c(),dr=s("p"),q2=a("See "),pr=s("a"),D2=a("the paper"),S2=a(" for more information."),P2=c(),cl=s("div"),g(mr.$$.fragment),X_=c(),We=s("div"),g(hr.$$.fragment),W2=c(),cs=s("p"),ll=s("a"),V2=a("LogitsProcessor"),Z2=a(` that enforces no repetition of encoder input ids n-grams for the decoder ids. See
`),gr=s("a"),G2=a("ParlAI"),C2=a("."),N2=c(),dl=s("div"),g(ur.$$.fragment),R_=c(),Ve=s("div"),g(fr.$$.fragment),X2=c(),pl=s("p"),ml=s("a"),R2=a("LogitsProcessor"),O2=a(" enforcing an exponential penalty on tokens that are not in the original input."),A2=c(),hl=s("div"),g(_r.$$.fragment),O_=c(),ue=s("div"),g(br.$$.fragment),H2=c(),Wt=s("p"),gl=s("a"),Q2=a("LogitsWarper"),Y2=a(" that performs epsilon-sampling, i.e. restricting to tokens with "),wg=s("code"),K2=a("prob >= epsilon"),ew=a(`. Takes the
largest min_tokens_to_keep tokens if no tokens satisfy this constraint. See `),yr=s("a"),tw=a(`Truncation Sampling as Language Model
Desmoothing`),ow=a(" for more information."),sw=c(),g(ls.$$.fragment),nw=c(),ul=s("div"),g(Tr.$$.fragment),A_=c(),fe=s("div"),g(vr.$$.fragment),rw=c(),D=s("p"),fl=s("a"),aw=a("LogitsWarper"),iw=a(` that performs eta-sampling, a technique to filter out tokens with probabilities below a dynamic
cutoff value, `),$g=s("code"),cw=a("eta"),lw=a(", which is calculated based on a combination of the hyperparameter "),kg=s("code"),dw=a("epsilon"),pw=a(` and the entropy of
the token probabilities, i.e. `),xg=s("code"),mw=a("eta := min(epsilon, sqrt(epsilon * e^-entropy(probabilities)))"),hw=a(`. Takes the largest
min_tokens_to_keep tokens if no tokens satisfy this constraint. It addresses the issue of poor quality in long
samples of text generated by neural language models leading to more coherent and fluent text. See `),wr=s("a"),gw=a(`Truncation
Sampling as Language Model Desmoothing`),uw=a(" for more information. Note: "),Mg=s("code"),fw=a("do_sample"),_w=a(`
must be set to `),Eg=s("code"),bw=a("True"),yw=a(" for this "),jg=s("code"),Tw=a("LogitsWarper"),vw=a(" to work."),ww=c(),g(ds.$$.fragment),$w=c(),_l=s("div"),g($r.$$.fragment),H_=c(),Ze=s("div"),g(kr.$$.fragment),kw=c(),bl=s("p"),yl=s("a"),xw=a("LogitsProcessor"),Mw=a(` that exponentially increases the score of the eos_token_id after regulation_start has been
reached.`),Ew=c(),Tl=s("div"),g(xr.$$.fragment),Q_=c(),Ge=s("div"),g(Mr.$$.fragment),jw=c(),vl=s("p"),wl=s("a"),Fw=a("LogitsProcessor"),Lw=a(" that enforces the specified token as the first generated token."),zw=c(),$l=s("div"),g(Er.$$.fragment),Y_=c(),Ce=s("div"),g(jr.$$.fragment),Jw=c(),ps=s("p"),kl=s("a"),Iw=a("LogitsProcessor"),Uw=a(" that enforces the specified token as the last generated token when "),Fg=s("code"),Bw=a("max_length"),qw=a(" is reached."),Dw=c(),xl=s("div"),g(Fr.$$.fragment),K_=c(),Ne=s("div"),g(Lr.$$.fragment),Sw=c(),zr=s("p"),Pw=a(`This processor takes a list of pairs of integers which indicates a mapping from generation indices to token
indices that will be forced before sampling. The processor will set their log probs to `),Lg=s("code"),Ww=a("inf"),Vw=a(` so that they are
sampled at their corresponding index.`),Zw=c(),Ml=s("div"),g(Jr.$$.fragment),eb=c(),L=s("div"),g(Ir.$$.fragment),Gw=c(),El=s("p"),jl=s("a"),Cw=a("LogitsProcessor"),Nw=a(" that enforces diverse beam search."),Xw=c(),Lo=s("p"),Rw=a("Note that this logits processor is only effective for "),Fl=s("a"),Ow=a("PreTrainedModel.group_beam_search()"),Aw=a(". See "),Ur=s("a"),Hw=a(`Diverse Beam
Search: Decoding Diverse Solutions from Neural Sequence Models`),Qw=a(` for more
details.`),Yw=c(),g(ms.$$.fragment),Kw=c(),g(hs.$$.fragment),e$=c(),Br=s("p"),t$=a(`Traditional beam search often generates very similar sequences across different beams.
`),zg=s("code"),o$=a("HammingDiversityLogitsProcessor"),s$=a(` addresses this by penalizing beams that generate tokens already chosen by other
beams in the same time step.`),n$=c(),Jg=s("p"),r$=a("How It Works:"),a$=c(),zo=s("ul"),Ll=s("li"),Ig=s("strong"),i$=a("Grouping Beams"),c$=a(": Beams are divided into groups. Each group selects tokens independently of the others."),l$=c(),zl=s("li"),Ug=s("strong"),d$=a("Penalizing Repeated Tokens"),p$=a(`: If a beam in a group selects a token already chosen by another group in the
same step, a penalty is applied to that token\u2019s score.`),m$=c(),Jl=s("li"),Bg=s("strong"),h$=a("Promoting Diversity"),g$=a(`: This penalty discourages beams within a group from selecting the same tokens as
beams in other groups.`),u$=c(),qg=s("p"),f$=a("Benefits:"),_$=c(),qr=s("ul"),Il=s("li"),Dg=s("strong"),b$=a("Diverse Outputs"),y$=a(": Produces a variety of different sequences."),T$=c(),Ul=s("li"),Sg=s("strong"),v$=a("Exploration"),w$=a(": Allows the model to explore different paths."),$$=c(),g(gs.$$.fragment),k$=c(),Bl=s("div"),g(Dr.$$.fragment),tb=c(),Xe=s("div"),g(Sr.$$.fragment),x$=c(),Vt=s("p"),ql=s("a"),M$=a("LogitsProcessor"),E$=a(" that removes all "),Pg=s("code"),j$=a("nan"),F$=a(" and "),Wg=s("code"),L$=a("inf"),z$=a(` values to avoid the generation method to fail. Note that using
the logits processor should only be used if necessary since it can slow down the generation method.`),J$=c(),Dl=s("div"),g(Pr.$$.fragment),ob=c(),Re=s("div"),g(Wr.$$.fragment),I$=c(),us=s("p"),Sl=s("a"),U$=a("LogitsWarper"),B$=a(" and "),Pl=s("a"),q$=a("LogitsProcessor"),D$=a(` for normalizing the scores using log-softmax. It\u2019s important to normalize
the scores during beam search, after applying the logits processors or warpers, since the search algorithm used in
this library doesn\u2019t do it (it only does it before, but they may need re-normalization) but it still supposes that
the scores are normalized when comparing the hypotheses.`),S$=c(),Wl=s("div"),g(Vr.$$.fragment),sb=c(),Oe=s("div"),g(Zr.$$.fragment),P$=c(),Vg=s("p"),W$=a("Abstract base class for all logit processors that can be applied during generation."),V$=c(),Vl=s("div"),g(Gr.$$.fragment),nb=c(),Ae=s("div"),g(Cr.$$.fragment),Z$=c(),G=s("p"),G$=a("This class can be used to create a list of "),Zl=s("a"),C$=a("LogitsProcessor"),N$=a(" or "),Gl=s("a"),X$=a("LogitsWarper"),R$=a(` to subsequently process a
`),Zg=s("code"),O$=a("scores"),A$=a(" input tensor. This class inherits from list and adds a specific "),Gg=s("em"),Cg=s("strong"),H$=a("call"),Q$=a(` method to apply each
`),Cl=s("a"),Y$=a("LogitsProcessor"),K$=a(" or "),Nl=s("a"),ek=a("LogitsWarper"),tk=a(" to the inputs."),ok=c(),Xl=s("div"),g(Nr.$$.fragment),rb=c(),He=s("div"),g(Xr.$$.fragment),sk=c(),Ng=s("p"),nk=a("Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),rk=c(),Rl=s("div"),g(Rr.$$.fragment),ab=c(),Qe=s("div"),g(Or.$$.fragment),ak=c(),Ol=s("p"),Al=s("a"),ik=a("LogitsProcessor"),ck=a(" enforcing a min-length by setting EOS probability to 0."),lk=c(),Hl=s("div"),g(Ar.$$.fragment),ib=c(),_e=s("div"),g(Hr.$$.fragment),dk=c(),je=s("p"),Ql=s("a"),pk=a("LogitsProcessor"),mk=a(` enforcing a min-length of new tokens by setting EOS (End-Of-Sequence) token probability to 0.
Note that for decoder-only models, such as Llama2, `),Xg=s("code"),hk=a("min_length"),gk=a(" will compute the length of "),Rg=s("code"),uk=a("prompt + newly generated tokens"),fk=a(" whereas for other models it will behave as "),Og=s("code"),_k=a("min_new_tokens"),bk=a(`, that is, taking only into account
the newly generated ones.`),yk=c(),g(fs.$$.fragment),Tk=c(),Yl=s("div"),g(Qr.$$.fragment),cb=c(),H=s("div"),g(Yr.$$.fragment),vk=c(),Kl=s("p"),ed=s("a"),wk=a("LogitsProcessor"),$k=a(" that enforces that specified sequences will never be selected."),kk=c(),g(_s.$$.fragment),xk=c(),g(bs.$$.fragment),Mk=c(),td=s("div"),g(Kr.$$.fragment),lb=c(),Q=s("div"),g(ea.$$.fragment),Ek=c(),Jo=s("p"),jk=a(`N-grams are groups of \u201Cn\u201D consecutive words, characters, or tokens taken from a sequence of text. Given the
sentence: \u201CShe runs fast\u201D, the bi-grams (n=2) would be (\u201Cshe\u201D, \u201Cruns\u201D) and (\u201Cruns\u201D, \u201Cfast\u201D). In text generation,
avoiding repetitions of word sequences provides a more diverse output. This `),od=s("a"),Fk=a("LogitsProcessor"),Lk=a(` enforces no
repetition of n-grams by setting the scores of banned tokens to negative infinity which eliminates those tokens
from consideration when further processing the scores.
`),ta=s("a"),zk=a("Fairseq"),Jk=a("."),Ik=c(),g(ys.$$.fragment),Uk=c(),g(Ts.$$.fragment),Bk=c(),sd=s("div"),g(oa.$$.fragment),db=c(),Ye=s("div"),g(sa.$$.fragment),qk=c(),vs=s("p"),nd=s("a"),Dk=a("LogitsProcessor"),Sk=a(` that enforces constrained generation and is useful for prefix-conditioned constrained
generation. See `),na=s("a"),Pk=a("Autoregressive Entity Retrieval"),Wk=a(" for more information."),Vk=c(),rd=s("div"),g(ra.$$.fragment),pb=c(),be=s("div"),g(aa.$$.fragment),Zk=c(),ws=s("p"),ad=s("a"),Gk=a("LogitsProcessor"),Ck=a(` that prevents the repetition of previous tokens through an exponential penalty. This technique
shares some similarities with coverage mechanisms and other aimed at reducing repetition. During the text
generation process, the probability distribution for the next token is determined using a formula that incorporates
token scores based on their occurrence in the generated sequence. Tokens with higher scores are less likely to be
selected. The formula can be seen in the original `),ia=s("a"),Nk=a("paper"),Xk=a(`. According to the
paper a penalty of around 1.2 yields a good balance between truthful generation and lack of repetition.`),Rk=c(),g($s.$$.fragment),Ok=c(),id=s("div"),g(ca.$$.fragment),mb=c(),Y=s("div"),g(la.$$.fragment),Ak=c(),cd=s("p"),ld=s("a"),Hk=a("LogitsProcessor"),Qk=a(` that applies an additive bias on sequences. The bias is applied to the last token of a sequence
when the next generated token can complete it. Consequently, to take the most of biasing sequences with more than
one token, consider using beam methods (to gracefully work around partially completed sequences that have a
negative bias) and applying the bias to their prefixes (to ensure the bias is applied earlier).`),Yk=c(),g(ks.$$.fragment),Kk=c(),g(xs.$$.fragment),e0=c(),dd=s("div"),g(da.$$.fragment),hb=c(),Ke=s("div"),g(pa.$$.fragment),t0=c(),Fe=s("p"),pd=s("a"),o0=a("SuppressTokensAtBeginLogitsProcessor"),s0=a(" supresses a list of tokens as soon as the "),Ag=s("code"),n0=a("generate"),r0=a(` function starts
generating using `),Hg=s("code"),a0=a("begin_index"),i0=a(" tokens. This should ensure that the tokens defined by "),Qg=s("code"),c0=a("begin_suppress_tokens"),l0=a(` at not
sampled at the begining of the generation.`),d0=c(),md=s("div"),g(ma.$$.fragment),gb=c(),et=s("div"),g(ha.$$.fragment),p0=c(),ga=s("p"),m0=a("This processor can be used to suppress a list of tokens. The processor will set their log probs to "),Yg=s("code"),h0=a("-inf"),g0=a(` so that they
are not sampled.`),u0=c(),hd=s("div"),g(ua.$$.fragment),ub=c(),K=s("div"),g(fa.$$.fragment),f0=c(),gd=s("p"),ud=s("a"),_0=a("LogitsWarper"),b0=a(` for temperature (exponential scaling output probability distribution), which effectively means
that it can control the randomness of the predicted tokens.`),y0=c(),g(Ms.$$.fragment),T0=c(),g(Es.$$.fragment),v0=c(),fd=s("div"),g(_a.$$.fragment),fb=c(),tt=s("div"),g(ba.$$.fragment),w0=c(),_d=s("p"),bd=s("a"),$0=a("LogitsWarper"),k0=a(" that performs top-k, i.e. restricting to the k highest probability elements."),x0=c(),yd=s("div"),g(ya.$$.fragment),_b=c(),ye=s("div"),g(Ta.$$.fragment),M0=c(),Td=s("p"),vd=s("a"),E0=a("LogitsWarper"),j0=a(" that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),F0=c(),g(js.$$.fragment),L0=c(),wd=s("div"),g(va.$$.fragment),bb=c(),ot=s("div"),g(wa.$$.fragment),z0=c(),Fs=s("p"),$d=s("a"),J0=a("LogitsWarper"),I0=a(" that performs typical decoding. See "),$a=s("a"),U0=a(`Typical Decoding for Natural Language
Generation`),B0=a(" for more information."),q0=c(),kd=s("div"),g(ka.$$.fragment),yb=c(),ee=s("div"),g(xa.$$.fragment),D0=c(),st=s("p"),S0=a(`Logits processor for Classifier-Free Guidance (CFG). The processors
computes a weighted average across scores from prompt conditional and prompt unconditional (or negative) logits,
parameterized by the `),Kg=s("code"),P0=a("guidance_scale"),W0=a(". The unconditional scores are computed internally by prompting "),eu=s("code"),V0=a("model"),Z0=a(` with
the `),tu=s("code"),G0=a("unconditional_ids"),C0=a(" branch."),N0=c(),Ma=s("p"),X0=a("See "),Ea=s("a"),R0=a("the paper"),O0=a(" for more information."),A0=c(),g(Ls.$$.fragment),H0=c(),xd=s("div"),g(ja.$$.fragment),Tb=c(),Te=s("div"),g(Fa.$$.fragment),Q0=c(),La=s("p"),Y0=a(`Whisper specific Processor. This processor can be used to force a list of tokens. The processor will set their log
probs to `),ou=s("code"),K0=a("inf"),ex=a(" so that they are sampled at their corresponding index."),tx=c(),za=s("p"),ox=a("See "),Ja=s("a"),sx=a("the paper"),nx=a(" for more information."),rx=c(),Md=s("div"),g(Ia.$$.fragment),vb=c(),Io=s("h3"),zs=s("a"),su=s("span"),g(Ua.$$.fragment),ax=c(),nu=s("span"),ix=a("TensorFlow"),wb=c(),nt=s("div"),g(Ba.$$.fragment),cx=c(),Ed=s("p"),jd=s("a"),lx=a("TFLogitsProcessor"),dx=a(" that enforces the specified token as the first generated token."),px=c(),Fd=s("div"),g(qa.$$.fragment),$b=c(),rt=s("div"),g(Da.$$.fragment),mx=c(),Js=s("p"),Ld=s("a"),hx=a("TFLogitsProcessor"),gx=a(" that enforces the specified token as the last generated token when "),ru=s("code"),ux=a("max_length"),fx=a(" is reached."),_x=c(),zd=s("div"),g(Sa.$$.fragment),kb=c(),at=s("div"),g(Pa.$$.fragment),bx=c(),Uo=s("p"),yx=a(`This processor takes a list of pairs of integers which indicates a mapping from generation indices to token
indices that will be forced before sampling. The processor will set their log probs to `),au=s("code"),Tx=a("0"),vx=a(` and all other tokens to
`),iu=s("code"),wx=a("-inf"),$x=a(" so that they are sampled at their corresponding index."),kx=c(),Jd=s("div"),g(Wa.$$.fragment),xb=c(),it=s("div"),g(Va.$$.fragment),xx=c(),cu=s("p"),Mx=a("Abstract base class for all logit processors that can be applied during generation."),Ex=c(),Is=s("div"),g(Za.$$.fragment),jx=c(),lu=s("p"),Fx=a("TF method for processing logits."),Mb=c(),ct=s("div"),g(Ga.$$.fragment),Lx=c(),ve=s("p"),zx=a("This class can be used to create a list of "),Id=s("a"),Jx=a("TFLogitsProcessor"),Ix=a(" to subsequently process a "),du=s("code"),Ux=a("scores"),Bx=a(` input tensor.
This class inherits from list and adds a specific `),pu=s("em"),mu=s("strong"),qx=a("call"),Dx=a(" method to apply each "),Ud=s("a"),Sx=a("TFLogitsProcessor"),Px=a(` to the
inputs.`),Wx=c(),Bd=s("div"),g(Ca.$$.fragment),Eb=c(),lt=s("div"),g(Na.$$.fragment),Vx=c(),hu=s("p"),Zx=a("Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),Gx=c(),Us=s("div"),g(Xa.$$.fragment),Cx=c(),gu=s("p"),Nx=a("TF method for warping logits."),jb=c(),dt=s("div"),g(Ra.$$.fragment),Xx=c(),qd=s("p"),Dd=s("a"),Rx=a("TFLogitsProcessor"),Ox=a(" enforcing a min-length by setting EOS probability to 0."),Ax=c(),Sd=s("div"),g(Oa.$$.fragment),Fb=c(),pt=s("div"),g(Aa.$$.fragment),Hx=c(),Pd=s("p"),Wd=s("a"),Qx=a("TFLogitsProcessor"),Yx=a(" that enforces that specified sequences will never be sampled."),Kx=c(),Vd=s("div"),g(Ha.$$.fragment),Lb=c(),mt=s("div"),g(Qa.$$.fragment),eM=c(),Bs=s("p"),Zd=s("a"),tM=a("TFLogitsProcessor"),oM=a(` that enforces no repetition of n-grams. See
`),Ya=s("a"),sM=a("Fairseq"),nM=a("."),rM=c(),Gd=s("div"),g(Ka.$$.fragment),zb=c(),ht=s("div"),g(ei.$$.fragment),aM=c(),Cd=s("p"),Nd=s("a"),iM=a("TFLogitsProcessor"),cM=a(" enforcing an exponential penalty on repeated sequences."),lM=c(),Xd=s("div"),g(ti.$$.fragment),Jb=c(),gt=s("div"),g(oi.$$.fragment),dM=c(),Le=s("p"),Rd=s("a"),pM=a("TFSuppressTokensAtBeginLogitsProcessor"),mM=a(" suppresses a list of tokens as soon as the "),uu=s("code"),hM=a("generate"),gM=a(` function starts
generating using `),fu=s("code"),uM=a("begin_index"),fM=a(" tokens. This should ensure that the tokens defined by "),_u=s("code"),_M=a("begin_suppress_tokens"),bM=a(` at not
sampled at the begining of the generation.`),yM=c(),Od=s("div"),g(si.$$.fragment),Ib=c(),ut=s("div"),g(ni.$$.fragment),TM=c(),ri=s("p"),vM=a("This processor can be used to suppress a list of tokens. The processor will set their log probs to "),bu=s("code"),wM=a("-inf"),$M=a(` so that they
are not sampled.`),kM=c(),Ad=s("div"),g(ai.$$.fragment),Ub=c(),ft=s("div"),g(ii.$$.fragment),xM=c(),Hd=s("p"),Qd=s("a"),MM=a("TFLogitsWarper"),EM=a(" for temperature (exponential scaling output probability distribution)."),jM=c(),Yd=s("div"),g(ci.$$.fragment),Bb=c(),_t=s("div"),g(li.$$.fragment),FM=c(),Kd=s("p"),ep=s("a"),LM=a("TFLogitsWarper"),zM=a(" that performs top-k, i.e. restricting to the k highest probability elements."),JM=c(),tp=s("div"),g(di.$$.fragment),qb=c(),bt=s("div"),g(pi.$$.fragment),IM=c(),op=s("p"),sp=s("a"),UM=a("TFLogitsWarper"),BM=a(" that performs top-p, i.e. restricting to top tokens summing to <= prob_cut_off."),qM=c(),np=s("div"),g(mi.$$.fragment),Db=c(),Bo=s("h3"),qs=s("a"),yu=s("span"),g(hi.$$.fragment),DM=c(),Tu=s("span"),SM=a("FLAX"),Sb=c(),yt=s("div"),g(gi.$$.fragment),PM=c(),rp=s("p"),ap=s("a"),WM=a("FlaxLogitsProcessor"),VM=a(" that enforces the specified token as the first generated token."),ZM=c(),ip=s("div"),g(ui.$$.fragment),Pb=c(),Tt=s("div"),g(fi.$$.fragment),GM=c(),Ds=s("p"),cp=s("a"),CM=a("FlaxLogitsProcessor"),NM=a(" that enforces the specified token as the last generated token when "),vu=s("code"),XM=a("max_length"),RM=a(" is reached."),OM=c(),lp=s("div"),g(_i.$$.fragment),Wb=c(),vt=s("div"),g(bi.$$.fragment),AM=c(),Ss=s("p"),dp=s("a"),HM=a("FlaxLogitsProcessor"),QM=a(` that takes a list of pairs of integers which indicates a mapping from generation indices to
token indices that will be forced before sampling. The processor will set their log probs to 0 and all other tokens
to `),wu=s("code"),YM=a("-inf"),KM=a(" so that they are sampled at their corresponding index."),e4=c(),pp=s("div"),g(yi.$$.fragment),Vb=c(),wt=s("div"),g(Ti.$$.fragment),t4=c(),$u=s("p"),o4=a("Abstract base class for all logit processors that can be applied during generation."),s4=c(),Ps=s("div"),g(vi.$$.fragment),n4=c(),ku=s("p"),r4=a("Flax method for processing logits."),Zb=c(),$t=s("div"),g(wi.$$.fragment),a4=c(),C=s("p"),i4=a("This class can be used to create a list of "),mp=s("a"),c4=a("FlaxLogitsProcessor"),l4=a(" or "),hp=s("a"),d4=a("FlaxLogitsWarper"),p4=a(` to subsequently process
a `),xu=s("code"),m4=a("scores"),h4=a(" input tensor. This class inherits from list and adds a specific "),Mu=s("em"),Eu=s("strong"),g4=a("call"),u4=a(` method to apply each
`),gp=s("a"),f4=a("FlaxLogitsProcessor"),_4=a(" or "),up=s("a"),b4=a("FlaxLogitsWarper"),y4=a(" to the inputs."),T4=c(),fp=s("div"),g($i.$$.fragment),Gb=c(),kt=s("div"),g(ki.$$.fragment),v4=c(),ju=s("p"),w4=a("Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),$4=c(),Ws=s("div"),g(xi.$$.fragment),k4=c(),Fu=s("p"),x4=a("Flax method for warping logits."),Cb=c(),xt=s("div"),g(Mi.$$.fragment),M4=c(),_p=s("p"),bp=s("a"),E4=a("FlaxLogitsProcessor"),j4=a(" enforcing a min-length by setting EOS probability to 0."),F4=c(),yp=s("div"),g(Ei.$$.fragment),Nb=c(),Mt=s("div"),g(ji.$$.fragment),L4=c(),ze=s("p"),Tp=s("a"),z4=a("FlaxLogitsProcessor"),J4=a(" supressing a list of tokens as soon as the "),Lu=s("code"),I4=a("generate"),U4=a(` function starts generating using
`),zu=s("code"),B4=a("begin_index"),q4=a(" tokens. This should ensure that the tokens defined by "),Ju=s("code"),D4=a("begin_suppress_tokens"),S4=a(` are not sampled at the
begining of the generation.`),P4=c(),vp=s("div"),g(Fi.$$.fragment),Xb=c(),Et=s("div"),g(Li.$$.fragment),W4=c(),Vs=s("p"),wp=s("a"),V4=a("FlaxLogitsProcessor"),Z4=a(` suppressing a list of tokens at each decoding step. The processor will set their log probs
to be `),Iu=s("code"),G4=a("-inf"),C4=a(" so they are not sampled."),N4=c(),$p=s("div"),g(zi.$$.fragment),Rb=c(),jt=s("div"),g(Ji.$$.fragment),X4=c(),kp=s("p"),xp=s("a"),R4=a("FlaxLogitsWarper"),O4=a(" for temperature (exponential scaling output probability distribution)."),A4=c(),Mp=s("div"),g(Ii.$$.fragment),Ob=c(),Ft=s("div"),g(Ui.$$.fragment),H4=c(),Ep=s("p"),jp=s("a"),Q4=a("FlaxLogitsWarper"),Y4=a(" that performs top-k, i.e. restricting to the k highest probability elements."),K4=c(),Fp=s("div"),g(Bi.$$.fragment),Ab=c(),Lt=s("div"),g(qi.$$.fragment),eE=c(),Lp=s("p"),zp=s("a"),tE=a("FlaxLogitsWarper"),oE=a(" that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),sE=c(),Jp=s("div"),g(Di.$$.fragment),Hb=c(),zt=s("div"),g(Si.$$.fragment),nE=c(),Pi=s("p"),rE=a(`Whisper specific Processor. This processor can be used to force a list of tokens. The processor will set their log
probs to `),Uu=s("code"),aE=a("inf"),iE=a(" so that they are sampled at their corresponding index."),cE=c(),Ip=s("div"),g(Wi.$$.fragment),Qb=c(),qo=s("h2"),Zs=s("a"),Bu=s("span"),g(Vi.$$.fragment),lE=c(),qu=s("span"),dE=a("StoppingCriteria"),Yb=c(),Gs=s("p"),pE=a("A "),Up=s("a"),mE=a("StoppingCriteria"),hE=a(" can be used to change when to stop generation (other than EOS token). Please note that this is exclusivelly available to our PyTorch implementations."),Kb=c(),Jt=s("div"),g(Zi.$$.fragment),gE=c(),Du=s("p"),uE=a("Abstract base class for all stopping criteria that can be applied during generation."),fE=c(),Bp=s("div"),g(Gi.$$.fragment),ey=c(),Do=s("div"),g(Ci.$$.fragment),_E=c(),qp=s("div"),g(Ni.$$.fragment),ty=c(),It=s("div"),g(Xi.$$.fragment),bE=c(),Ri=s("p"),yE=a("This class can be used to stop generation whenever the full generated number of tokens exceeds "),Su=s("code"),TE=a("max_length"),vE=a(`. Keep
in mind for decoder-only type of transformers, this will include the initial prompted tokens.`),wE=c(),Dp=s("div"),g(Oi.$$.fragment),oy=c(),Ut=s("div"),g(Ai.$$.fragment),$E=c(),Hi=s("p"),kE=a(`This class can be used to stop generation whenever the full generation exceeds some amount of time. By default, the
time will start being counted when you initialize this function. You can override this by passing an
`),Pu=s("code"),xE=a("initial_time"),ME=a("."),EE=c(),Sp=s("div"),g(Qi.$$.fragment),sy=c(),So=s("h2"),Cs=s("a"),Wu=s("span"),g(Yi.$$.fragment),jE=c(),Vu=s("span"),FE=a("Constraints"),ny=c(),Ns=s("p"),LE=a("A "),Pp=s("a"),zE=a("Constraint"),JE=a(" can be used to force the generation to include specific tokens or sequences in the output. Please note that this is exclusivelly available to our PyTorch implementations."),ry=c(),z=s("div"),g(Ki.$$.fragment),IE=c(),Zu=s("p"),UE=a(`Abstract base class for all constraints that can be applied during generation.
It must define how the constraint can be satisfied.`),BE=c(),Gu=s("p"),qE=a("All classes that inherit Constraint must follow the requirement that"),DE=c(),g(Xs.$$.fragment),SE=c(),Cu=s("p"),PE=a("will always terminate (halt)."),WE=c(),Rs=s("div"),g(ec.$$.fragment),VE=c(),Nu=s("p"),ZE=a("When called, returns the token that would take this constraint one step closer to being fulfilled."),GE=c(),Os=s("div"),g(tc.$$.fragment),CE=c(),Xu=s("p"),NE=a("Creates a new instance of this constraint."),XE=c(),As=s("div"),g(oc.$$.fragment),RE=c(),Ru=s("p"),OE=a("Reads in a token and returns whether it creates progress."),AE=c(),Hs=s("div"),g(sc.$$.fragment),HE=c(),nc=s("p"),QE=a("Returns the number of remaining steps of "),Ou=s("code"),YE=a("advance()"),KE=a(" in order to complete this constraint."),ej=c(),Qs=s("div"),g(rc.$$.fragment),tj=c(),Au=s("p"),oj=a(`Resets the state of this constraint to its initialization. We would call this in cases where the fulfillment of
a constraint is abrupted by an unwanted token.`),sj=c(),Ys=s("div"),g(ac.$$.fragment),nj=c(),Hu=s("p"),rj=a("Tests whether this constraint has been properly defined."),aj=c(),Zt=s("div"),g(ic.$$.fragment),ij=c(),cc=s("p"),cj=a(`Reads in a token and returns booleans that indicate the progress made by it. This function will update the
state of this object unlikes `),Qu=s("code"),lj=a("does_advance(self, token_id: int)"),dj=a("."),pj=c(),Yu=s("p"),mj=a(`This isn\u2019t to test whether a certain token will advance the progress; it\u2019s to update its state as if it has
been generated. This becomes important if token_id != desired token (refer to else statement in
PhrasalConstraint)`),ay=c(),Po=s("div"),g(lc.$$.fragment),hj=c(),Wp=s("p"),Vp=s("a"),gj=a("Constraint"),uj=a(" enforcing that an ordered sequence of tokens is included in the output."),iy=c(),Wo=s("div"),g(dc.$$.fragment),fj=c(),pc=s("p"),_j=a("A special "),Zp=s("a"),bj=a("Constraint"),yj=a(" that is fulfilled by fulfilling just one of several constraints."),cy=c(),we=s("div"),g(mc.$$.fragment),Tj=c(),Ku=s("p"),vj=a("A class for beam scorers to track its progress through a list of constraints."),wj=c(),R=s("div"),g(hc.$$.fragment),$j=c(),ef=s("p"),kj=a(`The list of tokens to generate such that we can make progress.
By \u201Clist\u201D we don\u2019t mean the list of token that will fully fulfill a constraint.`),xj=c(),Vo=s("p"),Mj=a("Given constraints "),tf=s("code"),Ej=a("c_i = {t_ij | j == # of tokens}"),jj=a(`, If we\u2019re not in the middle of progressing through a
specific constraint `),of=s("code"),Fj=a("c_i"),Lj=a(", we return:"),zj=c(),sf=s("p"),nf=s("code"),Jj=a("[t_k1 for k in indices of unfulfilled constraints]"),Ij=c(),Bt=s("p"),Uj=a(`If we are in the middle of a constraint, then we return:
`),rf=s("code"),Bj=a("[t_ij]"),qj=a(", where "),af=s("code"),Dj=a("i"),Sj=a(" is the index of the inprogress constraint, "),cf=s("code"),Pj=a("j"),Wj=a(" is the next step for the constraint."),Vj=c(),lf=s("p"),Zj=a(`Though we don\u2019t care which constraint is fulfilled first, if we are in the progress of fulfilling a constraint,
that\u2019s the only one we\u2019ll return.`),Gj=c(),Ks=s("div"),g(gc.$$.fragment),Cj=c(),df=s("p"),Nj=a("token_ids: the tokens generated thus far to reset the state of the progress through constraints."),ly=c(),Zo=s("h2"),en=s("a"),pf=s("span"),g(uc.$$.fragment),Xj=c(),mf=s("span"),Rj=a("BeamSearch"),dy=c(),$e=s("div"),g(fc.$$.fragment),Oj=c(),Go=s("p"),Aj=a("Abstract base class for all beam scorers that are used for "),Gp=s("a"),Hj=a("beam_search()"),Qj=a(` and
`),Cp=s("a"),Yj=a("beam_sample()"),Kj=a("."),eF=c(),Np=s("div"),g(_c.$$.fragment),tF=c(),Xp=s("div"),g(bc.$$.fragment),py=c(),N=s("div"),g(yc.$$.fragment),oF=c(),Rp=s("p"),Op=s("a"),sF=a("BeamScorer"),nF=a(" implementing standard beam search decoding."),rF=c(),Tc=s("p"),aF=a("Adapted in part from "),vc=s("a"),iF=a(`Facebook\u2019s XLM beam search
code`),cF=a("."),lF=c(),Ap=s("p"),dF=a("Reference for the diverse beam search algorithm and implementation "),wc=s("a"),pF=a(`Ashwin Kalyan\u2019s DBS
implementation`),mF=c(),Hp=s("div"),g($c.$$.fragment),hF=c(),Qp=s("div"),g(kc.$$.fragment),my=c(),ke=s("div"),g(xc.$$.fragment),gF=c(),Yp=s("p"),Kp=s("a"),uF=a("BeamScorer"),fF=a(" implementing constrained beam search decoding."),_F=c(),em=s("div"),g(Mc.$$.fragment),bF=c(),tm=s("div"),g(Ec.$$.fragment),hy=c(),Co=s("h2"),tn=s("a"),hf=s("span"),g(jc.$$.fragment),yF=c(),gf=s("span"),TF=a("Utilities"),gy=c(),qt=s("div"),g(Fc.$$.fragment),vF=c(),uf=s("p"),wF=a("Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),$F=c(),om=s("p"),kF=a("From: "),Lc=s("a"),xF=a("https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),uy=c(),Dt=s("div"),g(zc.$$.fragment),MF=c(),ff=s("p"),EF=a("Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),jF=c(),sm=s("p"),FF=a("From: "),Jc=s("a"),LF=a("https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),fy=c(),No=s("h2"),on=s("a"),_f=s("span"),g(Ic.$$.fragment),zF=c(),bf=s("span"),JF=a("Streamers"),_y=c(),P=s("div"),g(Uc.$$.fragment),IF=c(),yf=s("p"),UF=a("Simple text streamer that prints the token(s) to stdout as soon as entire words are formed."),BF=c(),g(sn.$$.fragment),qF=c(),g(nn.$$.fragment),DF=c(),rn=s("div"),g(Bc.$$.fragment),SF=c(),Tf=s("p"),PF=a("Flushes any remaining cache and prints a newline to stdout."),WF=c(),an=s("div"),g(qc.$$.fragment),VF=c(),vf=s("p"),ZF=a("Prints the new text to stdout. If the stream is ending, also prints a newline."),GF=c(),cn=s("div"),g(Dc.$$.fragment),CF=c(),wf=s("p"),NF=a("Receives tokens, decodes them, and prints them to stdout as soon as they form entire words."),by=c(),te=s("div"),g(Sc.$$.fragment),XF=c(),$f=s("p"),RF=a(`Streamer that stores print-ready text in a queue, to be used by a downstream application as an iterator. This is
useful for applications that benefit from acessing the generated text in a non-blocking way (e.g. in an interactive
Gradio demo).`),OF=c(),g(ln.$$.fragment),AF=c(),g(dn.$$.fragment),HF=c(),pn=s("div"),g(Pc.$$.fragment),QF=c(),kf=s("p"),YF=a("Put the new text in the queue. If the stream is ending, also put a stop signal in the queue."),this.h()},l(t){const p=XU('[data-svelte="svelte-1phssyn"]',document.head);T=n(p,"META",{name:!0,content:!0}),p.forEach(o),x=l(t),$=n(t,"H1",{class:!0});var Wc=r($);w=n(Wc,"A",{id:!0,class:!0,href:!0});var xf=r(w);M=n(xf,"SPAN",{});var Mf=r(M);u(h.$$.fragment,Mf),Mf.forEach(o),xf.forEach(o),k=l(Wc),Z=n(Wc,"SPAN",{});var Ef=r(Z);U=i(Ef,"Utilities for Generation"),Ef.forEach(o),Wc.forEach(o),B=l(t),F=n(t,"P",{});var q=r(F);W=i(q,"This page lists all the utility functions used by "),oe=n(q,"A",{href:!0});var jf=r(oe);Ue=i(jf,"generate()"),jf.forEach(o),S=i(q,`,
`),se=n(q,"A",{href:!0});var Ff=r(se);Be=i(Ff,"greedy_search()"),Ff.forEach(o),A=i(q,`,
`),j=n(q,"A",{href:!0});var Lf=r(j);Kt=i(Lf,"contrastive_search()"),Lf.forEach(o),eo=i(q,`,
`),xe=n(q,"A",{href:!0});var zf=r(xe);to=i(zf,"sample()"),zf.forEach(o),oo=i(q,`,
`),Cc=n(q,"A",{href:!0});var Jf=r(Cc);WT=i(Jf,"beam_search()"),Jf.forEach(o),VT=i(q,`,
`),Nc=n(q,"A",{href:!0});var If=r(Nc);ZT=i(If,"beam_sample()"),If.forEach(o),GT=i(q,`,
`),Xc=n(q,"A",{href:!0});var Uf=r(Xc);CT=i(Uf,"group_beam_search()"),Uf.forEach(o),NT=i(q,`, and
`),Rc=n(q,"A",{href:!0});var Bf=r(Rc);XT=i(Bf,"constrained_beam_search()"),Bf.forEach(o),RT=i(q,"."),q.forEach(o),t_=l(t),Oc=n(t,"P",{});var qf=r(Oc);OT=i(qf,"Most of those are only useful if you are studying the code of the generate methods in the library."),qf.forEach(o),o_=l(t),so=n(t,"H2",{class:!0});var Vc=r(so);Ho=n(Vc,"A",{id:!0,class:!0,href:!0});var Df=r(Ho);mh=n(Df,"SPAN",{});var Sf=r(mh);u(Mn.$$.fragment,Sf),Sf.forEach(o),Df.forEach(o),AT=l(Vc),hh=n(Vc,"SPAN",{});var Pf=r(hh);HT=i(Pf,"Generate Outputs"),Pf.forEach(o),Vc.forEach(o),s_=l(t),Me=n(t,"P",{});var St=r(Me);QT=i(St,"The output of "),Ac=n(St,"A",{href:!0});var Wf=r(Ac);YT=i(Wf,"generate()"),Wf.forEach(o),KT=i(St,` is an instance of a subclass of
`),Hc=n(St,"A",{href:!0});var Vf=r(Hc);ev=i(Vf,"ModelOutput"),Vf.forEach(o),tv=i(St,`. This output is a data structure containing all the information returned
by `),Qc=n(St,"A",{href:!0});var Zf=r(Qc);ov=i(Zf,"generate()"),Zf.forEach(o),sv=i(St,", but that can also be used as tuple or dictionary."),St.forEach(o),n_=l(t),Yc=n(t,"P",{});var qL=r(Yc);nv=i(qL,"Here\u2019s an example:"),qL.forEach(o),r_=l(t),u(En.$$.fragment,t),a_=l(t),Pt=n(t,"P",{});var nm=r(Pt);rv=i(nm,"The "),gh=n(nm,"CODE",{});var DL=r(gh);av=i(DL,"generation_output"),DL.forEach(o),iv=i(nm," object is a "),Kc=n(nm,"A",{href:!0});var SL=r(Kc);cv=i(SL,"GreedySearchDecoderOnlyOutput"),SL.forEach(o),lv=i(nm,`, as we can
see in the documentation of that class below, it means it has the following attributes:`),nm.forEach(o),i_=l(t),Ee=n(t,"UL",{});var mn=r(Ee);el=n(mn,"LI",{});var KF=r(el);uh=n(KF,"CODE",{});var PL=r(uh);dv=i(PL,"sequences"),PL.forEach(o),pv=i(KF,": the generated sequences of tokens"),KF.forEach(o),mv=l(mn),tl=n(mn,"LI",{});var eL=r(tl);fh=n(eL,"CODE",{});var WL=r(fh);hv=i(WL,"scores"),WL.forEach(o),gv=i(eL," (optional): the prediction scores of the language modelling head, for each generation step"),eL.forEach(o),uv=l(mn),ol=n(mn,"LI",{});var tL=r(ol);_h=n(tL,"CODE",{});var VL=r(_h);fv=i(VL,"hidden_states"),VL.forEach(o),_v=i(tL," (optional): the hidden states of the model, for each generation step"),tL.forEach(o),bv=l(mn),sl=n(mn,"LI",{});var oL=r(sl);bh=n(oL,"CODE",{});var ZL=r(bh);yv=i(ZL,"attentions"),ZL.forEach(o),Tv=i(oL," (optional): the attention weights of the model, for each generation step"),oL.forEach(o),mn.forEach(o),c_=l(t),V=n(t,"P",{});var ie=r(V);vv=i(ie,"Here we have the "),yh=n(ie,"CODE",{});var GL=r(yh);wv=i(GL,"scores"),GL.forEach(o),$v=i(ie," since we passed along "),Th=n(ie,"CODE",{});var CL=r(Th);kv=i(CL,"output_scores=True"),CL.forEach(o),xv=i(ie,", but we don\u2019t have "),vh=n(ie,"CODE",{});var NL=r(vh);Mv=i(NL,"hidden_states"),NL.forEach(o),Ev=i(ie,` and
`),wh=n(ie,"CODE",{});var XL=r(wh);jv=i(XL,"attentions"),XL.forEach(o),Fv=i(ie," because we didn\u2019t pass "),$h=n(ie,"CODE",{});var RL=r($h);Lv=i(RL,"output_hidden_states=True"),RL.forEach(o),zv=i(ie," or "),kh=n(ie,"CODE",{});var OL=r(kh);Jv=i(OL,"output_attentions=True"),OL.forEach(o),Iv=i(ie,"."),ie.forEach(o),l_=l(t),ne=n(t,"P",{});var Gt=r(ne);Uv=i(Gt,`You can access each attribute as you would usually do, and if that attribute has not been returned by the model, you
will get `),xh=n(Gt,"CODE",{});var AL=r(xh);Bv=i(AL,"None"),AL.forEach(o),qv=i(Gt,". Here for instance "),Mh=n(Gt,"CODE",{});var HL=r(Mh);Dv=i(HL,"generation_output.scores"),HL.forEach(o),Sv=i(Gt,` are all the generated prediction scores of the
language modeling head, and `),Eh=n(Gt,"CODE",{});var QL=r(Eh);Pv=i(QL,"generation_output.attentions"),QL.forEach(o),Wv=i(Gt," is "),jh=n(Gt,"CODE",{});var YL=r(jh);Vv=i(YL,"None"),YL.forEach(o),Zv=i(Gt,"."),Gt.forEach(o),d_=l(t),re=n(t,"P",{});var Ct=r(re);Gv=i(Ct,"When using our "),Fh=n(Ct,"CODE",{});var KL=r(Fh);Cv=i(KL,"generation_output"),KL.forEach(o),Nv=i(Ct," object as a tuple, it only keeps the attributes that don\u2019t have "),Lh=n(Ct,"CODE",{});var e3=r(Lh);Xv=i(e3,"None"),e3.forEach(o),Rv=i(Ct,` values.
Here, for instance, it has two elements, `),zh=n(Ct,"CODE",{});var t3=r(zh);Ov=i(t3,"loss"),t3.forEach(o),Av=i(Ct," then "),Jh=n(Ct,"CODE",{});var o3=r(Jh);Hv=i(o3,"logits"),o3.forEach(o),Qv=i(Ct,", so"),Ct.forEach(o),p_=l(t),u(jn.$$.fragment,t),m_=l(t),Qo=n(t,"P",{});var Ty=r(Qo);Yv=i(Ty,"will return the tuple "),Ih=n(Ty,"CODE",{});var s3=r(Ih);Kv=i(s3,"(generation_output.sequences, generation_output.scores)"),s3.forEach(o),e1=i(Ty," for instance."),Ty.forEach(o),h_=l(t),ae=n(t,"P",{});var Nt=r(ae);t1=i(Nt,"When using our "),Uh=n(Nt,"CODE",{});var n3=r(Uh);o1=i(n3,"generation_output"),n3.forEach(o),s1=i(Nt," object as a dictionary, it only keeps the attributes that don\u2019t have "),Bh=n(Nt,"CODE",{});var r3=r(Bh);n1=i(r3,"None"),r3.forEach(o),r1=i(Nt,`
values. Here, for instance, it has two keys that are `),qh=n(Nt,"CODE",{});var a3=r(qh);a1=i(a3,"sequences"),a3.forEach(o),i1=i(Nt," and "),Dh=n(Nt,"CODE",{});var i3=r(Dh);c1=i(i3,"scores"),i3.forEach(o),l1=i(Nt,"."),Nt.forEach(o),g_=l(t),nl=n(t,"P",{});var c3=r(nl);d1=i(c3,"We document here all output types."),c3.forEach(o),u_=l(t),no=n(t,"H3",{class:!0});var vy=r(no);Yo=n(vy,"A",{id:!0,class:!0,href:!0});var l3=r(Yo);Sh=n(l3,"SPAN",{});var d3=r(Sh);u(Fn.$$.fragment,d3),d3.forEach(o),l3.forEach(o),p1=l(vy),Ph=n(vy,"SPAN",{});var p3=r(Ph);m1=i(p3,"PyTorch"),p3.forEach(o),vy.forEach(o),f_=l(t),ro=n(t,"DIV",{class:!0});var wy=r(ro);u(Ln.$$.fragment,wy),h1=l(wy),Wh=n(wy,"P",{});var m3=r(Wh);g1=i(m3,`Base class for outputs of encoder-decoder generation models using greedy search. Hidden states and attention
weights of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the
encoder_hidden_states attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),m3.forEach(o),wy.forEach(o),__=l(t),ao=n(t,"DIV",{class:!0});var $y=r(ao);u(zn.$$.fragment,$y),u1=l($y),Vh=n($y,"P",{});var h3=r(Vh);f1=i(h3,"Base class for outputs of decoder-only generation models using greedy search."),h3.forEach(o),$y.forEach(o),b_=l(t),io=n(t,"DIV",{class:!0});var ky=r(io);u(Jn.$$.fragment,ky),_1=l(ky),Zh=n(ky,"P",{});var g3=r(Zh);b1=i(g3,`Base class for outputs of encoder-decoder generation models using sampling. Hidden states and attention weights of
the decoder (respectively the encoder) can be accessed via the encoder_attentions and the encoder_hidden_states
attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),g3.forEach(o),ky.forEach(o),y_=l(t),co=n(t,"DIV",{class:!0});var xy=r(co);u(In.$$.fragment,xy),y1=l(xy),Gh=n(xy,"P",{});var u3=r(Gh);T1=i(u3,"Base class for outputs of decoder-only generation models using sampling."),u3.forEach(o),xy.forEach(o),T_=l(t),lo=n(t,"DIV",{class:!0});var My=r(lo);u(Un.$$.fragment,My),v1=l(My),Ch=n(My,"P",{});var f3=r(Ch);w1=i(f3,`Base class for outputs of encoder-decoder generation models using beam search. Hidden states and attention weights
of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the encoder_hidden_states
attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),f3.forEach(o),My.forEach(o),v_=l(t),po=n(t,"DIV",{class:!0});var Ey=r(po);u(Bn.$$.fragment,Ey),$1=l(Ey),Nh=n(Ey,"P",{});var _3=r(Nh);k1=i(_3,"Base class for outputs of decoder-only generation models using beam search."),_3.forEach(o),Ey.forEach(o),w_=l(t),mo=n(t,"DIV",{class:!0});var jy=r(mo);u(qn.$$.fragment,jy),x1=l(jy),Xh=n(jy,"P",{});var b3=r(Xh);M1=i(b3,`Base class for outputs of encoder-decoder generation models using beam sampling. Hidden states and attention
weights of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the
encoder_hidden_states attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),b3.forEach(o),jy.forEach(o),$_=l(t),ho=n(t,"DIV",{class:!0});var Fy=r(ho);u(Dn.$$.fragment,Fy),E1=l(Fy),Rh=n(Fy,"P",{});var y3=r(Rh);j1=i(y3,"Base class for outputs of decoder-only generation models using beam sample."),y3.forEach(o),Fy.forEach(o),k_=l(t),go=n(t,"DIV",{class:!0});var Ly=r(go);u(Sn.$$.fragment,Ly),F1=l(Ly),Oh=n(Ly,"P",{});var T3=r(Oh);L1=i(T3,"Base class for outputs of decoder-only generation models using contrastive search."),T3.forEach(o),Ly.forEach(o),x_=l(t),uo=n(t,"DIV",{class:!0});var zy=r(uo);u(Pn.$$.fragment,zy),z1=l(zy),Ah=n(zy,"P",{});var v3=r(Ah);J1=i(v3,"Base class for outputs of decoder-only generation models using contrastive search."),v3.forEach(o),zy.forEach(o),M_=l(t),fo=n(t,"H3",{class:!0});var Jy=r(fo);Ko=n(Jy,"A",{id:!0,class:!0,href:!0});var w3=r(Ko);Hh=n(w3,"SPAN",{});var $3=r(Hh);u(Wn.$$.fragment,$3),$3.forEach(o),w3.forEach(o),I1=l(Jy),Qh=n(Jy,"SPAN",{});var k3=r(Qh);U1=i(k3,"TensorFlow"),k3.forEach(o),Jy.forEach(o),E_=l(t),_o=n(t,"DIV",{class:!0});var Iy=r(_o);u(Vn.$$.fragment,Iy),B1=l(Iy),Yh=n(Iy,"P",{});var x3=r(Yh);q1=i(x3,`Base class for outputs of encoder-decoder generation models using greedy search. Hidden states and attention
weights of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the
encoder_hidden_states attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),x3.forEach(o),Iy.forEach(o),j_=l(t),bo=n(t,"DIV",{class:!0});var Uy=r(bo);u(Zn.$$.fragment,Uy),D1=l(Uy),Kh=n(Uy,"P",{});var M3=r(Kh);S1=i(M3,"Base class for outputs of decoder-only generation models using greedy search."),M3.forEach(o),Uy.forEach(o),F_=l(t),yo=n(t,"DIV",{class:!0});var By=r(yo);u(Gn.$$.fragment,By),P1=l(By),eg=n(By,"P",{});var E3=r(eg);W1=i(E3,`Base class for outputs of encoder-decoder generation models using sampling. Hidden states and attention weights of
the decoder (respectively the encoder) can be accessed via the encoder_attentions and the encoder_hidden_states
attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),E3.forEach(o),By.forEach(o),L_=l(t),To=n(t,"DIV",{class:!0});var qy=r(To);u(Cn.$$.fragment,qy),V1=l(qy),tg=n(qy,"P",{});var j3=r(tg);Z1=i(j3,"Base class for outputs of decoder-only generation models using sampling."),j3.forEach(o),qy.forEach(o),z_=l(t),vo=n(t,"DIV",{class:!0});var Dy=r(vo);u(Nn.$$.fragment,Dy),G1=l(Dy),og=n(Dy,"P",{});var F3=r(og);C1=i(F3,`Base class for outputs of encoder-decoder generation models using beam search. Hidden states and attention weights
of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the encoder_hidden_states
attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),F3.forEach(o),Dy.forEach(o),J_=l(t),wo=n(t,"DIV",{class:!0});var Sy=r(wo);u(Xn.$$.fragment,Sy),N1=l(Sy),sg=n(Sy,"P",{});var L3=r(sg);X1=i(L3,"Base class for outputs of decoder-only generation models using beam search."),L3.forEach(o),Sy.forEach(o),I_=l(t),$o=n(t,"DIV",{class:!0});var Py=r($o);u(Rn.$$.fragment,Py),R1=l(Py),ng=n(Py,"P",{});var z3=r(ng);O1=i(z3,`Base class for outputs of encoder-decoder generation models using beam sampling. Hidden states and attention
weights of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the
encoder_hidden_states attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),z3.forEach(o),Py.forEach(o),U_=l(t),ko=n(t,"DIV",{class:!0});var Wy=r(ko);u(On.$$.fragment,Wy),A1=l(Wy),rg=n(Wy,"P",{});var J3=r(rg);H1=i(J3,"Base class for outputs of decoder-only generation models using beam sample."),J3.forEach(o),Wy.forEach(o),B_=l(t),xo=n(t,"DIV",{class:!0});var Vy=r(xo);u(An.$$.fragment,Vy),Q1=l(Vy),ag=n(Vy,"P",{});var I3=r(ag);Y1=i(I3,`Base class for outputs of encoder-decoder generation models using contrastive search. Hidden states and attention
weights of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the
encoder_hidden_states attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),I3.forEach(o),Vy.forEach(o),q_=l(t),Mo=n(t,"DIV",{class:!0});var Zy=r(Mo);u(Hn.$$.fragment,Zy),K1=l(Zy),ig=n(Zy,"P",{});var U3=r(ig);e2=i(U3,"Base class for outputs of decoder-only generation models using contrastive search."),U3.forEach(o),Zy.forEach(o),D_=l(t),Eo=n(t,"H3",{class:!0});var Gy=r(Eo);es=n(Gy,"A",{id:!0,class:!0,href:!0});var B3=r(es);cg=n(B3,"SPAN",{});var q3=r(cg);u(Qn.$$.fragment,q3),q3.forEach(o),B3.forEach(o),t2=l(Gy),lg=n(Gy,"SPAN",{});var D3=r(lg);o2=i(D3,"FLAX"),D3.forEach(o),Gy.forEach(o),S_=l(t),qe=n(t,"DIV",{class:!0});var rm=r(qe);u(Yn.$$.fragment,rm),s2=l(rm),dg=n(rm,"P",{});var S3=r(dg);n2=i(S3,"Flax Base class for outputs of decoder-only generation models using sampling."),S3.forEach(o),r2=l(rm),ts=n(rm,"DIV",{class:!0});var Cy=r(ts);u(Kn.$$.fragment,Cy),a2=l(Cy),pg=n(Cy,"P",{});var P3=r(pg);i2=i(P3,"\u201CReturns a new object replacing the specified fields with new values."),P3.forEach(o),Cy.forEach(o),rm.forEach(o),P_=l(t),De=n(t,"DIV",{class:!0});var am=r(De);u(er.$$.fragment,am),c2=l(am),mg=n(am,"P",{});var W3=r(mg);l2=i(W3,"Flax Base class for outputs of decoder-only generation models using greedy search."),W3.forEach(o),d2=l(am),os=n(am,"DIV",{class:!0});var Ny=r(os);u(tr.$$.fragment,Ny),p2=l(Ny),hg=n(Ny,"P",{});var V3=r(hg);m2=i(V3,"\u201CReturns a new object replacing the specified fields with new values."),V3.forEach(o),Ny.forEach(o),am.forEach(o),W_=l(t),Se=n(t,"DIV",{class:!0});var im=r(Se);u(or.$$.fragment,im),h2=l(im),gg=n(im,"P",{});var Z3=r(gg);g2=i(Z3,"Flax Base class for outputs of decoder-only generation models using greedy search."),Z3.forEach(o),u2=l(im),ss=n(im,"DIV",{class:!0});var Xy=r(ss);u(sr.$$.fragment,Xy),f2=l(Xy),ug=n(Xy,"P",{});var G3=r(ug);_2=i(G3,"\u201CReturns a new object replacing the specified fields with new values."),G3.forEach(o),Xy.forEach(o),im.forEach(o),V_=l(t),jo=n(t,"H2",{class:!0});var Ry=r(jo);ns=n(Ry,"A",{id:!0,class:!0,href:!0});var C3=r(ns);fg=n(C3,"SPAN",{});var N3=r(fg);u(nr.$$.fragment,N3),N3.forEach(o),C3.forEach(o),b2=l(Ry),_g=n(Ry,"SPAN",{});var X3=r(_g);y2=i(X3,"LogitsProcessor"),X3.forEach(o),Ry.forEach(o),Z_=l(t),rs=n(t,"P",{});var Oy=r(rs);T2=i(Oy,"A "),rl=n(Oy,"A",{href:!0});var R3=r(rl);v2=i(R3,"LogitsProcessor"),R3.forEach(o),w2=i(Oy,` can be used to modify the prediction scores of a language model head for
generation.`),Oy.forEach(o),G_=l(t),Fo=n(t,"H3",{class:!0});var Ay=r(Fo);as=n(Ay,"A",{id:!0,class:!0,href:!0});var O3=r(as);bg=n(O3,"SPAN",{});var A3=r(bg);u(rr.$$.fragment,A3),A3.forEach(o),O3.forEach(o),$2=l(Ay),yg=n(Ay,"SPAN",{});var H3=r(yg);k2=i(H3,"PyTorch"),H3.forEach(o),Ay.forEach(o),C_=l(t),Pe=n(t,"DIV",{class:!0});var cm=r(Pe);u(ar.$$.fragment,cm),x2=l(cm),is=n(cm,"P",{});var Gf=r(is);al=n(Gf,"A",{href:!0});var Q3=r(al);M2=i(Q3,"LogitsProcessor"),Q3.forEach(o),E2=i(Gf," enforcing alternated generation between the two codebooks of "),Tg=n(Gf,"CODE",{});var Y3=r(Tg);j2=i(Y3,"Bark"),Y3.forEach(o),F2=i(Gf,"\u2019s fine submodel."),Gf.forEach(o),L2=l(cm),il=n(cm,"DIV",{class:!0});var K3=r(il);u(ir.$$.fragment,K3),K3.forEach(o),cm.forEach(o),N_=l(t),ge=n(t,"DIV",{class:!0});var hn=r(ge);u(cr.$$.fragment,hn),z2=l(hn),lr=n(hn,"P",{});var Hy=r(lr);J2=i(Hy,`Logits processor for classifier free guidance (CFG). The scores are split over the batch dimension,
where the first half correspond to the conditional logits (predicted from the input prompt) and the second half
correspond to the unconditional logits (predicted from an empty or \u2018null\u2019 prompt). The processor computes a
weighted average across the conditional and unconditional logits, parameterised by the `),vg=n(Hy,"CODE",{});var e5=r(vg);I2=i(e5,"guidance_scale"),e5.forEach(o),U2=i(Hy,"."),Hy.forEach(o),B2=l(hn),dr=n(hn,"P",{});var Qy=r(dr);q2=i(Qy,"See "),pr=n(Qy,"A",{href:!0,rel:!0});var t5=r(pr);D2=i(t5,"the paper"),t5.forEach(o),S2=i(Qy," for more information."),Qy.forEach(o),P2=l(hn),cl=n(hn,"DIV",{class:!0});var o5=r(cl);u(mr.$$.fragment,o5),o5.forEach(o),hn.forEach(o),X_=l(t),We=n(t,"DIV",{class:!0});var lm=r(We);u(hr.$$.fragment,lm),W2=l(lm),cs=n(lm,"P",{});var Cf=r(cs);ll=n(Cf,"A",{href:!0});var s5=r(ll);V2=i(s5,"LogitsProcessor"),s5.forEach(o),Z2=i(Cf,` that enforces no repetition of encoder input ids n-grams for the decoder ids. See
`),gr=n(Cf,"A",{href:!0,rel:!0});var n5=r(gr);G2=i(n5,"ParlAI"),n5.forEach(o),C2=i(Cf,"."),Cf.forEach(o),N2=l(lm),dl=n(lm,"DIV",{class:!0});var r5=r(dl);u(ur.$$.fragment,r5),r5.forEach(o),lm.forEach(o),R_=l(t),Ve=n(t,"DIV",{class:!0});var dm=r(Ve);u(fr.$$.fragment,dm),X2=l(dm),pl=n(dm,"P",{});var sL=r(pl);ml=n(sL,"A",{href:!0});var a5=r(ml);R2=i(a5,"LogitsProcessor"),a5.forEach(o),O2=i(sL," enforcing an exponential penalty on tokens that are not in the original input."),sL.forEach(o),A2=l(dm),hl=n(dm,"DIV",{class:!0});var i5=r(hl);u(_r.$$.fragment,i5),i5.forEach(o),dm.forEach(o),O_=l(t),ue=n(t,"DIV",{class:!0});var gn=r(ue);u(br.$$.fragment,gn),H2=l(gn),Wt=n(gn,"P",{});var Zc=r(Wt);gl=n(Zc,"A",{href:!0});var c5=r(gl);Q2=i(c5,"LogitsWarper"),c5.forEach(o),Y2=i(Zc," that performs epsilon-sampling, i.e. restricting to tokens with "),wg=n(Zc,"CODE",{});var l5=r(wg);K2=i(l5,"prob >= epsilon"),l5.forEach(o),ew=i(Zc,`. Takes the
largest min_tokens_to_keep tokens if no tokens satisfy this constraint. See `),yr=n(Zc,"A",{href:!0,rel:!0});var d5=r(yr);tw=i(d5,`Truncation Sampling as Language Model
Desmoothing`),d5.forEach(o),ow=i(Zc," for more information."),Zc.forEach(o),sw=l(gn),u(ls.$$.fragment,gn),nw=l(gn),ul=n(gn,"DIV",{class:!0});var p5=r(ul);u(Tr.$$.fragment,p5),p5.forEach(o),gn.forEach(o),A_=l(t),fe=n(t,"DIV",{class:!0});var un=r(fe);u(vr.$$.fragment,un),rw=l(un),D=n(un,"P",{});var X=r(D);fl=n(X,"A",{href:!0});var m5=r(fl);aw=i(m5,"LogitsWarper"),m5.forEach(o),iw=i(X,` that performs eta-sampling, a technique to filter out tokens with probabilities below a dynamic
cutoff value, `),$g=n(X,"CODE",{});var h5=r($g);cw=i(h5,"eta"),h5.forEach(o),lw=i(X,", which is calculated based on a combination of the hyperparameter "),kg=n(X,"CODE",{});var g5=r(kg);dw=i(g5,"epsilon"),g5.forEach(o),pw=i(X,` and the entropy of
the token probabilities, i.e. `),xg=n(X,"CODE",{});var u5=r(xg);mw=i(u5,"eta := min(epsilon, sqrt(epsilon * e^-entropy(probabilities)))"),u5.forEach(o),hw=i(X,`. Takes the largest
min_tokens_to_keep tokens if no tokens satisfy this constraint. It addresses the issue of poor quality in long
samples of text generated by neural language models leading to more coherent and fluent text. See `),wr=n(X,"A",{href:!0,rel:!0});var f5=r(wr);gw=i(f5,`Truncation
Sampling as Language Model Desmoothing`),f5.forEach(o),uw=i(X," for more information. Note: "),Mg=n(X,"CODE",{});var _5=r(Mg);fw=i(_5,"do_sample"),_5.forEach(o),_w=i(X,`
must be set to `),Eg=n(X,"CODE",{});var b5=r(Eg);bw=i(b5,"True"),b5.forEach(o),yw=i(X," for this "),jg=n(X,"CODE",{});var y5=r(jg);Tw=i(y5,"LogitsWarper"),y5.forEach(o),vw=i(X," to work."),X.forEach(o),ww=l(un),u(ds.$$.fragment,un),$w=l(un),_l=n(un,"DIV",{class:!0});var T5=r(_l);u($r.$$.fragment,T5),T5.forEach(o),un.forEach(o),H_=l(t),Ze=n(t,"DIV",{class:!0});var pm=r(Ze);u(kr.$$.fragment,pm),kw=l(pm),bl=n(pm,"P",{});var nL=r(bl);yl=n(nL,"A",{href:!0});var v5=r(yl);xw=i(v5,"LogitsProcessor"),v5.forEach(o),Mw=i(nL,` that exponentially increases the score of the eos_token_id after regulation_start has been
reached.`),nL.forEach(o),Ew=l(pm),Tl=n(pm,"DIV",{class:!0});var w5=r(Tl);u(xr.$$.fragment,w5),w5.forEach(o),pm.forEach(o),Q_=l(t),Ge=n(t,"DIV",{class:!0});var mm=r(Ge);u(Mr.$$.fragment,mm),jw=l(mm),vl=n(mm,"P",{});var rL=r(vl);wl=n(rL,"A",{href:!0});var $5=r(wl);Fw=i($5,"LogitsProcessor"),$5.forEach(o),Lw=i(rL," that enforces the specified token as the first generated token."),rL.forEach(o),zw=l(mm),$l=n(mm,"DIV",{class:!0});var k5=r($l);u(Er.$$.fragment,k5),k5.forEach(o),mm.forEach(o),Y_=l(t),Ce=n(t,"DIV",{class:!0});var hm=r(Ce);u(jr.$$.fragment,hm),Jw=l(hm),ps=n(hm,"P",{});var Nf=r(ps);kl=n(Nf,"A",{href:!0});var x5=r(kl);Iw=i(x5,"LogitsProcessor"),x5.forEach(o),Uw=i(Nf," that enforces the specified token as the last generated token when "),Fg=n(Nf,"CODE",{});var M5=r(Fg);Bw=i(M5,"max_length"),M5.forEach(o),qw=i(Nf," is reached."),Nf.forEach(o),Dw=l(hm),xl=n(hm,"DIV",{class:!0});var E5=r(xl);u(Fr.$$.fragment,E5),E5.forEach(o),hm.forEach(o),K_=l(t),Ne=n(t,"DIV",{class:!0});var gm=r(Ne);u(Lr.$$.fragment,gm),Sw=l(gm),zr=n(gm,"P",{});var Yy=r(zr);Pw=i(Yy,`This processor takes a list of pairs of integers which indicates a mapping from generation indices to token
indices that will be forced before sampling. The processor will set their log probs to `),Lg=n(Yy,"CODE",{});var j5=r(Lg);Ww=i(j5,"inf"),j5.forEach(o),Vw=i(Yy,` so that they are
sampled at their corresponding index.`),Yy.forEach(o),Zw=l(gm),Ml=n(gm,"DIV",{class:!0});var F5=r(Ml);u(Jr.$$.fragment,F5),F5.forEach(o),gm.forEach(o),eb=l(t),L=n(t,"DIV",{class:!0});var J=r(L);u(Ir.$$.fragment,J),Gw=l(J),El=n(J,"P",{});var aL=r(El);jl=n(aL,"A",{href:!0});var L5=r(jl);Cw=i(L5,"LogitsProcessor"),L5.forEach(o),Nw=i(aL," that enforces diverse beam search."),aL.forEach(o),Xw=l(J),Lo=n(J,"P",{});var um=r(Lo);Rw=i(um,"Note that this logits processor is only effective for "),Fl=n(um,"A",{href:!0});var z5=r(Fl);Ow=i(z5,"PreTrainedModel.group_beam_search()"),z5.forEach(o),Aw=i(um,". See "),Ur=n(um,"A",{href:!0,rel:!0});var J5=r(Ur);Hw=i(J5,`Diverse Beam
Search: Decoding Diverse Solutions from Neural Sequence Models`),J5.forEach(o),Qw=i(um,` for more
details.`),um.forEach(o),Yw=l(J),u(ms.$$.fragment,J),Kw=l(J),u(hs.$$.fragment,J),e$=l(J),Br=n(J,"P",{});var Ky=r(Br);t$=i(Ky,`Traditional beam search often generates very similar sequences across different beams.
`),zg=n(Ky,"CODE",{});var I5=r(zg);o$=i(I5,"HammingDiversityLogitsProcessor"),I5.forEach(o),s$=i(Ky,` addresses this by penalizing beams that generate tokens already chosen by other
beams in the same time step.`),Ky.forEach(o),n$=l(J),Jg=n(J,"P",{});var U5=r(Jg);r$=i(U5,"How It Works:"),U5.forEach(o),a$=l(J),zo=n(J,"UL",{});var fm=r(zo);Ll=n(fm,"LI",{});var iL=r(Ll);Ig=n(iL,"STRONG",{});var B5=r(Ig);i$=i(B5,"Grouping Beams"),B5.forEach(o),c$=i(iL,": Beams are divided into groups. Each group selects tokens independently of the others."),iL.forEach(o),l$=l(fm),zl=n(fm,"LI",{});var cL=r(zl);Ug=n(cL,"STRONG",{});var q5=r(Ug);d$=i(q5,"Penalizing Repeated Tokens"),q5.forEach(o),p$=i(cL,`: If a beam in a group selects a token already chosen by another group in the
same step, a penalty is applied to that token\u2019s score.`),cL.forEach(o),m$=l(fm),Jl=n(fm,"LI",{});var lL=r(Jl);Bg=n(lL,"STRONG",{});var D5=r(Bg);h$=i(D5,"Promoting Diversity"),D5.forEach(o),g$=i(lL,`: This penalty discourages beams within a group from selecting the same tokens as
beams in other groups.`),lL.forEach(o),fm.forEach(o),u$=l(J),qg=n(J,"P",{});var S5=r(qg);f$=i(S5,"Benefits:"),S5.forEach(o),_$=l(J),qr=n(J,"UL",{});var eT=r(qr);Il=n(eT,"LI",{});var dL=r(Il);Dg=n(dL,"STRONG",{});var P5=r(Dg);b$=i(P5,"Diverse Outputs"),P5.forEach(o),y$=i(dL,": Produces a variety of different sequences."),dL.forEach(o),T$=l(eT),Ul=n(eT,"LI",{});var pL=r(Ul);Sg=n(pL,"STRONG",{});var W5=r(Sg);v$=i(W5,"Exploration"),W5.forEach(o),w$=i(pL,": Allows the model to explore different paths."),pL.forEach(o),eT.forEach(o),$$=l(J),u(gs.$$.fragment,J),k$=l(J),Bl=n(J,"DIV",{class:!0});var V5=r(Bl);u(Dr.$$.fragment,V5),V5.forEach(o),J.forEach(o),tb=l(t),Xe=n(t,"DIV",{class:!0});var _m=r(Xe);u(Sr.$$.fragment,_m),x$=l(_m),Vt=n(_m,"P",{});var Gc=r(Vt);ql=n(Gc,"A",{href:!0});var Z5=r(ql);M$=i(Z5,"LogitsProcessor"),Z5.forEach(o),E$=i(Gc," that removes all "),Pg=n(Gc,"CODE",{});var G5=r(Pg);j$=i(G5,"nan"),G5.forEach(o),F$=i(Gc," and "),Wg=n(Gc,"CODE",{});var C5=r(Wg);L$=i(C5,"inf"),C5.forEach(o),z$=i(Gc,` values to avoid the generation method to fail. Note that using
the logits processor should only be used if necessary since it can slow down the generation method.`),Gc.forEach(o),J$=l(_m),Dl=n(_m,"DIV",{class:!0});var N5=r(Dl);u(Pr.$$.fragment,N5),N5.forEach(o),_m.forEach(o),ob=l(t),Re=n(t,"DIV",{class:!0});var bm=r(Re);u(Wr.$$.fragment,bm),I$=l(bm),us=n(bm,"P",{});var Xf=r(us);Sl=n(Xf,"A",{href:!0});var X5=r(Sl);U$=i(X5,"LogitsWarper"),X5.forEach(o),B$=i(Xf," and "),Pl=n(Xf,"A",{href:!0});var R5=r(Pl);q$=i(R5,"LogitsProcessor"),R5.forEach(o),D$=i(Xf,` for normalizing the scores using log-softmax. It\u2019s important to normalize
the scores during beam search, after applying the logits processors or warpers, since the search algorithm used in
this library doesn\u2019t do it (it only does it before, but they may need re-normalization) but it still supposes that
the scores are normalized when comparing the hypotheses.`),Xf.forEach(o),S$=l(bm),Wl=n(bm,"DIV",{class:!0});var O5=r(Wl);u(Vr.$$.fragment,O5),O5.forEach(o),bm.forEach(o),sb=l(t),Oe=n(t,"DIV",{class:!0});var ym=r(Oe);u(Zr.$$.fragment,ym),P$=l(ym),Vg=n(ym,"P",{});var A5=r(Vg);W$=i(A5,"Abstract base class for all logit processors that can be applied during generation."),A5.forEach(o),V$=l(ym),Vl=n(ym,"DIV",{class:!0});var H5=r(Vl);u(Gr.$$.fragment,H5),H5.forEach(o),ym.forEach(o),nb=l(t),Ae=n(t,"DIV",{class:!0});var Tm=r(Ae);u(Cr.$$.fragment,Tm),Z$=l(Tm),G=n(Tm,"P",{});var ce=r(G);G$=i(ce,"This class can be used to create a list of "),Zl=n(ce,"A",{href:!0});var Q5=r(Zl);C$=i(Q5,"LogitsProcessor"),Q5.forEach(o),N$=i(ce," or "),Gl=n(ce,"A",{href:!0});var Y5=r(Gl);X$=i(Y5,"LogitsWarper"),Y5.forEach(o),R$=i(ce,` to subsequently process a
`),Zg=n(ce,"CODE",{});var K5=r(Zg);O$=i(K5,"scores"),K5.forEach(o),A$=i(ce," input tensor. This class inherits from list and adds a specific "),Gg=n(ce,"EM",{});var ez=r(Gg);Cg=n(ez,"STRONG",{});var tz=r(Cg);H$=i(tz,"call"),tz.forEach(o),ez.forEach(o),Q$=i(ce,` method to apply each
`),Cl=n(ce,"A",{href:!0});var oz=r(Cl);Y$=i(oz,"LogitsProcessor"),oz.forEach(o),K$=i(ce," or "),Nl=n(ce,"A",{href:!0});var sz=r(Nl);ek=i(sz,"LogitsWarper"),sz.forEach(o),tk=i(ce," to the inputs."),ce.forEach(o),ok=l(Tm),Xl=n(Tm,"DIV",{class:!0});var nz=r(Xl);u(Nr.$$.fragment,nz),nz.forEach(o),Tm.forEach(o),rb=l(t),He=n(t,"DIV",{class:!0});var vm=r(He);u(Xr.$$.fragment,vm),sk=l(vm),Ng=n(vm,"P",{});var rz=r(Ng);nk=i(rz,"Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),rz.forEach(o),rk=l(vm),Rl=n(vm,"DIV",{class:!0});var az=r(Rl);u(Rr.$$.fragment,az),az.forEach(o),vm.forEach(o),ab=l(t),Qe=n(t,"DIV",{class:!0});var wm=r(Qe);u(Or.$$.fragment,wm),ak=l(wm),Ol=n(wm,"P",{});var mL=r(Ol);Al=n(mL,"A",{href:!0});var iz=r(Al);ik=i(iz,"LogitsProcessor"),iz.forEach(o),ck=i(mL," enforcing a min-length by setting EOS probability to 0."),mL.forEach(o),lk=l(wm),Hl=n(wm,"DIV",{class:!0});var cz=r(Hl);u(Ar.$$.fragment,cz),cz.forEach(o),wm.forEach(o),ib=l(t),_e=n(t,"DIV",{class:!0});var fn=r(_e);u(Hr.$$.fragment,fn),dk=l(fn),je=n(fn,"P",{});var Xo=r(je);Ql=n(Xo,"A",{href:!0});var lz=r(Ql);pk=i(lz,"LogitsProcessor"),lz.forEach(o),mk=i(Xo,` enforcing a min-length of new tokens by setting EOS (End-Of-Sequence) token probability to 0.
Note that for decoder-only models, such as Llama2, `),Xg=n(Xo,"CODE",{});var dz=r(Xg);hk=i(dz,"min_length"),dz.forEach(o),gk=i(Xo," will compute the length of "),Rg=n(Xo,"CODE",{});var pz=r(Rg);uk=i(pz,"prompt + newly generated tokens"),pz.forEach(o),fk=i(Xo," whereas for other models it will behave as "),Og=n(Xo,"CODE",{});var mz=r(Og);_k=i(mz,"min_new_tokens"),mz.forEach(o),bk=i(Xo,`, that is, taking only into account
the newly generated ones.`),Xo.forEach(o),yk=l(fn),u(fs.$$.fragment,fn),Tk=l(fn),Yl=n(fn,"DIV",{class:!0});var hz=r(Yl);u(Qr.$$.fragment,hz),hz.forEach(o),fn.forEach(o),cb=l(t),H=n(t,"DIV",{class:!0});var Xt=r(H);u(Yr.$$.fragment,Xt),vk=l(Xt),Kl=n(Xt,"P",{});var hL=r(Kl);ed=n(hL,"A",{href:!0});var gz=r(ed);wk=i(gz,"LogitsProcessor"),gz.forEach(o),$k=i(hL," that enforces that specified sequences will never be selected."),hL.forEach(o),kk=l(Xt),u(_s.$$.fragment,Xt),xk=l(Xt),u(bs.$$.fragment,Xt),Mk=l(Xt),td=n(Xt,"DIV",{class:!0});var uz=r(td);u(Kr.$$.fragment,uz),uz.forEach(o),Xt.forEach(o),lb=l(t),Q=n(t,"DIV",{class:!0});var Rt=r(Q);u(ea.$$.fragment,Rt),Ek=l(Rt),Jo=n(Rt,"P",{});var $m=r(Jo);jk=i($m,`N-grams are groups of \u201Cn\u201D consecutive words, characters, or tokens taken from a sequence of text. Given the
sentence: \u201CShe runs fast\u201D, the bi-grams (n=2) would be (\u201Cshe\u201D, \u201Cruns\u201D) and (\u201Cruns\u201D, \u201Cfast\u201D). In text generation,
avoiding repetitions of word sequences provides a more diverse output. This `),od=n($m,"A",{href:!0});var fz=r(od);Fk=i(fz,"LogitsProcessor"),fz.forEach(o),Lk=i($m,` enforces no
repetition of n-grams by setting the scores of banned tokens to negative infinity which eliminates those tokens
from consideration when further processing the scores.
`),ta=n($m,"A",{href:!0,rel:!0});var _z=r(ta);zk=i(_z,"Fairseq"),_z.forEach(o),Jk=i($m,"."),$m.forEach(o),Ik=l(Rt),u(ys.$$.fragment,Rt),Uk=l(Rt),u(Ts.$$.fragment,Rt),Bk=l(Rt),sd=n(Rt,"DIV",{class:!0});var bz=r(sd);u(oa.$$.fragment,bz),bz.forEach(o),Rt.forEach(o),db=l(t),Ye=n(t,"DIV",{class:!0});var km=r(Ye);u(sa.$$.fragment,km),qk=l(km),vs=n(km,"P",{});var Rf=r(vs);nd=n(Rf,"A",{href:!0});var yz=r(nd);Dk=i(yz,"LogitsProcessor"),yz.forEach(o),Sk=i(Rf,` that enforces constrained generation and is useful for prefix-conditioned constrained
generation. See `),na=n(Rf,"A",{href:!0,rel:!0});var Tz=r(na);Pk=i(Tz,"Autoregressive Entity Retrieval"),Tz.forEach(o),Wk=i(Rf," for more information."),Rf.forEach(o),Vk=l(km),rd=n(km,"DIV",{class:!0});var vz=r(rd);u(ra.$$.fragment,vz),vz.forEach(o),km.forEach(o),pb=l(t),be=n(t,"DIV",{class:!0});var _n=r(be);u(aa.$$.fragment,_n),Zk=l(_n),ws=n(_n,"P",{});var Of=r(ws);ad=n(Of,"A",{href:!0});var wz=r(ad);Gk=i(wz,"LogitsProcessor"),wz.forEach(o),Ck=i(Of,` that prevents the repetition of previous tokens through an exponential penalty. This technique
shares some similarities with coverage mechanisms and other aimed at reducing repetition. During the text
generation process, the probability distribution for the next token is determined using a formula that incorporates
token scores based on their occurrence in the generated sequence. Tokens with higher scores are less likely to be
selected. The formula can be seen in the original `),ia=n(Of,"A",{href:!0,rel:!0});var $z=r(ia);Nk=i($z,"paper"),$z.forEach(o),Xk=i(Of,`. According to the
paper a penalty of around 1.2 yields a good balance between truthful generation and lack of repetition.`),Of.forEach(o),Rk=l(_n),u($s.$$.fragment,_n),Ok=l(_n),id=n(_n,"DIV",{class:!0});var kz=r(id);u(ca.$$.fragment,kz),kz.forEach(o),_n.forEach(o),mb=l(t),Y=n(t,"DIV",{class:!0});var Ot=r(Y);u(la.$$.fragment,Ot),Ak=l(Ot),cd=n(Ot,"P",{});var gL=r(cd);ld=n(gL,"A",{href:!0});var xz=r(ld);Hk=i(xz,"LogitsProcessor"),xz.forEach(o),Qk=i(gL,` that applies an additive bias on sequences. The bias is applied to the last token of a sequence
when the next generated token can complete it. Consequently, to take the most of biasing sequences with more than
one token, consider using beam methods (to gracefully work around partially completed sequences that have a
negative bias) and applying the bias to their prefixes (to ensure the bias is applied earlier).`),gL.forEach(o),Yk=l(Ot),u(ks.$$.fragment,Ot),Kk=l(Ot),u(xs.$$.fragment,Ot),e0=l(Ot),dd=n(Ot,"DIV",{class:!0});var Mz=r(dd);u(da.$$.fragment,Mz),Mz.forEach(o),Ot.forEach(o),hb=l(t),Ke=n(t,"DIV",{class:!0});var xm=r(Ke);u(pa.$$.fragment,xm),t0=l(xm),Fe=n(xm,"P",{});var Ro=r(Fe);pd=n(Ro,"A",{href:!0});var Ez=r(pd);o0=i(Ez,"SuppressTokensAtBeginLogitsProcessor"),Ez.forEach(o),s0=i(Ro," supresses a list of tokens as soon as the "),Ag=n(Ro,"CODE",{});var jz=r(Ag);n0=i(jz,"generate"),jz.forEach(o),r0=i(Ro,` function starts
generating using `),Hg=n(Ro,"CODE",{});var Fz=r(Hg);a0=i(Fz,"begin_index"),Fz.forEach(o),i0=i(Ro," tokens. This should ensure that the tokens defined by "),Qg=n(Ro,"CODE",{});var Lz=r(Qg);c0=i(Lz,"begin_suppress_tokens"),Lz.forEach(o),l0=i(Ro,` at not
sampled at the begining of the generation.`),Ro.forEach(o),d0=l(xm),md=n(xm,"DIV",{class:!0});var zz=r(md);u(ma.$$.fragment,zz),zz.forEach(o),xm.forEach(o),gb=l(t),et=n(t,"DIV",{class:!0});var Mm=r(et);u(ha.$$.fragment,Mm),p0=l(Mm),ga=n(Mm,"P",{});var tT=r(ga);m0=i(tT,"This processor can be used to suppress a list of tokens. The processor will set their log probs to "),Yg=n(tT,"CODE",{});var Jz=r(Yg);h0=i(Jz,"-inf"),Jz.forEach(o),g0=i(tT,` so that they
are not sampled.`),tT.forEach(o),u0=l(Mm),hd=n(Mm,"DIV",{class:!0});var Iz=r(hd);u(ua.$$.fragment,Iz),Iz.forEach(o),Mm.forEach(o),ub=l(t),K=n(t,"DIV",{class:!0});var At=r(K);u(fa.$$.fragment,At),f0=l(At),gd=n(At,"P",{});var uL=r(gd);ud=n(uL,"A",{href:!0});var Uz=r(ud);_0=i(Uz,"LogitsWarper"),Uz.forEach(o),b0=i(uL,` for temperature (exponential scaling output probability distribution), which effectively means
that it can control the randomness of the predicted tokens.`),uL.forEach(o),y0=l(At),u(Ms.$$.fragment,At),T0=l(At),u(Es.$$.fragment,At),v0=l(At),fd=n(At,"DIV",{class:!0});var Bz=r(fd);u(_a.$$.fragment,Bz),Bz.forEach(o),At.forEach(o),fb=l(t),tt=n(t,"DIV",{class:!0});var Em=r(tt);u(ba.$$.fragment,Em),w0=l(Em),_d=n(Em,"P",{});var fL=r(_d);bd=n(fL,"A",{href:!0});var qz=r(bd);$0=i(qz,"LogitsWarper"),qz.forEach(o),k0=i(fL," that performs top-k, i.e. restricting to the k highest probability elements."),fL.forEach(o),x0=l(Em),yd=n(Em,"DIV",{class:!0});var Dz=r(yd);u(ya.$$.fragment,Dz),Dz.forEach(o),Em.forEach(o),_b=l(t),ye=n(t,"DIV",{class:!0});var bn=r(ye);u(Ta.$$.fragment,bn),M0=l(bn),Td=n(bn,"P",{});var _L=r(Td);vd=n(_L,"A",{href:!0});var Sz=r(vd);E0=i(Sz,"LogitsWarper"),Sz.forEach(o),j0=i(_L," that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),_L.forEach(o),F0=l(bn),u(js.$$.fragment,bn),L0=l(bn),wd=n(bn,"DIV",{class:!0});var Pz=r(wd);u(va.$$.fragment,Pz),Pz.forEach(o),bn.forEach(o),bb=l(t),ot=n(t,"DIV",{class:!0});var jm=r(ot);u(wa.$$.fragment,jm),z0=l(jm),Fs=n(jm,"P",{});var Af=r(Fs);$d=n(Af,"A",{href:!0});var Wz=r($d);J0=i(Wz,"LogitsWarper"),Wz.forEach(o),I0=i(Af," that performs typical decoding. See "),$a=n(Af,"A",{href:!0,rel:!0});var Vz=r($a);U0=i(Vz,`Typical Decoding for Natural Language
Generation`),Vz.forEach(o),B0=i(Af," for more information."),Af.forEach(o),q0=l(jm),kd=n(jm,"DIV",{class:!0});var Zz=r(kd);u(ka.$$.fragment,Zz),Zz.forEach(o),jm.forEach(o),yb=l(t),ee=n(t,"DIV",{class:!0});var Ht=r(ee);u(xa.$$.fragment,Ht),D0=l(Ht),st=n(Ht,"P",{});var yn=r(st);S0=i(yn,`Logits processor for Classifier-Free Guidance (CFG). The processors
computes a weighted average across scores from prompt conditional and prompt unconditional (or negative) logits,
parameterized by the `),Kg=n(yn,"CODE",{});var Gz=r(Kg);P0=i(Gz,"guidance_scale"),Gz.forEach(o),W0=i(yn,". The unconditional scores are computed internally by prompting "),eu=n(yn,"CODE",{});var Cz=r(eu);V0=i(Cz,"model"),Cz.forEach(o),Z0=i(yn,` with
the `),tu=n(yn,"CODE",{});var Nz=r(tu);G0=i(Nz,"unconditional_ids"),Nz.forEach(o),C0=i(yn," branch."),yn.forEach(o),N0=l(Ht),Ma=n(Ht,"P",{});var oT=r(Ma);X0=i(oT,"See "),Ea=n(oT,"A",{href:!0,rel:!0});var Xz=r(Ea);R0=i(Xz,"the paper"),Xz.forEach(o),O0=i(oT," for more information."),oT.forEach(o),A0=l(Ht),u(Ls.$$.fragment,Ht),H0=l(Ht),xd=n(Ht,"DIV",{class:!0});var Rz=r(xd);u(ja.$$.fragment,Rz),Rz.forEach(o),Ht.forEach(o),Tb=l(t),Te=n(t,"DIV",{class:!0});var Tn=r(Te);u(Fa.$$.fragment,Tn),Q0=l(Tn),La=n(Tn,"P",{});var sT=r(La);Y0=i(sT,`Whisper specific Processor. This processor can be used to force a list of tokens. The processor will set their log
probs to `),ou=n(sT,"CODE",{});var Oz=r(ou);K0=i(Oz,"inf"),Oz.forEach(o),ex=i(sT," so that they are sampled at their corresponding index."),sT.forEach(o),tx=l(Tn),za=n(Tn,"P",{});var nT=r(za);ox=i(nT,"See "),Ja=n(nT,"A",{href:!0,rel:!0});var Az=r(Ja);sx=i(Az,"the paper"),Az.forEach(o),nx=i(nT," for more information."),nT.forEach(o),rx=l(Tn),Md=n(Tn,"DIV",{class:!0});var Hz=r(Md);u(Ia.$$.fragment,Hz),Hz.forEach(o),Tn.forEach(o),vb=l(t),Io=n(t,"H3",{class:!0});var rT=r(Io);zs=n(rT,"A",{id:!0,class:!0,href:!0});var Qz=r(zs);su=n(Qz,"SPAN",{});var Yz=r(su);u(Ua.$$.fragment,Yz),Yz.forEach(o),Qz.forEach(o),ax=l(rT),nu=n(rT,"SPAN",{});var Kz=r(nu);ix=i(Kz,"TensorFlow"),Kz.forEach(o),rT.forEach(o),wb=l(t),nt=n(t,"DIV",{class:!0});var Fm=r(nt);u(Ba.$$.fragment,Fm),cx=l(Fm),Ed=n(Fm,"P",{});var bL=r(Ed);jd=n(bL,"A",{href:!0});var eJ=r(jd);lx=i(eJ,"TFLogitsProcessor"),eJ.forEach(o),dx=i(bL," that enforces the specified token as the first generated token."),bL.forEach(o),px=l(Fm),Fd=n(Fm,"DIV",{class:!0});var tJ=r(Fd);u(qa.$$.fragment,tJ),tJ.forEach(o),Fm.forEach(o),$b=l(t),rt=n(t,"DIV",{class:!0});var Lm=r(rt);u(Da.$$.fragment,Lm),mx=l(Lm),Js=n(Lm,"P",{});var Hf=r(Js);Ld=n(Hf,"A",{href:!0});var oJ=r(Ld);hx=i(oJ,"TFLogitsProcessor"),oJ.forEach(o),gx=i(Hf," that enforces the specified token as the last generated token when "),ru=n(Hf,"CODE",{});var sJ=r(ru);ux=i(sJ,"max_length"),sJ.forEach(o),fx=i(Hf," is reached."),Hf.forEach(o),_x=l(Lm),zd=n(Lm,"DIV",{class:!0});var nJ=r(zd);u(Sa.$$.fragment,nJ),nJ.forEach(o),Lm.forEach(o),kb=l(t),at=n(t,"DIV",{class:!0});var zm=r(at);u(Pa.$$.fragment,zm),bx=l(zm),Uo=n(zm,"P",{});var Jm=r(Uo);yx=i(Jm,`This processor takes a list of pairs of integers which indicates a mapping from generation indices to token
indices that will be forced before sampling. The processor will set their log probs to `),au=n(Jm,"CODE",{});var rJ=r(au);Tx=i(rJ,"0"),rJ.forEach(o),vx=i(Jm,` and all other tokens to
`),iu=n(Jm,"CODE",{});var aJ=r(iu);wx=i(aJ,"-inf"),aJ.forEach(o),$x=i(Jm," so that they are sampled at their corresponding index."),Jm.forEach(o),kx=l(zm),Jd=n(zm,"DIV",{class:!0});var iJ=r(Jd);u(Wa.$$.fragment,iJ),iJ.forEach(o),zm.forEach(o),xb=l(t),it=n(t,"DIV",{class:!0});var Im=r(it);u(Va.$$.fragment,Im),xx=l(Im),cu=n(Im,"P",{});var cJ=r(cu);Mx=i(cJ,"Abstract base class for all logit processors that can be applied during generation."),cJ.forEach(o),Ex=l(Im),Is=n(Im,"DIV",{class:!0});var aT=r(Is);u(Za.$$.fragment,aT),jx=l(aT),lu=n(aT,"P",{});var lJ=r(lu);Fx=i(lJ,"TF method for processing logits."),lJ.forEach(o),aT.forEach(o),Im.forEach(o),Mb=l(t),ct=n(t,"DIV",{class:!0});var Um=r(ct);u(Ga.$$.fragment,Um),Lx=l(Um),ve=n(Um,"P",{});var Qt=r(ve);zx=i(Qt,"This class can be used to create a list of "),Id=n(Qt,"A",{href:!0});var dJ=r(Id);Jx=i(dJ,"TFLogitsProcessor"),dJ.forEach(o),Ix=i(Qt," to subsequently process a "),du=n(Qt,"CODE",{});var pJ=r(du);Ux=i(pJ,"scores"),pJ.forEach(o),Bx=i(Qt,` input tensor.
This class inherits from list and adds a specific `),pu=n(Qt,"EM",{});var mJ=r(pu);mu=n(mJ,"STRONG",{});var hJ=r(mu);qx=i(hJ,"call"),hJ.forEach(o),mJ.forEach(o),Dx=i(Qt," method to apply each "),Ud=n(Qt,"A",{href:!0});var gJ=r(Ud);Sx=i(gJ,"TFLogitsProcessor"),gJ.forEach(o),Px=i(Qt,` to the
inputs.`),Qt.forEach(o),Wx=l(Um),Bd=n(Um,"DIV",{class:!0});var uJ=r(Bd);u(Ca.$$.fragment,uJ),uJ.forEach(o),Um.forEach(o),Eb=l(t),lt=n(t,"DIV",{class:!0});var Bm=r(lt);u(Na.$$.fragment,Bm),Vx=l(Bm),hu=n(Bm,"P",{});var fJ=r(hu);Zx=i(fJ,"Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),fJ.forEach(o),Gx=l(Bm),Us=n(Bm,"DIV",{class:!0});var iT=r(Us);u(Xa.$$.fragment,iT),Cx=l(iT),gu=n(iT,"P",{});var _J=r(gu);Nx=i(_J,"TF method for warping logits."),_J.forEach(o),iT.forEach(o),Bm.forEach(o),jb=l(t),dt=n(t,"DIV",{class:!0});var qm=r(dt);u(Ra.$$.fragment,qm),Xx=l(qm),qd=n(qm,"P",{});var yL=r(qd);Dd=n(yL,"A",{href:!0});var bJ=r(Dd);Rx=i(bJ,"TFLogitsProcessor"),bJ.forEach(o),Ox=i(yL," enforcing a min-length by setting EOS probability to 0."),yL.forEach(o),Ax=l(qm),Sd=n(qm,"DIV",{class:!0});var yJ=r(Sd);u(Oa.$$.fragment,yJ),yJ.forEach(o),qm.forEach(o),Fb=l(t),pt=n(t,"DIV",{class:!0});var Dm=r(pt);u(Aa.$$.fragment,Dm),Hx=l(Dm),Pd=n(Dm,"P",{});var TL=r(Pd);Wd=n(TL,"A",{href:!0});var TJ=r(Wd);Qx=i(TJ,"TFLogitsProcessor"),TJ.forEach(o),Yx=i(TL," that enforces that specified sequences will never be sampled."),TL.forEach(o),Kx=l(Dm),Vd=n(Dm,"DIV",{class:!0});var vJ=r(Vd);u(Ha.$$.fragment,vJ),vJ.forEach(o),Dm.forEach(o),Lb=l(t),mt=n(t,"DIV",{class:!0});var Sm=r(mt);u(Qa.$$.fragment,Sm),eM=l(Sm),Bs=n(Sm,"P",{});var Qf=r(Bs);Zd=n(Qf,"A",{href:!0});var wJ=r(Zd);tM=i(wJ,"TFLogitsProcessor"),wJ.forEach(o),oM=i(Qf,` that enforces no repetition of n-grams. See
`),Ya=n(Qf,"A",{href:!0,rel:!0});var $J=r(Ya);sM=i($J,"Fairseq"),$J.forEach(o),nM=i(Qf,"."),Qf.forEach(o),rM=l(Sm),Gd=n(Sm,"DIV",{class:!0});var kJ=r(Gd);u(Ka.$$.fragment,kJ),kJ.forEach(o),Sm.forEach(o),zb=l(t),ht=n(t,"DIV",{class:!0});var Pm=r(ht);u(ei.$$.fragment,Pm),aM=l(Pm),Cd=n(Pm,"P",{});var vL=r(Cd);Nd=n(vL,"A",{href:!0});var xJ=r(Nd);iM=i(xJ,"TFLogitsProcessor"),xJ.forEach(o),cM=i(vL," enforcing an exponential penalty on repeated sequences."),vL.forEach(o),lM=l(Pm),Xd=n(Pm,"DIV",{class:!0});var MJ=r(Xd);u(ti.$$.fragment,MJ),MJ.forEach(o),Pm.forEach(o),Jb=l(t),gt=n(t,"DIV",{class:!0});var Wm=r(gt);u(oi.$$.fragment,Wm),dM=l(Wm),Le=n(Wm,"P",{});var Oo=r(Le);Rd=n(Oo,"A",{href:!0});var EJ=r(Rd);pM=i(EJ,"TFSuppressTokensAtBeginLogitsProcessor"),EJ.forEach(o),mM=i(Oo," suppresses a list of tokens as soon as the "),uu=n(Oo,"CODE",{});var jJ=r(uu);hM=i(jJ,"generate"),jJ.forEach(o),gM=i(Oo,` function starts
generating using `),fu=n(Oo,"CODE",{});var FJ=r(fu);uM=i(FJ,"begin_index"),FJ.forEach(o),fM=i(Oo," tokens. This should ensure that the tokens defined by "),_u=n(Oo,"CODE",{});var LJ=r(_u);_M=i(LJ,"begin_suppress_tokens"),LJ.forEach(o),bM=i(Oo,` at not
sampled at the begining of the generation.`),Oo.forEach(o),yM=l(Wm),Od=n(Wm,"DIV",{class:!0});var zJ=r(Od);u(si.$$.fragment,zJ),zJ.forEach(o),Wm.forEach(o),Ib=l(t),ut=n(t,"DIV",{class:!0});var Vm=r(ut);u(ni.$$.fragment,Vm),TM=l(Vm),ri=n(Vm,"P",{});var cT=r(ri);vM=i(cT,"This processor can be used to suppress a list of tokens. The processor will set their log probs to "),bu=n(cT,"CODE",{});var JJ=r(bu);wM=i(JJ,"-inf"),JJ.forEach(o),$M=i(cT,` so that they
are not sampled.`),cT.forEach(o),kM=l(Vm),Ad=n(Vm,"DIV",{class:!0});var IJ=r(Ad);u(ai.$$.fragment,IJ),IJ.forEach(o),Vm.forEach(o),Ub=l(t),ft=n(t,"DIV",{class:!0});var Zm=r(ft);u(ii.$$.fragment,Zm),xM=l(Zm),Hd=n(Zm,"P",{});var wL=r(Hd);Qd=n(wL,"A",{href:!0});var UJ=r(Qd);MM=i(UJ,"TFLogitsWarper"),UJ.forEach(o),EM=i(wL," for temperature (exponential scaling output probability distribution)."),wL.forEach(o),jM=l(Zm),Yd=n(Zm,"DIV",{class:!0});var BJ=r(Yd);u(ci.$$.fragment,BJ),BJ.forEach(o),Zm.forEach(o),Bb=l(t),_t=n(t,"DIV",{class:!0});var Gm=r(_t);u(li.$$.fragment,Gm),FM=l(Gm),Kd=n(Gm,"P",{});var $L=r(Kd);ep=n($L,"A",{href:!0});var qJ=r(ep);LM=i(qJ,"TFLogitsWarper"),qJ.forEach(o),zM=i($L," that performs top-k, i.e. restricting to the k highest probability elements."),$L.forEach(o),JM=l(Gm),tp=n(Gm,"DIV",{class:!0});var DJ=r(tp);u(di.$$.fragment,DJ),DJ.forEach(o),Gm.forEach(o),qb=l(t),bt=n(t,"DIV",{class:!0});var Cm=r(bt);u(pi.$$.fragment,Cm),IM=l(Cm),op=n(Cm,"P",{});var kL=r(op);sp=n(kL,"A",{href:!0});var SJ=r(sp);UM=i(SJ,"TFLogitsWarper"),SJ.forEach(o),BM=i(kL," that performs top-p, i.e. restricting to top tokens summing to <= prob_cut_off."),kL.forEach(o),qM=l(Cm),np=n(Cm,"DIV",{class:!0});var PJ=r(np);u(mi.$$.fragment,PJ),PJ.forEach(o),Cm.forEach(o),Db=l(t),Bo=n(t,"H3",{class:!0});var lT=r(Bo);qs=n(lT,"A",{id:!0,class:!0,href:!0});var WJ=r(qs);yu=n(WJ,"SPAN",{});var VJ=r(yu);u(hi.$$.fragment,VJ),VJ.forEach(o),WJ.forEach(o),DM=l(lT),Tu=n(lT,"SPAN",{});var ZJ=r(Tu);SM=i(ZJ,"FLAX"),ZJ.forEach(o),lT.forEach(o),Sb=l(t),yt=n(t,"DIV",{class:!0});var Nm=r(yt);u(gi.$$.fragment,Nm),PM=l(Nm),rp=n(Nm,"P",{});var xL=r(rp);ap=n(xL,"A",{href:!0});var GJ=r(ap);WM=i(GJ,"FlaxLogitsProcessor"),GJ.forEach(o),VM=i(xL," that enforces the specified token as the first generated token."),xL.forEach(o),ZM=l(Nm),ip=n(Nm,"DIV",{class:!0});var CJ=r(ip);u(ui.$$.fragment,CJ),CJ.forEach(o),Nm.forEach(o),Pb=l(t),Tt=n(t,"DIV",{class:!0});var Xm=r(Tt);u(fi.$$.fragment,Xm),GM=l(Xm),Ds=n(Xm,"P",{});var Yf=r(Ds);cp=n(Yf,"A",{href:!0});var NJ=r(cp);CM=i(NJ,"FlaxLogitsProcessor"),NJ.forEach(o),NM=i(Yf," that enforces the specified token as the last generated token when "),vu=n(Yf,"CODE",{});var XJ=r(vu);XM=i(XJ,"max_length"),XJ.forEach(o),RM=i(Yf," is reached."),Yf.forEach(o),OM=l(Xm),lp=n(Xm,"DIV",{class:!0});var RJ=r(lp);u(_i.$$.fragment,RJ),RJ.forEach(o),Xm.forEach(o),Wb=l(t),vt=n(t,"DIV",{class:!0});var Rm=r(vt);u(bi.$$.fragment,Rm),AM=l(Rm),Ss=n(Rm,"P",{});var Kf=r(Ss);dp=n(Kf,"A",{href:!0});var OJ=r(dp);HM=i(OJ,"FlaxLogitsProcessor"),OJ.forEach(o),QM=i(Kf,` that takes a list of pairs of integers which indicates a mapping from generation indices to
token indices that will be forced before sampling. The processor will set their log probs to 0 and all other tokens
to `),wu=n(Kf,"CODE",{});var AJ=r(wu);YM=i(AJ,"-inf"),AJ.forEach(o),KM=i(Kf," so that they are sampled at their corresponding index."),Kf.forEach(o),e4=l(Rm),pp=n(Rm,"DIV",{class:!0});var HJ=r(pp);u(yi.$$.fragment,HJ),HJ.forEach(o),Rm.forEach(o),Vb=l(t),wt=n(t,"DIV",{class:!0});var Om=r(wt);u(Ti.$$.fragment,Om),t4=l(Om),$u=n(Om,"P",{});var QJ=r($u);o4=i(QJ,"Abstract base class for all logit processors that can be applied during generation."),QJ.forEach(o),s4=l(Om),Ps=n(Om,"DIV",{class:!0});var dT=r(Ps);u(vi.$$.fragment,dT),n4=l(dT),ku=n(dT,"P",{});var YJ=r(ku);r4=i(YJ,"Flax method for processing logits."),YJ.forEach(o),dT.forEach(o),Om.forEach(o),Zb=l(t),$t=n(t,"DIV",{class:!0});var Am=r($t);u(wi.$$.fragment,Am),a4=l(Am),C=n(Am,"P",{});var le=r(C);i4=i(le,"This class can be used to create a list of "),mp=n(le,"A",{href:!0});var KJ=r(mp);c4=i(KJ,"FlaxLogitsProcessor"),KJ.forEach(o),l4=i(le," or "),hp=n(le,"A",{href:!0});var eI=r(hp);d4=i(eI,"FlaxLogitsWarper"),eI.forEach(o),p4=i(le,` to subsequently process
a `),xu=n(le,"CODE",{});var tI=r(xu);m4=i(tI,"scores"),tI.forEach(o),h4=i(le," input tensor. This class inherits from list and adds a specific "),Mu=n(le,"EM",{});var oI=r(Mu);Eu=n(oI,"STRONG",{});var sI=r(Eu);g4=i(sI,"call"),sI.forEach(o),oI.forEach(o),u4=i(le,` method to apply each
`),gp=n(le,"A",{href:!0});var nI=r(gp);f4=i(nI,"FlaxLogitsProcessor"),nI.forEach(o),_4=i(le," or "),up=n(le,"A",{href:!0});var rI=r(up);b4=i(rI,"FlaxLogitsWarper"),rI.forEach(o),y4=i(le," to the inputs."),le.forEach(o),T4=l(Am),fp=n(Am,"DIV",{class:!0});var aI=r(fp);u($i.$$.fragment,aI),aI.forEach(o),Am.forEach(o),Gb=l(t),kt=n(t,"DIV",{class:!0});var Hm=r(kt);u(ki.$$.fragment,Hm),v4=l(Hm),ju=n(Hm,"P",{});var iI=r(ju);w4=i(iI,"Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),iI.forEach(o),$4=l(Hm),Ws=n(Hm,"DIV",{class:!0});var pT=r(Ws);u(xi.$$.fragment,pT),k4=l(pT),Fu=n(pT,"P",{});var cI=r(Fu);x4=i(cI,"Flax method for warping logits."),cI.forEach(o),pT.forEach(o),Hm.forEach(o),Cb=l(t),xt=n(t,"DIV",{class:!0});var Qm=r(xt);u(Mi.$$.fragment,Qm),M4=l(Qm),_p=n(Qm,"P",{});var ML=r(_p);bp=n(ML,"A",{href:!0});var lI=r(bp);E4=i(lI,"FlaxLogitsProcessor"),lI.forEach(o),j4=i(ML," enforcing a min-length by setting EOS probability to 0."),ML.forEach(o),F4=l(Qm),yp=n(Qm,"DIV",{class:!0});var dI=r(yp);u(Ei.$$.fragment,dI),dI.forEach(o),Qm.forEach(o),Nb=l(t),Mt=n(t,"DIV",{class:!0});var Ym=r(Mt);u(ji.$$.fragment,Ym),L4=l(Ym),ze=n(Ym,"P",{});var Ao=r(ze);Tp=n(Ao,"A",{href:!0});var pI=r(Tp);z4=i(pI,"FlaxLogitsProcessor"),pI.forEach(o),J4=i(Ao," supressing a list of tokens as soon as the "),Lu=n(Ao,"CODE",{});var mI=r(Lu);I4=i(mI,"generate"),mI.forEach(o),U4=i(Ao,` function starts generating using
`),zu=n(Ao,"CODE",{});var hI=r(zu);B4=i(hI,"begin_index"),hI.forEach(o),q4=i(Ao," tokens. This should ensure that the tokens defined by "),Ju=n(Ao,"CODE",{});var gI=r(Ju);D4=i(gI,"begin_suppress_tokens"),gI.forEach(o),S4=i(Ao,` are not sampled at the
begining of the generation.`),Ao.forEach(o),P4=l(Ym),vp=n(Ym,"DIV",{class:!0});var uI=r(vp);u(Fi.$$.fragment,uI),uI.forEach(o),Ym.forEach(o),Xb=l(t),Et=n(t,"DIV",{class:!0});var Km=r(Et);u(Li.$$.fragment,Km),W4=l(Km),Vs=n(Km,"P",{});var e_=r(Vs);wp=n(e_,"A",{href:!0});var fI=r(wp);V4=i(fI,"FlaxLogitsProcessor"),fI.forEach(o),Z4=i(e_,` suppressing a list of tokens at each decoding step. The processor will set their log probs
to be `),Iu=n(e_,"CODE",{});var _I=r(Iu);G4=i(_I,"-inf"),_I.forEach(o),C4=i(e_," so they are not sampled."),e_.forEach(o),N4=l(Km),$p=n(Km,"DIV",{class:!0});var bI=r($p);u(zi.$$.fragment,bI),bI.forEach(o),Km.forEach(o),Rb=l(t),jt=n(t,"DIV",{class:!0});var eh=r(jt);u(Ji.$$.fragment,eh),X4=l(eh),kp=n(eh,"P",{});var EL=r(kp);xp=n(EL,"A",{href:!0});var yI=r(xp);R4=i(yI,"FlaxLogitsWarper"),yI.forEach(o),O4=i(EL," for temperature (exponential scaling output probability distribution)."),EL.forEach(o),A4=l(eh),Mp=n(eh,"DIV",{class:!0});var TI=r(Mp);u(Ii.$$.fragment,TI),TI.forEach(o),eh.forEach(o),Ob=l(t),Ft=n(t,"DIV",{class:!0});var th=r(Ft);u(Ui.$$.fragment,th),H4=l(th),Ep=n(th,"P",{});var jL=r(Ep);jp=n(jL,"A",{href:!0});var vI=r(jp);Q4=i(vI,"FlaxLogitsWarper"),vI.forEach(o),Y4=i(jL," that performs top-k, i.e. restricting to the k highest probability elements."),jL.forEach(o),K4=l(th),Fp=n(th,"DIV",{class:!0});var wI=r(Fp);u(Bi.$$.fragment,wI),wI.forEach(o),th.forEach(o),Ab=l(t),Lt=n(t,"DIV",{class:!0});var oh=r(Lt);u(qi.$$.fragment,oh),eE=l(oh),Lp=n(oh,"P",{});var FL=r(Lp);zp=n(FL,"A",{href:!0});var $I=r(zp);tE=i($I,"FlaxLogitsWarper"),$I.forEach(o),oE=i(FL," that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),FL.forEach(o),sE=l(oh),Jp=n(oh,"DIV",{class:!0});var kI=r(Jp);u(Di.$$.fragment,kI),kI.forEach(o),oh.forEach(o),Hb=l(t),zt=n(t,"DIV",{class:!0});var sh=r(zt);u(Si.$$.fragment,sh),nE=l(sh),Pi=n(sh,"P",{});var mT=r(Pi);rE=i(mT,`Whisper specific Processor. This processor can be used to force a list of tokens. The processor will set their log
probs to `),Uu=n(mT,"CODE",{});var xI=r(Uu);aE=i(xI,"inf"),xI.forEach(o),iE=i(mT," so that they are sampled at their corresponding index."),mT.forEach(o),cE=l(sh),Ip=n(sh,"DIV",{class:!0});var MI=r(Ip);u(Wi.$$.fragment,MI),MI.forEach(o),sh.forEach(o),Qb=l(t),qo=n(t,"H2",{class:!0});var hT=r(qo);Zs=n(hT,"A",{id:!0,class:!0,href:!0});var EI=r(Zs);Bu=n(EI,"SPAN",{});var jI=r(Bu);u(Vi.$$.fragment,jI),jI.forEach(o),EI.forEach(o),lE=l(hT),qu=n(hT,"SPAN",{});var FI=r(qu);dE=i(FI,"StoppingCriteria"),FI.forEach(o),hT.forEach(o),Yb=l(t),Gs=n(t,"P",{});var gT=r(Gs);pE=i(gT,"A "),Up=n(gT,"A",{href:!0});var LI=r(Up);mE=i(LI,"StoppingCriteria"),LI.forEach(o),hE=i(gT," can be used to change when to stop generation (other than EOS token). Please note that this is exclusivelly available to our PyTorch implementations."),gT.forEach(o),Kb=l(t),Jt=n(t,"DIV",{class:!0});var nh=r(Jt);u(Zi.$$.fragment,nh),gE=l(nh),Du=n(nh,"P",{});var zI=r(Du);uE=i(zI,"Abstract base class for all stopping criteria that can be applied during generation."),zI.forEach(o),fE=l(nh),Bp=n(nh,"DIV",{class:!0});var JI=r(Bp);u(Gi.$$.fragment,JI),JI.forEach(o),nh.forEach(o),ey=l(t),Do=n(t,"DIV",{class:!0});var uT=r(Do);u(Ci.$$.fragment,uT),_E=l(uT),qp=n(uT,"DIV",{class:!0});var II=r(qp);u(Ni.$$.fragment,II),II.forEach(o),uT.forEach(o),ty=l(t),It=n(t,"DIV",{class:!0});var rh=r(It);u(Xi.$$.fragment,rh),bE=l(rh),Ri=n(rh,"P",{});var fT=r(Ri);yE=i(fT,"This class can be used to stop generation whenever the full generated number of tokens exceeds "),Su=n(fT,"CODE",{});var UI=r(Su);TE=i(UI,"max_length"),UI.forEach(o),vE=i(fT,`. Keep
in mind for decoder-only type of transformers, this will include the initial prompted tokens.`),fT.forEach(o),wE=l(rh),Dp=n(rh,"DIV",{class:!0});var BI=r(Dp);u(Oi.$$.fragment,BI),BI.forEach(o),rh.forEach(o),oy=l(t),Ut=n(t,"DIV",{class:!0});var ah=r(Ut);u(Ai.$$.fragment,ah),$E=l(ah),Hi=n(ah,"P",{});var _T=r(Hi);kE=i(_T,`This class can be used to stop generation whenever the full generation exceeds some amount of time. By default, the
time will start being counted when you initialize this function. You can override this by passing an
`),Pu=n(_T,"CODE",{});var qI=r(Pu);xE=i(qI,"initial_time"),qI.forEach(o),ME=i(_T,"."),_T.forEach(o),EE=l(ah),Sp=n(ah,"DIV",{class:!0});var DI=r(Sp);u(Qi.$$.fragment,DI),DI.forEach(o),ah.forEach(o),sy=l(t),So=n(t,"H2",{class:!0});var bT=r(So);Cs=n(bT,"A",{id:!0,class:!0,href:!0});var SI=r(Cs);Wu=n(SI,"SPAN",{});var PI=r(Wu);u(Yi.$$.fragment,PI),PI.forEach(o),SI.forEach(o),jE=l(bT),Vu=n(bT,"SPAN",{});var WI=r(Vu);FE=i(WI,"Constraints"),WI.forEach(o),bT.forEach(o),ny=l(t),Ns=n(t,"P",{});var yT=r(Ns);LE=i(yT,"A "),Pp=n(yT,"A",{href:!0});var VI=r(Pp);zE=i(VI,"Constraint"),VI.forEach(o),JE=i(yT," can be used to force the generation to include specific tokens or sequences in the output. Please note that this is exclusivelly available to our PyTorch implementations."),yT.forEach(o),ry=l(t),z=n(t,"DIV",{class:!0});var I=r(z);u(Ki.$$.fragment,I),IE=l(I),Zu=n(I,"P",{});var ZI=r(Zu);UE=i(ZI,`Abstract base class for all constraints that can be applied during generation.
It must define how the constraint can be satisfied.`),ZI.forEach(o),BE=l(I),Gu=n(I,"P",{});var GI=r(Gu);qE=i(GI,"All classes that inherit Constraint must follow the requirement that"),GI.forEach(o),DE=l(I),u(Xs.$$.fragment,I),SE=l(I),Cu=n(I,"P",{});var CI=r(Cu);PE=i(CI,"will always terminate (halt)."),CI.forEach(o),WE=l(I),Rs=n(I,"DIV",{class:!0});var TT=r(Rs);u(ec.$$.fragment,TT),VE=l(TT),Nu=n(TT,"P",{});var NI=r(Nu);ZE=i(NI,"When called, returns the token that would take this constraint one step closer to being fulfilled."),NI.forEach(o),TT.forEach(o),GE=l(I),Os=n(I,"DIV",{class:!0});var vT=r(Os);u(tc.$$.fragment,vT),CE=l(vT),Xu=n(vT,"P",{});var XI=r(Xu);NE=i(XI,"Creates a new instance of this constraint."),XI.forEach(o),vT.forEach(o),XE=l(I),As=n(I,"DIV",{class:!0});var wT=r(As);u(oc.$$.fragment,wT),RE=l(wT),Ru=n(wT,"P",{});var RI=r(Ru);OE=i(RI,"Reads in a token and returns whether it creates progress."),RI.forEach(o),wT.forEach(o),AE=l(I),Hs=n(I,"DIV",{class:!0});var $T=r(Hs);u(sc.$$.fragment,$T),HE=l($T),nc=n($T,"P",{});var kT=r(nc);QE=i(kT,"Returns the number of remaining steps of "),Ou=n(kT,"CODE",{});var OI=r(Ou);YE=i(OI,"advance()"),OI.forEach(o),KE=i(kT," in order to complete this constraint."),kT.forEach(o),$T.forEach(o),ej=l(I),Qs=n(I,"DIV",{class:!0});var xT=r(Qs);u(rc.$$.fragment,xT),tj=l(xT),Au=n(xT,"P",{});var AI=r(Au);oj=i(AI,`Resets the state of this constraint to its initialization. We would call this in cases where the fulfillment of
a constraint is abrupted by an unwanted token.`),AI.forEach(o),xT.forEach(o),sj=l(I),Ys=n(I,"DIV",{class:!0});var MT=r(Ys);u(ac.$$.fragment,MT),nj=l(MT),Hu=n(MT,"P",{});var HI=r(Hu);rj=i(HI,"Tests whether this constraint has been properly defined."),HI.forEach(o),MT.forEach(o),aj=l(I),Zt=n(I,"DIV",{class:!0});var ih=r(Zt);u(ic.$$.fragment,ih),ij=l(ih),cc=n(ih,"P",{});var ET=r(cc);cj=i(ET,`Reads in a token and returns booleans that indicate the progress made by it. This function will update the
state of this object unlikes `),Qu=n(ET,"CODE",{});var QI=r(Qu);lj=i(QI,"does_advance(self, token_id: int)"),QI.forEach(o),dj=i(ET,"."),ET.forEach(o),pj=l(ih),Yu=n(ih,"P",{});var YI=r(Yu);mj=i(YI,`This isn\u2019t to test whether a certain token will advance the progress; it\u2019s to update its state as if it has
been generated. This becomes important if token_id != desired token (refer to else statement in
PhrasalConstraint)`),YI.forEach(o),ih.forEach(o),I.forEach(o),ay=l(t),Po=n(t,"DIV",{class:!0});var jT=r(Po);u(lc.$$.fragment,jT),hj=l(jT),Wp=n(jT,"P",{});var LL=r(Wp);Vp=n(LL,"A",{href:!0});var KI=r(Vp);gj=i(KI,"Constraint"),KI.forEach(o),uj=i(LL," enforcing that an ordered sequence of tokens is included in the output."),LL.forEach(o),jT.forEach(o),iy=l(t),Wo=n(t,"DIV",{class:!0});var FT=r(Wo);u(dc.$$.fragment,FT),fj=l(FT),pc=n(FT,"P",{});var LT=r(pc);_j=i(LT,"A special "),Zp=n(LT,"A",{href:!0});var eU=r(Zp);bj=i(eU,"Constraint"),eU.forEach(o),yj=i(LT," that is fulfilled by fulfilling just one of several constraints."),LT.forEach(o),FT.forEach(o),cy=l(t),we=n(t,"DIV",{class:!0});var vn=r(we);u(mc.$$.fragment,vn),Tj=l(vn),Ku=n(vn,"P",{});var tU=r(Ku);vj=i(tU,"A class for beam scorers to track its progress through a list of constraints."),tU.forEach(o),wj=l(vn),R=n(vn,"DIV",{class:!0});var Je=r(R);u(hc.$$.fragment,Je),$j=l(Je),ef=n(Je,"P",{});var oU=r(ef);kj=i(oU,`The list of tokens to generate such that we can make progress.
By \u201Clist\u201D we don\u2019t mean the list of token that will fully fulfill a constraint.`),oU.forEach(o),xj=l(Je),Vo=n(Je,"P",{});var ch=r(Vo);Mj=i(ch,"Given constraints "),tf=n(ch,"CODE",{});var sU=r(tf);Ej=i(sU,"c_i = {t_ij | j == # of tokens}"),sU.forEach(o),jj=i(ch,`, If we\u2019re not in the middle of progressing through a
specific constraint `),of=n(ch,"CODE",{});var nU=r(of);Fj=i(nU,"c_i"),nU.forEach(o),Lj=i(ch,", we return:"),ch.forEach(o),zj=l(Je),sf=n(Je,"P",{});var rU=r(sf);nf=n(rU,"CODE",{});var aU=r(nf);Jj=i(aU,"[t_k1 for k in indices of unfulfilled constraints]"),aU.forEach(o),rU.forEach(o),Ij=l(Je),Bt=n(Je,"P",{});var wn=r(Bt);Uj=i(wn,`If we are in the middle of a constraint, then we return:
`),rf=n(wn,"CODE",{});var iU=r(rf);Bj=i(iU,"[t_ij]"),iU.forEach(o),qj=i(wn,", where "),af=n(wn,"CODE",{});var cU=r(af);Dj=i(cU,"i"),cU.forEach(o),Sj=i(wn," is the index of the inprogress constraint, "),cf=n(wn,"CODE",{});var lU=r(cf);Pj=i(lU,"j"),lU.forEach(o),Wj=i(wn," is the next step for the constraint."),wn.forEach(o),Vj=l(Je),lf=n(Je,"P",{});var dU=r(lf);Zj=i(dU,`Though we don\u2019t care which constraint is fulfilled first, if we are in the progress of fulfilling a constraint,
that\u2019s the only one we\u2019ll return.`),dU.forEach(o),Je.forEach(o),Gj=l(vn),Ks=n(vn,"DIV",{class:!0});var zT=r(Ks);u(gc.$$.fragment,zT),Cj=l(zT),df=n(zT,"P",{});var pU=r(df);Nj=i(pU,"token_ids: the tokens generated thus far to reset the state of the progress through constraints."),pU.forEach(o),zT.forEach(o),vn.forEach(o),ly=l(t),Zo=n(t,"H2",{class:!0});var JT=r(Zo);en=n(JT,"A",{id:!0,class:!0,href:!0});var mU=r(en);pf=n(mU,"SPAN",{});var hU=r(pf);u(uc.$$.fragment,hU),hU.forEach(o),mU.forEach(o),Xj=l(JT),mf=n(JT,"SPAN",{});var gU=r(mf);Rj=i(gU,"BeamSearch"),gU.forEach(o),JT.forEach(o),dy=l(t),$e=n(t,"DIV",{class:!0});var $n=r($e);u(fc.$$.fragment,$n),Oj=l($n),Go=n($n,"P",{});var lh=r(Go);Aj=i(lh,"Abstract base class for all beam scorers that are used for "),Gp=n(lh,"A",{href:!0});var uU=r(Gp);Hj=i(uU,"beam_search()"),uU.forEach(o),Qj=i(lh,` and
`),Cp=n(lh,"A",{href:!0});var fU=r(Cp);Yj=i(fU,"beam_sample()"),fU.forEach(o),Kj=i(lh,"."),lh.forEach(o),eF=l($n),Np=n($n,"DIV",{class:!0});var _U=r(Np);u(_c.$$.fragment,_U),_U.forEach(o),tF=l($n),Xp=n($n,"DIV",{class:!0});var bU=r(Xp);u(bc.$$.fragment,bU),bU.forEach(o),$n.forEach(o),py=l(t),N=n(t,"DIV",{class:!0});var Ie=r(N);u(yc.$$.fragment,Ie),oF=l(Ie),Rp=n(Ie,"P",{});var zL=r(Rp);Op=n(zL,"A",{href:!0});var yU=r(Op);sF=i(yU,"BeamScorer"),yU.forEach(o),nF=i(zL," implementing standard beam search decoding."),zL.forEach(o),rF=l(Ie),Tc=n(Ie,"P",{});var IT=r(Tc);aF=i(IT,"Adapted in part from "),vc=n(IT,"A",{href:!0,rel:!0});var TU=r(vc);iF=i(TU,`Facebook\u2019s XLM beam search
code`),TU.forEach(o),cF=i(IT,"."),IT.forEach(o),lF=l(Ie),Ap=n(Ie,"P",{});var JL=r(Ap);dF=i(JL,"Reference for the diverse beam search algorithm and implementation "),wc=n(JL,"A",{href:!0,rel:!0});var vU=r(wc);pF=i(vU,`Ashwin Kalyan\u2019s DBS
implementation`),vU.forEach(o),JL.forEach(o),mF=l(Ie),Hp=n(Ie,"DIV",{class:!0});var wU=r(Hp);u($c.$$.fragment,wU),wU.forEach(o),hF=l(Ie),Qp=n(Ie,"DIV",{class:!0});var $U=r(Qp);u(kc.$$.fragment,$U),$U.forEach(o),Ie.forEach(o),my=l(t),ke=n(t,"DIV",{class:!0});var kn=r(ke);u(xc.$$.fragment,kn),gF=l(kn),Yp=n(kn,"P",{});var IL=r(Yp);Kp=n(IL,"A",{href:!0});var kU=r(Kp);uF=i(kU,"BeamScorer"),kU.forEach(o),fF=i(IL," implementing constrained beam search decoding."),IL.forEach(o),_F=l(kn),em=n(kn,"DIV",{class:!0});var xU=r(em);u(Mc.$$.fragment,xU),xU.forEach(o),bF=l(kn),tm=n(kn,"DIV",{class:!0});var MU=r(tm);u(Ec.$$.fragment,MU),MU.forEach(o),kn.forEach(o),hy=l(t),Co=n(t,"H2",{class:!0});var UT=r(Co);tn=n(UT,"A",{id:!0,class:!0,href:!0});var EU=r(tn);hf=n(EU,"SPAN",{});var jU=r(hf);u(jc.$$.fragment,jU),jU.forEach(o),EU.forEach(o),yF=l(UT),gf=n(UT,"SPAN",{});var FU=r(gf);TF=i(FU,"Utilities"),FU.forEach(o),UT.forEach(o),gy=l(t),qt=n(t,"DIV",{class:!0});var dh=r(qt);u(Fc.$$.fragment,dh),vF=l(dh),uf=n(dh,"P",{});var LU=r(uf);wF=i(LU,"Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),LU.forEach(o),$F=l(dh),om=n(dh,"P",{});var UL=r(om);kF=i(UL,"From: "),Lc=n(UL,"A",{href:!0,rel:!0});var zU=r(Lc);xF=i(zU,"https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),zU.forEach(o),UL.forEach(o),dh.forEach(o),uy=l(t),Dt=n(t,"DIV",{class:!0});var ph=r(Dt);u(zc.$$.fragment,ph),MF=l(ph),ff=n(ph,"P",{});var JU=r(ff);EF=i(JU,"Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),JU.forEach(o),jF=l(ph),sm=n(ph,"P",{});var BL=r(sm);FF=i(BL,"From: "),Jc=n(BL,"A",{href:!0,rel:!0});var IU=r(Jc);LF=i(IU,"https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),IU.forEach(o),BL.forEach(o),ph.forEach(o),fy=l(t),No=n(t,"H2",{class:!0});var BT=r(No);on=n(BT,"A",{id:!0,class:!0,href:!0});var UU=r(on);_f=n(UU,"SPAN",{});var BU=r(_f);u(Ic.$$.fragment,BU),BU.forEach(o),UU.forEach(o),zF=l(BT),bf=n(BT,"SPAN",{});var qU=r(bf);JF=i(qU,"Streamers"),qU.forEach(o),BT.forEach(o),_y=l(t),P=n(t,"DIV",{class:!0});var de=r(P);u(Uc.$$.fragment,de),IF=l(de),yf=n(de,"P",{});var DU=r(yf);UF=i(DU,"Simple text streamer that prints the token(s) to stdout as soon as entire words are formed."),DU.forEach(o),BF=l(de),u(sn.$$.fragment,de),qF=l(de),u(nn.$$.fragment,de),DF=l(de),rn=n(de,"DIV",{class:!0});var qT=r(rn);u(Bc.$$.fragment,qT),SF=l(qT),Tf=n(qT,"P",{});var SU=r(Tf);PF=i(SU,"Flushes any remaining cache and prints a newline to stdout."),SU.forEach(o),qT.forEach(o),WF=l(de),an=n(de,"DIV",{class:!0});var DT=r(an);u(qc.$$.fragment,DT),VF=l(DT),vf=n(DT,"P",{});var PU=r(vf);ZF=i(PU,"Prints the new text to stdout. If the stream is ending, also prints a newline."),PU.forEach(o),DT.forEach(o),GF=l(de),cn=n(de,"DIV",{class:!0});var ST=r(cn);u(Dc.$$.fragment,ST),CF=l(ST),wf=n(ST,"P",{});var WU=r(wf);NF=i(WU,"Receives tokens, decodes them, and prints them to stdout as soon as they form entire words."),WU.forEach(o),ST.forEach(o),de.forEach(o),by=l(t),te=n(t,"DIV",{class:!0});var Yt=r(te);u(Sc.$$.fragment,Yt),XF=l(Yt),$f=n(Yt,"P",{});var VU=r($f);RF=i(VU,`Streamer that stores print-ready text in a queue, to be used by a downstream application as an iterator. This is
useful for applications that benefit from acessing the generated text in a non-blocking way (e.g. in an interactive
Gradio demo).`),VU.forEach(o),OF=l(Yt),u(ln.$$.fragment,Yt),AF=l(Yt),u(dn.$$.fragment,Yt),HF=l(Yt),pn=n(Yt,"DIV",{class:!0});var PT=r(pn);u(Pc.$$.fragment,PT),QF=l(PT),kf=n(PT,"P",{});var ZU=r(kf);YF=i(ZU,"Put the new text in the queue. If the stream is ending, also put a stop signal in the queue."),ZU.forEach(o),PT.forEach(o),Yt.forEach(o),this.h()},h(){d(T,"name","hf:doc:metadata"),d(T,"content",JSON.stringify(_B)),d(w,"id","utilities-for-generation"),d(w,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(w,"href","#utilities-for-generation"),d($,"class","relative group"),d(oe,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.generate"),d(se,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.greedy_search"),d(j,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.contrastive_search"),d(xe,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.sample"),d(Cc,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.beam_search"),d(Nc,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.beam_sample"),d(Xc,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.group_beam_search"),d(Rc,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.constrained_beam_search"),d(Ho,"id","generate-outputs"),d(Ho,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ho,"href","#generate-outputs"),d(so,"class","relative group"),d(Ac,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.generate"),d(Hc,"href","/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput"),d(Qc,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.generate"),d(Kc,"href","/docs/transformers/main/en/internal/generation_utils#transformers.generation.GreedySearchDecoderOnlyOutput"),d(Yo,"id","transformers.generation.GreedySearchEncoderDecoderOutput"),d(Yo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Yo,"href","#transformers.generation.GreedySearchEncoderDecoderOutput"),d(no,"class","relative group"),d(ro,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ao,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(io,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(co,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(lo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(po,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(mo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ho,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(go,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(uo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ko,"id","transformers.generation.TFGreedySearchEncoderDecoderOutput"),d(Ko,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ko,"href","#transformers.generation.TFGreedySearchEncoderDecoderOutput"),d(fo,"class","relative group"),d(_o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(bo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(yo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(To,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(vo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(wo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d($o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ko,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(xo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Mo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(es,"id","transformers.generation.FlaxSampleOutput"),d(es,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(es,"href","#transformers.generation.FlaxSampleOutput"),d(Eo,"class","relative group"),d(ts,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(os,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ss,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ns,"id","logitsprocessor"),d(ns,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ns,"href","#logitsprocessor"),d(jo,"class","relative group"),d(rl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(as,"id","transformers.AlternatingCodebooksLogitsProcessor"),d(as,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(as,"href","#transformers.AlternatingCodebooksLogitsProcessor"),d(Fo,"class","relative group"),d(al,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(il,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(pr,"href","https://arxiv.org/abs/2306.05284"),d(pr,"rel","nofollow"),d(cl,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ll,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(gr,"href","https://github.com/facebookresearch/ParlAI/blob/master/parlai/core/torch_generator_agent.py#L1350"),d(gr,"rel","nofollow"),d(dl,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ml,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(hl,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(gl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(yr,"href","https://arxiv.org/abs/2210.15191"),d(yr,"rel","nofollow"),d(ul,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(fl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(wr,"href","https://arxiv.org/abs/2210.15191"),d(wr,"rel","nofollow"),d(_l,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(yl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Tl,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(wl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d($l,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(kl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(xl,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ml,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(jl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Fl,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.group_beam_search"),d(Ur,"href","https://arxiv.org/pdf/1610.02424.pdf"),d(Ur,"rel","nofollow"),d(Bl,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ql,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Dl,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Sl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(Pl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Wl,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Vl,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Zl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Gl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(Cl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Nl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(Xl,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Rl,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(He,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Al,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Hl,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ql,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Yl,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ed,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(td,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(od,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(ta,"href","https://github.com/pytorch/fairseq/blob/a07cb6f40480928c9e0548b737aadd36ee66ac76/fairseq/sequence_generator.py#L345"),d(ta,"rel","nofollow"),d(sd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(nd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(na,"href","https://arxiv.org/abs/2010.00904"),d(na,"rel","nofollow"),d(rd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ad,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(ia,"href","https://arxiv.org/pdf/1909.05858.pdf"),d(ia,"rel","nofollow"),d(id,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ld,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(dd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(pd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.SuppressTokensAtBeginLogitsProcessor"),d(md,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(hd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ud,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(fd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(bd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(yd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(vd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(wd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d($d,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d($a,"href","https://arxiv.org/abs/2202.00666"),d($a,"rel","nofollow"),d(kd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ea,"href","https://arxiv.org/abs/2306.17806"),d(Ea,"rel","nofollow"),d(xd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ja,"href","https://arxiv.org/abs/2212.04356"),d(Ja,"rel","nofollow"),d(Md,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(zs,"id","transformers.TFForcedBOSTokenLogitsProcessor"),d(zs,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(zs,"href","#transformers.TFForcedBOSTokenLogitsProcessor"),d(Io,"class","relative group"),d(jd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(Fd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ld,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(zd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Jd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Is,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Id,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(Ud,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(Bd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Us,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Dd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(Sd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Wd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(Vd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Zd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(Ya,"href","https://github.com/pytorch/fairseq/blob/a07cb6f40480928c9e0548b737aadd36ee66ac76/fairseq/sequence_generator.py#L345"),d(Ya,"rel","nofollow"),d(Gd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Nd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(Xd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Rd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFSuppressTokensAtBeginLogitsProcessor"),d(Od,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ad,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Qd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsWarper"),d(Yd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ep,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsWarper"),d(tp,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(_t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(sp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsWarper"),d(np,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(qs,"id","transformers.FlaxForcedBOSTokenLogitsProcessor"),d(qs,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(qs,"href","#transformers.FlaxForcedBOSTokenLogitsProcessor"),d(Bo,"class","relative group"),d(ap,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(ip,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(cp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(lp,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(dp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(pp,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ps,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(wt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(mp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(hp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(gp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(up,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(fp,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d($t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ws,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(bp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(yp,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Tp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(vp,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(wp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d($p,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(xp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(Mp,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(jp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(Fp,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(zp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(Jp,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ip,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Zs,"id","transformers.StoppingCriteria"),d(Zs,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Zs,"href","#transformers.StoppingCriteria"),d(qo,"class","relative group"),d(Up,"href","/docs/transformers/main/en/internal/generation_utils#transformers.StoppingCriteria"),d(Bp,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(qp,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Do,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Dp,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(It,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Sp,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Cs,"id","transformers.Constraint"),d(Cs,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Cs,"href","#transformers.Constraint"),d(So,"class","relative group"),d(Pp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.Constraint"),d(Rs,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Os,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(As,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Hs,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Qs,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ys,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Vp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.Constraint"),d(Po,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Zp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.Constraint"),d(Wo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ks,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(en,"id","transformers.BeamScorer"),d(en,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(en,"href","#transformers.BeamScorer"),d(Zo,"class","relative group"),d(Gp,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.beam_search"),d(Cp,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.beam_sample"),d(Np,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Xp,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Op,"href","/docs/transformers/main/en/internal/generation_utils#transformers.BeamScorer"),d(vc,"href","https://github.com/facebookresearch/XLM/blob/9e6f6814d17be4fe5b15f2e6c43eb2b2d76daeb4/src/model/transformer.py#L529"),d(vc,"rel","nofollow"),d(wc,"href","https://github.com/ashwinkalyan/dbs/blob/master/dbs/beam_utils.lua"),d(wc,"rel","nofollow"),d(Hp,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Qp,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Kp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.BeamScorer"),d(em,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(tm,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(tn,"id","transformers.top_k_top_p_filtering"),d(tn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(tn,"href","#transformers.top_k_top_p_filtering"),d(Co,"class","relative group"),d(Lc,"href","https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),d(Lc,"rel","nofollow"),d(qt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Jc,"href","https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),d(Jc,"rel","nofollow"),d(Dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(on,"id","transformers.TextStreamer"),d(on,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(on,"href","#transformers.TextStreamer"),d(No,"class","relative group"),d(rn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(an,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(cn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(pn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,p){e(document.head,T),m(t,x,p),m(t,$,p),e($,w),e(w,M),f(h,M,null),e($,k),e($,Z),e(Z,U),m(t,B,p),m(t,F,p),e(F,W),e(F,oe),e(oe,Ue),e(F,S),e(F,se),e(se,Be),e(F,A),e(F,j),e(j,Kt),e(F,eo),e(F,xe),e(xe,to),e(F,oo),e(F,Cc),e(Cc,WT),e(F,VT),e(F,Nc),e(Nc,ZT),e(F,GT),e(F,Xc),e(Xc,CT),e(F,NT),e(F,Rc),e(Rc,XT),e(F,RT),m(t,t_,p),m(t,Oc,p),e(Oc,OT),m(t,o_,p),m(t,so,p),e(so,Ho),e(Ho,mh),f(Mn,mh,null),e(so,AT),e(so,hh),e(hh,HT),m(t,s_,p),m(t,Me,p),e(Me,QT),e(Me,Ac),e(Ac,YT),e(Me,KT),e(Me,Hc),e(Hc,ev),e(Me,tv),e(Me,Qc),e(Qc,ov),e(Me,sv),m(t,n_,p),m(t,Yc,p),e(Yc,nv),m(t,r_,p),f(En,t,p),m(t,a_,p),m(t,Pt,p),e(Pt,rv),e(Pt,gh),e(gh,av),e(Pt,iv),e(Pt,Kc),e(Kc,cv),e(Pt,lv),m(t,i_,p),m(t,Ee,p),e(Ee,el),e(el,uh),e(uh,dv),e(el,pv),e(Ee,mv),e(Ee,tl),e(tl,fh),e(fh,hv),e(tl,gv),e(Ee,uv),e(Ee,ol),e(ol,_h),e(_h,fv),e(ol,_v),e(Ee,bv),e(Ee,sl),e(sl,bh),e(bh,yv),e(sl,Tv),m(t,c_,p),m(t,V,p),e(V,vv),e(V,yh),e(yh,wv),e(V,$v),e(V,Th),e(Th,kv),e(V,xv),e(V,vh),e(vh,Mv),e(V,Ev),e(V,wh),e(wh,jv),e(V,Fv),e(V,$h),e($h,Lv),e(V,zv),e(V,kh),e(kh,Jv),e(V,Iv),m(t,l_,p),m(t,ne,p),e(ne,Uv),e(ne,xh),e(xh,Bv),e(ne,qv),e(ne,Mh),e(Mh,Dv),e(ne,Sv),e(ne,Eh),e(Eh,Pv),e(ne,Wv),e(ne,jh),e(jh,Vv),e(ne,Zv),m(t,d_,p),m(t,re,p),e(re,Gv),e(re,Fh),e(Fh,Cv),e(re,Nv),e(re,Lh),e(Lh,Xv),e(re,Rv),e(re,zh),e(zh,Ov),e(re,Av),e(re,Jh),e(Jh,Hv),e(re,Qv),m(t,p_,p),f(jn,t,p),m(t,m_,p),m(t,Qo,p),e(Qo,Yv),e(Qo,Ih),e(Ih,Kv),e(Qo,e1),m(t,h_,p),m(t,ae,p),e(ae,t1),e(ae,Uh),e(Uh,o1),e(ae,s1),e(ae,Bh),e(Bh,n1),e(ae,r1),e(ae,qh),e(qh,a1),e(ae,i1),e(ae,Dh),e(Dh,c1),e(ae,l1),m(t,g_,p),m(t,nl,p),e(nl,d1),m(t,u_,p),m(t,no,p),e(no,Yo),e(Yo,Sh),f(Fn,Sh,null),e(no,p1),e(no,Ph),e(Ph,m1),m(t,f_,p),m(t,ro,p),f(Ln,ro,null),e(ro,h1),e(ro,Wh),e(Wh,g1),m(t,__,p),m(t,ao,p),f(zn,ao,null),e(ao,u1),e(ao,Vh),e(Vh,f1),m(t,b_,p),m(t,io,p),f(Jn,io,null),e(io,_1),e(io,Zh),e(Zh,b1),m(t,y_,p),m(t,co,p),f(In,co,null),e(co,y1),e(co,Gh),e(Gh,T1),m(t,T_,p),m(t,lo,p),f(Un,lo,null),e(lo,v1),e(lo,Ch),e(Ch,w1),m(t,v_,p),m(t,po,p),f(Bn,po,null),e(po,$1),e(po,Nh),e(Nh,k1),m(t,w_,p),m(t,mo,p),f(qn,mo,null),e(mo,x1),e(mo,Xh),e(Xh,M1),m(t,$_,p),m(t,ho,p),f(Dn,ho,null),e(ho,E1),e(ho,Rh),e(Rh,j1),m(t,k_,p),m(t,go,p),f(Sn,go,null),e(go,F1),e(go,Oh),e(Oh,L1),m(t,x_,p),m(t,uo,p),f(Pn,uo,null),e(uo,z1),e(uo,Ah),e(Ah,J1),m(t,M_,p),m(t,fo,p),e(fo,Ko),e(Ko,Hh),f(Wn,Hh,null),e(fo,I1),e(fo,Qh),e(Qh,U1),m(t,E_,p),m(t,_o,p),f(Vn,_o,null),e(_o,B1),e(_o,Yh),e(Yh,q1),m(t,j_,p),m(t,bo,p),f(Zn,bo,null),e(bo,D1),e(bo,Kh),e(Kh,S1),m(t,F_,p),m(t,yo,p),f(Gn,yo,null),e(yo,P1),e(yo,eg),e(eg,W1),m(t,L_,p),m(t,To,p),f(Cn,To,null),e(To,V1),e(To,tg),e(tg,Z1),m(t,z_,p),m(t,vo,p),f(Nn,vo,null),e(vo,G1),e(vo,og),e(og,C1),m(t,J_,p),m(t,wo,p),f(Xn,wo,null),e(wo,N1),e(wo,sg),e(sg,X1),m(t,I_,p),m(t,$o,p),f(Rn,$o,null),e($o,R1),e($o,ng),e(ng,O1),m(t,U_,p),m(t,ko,p),f(On,ko,null),e(ko,A1),e(ko,rg),e(rg,H1),m(t,B_,p),m(t,xo,p),f(An,xo,null),e(xo,Q1),e(xo,ag),e(ag,Y1),m(t,q_,p),m(t,Mo,p),f(Hn,Mo,null),e(Mo,K1),e(Mo,ig),e(ig,e2),m(t,D_,p),m(t,Eo,p),e(Eo,es),e(es,cg),f(Qn,cg,null),e(Eo,t2),e(Eo,lg),e(lg,o2),m(t,S_,p),m(t,qe,p),f(Yn,qe,null),e(qe,s2),e(qe,dg),e(dg,n2),e(qe,r2),e(qe,ts),f(Kn,ts,null),e(ts,a2),e(ts,pg),e(pg,i2),m(t,P_,p),m(t,De,p),f(er,De,null),e(De,c2),e(De,mg),e(mg,l2),e(De,d2),e(De,os),f(tr,os,null),e(os,p2),e(os,hg),e(hg,m2),m(t,W_,p),m(t,Se,p),f(or,Se,null),e(Se,h2),e(Se,gg),e(gg,g2),e(Se,u2),e(Se,ss),f(sr,ss,null),e(ss,f2),e(ss,ug),e(ug,_2),m(t,V_,p),m(t,jo,p),e(jo,ns),e(ns,fg),f(nr,fg,null),e(jo,b2),e(jo,_g),e(_g,y2),m(t,Z_,p),m(t,rs,p),e(rs,T2),e(rs,rl),e(rl,v2),e(rs,w2),m(t,G_,p),m(t,Fo,p),e(Fo,as),e(as,bg),f(rr,bg,null),e(Fo,$2),e(Fo,yg),e(yg,k2),m(t,C_,p),m(t,Pe,p),f(ar,Pe,null),e(Pe,x2),e(Pe,is),e(is,al),e(al,M2),e(is,E2),e(is,Tg),e(Tg,j2),e(is,F2),e(Pe,L2),e(Pe,il),f(ir,il,null),m(t,N_,p),m(t,ge,p),f(cr,ge,null),e(ge,z2),e(ge,lr),e(lr,J2),e(lr,vg),e(vg,I2),e(lr,U2),e(ge,B2),e(ge,dr),e(dr,q2),e(dr,pr),e(pr,D2),e(dr,S2),e(ge,P2),e(ge,cl),f(mr,cl,null),m(t,X_,p),m(t,We,p),f(hr,We,null),e(We,W2),e(We,cs),e(cs,ll),e(ll,V2),e(cs,Z2),e(cs,gr),e(gr,G2),e(cs,C2),e(We,N2),e(We,dl),f(ur,dl,null),m(t,R_,p),m(t,Ve,p),f(fr,Ve,null),e(Ve,X2),e(Ve,pl),e(pl,ml),e(ml,R2),e(pl,O2),e(Ve,A2),e(Ve,hl),f(_r,hl,null),m(t,O_,p),m(t,ue,p),f(br,ue,null),e(ue,H2),e(ue,Wt),e(Wt,gl),e(gl,Q2),e(Wt,Y2),e(Wt,wg),e(wg,K2),e(Wt,ew),e(Wt,yr),e(yr,tw),e(Wt,ow),e(ue,sw),f(ls,ue,null),e(ue,nw),e(ue,ul),f(Tr,ul,null),m(t,A_,p),m(t,fe,p),f(vr,fe,null),e(fe,rw),e(fe,D),e(D,fl),e(fl,aw),e(D,iw),e(D,$g),e($g,cw),e(D,lw),e(D,kg),e(kg,dw),e(D,pw),e(D,xg),e(xg,mw),e(D,hw),e(D,wr),e(wr,gw),e(D,uw),e(D,Mg),e(Mg,fw),e(D,_w),e(D,Eg),e(Eg,bw),e(D,yw),e(D,jg),e(jg,Tw),e(D,vw),e(fe,ww),f(ds,fe,null),e(fe,$w),e(fe,_l),f($r,_l,null),m(t,H_,p),m(t,Ze,p),f(kr,Ze,null),e(Ze,kw),e(Ze,bl),e(bl,yl),e(yl,xw),e(bl,Mw),e(Ze,Ew),e(Ze,Tl),f(xr,Tl,null),m(t,Q_,p),m(t,Ge,p),f(Mr,Ge,null),e(Ge,jw),e(Ge,vl),e(vl,wl),e(wl,Fw),e(vl,Lw),e(Ge,zw),e(Ge,$l),f(Er,$l,null),m(t,Y_,p),m(t,Ce,p),f(jr,Ce,null),e(Ce,Jw),e(Ce,ps),e(ps,kl),e(kl,Iw),e(ps,Uw),e(ps,Fg),e(Fg,Bw),e(ps,qw),e(Ce,Dw),e(Ce,xl),f(Fr,xl,null),m(t,K_,p),m(t,Ne,p),f(Lr,Ne,null),e(Ne,Sw),e(Ne,zr),e(zr,Pw),e(zr,Lg),e(Lg,Ww),e(zr,Vw),e(Ne,Zw),e(Ne,Ml),f(Jr,Ml,null),m(t,eb,p),m(t,L,p),f(Ir,L,null),e(L,Gw),e(L,El),e(El,jl),e(jl,Cw),e(El,Nw),e(L,Xw),e(L,Lo),e(Lo,Rw),e(Lo,Fl),e(Fl,Ow),e(Lo,Aw),e(Lo,Ur),e(Ur,Hw),e(Lo,Qw),e(L,Yw),f(ms,L,null),e(L,Kw),f(hs,L,null),e(L,e$),e(L,Br),e(Br,t$),e(Br,zg),e(zg,o$),e(Br,s$),e(L,n$),e(L,Jg),e(Jg,r$),e(L,a$),e(L,zo),e(zo,Ll),e(Ll,Ig),e(Ig,i$),e(Ll,c$),e(zo,l$),e(zo,zl),e(zl,Ug),e(Ug,d$),e(zl,p$),e(zo,m$),e(zo,Jl),e(Jl,Bg),e(Bg,h$),e(Jl,g$),e(L,u$),e(L,qg),e(qg,f$),e(L,_$),e(L,qr),e(qr,Il),e(Il,Dg),e(Dg,b$),e(Il,y$),e(qr,T$),e(qr,Ul),e(Ul,Sg),e(Sg,v$),e(Ul,w$),e(L,$$),f(gs,L,null),e(L,k$),e(L,Bl),f(Dr,Bl,null),m(t,tb,p),m(t,Xe,p),f(Sr,Xe,null),e(Xe,x$),e(Xe,Vt),e(Vt,ql),e(ql,M$),e(Vt,E$),e(Vt,Pg),e(Pg,j$),e(Vt,F$),e(Vt,Wg),e(Wg,L$),e(Vt,z$),e(Xe,J$),e(Xe,Dl),f(Pr,Dl,null),m(t,ob,p),m(t,Re,p),f(Wr,Re,null),e(Re,I$),e(Re,us),e(us,Sl),e(Sl,U$),e(us,B$),e(us,Pl),e(Pl,q$),e(us,D$),e(Re,S$),e(Re,Wl),f(Vr,Wl,null),m(t,sb,p),m(t,Oe,p),f(Zr,Oe,null),e(Oe,P$),e(Oe,Vg),e(Vg,W$),e(Oe,V$),e(Oe,Vl),f(Gr,Vl,null),m(t,nb,p),m(t,Ae,p),f(Cr,Ae,null),e(Ae,Z$),e(Ae,G),e(G,G$),e(G,Zl),e(Zl,C$),e(G,N$),e(G,Gl),e(Gl,X$),e(G,R$),e(G,Zg),e(Zg,O$),e(G,A$),e(G,Gg),e(Gg,Cg),e(Cg,H$),e(G,Q$),e(G,Cl),e(Cl,Y$),e(G,K$),e(G,Nl),e(Nl,ek),e(G,tk),e(Ae,ok),e(Ae,Xl),f(Nr,Xl,null),m(t,rb,p),m(t,He,p),f(Xr,He,null),e(He,sk),e(He,Ng),e(Ng,nk),e(He,rk),e(He,Rl),f(Rr,Rl,null),m(t,ab,p),m(t,Qe,p),f(Or,Qe,null),e(Qe,ak),e(Qe,Ol),e(Ol,Al),e(Al,ik),e(Ol,ck),e(Qe,lk),e(Qe,Hl),f(Ar,Hl,null),m(t,ib,p),m(t,_e,p),f(Hr,_e,null),e(_e,dk),e(_e,je),e(je,Ql),e(Ql,pk),e(je,mk),e(je,Xg),e(Xg,hk),e(je,gk),e(je,Rg),e(Rg,uk),e(je,fk),e(je,Og),e(Og,_k),e(je,bk),e(_e,yk),f(fs,_e,null),e(_e,Tk),e(_e,Yl),f(Qr,Yl,null),m(t,cb,p),m(t,H,p),f(Yr,H,null),e(H,vk),e(H,Kl),e(Kl,ed),e(ed,wk),e(Kl,$k),e(H,kk),f(_s,H,null),e(H,xk),f(bs,H,null),e(H,Mk),e(H,td),f(Kr,td,null),m(t,lb,p),m(t,Q,p),f(ea,Q,null),e(Q,Ek),e(Q,Jo),e(Jo,jk),e(Jo,od),e(od,Fk),e(Jo,Lk),e(Jo,ta),e(ta,zk),e(Jo,Jk),e(Q,Ik),f(ys,Q,null),e(Q,Uk),f(Ts,Q,null),e(Q,Bk),e(Q,sd),f(oa,sd,null),m(t,db,p),m(t,Ye,p),f(sa,Ye,null),e(Ye,qk),e(Ye,vs),e(vs,nd),e(nd,Dk),e(vs,Sk),e(vs,na),e(na,Pk),e(vs,Wk),e(Ye,Vk),e(Ye,rd),f(ra,rd,null),m(t,pb,p),m(t,be,p),f(aa,be,null),e(be,Zk),e(be,ws),e(ws,ad),e(ad,Gk),e(ws,Ck),e(ws,ia),e(ia,Nk),e(ws,Xk),e(be,Rk),f($s,be,null),e(be,Ok),e(be,id),f(ca,id,null),m(t,mb,p),m(t,Y,p),f(la,Y,null),e(Y,Ak),e(Y,cd),e(cd,ld),e(ld,Hk),e(cd,Qk),e(Y,Yk),f(ks,Y,null),e(Y,Kk),f(xs,Y,null),e(Y,e0),e(Y,dd),f(da,dd,null),m(t,hb,p),m(t,Ke,p),f(pa,Ke,null),e(Ke,t0),e(Ke,Fe),e(Fe,pd),e(pd,o0),e(Fe,s0),e(Fe,Ag),e(Ag,n0),e(Fe,r0),e(Fe,Hg),e(Hg,a0),e(Fe,i0),e(Fe,Qg),e(Qg,c0),e(Fe,l0),e(Ke,d0),e(Ke,md),f(ma,md,null),m(t,gb,p),m(t,et,p),f(ha,et,null),e(et,p0),e(et,ga),e(ga,m0),e(ga,Yg),e(Yg,h0),e(ga,g0),e(et,u0),e(et,hd),f(ua,hd,null),m(t,ub,p),m(t,K,p),f(fa,K,null),e(K,f0),e(K,gd),e(gd,ud),e(ud,_0),e(gd,b0),e(K,y0),f(Ms,K,null),e(K,T0),f(Es,K,null),e(K,v0),e(K,fd),f(_a,fd,null),m(t,fb,p),m(t,tt,p),f(ba,tt,null),e(tt,w0),e(tt,_d),e(_d,bd),e(bd,$0),e(_d,k0),e(tt,x0),e(tt,yd),f(ya,yd,null),m(t,_b,p),m(t,ye,p),f(Ta,ye,null),e(ye,M0),e(ye,Td),e(Td,vd),e(vd,E0),e(Td,j0),e(ye,F0),f(js,ye,null),e(ye,L0),e(ye,wd),f(va,wd,null),m(t,bb,p),m(t,ot,p),f(wa,ot,null),e(ot,z0),e(ot,Fs),e(Fs,$d),e($d,J0),e(Fs,I0),e(Fs,$a),e($a,U0),e(Fs,B0),e(ot,q0),e(ot,kd),f(ka,kd,null),m(t,yb,p),m(t,ee,p),f(xa,ee,null),e(ee,D0),e(ee,st),e(st,S0),e(st,Kg),e(Kg,P0),e(st,W0),e(st,eu),e(eu,V0),e(st,Z0),e(st,tu),e(tu,G0),e(st,C0),e(ee,N0),e(ee,Ma),e(Ma,X0),e(Ma,Ea),e(Ea,R0),e(Ma,O0),e(ee,A0),f(Ls,ee,null),e(ee,H0),e(ee,xd),f(ja,xd,null),m(t,Tb,p),m(t,Te,p),f(Fa,Te,null),e(Te,Q0),e(Te,La),e(La,Y0),e(La,ou),e(ou,K0),e(La,ex),e(Te,tx),e(Te,za),e(za,ox),e(za,Ja),e(Ja,sx),e(za,nx),e(Te,rx),e(Te,Md),f(Ia,Md,null),m(t,vb,p),m(t,Io,p),e(Io,zs),e(zs,su),f(Ua,su,null),e(Io,ax),e(Io,nu),e(nu,ix),m(t,wb,p),m(t,nt,p),f(Ba,nt,null),e(nt,cx),e(nt,Ed),e(Ed,jd),e(jd,lx),e(Ed,dx),e(nt,px),e(nt,Fd),f(qa,Fd,null),m(t,$b,p),m(t,rt,p),f(Da,rt,null),e(rt,mx),e(rt,Js),e(Js,Ld),e(Ld,hx),e(Js,gx),e(Js,ru),e(ru,ux),e(Js,fx),e(rt,_x),e(rt,zd),f(Sa,zd,null),m(t,kb,p),m(t,at,p),f(Pa,at,null),e(at,bx),e(at,Uo),e(Uo,yx),e(Uo,au),e(au,Tx),e(Uo,vx),e(Uo,iu),e(iu,wx),e(Uo,$x),e(at,kx),e(at,Jd),f(Wa,Jd,null),m(t,xb,p),m(t,it,p),f(Va,it,null),e(it,xx),e(it,cu),e(cu,Mx),e(it,Ex),e(it,Is),f(Za,Is,null),e(Is,jx),e(Is,lu),e(lu,Fx),m(t,Mb,p),m(t,ct,p),f(Ga,ct,null),e(ct,Lx),e(ct,ve),e(ve,zx),e(ve,Id),e(Id,Jx),e(ve,Ix),e(ve,du),e(du,Ux),e(ve,Bx),e(ve,pu),e(pu,mu),e(mu,qx),e(ve,Dx),e(ve,Ud),e(Ud,Sx),e(ve,Px),e(ct,Wx),e(ct,Bd),f(Ca,Bd,null),m(t,Eb,p),m(t,lt,p),f(Na,lt,null),e(lt,Vx),e(lt,hu),e(hu,Zx),e(lt,Gx),e(lt,Us),f(Xa,Us,null),e(Us,Cx),e(Us,gu),e(gu,Nx),m(t,jb,p),m(t,dt,p),f(Ra,dt,null),e(dt,Xx),e(dt,qd),e(qd,Dd),e(Dd,Rx),e(qd,Ox),e(dt,Ax),e(dt,Sd),f(Oa,Sd,null),m(t,Fb,p),m(t,pt,p),f(Aa,pt,null),e(pt,Hx),e(pt,Pd),e(Pd,Wd),e(Wd,Qx),e(Pd,Yx),e(pt,Kx),e(pt,Vd),f(Ha,Vd,null),m(t,Lb,p),m(t,mt,p),f(Qa,mt,null),e(mt,eM),e(mt,Bs),e(Bs,Zd),e(Zd,tM),e(Bs,oM),e(Bs,Ya),e(Ya,sM),e(Bs,nM),e(mt,rM),e(mt,Gd),f(Ka,Gd,null),m(t,zb,p),m(t,ht,p),f(ei,ht,null),e(ht,aM),e(ht,Cd),e(Cd,Nd),e(Nd,iM),e(Cd,cM),e(ht,lM),e(ht,Xd),f(ti,Xd,null),m(t,Jb,p),m(t,gt,p),f(oi,gt,null),e(gt,dM),e(gt,Le),e(Le,Rd),e(Rd,pM),e(Le,mM),e(Le,uu),e(uu,hM),e(Le,gM),e(Le,fu),e(fu,uM),e(Le,fM),e(Le,_u),e(_u,_M),e(Le,bM),e(gt,yM),e(gt,Od),f(si,Od,null),m(t,Ib,p),m(t,ut,p),f(ni,ut,null),e(ut,TM),e(ut,ri),e(ri,vM),e(ri,bu),e(bu,wM),e(ri,$M),e(ut,kM),e(ut,Ad),f(ai,Ad,null),m(t,Ub,p),m(t,ft,p),f(ii,ft,null),e(ft,xM),e(ft,Hd),e(Hd,Qd),e(Qd,MM),e(Hd,EM),e(ft,jM),e(ft,Yd),f(ci,Yd,null),m(t,Bb,p),m(t,_t,p),f(li,_t,null),e(_t,FM),e(_t,Kd),e(Kd,ep),e(ep,LM),e(Kd,zM),e(_t,JM),e(_t,tp),f(di,tp,null),m(t,qb,p),m(t,bt,p),f(pi,bt,null),e(bt,IM),e(bt,op),e(op,sp),e(sp,UM),e(op,BM),e(bt,qM),e(bt,np),f(mi,np,null),m(t,Db,p),m(t,Bo,p),e(Bo,qs),e(qs,yu),f(hi,yu,null),e(Bo,DM),e(Bo,Tu),e(Tu,SM),m(t,Sb,p),m(t,yt,p),f(gi,yt,null),e(yt,PM),e(yt,rp),e(rp,ap),e(ap,WM),e(rp,VM),e(yt,ZM),e(yt,ip),f(ui,ip,null),m(t,Pb,p),m(t,Tt,p),f(fi,Tt,null),e(Tt,GM),e(Tt,Ds),e(Ds,cp),e(cp,CM),e(Ds,NM),e(Ds,vu),e(vu,XM),e(Ds,RM),e(Tt,OM),e(Tt,lp),f(_i,lp,null),m(t,Wb,p),m(t,vt,p),f(bi,vt,null),e(vt,AM),e(vt,Ss),e(Ss,dp),e(dp,HM),e(Ss,QM),e(Ss,wu),e(wu,YM),e(Ss,KM),e(vt,e4),e(vt,pp),f(yi,pp,null),m(t,Vb,p),m(t,wt,p),f(Ti,wt,null),e(wt,t4),e(wt,$u),e($u,o4),e(wt,s4),e(wt,Ps),f(vi,Ps,null),e(Ps,n4),e(Ps,ku),e(ku,r4),m(t,Zb,p),m(t,$t,p),f(wi,$t,null),e($t,a4),e($t,C),e(C,i4),e(C,mp),e(mp,c4),e(C,l4),e(C,hp),e(hp,d4),e(C,p4),e(C,xu),e(xu,m4),e(C,h4),e(C,Mu),e(Mu,Eu),e(Eu,g4),e(C,u4),e(C,gp),e(gp,f4),e(C,_4),e(C,up),e(up,b4),e(C,y4),e($t,T4),e($t,fp),f($i,fp,null),m(t,Gb,p),m(t,kt,p),f(ki,kt,null),e(kt,v4),e(kt,ju),e(ju,w4),e(kt,$4),e(kt,Ws),f(xi,Ws,null),e(Ws,k4),e(Ws,Fu),e(Fu,x4),m(t,Cb,p),m(t,xt,p),f(Mi,xt,null),e(xt,M4),e(xt,_p),e(_p,bp),e(bp,E4),e(_p,j4),e(xt,F4),e(xt,yp),f(Ei,yp,null),m(t,Nb,p),m(t,Mt,p),f(ji,Mt,null),e(Mt,L4),e(Mt,ze),e(ze,Tp),e(Tp,z4),e(ze,J4),e(ze,Lu),e(Lu,I4),e(ze,U4),e(ze,zu),e(zu,B4),e(ze,q4),e(ze,Ju),e(Ju,D4),e(ze,S4),e(Mt,P4),e(Mt,vp),f(Fi,vp,null),m(t,Xb,p),m(t,Et,p),f(Li,Et,null),e(Et,W4),e(Et,Vs),e(Vs,wp),e(wp,V4),e(Vs,Z4),e(Vs,Iu),e(Iu,G4),e(Vs,C4),e(Et,N4),e(Et,$p),f(zi,$p,null),m(t,Rb,p),m(t,jt,p),f(Ji,jt,null),e(jt,X4),e(jt,kp),e(kp,xp),e(xp,R4),e(kp,O4),e(jt,A4),e(jt,Mp),f(Ii,Mp,null),m(t,Ob,p),m(t,Ft,p),f(Ui,Ft,null),e(Ft,H4),e(Ft,Ep),e(Ep,jp),e(jp,Q4),e(Ep,Y4),e(Ft,K4),e(Ft,Fp),f(Bi,Fp,null),m(t,Ab,p),m(t,Lt,p),f(qi,Lt,null),e(Lt,eE),e(Lt,Lp),e(Lp,zp),e(zp,tE),e(Lp,oE),e(Lt,sE),e(Lt,Jp),f(Di,Jp,null),m(t,Hb,p),m(t,zt,p),f(Si,zt,null),e(zt,nE),e(zt,Pi),e(Pi,rE),e(Pi,Uu),e(Uu,aE),e(Pi,iE),e(zt,cE),e(zt,Ip),f(Wi,Ip,null),m(t,Qb,p),m(t,qo,p),e(qo,Zs),e(Zs,Bu),f(Vi,Bu,null),e(qo,lE),e(qo,qu),e(qu,dE),m(t,Yb,p),m(t,Gs,p),e(Gs,pE),e(Gs,Up),e(Up,mE),e(Gs,hE),m(t,Kb,p),m(t,Jt,p),f(Zi,Jt,null),e(Jt,gE),e(Jt,Du),e(Du,uE),e(Jt,fE),e(Jt,Bp),f(Gi,Bp,null),m(t,ey,p),m(t,Do,p),f(Ci,Do,null),e(Do,_E),e(Do,qp),f(Ni,qp,null),m(t,ty,p),m(t,It,p),f(Xi,It,null),e(It,bE),e(It,Ri),e(Ri,yE),e(Ri,Su),e(Su,TE),e(Ri,vE),e(It,wE),e(It,Dp),f(Oi,Dp,null),m(t,oy,p),m(t,Ut,p),f(Ai,Ut,null),e(Ut,$E),e(Ut,Hi),e(Hi,kE),e(Hi,Pu),e(Pu,xE),e(Hi,ME),e(Ut,EE),e(Ut,Sp),f(Qi,Sp,null),m(t,sy,p),m(t,So,p),e(So,Cs),e(Cs,Wu),f(Yi,Wu,null),e(So,jE),e(So,Vu),e(Vu,FE),m(t,ny,p),m(t,Ns,p),e(Ns,LE),e(Ns,Pp),e(Pp,zE),e(Ns,JE),m(t,ry,p),m(t,z,p),f(Ki,z,null),e(z,IE),e(z,Zu),e(Zu,UE),e(z,BE),e(z,Gu),e(Gu,qE),e(z,DE),f(Xs,z,null),e(z,SE),e(z,Cu),e(Cu,PE),e(z,WE),e(z,Rs),f(ec,Rs,null),e(Rs,VE),e(Rs,Nu),e(Nu,ZE),e(z,GE),e(z,Os),f(tc,Os,null),e(Os,CE),e(Os,Xu),e(Xu,NE),e(z,XE),e(z,As),f(oc,As,null),e(As,RE),e(As,Ru),e(Ru,OE),e(z,AE),e(z,Hs),f(sc,Hs,null),e(Hs,HE),e(Hs,nc),e(nc,QE),e(nc,Ou),e(Ou,YE),e(nc,KE),e(z,ej),e(z,Qs),f(rc,Qs,null),e(Qs,tj),e(Qs,Au),e(Au,oj),e(z,sj),e(z,Ys),f(ac,Ys,null),e(Ys,nj),e(Ys,Hu),e(Hu,rj),e(z,aj),e(z,Zt),f(ic,Zt,null),e(Zt,ij),e(Zt,cc),e(cc,cj),e(cc,Qu),e(Qu,lj),e(cc,dj),e(Zt,pj),e(Zt,Yu),e(Yu,mj),m(t,ay,p),m(t,Po,p),f(lc,Po,null),e(Po,hj),e(Po,Wp),e(Wp,Vp),e(Vp,gj),e(Wp,uj),m(t,iy,p),m(t,Wo,p),f(dc,Wo,null),e(Wo,fj),e(Wo,pc),e(pc,_j),e(pc,Zp),e(Zp,bj),e(pc,yj),m(t,cy,p),m(t,we,p),f(mc,we,null),e(we,Tj),e(we,Ku),e(Ku,vj),e(we,wj),e(we,R),f(hc,R,null),e(R,$j),e(R,ef),e(ef,kj),e(R,xj),e(R,Vo),e(Vo,Mj),e(Vo,tf),e(tf,Ej),e(Vo,jj),e(Vo,of),e(of,Fj),e(Vo,Lj),e(R,zj),e(R,sf),e(sf,nf),e(nf,Jj),e(R,Ij),e(R,Bt),e(Bt,Uj),e(Bt,rf),e(rf,Bj),e(Bt,qj),e(Bt,af),e(af,Dj),e(Bt,Sj),e(Bt,cf),e(cf,Pj),e(Bt,Wj),e(R,Vj),e(R,lf),e(lf,Zj),e(we,Gj),e(we,Ks),f(gc,Ks,null),e(Ks,Cj),e(Ks,df),e(df,Nj),m(t,ly,p),m(t,Zo,p),e(Zo,en),e(en,pf),f(uc,pf,null),e(Zo,Xj),e(Zo,mf),e(mf,Rj),m(t,dy,p),m(t,$e,p),f(fc,$e,null),e($e,Oj),e($e,Go),e(Go,Aj),e(Go,Gp),e(Gp,Hj),e(Go,Qj),e(Go,Cp),e(Cp,Yj),e(Go,Kj),e($e,eF),e($e,Np),f(_c,Np,null),e($e,tF),e($e,Xp),f(bc,Xp,null),m(t,py,p),m(t,N,p),f(yc,N,null),e(N,oF),e(N,Rp),e(Rp,Op),e(Op,sF),e(Rp,nF),e(N,rF),e(N,Tc),e(Tc,aF),e(Tc,vc),e(vc,iF),e(Tc,cF),e(N,lF),e(N,Ap),e(Ap,dF),e(Ap,wc),e(wc,pF),e(N,mF),e(N,Hp),f($c,Hp,null),e(N,hF),e(N,Qp),f(kc,Qp,null),m(t,my,p),m(t,ke,p),f(xc,ke,null),e(ke,gF),e(ke,Yp),e(Yp,Kp),e(Kp,uF),e(Yp,fF),e(ke,_F),e(ke,em),f(Mc,em,null),e(ke,bF),e(ke,tm),f(Ec,tm,null),m(t,hy,p),m(t,Co,p),e(Co,tn),e(tn,hf),f(jc,hf,null),e(Co,yF),e(Co,gf),e(gf,TF),m(t,gy,p),m(t,qt,p),f(Fc,qt,null),e(qt,vF),e(qt,uf),e(uf,wF),e(qt,$F),e(qt,om),e(om,kF),e(om,Lc),e(Lc,xF),m(t,uy,p),m(t,Dt,p),f(zc,Dt,null),e(Dt,MF),e(Dt,ff),e(ff,EF),e(Dt,jF),e(Dt,sm),e(sm,FF),e(sm,Jc),e(Jc,LF),m(t,fy,p),m(t,No,p),e(No,on),e(on,_f),f(Ic,_f,null),e(No,zF),e(No,bf),e(bf,JF),m(t,_y,p),m(t,P,p),f(Uc,P,null),e(P,IF),e(P,yf),e(yf,UF),e(P,BF),f(sn,P,null),e(P,qF),f(nn,P,null),e(P,DF),e(P,rn),f(Bc,rn,null),e(rn,SF),e(rn,Tf),e(Tf,PF),e(P,WF),e(P,an),f(qc,an,null),e(an,VF),e(an,vf),e(vf,ZF),e(P,GF),e(P,cn),f(Dc,cn,null),e(cn,CF),e(cn,wf),e(wf,NF),m(t,by,p),m(t,te,p),f(Sc,te,null),e(te,XF),e(te,$f),e($f,RF),e(te,OF),f(ln,te,null),e(te,AF),f(dn,te,null),e(te,HF),e(te,pn),f(Pc,pn,null),e(pn,QF),e(pn,kf),e(kf,YF),yy=!0},p(t,[p]){const Wc={};p&2&&(Wc.$$scope={dirty:p,ctx:t}),ls.$set(Wc);const xf={};p&2&&(xf.$$scope={dirty:p,ctx:t}),ds.$set(xf);const Mf={};p&2&&(Mf.$$scope={dirty:p,ctx:t}),ms.$set(Mf);const Ef={};p&2&&(Ef.$$scope={dirty:p,ctx:t}),hs.$set(Ef);const q={};p&2&&(q.$$scope={dirty:p,ctx:t}),gs.$set(q);const jf={};p&2&&(jf.$$scope={dirty:p,ctx:t}),fs.$set(jf);const Ff={};p&2&&(Ff.$$scope={dirty:p,ctx:t}),_s.$set(Ff);const Lf={};p&2&&(Lf.$$scope={dirty:p,ctx:t}),bs.$set(Lf);const zf={};p&2&&(zf.$$scope={dirty:p,ctx:t}),ys.$set(zf);const Jf={};p&2&&(Jf.$$scope={dirty:p,ctx:t}),Ts.$set(Jf);const If={};p&2&&(If.$$scope={dirty:p,ctx:t}),$s.$set(If);const Uf={};p&2&&(Uf.$$scope={dirty:p,ctx:t}),ks.$set(Uf);const Bf={};p&2&&(Bf.$$scope={dirty:p,ctx:t}),xs.$set(Bf);const qf={};p&2&&(qf.$$scope={dirty:p,ctx:t}),Ms.$set(qf);const Vc={};p&2&&(Vc.$$scope={dirty:p,ctx:t}),Es.$set(Vc);const Df={};p&2&&(Df.$$scope={dirty:p,ctx:t}),js.$set(Df);const Sf={};p&2&&(Sf.$$scope={dirty:p,ctx:t}),Ls.$set(Sf);const Pf={};p&2&&(Pf.$$scope={dirty:p,ctx:t}),Xs.$set(Pf);const St={};p&2&&(St.$$scope={dirty:p,ctx:t}),sn.$set(St);const Wf={};p&2&&(Wf.$$scope={dirty:p,ctx:t}),nn.$set(Wf);const Vf={};p&2&&(Vf.$$scope={dirty:p,ctx:t}),ln.$set(Vf);const Zf={};p&2&&(Zf.$$scope={dirty:p,ctx:t}),dn.$set(Zf)},i(t){yy||(_(h.$$.fragment,t),_(Mn.$$.fragment,t),_(En.$$.fragment,t),_(jn.$$.fragment,t),_(Fn.$$.fragment,t),_(Ln.$$.fragment,t),_(zn.$$.fragment,t),_(Jn.$$.fragment,t),_(In.$$.fragment,t),_(Un.$$.fragment,t),_(Bn.$$.fragment,t),_(qn.$$.fragment,t),_(Dn.$$.fragment,t),_(Sn.$$.fragment,t),_(Pn.$$.fragment,t),_(Wn.$$.fragment,t),_(Vn.$$.fragment,t),_(Zn.$$.fragment,t),_(Gn.$$.fragment,t),_(Cn.$$.fragment,t),_(Nn.$$.fragment,t),_(Xn.$$.fragment,t),_(Rn.$$.fragment,t),_(On.$$.fragment,t),_(An.$$.fragment,t),_(Hn.$$.fragment,t),_(Qn.$$.fragment,t),_(Yn.$$.fragment,t),_(Kn.$$.fragment,t),_(er.$$.fragment,t),_(tr.$$.fragment,t),_(or.$$.fragment,t),_(sr.$$.fragment,t),_(nr.$$.fragment,t),_(rr.$$.fragment,t),_(ar.$$.fragment,t),_(ir.$$.fragment,t),_(cr.$$.fragment,t),_(mr.$$.fragment,t),_(hr.$$.fragment,t),_(ur.$$.fragment,t),_(fr.$$.fragment,t),_(_r.$$.fragment,t),_(br.$$.fragment,t),_(ls.$$.fragment,t),_(Tr.$$.fragment,t),_(vr.$$.fragment,t),_(ds.$$.fragment,t),_($r.$$.fragment,t),_(kr.$$.fragment,t),_(xr.$$.fragment,t),_(Mr.$$.fragment,t),_(Er.$$.fragment,t),_(jr.$$.fragment,t),_(Fr.$$.fragment,t),_(Lr.$$.fragment,t),_(Jr.$$.fragment,t),_(Ir.$$.fragment,t),_(ms.$$.fragment,t),_(hs.$$.fragment,t),_(gs.$$.fragment,t),_(Dr.$$.fragment,t),_(Sr.$$.fragment,t),_(Pr.$$.fragment,t),_(Wr.$$.fragment,t),_(Vr.$$.fragment,t),_(Zr.$$.fragment,t),_(Gr.$$.fragment,t),_(Cr.$$.fragment,t),_(Nr.$$.fragment,t),_(Xr.$$.fragment,t),_(Rr.$$.fragment,t),_(Or.$$.fragment,t),_(Ar.$$.fragment,t),_(Hr.$$.fragment,t),_(fs.$$.fragment,t),_(Qr.$$.fragment,t),_(Yr.$$.fragment,t),_(_s.$$.fragment,t),_(bs.$$.fragment,t),_(Kr.$$.fragment,t),_(ea.$$.fragment,t),_(ys.$$.fragment,t),_(Ts.$$.fragment,t),_(oa.$$.fragment,t),_(sa.$$.fragment,t),_(ra.$$.fragment,t),_(aa.$$.fragment,t),_($s.$$.fragment,t),_(ca.$$.fragment,t),_(la.$$.fragment,t),_(ks.$$.fragment,t),_(xs.$$.fragment,t),_(da.$$.fragment,t),_(pa.$$.fragment,t),_(ma.$$.fragment,t),_(ha.$$.fragment,t),_(ua.$$.fragment,t),_(fa.$$.fragment,t),_(Ms.$$.fragment,t),_(Es.$$.fragment,t),_(_a.$$.fragment,t),_(ba.$$.fragment,t),_(ya.$$.fragment,t),_(Ta.$$.fragment,t),_(js.$$.fragment,t),_(va.$$.fragment,t),_(wa.$$.fragment,t),_(ka.$$.fragment,t),_(xa.$$.fragment,t),_(Ls.$$.fragment,t),_(ja.$$.fragment,t),_(Fa.$$.fragment,t),_(Ia.$$.fragment,t),_(Ua.$$.fragment,t),_(Ba.$$.fragment,t),_(qa.$$.fragment,t),_(Da.$$.fragment,t),_(Sa.$$.fragment,t),_(Pa.$$.fragment,t),_(Wa.$$.fragment,t),_(Va.$$.fragment,t),_(Za.$$.fragment,t),_(Ga.$$.fragment,t),_(Ca.$$.fragment,t),_(Na.$$.fragment,t),_(Xa.$$.fragment,t),_(Ra.$$.fragment,t),_(Oa.$$.fragment,t),_(Aa.$$.fragment,t),_(Ha.$$.fragment,t),_(Qa.$$.fragment,t),_(Ka.$$.fragment,t),_(ei.$$.fragment,t),_(ti.$$.fragment,t),_(oi.$$.fragment,t),_(si.$$.fragment,t),_(ni.$$.fragment,t),_(ai.$$.fragment,t),_(ii.$$.fragment,t),_(ci.$$.fragment,t),_(li.$$.fragment,t),_(di.$$.fragment,t),_(pi.$$.fragment,t),_(mi.$$.fragment,t),_(hi.$$.fragment,t),_(gi.$$.fragment,t),_(ui.$$.fragment,t),_(fi.$$.fragment,t),_(_i.$$.fragment,t),_(bi.$$.fragment,t),_(yi.$$.fragment,t),_(Ti.$$.fragment,t),_(vi.$$.fragment,t),_(wi.$$.fragment,t),_($i.$$.fragment,t),_(ki.$$.fragment,t),_(xi.$$.fragment,t),_(Mi.$$.fragment,t),_(Ei.$$.fragment,t),_(ji.$$.fragment,t),_(Fi.$$.fragment,t),_(Li.$$.fragment,t),_(zi.$$.fragment,t),_(Ji.$$.fragment,t),_(Ii.$$.fragment,t),_(Ui.$$.fragment,t),_(Bi.$$.fragment,t),_(qi.$$.fragment,t),_(Di.$$.fragment,t),_(Si.$$.fragment,t),_(Wi.$$.fragment,t),_(Vi.$$.fragment,t),_(Zi.$$.fragment,t),_(Gi.$$.fragment,t),_(Ci.$$.fragment,t),_(Ni.$$.fragment,t),_(Xi.$$.fragment,t),_(Oi.$$.fragment,t),_(Ai.$$.fragment,t),_(Qi.$$.fragment,t),_(Yi.$$.fragment,t),_(Ki.$$.fragment,t),_(Xs.$$.fragment,t),_(ec.$$.fragment,t),_(tc.$$.fragment,t),_(oc.$$.fragment,t),_(sc.$$.fragment,t),_(rc.$$.fragment,t),_(ac.$$.fragment,t),_(ic.$$.fragment,t),_(lc.$$.fragment,t),_(dc.$$.fragment,t),_(mc.$$.fragment,t),_(hc.$$.fragment,t),_(gc.$$.fragment,t),_(uc.$$.fragment,t),_(fc.$$.fragment,t),_(_c.$$.fragment,t),_(bc.$$.fragment,t),_(yc.$$.fragment,t),_($c.$$.fragment,t),_(kc.$$.fragment,t),_(xc.$$.fragment,t),_(Mc.$$.fragment,t),_(Ec.$$.fragment,t),_(jc.$$.fragment,t),_(Fc.$$.fragment,t),_(zc.$$.fragment,t),_(Ic.$$.fragment,t),_(Uc.$$.fragment,t),_(sn.$$.fragment,t),_(nn.$$.fragment,t),_(Bc.$$.fragment,t),_(qc.$$.fragment,t),_(Dc.$$.fragment,t),_(Sc.$$.fragment,t),_(ln.$$.fragment,t),_(dn.$$.fragment,t),_(Pc.$$.fragment,t),yy=!0)},o(t){b(h.$$.fragment,t),b(Mn.$$.fragment,t),b(En.$$.fragment,t),b(jn.$$.fragment,t),b(Fn.$$.fragment,t),b(Ln.$$.fragment,t),b(zn.$$.fragment,t),b(Jn.$$.fragment,t),b(In.$$.fragment,t),b(Un.$$.fragment,t),b(Bn.$$.fragment,t),b(qn.$$.fragment,t),b(Dn.$$.fragment,t),b(Sn.$$.fragment,t),b(Pn.$$.fragment,t),b(Wn.$$.fragment,t),b(Vn.$$.fragment,t),b(Zn.$$.fragment,t),b(Gn.$$.fragment,t),b(Cn.$$.fragment,t),b(Nn.$$.fragment,t),b(Xn.$$.fragment,t),b(Rn.$$.fragment,t),b(On.$$.fragment,t),b(An.$$.fragment,t),b(Hn.$$.fragment,t),b(Qn.$$.fragment,t),b(Yn.$$.fragment,t),b(Kn.$$.fragment,t),b(er.$$.fragment,t),b(tr.$$.fragment,t),b(or.$$.fragment,t),b(sr.$$.fragment,t),b(nr.$$.fragment,t),b(rr.$$.fragment,t),b(ar.$$.fragment,t),b(ir.$$.fragment,t),b(cr.$$.fragment,t),b(mr.$$.fragment,t),b(hr.$$.fragment,t),b(ur.$$.fragment,t),b(fr.$$.fragment,t),b(_r.$$.fragment,t),b(br.$$.fragment,t),b(ls.$$.fragment,t),b(Tr.$$.fragment,t),b(vr.$$.fragment,t),b(ds.$$.fragment,t),b($r.$$.fragment,t),b(kr.$$.fragment,t),b(xr.$$.fragment,t),b(Mr.$$.fragment,t),b(Er.$$.fragment,t),b(jr.$$.fragment,t),b(Fr.$$.fragment,t),b(Lr.$$.fragment,t),b(Jr.$$.fragment,t),b(Ir.$$.fragment,t),b(ms.$$.fragment,t),b(hs.$$.fragment,t),b(gs.$$.fragment,t),b(Dr.$$.fragment,t),b(Sr.$$.fragment,t),b(Pr.$$.fragment,t),b(Wr.$$.fragment,t),b(Vr.$$.fragment,t),b(Zr.$$.fragment,t),b(Gr.$$.fragment,t),b(Cr.$$.fragment,t),b(Nr.$$.fragment,t),b(Xr.$$.fragment,t),b(Rr.$$.fragment,t),b(Or.$$.fragment,t),b(Ar.$$.fragment,t),b(Hr.$$.fragment,t),b(fs.$$.fragment,t),b(Qr.$$.fragment,t),b(Yr.$$.fragment,t),b(_s.$$.fragment,t),b(bs.$$.fragment,t),b(Kr.$$.fragment,t),b(ea.$$.fragment,t),b(ys.$$.fragment,t),b(Ts.$$.fragment,t),b(oa.$$.fragment,t),b(sa.$$.fragment,t),b(ra.$$.fragment,t),b(aa.$$.fragment,t),b($s.$$.fragment,t),b(ca.$$.fragment,t),b(la.$$.fragment,t),b(ks.$$.fragment,t),b(xs.$$.fragment,t),b(da.$$.fragment,t),b(pa.$$.fragment,t),b(ma.$$.fragment,t),b(ha.$$.fragment,t),b(ua.$$.fragment,t),b(fa.$$.fragment,t),b(Ms.$$.fragment,t),b(Es.$$.fragment,t),b(_a.$$.fragment,t),b(ba.$$.fragment,t),b(ya.$$.fragment,t),b(Ta.$$.fragment,t),b(js.$$.fragment,t),b(va.$$.fragment,t),b(wa.$$.fragment,t),b(ka.$$.fragment,t),b(xa.$$.fragment,t),b(Ls.$$.fragment,t),b(ja.$$.fragment,t),b(Fa.$$.fragment,t),b(Ia.$$.fragment,t),b(Ua.$$.fragment,t),b(Ba.$$.fragment,t),b(qa.$$.fragment,t),b(Da.$$.fragment,t),b(Sa.$$.fragment,t),b(Pa.$$.fragment,t),b(Wa.$$.fragment,t),b(Va.$$.fragment,t),b(Za.$$.fragment,t),b(Ga.$$.fragment,t),b(Ca.$$.fragment,t),b(Na.$$.fragment,t),b(Xa.$$.fragment,t),b(Ra.$$.fragment,t),b(Oa.$$.fragment,t),b(Aa.$$.fragment,t),b(Ha.$$.fragment,t),b(Qa.$$.fragment,t),b(Ka.$$.fragment,t),b(ei.$$.fragment,t),b(ti.$$.fragment,t),b(oi.$$.fragment,t),b(si.$$.fragment,t),b(ni.$$.fragment,t),b(ai.$$.fragment,t),b(ii.$$.fragment,t),b(ci.$$.fragment,t),b(li.$$.fragment,t),b(di.$$.fragment,t),b(pi.$$.fragment,t),b(mi.$$.fragment,t),b(hi.$$.fragment,t),b(gi.$$.fragment,t),b(ui.$$.fragment,t),b(fi.$$.fragment,t),b(_i.$$.fragment,t),b(bi.$$.fragment,t),b(yi.$$.fragment,t),b(Ti.$$.fragment,t),b(vi.$$.fragment,t),b(wi.$$.fragment,t),b($i.$$.fragment,t),b(ki.$$.fragment,t),b(xi.$$.fragment,t),b(Mi.$$.fragment,t),b(Ei.$$.fragment,t),b(ji.$$.fragment,t),b(Fi.$$.fragment,t),b(Li.$$.fragment,t),b(zi.$$.fragment,t),b(Ji.$$.fragment,t),b(Ii.$$.fragment,t),b(Ui.$$.fragment,t),b(Bi.$$.fragment,t),b(qi.$$.fragment,t),b(Di.$$.fragment,t),b(Si.$$.fragment,t),b(Wi.$$.fragment,t),b(Vi.$$.fragment,t),b(Zi.$$.fragment,t),b(Gi.$$.fragment,t),b(Ci.$$.fragment,t),b(Ni.$$.fragment,t),b(Xi.$$.fragment,t),b(Oi.$$.fragment,t),b(Ai.$$.fragment,t),b(Qi.$$.fragment,t),b(Yi.$$.fragment,t),b(Ki.$$.fragment,t),b(Xs.$$.fragment,t),b(ec.$$.fragment,t),b(tc.$$.fragment,t),b(oc.$$.fragment,t),b(sc.$$.fragment,t),b(rc.$$.fragment,t),b(ac.$$.fragment,t),b(ic.$$.fragment,t),b(lc.$$.fragment,t),b(dc.$$.fragment,t),b(mc.$$.fragment,t),b(hc.$$.fragment,t),b(gc.$$.fragment,t),b(uc.$$.fragment,t),b(fc.$$.fragment,t),b(_c.$$.fragment,t),b(bc.$$.fragment,t),b(yc.$$.fragment,t),b($c.$$.fragment,t),b(kc.$$.fragment,t),b(xc.$$.fragment,t),b(Mc.$$.fragment,t),b(Ec.$$.fragment,t),b(jc.$$.fragment,t),b(Fc.$$.fragment,t),b(zc.$$.fragment,t),b(Ic.$$.fragment,t),b(Uc.$$.fragment,t),b(sn.$$.fragment,t),b(nn.$$.fragment,t),b(Bc.$$.fragment,t),b(qc.$$.fragment,t),b(Dc.$$.fragment,t),b(Sc.$$.fragment,t),b(ln.$$.fragment,t),b(dn.$$.fragment,t),b(Pc.$$.fragment,t),yy=!1},d(t){o(T),t&&o(x),t&&o($),y(h),t&&o(B),t&&o(F),t&&o(t_),t&&o(Oc),t&&o(o_),t&&o(so),y(Mn),t&&o(s_),t&&o(Me),t&&o(n_),t&&o(Yc),t&&o(r_),y(En,t),t&&o(a_),t&&o(Pt),t&&o(i_),t&&o(Ee),t&&o(c_),t&&o(V),t&&o(l_),t&&o(ne),t&&o(d_),t&&o(re),t&&o(p_),y(jn,t),t&&o(m_),t&&o(Qo),t&&o(h_),t&&o(ae),t&&o(g_),t&&o(nl),t&&o(u_),t&&o(no),y(Fn),t&&o(f_),t&&o(ro),y(Ln),t&&o(__),t&&o(ao),y(zn),t&&o(b_),t&&o(io),y(Jn),t&&o(y_),t&&o(co),y(In),t&&o(T_),t&&o(lo),y(Un),t&&o(v_),t&&o(po),y(Bn),t&&o(w_),t&&o(mo),y(qn),t&&o($_),t&&o(ho),y(Dn),t&&o(k_),t&&o(go),y(Sn),t&&o(x_),t&&o(uo),y(Pn),t&&o(M_),t&&o(fo),y(Wn),t&&o(E_),t&&o(_o),y(Vn),t&&o(j_),t&&o(bo),y(Zn),t&&o(F_),t&&o(yo),y(Gn),t&&o(L_),t&&o(To),y(Cn),t&&o(z_),t&&o(vo),y(Nn),t&&o(J_),t&&o(wo),y(Xn),t&&o(I_),t&&o($o),y(Rn),t&&o(U_),t&&o(ko),y(On),t&&o(B_),t&&o(xo),y(An),t&&o(q_),t&&o(Mo),y(Hn),t&&o(D_),t&&o(Eo),y(Qn),t&&o(S_),t&&o(qe),y(Yn),y(Kn),t&&o(P_),t&&o(De),y(er),y(tr),t&&o(W_),t&&o(Se),y(or),y(sr),t&&o(V_),t&&o(jo),y(nr),t&&o(Z_),t&&o(rs),t&&o(G_),t&&o(Fo),y(rr),t&&o(C_),t&&o(Pe),y(ar),y(ir),t&&o(N_),t&&o(ge),y(cr),y(mr),t&&o(X_),t&&o(We),y(hr),y(ur),t&&o(R_),t&&o(Ve),y(fr),y(_r),t&&o(O_),t&&o(ue),y(br),y(ls),y(Tr),t&&o(A_),t&&o(fe),y(vr),y(ds),y($r),t&&o(H_),t&&o(Ze),y(kr),y(xr),t&&o(Q_),t&&o(Ge),y(Mr),y(Er),t&&o(Y_),t&&o(Ce),y(jr),y(Fr),t&&o(K_),t&&o(Ne),y(Lr),y(Jr),t&&o(eb),t&&o(L),y(Ir),y(ms),y(hs),y(gs),y(Dr),t&&o(tb),t&&o(Xe),y(Sr),y(Pr),t&&o(ob),t&&o(Re),y(Wr),y(Vr),t&&o(sb),t&&o(Oe),y(Zr),y(Gr),t&&o(nb),t&&o(Ae),y(Cr),y(Nr),t&&o(rb),t&&o(He),y(Xr),y(Rr),t&&o(ab),t&&o(Qe),y(Or),y(Ar),t&&o(ib),t&&o(_e),y(Hr),y(fs),y(Qr),t&&o(cb),t&&o(H),y(Yr),y(_s),y(bs),y(Kr),t&&o(lb),t&&o(Q),y(ea),y(ys),y(Ts),y(oa),t&&o(db),t&&o(Ye),y(sa),y(ra),t&&o(pb),t&&o(be),y(aa),y($s),y(ca),t&&o(mb),t&&o(Y),y(la),y(ks),y(xs),y(da),t&&o(hb),t&&o(Ke),y(pa),y(ma),t&&o(gb),t&&o(et),y(ha),y(ua),t&&o(ub),t&&o(K),y(fa),y(Ms),y(Es),y(_a),t&&o(fb),t&&o(tt),y(ba),y(ya),t&&o(_b),t&&o(ye),y(Ta),y(js),y(va),t&&o(bb),t&&o(ot),y(wa),y(ka),t&&o(yb),t&&o(ee),y(xa),y(Ls),y(ja),t&&o(Tb),t&&o(Te),y(Fa),y(Ia),t&&o(vb),t&&o(Io),y(Ua),t&&o(wb),t&&o(nt),y(Ba),y(qa),t&&o($b),t&&o(rt),y(Da),y(Sa),t&&o(kb),t&&o(at),y(Pa),y(Wa),t&&o(xb),t&&o(it),y(Va),y(Za),t&&o(Mb),t&&o(ct),y(Ga),y(Ca),t&&o(Eb),t&&o(lt),y(Na),y(Xa),t&&o(jb),t&&o(dt),y(Ra),y(Oa),t&&o(Fb),t&&o(pt),y(Aa),y(Ha),t&&o(Lb),t&&o(mt),y(Qa),y(Ka),t&&o(zb),t&&o(ht),y(ei),y(ti),t&&o(Jb),t&&o(gt),y(oi),y(si),t&&o(Ib),t&&o(ut),y(ni),y(ai),t&&o(Ub),t&&o(ft),y(ii),y(ci),t&&o(Bb),t&&o(_t),y(li),y(di),t&&o(qb),t&&o(bt),y(pi),y(mi),t&&o(Db),t&&o(Bo),y(hi),t&&o(Sb),t&&o(yt),y(gi),y(ui),t&&o(Pb),t&&o(Tt),y(fi),y(_i),t&&o(Wb),t&&o(vt),y(bi),y(yi),t&&o(Vb),t&&o(wt),y(Ti),y(vi),t&&o(Zb),t&&o($t),y(wi),y($i),t&&o(Gb),t&&o(kt),y(ki),y(xi),t&&o(Cb),t&&o(xt),y(Mi),y(Ei),t&&o(Nb),t&&o(Mt),y(ji),y(Fi),t&&o(Xb),t&&o(Et),y(Li),y(zi),t&&o(Rb),t&&o(jt),y(Ji),y(Ii),t&&o(Ob),t&&o(Ft),y(Ui),y(Bi),t&&o(Ab),t&&o(Lt),y(qi),y(Di),t&&o(Hb),t&&o(zt),y(Si),y(Wi),t&&o(Qb),t&&o(qo),y(Vi),t&&o(Yb),t&&o(Gs),t&&o(Kb),t&&o(Jt),y(Zi),y(Gi),t&&o(ey),t&&o(Do),y(Ci),y(Ni),t&&o(ty),t&&o(It),y(Xi),y(Oi),t&&o(oy),t&&o(Ut),y(Ai),y(Qi),t&&o(sy),t&&o(So),y(Yi),t&&o(ny),t&&o(Ns),t&&o(ry),t&&o(z),y(Ki),y(Xs),y(ec),y(tc),y(oc),y(sc),y(rc),y(ac),y(ic),t&&o(ay),t&&o(Po),y(lc),t&&o(iy),t&&o(Wo),y(dc),t&&o(cy),t&&o(we),y(mc),y(hc),y(gc),t&&o(ly),t&&o(Zo),y(uc),t&&o(dy),t&&o($e),y(fc),y(_c),y(bc),t&&o(py),t&&o(N),y(yc),y($c),y(kc),t&&o(my),t&&o(ke),y(xc),y(Mc),y(Ec),t&&o(hy),t&&o(Co),y(jc),t&&o(gy),t&&o(qt),y(Fc),t&&o(uy),t&&o(Dt),y(zc),t&&o(fy),t&&o(No),y(Ic),t&&o(_y),t&&o(P),y(Uc),y(sn),y(nn),y(Bc),y(qc),y(Dc),t&&o(by),t&&o(te),y(Sc),y(ln),y(dn),y(Pc)}}}const _B={local:"utilities-for-generation",sections:[{local:"generate-outputs",sections:[{local:"transformers.generation.GreedySearchEncoderDecoderOutput",title:"PyTorch"},{local:"transformers.generation.TFGreedySearchEncoderDecoderOutput",title:"TensorFlow"},{local:"transformers.generation.FlaxSampleOutput",title:"FLAX"}],title:"Generate Outputs"},{local:"logitsprocessor",sections:[{local:"transformers.AlternatingCodebooksLogitsProcessor",title:"PyTorch"},{local:"transformers.TFForcedBOSTokenLogitsProcessor",title:"TensorFlow"},{local:"transformers.FlaxForcedBOSTokenLogitsProcessor",title:"FLAX"}],title:"LogitsProcessor"},{local:"transformers.StoppingCriteria",title:"StoppingCriteria"},{local:"transformers.Constraint",title:"Constraints"},{local:"transformers.BeamScorer",title:"BeamSearch"},{local:"transformers.top_k_top_p_filtering",title:"Utilities"},{local:"transformers.TextStreamer",title:"Streamers"}],title:"Utilities for Generation"};function bB(E){return RU(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class xB extends GU{constructor(T){super();CU(this,T,bB,fB,NU,{})}}export{xB as default,_B as metadata};
