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 r,d as o,m as l,a as n,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 v,v as RU,L as he}from"../../chunks/vendor-hf-doc-builder.js";import{T as kr}from"../../chunks/Tip-hf-doc-builder.js";import{D as T}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 y,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(){y=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){y=r(h,"P",{});var k=n(y);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,y,k),e(y,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(y),h&&o($),v(w,h)}}}function AU(E){let y,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(){y=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){y=r(h,"P",{});var k=n(y);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,y,k),e(y,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(y),h&&o($),v(w,h)}}}function HU(E){let y,x;return{c(){y=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($){y=r($,"P",{});var w=n(y);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($,y,w),e(y,x)},d($){$&&o(y)}}}function QU(E){let y,x;return{c(){y=s("p"),x=a("This logits processor can be resource-intensive, especially when using large models or long sequences.")},l($){y=r($,"P",{});var w=n(y);x=i(w,"This logits processor can be resource-intensive, especially when using large models or long sequences."),w.forEach(o)},m($,w){m($,y,w),e(y,x)},d($){$&&o(y)}}}function YU(E){let y,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(){y=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){y=r(h,"P",{});var k=n(y);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,y,k),e(y,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(y),h&&o($),v(w,h)}}}function KU(E){let y,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(){y=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){y=r(h,"P",{});var k=n(y);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,y,k),e(y,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(y),h&&o($),v(w,h)}}}function eB(E){let y,x,$,w,M,h,k,Z,U,B,F,W,oe,Ue,S,se,Be;return{c(){y=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){y=r(A,"P",{});var j=n(y);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
`),$=r(j,"CODE",{});var Kt=n($);w=i(Kt,"add_prefix_space=True"),Kt.forEach(o),M=i(j," when initializing the tokenizer, and use "),h=r(j,"CODE",{});var eo=n(h);k=i(eo,"tokenizer(bad_words, add_special_tokens=False).input_ids"),eo.forEach(o),Z=i(j,". The "),U=r(j,"CODE",{});var xe=n(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=r(j,"CODE",{});var to=n(W);oe=i(to,"pre tokenizers"),to.forEach(o),Ue=i(j,`. Read more
`),S=r(j,"A",{href:!0,rel:!0});var oo=n(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,y,j),e(y,x),e(y,$),e($,w),e(y,M),e(y,h),e(h,k),e(y,Z),e(y,U),e(U,B),e(y,F),e(y,W),e(W,oe),e(y,Ue),e(y,S),e(S,se),e(y,Be)},d(A){A&&o(y)}}}function tB(E){let y,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(){y=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){y=r(h,"P",{});var k=n(y);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,y,k),e(y,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(y),h&&o($),v(w,h)}}}function oB(E){let y,x,$,w;return{c(){y=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){y=r(M,"P",{});var h=n(y);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.
`),$=r(h,"A",{href:!0,rel:!0});var k=n($);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,y,h),e(y,x),e(y,$),e($,w)},d(M){M&&o(y)}}}function sB(E){let y,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(){y=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){y=r(h,"P",{});var k=n(y);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,y,k),e(y,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(y),h&&o($),v(w,h)}}}function rB(E){let y,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(){y=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){y=r(h,"P",{});var k=n(y);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,y,k),e(y,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(y),h&&o($),v(w,h)}}}function nB(E){let y,x,$,w,M,h,k,Z,U,B,F,W,oe,Ue,S,se,Be;return{c(){y=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){y=r(A,"P",{});var j=n(y);x=i(j,"In order to get the token ids of the sequences that you want to bias, make sure to set "),$=r(j,"CODE",{});var Kt=n($);w=i(Kt,"add_prefix_space=True"),Kt.forEach(o),M=i(j,` when
initializing the tokenizer, and use `),h=r(j,"CODE",{});var eo=n(h);k=i(eo,"tokenizer(bad_words, add_special_tokens=False).input_ids"),eo.forEach(o),Z=i(j,`. The
`),U=r(j,"CODE",{});var xe=n(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=r(j,"CODE",{});var to=n(W);oe=i(to,"pre tokenizers"),to.forEach(o),Ue=i(j,". Read more "),S=r(j,"A",{href:!0,rel:!0});var oo=n(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,y,j),e(y,x),e(y,$),e($,w),e(y,M),e(y,h),e(h,k),e(y,Z),e(y,U),e(U,B),e(y,F),e(y,W),e(W,oe),e(y,Ue),e(y,S),e(S,se),e(y,Be)},d(A){A&&o(y)}}}function aB(E){let y,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(){y=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){y=r(h,"P",{});var k=n(y);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,y,k),e(y,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(y),h&&o($),v(w,h)}}}function iB(E){let y,x,$,w,M,h,k,Z;return{c(){y=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){y=r(U,"P",{});var B=n(y);x=i(B,"Make sure that "),$=r(B,"CODE",{});var F=n($);w=i(F,"do_sample=True"),F.forEach(o),M=i(B," is included in the "),h=r(B,"CODE",{});var W=n(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,y,B),e(y,x),e(y,$),e($,w),e(y,M),e(y,h),e(h,k),e(y,Z)},d(U){U&&o(y)}}}function cB(E){let y,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(){y=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){y=r(h,"P",{});var k=n(y);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,y,k),e(y,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(y),h&&o($),v(w,h)}}}function lB(E){let y,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(){y=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){y=r(h,"P",{});var k=n(y);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,y,k),e(y,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(y),h&&o($),v(w,h)}}}function dB(E){let y,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(){y=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){y=r(h,"P",{});var k=n(y);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,y,k),e(y,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(y),h&&o($),v(w,h)}}}function pB(E){let y,x;return y=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(y.$$.fragment)},l($){u(y.$$.fragment,$)},m($,w){f(y,$,w),x=!0},p:he,i($){x||(_(y.$$.fragment,$),x=!0)},o($){b(y.$$.fragment,$),x=!1},d($){v(y,$)}}}function mB(E){let y,x;return{c(){y=s("p"),x=a("The API for the streamer classes is still under development and may change in the future.")},l($){y=r($,"P",{});var w=n(y);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($,y,w),e(y,x)},d($){$&&o(y)}}}function hB(E){let y,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(){y=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){y=r(h,"P",{});var k=n(y);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,y,k),e(y,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(y),h&&o($),v(w,h)}}}function gB(E){let y,x;return{c(){y=s("p"),x=a("The API for the streamer classes is still under development and may change in the future.")},l($){y=r($,"P",{});var w=n(y);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($,y,w),e(y,x)},d($){$&&o(y)}}}function uB(E){let y,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(){y=s("p"),x=a("Examples:"),$=c(),g(w.$$.fragment)},l(h){y=r(h,"P",{});var k=n(y);x=i(k,"Examples:"),k.forEach(o),$=l(h),u(w.$$.fragment,h)},m(h,k){m(h,y,k),e(y,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(y),h&&o($),v(w,h)}}}function fB(E){let y,x,$,w,M,h,k,Z,U,B,F,W,oe,Ue,S,se,Be,A,j,Kt,eo,xe,to,oo,Cc,Wy,Vy,Nc,Zy,Gy,Xc,Cy,Ny,Rc,Xy,Ry,t_,Oc,Oy,o_,so,Ho,mh,xr,Ay,hh,Hy,s_,Me,Qy,Ac,Yy,Ky,Hc,eT,tT,Qc,oT,sT,r_,Yc,rT,n_,Mr,a_,Pt,nT,gh,aT,iT,Kc,cT,lT,i_,Ee,el,uh,dT,pT,mT,tl,fh,hT,gT,uT,ol,_h,fT,_T,bT,sl,bh,vT,yT,c_,V,TT,vh,wT,$T,yh,kT,xT,Th,MT,ET,wh,jT,FT,$h,LT,zT,kh,JT,IT,l_,re,UT,xh,BT,qT,Mh,DT,ST,Eh,PT,WT,jh,VT,ZT,d_,ne,GT,Fh,CT,NT,Lh,XT,RT,zh,OT,AT,Jh,HT,QT,p_,Er,m_,Qo,YT,Ih,KT,e1,h_,ae,t1,Uh,o1,s1,Bh,r1,n1,qh,a1,i1,Dh,c1,l1,g_,rl,d1,u_,ro,Yo,Sh,jr,p1,Ph,m1,f_,no,Fr,h1,Wh,g1,__,ao,Lr,u1,Vh,f1,b_,io,zr,_1,Zh,b1,v_,co,Jr,v1,Gh,y1,y_,lo,Ir,T1,Ch,w1,T_,po,Ur,$1,Nh,k1,w_,mo,Br,x1,Xh,M1,$_,ho,qr,E1,Rh,j1,k_,go,Dr,F1,Oh,L1,x_,uo,Sr,z1,Ah,J1,M_,fo,Ko,Hh,Pr,I1,Qh,U1,E_,_o,Wr,B1,Yh,q1,j_,bo,Vr,D1,Kh,S1,F_,vo,Zr,P1,eg,W1,L_,yo,Gr,V1,tg,Z1,z_,To,Cr,G1,og,C1,J_,wo,Nr,N1,sg,X1,I_,$o,Xr,R1,rg,O1,U_,ko,Rr,A1,ng,H1,B_,xo,Or,Q1,ag,Y1,q_,Mo,Ar,K1,ig,e0,D_,Eo,es,cg,Hr,t0,lg,o0,S_,qe,Qr,s0,dg,r0,n0,ts,Yr,a0,pg,i0,P_,De,Kr,c0,mg,l0,d0,os,en,p0,hg,m0,W_,Se,tn,h0,gg,g0,u0,ss,on,f0,ug,_0,V_,jo,rs,fg,sn,b0,_g,v0,Z_,ns,y0,nl,T0,w0,G_,Fo,as,bg,rn,$0,vg,k0,C_,Pe,nn,x0,is,al,M0,E0,yg,j0,F0,L0,il,an,N_,ge,cn,z0,ln,J0,Tg,I0,U0,B0,dn,q0,pn,D0,S0,P0,cl,mn,X_,We,hn,W0,cs,ll,V0,Z0,gn,G0,C0,N0,dl,un,R_,Ve,fn,X0,pl,ml,R0,O0,A0,hl,_n,O_,ue,bn,H0,Wt,gl,Q0,Y0,wg,K0,e2,vn,t2,o2,s2,ls,r2,ul,yn,A_,fe,Tn,n2,D,fl,a2,i2,$g,c2,l2,kg,d2,p2,xg,m2,h2,wn,g2,u2,Mg,f2,_2,Eg,b2,v2,jg,y2,T2,w2,ds,$2,_l,$n,H_,Ze,kn,k2,bl,vl,x2,M2,E2,yl,xn,Q_,Ge,Mn,j2,Tl,wl,F2,L2,z2,$l,En,Y_,Ce,jn,J2,ps,kl,I2,U2,Fg,B2,q2,D2,xl,Fn,K_,Ne,Ln,S2,zn,P2,Lg,W2,V2,Z2,Ml,Jn,eb,L,In,G2,El,jl,C2,N2,X2,Lo,R2,Fl,O2,A2,Un,H2,Q2,Y2,ms,K2,hs,ew,Bn,tw,zg,ow,sw,rw,Jg,nw,aw,zo,Ll,Ig,iw,cw,lw,zl,Ug,dw,pw,mw,Jl,Bg,hw,gw,uw,qg,fw,_w,qn,Il,Dg,bw,vw,yw,Ul,Sg,Tw,ww,$w,gs,kw,Bl,Dn,tb,Xe,Sn,xw,Vt,ql,Mw,Ew,Pg,jw,Fw,Wg,Lw,zw,Jw,Dl,Pn,ob,Re,Wn,Iw,us,Sl,Uw,Bw,Pl,qw,Dw,Sw,Wl,Vn,sb,Oe,Zn,Pw,Vg,Ww,Vw,Vl,Gn,rb,Ae,Cn,Zw,G,Gw,Zl,Cw,Nw,Gl,Xw,Rw,Zg,Ow,Aw,Gg,Cg,Hw,Qw,Cl,Yw,Kw,Nl,e$,t$,o$,Xl,Nn,nb,He,Xn,s$,Ng,r$,n$,Rl,Rn,ab,Qe,On,a$,Ol,Al,i$,c$,l$,Hl,An,ib,_e,Hn,d$,je,Ql,p$,m$,Xg,h$,g$,Rg,u$,f$,Og,_$,b$,v$,fs,y$,Yl,Qn,cb,H,Yn,T$,Kl,ed,w$,$$,k$,_s,x$,bs,M$,td,Kn,lb,Q,ea,E$,Jo,j$,od,F$,L$,ta,z$,J$,I$,vs,U$,ys,B$,sd,oa,db,Ye,sa,q$,Ts,rd,D$,S$,ra,P$,W$,V$,nd,na,pb,be,aa,Z$,ws,ad,G$,C$,ia,N$,X$,R$,$s,O$,id,ca,mb,Y,la,A$,cd,ld,H$,Q$,Y$,ks,K$,xs,ek,dd,da,hb,Ke,pa,tk,Fe,pd,ok,sk,Ag,rk,nk,Hg,ak,ik,Qg,ck,lk,dk,md,ma,gb,et,ha,pk,ga,mk,Yg,hk,gk,uk,hd,ua,ub,K,fa,fk,gd,ud,_k,bk,vk,Ms,yk,Es,Tk,fd,_a,fb,tt,ba,wk,_d,bd,$k,kk,xk,vd,va,_b,ve,ya,Mk,yd,Td,Ek,jk,Fk,js,Lk,wd,Ta,bb,ot,wa,zk,Fs,$d,Jk,Ik,$a,Uk,Bk,qk,kd,ka,vb,ee,xa,Dk,st,Sk,Kg,Pk,Wk,eu,Vk,Zk,tu,Gk,Ck,Nk,Ma,Xk,Ea,Rk,Ok,Ak,Ls,Hk,xd,ja,yb,ye,Fa,Qk,La,Yk,ou,Kk,e3,t3,za,o3,Ja,s3,r3,n3,Md,Ia,Tb,Io,zs,su,Ua,a3,ru,i3,wb,rt,Ba,c3,Ed,jd,l3,d3,p3,Fd,qa,$b,nt,Da,m3,Js,Ld,h3,g3,nu,u3,f3,_3,zd,Sa,kb,at,Pa,b3,Uo,v3,au,y3,T3,iu,w3,$3,k3,Jd,Wa,xb,it,Va,x3,cu,M3,E3,Is,Za,j3,lu,F3,Mb,ct,Ga,L3,Te,z3,Id,J3,I3,du,U3,B3,pu,mu,q3,D3,Ud,S3,P3,W3,Bd,Ca,Eb,lt,Na,V3,hu,Z3,G3,Us,Xa,C3,gu,N3,jb,dt,Ra,X3,qd,Dd,R3,O3,A3,Sd,Oa,Fb,pt,Aa,H3,Pd,Wd,Q3,Y3,K3,Vd,Ha,Lb,mt,Qa,e4,Bs,Zd,t4,o4,Ya,s4,r4,n4,Gd,Ka,zb,ht,ei,a4,Cd,Nd,i4,c4,l4,Xd,ti,Jb,gt,oi,d4,Le,Rd,p4,m4,uu,h4,g4,fu,u4,f4,_u,_4,b4,v4,Od,si,Ib,ut,ri,y4,ni,T4,bu,w4,$4,k4,Ad,ai,Ub,ft,ii,x4,Hd,Qd,M4,E4,j4,Yd,ci,Bb,_t,li,F4,Kd,ep,L4,z4,J4,tp,di,qb,bt,pi,I4,op,sp,U4,B4,q4,rp,mi,Db,Bo,qs,vu,hi,D4,yu,S4,Sb,vt,gi,P4,np,ap,W4,V4,Z4,ip,ui,Pb,yt,fi,G4,Ds,cp,C4,N4,Tu,X4,R4,O4,lp,_i,Wb,Tt,bi,A4,Ss,dp,H4,Q4,wu,Y4,K4,ex,pp,vi,Vb,wt,yi,tx,$u,ox,sx,Ps,Ti,rx,ku,nx,Zb,$t,wi,ax,C,ix,mp,cx,lx,hp,dx,px,xu,mx,hx,Mu,Eu,gx,ux,gp,fx,_x,up,bx,vx,yx,fp,$i,Gb,kt,ki,Tx,ju,wx,$x,Ws,xi,kx,Fu,xx,Cb,xt,Mi,Mx,_p,bp,Ex,jx,Fx,vp,Ei,Nb,Mt,ji,Lx,ze,yp,zx,Jx,Lu,Ix,Ux,zu,Bx,qx,Ju,Dx,Sx,Px,Tp,Fi,Xb,Et,Li,Wx,Vs,wp,Vx,Zx,Iu,Gx,Cx,Nx,$p,zi,Rb,jt,Ji,Xx,kp,xp,Rx,Ox,Ax,Mp,Ii,Ob,Ft,Ui,Hx,Ep,jp,Qx,Yx,Kx,Fp,Bi,Ab,Lt,qi,eM,Lp,zp,tM,oM,sM,Jp,Di,Hb,zt,Si,rM,Pi,nM,Uu,aM,iM,cM,Ip,Wi,Qb,qo,Zs,Bu,Vi,lM,qu,dM,Yb,Gs,pM,Up,mM,hM,Kb,Jt,Zi,gM,Du,uM,fM,Bp,Gi,ev,Do,Ci,_M,qp,Ni,tv,It,Xi,bM,Ri,vM,Su,yM,TM,wM,Dp,Oi,ov,Ut,Ai,$M,Hi,kM,Pu,xM,MM,EM,Sp,Qi,sv,So,Cs,Wu,Yi,jM,Vu,FM,rv,Ns,LM,Pp,zM,JM,nv,z,Ki,IM,Zu,UM,BM,Gu,qM,DM,Xs,SM,Cu,PM,WM,Rs,ec,VM,Nu,ZM,GM,Os,tc,CM,Xu,NM,XM,As,oc,RM,Ru,OM,AM,Hs,sc,HM,rc,QM,Ou,YM,KM,eE,Qs,nc,tE,Au,oE,sE,Ys,ac,rE,Hu,nE,aE,Zt,ic,iE,cc,cE,Qu,lE,dE,pE,Yu,mE,av,Po,lc,hE,Wp,Vp,gE,uE,iv,Wo,dc,fE,pc,_E,Zp,bE,vE,cv,we,mc,yE,Ku,TE,wE,R,hc,$E,ef,kE,xE,Vo,ME,tf,EE,jE,of,FE,LE,zE,sf,rf,JE,IE,Bt,UE,nf,BE,qE,af,DE,SE,cf,PE,WE,VE,lf,ZE,GE,Ks,gc,CE,df,NE,lv,Zo,er,pf,uc,XE,mf,RE,dv,$e,fc,OE,Go,AE,Gp,HE,QE,Cp,YE,KE,ej,Np,_c,tj,Xp,bc,pv,N,vc,oj,Rp,Op,sj,rj,nj,yc,aj,Tc,ij,cj,lj,Ap,dj,wc,pj,mj,Hp,$c,hj,Qp,kc,mv,ke,xc,gj,Yp,Kp,uj,fj,_j,em,Mc,bj,tm,Ec,hv,Co,tr,hf,jc,vj,gf,yj,gv,qt,Fc,Tj,uf,wj,$j,om,kj,Lc,xj,uv,Dt,zc,Mj,ff,Ej,jj,sm,Fj,Jc,Lj,fv,No,or,_f,Ic,zj,bf,Jj,_v,P,Uc,Ij,vf,Uj,Bj,sr,qj,rr,Dj,nr,Bc,Sj,yf,Pj,Wj,ar,qc,Vj,Tf,Zj,Gj,ir,Dc,Cj,wf,Nj,bv,te,Sc,Xj,$f,Rj,Oj,cr,Aj,lr,Hj,dr,Pc,Qj,kf,Yj,vv;return h=new pe({}),xr=new pe({}),Mr=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>)`}}),Er=new O({props:{code:"Z2VuZXJhdGlvbl9vdXRwdXQlNUIlM0EyJTVE",highlighted:'generation_output[:<span class="hljs-number">2</span>]'}}),jr=new pe({}),Fr=new T({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/v4.33.0/src/transformers/generation/utils.py#L184"}}),Lr=new T({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/v4.33.0/src/transformers/generation/utils.py#L88"}}),zr=new T({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/v4.33.0/src/transformers/generation/utils.py#L255"}}),Jr=new T({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/v4.33.0/src/transformers/generation/utils.py#L226"}}),Ir=new T({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/v4.33.0/src/transformers/generation/utils.py#L333"}}),Ur=new T({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/v4.33.0/src/transformers/generation/utils.py#L298"}}),Br=new T({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/v4.33.0/src/transformers/generation/utils.py#L418"}}),qr=new T({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/v4.33.0/src/transformers/generation/utils.py#L383"}}),Dr=new T({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/v4.33.0/src/transformers/generation/utils.py#L116"}}),Sr=new T({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/v4.33.0/src/transformers/generation/utils.py#L155"}}),Pr=new pe({}),Wr=new T({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/v4.33.0/src/transformers/generation/tf_utils.py#L86"}}),Vr=new T({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/v4.33.0/src/transformers/generation/tf_utils.py#L58"}}),Zr=new T({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/v4.33.0/src/transformers/generation/tf_utils.py#L156"}}),Gr=new T({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/v4.33.0/src/transformers/generation/tf_utils.py#L128"}}),Cr=new T({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/v4.33.0/src/transformers/generation/tf_utils.py#L233"}}),Nr=new T({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/v4.33.0/src/transformers/generation/tf_utils.py#L198"}}),Xr=new T({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/v4.33.0/src/transformers/generation/tf_utils.py#L318"}}),Rr=new T({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/v4.33.0/src/transformers/generation/tf_utils.py#L283"}}),Or=new T({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/v4.33.0/src/transformers/generation/tf_utils.py#L394"}}),Ar=new T({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/v4.33.0/src/transformers/generation/tf_utils.py#L367"}}),Hr=new pe({}),Qr=new T({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/v4.33.0/src/transformers/generation/flax_utils.py#L69"}}),Yr=new T({props:{name:"replace",anchor:"transformers.generation.FlaxSampleOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/flax/struct.py#L111"}}),Kr=new T({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/v4.33.0/src/transformers/generation/flax_utils.py#L55"}}),en=new T({props:{name:"replace",anchor:"transformers.generation.FlaxGreedySearchOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/flax/struct.py#L111"}}),tn=new T({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/v4.33.0/src/transformers/generation/flax_utils.py#L83"}}),on=new T({props:{name:"replace",anchor:"transformers.generation.FlaxBeamSearchOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/flax/struct.py#L111"}}),sn=new pe({}),rn=new pe({}),nn=new T({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/v4.33.0/src/transformers/generation/logits_process.py#L1505"}}),an=new T({props:{name:"__call__",anchor:"transformers.AlternatingCodebooksLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/logits_process.py#L1526"}}),cn=new T({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/v4.33.0/src/transformers/generation/logits_process.py#L1465"}}),mn=new T({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/v4.33.0/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>
`}}),hn=new T({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/v4.33.0/src/transformers/generation/logits_process.py#L763"}}),un=new T({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/v4.33.0/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>
`}}),fn=new T({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/v4.33.0/src/transformers/generation/logits_process.py#L323"}}),_n=new T({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/v4.33.0/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>
`}}),bn=new T({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/v4.33.0/src/transformers/generation/logits_process.py#L493"}}),ls=new me({props:{anchor:"transformers.EpsilonLogitsWarper.example",$$slots:{default:[OU]},$$scope:{ctx:E}}}),yn=new T({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/v4.33.0/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>
`}}),Tn=new T({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/v4.33.0/src/transformers/generation/logits_process.py#L560"}}),ds=new me({props:{anchor:"transformers.EtaLogitsWarper.example",$$slots:{default:[AU]},$$scope:{ctx:E}}}),$n=new T({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/v4.33.0/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>
`}}),kn=new T({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/v4.33.0/src/transformers/generation/logits_process.py#L1298"}}),xn=new T({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/v4.33.0/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>
`}}),Mn=new T({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/v4.33.0/src/transformers/generation/logits_process.py#L1230"}}),En=new T({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/v4.33.0/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>
`}}),jn=new T({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/v4.33.0/src/transformers/generation/logits_process.py#L1252"}}),Fn=new T({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/v4.33.0/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>
`}}),Ln=new T({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/v4.33.0/src/transformers/generation/logits_process.py#L1380"}}),Jn=new T({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/v4.33.0/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>
`}}),In=new T({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/v4.33.0/src/transformers/generation/logits_process.py#L1067"}}),ms=new kr({props:{$$slots:{default:[HU]},$$scope:{ctx:E}}}),hs=new kr({props:{warning:!0,$$slots:{default:[QU]},$$scope:{ctx:E}}}),gs=new me({props:{anchor:"transformers.HammingDiversityLogitsProcessor.example",$$slots:{default:[YU]},$$scope:{ctx:E}}}),Dn=new T({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/v4.33.0/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>
`}}),Sn=new T({props:{name:"class transformers.InfNanRemoveLogitsProcessor",anchor:"transformers.InfNanRemoveLogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/logits_process.py#L1281"}}),Pn=new T({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/v4.33.0/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>
`}}),Wn=new T({props:{name:"class transformers.LogitNormalization",anchor:"transformers.LogitNormalization",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/logits_process.py#L1334"}}),Vn=new T({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/v4.33.0/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>
`}}),Zn=new T({props:{name:"class transformers.LogitsProcessor",anchor:"transformers.LogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/logits_process.py#L44"}}),Gn=new T({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/v4.33.0/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>
`}}),Cn=new T({props:{name:"class transformers.LogitsProcessorList",anchor:"transformers.LogitsProcessorList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/logits_process.py#L64"}}),Nn=new T({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/v4.33.0/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>
`}}),Xn=new T({props:{name:"class transformers.LogitsWarper",anchor:"transformers.LogitsWarper",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/logits_process.py#L54"}}),Rn=new T({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/v4.33.0/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>
`}}),On=new T({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/v4.33.0/src/transformers/generation/logits_process.py#L101"}}),An=new T({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/v4.33.0/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>
`}}),Hn=new T({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/v4.33.0/src/transformers/generation/logits_process.py#L133"}}),fs=new me({props:{anchor:"transformers.MinNewTokensLengthLogitsProcessor.example",$$slots:{default:[KU]},$$scope:{ctx:E}}}),Qn=new T({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/v4.33.0/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>
`}}),Yn=new T({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/v4.33.0/src/transformers/generation/logits_process.py#L953"}}),_s=new kr({props:{$$slots:{default:[eB]},$$scope:{ctx:E}}}),bs=new me({props:{anchor:"transformers.NoBadWordsLogitsProcessor.example",$$slots:{default:[tB]},$$scope:{ctx:E}}}),Kn=new T({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/v4.33.0/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 T({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/v4.33.0/src/transformers/generation/logits_process.py#L706"}}),vs=new kr({props:{$$slots:{default:[oB]},$$scope:{ctx:E}}}),ys=new me({props:{anchor:"transformers.NoRepeatNGramLogitsProcessor.example",$$slots:{default:[sB]},$$scope:{ctx:E}}}),oa=new T({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/v4.33.0/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 T({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/v4.33.0/src/transformers/generation/logits_process.py#L1040"}}),na=new T({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/v4.33.0/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 T({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/v4.33.0/src/transformers/generation/logits_process.py#L270"}}),$s=new me({props:{anchor:"transformers.RepetitionPenaltyLogitsProcessor.example",$$slots:{default:[rB]},$$scope:{ctx:E}}}),ca=new T({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/v4.33.0/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 T({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/v4.33.0/src/transformers/generation/logits_process.py#L805"}}),ks=new kr({props:{$$slots:{default:[nB]},$$scope:{ctx:E}}}),xs=new me({props:{anchor:"transformers.SequenceBiasLogitsProcessor.example",$$slots:{default:[aB]},$$scope:{ctx:E}}}),da=new T({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/v4.33.0/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 T({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/v4.33.0/src/transformers/generation/logits_process.py#L1348"}}),ma=new T({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/v4.33.0/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 T({props:{name:"class transformers.SuppressTokensLogitsProcessor",anchor:"transformers.SuppressTokensLogitsProcessor",parameters:[{name:"suppress_tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/logits_process.py#L1367"}}),ua=new T({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/v4.33.0/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 T({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/v4.33.0/src/transformers/generation/logits_process.py#L205"}}),Ms=new kr({props:{$$slots:{default:[iB]},$$scope:{ctx:E}}}),Es=new me({props:{anchor:"transformers.TemperatureLogitsWarper.example",$$slots:{default:[cB]},$$scope:{ctx:E}}}),_a=new T({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/v4.33.0/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 T({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/v4.33.0/src/transformers/generation/logits_process.py#L415"}}),va=new T({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/v4.33.0/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>
`}}),ya=new T({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/v4.33.0/src/transformers/generation/logits_process.py#L352"}}),js=new me({props:{anchor:"transformers.TopPLogitsWarper.example",$$slots:{default:[lB]},$$scope:{ctx:E}}}),Ta=new T({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/v4.33.0/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 T({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/v4.33.0/src/transformers/generation/logits_process.py#L444"}}),ka=new T({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/v4.33.0/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 T({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/v4.33.0/src/transformers/generation/logits_process.py#L1541"}}),Ls=new me({props:{anchor:"transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor.example",$$slots:{default:[dB]},$$scope:{ctx:E}}}),ja=new T({props:{name:"__call__",anchor:"transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor.__call__",parameters:[{name:"input_ids",val:""},{name:"scores",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/logits_process.py#L1650"}}),Fa=new T({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/v4.33.0/src/transformers/generation/logits_process.py#L1398"}}),Ia=new T({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/v4.33.0/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 T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L448"}}),qa=new T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L462"}}),Da=new T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L478"}}),Sa=new T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L495"}}),Pa=new T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L551"}}),Wa=new T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L567"}}),Va=new T({props:{name:"class transformers.TFLogitsProcessor",anchor:"transformers.TFLogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/tf_logits_process.py#L53"}}),Za=new T({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/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.33.0/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 T({props:{name:"class transformers.TFLogitsProcessorList",anchor:"transformers.TFLogitsProcessorList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/tf_logits_process.py#L75"}}),Ca=new T({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/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.33.0/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 T({props:{name:"class transformers.TFLogitsWarper",anchor:"transformers.TFLogitsWarper",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/tf_logits_process.py#L64"}}),Xa=new T({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/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.33.0/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 T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L202"}}),Oa=new T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L228"}}),Aa=new T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L288"}}),Ha=new T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L367"}}),Qa=new T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L388"}}),Ka=new T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L427"}}),ei=new T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L238"}}),ti=new T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L280"}}),oi=new T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L511"}}),si=new T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L522"}}),ri=new T({props:{name:"class transformers.TFSuppressTokensLogitsProcessor",anchor:"transformers.TFSuppressTokensLogitsProcessor",parameters:[{name:"suppress_tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/tf_logits_process.py#L535"}}),ai=new T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L542"}}),ii=new T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L98"}}),ci=new T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L113"}}),li=new T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L118"}}),di=new T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L138"}}),pi=new T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L146"}}),mi=new T({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/v4.33.0/src/transformers/generation/tf_logits_process.py#L170"}}),hi=new pe({}),gi=new T({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/v4.33.0/src/transformers/generation/flax_logits_process.py#L194"}}),ui=new T({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/v4.33.0/src/transformers/generation/flax_logits_process.py#L206"}}),fi=new T({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/v4.33.0/src/transformers/generation/flax_logits_process.py#L216"}}),_i=new T({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/v4.33.0/src/transformers/generation/flax_logits_process.py#L231"}}),bi=new T({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/v4.33.0/src/transformers/generation/flax_logits_process.py#L315"}}),vi=new T({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/v4.33.0/src/transformers/generation/flax_logits_process.py#L337"}}),yi=new T({props:{name:"class transformers.FlaxLogitsProcessor",anchor:"transformers.FlaxLogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/flax_logits_process.py#L50"}}),Ti=new T({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/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.33.0/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 T({props:{name:"class transformers.FlaxLogitsProcessorList",anchor:"transformers.FlaxLogitsProcessorList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/flax_logits_process.py#L72"}}),$i=new T({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/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.33.0/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 T({props:{name:"class transformers.FlaxLogitsWarper",anchor:"transformers.FlaxLogitsWarper",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/flax_logits_process.py#L61"}}),xi=new T({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/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.33.0/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 T({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/v4.33.0/src/transformers/generation/flax_logits_process.py#L241"}}),Ei=new T({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/v4.33.0/src/transformers/generation/flax_logits_process.py#L262"}}),ji=new T({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/v4.33.0/src/transformers/generation/flax_logits_process.py#L271"}}),Fi=new T({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/v4.33.0/src/transformers/generation/flax_logits_process.py#L288"}}),Li=new T({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/v4.33.0/src/transformers/generation/flax_logits_process.py#L296"}}),zi=new T({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/v4.33.0/src/transformers/generation/flax_logits_process.py#L309"}}),Ji=new T({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/v4.33.0/src/transformers/generation/flax_logits_process.py#L95"}}),Ii=new T({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/v4.33.0/src/transformers/generation/flax_logits_process.py#L110"}}),Ui=new T({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/v4.33.0/src/transformers/generation/flax_logits_process.py#L159"}}),Bi=new T({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/v4.33.0/src/transformers/generation/flax_logits_process.py#L179"}}),qi=new T({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/v4.33.0/src/transformers/generation/flax_logits_process.py#L115"}}),Di=new T({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/v4.33.0/src/transformers/generation/flax_logits_process.py#L139"}}),Si=new T({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/v4.33.0/src/transformers/generation/flax_logits_process.py#L363"}}),Wi=new T({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/v4.33.0/src/transformers/generation/flax_logits_process.py#L397"}}),Vi=new pe({}),Zi=new T({props:{name:"class transformers.StoppingCriteria",anchor:"transformers.StoppingCriteria",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/stopping_criteria.py#L36"}}),Gi=new T({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/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.33.0/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 T({props:{name:"class transformers.StoppingCriteriaList",anchor:"transformers.StoppingCriteriaList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/stopping_criteria.py#L124"}}),Ni=new T({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/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.33.0/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 T({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/v4.33.0/src/transformers/generation/stopping_criteria.py#L44"}}),Oi=new T({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/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.33.0/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 T({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/v4.33.0/src/transformers/generation/stopping_criteria.py#L102"}}),Qi=new T({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/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.33.0/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 T({props:{name:"class transformers.Constraint",anchor:"transformers.Constraint",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/beam_constraints.py#L5"}}),Xs=new me({props:{anchor:"transformers.Constraint.example",$$slots:{default:[pB]},$$scope:{ctx:E}}}),ec=new T({props:{name:"advance",anchor:"transformers.Constraint.advance",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/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 T({props:{name:"copy",anchor:"transformers.Constraint.copy",parameters:[{name:"stateful",val:" = False"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/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 T({props:{name:"does_advance",anchor:"transformers.Constraint.does_advance",parameters:[{name:"token_id",val:": int"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/beam_constraints.py#L60"}}),sc=new T({props:{name:"remaining",anchor:"transformers.Constraint.remaining",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/beam_constraints.py#L104"}}),nc=new T({props:{name:"reset",anchor:"transformers.Constraint.reset",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/beam_constraints.py#L94"}}),ac=new T({props:{name:"test",anchor:"transformers.Constraint.test",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/beam_constraints.py#L24"}}),ic=new T({props:{name:"update",anchor:"transformers.Constraint.update",parameters:[{name:"token_id",val:": int"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/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 T({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/v4.33.0/src/transformers/generation/beam_constraints.py#L129"}}),dc=new T({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/v4.33.0/src/transformers/generation/beam_constraints.py#L261"}}),mc=new T({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/v4.33.0/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/v4.33.0/src/transformers/generation/beam_constraints.py#L350"}}),hc=new T({props:{name:"advance",anchor:"transformers.ConstraintListState.advance",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/beam_constraints.py#L382"}}),gc=new T({props:{name:"reset",anchor:"transformers.ConstraintListState.reset",parameters:[{name:"token_ids",val:": typing.Optional[typing.List[int]]"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/beam_constraints.py#L417"}}),uc=new pe({}),fc=new T({props:{name:"class transformers.BeamScorer",anchor:"transformers.BeamScorer",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/beam_search.py#L91"}}),_c=new T({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/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.33.0/en/main_classes/text_generation#transformers.GenerationMixin.group_beam_search">group_beam_search()</a>.`,name:"group_index"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/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 T({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/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.33.0/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>
`}}),vc=new T({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/v4.33.0/src/transformers/generation/beam_search.py#L123"}}),$c=new T({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/v4.33.0/src/transformers/generation/beam_search.py#L215"}}),kc=new T({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/v4.33.0/src/transformers/generation/beam_search.py#L315"}}),xc=new T({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/v4.33.0/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/v4.33.0/src/transformers/generation/beam_search.py#L410"}}),Mc=new T({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/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.33.0/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 T({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/v4.33.0/src/transformers/generation/beam_search.py#L798"}}),jc=new pe({}),Fc=new T({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/v4.33.0/src/transformers/generation/utils.py#L4696"}}),zc=new T({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/v4.33.0/src/transformers/generation/tf_utils.py#L3059"}}),Ic=new pe({}),Uc=new T({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/v4.33.0/src/transformers/generation/streamers.py#L38"}}),sr=new kr({props:{warning:!0,$$slots:{default:[mB]},$$scope:{ctx:E}}}),rr=new me({props:{anchor:"transformers.TextStreamer.example",$$slots:{default:[hB]},$$scope:{ctx:E}}}),Bc=new T({props:{name:"end",anchor:"transformers.TextStreamer.end",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/streamers.py#L116"}}),qc=new T({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/v4.33.0/src/transformers/generation/streamers.py#L130"}}),Dc=new T({props:{name:"put",anchor:"transformers.TextStreamer.put",parameters:[{name:"value",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/generation/streamers.py#L82"}}),Sc=new T({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/v4.33.0/src/transformers/generation/streamers.py#L159"}}),cr=new kr({props:{warning:!0,$$slots:{default:[gB]},$$scope:{ctx:E}}}),lr=new me({props:{anchor:"transformers.TextIteratorStreamer.example",$$slots:{default:[uB]},$$scope:{ctx:E}}}),Pc=new T({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/v4.33.0/src/transformers/generation/streamers.py#L213"}}),{c(){y=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"),Wy=a("beam_search()"),Vy=a(`,
`),Nc=s("a"),Zy=a("beam_sample()"),Gy=a(`,
`),Xc=s("a"),Cy=a("group_beam_search()"),Ny=a(`, and
`),Rc=s("a"),Xy=a("constrained_beam_search()"),Ry=a("."),t_=c(),Oc=s("p"),Oy=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(xr.$$.fragment),Ay=c(),hh=s("span"),Hy=a("Generate Outputs"),s_=c(),Me=s("p"),Qy=a("The output of "),Ac=s("a"),Yy=a("generate()"),Ky=a(` is an instance of a subclass of
`),Hc=s("a"),eT=a("ModelOutput"),tT=a(`. This output is a data structure containing all the information returned
by `),Qc=s("a"),oT=a("generate()"),sT=a(", but that can also be used as tuple or dictionary."),r_=c(),Yc=s("p"),rT=a("Here\u2019s an example:"),n_=c(),g(Mr.$$.fragment),a_=c(),Pt=s("p"),nT=a("The "),gh=s("code"),aT=a("generation_output"),iT=a(" object is a "),Kc=s("a"),cT=a("GreedySearchDecoderOnlyOutput"),lT=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"),dT=a("sequences"),pT=a(": the generated sequences of tokens"),mT=c(),tl=s("li"),fh=s("code"),hT=a("scores"),gT=a(" (optional): the prediction scores of the language modelling head, for each generation step"),uT=c(),ol=s("li"),_h=s("code"),fT=a("hidden_states"),_T=a(" (optional): the hidden states of the model, for each generation step"),bT=c(),sl=s("li"),bh=s("code"),vT=a("attentions"),yT=a(" (optional): the attention weights of the model, for each generation step"),c_=c(),V=s("p"),TT=a("Here we have the "),vh=s("code"),wT=a("scores"),$T=a(" since we passed along "),yh=s("code"),kT=a("output_scores=True"),xT=a(", but we don\u2019t have "),Th=s("code"),MT=a("hidden_states"),ET=a(` and
`),wh=s("code"),jT=a("attentions"),FT=a(" because we didn\u2019t pass "),$h=s("code"),LT=a("output_hidden_states=True"),zT=a(" or "),kh=s("code"),JT=a("output_attentions=True"),IT=a("."),l_=c(),re=s("p"),UT=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"),BT=a("None"),qT=a(". Here for instance "),Mh=s("code"),DT=a("generation_output.scores"),ST=a(` are all the generated prediction scores of the
language modeling head, and `),Eh=s("code"),PT=a("generation_output.attentions"),WT=a(" is "),jh=s("code"),VT=a("None"),ZT=a("."),d_=c(),ne=s("p"),GT=a("When using our "),Fh=s("code"),CT=a("generation_output"),NT=a(" object as a tuple, it only keeps the attributes that don\u2019t have "),Lh=s("code"),XT=a("None"),RT=a(` values.
Here, for instance, it has two elements, `),zh=s("code"),OT=a("loss"),AT=a(" then "),Jh=s("code"),HT=a("logits"),QT=a(", so"),p_=c(),g(Er.$$.fragment),m_=c(),Qo=s("p"),YT=a("will return the tuple "),Ih=s("code"),KT=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"),r1=a("None"),n1=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(),rl=s("p"),d1=a("We document here all output types."),u_=c(),ro=s("h3"),Yo=s("a"),Sh=s("span"),g(jr.$$.fragment),p1=c(),Ph=s("span"),m1=a("PyTorch"),f_=c(),no=s("div"),g(Fr.$$.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(Lr.$$.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(zr.$$.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)`),v_=c(),co=s("div"),g(Jr.$$.fragment),v1=c(),Gh=s("p"),y1=a("Base class for outputs of decoder-only generation models using sampling."),y_=c(),lo=s("div"),g(Ir.$$.fragment),T1=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)`),T_=c(),po=s("div"),g(Ur.$$.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(Br.$$.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(qr.$$.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(Dr.$$.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(Sr.$$.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(Pr.$$.fragment),I1=c(),Qh=s("span"),U1=a("TensorFlow"),E_=c(),_o=s("div"),g(Wr.$$.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(Vr.$$.fragment),D1=c(),Kh=s("p"),S1=a("Base class for outputs of decoder-only generation models using greedy search."),F_=c(),vo=s("div"),g(Zr.$$.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(),yo=s("div"),g(Gr.$$.fragment),V1=c(),tg=s("p"),Z1=a("Base class for outputs of decoder-only generation models using sampling."),z_=c(),To=s("div"),g(Cr.$$.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(Nr.$$.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(Xr.$$.fragment),R1=c(),rg=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(Rr.$$.fragment),A1=c(),ng=s("p"),H1=a("Base class for outputs of decoder-only generation models using beam sample."),B_=c(),xo=s("div"),g(Or.$$.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(Ar.$$.fragment),K1=c(),ig=s("p"),e0=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(Hr.$$.fragment),t0=c(),lg=s("span"),o0=a("FLAX"),S_=c(),qe=s("div"),g(Qr.$$.fragment),s0=c(),dg=s("p"),r0=a("Flax Base class for outputs of decoder-only generation models using sampling."),n0=c(),ts=s("div"),g(Yr.$$.fragment),a0=c(),pg=s("p"),i0=a("\u201CReturns a new object replacing the specified fields with new values."),P_=c(),De=s("div"),g(Kr.$$.fragment),c0=c(),mg=s("p"),l0=a("Flax Base class for outputs of decoder-only generation models using greedy search."),d0=c(),os=s("div"),g(en.$$.fragment),p0=c(),hg=s("p"),m0=a("\u201CReturns a new object replacing the specified fields with new values."),W_=c(),Se=s("div"),g(tn.$$.fragment),h0=c(),gg=s("p"),g0=a("Flax Base class for outputs of decoder-only generation models using greedy search."),u0=c(),ss=s("div"),g(on.$$.fragment),f0=c(),ug=s("p"),_0=a("\u201CReturns a new object replacing the specified fields with new values."),V_=c(),jo=s("h2"),rs=s("a"),fg=s("span"),g(sn.$$.fragment),b0=c(),_g=s("span"),v0=a("LogitsProcessor"),Z_=c(),ns=s("p"),y0=a("A "),nl=s("a"),T0=a("LogitsProcessor"),w0=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(rn.$$.fragment),$0=c(),vg=s("span"),k0=a("PyTorch"),C_=c(),Pe=s("div"),g(nn.$$.fragment),x0=c(),is=s("p"),al=s("a"),M0=a("LogitsProcessor"),E0=a(" enforcing alternated generation between the two codebooks of "),yg=s("code"),j0=a("Bark"),F0=a("\u2019s fine submodel."),L0=c(),il=s("div"),g(an.$$.fragment),N_=c(),ge=s("div"),g(cn.$$.fragment),z0=c(),ln=s("p"),J0=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 `),Tg=s("code"),I0=a("guidance_scale"),U0=a("."),B0=c(),dn=s("p"),q0=a("See "),pn=s("a"),D0=a("the paper"),S0=a(" for more information."),P0=c(),cl=s("div"),g(mn.$$.fragment),X_=c(),We=s("div"),g(hn.$$.fragment),W0=c(),cs=s("p"),ll=s("a"),V0=a("LogitsProcessor"),Z0=a(` that enforces no repetition of encoder input ids n-grams for the decoder ids. See
`),gn=s("a"),G0=a("ParlAI"),C0=a("."),N0=c(),dl=s("div"),g(un.$$.fragment),R_=c(),Ve=s("div"),g(fn.$$.fragment),X0=c(),pl=s("p"),ml=s("a"),R0=a("LogitsProcessor"),O0=a(" enforcing an exponential penalty on tokens that are not in the original input."),A0=c(),hl=s("div"),g(_n.$$.fragment),O_=c(),ue=s("div"),g(bn.$$.fragment),H0=c(),Wt=s("p"),gl=s("a"),Q0=a("LogitsWarper"),Y0=a(" that performs epsilon-sampling, i.e. restricting to tokens with "),wg=s("code"),K0=a("prob >= epsilon"),e2=a(`. Takes the
largest min_tokens_to_keep tokens if no tokens satisfy this constraint. See `),vn=s("a"),t2=a(`Truncation Sampling as Language Model
Desmoothing`),o2=a(" for more information."),s2=c(),g(ls.$$.fragment),r2=c(),ul=s("div"),g(yn.$$.fragment),A_=c(),fe=s("div"),g(Tn.$$.fragment),n2=c(),D=s("p"),fl=s("a"),a2=a("LogitsWarper"),i2=a(` that performs eta-sampling, a technique to filter out tokens with probabilities below a dynamic
cutoff value, `),$g=s("code"),c2=a("eta"),l2=a(", which is calculated based on a combination of the hyperparameter "),kg=s("code"),d2=a("epsilon"),p2=a(` and the entropy of
the token probabilities, i.e. `),xg=s("code"),m2=a("eta := min(epsilon, sqrt(epsilon * e^-entropy(probabilities)))"),h2=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 `),wn=s("a"),g2=a(`Truncation
Sampling as Language Model Desmoothing`),u2=a(" for more information. Note: "),Mg=s("code"),f2=a("do_sample"),_2=a(`
must be set to `),Eg=s("code"),b2=a("True"),v2=a(" for this "),jg=s("code"),y2=a("LogitsWarper"),T2=a(" to work."),w2=c(),g(ds.$$.fragment),$2=c(),_l=s("div"),g($n.$$.fragment),H_=c(),Ze=s("div"),g(kn.$$.fragment),k2=c(),bl=s("p"),vl=s("a"),x2=a("LogitsProcessor"),M2=a(` that exponentially increases the score of the eos_token_id after regulation_start has been
reached.`),E2=c(),yl=s("div"),g(xn.$$.fragment),Q_=c(),Ge=s("div"),g(Mn.$$.fragment),j2=c(),Tl=s("p"),wl=s("a"),F2=a("LogitsProcessor"),L2=a(" that enforces the specified token as the first generated token."),z2=c(),$l=s("div"),g(En.$$.fragment),Y_=c(),Ce=s("div"),g(jn.$$.fragment),J2=c(),ps=s("p"),kl=s("a"),I2=a("LogitsProcessor"),U2=a(" that enforces the specified token as the last generated token when "),Fg=s("code"),B2=a("max_length"),q2=a(" is reached."),D2=c(),xl=s("div"),g(Fn.$$.fragment),K_=c(),Ne=s("div"),g(Ln.$$.fragment),S2=c(),zn=s("p"),P2=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"),W2=a("inf"),V2=a(` so that they are
sampled at their corresponding index.`),Z2=c(),Ml=s("div"),g(Jn.$$.fragment),eb=c(),L=s("div"),g(In.$$.fragment),G2=c(),El=s("p"),jl=s("a"),C2=a("LogitsProcessor"),N2=a(" that enforces diverse beam search."),X2=c(),Lo=s("p"),R2=a("Note that this logits processor is only effective for "),Fl=s("a"),O2=a("PreTrainedModel.group_beam_search()"),A2=a(". See "),Un=s("a"),H2=a(`Diverse Beam
Search: Decoding Diverse Solutions from Neural Sequence Models`),Q2=a(` for more
details.`),Y2=c(),g(ms.$$.fragment),K2=c(),g(hs.$$.fragment),ew=c(),Bn=s("p"),tw=a(`Traditional beam search often generates very similar sequences across different beams.
`),zg=s("code"),ow=a("HammingDiversityLogitsProcessor"),sw=a(` addresses this by penalizing beams that generate tokens already chosen by other
beams in the same time step.`),rw=c(),Jg=s("p"),nw=a("How It Works:"),aw=c(),zo=s("ul"),Ll=s("li"),Ig=s("strong"),iw=a("Grouping Beams"),cw=a(": Beams are divided into groups. Each group selects tokens independently of the others."),lw=c(),zl=s("li"),Ug=s("strong"),dw=a("Penalizing Repeated Tokens"),pw=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.`),mw=c(),Jl=s("li"),Bg=s("strong"),hw=a("Promoting Diversity"),gw=a(`: This penalty discourages beams within a group from selecting the same tokens as
beams in other groups.`),uw=c(),qg=s("p"),fw=a("Benefits:"),_w=c(),qn=s("ul"),Il=s("li"),Dg=s("strong"),bw=a("Diverse Outputs"),vw=a(": Produces a variety of different sequences."),yw=c(),Ul=s("li"),Sg=s("strong"),Tw=a("Exploration"),ww=a(": Allows the model to explore different paths."),$w=c(),g(gs.$$.fragment),kw=c(),Bl=s("div"),g(Dn.$$.fragment),tb=c(),Xe=s("div"),g(Sn.$$.fragment),xw=c(),Vt=s("p"),ql=s("a"),Mw=a("LogitsProcessor"),Ew=a(" that removes all "),Pg=s("code"),jw=a("nan"),Fw=a(" and "),Wg=s("code"),Lw=a("inf"),zw=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.`),Jw=c(),Dl=s("div"),g(Pn.$$.fragment),ob=c(),Re=s("div"),g(Wn.$$.fragment),Iw=c(),us=s("p"),Sl=s("a"),Uw=a("LogitsWarper"),Bw=a(" and "),Pl=s("a"),qw=a("LogitsProcessor"),Dw=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.`),Sw=c(),Wl=s("div"),g(Vn.$$.fragment),sb=c(),Oe=s("div"),g(Zn.$$.fragment),Pw=c(),Vg=s("p"),Ww=a("Abstract base class for all logit processors that can be applied during generation."),Vw=c(),Vl=s("div"),g(Gn.$$.fragment),rb=c(),Ae=s("div"),g(Cn.$$.fragment),Zw=c(),G=s("p"),Gw=a("This class can be used to create a list of "),Zl=s("a"),Cw=a("LogitsProcessor"),Nw=a(" or "),Gl=s("a"),Xw=a("LogitsWarper"),Rw=a(` to subsequently process a
`),Zg=s("code"),Ow=a("scores"),Aw=a(" input tensor. This class inherits from list and adds a specific "),Gg=s("em"),Cg=s("strong"),Hw=a("call"),Qw=a(` method to apply each
`),Cl=s("a"),Yw=a("LogitsProcessor"),Kw=a(" or "),Nl=s("a"),e$=a("LogitsWarper"),t$=a(" to the inputs."),o$=c(),Xl=s("div"),g(Nn.$$.fragment),nb=c(),He=s("div"),g(Xn.$$.fragment),s$=c(),Ng=s("p"),r$=a("Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),n$=c(),Rl=s("div"),g(Rn.$$.fragment),ab=c(),Qe=s("div"),g(On.$$.fragment),a$=c(),Ol=s("p"),Al=s("a"),i$=a("LogitsProcessor"),c$=a(" enforcing a min-length by setting EOS probability to 0."),l$=c(),Hl=s("div"),g(An.$$.fragment),ib=c(),_e=s("div"),g(Hn.$$.fragment),d$=c(),je=s("p"),Ql=s("a"),p$=a("LogitsProcessor"),m$=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"),h$=a("min_length"),g$=a(" will compute the length of "),Rg=s("code"),u$=a("prompt + newly generated tokens"),f$=a(" whereas for other models it will behave as "),Og=s("code"),_$=a("min_new_tokens"),b$=a(`, that is, taking only into account
the newly generated ones.`),v$=c(),g(fs.$$.fragment),y$=c(),Yl=s("div"),g(Qn.$$.fragment),cb=c(),H=s("div"),g(Yn.$$.fragment),T$=c(),Kl=s("p"),ed=s("a"),w$=a("LogitsProcessor"),$$=a(" that enforces that specified sequences will never be selected."),k$=c(),g(_s.$$.fragment),x$=c(),g(bs.$$.fragment),M$=c(),td=s("div"),g(Kn.$$.fragment),lb=c(),Q=s("div"),g(ea.$$.fragment),E$=c(),Jo=s("p"),j$=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"),F$=a("LogitsProcessor"),L$=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"),z$=a("Fairseq"),J$=a("."),I$=c(),g(vs.$$.fragment),U$=c(),g(ys.$$.fragment),B$=c(),sd=s("div"),g(oa.$$.fragment),db=c(),Ye=s("div"),g(sa.$$.fragment),q$=c(),Ts=s("p"),rd=s("a"),D$=a("LogitsProcessor"),S$=a(` that enforces constrained generation and is useful for prefix-conditioned constrained
generation. See `),ra=s("a"),P$=a("Autoregressive Entity Retrieval"),W$=a(" for more information."),V$=c(),nd=s("div"),g(na.$$.fragment),pb=c(),be=s("div"),g(aa.$$.fragment),Z$=c(),ws=s("p"),ad=s("a"),G$=a("LogitsProcessor"),C$=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"),N$=a("paper"),X$=a(`. According to the
paper a penalty of around 1.2 yields a good balance between truthful generation and lack of repetition.`),R$=c(),g($s.$$.fragment),O$=c(),id=s("div"),g(ca.$$.fragment),mb=c(),Y=s("div"),g(la.$$.fragment),A$=c(),cd=s("p"),ld=s("a"),H$=a("LogitsProcessor"),Q$=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).`),Y$=c(),g(ks.$$.fragment),K$=c(),g(xs.$$.fragment),ek=c(),dd=s("div"),g(da.$$.fragment),hb=c(),Ke=s("div"),g(pa.$$.fragment),tk=c(),Fe=s("p"),pd=s("a"),ok=a("SuppressTokensAtBeginLogitsProcessor"),sk=a(" supresses a list of tokens as soon as the "),Ag=s("code"),rk=a("generate"),nk=a(` function starts
generating using `),Hg=s("code"),ak=a("begin_index"),ik=a(" tokens. This should ensure that the tokens defined by "),Qg=s("code"),ck=a("begin_suppress_tokens"),lk=a(` at not
sampled at the begining of the generation.`),dk=c(),md=s("div"),g(ma.$$.fragment),gb=c(),et=s("div"),g(ha.$$.fragment),pk=c(),ga=s("p"),mk=a("This processor can be used to suppress a list of tokens. The processor will set their log probs to "),Yg=s("code"),hk=a("-inf"),gk=a(` so that they
are not sampled.`),uk=c(),hd=s("div"),g(ua.$$.fragment),ub=c(),K=s("div"),g(fa.$$.fragment),fk=c(),gd=s("p"),ud=s("a"),_k=a("LogitsWarper"),bk=a(` for temperature (exponential scaling output probability distribution), which effectively means
that it can control the randomness of the predicted tokens.`),vk=c(),g(Ms.$$.fragment),yk=c(),g(Es.$$.fragment),Tk=c(),fd=s("div"),g(_a.$$.fragment),fb=c(),tt=s("div"),g(ba.$$.fragment),wk=c(),_d=s("p"),bd=s("a"),$k=a("LogitsWarper"),kk=a(" that performs top-k, i.e. restricting to the k highest probability elements."),xk=c(),vd=s("div"),g(va.$$.fragment),_b=c(),ve=s("div"),g(ya.$$.fragment),Mk=c(),yd=s("p"),Td=s("a"),Ek=a("LogitsWarper"),jk=a(" that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),Fk=c(),g(js.$$.fragment),Lk=c(),wd=s("div"),g(Ta.$$.fragment),bb=c(),ot=s("div"),g(wa.$$.fragment),zk=c(),Fs=s("p"),$d=s("a"),Jk=a("LogitsWarper"),Ik=a(" that performs typical decoding. See "),$a=s("a"),Uk=a(`Typical Decoding for Natural Language
Generation`),Bk=a(" for more information."),qk=c(),kd=s("div"),g(ka.$$.fragment),vb=c(),ee=s("div"),g(xa.$$.fragment),Dk=c(),st=s("p"),Sk=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"),Pk=a("guidance_scale"),Wk=a(". The unconditional scores are computed internally by prompting "),eu=s("code"),Vk=a("model"),Zk=a(` with
the `),tu=s("code"),Gk=a("unconditional_ids"),Ck=a(" branch."),Nk=c(),Ma=s("p"),Xk=a("See "),Ea=s("a"),Rk=a("the paper"),Ok=a(" for more information."),Ak=c(),g(Ls.$$.fragment),Hk=c(),xd=s("div"),g(ja.$$.fragment),yb=c(),ye=s("div"),g(Fa.$$.fragment),Qk=c(),La=s("p"),Yk=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"),Kk=a("inf"),e3=a(" so that they are sampled at their corresponding index."),t3=c(),za=s("p"),o3=a("See "),Ja=s("a"),s3=a("the paper"),r3=a(" for more information."),n3=c(),Md=s("div"),g(Ia.$$.fragment),Tb=c(),Io=s("h3"),zs=s("a"),su=s("span"),g(Ua.$$.fragment),a3=c(),ru=s("span"),i3=a("TensorFlow"),wb=c(),rt=s("div"),g(Ba.$$.fragment),c3=c(),Ed=s("p"),jd=s("a"),l3=a("TFLogitsProcessor"),d3=a(" that enforces the specified token as the first generated token."),p3=c(),Fd=s("div"),g(qa.$$.fragment),$b=c(),nt=s("div"),g(Da.$$.fragment),m3=c(),Js=s("p"),Ld=s("a"),h3=a("TFLogitsProcessor"),g3=a(" that enforces the specified token as the last generated token when "),nu=s("code"),u3=a("max_length"),f3=a(" is reached."),_3=c(),zd=s("div"),g(Sa.$$.fragment),kb=c(),at=s("div"),g(Pa.$$.fragment),b3=c(),Uo=s("p"),v3=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"),y3=a("0"),T3=a(` and all other tokens to
`),iu=s("code"),w3=a("-inf"),$3=a(" so that they are sampled at their corresponding index."),k3=c(),Jd=s("div"),g(Wa.$$.fragment),xb=c(),it=s("div"),g(Va.$$.fragment),x3=c(),cu=s("p"),M3=a("Abstract base class for all logit processors that can be applied during generation."),E3=c(),Is=s("div"),g(Za.$$.fragment),j3=c(),lu=s("p"),F3=a("TF method for processing logits."),Mb=c(),ct=s("div"),g(Ga.$$.fragment),L3=c(),Te=s("p"),z3=a("This class can be used to create a list of "),Id=s("a"),J3=a("TFLogitsProcessor"),I3=a(" to subsequently process a "),du=s("code"),U3=a("scores"),B3=a(` input tensor.
This class inherits from list and adds a specific `),pu=s("em"),mu=s("strong"),q3=a("call"),D3=a(" method to apply each "),Ud=s("a"),S3=a("TFLogitsProcessor"),P3=a(` to the
inputs.`),W3=c(),Bd=s("div"),g(Ca.$$.fragment),Eb=c(),lt=s("div"),g(Na.$$.fragment),V3=c(),hu=s("p"),Z3=a("Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),G3=c(),Us=s("div"),g(Xa.$$.fragment),C3=c(),gu=s("p"),N3=a("TF method for warping logits."),jb=c(),dt=s("div"),g(Ra.$$.fragment),X3=c(),qd=s("p"),Dd=s("a"),R3=a("TFLogitsProcessor"),O3=a(" enforcing a min-length by setting EOS probability to 0."),A3=c(),Sd=s("div"),g(Oa.$$.fragment),Fb=c(),pt=s("div"),g(Aa.$$.fragment),H3=c(),Pd=s("p"),Wd=s("a"),Q3=a("TFLogitsProcessor"),Y3=a(" that enforces that specified sequences will never be sampled."),K3=c(),Vd=s("div"),g(Ha.$$.fragment),Lb=c(),mt=s("div"),g(Qa.$$.fragment),e4=c(),Bs=s("p"),Zd=s("a"),t4=a("TFLogitsProcessor"),o4=a(` that enforces no repetition of n-grams. See
`),Ya=s("a"),s4=a("Fairseq"),r4=a("."),n4=c(),Gd=s("div"),g(Ka.$$.fragment),zb=c(),ht=s("div"),g(ei.$$.fragment),a4=c(),Cd=s("p"),Nd=s("a"),i4=a("TFLogitsProcessor"),c4=a(" enforcing an exponential penalty on repeated sequences."),l4=c(),Xd=s("div"),g(ti.$$.fragment),Jb=c(),gt=s("div"),g(oi.$$.fragment),d4=c(),Le=s("p"),Rd=s("a"),p4=a("TFSuppressTokensAtBeginLogitsProcessor"),m4=a(" suppresses a list of tokens as soon as the "),uu=s("code"),h4=a("generate"),g4=a(` function starts
generating using `),fu=s("code"),u4=a("begin_index"),f4=a(" tokens. This should ensure that the tokens defined by "),_u=s("code"),_4=a("begin_suppress_tokens"),b4=a(` at not
sampled at the begining of the generation.`),v4=c(),Od=s("div"),g(si.$$.fragment),Ib=c(),ut=s("div"),g(ri.$$.fragment),y4=c(),ni=s("p"),T4=a("This processor can be used to suppress a list of tokens. The processor will set their log probs to "),bu=s("code"),w4=a("-inf"),$4=a(` so that they
are not sampled.`),k4=c(),Ad=s("div"),g(ai.$$.fragment),Ub=c(),ft=s("div"),g(ii.$$.fragment),x4=c(),Hd=s("p"),Qd=s("a"),M4=a("TFLogitsWarper"),E4=a(" for temperature (exponential scaling output probability distribution)."),j4=c(),Yd=s("div"),g(ci.$$.fragment),Bb=c(),_t=s("div"),g(li.$$.fragment),F4=c(),Kd=s("p"),ep=s("a"),L4=a("TFLogitsWarper"),z4=a(" that performs top-k, i.e. restricting to the k highest probability elements."),J4=c(),tp=s("div"),g(di.$$.fragment),qb=c(),bt=s("div"),g(pi.$$.fragment),I4=c(),op=s("p"),sp=s("a"),U4=a("TFLogitsWarper"),B4=a(" that performs top-p, i.e. restricting to top tokens summing to <= prob_cut_off."),q4=c(),rp=s("div"),g(mi.$$.fragment),Db=c(),Bo=s("h3"),qs=s("a"),vu=s("span"),g(hi.$$.fragment),D4=c(),yu=s("span"),S4=a("FLAX"),Sb=c(),vt=s("div"),g(gi.$$.fragment),P4=c(),np=s("p"),ap=s("a"),W4=a("FlaxLogitsProcessor"),V4=a(" that enforces the specified token as the first generated token."),Z4=c(),ip=s("div"),g(ui.$$.fragment),Pb=c(),yt=s("div"),g(fi.$$.fragment),G4=c(),Ds=s("p"),cp=s("a"),C4=a("FlaxLogitsProcessor"),N4=a(" that enforces the specified token as the last generated token when "),Tu=s("code"),X4=a("max_length"),R4=a(" is reached."),O4=c(),lp=s("div"),g(_i.$$.fragment),Wb=c(),Tt=s("div"),g(bi.$$.fragment),A4=c(),Ss=s("p"),dp=s("a"),H4=a("FlaxLogitsProcessor"),Q4=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"),Y4=a("-inf"),K4=a(" so that they are sampled at their corresponding index."),ex=c(),pp=s("div"),g(vi.$$.fragment),Vb=c(),wt=s("div"),g(yi.$$.fragment),tx=c(),$u=s("p"),ox=a("Abstract base class for all logit processors that can be applied during generation."),sx=c(),Ps=s("div"),g(Ti.$$.fragment),rx=c(),ku=s("p"),nx=a("Flax method for processing logits."),Zb=c(),$t=s("div"),g(wi.$$.fragment),ax=c(),C=s("p"),ix=a("This class can be used to create a list of "),mp=s("a"),cx=a("FlaxLogitsProcessor"),lx=a(" or "),hp=s("a"),dx=a("FlaxLogitsWarper"),px=a(` to subsequently process
a `),xu=s("code"),mx=a("scores"),hx=a(" input tensor. This class inherits from list and adds a specific "),Mu=s("em"),Eu=s("strong"),gx=a("call"),ux=a(` method to apply each
`),gp=s("a"),fx=a("FlaxLogitsProcessor"),_x=a(" or "),up=s("a"),bx=a("FlaxLogitsWarper"),vx=a(" to the inputs."),yx=c(),fp=s("div"),g($i.$$.fragment),Gb=c(),kt=s("div"),g(ki.$$.fragment),Tx=c(),ju=s("p"),wx=a("Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),$x=c(),Ws=s("div"),g(xi.$$.fragment),kx=c(),Fu=s("p"),xx=a("Flax method for warping logits."),Cb=c(),xt=s("div"),g(Mi.$$.fragment),Mx=c(),_p=s("p"),bp=s("a"),Ex=a("FlaxLogitsProcessor"),jx=a(" enforcing a min-length by setting EOS probability to 0."),Fx=c(),vp=s("div"),g(Ei.$$.fragment),Nb=c(),Mt=s("div"),g(ji.$$.fragment),Lx=c(),ze=s("p"),yp=s("a"),zx=a("FlaxLogitsProcessor"),Jx=a(" supressing a list of tokens as soon as the "),Lu=s("code"),Ix=a("generate"),Ux=a(` function starts generating using
`),zu=s("code"),Bx=a("begin_index"),qx=a(" tokens. This should ensure that the tokens defined by "),Ju=s("code"),Dx=a("begin_suppress_tokens"),Sx=a(` are not sampled at the
begining of the generation.`),Px=c(),Tp=s("div"),g(Fi.$$.fragment),Xb=c(),Et=s("div"),g(Li.$$.fragment),Wx=c(),Vs=s("p"),wp=s("a"),Vx=a("FlaxLogitsProcessor"),Zx=a(` suppressing a list of tokens at each decoding step. The processor will set their log probs
to be `),Iu=s("code"),Gx=a("-inf"),Cx=a(" so they are not sampled."),Nx=c(),$p=s("div"),g(zi.$$.fragment),Rb=c(),jt=s("div"),g(Ji.$$.fragment),Xx=c(),kp=s("p"),xp=s("a"),Rx=a("FlaxLogitsWarper"),Ox=a(" for temperature (exponential scaling output probability distribution)."),Ax=c(),Mp=s("div"),g(Ii.$$.fragment),Ob=c(),Ft=s("div"),g(Ui.$$.fragment),Hx=c(),Ep=s("p"),jp=s("a"),Qx=a("FlaxLogitsWarper"),Yx=a(" that performs top-k, i.e. restricting to the k highest probability elements."),Kx=c(),Fp=s("div"),g(Bi.$$.fragment),Ab=c(),Lt=s("div"),g(qi.$$.fragment),eM=c(),Lp=s("p"),zp=s("a"),tM=a("FlaxLogitsWarper"),oM=a(" that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),sM=c(),Jp=s("div"),g(Di.$$.fragment),Hb=c(),zt=s("div"),g(Si.$$.fragment),rM=c(),Pi=s("p"),nM=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"),aM=a("inf"),iM=a(" so that they are sampled at their corresponding index."),cM=c(),Ip=s("div"),g(Wi.$$.fragment),Qb=c(),qo=s("h2"),Zs=s("a"),Bu=s("span"),g(Vi.$$.fragment),lM=c(),qu=s("span"),dM=a("StoppingCriteria"),Yb=c(),Gs=s("p"),pM=a("A "),Up=s("a"),mM=a("StoppingCriteria"),hM=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),gM=c(),Du=s("p"),uM=a("Abstract base class for all stopping criteria that can be applied during generation."),fM=c(),Bp=s("div"),g(Gi.$$.fragment),ev=c(),Do=s("div"),g(Ci.$$.fragment),_M=c(),qp=s("div"),g(Ni.$$.fragment),tv=c(),It=s("div"),g(Xi.$$.fragment),bM=c(),Ri=s("p"),vM=a("This class can be used to stop generation whenever the full generated number of tokens exceeds "),Su=s("code"),yM=a("max_length"),TM=a(`. Keep
in mind for decoder-only type of transformers, this will include the initial prompted tokens.`),wM=c(),Dp=s("div"),g(Oi.$$.fragment),ov=c(),Ut=s("div"),g(Ai.$$.fragment),$M=c(),Hi=s("p"),kM=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"),xM=a("initial_time"),MM=a("."),EM=c(),Sp=s("div"),g(Qi.$$.fragment),sv=c(),So=s("h2"),Cs=s("a"),Wu=s("span"),g(Yi.$$.fragment),jM=c(),Vu=s("span"),FM=a("Constraints"),rv=c(),Ns=s("p"),LM=a("A "),Pp=s("a"),zM=a("Constraint"),JM=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."),nv=c(),z=s("div"),g(Ki.$$.fragment),IM=c(),Zu=s("p"),UM=a(`Abstract base class for all constraints that can be applied during generation.
It must define how the constraint can be satisfied.`),BM=c(),Gu=s("p"),qM=a("All classes that inherit Constraint must follow the requirement that"),DM=c(),g(Xs.$$.fragment),SM=c(),Cu=s("p"),PM=a("will always terminate (halt)."),WM=c(),Rs=s("div"),g(ec.$$.fragment),VM=c(),Nu=s("p"),ZM=a("When called, returns the token that would take this constraint one step closer to being fulfilled."),GM=c(),Os=s("div"),g(tc.$$.fragment),CM=c(),Xu=s("p"),NM=a("Creates a new instance of this constraint."),XM=c(),As=s("div"),g(oc.$$.fragment),RM=c(),Ru=s("p"),OM=a("Reads in a token and returns whether it creates progress."),AM=c(),Hs=s("div"),g(sc.$$.fragment),HM=c(),rc=s("p"),QM=a("Returns the number of remaining steps of "),Ou=s("code"),YM=a("advance()"),KM=a(" in order to complete this constraint."),eE=c(),Qs=s("div"),g(nc.$$.fragment),tE=c(),Au=s("p"),oE=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.`),sE=c(),Ys=s("div"),g(ac.$$.fragment),rE=c(),Hu=s("p"),nE=a("Tests whether this constraint has been properly defined."),aE=c(),Zt=s("div"),g(ic.$$.fragment),iE=c(),cc=s("p"),cE=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"),lE=a("does_advance(self, token_id: int)"),dE=a("."),pE=c(),Yu=s("p"),mE=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)`),av=c(),Po=s("div"),g(lc.$$.fragment),hE=c(),Wp=s("p"),Vp=s("a"),gE=a("Constraint"),uE=a(" enforcing that an ordered sequence of tokens is included in the output."),iv=c(),Wo=s("div"),g(dc.$$.fragment),fE=c(),pc=s("p"),_E=a("A special "),Zp=s("a"),bE=a("Constraint"),vE=a(" that is fulfilled by fulfilling just one of several constraints."),cv=c(),we=s("div"),g(mc.$$.fragment),yE=c(),Ku=s("p"),TE=a("A class for beam scorers to track its progress through a list of constraints."),wE=c(),R=s("div"),g(hc.$$.fragment),$E=c(),ef=s("p"),kE=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.`),xE=c(),Vo=s("p"),ME=a("Given constraints "),tf=s("code"),EE=a("c_i = {t_ij | j == # of tokens}"),jE=a(`, If we\u2019re not in the middle of progressing through a
specific constraint `),of=s("code"),FE=a("c_i"),LE=a(", we return:"),zE=c(),sf=s("p"),rf=s("code"),JE=a("[t_k1 for k in indices of unfulfilled constraints]"),IE=c(),Bt=s("p"),UE=a(`If we are in the middle of a constraint, then we return:
`),nf=s("code"),BE=a("[t_ij]"),qE=a(", where "),af=s("code"),DE=a("i"),SE=a(" is the index of the inprogress constraint, "),cf=s("code"),PE=a("j"),WE=a(" is the next step for the constraint."),VE=c(),lf=s("p"),ZE=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.`),GE=c(),Ks=s("div"),g(gc.$$.fragment),CE=c(),df=s("p"),NE=a("token_ids: the tokens generated thus far to reset the state of the progress through constraints."),lv=c(),Zo=s("h2"),er=s("a"),pf=s("span"),g(uc.$$.fragment),XE=c(),mf=s("span"),RE=a("BeamSearch"),dv=c(),$e=s("div"),g(fc.$$.fragment),OE=c(),Go=s("p"),AE=a("Abstract base class for all beam scorers that are used for "),Gp=s("a"),HE=a("beam_search()"),QE=a(` and
`),Cp=s("a"),YE=a("beam_sample()"),KE=a("."),ej=c(),Np=s("div"),g(_c.$$.fragment),tj=c(),Xp=s("div"),g(bc.$$.fragment),pv=c(),N=s("div"),g(vc.$$.fragment),oj=c(),Rp=s("p"),Op=s("a"),sj=a("BeamScorer"),rj=a(" implementing standard beam search decoding."),nj=c(),yc=s("p"),aj=a("Adapted in part from "),Tc=s("a"),ij=a(`Facebook\u2019s XLM beam search
code`),cj=a("."),lj=c(),Ap=s("p"),dj=a("Reference for the diverse beam search algorithm and implementation "),wc=s("a"),pj=a(`Ashwin Kalyan\u2019s DBS
implementation`),mj=c(),Hp=s("div"),g($c.$$.fragment),hj=c(),Qp=s("div"),g(kc.$$.fragment),mv=c(),ke=s("div"),g(xc.$$.fragment),gj=c(),Yp=s("p"),Kp=s("a"),uj=a("BeamScorer"),fj=a(" implementing constrained beam search decoding."),_j=c(),em=s("div"),g(Mc.$$.fragment),bj=c(),tm=s("div"),g(Ec.$$.fragment),hv=c(),Co=s("h2"),tr=s("a"),hf=s("span"),g(jc.$$.fragment),vj=c(),gf=s("span"),yj=a("Utilities"),gv=c(),qt=s("div"),g(Fc.$$.fragment),Tj=c(),uf=s("p"),wj=a("Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),$j=c(),om=s("p"),kj=a("From: "),Lc=s("a"),xj=a("https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),uv=c(),Dt=s("div"),g(zc.$$.fragment),Mj=c(),ff=s("p"),Ej=a("Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),jj=c(),sm=s("p"),Fj=a("From: "),Jc=s("a"),Lj=a("https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),fv=c(),No=s("h2"),or=s("a"),_f=s("span"),g(Ic.$$.fragment),zj=c(),bf=s("span"),Jj=a("Streamers"),_v=c(),P=s("div"),g(Uc.$$.fragment),Ij=c(),vf=s("p"),Uj=a("Simple text streamer that prints the token(s) to stdout as soon as entire words are formed."),Bj=c(),g(sr.$$.fragment),qj=c(),g(rr.$$.fragment),Dj=c(),nr=s("div"),g(Bc.$$.fragment),Sj=c(),yf=s("p"),Pj=a("Flushes any remaining cache and prints a newline to stdout."),Wj=c(),ar=s("div"),g(qc.$$.fragment),Vj=c(),Tf=s("p"),Zj=a("Prints the new text to stdout. If the stream is ending, also prints a newline."),Gj=c(),ir=s("div"),g(Dc.$$.fragment),Cj=c(),wf=s("p"),Nj=a("Receives tokens, decodes them, and prints them to stdout as soon as they form entire words."),bv=c(),te=s("div"),g(Sc.$$.fragment),Xj=c(),$f=s("p"),Rj=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).`),Oj=c(),g(cr.$$.fragment),Aj=c(),g(lr.$$.fragment),Hj=c(),dr=s("div"),g(Pc.$$.fragment),Qj=c(),kf=s("p"),Yj=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);y=r(p,"META",{name:!0,content:!0}),p.forEach(o),x=l(t),$=r(t,"H1",{class:!0});var Wc=n($);w=r(Wc,"A",{id:!0,class:!0,href:!0});var xf=n(w);M=r(xf,"SPAN",{});var Mf=n(M);u(h.$$.fragment,Mf),Mf.forEach(o),xf.forEach(o),k=l(Wc),Z=r(Wc,"SPAN",{});var Ef=n(Z);U=i(Ef,"Utilities for Generation"),Ef.forEach(o),Wc.forEach(o),B=l(t),F=r(t,"P",{});var q=n(F);W=i(q,"This page lists all the utility functions used by "),oe=r(q,"A",{href:!0});var jf=n(oe);Ue=i(jf,"generate()"),jf.forEach(o),S=i(q,`,
`),se=r(q,"A",{href:!0});var Ff=n(se);Be=i(Ff,"greedy_search()"),Ff.forEach(o),A=i(q,`,
`),j=r(q,"A",{href:!0});var Lf=n(j);Kt=i(Lf,"contrastive_search()"),Lf.forEach(o),eo=i(q,`,
`),xe=r(q,"A",{href:!0});var zf=n(xe);to=i(zf,"sample()"),zf.forEach(o),oo=i(q,`,
`),Cc=r(q,"A",{href:!0});var Jf=n(Cc);Wy=i(Jf,"beam_search()"),Jf.forEach(o),Vy=i(q,`,
`),Nc=r(q,"A",{href:!0});var If=n(Nc);Zy=i(If,"beam_sample()"),If.forEach(o),Gy=i(q,`,
`),Xc=r(q,"A",{href:!0});var Uf=n(Xc);Cy=i(Uf,"group_beam_search()"),Uf.forEach(o),Ny=i(q,`, and
`),Rc=r(q,"A",{href:!0});var Bf=n(Rc);Xy=i(Bf,"constrained_beam_search()"),Bf.forEach(o),Ry=i(q,"."),q.forEach(o),t_=l(t),Oc=r(t,"P",{});var qf=n(Oc);Oy=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=r(t,"H2",{class:!0});var Vc=n(so);Ho=r(Vc,"A",{id:!0,class:!0,href:!0});var Df=n(Ho);mh=r(Df,"SPAN",{});var Sf=n(mh);u(xr.$$.fragment,Sf),Sf.forEach(o),Df.forEach(o),Ay=l(Vc),hh=r(Vc,"SPAN",{});var Pf=n(hh);Hy=i(Pf,"Generate Outputs"),Pf.forEach(o),Vc.forEach(o),s_=l(t),Me=r(t,"P",{});var St=n(Me);Qy=i(St,"The output of "),Ac=r(St,"A",{href:!0});var Wf=n(Ac);Yy=i(Wf,"generate()"),Wf.forEach(o),Ky=i(St,` is an instance of a subclass of
`),Hc=r(St,"A",{href:!0});var Vf=n(Hc);eT=i(Vf,"ModelOutput"),Vf.forEach(o),tT=i(St,`. This output is a data structure containing all the information returned
by `),Qc=r(St,"A",{href:!0});var Zf=n(Qc);oT=i(Zf,"generate()"),Zf.forEach(o),sT=i(St,", but that can also be used as tuple or dictionary."),St.forEach(o),r_=l(t),Yc=r(t,"P",{});var qF=n(Yc);rT=i(qF,"Here\u2019s an example:"),qF.forEach(o),n_=l(t),u(Mr.$$.fragment,t),a_=l(t),Pt=r(t,"P",{});var rm=n(Pt);nT=i(rm,"The "),gh=r(rm,"CODE",{});var DF=n(gh);aT=i(DF,"generation_output"),DF.forEach(o),iT=i(rm," object is a "),Kc=r(rm,"A",{href:!0});var SF=n(Kc);cT=i(SF,"GreedySearchDecoderOnlyOutput"),SF.forEach(o),lT=i(rm,`, as we can
see in the documentation of that class below, it means it has the following attributes:`),rm.forEach(o),i_=l(t),Ee=r(t,"UL",{});var pr=n(Ee);el=r(pr,"LI",{});var Kj=n(el);uh=r(Kj,"CODE",{});var PF=n(uh);dT=i(PF,"sequences"),PF.forEach(o),pT=i(Kj,": the generated sequences of tokens"),Kj.forEach(o),mT=l(pr),tl=r(pr,"LI",{});var eF=n(tl);fh=r(eF,"CODE",{});var WF=n(fh);hT=i(WF,"scores"),WF.forEach(o),gT=i(eF," (optional): the prediction scores of the language modelling head, for each generation step"),eF.forEach(o),uT=l(pr),ol=r(pr,"LI",{});var tF=n(ol);_h=r(tF,"CODE",{});var VF=n(_h);fT=i(VF,"hidden_states"),VF.forEach(o),_T=i(tF," (optional): the hidden states of the model, for each generation step"),tF.forEach(o),bT=l(pr),sl=r(pr,"LI",{});var oF=n(sl);bh=r(oF,"CODE",{});var ZF=n(bh);vT=i(ZF,"attentions"),ZF.forEach(o),yT=i(oF," (optional): the attention weights of the model, for each generation step"),oF.forEach(o),pr.forEach(o),c_=l(t),V=r(t,"P",{});var ie=n(V);TT=i(ie,"Here we have the "),vh=r(ie,"CODE",{});var GF=n(vh);wT=i(GF,"scores"),GF.forEach(o),$T=i(ie," since we passed along "),yh=r(ie,"CODE",{});var CF=n(yh);kT=i(CF,"output_scores=True"),CF.forEach(o),xT=i(ie,", but we don\u2019t have "),Th=r(ie,"CODE",{});var NF=n(Th);MT=i(NF,"hidden_states"),NF.forEach(o),ET=i(ie,` and
`),wh=r(ie,"CODE",{});var XF=n(wh);jT=i(XF,"attentions"),XF.forEach(o),FT=i(ie," because we didn\u2019t pass "),$h=r(ie,"CODE",{});var RF=n($h);LT=i(RF,"output_hidden_states=True"),RF.forEach(o),zT=i(ie," or "),kh=r(ie,"CODE",{});var OF=n(kh);JT=i(OF,"output_attentions=True"),OF.forEach(o),IT=i(ie,"."),ie.forEach(o),l_=l(t),re=r(t,"P",{});var Gt=n(re);UT=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=r(Gt,"CODE",{});var AF=n(xh);BT=i(AF,"None"),AF.forEach(o),qT=i(Gt,". Here for instance "),Mh=r(Gt,"CODE",{});var HF=n(Mh);DT=i(HF,"generation_output.scores"),HF.forEach(o),ST=i(Gt,` are all the generated prediction scores of the
language modeling head, and `),Eh=r(Gt,"CODE",{});var QF=n(Eh);PT=i(QF,"generation_output.attentions"),QF.forEach(o),WT=i(Gt," is "),jh=r(Gt,"CODE",{});var YF=n(jh);VT=i(YF,"None"),YF.forEach(o),ZT=i(Gt,"."),Gt.forEach(o),d_=l(t),ne=r(t,"P",{});var Ct=n(ne);GT=i(Ct,"When using our "),Fh=r(Ct,"CODE",{});var KF=n(Fh);CT=i(KF,"generation_output"),KF.forEach(o),NT=i(Ct," object as a tuple, it only keeps the attributes that don\u2019t have "),Lh=r(Ct,"CODE",{});var eL=n(Lh);XT=i(eL,"None"),eL.forEach(o),RT=i(Ct,` values.
Here, for instance, it has two elements, `),zh=r(Ct,"CODE",{});var tL=n(zh);OT=i(tL,"loss"),tL.forEach(o),AT=i(Ct," then "),Jh=r(Ct,"CODE",{});var oL=n(Jh);HT=i(oL,"logits"),oL.forEach(o),QT=i(Ct,", so"),Ct.forEach(o),p_=l(t),u(Er.$$.fragment,t),m_=l(t),Qo=r(t,"P",{});var yv=n(Qo);YT=i(yv,"will return the tuple "),Ih=r(yv,"CODE",{});var sL=n(Ih);KT=i(sL,"(generation_output.sequences, generation_output.scores)"),sL.forEach(o),e1=i(yv," for instance."),yv.forEach(o),h_=l(t),ae=r(t,"P",{});var Nt=n(ae);t1=i(Nt,"When using our "),Uh=r(Nt,"CODE",{});var rL=n(Uh);o1=i(rL,"generation_output"),rL.forEach(o),s1=i(Nt," object as a dictionary, it only keeps the attributes that don\u2019t have "),Bh=r(Nt,"CODE",{});var nL=n(Bh);r1=i(nL,"None"),nL.forEach(o),n1=i(Nt,`
values. Here, for instance, it has two keys that are `),qh=r(Nt,"CODE",{});var aL=n(qh);a1=i(aL,"sequences"),aL.forEach(o),i1=i(Nt," and "),Dh=r(Nt,"CODE",{});var iL=n(Dh);c1=i(iL,"scores"),iL.forEach(o),l1=i(Nt,"."),Nt.forEach(o),g_=l(t),rl=r(t,"P",{});var cL=n(rl);d1=i(cL,"We document here all output types."),cL.forEach(o),u_=l(t),ro=r(t,"H3",{class:!0});var Tv=n(ro);Yo=r(Tv,"A",{id:!0,class:!0,href:!0});var lL=n(Yo);Sh=r(lL,"SPAN",{});var dL=n(Sh);u(jr.$$.fragment,dL),dL.forEach(o),lL.forEach(o),p1=l(Tv),Ph=r(Tv,"SPAN",{});var pL=n(Ph);m1=i(pL,"PyTorch"),pL.forEach(o),Tv.forEach(o),f_=l(t),no=r(t,"DIV",{class:!0});var wv=n(no);u(Fr.$$.fragment,wv),h1=l(wv),Wh=r(wv,"P",{});var mL=n(Wh);g1=i(mL,`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)`),mL.forEach(o),wv.forEach(o),__=l(t),ao=r(t,"DIV",{class:!0});var $v=n(ao);u(Lr.$$.fragment,$v),u1=l($v),Vh=r($v,"P",{});var hL=n(Vh);f1=i(hL,"Base class for outputs of decoder-only generation models using greedy search."),hL.forEach(o),$v.forEach(o),b_=l(t),io=r(t,"DIV",{class:!0});var kv=n(io);u(zr.$$.fragment,kv),_1=l(kv),Zh=r(kv,"P",{});var gL=n(Zh);b1=i(gL,`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)`),gL.forEach(o),kv.forEach(o),v_=l(t),co=r(t,"DIV",{class:!0});var xv=n(co);u(Jr.$$.fragment,xv),v1=l(xv),Gh=r(xv,"P",{});var uL=n(Gh);y1=i(uL,"Base class for outputs of decoder-only generation models using sampling."),uL.forEach(o),xv.forEach(o),y_=l(t),lo=r(t,"DIV",{class:!0});var Mv=n(lo);u(Ir.$$.fragment,Mv),T1=l(Mv),Ch=r(Mv,"P",{});var fL=n(Ch);w1=i(fL,`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)`),fL.forEach(o),Mv.forEach(o),T_=l(t),po=r(t,"DIV",{class:!0});var Ev=n(po);u(Ur.$$.fragment,Ev),$1=l(Ev),Nh=r(Ev,"P",{});var _L=n(Nh);k1=i(_L,"Base class for outputs of decoder-only generation models using beam search."),_L.forEach(o),Ev.forEach(o),w_=l(t),mo=r(t,"DIV",{class:!0});var jv=n(mo);u(Br.$$.fragment,jv),x1=l(jv),Xh=r(jv,"P",{});var bL=n(Xh);M1=i(bL,`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)`),bL.forEach(o),jv.forEach(o),$_=l(t),ho=r(t,"DIV",{class:!0});var Fv=n(ho);u(qr.$$.fragment,Fv),E1=l(Fv),Rh=r(Fv,"P",{});var vL=n(Rh);j1=i(vL,"Base class for outputs of decoder-only generation models using beam sample."),vL.forEach(o),Fv.forEach(o),k_=l(t),go=r(t,"DIV",{class:!0});var Lv=n(go);u(Dr.$$.fragment,Lv),F1=l(Lv),Oh=r(Lv,"P",{});var yL=n(Oh);L1=i(yL,"Base class for outputs of decoder-only generation models using contrastive search."),yL.forEach(o),Lv.forEach(o),x_=l(t),uo=r(t,"DIV",{class:!0});var zv=n(uo);u(Sr.$$.fragment,zv),z1=l(zv),Ah=r(zv,"P",{});var TL=n(Ah);J1=i(TL,"Base class for outputs of decoder-only generation models using contrastive search."),TL.forEach(o),zv.forEach(o),M_=l(t),fo=r(t,"H3",{class:!0});var Jv=n(fo);Ko=r(Jv,"A",{id:!0,class:!0,href:!0});var wL=n(Ko);Hh=r(wL,"SPAN",{});var $L=n(Hh);u(Pr.$$.fragment,$L),$L.forEach(o),wL.forEach(o),I1=l(Jv),Qh=r(Jv,"SPAN",{});var kL=n(Qh);U1=i(kL,"TensorFlow"),kL.forEach(o),Jv.forEach(o),E_=l(t),_o=r(t,"DIV",{class:!0});var Iv=n(_o);u(Wr.$$.fragment,Iv),B1=l(Iv),Yh=r(Iv,"P",{});var xL=n(Yh);q1=i(xL,`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)`),xL.forEach(o),Iv.forEach(o),j_=l(t),bo=r(t,"DIV",{class:!0});var Uv=n(bo);u(Vr.$$.fragment,Uv),D1=l(Uv),Kh=r(Uv,"P",{});var ML=n(Kh);S1=i(ML,"Base class for outputs of decoder-only generation models using greedy search."),ML.forEach(o),Uv.forEach(o),F_=l(t),vo=r(t,"DIV",{class:!0});var Bv=n(vo);u(Zr.$$.fragment,Bv),P1=l(Bv),eg=r(Bv,"P",{});var EL=n(eg);W1=i(EL,`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)`),EL.forEach(o),Bv.forEach(o),L_=l(t),yo=r(t,"DIV",{class:!0});var qv=n(yo);u(Gr.$$.fragment,qv),V1=l(qv),tg=r(qv,"P",{});var jL=n(tg);Z1=i(jL,"Base class for outputs of decoder-only generation models using sampling."),jL.forEach(o),qv.forEach(o),z_=l(t),To=r(t,"DIV",{class:!0});var Dv=n(To);u(Cr.$$.fragment,Dv),G1=l(Dv),og=r(Dv,"P",{});var FL=n(og);C1=i(FL,`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)`),FL.forEach(o),Dv.forEach(o),J_=l(t),wo=r(t,"DIV",{class:!0});var Sv=n(wo);u(Nr.$$.fragment,Sv),N1=l(Sv),sg=r(Sv,"P",{});var LL=n(sg);X1=i(LL,"Base class for outputs of decoder-only generation models using beam search."),LL.forEach(o),Sv.forEach(o),I_=l(t),$o=r(t,"DIV",{class:!0});var Pv=n($o);u(Xr.$$.fragment,Pv),R1=l(Pv),rg=r(Pv,"P",{});var zL=n(rg);O1=i(zL,`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)`),zL.forEach(o),Pv.forEach(o),U_=l(t),ko=r(t,"DIV",{class:!0});var Wv=n(ko);u(Rr.$$.fragment,Wv),A1=l(Wv),ng=r(Wv,"P",{});var JL=n(ng);H1=i(JL,"Base class for outputs of decoder-only generation models using beam sample."),JL.forEach(o),Wv.forEach(o),B_=l(t),xo=r(t,"DIV",{class:!0});var Vv=n(xo);u(Or.$$.fragment,Vv),Q1=l(Vv),ag=r(Vv,"P",{});var IL=n(ag);Y1=i(IL,`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)`),IL.forEach(o),Vv.forEach(o),q_=l(t),Mo=r(t,"DIV",{class:!0});var Zv=n(Mo);u(Ar.$$.fragment,Zv),K1=l(Zv),ig=r(Zv,"P",{});var UL=n(ig);e0=i(UL,"Base class for outputs of decoder-only generation models using contrastive search."),UL.forEach(o),Zv.forEach(o),D_=l(t),Eo=r(t,"H3",{class:!0});var Gv=n(Eo);es=r(Gv,"A",{id:!0,class:!0,href:!0});var BL=n(es);cg=r(BL,"SPAN",{});var qL=n(cg);u(Hr.$$.fragment,qL),qL.forEach(o),BL.forEach(o),t0=l(Gv),lg=r(Gv,"SPAN",{});var DL=n(lg);o0=i(DL,"FLAX"),DL.forEach(o),Gv.forEach(o),S_=l(t),qe=r(t,"DIV",{class:!0});var nm=n(qe);u(Qr.$$.fragment,nm),s0=l(nm),dg=r(nm,"P",{});var SL=n(dg);r0=i(SL,"Flax Base class for outputs of decoder-only generation models using sampling."),SL.forEach(o),n0=l(nm),ts=r(nm,"DIV",{class:!0});var Cv=n(ts);u(Yr.$$.fragment,Cv),a0=l(Cv),pg=r(Cv,"P",{});var PL=n(pg);i0=i(PL,"\u201CReturns a new object replacing the specified fields with new values."),PL.forEach(o),Cv.forEach(o),nm.forEach(o),P_=l(t),De=r(t,"DIV",{class:!0});var am=n(De);u(Kr.$$.fragment,am),c0=l(am),mg=r(am,"P",{});var WL=n(mg);l0=i(WL,"Flax Base class for outputs of decoder-only generation models using greedy search."),WL.forEach(o),d0=l(am),os=r(am,"DIV",{class:!0});var Nv=n(os);u(en.$$.fragment,Nv),p0=l(Nv),hg=r(Nv,"P",{});var VL=n(hg);m0=i(VL,"\u201CReturns a new object replacing the specified fields with new values."),VL.forEach(o),Nv.forEach(o),am.forEach(o),W_=l(t),Se=r(t,"DIV",{class:!0});var im=n(Se);u(tn.$$.fragment,im),h0=l(im),gg=r(im,"P",{});var ZL=n(gg);g0=i(ZL,"Flax Base class for outputs of decoder-only generation models using greedy search."),ZL.forEach(o),u0=l(im),ss=r(im,"DIV",{class:!0});var Xv=n(ss);u(on.$$.fragment,Xv),f0=l(Xv),ug=r(Xv,"P",{});var GL=n(ug);_0=i(GL,"\u201CReturns a new object replacing the specified fields with new values."),GL.forEach(o),Xv.forEach(o),im.forEach(o),V_=l(t),jo=r(t,"H2",{class:!0});var Rv=n(jo);rs=r(Rv,"A",{id:!0,class:!0,href:!0});var CL=n(rs);fg=r(CL,"SPAN",{});var NL=n(fg);u(sn.$$.fragment,NL),NL.forEach(o),CL.forEach(o),b0=l(Rv),_g=r(Rv,"SPAN",{});var XL=n(_g);v0=i(XL,"LogitsProcessor"),XL.forEach(o),Rv.forEach(o),Z_=l(t),ns=r(t,"P",{});var Ov=n(ns);y0=i(Ov,"A "),nl=r(Ov,"A",{href:!0});var RL=n(nl);T0=i(RL,"LogitsProcessor"),RL.forEach(o),w0=i(Ov,` can be used to modify the prediction scores of a language model head for
generation.`),Ov.forEach(o),G_=l(t),Fo=r(t,"H3",{class:!0});var Av=n(Fo);as=r(Av,"A",{id:!0,class:!0,href:!0});var OL=n(as);bg=r(OL,"SPAN",{});var AL=n(bg);u(rn.$$.fragment,AL),AL.forEach(o),OL.forEach(o),$0=l(Av),vg=r(Av,"SPAN",{});var HL=n(vg);k0=i(HL,"PyTorch"),HL.forEach(o),Av.forEach(o),C_=l(t),Pe=r(t,"DIV",{class:!0});var cm=n(Pe);u(nn.$$.fragment,cm),x0=l(cm),is=r(cm,"P",{});var Gf=n(is);al=r(Gf,"A",{href:!0});var QL=n(al);M0=i(QL,"LogitsProcessor"),QL.forEach(o),E0=i(Gf," enforcing alternated generation between the two codebooks of "),yg=r(Gf,"CODE",{});var YL=n(yg);j0=i(YL,"Bark"),YL.forEach(o),F0=i(Gf,"\u2019s fine submodel."),Gf.forEach(o),L0=l(cm),il=r(cm,"DIV",{class:!0});var KL=n(il);u(an.$$.fragment,KL),KL.forEach(o),cm.forEach(o),N_=l(t),ge=r(t,"DIV",{class:!0});var mr=n(ge);u(cn.$$.fragment,mr),z0=l(mr),ln=r(mr,"P",{});var Hv=n(ln);J0=i(Hv,`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 `),Tg=r(Hv,"CODE",{});var e5=n(Tg);I0=i(e5,"guidance_scale"),e5.forEach(o),U0=i(Hv,"."),Hv.forEach(o),B0=l(mr),dn=r(mr,"P",{});var Qv=n(dn);q0=i(Qv,"See "),pn=r(Qv,"A",{href:!0,rel:!0});var t5=n(pn);D0=i(t5,"the paper"),t5.forEach(o),S0=i(Qv," for more information."),Qv.forEach(o),P0=l(mr),cl=r(mr,"DIV",{class:!0});var o5=n(cl);u(mn.$$.fragment,o5),o5.forEach(o),mr.forEach(o),X_=l(t),We=r(t,"DIV",{class:!0});var lm=n(We);u(hn.$$.fragment,lm),W0=l(lm),cs=r(lm,"P",{});var Cf=n(cs);ll=r(Cf,"A",{href:!0});var s5=n(ll);V0=i(s5,"LogitsProcessor"),s5.forEach(o),Z0=i(Cf,` that enforces no repetition of encoder input ids n-grams for the decoder ids. See
`),gn=r(Cf,"A",{href:!0,rel:!0});var r5=n(gn);G0=i(r5,"ParlAI"),r5.forEach(o),C0=i(Cf,"."),Cf.forEach(o),N0=l(lm),dl=r(lm,"DIV",{class:!0});var n5=n(dl);u(un.$$.fragment,n5),n5.forEach(o),lm.forEach(o),R_=l(t),Ve=r(t,"DIV",{class:!0});var dm=n(Ve);u(fn.$$.fragment,dm),X0=l(dm),pl=r(dm,"P",{});var sF=n(pl);ml=r(sF,"A",{href:!0});var a5=n(ml);R0=i(a5,"LogitsProcessor"),a5.forEach(o),O0=i(sF," enforcing an exponential penalty on tokens that are not in the original input."),sF.forEach(o),A0=l(dm),hl=r(dm,"DIV",{class:!0});var i5=n(hl);u(_n.$$.fragment,i5),i5.forEach(o),dm.forEach(o),O_=l(t),ue=r(t,"DIV",{class:!0});var hr=n(ue);u(bn.$$.fragment,hr),H0=l(hr),Wt=r(hr,"P",{});var Zc=n(Wt);gl=r(Zc,"A",{href:!0});var c5=n(gl);Q0=i(c5,"LogitsWarper"),c5.forEach(o),Y0=i(Zc," that performs epsilon-sampling, i.e. restricting to tokens with "),wg=r(Zc,"CODE",{});var l5=n(wg);K0=i(l5,"prob >= epsilon"),l5.forEach(o),e2=i(Zc,`. Takes the
largest min_tokens_to_keep tokens if no tokens satisfy this constraint. See `),vn=r(Zc,"A",{href:!0,rel:!0});var d5=n(vn);t2=i(d5,`Truncation Sampling as Language Model
Desmoothing`),d5.forEach(o),o2=i(Zc," for more information."),Zc.forEach(o),s2=l(hr),u(ls.$$.fragment,hr),r2=l(hr),ul=r(hr,"DIV",{class:!0});var p5=n(ul);u(yn.$$.fragment,p5),p5.forEach(o),hr.forEach(o),A_=l(t),fe=r(t,"DIV",{class:!0});var gr=n(fe);u(Tn.$$.fragment,gr),n2=l(gr),D=r(gr,"P",{});var X=n(D);fl=r(X,"A",{href:!0});var m5=n(fl);a2=i(m5,"LogitsWarper"),m5.forEach(o),i2=i(X,` that performs eta-sampling, a technique to filter out tokens with probabilities below a dynamic
cutoff value, `),$g=r(X,"CODE",{});var h5=n($g);c2=i(h5,"eta"),h5.forEach(o),l2=i(X,", which is calculated based on a combination of the hyperparameter "),kg=r(X,"CODE",{});var g5=n(kg);d2=i(g5,"epsilon"),g5.forEach(o),p2=i(X,` and the entropy of
the token probabilities, i.e. `),xg=r(X,"CODE",{});var u5=n(xg);m2=i(u5,"eta := min(epsilon, sqrt(epsilon * e^-entropy(probabilities)))"),u5.forEach(o),h2=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 `),wn=r(X,"A",{href:!0,rel:!0});var f5=n(wn);g2=i(f5,`Truncation
Sampling as Language Model Desmoothing`),f5.forEach(o),u2=i(X," for more information. Note: "),Mg=r(X,"CODE",{});var _5=n(Mg);f2=i(_5,"do_sample"),_5.forEach(o),_2=i(X,`
must be set to `),Eg=r(X,"CODE",{});var b5=n(Eg);b2=i(b5,"True"),b5.forEach(o),v2=i(X," for this "),jg=r(X,"CODE",{});var v5=n(jg);y2=i(v5,"LogitsWarper"),v5.forEach(o),T2=i(X," to work."),X.forEach(o),w2=l(gr),u(ds.$$.fragment,gr),$2=l(gr),_l=r(gr,"DIV",{class:!0});var y5=n(_l);u($n.$$.fragment,y5),y5.forEach(o),gr.forEach(o),H_=l(t),Ze=r(t,"DIV",{class:!0});var pm=n(Ze);u(kn.$$.fragment,pm),k2=l(pm),bl=r(pm,"P",{});var rF=n(bl);vl=r(rF,"A",{href:!0});var T5=n(vl);x2=i(T5,"LogitsProcessor"),T5.forEach(o),M2=i(rF,` that exponentially increases the score of the eos_token_id after regulation_start has been
reached.`),rF.forEach(o),E2=l(pm),yl=r(pm,"DIV",{class:!0});var w5=n(yl);u(xn.$$.fragment,w5),w5.forEach(o),pm.forEach(o),Q_=l(t),Ge=r(t,"DIV",{class:!0});var mm=n(Ge);u(Mn.$$.fragment,mm),j2=l(mm),Tl=r(mm,"P",{});var nF=n(Tl);wl=r(nF,"A",{href:!0});var $5=n(wl);F2=i($5,"LogitsProcessor"),$5.forEach(o),L2=i(nF," that enforces the specified token as the first generated token."),nF.forEach(o),z2=l(mm),$l=r(mm,"DIV",{class:!0});var k5=n($l);u(En.$$.fragment,k5),k5.forEach(o),mm.forEach(o),Y_=l(t),Ce=r(t,"DIV",{class:!0});var hm=n(Ce);u(jn.$$.fragment,hm),J2=l(hm),ps=r(hm,"P",{});var Nf=n(ps);kl=r(Nf,"A",{href:!0});var x5=n(kl);I2=i(x5,"LogitsProcessor"),x5.forEach(o),U2=i(Nf," that enforces the specified token as the last generated token when "),Fg=r(Nf,"CODE",{});var M5=n(Fg);B2=i(M5,"max_length"),M5.forEach(o),q2=i(Nf," is reached."),Nf.forEach(o),D2=l(hm),xl=r(hm,"DIV",{class:!0});var E5=n(xl);u(Fn.$$.fragment,E5),E5.forEach(o),hm.forEach(o),K_=l(t),Ne=r(t,"DIV",{class:!0});var gm=n(Ne);u(Ln.$$.fragment,gm),S2=l(gm),zn=r(gm,"P",{});var Yv=n(zn);P2=i(Yv,`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=r(Yv,"CODE",{});var j5=n(Lg);W2=i(j5,"inf"),j5.forEach(o),V2=i(Yv,` so that they are
sampled at their corresponding index.`),Yv.forEach(o),Z2=l(gm),Ml=r(gm,"DIV",{class:!0});var F5=n(Ml);u(Jn.$$.fragment,F5),F5.forEach(o),gm.forEach(o),eb=l(t),L=r(t,"DIV",{class:!0});var J=n(L);u(In.$$.fragment,J),G2=l(J),El=r(J,"P",{});var aF=n(El);jl=r(aF,"A",{href:!0});var L5=n(jl);C2=i(L5,"LogitsProcessor"),L5.forEach(o),N2=i(aF," that enforces diverse beam search."),aF.forEach(o),X2=l(J),Lo=r(J,"P",{});var um=n(Lo);R2=i(um,"Note that this logits processor is only effective for "),Fl=r(um,"A",{href:!0});var z5=n(Fl);O2=i(z5,"PreTrainedModel.group_beam_search()"),z5.forEach(o),A2=i(um,". See "),Un=r(um,"A",{href:!0,rel:!0});var J5=n(Un);H2=i(J5,`Diverse Beam
Search: Decoding Diverse Solutions from Neural Sequence Models`),J5.forEach(o),Q2=i(um,` for more
details.`),um.forEach(o),Y2=l(J),u(ms.$$.fragment,J),K2=l(J),u(hs.$$.fragment,J),ew=l(J),Bn=r(J,"P",{});var Kv=n(Bn);tw=i(Kv,`Traditional beam search often generates very similar sequences across different beams.
`),zg=r(Kv,"CODE",{});var I5=n(zg);ow=i(I5,"HammingDiversityLogitsProcessor"),I5.forEach(o),sw=i(Kv,` addresses this by penalizing beams that generate tokens already chosen by other
beams in the same time step.`),Kv.forEach(o),rw=l(J),Jg=r(J,"P",{});var U5=n(Jg);nw=i(U5,"How It Works:"),U5.forEach(o),aw=l(J),zo=r(J,"UL",{});var fm=n(zo);Ll=r(fm,"LI",{});var iF=n(Ll);Ig=r(iF,"STRONG",{});var B5=n(Ig);iw=i(B5,"Grouping Beams"),B5.forEach(o),cw=i(iF,": Beams are divided into groups. Each group selects tokens independently of the others."),iF.forEach(o),lw=l(fm),zl=r(fm,"LI",{});var cF=n(zl);Ug=r(cF,"STRONG",{});var q5=n(Ug);dw=i(q5,"Penalizing Repeated Tokens"),q5.forEach(o),pw=i(cF,`: 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.`),cF.forEach(o),mw=l(fm),Jl=r(fm,"LI",{});var lF=n(Jl);Bg=r(lF,"STRONG",{});var D5=n(Bg);hw=i(D5,"Promoting Diversity"),D5.forEach(o),gw=i(lF,`: This penalty discourages beams within a group from selecting the same tokens as
beams in other groups.`),lF.forEach(o),fm.forEach(o),uw=l(J),qg=r(J,"P",{});var S5=n(qg);fw=i(S5,"Benefits:"),S5.forEach(o),_w=l(J),qn=r(J,"UL",{});var ey=n(qn);Il=r(ey,"LI",{});var dF=n(Il);Dg=r(dF,"STRONG",{});var P5=n(Dg);bw=i(P5,"Diverse Outputs"),P5.forEach(o),vw=i(dF,": Produces a variety of different sequences."),dF.forEach(o),yw=l(ey),Ul=r(ey,"LI",{});var pF=n(Ul);Sg=r(pF,"STRONG",{});var W5=n(Sg);Tw=i(W5,"Exploration"),W5.forEach(o),ww=i(pF,": Allows the model to explore different paths."),pF.forEach(o),ey.forEach(o),$w=l(J),u(gs.$$.fragment,J),kw=l(J),Bl=r(J,"DIV",{class:!0});var V5=n(Bl);u(Dn.$$.fragment,V5),V5.forEach(o),J.forEach(o),tb=l(t),Xe=r(t,"DIV",{class:!0});var _m=n(Xe);u(Sn.$$.fragment,_m),xw=l(_m),Vt=r(_m,"P",{});var Gc=n(Vt);ql=r(Gc,"A",{href:!0});var Z5=n(ql);Mw=i(Z5,"LogitsProcessor"),Z5.forEach(o),Ew=i(Gc," that removes all "),Pg=r(Gc,"CODE",{});var G5=n(Pg);jw=i(G5,"nan"),G5.forEach(o),Fw=i(Gc," and "),Wg=r(Gc,"CODE",{});var C5=n(Wg);Lw=i(C5,"inf"),C5.forEach(o),zw=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),Jw=l(_m),Dl=r(_m,"DIV",{class:!0});var N5=n(Dl);u(Pn.$$.fragment,N5),N5.forEach(o),_m.forEach(o),ob=l(t),Re=r(t,"DIV",{class:!0});var bm=n(Re);u(Wn.$$.fragment,bm),Iw=l(bm),us=r(bm,"P",{});var Xf=n(us);Sl=r(Xf,"A",{href:!0});var X5=n(Sl);Uw=i(X5,"LogitsWarper"),X5.forEach(o),Bw=i(Xf," and "),Pl=r(Xf,"A",{href:!0});var R5=n(Pl);qw=i(R5,"LogitsProcessor"),R5.forEach(o),Dw=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),Sw=l(bm),Wl=r(bm,"DIV",{class:!0});var O5=n(Wl);u(Vn.$$.fragment,O5),O5.forEach(o),bm.forEach(o),sb=l(t),Oe=r(t,"DIV",{class:!0});var vm=n(Oe);u(Zn.$$.fragment,vm),Pw=l(vm),Vg=r(vm,"P",{});var A5=n(Vg);Ww=i(A5,"Abstract base class for all logit processors that can be applied during generation."),A5.forEach(o),Vw=l(vm),Vl=r(vm,"DIV",{class:!0});var H5=n(Vl);u(Gn.$$.fragment,H5),H5.forEach(o),vm.forEach(o),rb=l(t),Ae=r(t,"DIV",{class:!0});var ym=n(Ae);u(Cn.$$.fragment,ym),Zw=l(ym),G=r(ym,"P",{});var ce=n(G);Gw=i(ce,"This class can be used to create a list of "),Zl=r(ce,"A",{href:!0});var Q5=n(Zl);Cw=i(Q5,"LogitsProcessor"),Q5.forEach(o),Nw=i(ce," or "),Gl=r(ce,"A",{href:!0});var Y5=n(Gl);Xw=i(Y5,"LogitsWarper"),Y5.forEach(o),Rw=i(ce,` to subsequently process a
`),Zg=r(ce,"CODE",{});var K5=n(Zg);Ow=i(K5,"scores"),K5.forEach(o),Aw=i(ce," input tensor. This class inherits from list and adds a specific "),Gg=r(ce,"EM",{});var ez=n(Gg);Cg=r(ez,"STRONG",{});var tz=n(Cg);Hw=i(tz,"call"),tz.forEach(o),ez.forEach(o),Qw=i(ce,` method to apply each
`),Cl=r(ce,"A",{href:!0});var oz=n(Cl);Yw=i(oz,"LogitsProcessor"),oz.forEach(o),Kw=i(ce," or "),Nl=r(ce,"A",{href:!0});var sz=n(Nl);e$=i(sz,"LogitsWarper"),sz.forEach(o),t$=i(ce," to the inputs."),ce.forEach(o),o$=l(ym),Xl=r(ym,"DIV",{class:!0});var rz=n(Xl);u(Nn.$$.fragment,rz),rz.forEach(o),ym.forEach(o),nb=l(t),He=r(t,"DIV",{class:!0});var Tm=n(He);u(Xn.$$.fragment,Tm),s$=l(Tm),Ng=r(Tm,"P",{});var nz=n(Ng);r$=i(nz,"Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),nz.forEach(o),n$=l(Tm),Rl=r(Tm,"DIV",{class:!0});var az=n(Rl);u(Rn.$$.fragment,az),az.forEach(o),Tm.forEach(o),ab=l(t),Qe=r(t,"DIV",{class:!0});var wm=n(Qe);u(On.$$.fragment,wm),a$=l(wm),Ol=r(wm,"P",{});var mF=n(Ol);Al=r(mF,"A",{href:!0});var iz=n(Al);i$=i(iz,"LogitsProcessor"),iz.forEach(o),c$=i(mF," enforcing a min-length by setting EOS probability to 0."),mF.forEach(o),l$=l(wm),Hl=r(wm,"DIV",{class:!0});var cz=n(Hl);u(An.$$.fragment,cz),cz.forEach(o),wm.forEach(o),ib=l(t),_e=r(t,"DIV",{class:!0});var ur=n(_e);u(Hn.$$.fragment,ur),d$=l(ur),je=r(ur,"P",{});var Xo=n(je);Ql=r(Xo,"A",{href:!0});var lz=n(Ql);p$=i(lz,"LogitsProcessor"),lz.forEach(o),m$=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=r(Xo,"CODE",{});var dz=n(Xg);h$=i(dz,"min_length"),dz.forEach(o),g$=i(Xo," will compute the length of "),Rg=r(Xo,"CODE",{});var pz=n(Rg);u$=i(pz,"prompt + newly generated tokens"),pz.forEach(o),f$=i(Xo," whereas for other models it will behave as "),Og=r(Xo,"CODE",{});var mz=n(Og);_$=i(mz,"min_new_tokens"),mz.forEach(o),b$=i(Xo,`, that is, taking only into account
the newly generated ones.`),Xo.forEach(o),v$=l(ur),u(fs.$$.fragment,ur),y$=l(ur),Yl=r(ur,"DIV",{class:!0});var hz=n(Yl);u(Qn.$$.fragment,hz),hz.forEach(o),ur.forEach(o),cb=l(t),H=r(t,"DIV",{class:!0});var Xt=n(H);u(Yn.$$.fragment,Xt),T$=l(Xt),Kl=r(Xt,"P",{});var hF=n(Kl);ed=r(hF,"A",{href:!0});var gz=n(ed);w$=i(gz,"LogitsProcessor"),gz.forEach(o),$$=i(hF," that enforces that specified sequences will never be selected."),hF.forEach(o),k$=l(Xt),u(_s.$$.fragment,Xt),x$=l(Xt),u(bs.$$.fragment,Xt),M$=l(Xt),td=r(Xt,"DIV",{class:!0});var uz=n(td);u(Kn.$$.fragment,uz),uz.forEach(o),Xt.forEach(o),lb=l(t),Q=r(t,"DIV",{class:!0});var Rt=n(Q);u(ea.$$.fragment,Rt),E$=l(Rt),Jo=r(Rt,"P",{});var $m=n(Jo);j$=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=r($m,"A",{href:!0});var fz=n(od);F$=i(fz,"LogitsProcessor"),fz.forEach(o),L$=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=r($m,"A",{href:!0,rel:!0});var _z=n(ta);z$=i(_z,"Fairseq"),_z.forEach(o),J$=i($m,"."),$m.forEach(o),I$=l(Rt),u(vs.$$.fragment,Rt),U$=l(Rt),u(ys.$$.fragment,Rt),B$=l(Rt),sd=r(Rt,"DIV",{class:!0});var bz=n(sd);u(oa.$$.fragment,bz),bz.forEach(o),Rt.forEach(o),db=l(t),Ye=r(t,"DIV",{class:!0});var km=n(Ye);u(sa.$$.fragment,km),q$=l(km),Ts=r(km,"P",{});var Rf=n(Ts);rd=r(Rf,"A",{href:!0});var vz=n(rd);D$=i(vz,"LogitsProcessor"),vz.forEach(o),S$=i(Rf,` that enforces constrained generation and is useful for prefix-conditioned constrained
generation. See `),ra=r(Rf,"A",{href:!0,rel:!0});var yz=n(ra);P$=i(yz,"Autoregressive Entity Retrieval"),yz.forEach(o),W$=i(Rf," for more information."),Rf.forEach(o),V$=l(km),nd=r(km,"DIV",{class:!0});var Tz=n(nd);u(na.$$.fragment,Tz),Tz.forEach(o),km.forEach(o),pb=l(t),be=r(t,"DIV",{class:!0});var fr=n(be);u(aa.$$.fragment,fr),Z$=l(fr),ws=r(fr,"P",{});var Of=n(ws);ad=r(Of,"A",{href:!0});var wz=n(ad);G$=i(wz,"LogitsProcessor"),wz.forEach(o),C$=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=r(Of,"A",{href:!0,rel:!0});var $z=n(ia);N$=i($z,"paper"),$z.forEach(o),X$=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),R$=l(fr),u($s.$$.fragment,fr),O$=l(fr),id=r(fr,"DIV",{class:!0});var kz=n(id);u(ca.$$.fragment,kz),kz.forEach(o),fr.forEach(o),mb=l(t),Y=r(t,"DIV",{class:!0});var Ot=n(Y);u(la.$$.fragment,Ot),A$=l(Ot),cd=r(Ot,"P",{});var gF=n(cd);ld=r(gF,"A",{href:!0});var xz=n(ld);H$=i(xz,"LogitsProcessor"),xz.forEach(o),Q$=i(gF,` 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).`),gF.forEach(o),Y$=l(Ot),u(ks.$$.fragment,Ot),K$=l(Ot),u(xs.$$.fragment,Ot),ek=l(Ot),dd=r(Ot,"DIV",{class:!0});var Mz=n(dd);u(da.$$.fragment,Mz),Mz.forEach(o),Ot.forEach(o),hb=l(t),Ke=r(t,"DIV",{class:!0});var xm=n(Ke);u(pa.$$.fragment,xm),tk=l(xm),Fe=r(xm,"P",{});var Ro=n(Fe);pd=r(Ro,"A",{href:!0});var Ez=n(pd);ok=i(Ez,"SuppressTokensAtBeginLogitsProcessor"),Ez.forEach(o),sk=i(Ro," supresses a list of tokens as soon as the "),Ag=r(Ro,"CODE",{});var jz=n(Ag);rk=i(jz,"generate"),jz.forEach(o),nk=i(Ro,` function starts
generating using `),Hg=r(Ro,"CODE",{});var Fz=n(Hg);ak=i(Fz,"begin_index"),Fz.forEach(o),ik=i(Ro," tokens. This should ensure that the tokens defined by "),Qg=r(Ro,"CODE",{});var Lz=n(Qg);ck=i(Lz,"begin_suppress_tokens"),Lz.forEach(o),lk=i(Ro,` at not
sampled at the begining of the generation.`),Ro.forEach(o),dk=l(xm),md=r(xm,"DIV",{class:!0});var zz=n(md);u(ma.$$.fragment,zz),zz.forEach(o),xm.forEach(o),gb=l(t),et=r(t,"DIV",{class:!0});var Mm=n(et);u(ha.$$.fragment,Mm),pk=l(Mm),ga=r(Mm,"P",{});var ty=n(ga);mk=i(ty,"This processor can be used to suppress a list of tokens. The processor will set their log probs to "),Yg=r(ty,"CODE",{});var Jz=n(Yg);hk=i(Jz,"-inf"),Jz.forEach(o),gk=i(ty,` so that they
are not sampled.`),ty.forEach(o),uk=l(Mm),hd=r(Mm,"DIV",{class:!0});var Iz=n(hd);u(ua.$$.fragment,Iz),Iz.forEach(o),Mm.forEach(o),ub=l(t),K=r(t,"DIV",{class:!0});var At=n(K);u(fa.$$.fragment,At),fk=l(At),gd=r(At,"P",{});var uF=n(gd);ud=r(uF,"A",{href:!0});var Uz=n(ud);_k=i(Uz,"LogitsWarper"),Uz.forEach(o),bk=i(uF,` for temperature (exponential scaling output probability distribution), which effectively means
that it can control the randomness of the predicted tokens.`),uF.forEach(o),vk=l(At),u(Ms.$$.fragment,At),yk=l(At),u(Es.$$.fragment,At),Tk=l(At),fd=r(At,"DIV",{class:!0});var Bz=n(fd);u(_a.$$.fragment,Bz),Bz.forEach(o),At.forEach(o),fb=l(t),tt=r(t,"DIV",{class:!0});var Em=n(tt);u(ba.$$.fragment,Em),wk=l(Em),_d=r(Em,"P",{});var fF=n(_d);bd=r(fF,"A",{href:!0});var qz=n(bd);$k=i(qz,"LogitsWarper"),qz.forEach(o),kk=i(fF," that performs top-k, i.e. restricting to the k highest probability elements."),fF.forEach(o),xk=l(Em),vd=r(Em,"DIV",{class:!0});var Dz=n(vd);u(va.$$.fragment,Dz),Dz.forEach(o),Em.forEach(o),_b=l(t),ve=r(t,"DIV",{class:!0});var _r=n(ve);u(ya.$$.fragment,_r),Mk=l(_r),yd=r(_r,"P",{});var _F=n(yd);Td=r(_F,"A",{href:!0});var Sz=n(Td);Ek=i(Sz,"LogitsWarper"),Sz.forEach(o),jk=i(_F," that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),_F.forEach(o),Fk=l(_r),u(js.$$.fragment,_r),Lk=l(_r),wd=r(_r,"DIV",{class:!0});var Pz=n(wd);u(Ta.$$.fragment,Pz),Pz.forEach(o),_r.forEach(o),bb=l(t),ot=r(t,"DIV",{class:!0});var jm=n(ot);u(wa.$$.fragment,jm),zk=l(jm),Fs=r(jm,"P",{});var Af=n(Fs);$d=r(Af,"A",{href:!0});var Wz=n($d);Jk=i(Wz,"LogitsWarper"),Wz.forEach(o),Ik=i(Af," that performs typical decoding. See "),$a=r(Af,"A",{href:!0,rel:!0});var Vz=n($a);Uk=i(Vz,`Typical Decoding for Natural Language
Generation`),Vz.forEach(o),Bk=i(Af," for more information."),Af.forEach(o),qk=l(jm),kd=r(jm,"DIV",{class:!0});var Zz=n(kd);u(ka.$$.fragment,Zz),Zz.forEach(o),jm.forEach(o),vb=l(t),ee=r(t,"DIV",{class:!0});var Ht=n(ee);u(xa.$$.fragment,Ht),Dk=l(Ht),st=r(Ht,"P",{});var br=n(st);Sk=i(br,`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=r(br,"CODE",{});var Gz=n(Kg);Pk=i(Gz,"guidance_scale"),Gz.forEach(o),Wk=i(br,". The unconditional scores are computed internally by prompting "),eu=r(br,"CODE",{});var Cz=n(eu);Vk=i(Cz,"model"),Cz.forEach(o),Zk=i(br,` with
the `),tu=r(br,"CODE",{});var Nz=n(tu);Gk=i(Nz,"unconditional_ids"),Nz.forEach(o),Ck=i(br," branch."),br.forEach(o),Nk=l(Ht),Ma=r(Ht,"P",{});var oy=n(Ma);Xk=i(oy,"See "),Ea=r(oy,"A",{href:!0,rel:!0});var Xz=n(Ea);Rk=i(Xz,"the paper"),Xz.forEach(o),Ok=i(oy," for more information."),oy.forEach(o),Ak=l(Ht),u(Ls.$$.fragment,Ht),Hk=l(Ht),xd=r(Ht,"DIV",{class:!0});var Rz=n(xd);u(ja.$$.fragment,Rz),Rz.forEach(o),Ht.forEach(o),yb=l(t),ye=r(t,"DIV",{class:!0});var vr=n(ye);u(Fa.$$.fragment,vr),Qk=l(vr),La=r(vr,"P",{});var sy=n(La);Yk=i(sy,`Whisper specific Processor. This processor can be used to force a list of tokens. The processor will set their log
probs to `),ou=r(sy,"CODE",{});var Oz=n(ou);Kk=i(Oz,"inf"),Oz.forEach(o),e3=i(sy," so that they are sampled at their corresponding index."),sy.forEach(o),t3=l(vr),za=r(vr,"P",{});var ry=n(za);o3=i(ry,"See "),Ja=r(ry,"A",{href:!0,rel:!0});var Az=n(Ja);s3=i(Az,"the paper"),Az.forEach(o),r3=i(ry," for more information."),ry.forEach(o),n3=l(vr),Md=r(vr,"DIV",{class:!0});var Hz=n(Md);u(Ia.$$.fragment,Hz),Hz.forEach(o),vr.forEach(o),Tb=l(t),Io=r(t,"H3",{class:!0});var ny=n(Io);zs=r(ny,"A",{id:!0,class:!0,href:!0});var Qz=n(zs);su=r(Qz,"SPAN",{});var Yz=n(su);u(Ua.$$.fragment,Yz),Yz.forEach(o),Qz.forEach(o),a3=l(ny),ru=r(ny,"SPAN",{});var Kz=n(ru);i3=i(Kz,"TensorFlow"),Kz.forEach(o),ny.forEach(o),wb=l(t),rt=r(t,"DIV",{class:!0});var Fm=n(rt);u(Ba.$$.fragment,Fm),c3=l(Fm),Ed=r(Fm,"P",{});var bF=n(Ed);jd=r(bF,"A",{href:!0});var eJ=n(jd);l3=i(eJ,"TFLogitsProcessor"),eJ.forEach(o),d3=i(bF," that enforces the specified token as the first generated token."),bF.forEach(o),p3=l(Fm),Fd=r(Fm,"DIV",{class:!0});var tJ=n(Fd);u(qa.$$.fragment,tJ),tJ.forEach(o),Fm.forEach(o),$b=l(t),nt=r(t,"DIV",{class:!0});var Lm=n(nt);u(Da.$$.fragment,Lm),m3=l(Lm),Js=r(Lm,"P",{});var Hf=n(Js);Ld=r(Hf,"A",{href:!0});var oJ=n(Ld);h3=i(oJ,"TFLogitsProcessor"),oJ.forEach(o),g3=i(Hf," that enforces the specified token as the last generated token when "),nu=r(Hf,"CODE",{});var sJ=n(nu);u3=i(sJ,"max_length"),sJ.forEach(o),f3=i(Hf," is reached."),Hf.forEach(o),_3=l(Lm),zd=r(Lm,"DIV",{class:!0});var rJ=n(zd);u(Sa.$$.fragment,rJ),rJ.forEach(o),Lm.forEach(o),kb=l(t),at=r(t,"DIV",{class:!0});var zm=n(at);u(Pa.$$.fragment,zm),b3=l(zm),Uo=r(zm,"P",{});var Jm=n(Uo);v3=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=r(Jm,"CODE",{});var nJ=n(au);y3=i(nJ,"0"),nJ.forEach(o),T3=i(Jm,` and all other tokens to
`),iu=r(Jm,"CODE",{});var aJ=n(iu);w3=i(aJ,"-inf"),aJ.forEach(o),$3=i(Jm," so that they are sampled at their corresponding index."),Jm.forEach(o),k3=l(zm),Jd=r(zm,"DIV",{class:!0});var iJ=n(Jd);u(Wa.$$.fragment,iJ),iJ.forEach(o),zm.forEach(o),xb=l(t),it=r(t,"DIV",{class:!0});var Im=n(it);u(Va.$$.fragment,Im),x3=l(Im),cu=r(Im,"P",{});var cJ=n(cu);M3=i(cJ,"Abstract base class for all logit processors that can be applied during generation."),cJ.forEach(o),E3=l(Im),Is=r(Im,"DIV",{class:!0});var ay=n(Is);u(Za.$$.fragment,ay),j3=l(ay),lu=r(ay,"P",{});var lJ=n(lu);F3=i(lJ,"TF method for processing logits."),lJ.forEach(o),ay.forEach(o),Im.forEach(o),Mb=l(t),ct=r(t,"DIV",{class:!0});var Um=n(ct);u(Ga.$$.fragment,Um),L3=l(Um),Te=r(Um,"P",{});var Qt=n(Te);z3=i(Qt,"This class can be used to create a list of "),Id=r(Qt,"A",{href:!0});var dJ=n(Id);J3=i(dJ,"TFLogitsProcessor"),dJ.forEach(o),I3=i(Qt," to subsequently process a "),du=r(Qt,"CODE",{});var pJ=n(du);U3=i(pJ,"scores"),pJ.forEach(o),B3=i(Qt,` input tensor.
This class inherits from list and adds a specific `),pu=r(Qt,"EM",{});var mJ=n(pu);mu=r(mJ,"STRONG",{});var hJ=n(mu);q3=i(hJ,"call"),hJ.forEach(o),mJ.forEach(o),D3=i(Qt," method to apply each "),Ud=r(Qt,"A",{href:!0});var gJ=n(Ud);S3=i(gJ,"TFLogitsProcessor"),gJ.forEach(o),P3=i(Qt,` to the
inputs.`),Qt.forEach(o),W3=l(Um),Bd=r(Um,"DIV",{class:!0});var uJ=n(Bd);u(Ca.$$.fragment,uJ),uJ.forEach(o),Um.forEach(o),Eb=l(t),lt=r(t,"DIV",{class:!0});var Bm=n(lt);u(Na.$$.fragment,Bm),V3=l(Bm),hu=r(Bm,"P",{});var fJ=n(hu);Z3=i(fJ,"Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),fJ.forEach(o),G3=l(Bm),Us=r(Bm,"DIV",{class:!0});var iy=n(Us);u(Xa.$$.fragment,iy),C3=l(iy),gu=r(iy,"P",{});var _J=n(gu);N3=i(_J,"TF method for warping logits."),_J.forEach(o),iy.forEach(o),Bm.forEach(o),jb=l(t),dt=r(t,"DIV",{class:!0});var qm=n(dt);u(Ra.$$.fragment,qm),X3=l(qm),qd=r(qm,"P",{});var vF=n(qd);Dd=r(vF,"A",{href:!0});var bJ=n(Dd);R3=i(bJ,"TFLogitsProcessor"),bJ.forEach(o),O3=i(vF," enforcing a min-length by setting EOS probability to 0."),vF.forEach(o),A3=l(qm),Sd=r(qm,"DIV",{class:!0});var vJ=n(Sd);u(Oa.$$.fragment,vJ),vJ.forEach(o),qm.forEach(o),Fb=l(t),pt=r(t,"DIV",{class:!0});var Dm=n(pt);u(Aa.$$.fragment,Dm),H3=l(Dm),Pd=r(Dm,"P",{});var yF=n(Pd);Wd=r(yF,"A",{href:!0});var yJ=n(Wd);Q3=i(yJ,"TFLogitsProcessor"),yJ.forEach(o),Y3=i(yF," that enforces that specified sequences will never be sampled."),yF.forEach(o),K3=l(Dm),Vd=r(Dm,"DIV",{class:!0});var TJ=n(Vd);u(Ha.$$.fragment,TJ),TJ.forEach(o),Dm.forEach(o),Lb=l(t),mt=r(t,"DIV",{class:!0});var Sm=n(mt);u(Qa.$$.fragment,Sm),e4=l(Sm),Bs=r(Sm,"P",{});var Qf=n(Bs);Zd=r(Qf,"A",{href:!0});var wJ=n(Zd);t4=i(wJ,"TFLogitsProcessor"),wJ.forEach(o),o4=i(Qf,` that enforces no repetition of n-grams. See
`),Ya=r(Qf,"A",{href:!0,rel:!0});var $J=n(Ya);s4=i($J,"Fairseq"),$J.forEach(o),r4=i(Qf,"."),Qf.forEach(o),n4=l(Sm),Gd=r(Sm,"DIV",{class:!0});var kJ=n(Gd);u(Ka.$$.fragment,kJ),kJ.forEach(o),Sm.forEach(o),zb=l(t),ht=r(t,"DIV",{class:!0});var Pm=n(ht);u(ei.$$.fragment,Pm),a4=l(Pm),Cd=r(Pm,"P",{});var TF=n(Cd);Nd=r(TF,"A",{href:!0});var xJ=n(Nd);i4=i(xJ,"TFLogitsProcessor"),xJ.forEach(o),c4=i(TF," enforcing an exponential penalty on repeated sequences."),TF.forEach(o),l4=l(Pm),Xd=r(Pm,"DIV",{class:!0});var MJ=n(Xd);u(ti.$$.fragment,MJ),MJ.forEach(o),Pm.forEach(o),Jb=l(t),gt=r(t,"DIV",{class:!0});var Wm=n(gt);u(oi.$$.fragment,Wm),d4=l(Wm),Le=r(Wm,"P",{});var Oo=n(Le);Rd=r(Oo,"A",{href:!0});var EJ=n(Rd);p4=i(EJ,"TFSuppressTokensAtBeginLogitsProcessor"),EJ.forEach(o),m4=i(Oo," suppresses a list of tokens as soon as the "),uu=r(Oo,"CODE",{});var jJ=n(uu);h4=i(jJ,"generate"),jJ.forEach(o),g4=i(Oo,` function starts
generating using `),fu=r(Oo,"CODE",{});var FJ=n(fu);u4=i(FJ,"begin_index"),FJ.forEach(o),f4=i(Oo," tokens. This should ensure that the tokens defined by "),_u=r(Oo,"CODE",{});var LJ=n(_u);_4=i(LJ,"begin_suppress_tokens"),LJ.forEach(o),b4=i(Oo,` at not
sampled at the begining of the generation.`),Oo.forEach(o),v4=l(Wm),Od=r(Wm,"DIV",{class:!0});var zJ=n(Od);u(si.$$.fragment,zJ),zJ.forEach(o),Wm.forEach(o),Ib=l(t),ut=r(t,"DIV",{class:!0});var Vm=n(ut);u(ri.$$.fragment,Vm),y4=l(Vm),ni=r(Vm,"P",{});var cy=n(ni);T4=i(cy,"This processor can be used to suppress a list of tokens. The processor will set their log probs to "),bu=r(cy,"CODE",{});var JJ=n(bu);w4=i(JJ,"-inf"),JJ.forEach(o),$4=i(cy,` so that they
are not sampled.`),cy.forEach(o),k4=l(Vm),Ad=r(Vm,"DIV",{class:!0});var IJ=n(Ad);u(ai.$$.fragment,IJ),IJ.forEach(o),Vm.forEach(o),Ub=l(t),ft=r(t,"DIV",{class:!0});var Zm=n(ft);u(ii.$$.fragment,Zm),x4=l(Zm),Hd=r(Zm,"P",{});var wF=n(Hd);Qd=r(wF,"A",{href:!0});var UJ=n(Qd);M4=i(UJ,"TFLogitsWarper"),UJ.forEach(o),E4=i(wF," for temperature (exponential scaling output probability distribution)."),wF.forEach(o),j4=l(Zm),Yd=r(Zm,"DIV",{class:!0});var BJ=n(Yd);u(ci.$$.fragment,BJ),BJ.forEach(o),Zm.forEach(o),Bb=l(t),_t=r(t,"DIV",{class:!0});var Gm=n(_t);u(li.$$.fragment,Gm),F4=l(Gm),Kd=r(Gm,"P",{});var $F=n(Kd);ep=r($F,"A",{href:!0});var qJ=n(ep);L4=i(qJ,"TFLogitsWarper"),qJ.forEach(o),z4=i($F," that performs top-k, i.e. restricting to the k highest probability elements."),$F.forEach(o),J4=l(Gm),tp=r(Gm,"DIV",{class:!0});var DJ=n(tp);u(di.$$.fragment,DJ),DJ.forEach(o),Gm.forEach(o),qb=l(t),bt=r(t,"DIV",{class:!0});var Cm=n(bt);u(pi.$$.fragment,Cm),I4=l(Cm),op=r(Cm,"P",{});var kF=n(op);sp=r(kF,"A",{href:!0});var SJ=n(sp);U4=i(SJ,"TFLogitsWarper"),SJ.forEach(o),B4=i(kF," that performs top-p, i.e. restricting to top tokens summing to <= prob_cut_off."),kF.forEach(o),q4=l(Cm),rp=r(Cm,"DIV",{class:!0});var PJ=n(rp);u(mi.$$.fragment,PJ),PJ.forEach(o),Cm.forEach(o),Db=l(t),Bo=r(t,"H3",{class:!0});var ly=n(Bo);qs=r(ly,"A",{id:!0,class:!0,href:!0});var WJ=n(qs);vu=r(WJ,"SPAN",{});var VJ=n(vu);u(hi.$$.fragment,VJ),VJ.forEach(o),WJ.forEach(o),D4=l(ly),yu=r(ly,"SPAN",{});var ZJ=n(yu);S4=i(ZJ,"FLAX"),ZJ.forEach(o),ly.forEach(o),Sb=l(t),vt=r(t,"DIV",{class:!0});var Nm=n(vt);u(gi.$$.fragment,Nm),P4=l(Nm),np=r(Nm,"P",{});var xF=n(np);ap=r(xF,"A",{href:!0});var GJ=n(ap);W4=i(GJ,"FlaxLogitsProcessor"),GJ.forEach(o),V4=i(xF," that enforces the specified token as the first generated token."),xF.forEach(o),Z4=l(Nm),ip=r(Nm,"DIV",{class:!0});var CJ=n(ip);u(ui.$$.fragment,CJ),CJ.forEach(o),Nm.forEach(o),Pb=l(t),yt=r(t,"DIV",{class:!0});var Xm=n(yt);u(fi.$$.fragment,Xm),G4=l(Xm),Ds=r(Xm,"P",{});var Yf=n(Ds);cp=r(Yf,"A",{href:!0});var NJ=n(cp);C4=i(NJ,"FlaxLogitsProcessor"),NJ.forEach(o),N4=i(Yf," that enforces the specified token as the last generated token when "),Tu=r(Yf,"CODE",{});var XJ=n(Tu);X4=i(XJ,"max_length"),XJ.forEach(o),R4=i(Yf," is reached."),Yf.forEach(o),O4=l(Xm),lp=r(Xm,"DIV",{class:!0});var RJ=n(lp);u(_i.$$.fragment,RJ),RJ.forEach(o),Xm.forEach(o),Wb=l(t),Tt=r(t,"DIV",{class:!0});var Rm=n(Tt);u(bi.$$.fragment,Rm),A4=l(Rm),Ss=r(Rm,"P",{});var Kf=n(Ss);dp=r(Kf,"A",{href:!0});var OJ=n(dp);H4=i(OJ,"FlaxLogitsProcessor"),OJ.forEach(o),Q4=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=r(Kf,"CODE",{});var AJ=n(wu);Y4=i(AJ,"-inf"),AJ.forEach(o),K4=i(Kf," so that they are sampled at their corresponding index."),Kf.forEach(o),ex=l(Rm),pp=r(Rm,"DIV",{class:!0});var HJ=n(pp);u(vi.$$.fragment,HJ),HJ.forEach(o),Rm.forEach(o),Vb=l(t),wt=r(t,"DIV",{class:!0});var Om=n(wt);u(yi.$$.fragment,Om),tx=l(Om),$u=r(Om,"P",{});var QJ=n($u);ox=i(QJ,"Abstract base class for all logit processors that can be applied during generation."),QJ.forEach(o),sx=l(Om),Ps=r(Om,"DIV",{class:!0});var dy=n(Ps);u(Ti.$$.fragment,dy),rx=l(dy),ku=r(dy,"P",{});var YJ=n(ku);nx=i(YJ,"Flax method for processing logits."),YJ.forEach(o),dy.forEach(o),Om.forEach(o),Zb=l(t),$t=r(t,"DIV",{class:!0});var Am=n($t);u(wi.$$.fragment,Am),ax=l(Am),C=r(Am,"P",{});var le=n(C);ix=i(le,"This class can be used to create a list of "),mp=r(le,"A",{href:!0});var KJ=n(mp);cx=i(KJ,"FlaxLogitsProcessor"),KJ.forEach(o),lx=i(le," or "),hp=r(le,"A",{href:!0});var eI=n(hp);dx=i(eI,"FlaxLogitsWarper"),eI.forEach(o),px=i(le,` to subsequently process
a `),xu=r(le,"CODE",{});var tI=n(xu);mx=i(tI,"scores"),tI.forEach(o),hx=i(le," input tensor. This class inherits from list and adds a specific "),Mu=r(le,"EM",{});var oI=n(Mu);Eu=r(oI,"STRONG",{});var sI=n(Eu);gx=i(sI,"call"),sI.forEach(o),oI.forEach(o),ux=i(le,` method to apply each
`),gp=r(le,"A",{href:!0});var rI=n(gp);fx=i(rI,"FlaxLogitsProcessor"),rI.forEach(o),_x=i(le," or "),up=r(le,"A",{href:!0});var nI=n(up);bx=i(nI,"FlaxLogitsWarper"),nI.forEach(o),vx=i(le," to the inputs."),le.forEach(o),yx=l(Am),fp=r(Am,"DIV",{class:!0});var aI=n(fp);u($i.$$.fragment,aI),aI.forEach(o),Am.forEach(o),Gb=l(t),kt=r(t,"DIV",{class:!0});var Hm=n(kt);u(ki.$$.fragment,Hm),Tx=l(Hm),ju=r(Hm,"P",{});var iI=n(ju);wx=i(iI,"Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),iI.forEach(o),$x=l(Hm),Ws=r(Hm,"DIV",{class:!0});var py=n(Ws);u(xi.$$.fragment,py),kx=l(py),Fu=r(py,"P",{});var cI=n(Fu);xx=i(cI,"Flax method for warping logits."),cI.forEach(o),py.forEach(o),Hm.forEach(o),Cb=l(t),xt=r(t,"DIV",{class:!0});var Qm=n(xt);u(Mi.$$.fragment,Qm),Mx=l(Qm),_p=r(Qm,"P",{});var MF=n(_p);bp=r(MF,"A",{href:!0});var lI=n(bp);Ex=i(lI,"FlaxLogitsProcessor"),lI.forEach(o),jx=i(MF," enforcing a min-length by setting EOS probability to 0."),MF.forEach(o),Fx=l(Qm),vp=r(Qm,"DIV",{class:!0});var dI=n(vp);u(Ei.$$.fragment,dI),dI.forEach(o),Qm.forEach(o),Nb=l(t),Mt=r(t,"DIV",{class:!0});var Ym=n(Mt);u(ji.$$.fragment,Ym),Lx=l(Ym),ze=r(Ym,"P",{});var Ao=n(ze);yp=r(Ao,"A",{href:!0});var pI=n(yp);zx=i(pI,"FlaxLogitsProcessor"),pI.forEach(o),Jx=i(Ao," supressing a list of tokens as soon as the "),Lu=r(Ao,"CODE",{});var mI=n(Lu);Ix=i(mI,"generate"),mI.forEach(o),Ux=i(Ao,` function starts generating using
`),zu=r(Ao,"CODE",{});var hI=n(zu);Bx=i(hI,"begin_index"),hI.forEach(o),qx=i(Ao," tokens. This should ensure that the tokens defined by "),Ju=r(Ao,"CODE",{});var gI=n(Ju);Dx=i(gI,"begin_suppress_tokens"),gI.forEach(o),Sx=i(Ao,` are not sampled at the
begining of the generation.`),Ao.forEach(o),Px=l(Ym),Tp=r(Ym,"DIV",{class:!0});var uI=n(Tp);u(Fi.$$.fragment,uI),uI.forEach(o),Ym.forEach(o),Xb=l(t),Et=r(t,"DIV",{class:!0});var Km=n(Et);u(Li.$$.fragment,Km),Wx=l(Km),Vs=r(Km,"P",{});var e_=n(Vs);wp=r(e_,"A",{href:!0});var fI=n(wp);Vx=i(fI,"FlaxLogitsProcessor"),fI.forEach(o),Zx=i(e_,` suppressing a list of tokens at each decoding step. The processor will set their log probs
to be `),Iu=r(e_,"CODE",{});var _I=n(Iu);Gx=i(_I,"-inf"),_I.forEach(o),Cx=i(e_," so they are not sampled."),e_.forEach(o),Nx=l(Km),$p=r(Km,"DIV",{class:!0});var bI=n($p);u(zi.$$.fragment,bI),bI.forEach(o),Km.forEach(o),Rb=l(t),jt=r(t,"DIV",{class:!0});var eh=n(jt);u(Ji.$$.fragment,eh),Xx=l(eh),kp=r(eh,"P",{});var EF=n(kp);xp=r(EF,"A",{href:!0});var vI=n(xp);Rx=i(vI,"FlaxLogitsWarper"),vI.forEach(o),Ox=i(EF," for temperature (exponential scaling output probability distribution)."),EF.forEach(o),Ax=l(eh),Mp=r(eh,"DIV",{class:!0});var yI=n(Mp);u(Ii.$$.fragment,yI),yI.forEach(o),eh.forEach(o),Ob=l(t),Ft=r(t,"DIV",{class:!0});var th=n(Ft);u(Ui.$$.fragment,th),Hx=l(th),Ep=r(th,"P",{});var jF=n(Ep);jp=r(jF,"A",{href:!0});var TI=n(jp);Qx=i(TI,"FlaxLogitsWarper"),TI.forEach(o),Yx=i(jF," that performs top-k, i.e. restricting to the k highest probability elements."),jF.forEach(o),Kx=l(th),Fp=r(th,"DIV",{class:!0});var wI=n(Fp);u(Bi.$$.fragment,wI),wI.forEach(o),th.forEach(o),Ab=l(t),Lt=r(t,"DIV",{class:!0});var oh=n(Lt);u(qi.$$.fragment,oh),eM=l(oh),Lp=r(oh,"P",{});var FF=n(Lp);zp=r(FF,"A",{href:!0});var $I=n(zp);tM=i($I,"FlaxLogitsWarper"),$I.forEach(o),oM=i(FF," that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),FF.forEach(o),sM=l(oh),Jp=r(oh,"DIV",{class:!0});var kI=n(Jp);u(Di.$$.fragment,kI),kI.forEach(o),oh.forEach(o),Hb=l(t),zt=r(t,"DIV",{class:!0});var sh=n(zt);u(Si.$$.fragment,sh),rM=l(sh),Pi=r(sh,"P",{});var my=n(Pi);nM=i(my,`Whisper specific Processor. This processor can be used to force a list of tokens. The processor will set their log
probs to `),Uu=r(my,"CODE",{});var xI=n(Uu);aM=i(xI,"inf"),xI.forEach(o),iM=i(my," so that they are sampled at their corresponding index."),my.forEach(o),cM=l(sh),Ip=r(sh,"DIV",{class:!0});var MI=n(Ip);u(Wi.$$.fragment,MI),MI.forEach(o),sh.forEach(o),Qb=l(t),qo=r(t,"H2",{class:!0});var hy=n(qo);Zs=r(hy,"A",{id:!0,class:!0,href:!0});var EI=n(Zs);Bu=r(EI,"SPAN",{});var jI=n(Bu);u(Vi.$$.fragment,jI),jI.forEach(o),EI.forEach(o),lM=l(hy),qu=r(hy,"SPAN",{});var FI=n(qu);dM=i(FI,"StoppingCriteria"),FI.forEach(o),hy.forEach(o),Yb=l(t),Gs=r(t,"P",{});var gy=n(Gs);pM=i(gy,"A "),Up=r(gy,"A",{href:!0});var LI=n(Up);mM=i(LI,"StoppingCriteria"),LI.forEach(o),hM=i(gy," can be used to change when to stop generation (other than EOS token). Please note that this is exclusivelly available to our PyTorch implementations."),gy.forEach(o),Kb=l(t),Jt=r(t,"DIV",{class:!0});var rh=n(Jt);u(Zi.$$.fragment,rh),gM=l(rh),Du=r(rh,"P",{});var zI=n(Du);uM=i(zI,"Abstract base class for all stopping criteria that can be applied during generation."),zI.forEach(o),fM=l(rh),Bp=r(rh,"DIV",{class:!0});var JI=n(Bp);u(Gi.$$.fragment,JI),JI.forEach(o),rh.forEach(o),ev=l(t),Do=r(t,"DIV",{class:!0});var uy=n(Do);u(Ci.$$.fragment,uy),_M=l(uy),qp=r(uy,"DIV",{class:!0});var II=n(qp);u(Ni.$$.fragment,II),II.forEach(o),uy.forEach(o),tv=l(t),It=r(t,"DIV",{class:!0});var nh=n(It);u(Xi.$$.fragment,nh),bM=l(nh),Ri=r(nh,"P",{});var fy=n(Ri);vM=i(fy,"This class can be used to stop generation whenever the full generated number of tokens exceeds "),Su=r(fy,"CODE",{});var UI=n(Su);yM=i(UI,"max_length"),UI.forEach(o),TM=i(fy,`. Keep
in mind for decoder-only type of transformers, this will include the initial prompted tokens.`),fy.forEach(o),wM=l(nh),Dp=r(nh,"DIV",{class:!0});var BI=n(Dp);u(Oi.$$.fragment,BI),BI.forEach(o),nh.forEach(o),ov=l(t),Ut=r(t,"DIV",{class:!0});var ah=n(Ut);u(Ai.$$.fragment,ah),$M=l(ah),Hi=r(ah,"P",{});var _y=n(Hi);kM=i(_y,`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=r(_y,"CODE",{});var qI=n(Pu);xM=i(qI,"initial_time"),qI.forEach(o),MM=i(_y,"."),_y.forEach(o),EM=l(ah),Sp=r(ah,"DIV",{class:!0});var DI=n(Sp);u(Qi.$$.fragment,DI),DI.forEach(o),ah.forEach(o),sv=l(t),So=r(t,"H2",{class:!0});var by=n(So);Cs=r(by,"A",{id:!0,class:!0,href:!0});var SI=n(Cs);Wu=r(SI,"SPAN",{});var PI=n(Wu);u(Yi.$$.fragment,PI),PI.forEach(o),SI.forEach(o),jM=l(by),Vu=r(by,"SPAN",{});var WI=n(Vu);FM=i(WI,"Constraints"),WI.forEach(o),by.forEach(o),rv=l(t),Ns=r(t,"P",{});var vy=n(Ns);LM=i(vy,"A "),Pp=r(vy,"A",{href:!0});var VI=n(Pp);zM=i(VI,"Constraint"),VI.forEach(o),JM=i(vy," 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."),vy.forEach(o),nv=l(t),z=r(t,"DIV",{class:!0});var I=n(z);u(Ki.$$.fragment,I),IM=l(I),Zu=r(I,"P",{});var ZI=n(Zu);UM=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),BM=l(I),Gu=r(I,"P",{});var GI=n(Gu);qM=i(GI,"All classes that inherit Constraint must follow the requirement that"),GI.forEach(o),DM=l(I),u(Xs.$$.fragment,I),SM=l(I),Cu=r(I,"P",{});var CI=n(Cu);PM=i(CI,"will always terminate (halt)."),CI.forEach(o),WM=l(I),Rs=r(I,"DIV",{class:!0});var yy=n(Rs);u(ec.$$.fragment,yy),VM=l(yy),Nu=r(yy,"P",{});var NI=n(Nu);ZM=i(NI,"When called, returns the token that would take this constraint one step closer to being fulfilled."),NI.forEach(o),yy.forEach(o),GM=l(I),Os=r(I,"DIV",{class:!0});var Ty=n(Os);u(tc.$$.fragment,Ty),CM=l(Ty),Xu=r(Ty,"P",{});var XI=n(Xu);NM=i(XI,"Creates a new instance of this constraint."),XI.forEach(o),Ty.forEach(o),XM=l(I),As=r(I,"DIV",{class:!0});var wy=n(As);u(oc.$$.fragment,wy),RM=l(wy),Ru=r(wy,"P",{});var RI=n(Ru);OM=i(RI,"Reads in a token and returns whether it creates progress."),RI.forEach(o),wy.forEach(o),AM=l(I),Hs=r(I,"DIV",{class:!0});var $y=n(Hs);u(sc.$$.fragment,$y),HM=l($y),rc=r($y,"P",{});var ky=n(rc);QM=i(ky,"Returns the number of remaining steps of "),Ou=r(ky,"CODE",{});var OI=n(Ou);YM=i(OI,"advance()"),OI.forEach(o),KM=i(ky," in order to complete this constraint."),ky.forEach(o),$y.forEach(o),eE=l(I),Qs=r(I,"DIV",{class:!0});var xy=n(Qs);u(nc.$$.fragment,xy),tE=l(xy),Au=r(xy,"P",{});var AI=n(Au);oE=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),xy.forEach(o),sE=l(I),Ys=r(I,"DIV",{class:!0});var My=n(Ys);u(ac.$$.fragment,My),rE=l(My),Hu=r(My,"P",{});var HI=n(Hu);nE=i(HI,"Tests whether this constraint has been properly defined."),HI.forEach(o),My.forEach(o),aE=l(I),Zt=r(I,"DIV",{class:!0});var ih=n(Zt);u(ic.$$.fragment,ih),iE=l(ih),cc=r(ih,"P",{});var Ey=n(cc);cE=i(Ey,`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=r(Ey,"CODE",{});var QI=n(Qu);lE=i(QI,"does_advance(self, token_id: int)"),QI.forEach(o),dE=i(Ey,"."),Ey.forEach(o),pE=l(ih),Yu=r(ih,"P",{});var YI=n(Yu);mE=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),av=l(t),Po=r(t,"DIV",{class:!0});var jy=n(Po);u(lc.$$.fragment,jy),hE=l(jy),Wp=r(jy,"P",{});var LF=n(Wp);Vp=r(LF,"A",{href:!0});var KI=n(Vp);gE=i(KI,"Constraint"),KI.forEach(o),uE=i(LF," enforcing that an ordered sequence of tokens is included in the output."),LF.forEach(o),jy.forEach(o),iv=l(t),Wo=r(t,"DIV",{class:!0});var Fy=n(Wo);u(dc.$$.fragment,Fy),fE=l(Fy),pc=r(Fy,"P",{});var Ly=n(pc);_E=i(Ly,"A special "),Zp=r(Ly,"A",{href:!0});var eU=n(Zp);bE=i(eU,"Constraint"),eU.forEach(o),vE=i(Ly," that is fulfilled by fulfilling just one of several constraints."),Ly.forEach(o),Fy.forEach(o),cv=l(t),we=r(t,"DIV",{class:!0});var yr=n(we);u(mc.$$.fragment,yr),yE=l(yr),Ku=r(yr,"P",{});var tU=n(Ku);TE=i(tU,"A class for beam scorers to track its progress through a list of constraints."),tU.forEach(o),wE=l(yr),R=r(yr,"DIV",{class:!0});var Je=n(R);u(hc.$$.fragment,Je),$E=l(Je),ef=r(Je,"P",{});var oU=n(ef);kE=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),xE=l(Je),Vo=r(Je,"P",{});var ch=n(Vo);ME=i(ch,"Given constraints "),tf=r(ch,"CODE",{});var sU=n(tf);EE=i(sU,"c_i = {t_ij | j == # of tokens}"),sU.forEach(o),jE=i(ch,`, If we\u2019re not in the middle of progressing through a
specific constraint `),of=r(ch,"CODE",{});var rU=n(of);FE=i(rU,"c_i"),rU.forEach(o),LE=i(ch,", we return:"),ch.forEach(o),zE=l(Je),sf=r(Je,"P",{});var nU=n(sf);rf=r(nU,"CODE",{});var aU=n(rf);JE=i(aU,"[t_k1 for k in indices of unfulfilled constraints]"),aU.forEach(o),nU.forEach(o),IE=l(Je),Bt=r(Je,"P",{});var Tr=n(Bt);UE=i(Tr,`If we are in the middle of a constraint, then we return:
`),nf=r(Tr,"CODE",{});var iU=n(nf);BE=i(iU,"[t_ij]"),iU.forEach(o),qE=i(Tr,", where "),af=r(Tr,"CODE",{});var cU=n(af);DE=i(cU,"i"),cU.forEach(o),SE=i(Tr," is the index of the inprogress constraint, "),cf=r(Tr,"CODE",{});var lU=n(cf);PE=i(lU,"j"),lU.forEach(o),WE=i(Tr," is the next step for the constraint."),Tr.forEach(o),VE=l(Je),lf=r(Je,"P",{});var dU=n(lf);ZE=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),GE=l(yr),Ks=r(yr,"DIV",{class:!0});var zy=n(Ks);u(gc.$$.fragment,zy),CE=l(zy),df=r(zy,"P",{});var pU=n(df);NE=i(pU,"token_ids: the tokens generated thus far to reset the state of the progress through constraints."),pU.forEach(o),zy.forEach(o),yr.forEach(o),lv=l(t),Zo=r(t,"H2",{class:!0});var Jy=n(Zo);er=r(Jy,"A",{id:!0,class:!0,href:!0});var mU=n(er);pf=r(mU,"SPAN",{});var hU=n(pf);u(uc.$$.fragment,hU),hU.forEach(o),mU.forEach(o),XE=l(Jy),mf=r(Jy,"SPAN",{});var gU=n(mf);RE=i(gU,"BeamSearch"),gU.forEach(o),Jy.forEach(o),dv=l(t),$e=r(t,"DIV",{class:!0});var wr=n($e);u(fc.$$.fragment,wr),OE=l(wr),Go=r(wr,"P",{});var lh=n(Go);AE=i(lh,"Abstract base class for all beam scorers that are used for "),Gp=r(lh,"A",{href:!0});var uU=n(Gp);HE=i(uU,"beam_search()"),uU.forEach(o),QE=i(lh,` and
`),Cp=r(lh,"A",{href:!0});var fU=n(Cp);YE=i(fU,"beam_sample()"),fU.forEach(o),KE=i(lh,"."),lh.forEach(o),ej=l(wr),Np=r(wr,"DIV",{class:!0});var _U=n(Np);u(_c.$$.fragment,_U),_U.forEach(o),tj=l(wr),Xp=r(wr,"DIV",{class:!0});var bU=n(Xp);u(bc.$$.fragment,bU),bU.forEach(o),wr.forEach(o),pv=l(t),N=r(t,"DIV",{class:!0});var Ie=n(N);u(vc.$$.fragment,Ie),oj=l(Ie),Rp=r(Ie,"P",{});var zF=n(Rp);Op=r(zF,"A",{href:!0});var vU=n(Op);sj=i(vU,"BeamScorer"),vU.forEach(o),rj=i(zF," implementing standard beam search decoding."),zF.forEach(o),nj=l(Ie),yc=r(Ie,"P",{});var Iy=n(yc);aj=i(Iy,"Adapted in part from "),Tc=r(Iy,"A",{href:!0,rel:!0});var yU=n(Tc);ij=i(yU,`Facebook\u2019s XLM beam search
code`),yU.forEach(o),cj=i(Iy,"."),Iy.forEach(o),lj=l(Ie),Ap=r(Ie,"P",{});var JF=n(Ap);dj=i(JF,"Reference for the diverse beam search algorithm and implementation "),wc=r(JF,"A",{href:!0,rel:!0});var TU=n(wc);pj=i(TU,`Ashwin Kalyan\u2019s DBS
implementation`),TU.forEach(o),JF.forEach(o),mj=l(Ie),Hp=r(Ie,"DIV",{class:!0});var wU=n(Hp);u($c.$$.fragment,wU),wU.forEach(o),hj=l(Ie),Qp=r(Ie,"DIV",{class:!0});var $U=n(Qp);u(kc.$$.fragment,$U),$U.forEach(o),Ie.forEach(o),mv=l(t),ke=r(t,"DIV",{class:!0});var $r=n(ke);u(xc.$$.fragment,$r),gj=l($r),Yp=r($r,"P",{});var IF=n(Yp);Kp=r(IF,"A",{href:!0});var kU=n(Kp);uj=i(kU,"BeamScorer"),kU.forEach(o),fj=i(IF," implementing constrained beam search decoding."),IF.forEach(o),_j=l($r),em=r($r,"DIV",{class:!0});var xU=n(em);u(Mc.$$.fragment,xU),xU.forEach(o),bj=l($r),tm=r($r,"DIV",{class:!0});var MU=n(tm);u(Ec.$$.fragment,MU),MU.forEach(o),$r.forEach(o),hv=l(t),Co=r(t,"H2",{class:!0});var Uy=n(Co);tr=r(Uy,"A",{id:!0,class:!0,href:!0});var EU=n(tr);hf=r(EU,"SPAN",{});var jU=n(hf);u(jc.$$.fragment,jU),jU.forEach(o),EU.forEach(o),vj=l(Uy),gf=r(Uy,"SPAN",{});var FU=n(gf);yj=i(FU,"Utilities"),FU.forEach(o),Uy.forEach(o),gv=l(t),qt=r(t,"DIV",{class:!0});var dh=n(qt);u(Fc.$$.fragment,dh),Tj=l(dh),uf=r(dh,"P",{});var LU=n(uf);wj=i(LU,"Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),LU.forEach(o),$j=l(dh),om=r(dh,"P",{});var UF=n(om);kj=i(UF,"From: "),Lc=r(UF,"A",{href:!0,rel:!0});var zU=n(Lc);xj=i(zU,"https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),zU.forEach(o),UF.forEach(o),dh.forEach(o),uv=l(t),Dt=r(t,"DIV",{class:!0});var ph=n(Dt);u(zc.$$.fragment,ph),Mj=l(ph),ff=r(ph,"P",{});var JU=n(ff);Ej=i(JU,"Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),JU.forEach(o),jj=l(ph),sm=r(ph,"P",{});var BF=n(sm);Fj=i(BF,"From: "),Jc=r(BF,"A",{href:!0,rel:!0});var IU=n(Jc);Lj=i(IU,"https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),IU.forEach(o),BF.forEach(o),ph.forEach(o),fv=l(t),No=r(t,"H2",{class:!0});var By=n(No);or=r(By,"A",{id:!0,class:!0,href:!0});var UU=n(or);_f=r(UU,"SPAN",{});var BU=n(_f);u(Ic.$$.fragment,BU),BU.forEach(o),UU.forEach(o),zj=l(By),bf=r(By,"SPAN",{});var qU=n(bf);Jj=i(qU,"Streamers"),qU.forEach(o),By.forEach(o),_v=l(t),P=r(t,"DIV",{class:!0});var de=n(P);u(Uc.$$.fragment,de),Ij=l(de),vf=r(de,"P",{});var DU=n(vf);Uj=i(DU,"Simple text streamer that prints the token(s) to stdout as soon as entire words are formed."),DU.forEach(o),Bj=l(de),u(sr.$$.fragment,de),qj=l(de),u(rr.$$.fragment,de),Dj=l(de),nr=r(de,"DIV",{class:!0});var qy=n(nr);u(Bc.$$.fragment,qy),Sj=l(qy),yf=r(qy,"P",{});var SU=n(yf);Pj=i(SU,"Flushes any remaining cache and prints a newline to stdout."),SU.forEach(o),qy.forEach(o),Wj=l(de),ar=r(de,"DIV",{class:!0});var Dy=n(ar);u(qc.$$.fragment,Dy),Vj=l(Dy),Tf=r(Dy,"P",{});var PU=n(Tf);Zj=i(PU,"Prints the new text to stdout. If the stream is ending, also prints a newline."),PU.forEach(o),Dy.forEach(o),Gj=l(de),ir=r(de,"DIV",{class:!0});var Sy=n(ir);u(Dc.$$.fragment,Sy),Cj=l(Sy),wf=r(Sy,"P",{});var WU=n(wf);Nj=i(WU,"Receives tokens, decodes them, and prints them to stdout as soon as they form entire words."),WU.forEach(o),Sy.forEach(o),de.forEach(o),bv=l(t),te=r(t,"DIV",{class:!0});var Yt=n(te);u(Sc.$$.fragment,Yt),Xj=l(Yt),$f=r(Yt,"P",{});var VU=n($f);Rj=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),Oj=l(Yt),u(cr.$$.fragment,Yt),Aj=l(Yt),u(lr.$$.fragment,Yt),Hj=l(Yt),dr=r(Yt,"DIV",{class:!0});var Py=n(dr);u(Pc.$$.fragment,Py),Qj=l(Py),kf=r(Py,"P",{});var ZU=n(kf);Yj=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),Py.forEach(o),Yt.forEach(o),this.h()},h(){d(y,"name","hf:doc:metadata"),d(y,"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/v4.33.0/en/main_classes/text_generation#transformers.GenerationMixin.generate"),d(se,"href","/docs/transformers/v4.33.0/en/main_classes/text_generation#transformers.GenerationMixin.greedy_search"),d(j,"href","/docs/transformers/v4.33.0/en/main_classes/text_generation#transformers.GenerationMixin.contrastive_search"),d(xe,"href","/docs/transformers/v4.33.0/en/main_classes/text_generation#transformers.GenerationMixin.sample"),d(Cc,"href","/docs/transformers/v4.33.0/en/main_classes/text_generation#transformers.GenerationMixin.beam_search"),d(Nc,"href","/docs/transformers/v4.33.0/en/main_classes/text_generation#transformers.GenerationMixin.beam_sample"),d(Xc,"href","/docs/transformers/v4.33.0/en/main_classes/text_generation#transformers.GenerationMixin.group_beam_search"),d(Rc,"href","/docs/transformers/v4.33.0/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/v4.33.0/en/main_classes/text_generation#transformers.GenerationMixin.generate"),d(Hc,"href","/docs/transformers/v4.33.0/en/main_classes/output#transformers.utils.ModelOutput"),d(Qc,"href","/docs/transformers/v4.33.0/en/main_classes/text_generation#transformers.GenerationMixin.generate"),d(Kc,"href","/docs/transformers/v4.33.0/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(ro,"class","relative group"),d(no,"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(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(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(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(rs,"id","logitsprocessor"),d(rs,"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(rs,"href","#logitsprocessor"),d(jo,"class","relative group"),d(nl,"href","/docs/transformers/v4.33.0/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/v4.33.0/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(pn,"href","https://arxiv.org/abs/2306.05284"),d(pn,"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/v4.33.0/en/internal/generation_utils#transformers.LogitsProcessor"),d(gn,"href","https://github.com/facebookresearch/ParlAI/blob/master/parlai/core/torch_generator_agent.py#L1350"),d(gn,"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/v4.33.0/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/v4.33.0/en/internal/generation_utils#transformers.LogitsWarper"),d(vn,"href","https://arxiv.org/abs/2210.15191"),d(vn,"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/v4.33.0/en/internal/generation_utils#transformers.LogitsWarper"),d(wn,"href","https://arxiv.org/abs/2210.15191"),d(wn,"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(vl,"href","/docs/transformers/v4.33.0/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(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/v4.33.0/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/v4.33.0/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/v4.33.0/en/internal/generation_utils#transformers.LogitsProcessor"),d(Fl,"href","/docs/transformers/v4.33.0/en/main_classes/text_generation#transformers.GenerationMixin.group_beam_search"),d(Un,"href","https://arxiv.org/pdf/1610.02424.pdf"),d(Un,"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/v4.33.0/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/v4.33.0/en/internal/generation_utils#transformers.LogitsWarper"),d(Pl,"href","/docs/transformers/v4.33.0/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/v4.33.0/en/internal/generation_utils#transformers.LogitsProcessor"),d(Gl,"href","/docs/transformers/v4.33.0/en/internal/generation_utils#transformers.LogitsWarper"),d(Cl,"href","/docs/transformers/v4.33.0/en/internal/generation_utils#transformers.LogitsProcessor"),d(Nl,"href","/docs/transformers/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/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(rd,"href","/docs/transformers/v4.33.0/en/internal/generation_utils#transformers.LogitsProcessor"),d(ra,"href","https://arxiv.org/abs/2010.00904"),d(ra,"rel","nofollow"),d(nd,"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/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/en/internal/generation_utils#transformers.LogitsWarper"),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(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(Td,"href","/docs/transformers/v4.33.0/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(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($d,"href","/docs/transformers/v4.33.0/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(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(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/v4.33.0/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(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(Ld,"href","/docs/transformers/v4.33.0/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(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(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/v4.33.0/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(Ud,"href","/docs/transformers/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/en/internal/generation_utils#transformers.TFLogitsWarper"),d(rp,"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/v4.33.0/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(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(cp,"href","/docs/transformers/v4.33.0/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(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(dp,"href","/docs/transformers/v4.33.0/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(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(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/v4.33.0/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(hp,"href","/docs/transformers/v4.33.0/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(gp,"href","/docs/transformers/v4.33.0/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(up,"href","/docs/transformers/v4.33.0/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/v4.33.0/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(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(yp,"href","/docs/transformers/v4.33.0/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),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(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/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/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(er,"id","transformers.BeamScorer"),d(er,"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(er,"href","#transformers.BeamScorer"),d(Zo,"class","relative group"),d(Gp,"href","/docs/transformers/v4.33.0/en/main_classes/text_generation#transformers.GenerationMixin.beam_search"),d(Cp,"href","/docs/transformers/v4.33.0/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/v4.33.0/en/internal/generation_utils#transformers.BeamScorer"),d(Tc,"href","https://github.com/facebookresearch/XLM/blob/9e6f6814d17be4fe5b15f2e6c43eb2b2d76daeb4/src/model/transformer.py#L529"),d(Tc,"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/v4.33.0/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(tr,"id","transformers.top_k_top_p_filtering"),d(tr,"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(tr,"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(or,"id","transformers.TextStreamer"),d(or,"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(or,"href","#transformers.TextStreamer"),d(No,"class","relative group"),d(nr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ar,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ir,"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(dr,"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,y),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,Wy),e(F,Vy),e(F,Nc),e(Nc,Zy),e(F,Gy),e(F,Xc),e(Xc,Cy),e(F,Ny),e(F,Rc),e(Rc,Xy),e(F,Ry),m(t,t_,p),m(t,Oc,p),e(Oc,Oy),m(t,o_,p),m(t,so,p),e(so,Ho),e(Ho,mh),f(xr,mh,null),e(so,Ay),e(so,hh),e(hh,Hy),m(t,s_,p),m(t,Me,p),e(Me,Qy),e(Me,Ac),e(Ac,Yy),e(Me,Ky),e(Me,Hc),e(Hc,eT),e(Me,tT),e(Me,Qc),e(Qc,oT),e(Me,sT),m(t,r_,p),m(t,Yc,p),e(Yc,rT),m(t,n_,p),f(Mr,t,p),m(t,a_,p),m(t,Pt,p),e(Pt,nT),e(Pt,gh),e(gh,aT),e(Pt,iT),e(Pt,Kc),e(Kc,cT),e(Pt,lT),m(t,i_,p),m(t,Ee,p),e(Ee,el),e(el,uh),e(uh,dT),e(el,pT),e(Ee,mT),e(Ee,tl),e(tl,fh),e(fh,hT),e(tl,gT),e(Ee,uT),e(Ee,ol),e(ol,_h),e(_h,fT),e(ol,_T),e(Ee,bT),e(Ee,sl),e(sl,bh),e(bh,vT),e(sl,yT),m(t,c_,p),m(t,V,p),e(V,TT),e(V,vh),e(vh,wT),e(V,$T),e(V,yh),e(yh,kT),e(V,xT),e(V,Th),e(Th,MT),e(V,ET),e(V,wh),e(wh,jT),e(V,FT),e(V,$h),e($h,LT),e(V,zT),e(V,kh),e(kh,JT),e(V,IT),m(t,l_,p),m(t,re,p),e(re,UT),e(re,xh),e(xh,BT),e(re,qT),e(re,Mh),e(Mh,DT),e(re,ST),e(re,Eh),e(Eh,PT),e(re,WT),e(re,jh),e(jh,VT),e(re,ZT),m(t,d_,p),m(t,ne,p),e(ne,GT),e(ne,Fh),e(Fh,CT),e(ne,NT),e(ne,Lh),e(Lh,XT),e(ne,RT),e(ne,zh),e(zh,OT),e(ne,AT),e(ne,Jh),e(Jh,HT),e(ne,QT),m(t,p_,p),f(Er,t,p),m(t,m_,p),m(t,Qo,p),e(Qo,YT),e(Qo,Ih),e(Ih,KT),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,r1),e(ae,n1),e(ae,qh),e(qh,a1),e(ae,i1),e(ae,Dh),e(Dh,c1),e(ae,l1),m(t,g_,p),m(t,rl,p),e(rl,d1),m(t,u_,p),m(t,ro,p),e(ro,Yo),e(Yo,Sh),f(jr,Sh,null),e(ro,p1),e(ro,Ph),e(Ph,m1),m(t,f_,p),m(t,no,p),f(Fr,no,null),e(no,h1),e(no,Wh),e(Wh,g1),m(t,__,p),m(t,ao,p),f(Lr,ao,null),e(ao,u1),e(ao,Vh),e(Vh,f1),m(t,b_,p),m(t,io,p),f(zr,io,null),e(io,_1),e(io,Zh),e(Zh,b1),m(t,v_,p),m(t,co,p),f(Jr,co,null),e(co,v1),e(co,Gh),e(Gh,y1),m(t,y_,p),m(t,lo,p),f(Ir,lo,null),e(lo,T1),e(lo,Ch),e(Ch,w1),m(t,T_,p),m(t,po,p),f(Ur,po,null),e(po,$1),e(po,Nh),e(Nh,k1),m(t,w_,p),m(t,mo,p),f(Br,mo,null),e(mo,x1),e(mo,Xh),e(Xh,M1),m(t,$_,p),m(t,ho,p),f(qr,ho,null),e(ho,E1),e(ho,Rh),e(Rh,j1),m(t,k_,p),m(t,go,p),f(Dr,go,null),e(go,F1),e(go,Oh),e(Oh,L1),m(t,x_,p),m(t,uo,p),f(Sr,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(Pr,Hh,null),e(fo,I1),e(fo,Qh),e(Qh,U1),m(t,E_,p),m(t,_o,p),f(Wr,_o,null),e(_o,B1),e(_o,Yh),e(Yh,q1),m(t,j_,p),m(t,bo,p),f(Vr,bo,null),e(bo,D1),e(bo,Kh),e(Kh,S1),m(t,F_,p),m(t,vo,p),f(Zr,vo,null),e(vo,P1),e(vo,eg),e(eg,W1),m(t,L_,p),m(t,yo,p),f(Gr,yo,null),e(yo,V1),e(yo,tg),e(tg,Z1),m(t,z_,p),m(t,To,p),f(Cr,To,null),e(To,G1),e(To,og),e(og,C1),m(t,J_,p),m(t,wo,p),f(Nr,wo,null),e(wo,N1),e(wo,sg),e(sg,X1),m(t,I_,p),m(t,$o,p),f(Xr,$o,null),e($o,R1),e($o,rg),e(rg,O1),m(t,U_,p),m(t,ko,p),f(Rr,ko,null),e(ko,A1),e(ko,ng),e(ng,H1),m(t,B_,p),m(t,xo,p),f(Or,xo,null),e(xo,Q1),e(xo,ag),e(ag,Y1),m(t,q_,p),m(t,Mo,p),f(Ar,Mo,null),e(Mo,K1),e(Mo,ig),e(ig,e0),m(t,D_,p),m(t,Eo,p),e(Eo,es),e(es,cg),f(Hr,cg,null),e(Eo,t0),e(Eo,lg),e(lg,o0),m(t,S_,p),m(t,qe,p),f(Qr,qe,null),e(qe,s0),e(qe,dg),e(dg,r0),e(qe,n0),e(qe,ts),f(Yr,ts,null),e(ts,a0),e(ts,pg),e(pg,i0),m(t,P_,p),m(t,De,p),f(Kr,De,null),e(De,c0),e(De,mg),e(mg,l0),e(De,d0),e(De,os),f(en,os,null),e(os,p0),e(os,hg),e(hg,m0),m(t,W_,p),m(t,Se,p),f(tn,Se,null),e(Se,h0),e(Se,gg),e(gg,g0),e(Se,u0),e(Se,ss),f(on,ss,null),e(ss,f0),e(ss,ug),e(ug,_0),m(t,V_,p),m(t,jo,p),e(jo,rs),e(rs,fg),f(sn,fg,null),e(jo,b0),e(jo,_g),e(_g,v0),m(t,Z_,p),m(t,ns,p),e(ns,y0),e(ns,nl),e(nl,T0),e(ns,w0),m(t,G_,p),m(t,Fo,p),e(Fo,as),e(as,bg),f(rn,bg,null),e(Fo,$0),e(Fo,vg),e(vg,k0),m(t,C_,p),m(t,Pe,p),f(nn,Pe,null),e(Pe,x0),e(Pe,is),e(is,al),e(al,M0),e(is,E0),e(is,yg),e(yg,j0),e(is,F0),e(Pe,L0),e(Pe,il),f(an,il,null),m(t,N_,p),m(t,ge,p),f(cn,ge,null),e(ge,z0),e(ge,ln),e(ln,J0),e(ln,Tg),e(Tg,I0),e(ln,U0),e(ge,B0),e(ge,dn),e(dn,q0),e(dn,pn),e(pn,D0),e(dn,S0),e(ge,P0),e(ge,cl),f(mn,cl,null),m(t,X_,p),m(t,We,p),f(hn,We,null),e(We,W0),e(We,cs),e(cs,ll),e(ll,V0),e(cs,Z0),e(cs,gn),e(gn,G0),e(cs,C0),e(We,N0),e(We,dl),f(un,dl,null),m(t,R_,p),m(t,Ve,p),f(fn,Ve,null),e(Ve,X0),e(Ve,pl),e(pl,ml),e(ml,R0),e(pl,O0),e(Ve,A0),e(Ve,hl),f(_n,hl,null),m(t,O_,p),m(t,ue,p),f(bn,ue,null),e(ue,H0),e(ue,Wt),e(Wt,gl),e(gl,Q0),e(Wt,Y0),e(Wt,wg),e(wg,K0),e(Wt,e2),e(Wt,vn),e(vn,t2),e(Wt,o2),e(ue,s2),f(ls,ue,null),e(ue,r2),e(ue,ul),f(yn,ul,null),m(t,A_,p),m(t,fe,p),f(Tn,fe,null),e(fe,n2),e(fe,D),e(D,fl),e(fl,a2),e(D,i2),e(D,$g),e($g,c2),e(D,l2),e(D,kg),e(kg,d2),e(D,p2),e(D,xg),e(xg,m2),e(D,h2),e(D,wn),e(wn,g2),e(D,u2),e(D,Mg),e(Mg,f2),e(D,_2),e(D,Eg),e(Eg,b2),e(D,v2),e(D,jg),e(jg,y2),e(D,T2),e(fe,w2),f(ds,fe,null),e(fe,$2),e(fe,_l),f($n,_l,null),m(t,H_,p),m(t,Ze,p),f(kn,Ze,null),e(Ze,k2),e(Ze,bl),e(bl,vl),e(vl,x2),e(bl,M2),e(Ze,E2),e(Ze,yl),f(xn,yl,null),m(t,Q_,p),m(t,Ge,p),f(Mn,Ge,null),e(Ge,j2),e(Ge,Tl),e(Tl,wl),e(wl,F2),e(Tl,L2),e(Ge,z2),e(Ge,$l),f(En,$l,null),m(t,Y_,p),m(t,Ce,p),f(jn,Ce,null),e(Ce,J2),e(Ce,ps),e(ps,kl),e(kl,I2),e(ps,U2),e(ps,Fg),e(Fg,B2),e(ps,q2),e(Ce,D2),e(Ce,xl),f(Fn,xl,null),m(t,K_,p),m(t,Ne,p),f(Ln,Ne,null),e(Ne,S2),e(Ne,zn),e(zn,P2),e(zn,Lg),e(Lg,W2),e(zn,V2),e(Ne,Z2),e(Ne,Ml),f(Jn,Ml,null),m(t,eb,p),m(t,L,p),f(In,L,null),e(L,G2),e(L,El),e(El,jl),e(jl,C2),e(El,N2),e(L,X2),e(L,Lo),e(Lo,R2),e(Lo,Fl),e(Fl,O2),e(Lo,A2),e(Lo,Un),e(Un,H2),e(Lo,Q2),e(L,Y2),f(ms,L,null),e(L,K2),f(hs,L,null),e(L,ew),e(L,Bn),e(Bn,tw),e(Bn,zg),e(zg,ow),e(Bn,sw),e(L,rw),e(L,Jg),e(Jg,nw),e(L,aw),e(L,zo),e(zo,Ll),e(Ll,Ig),e(Ig,iw),e(Ll,cw),e(zo,lw),e(zo,zl),e(zl,Ug),e(Ug,dw),e(zl,pw),e(zo,mw),e(zo,Jl),e(Jl,Bg),e(Bg,hw),e(Jl,gw),e(L,uw),e(L,qg),e(qg,fw),e(L,_w),e(L,qn),e(qn,Il),e(Il,Dg),e(Dg,bw),e(Il,vw),e(qn,yw),e(qn,Ul),e(Ul,Sg),e(Sg,Tw),e(Ul,ww),e(L,$w),f(gs,L,null),e(L,kw),e(L,Bl),f(Dn,Bl,null),m(t,tb,p),m(t,Xe,p),f(Sn,Xe,null),e(Xe,xw),e(Xe,Vt),e(Vt,ql),e(ql,Mw),e(Vt,Ew),e(Vt,Pg),e(Pg,jw),e(Vt,Fw),e(Vt,Wg),e(Wg,Lw),e(Vt,zw),e(Xe,Jw),e(Xe,Dl),f(Pn,Dl,null),m(t,ob,p),m(t,Re,p),f(Wn,Re,null),e(Re,Iw),e(Re,us),e(us,Sl),e(Sl,Uw),e(us,Bw),e(us,Pl),e(Pl,qw),e(us,Dw),e(Re,Sw),e(Re,Wl),f(Vn,Wl,null),m(t,sb,p),m(t,Oe,p),f(Zn,Oe,null),e(Oe,Pw),e(Oe,Vg),e(Vg,Ww),e(Oe,Vw),e(Oe,Vl),f(Gn,Vl,null),m(t,rb,p),m(t,Ae,p),f(Cn,Ae,null),e(Ae,Zw),e(Ae,G),e(G,Gw),e(G,Zl),e(Zl,Cw),e(G,Nw),e(G,Gl),e(Gl,Xw),e(G,Rw),e(G,Zg),e(Zg,Ow),e(G,Aw),e(G,Gg),e(Gg,Cg),e(Cg,Hw),e(G,Qw),e(G,Cl),e(Cl,Yw),e(G,Kw),e(G,Nl),e(Nl,e$),e(G,t$),e(Ae,o$),e(Ae,Xl),f(Nn,Xl,null),m(t,nb,p),m(t,He,p),f(Xn,He,null),e(He,s$),e(He,Ng),e(Ng,r$),e(He,n$),e(He,Rl),f(Rn,Rl,null),m(t,ab,p),m(t,Qe,p),f(On,Qe,null),e(Qe,a$),e(Qe,Ol),e(Ol,Al),e(Al,i$),e(Ol,c$),e(Qe,l$),e(Qe,Hl),f(An,Hl,null),m(t,ib,p),m(t,_e,p),f(Hn,_e,null),e(_e,d$),e(_e,je),e(je,Ql),e(Ql,p$),e(je,m$),e(je,Xg),e(Xg,h$),e(je,g$),e(je,Rg),e(Rg,u$),e(je,f$),e(je,Og),e(Og,_$),e(je,b$),e(_e,v$),f(fs,_e,null),e(_e,y$),e(_e,Yl),f(Qn,Yl,null),m(t,cb,p),m(t,H,p),f(Yn,H,null),e(H,T$),e(H,Kl),e(Kl,ed),e(ed,w$),e(Kl,$$),e(H,k$),f(_s,H,null),e(H,x$),f(bs,H,null),e(H,M$),e(H,td),f(Kn,td,null),m(t,lb,p),m(t,Q,p),f(ea,Q,null),e(Q,E$),e(Q,Jo),e(Jo,j$),e(Jo,od),e(od,F$),e(Jo,L$),e(Jo,ta),e(ta,z$),e(Jo,J$),e(Q,I$),f(vs,Q,null),e(Q,U$),f(ys,Q,null),e(Q,B$),e(Q,sd),f(oa,sd,null),m(t,db,p),m(t,Ye,p),f(sa,Ye,null),e(Ye,q$),e(Ye,Ts),e(Ts,rd),e(rd,D$),e(Ts,S$),e(Ts,ra),e(ra,P$),e(Ts,W$),e(Ye,V$),e(Ye,nd),f(na,nd,null),m(t,pb,p),m(t,be,p),f(aa,be,null),e(be,Z$),e(be,ws),e(ws,ad),e(ad,G$),e(ws,C$),e(ws,ia),e(ia,N$),e(ws,X$),e(be,R$),f($s,be,null),e(be,O$),e(be,id),f(ca,id,null),m(t,mb,p),m(t,Y,p),f(la,Y,null),e(Y,A$),e(Y,cd),e(cd,ld),e(ld,H$),e(cd,Q$),e(Y,Y$),f(ks,Y,null),e(Y,K$),f(xs,Y,null),e(Y,ek),e(Y,dd),f(da,dd,null),m(t,hb,p),m(t,Ke,p),f(pa,Ke,null),e(Ke,tk),e(Ke,Fe),e(Fe,pd),e(pd,ok),e(Fe,sk),e(Fe,Ag),e(Ag,rk),e(Fe,nk),e(Fe,Hg),e(Hg,ak),e(Fe,ik),e(Fe,Qg),e(Qg,ck),e(Fe,lk),e(Ke,dk),e(Ke,md),f(ma,md,null),m(t,gb,p),m(t,et,p),f(ha,et,null),e(et,pk),e(et,ga),e(ga,mk),e(ga,Yg),e(Yg,hk),e(ga,gk),e(et,uk),e(et,hd),f(ua,hd,null),m(t,ub,p),m(t,K,p),f(fa,K,null),e(K,fk),e(K,gd),e(gd,ud),e(ud,_k),e(gd,bk),e(K,vk),f(Ms,K,null),e(K,yk),f(Es,K,null),e(K,Tk),e(K,fd),f(_a,fd,null),m(t,fb,p),m(t,tt,p),f(ba,tt,null),e(tt,wk),e(tt,_d),e(_d,bd),e(bd,$k),e(_d,kk),e(tt,xk),e(tt,vd),f(va,vd,null),m(t,_b,p),m(t,ve,p),f(ya,ve,null),e(ve,Mk),e(ve,yd),e(yd,Td),e(Td,Ek),e(yd,jk),e(ve,Fk),f(js,ve,null),e(ve,Lk),e(ve,wd),f(Ta,wd,null),m(t,bb,p),m(t,ot,p),f(wa,ot,null),e(ot,zk),e(ot,Fs),e(Fs,$d),e($d,Jk),e(Fs,Ik),e(Fs,$a),e($a,Uk),e(Fs,Bk),e(ot,qk),e(ot,kd),f(ka,kd,null),m(t,vb,p),m(t,ee,p),f(xa,ee,null),e(ee,Dk),e(ee,st),e(st,Sk),e(st,Kg),e(Kg,Pk),e(st,Wk),e(st,eu),e(eu,Vk),e(st,Zk),e(st,tu),e(tu,Gk),e(st,Ck),e(ee,Nk),e(ee,Ma),e(Ma,Xk),e(Ma,Ea),e(Ea,Rk),e(Ma,Ok),e(ee,Ak),f(Ls,ee,null),e(ee,Hk),e(ee,xd),f(ja,xd,null),m(t,yb,p),m(t,ye,p),f(Fa,ye,null),e(ye,Qk),e(ye,La),e(La,Yk),e(La,ou),e(ou,Kk),e(La,e3),e(ye,t3),e(ye,za),e(za,o3),e(za,Ja),e(Ja,s3),e(za,r3),e(ye,n3),e(ye,Md),f(Ia,Md,null),m(t,Tb,p),m(t,Io,p),e(Io,zs),e(zs,su),f(Ua,su,null),e(Io,a3),e(Io,ru),e(ru,i3),m(t,wb,p),m(t,rt,p),f(Ba,rt,null),e(rt,c3),e(rt,Ed),e(Ed,jd),e(jd,l3),e(Ed,d3),e(rt,p3),e(rt,Fd),f(qa,Fd,null),m(t,$b,p),m(t,nt,p),f(Da,nt,null),e(nt,m3),e(nt,Js),e(Js,Ld),e(Ld,h3),e(Js,g3),e(Js,nu),e(nu,u3),e(Js,f3),e(nt,_3),e(nt,zd),f(Sa,zd,null),m(t,kb,p),m(t,at,p),f(Pa,at,null),e(at,b3),e(at,Uo),e(Uo,v3),e(Uo,au),e(au,y3),e(Uo,T3),e(Uo,iu),e(iu,w3),e(Uo,$3),e(at,k3),e(at,Jd),f(Wa,Jd,null),m(t,xb,p),m(t,it,p),f(Va,it,null),e(it,x3),e(it,cu),e(cu,M3),e(it,E3),e(it,Is),f(Za,Is,null),e(Is,j3),e(Is,lu),e(lu,F3),m(t,Mb,p),m(t,ct,p),f(Ga,ct,null),e(ct,L3),e(ct,Te),e(Te,z3),e(Te,Id),e(Id,J3),e(Te,I3),e(Te,du),e(du,U3),e(Te,B3),e(Te,pu),e(pu,mu),e(mu,q3),e(Te,D3),e(Te,Ud),e(Ud,S3),e(Te,P3),e(ct,W3),e(ct,Bd),f(Ca,Bd,null),m(t,Eb,p),m(t,lt,p),f(Na,lt,null),e(lt,V3),e(lt,hu),e(hu,Z3),e(lt,G3),e(lt,Us),f(Xa,Us,null),e(Us,C3),e(Us,gu),e(gu,N3),m(t,jb,p),m(t,dt,p),f(Ra,dt,null),e(dt,X3),e(dt,qd),e(qd,Dd),e(Dd,R3),e(qd,O3),e(dt,A3),e(dt,Sd),f(Oa,Sd,null),m(t,Fb,p),m(t,pt,p),f(Aa,pt,null),e(pt,H3),e(pt,Pd),e(Pd,Wd),e(Wd,Q3),e(Pd,Y3),e(pt,K3),e(pt,Vd),f(Ha,Vd,null),m(t,Lb,p),m(t,mt,p),f(Qa,mt,null),e(mt,e4),e(mt,Bs),e(Bs,Zd),e(Zd,t4),e(Bs,o4),e(Bs,Ya),e(Ya,s4),e(Bs,r4),e(mt,n4),e(mt,Gd),f(Ka,Gd,null),m(t,zb,p),m(t,ht,p),f(ei,ht,null),e(ht,a4),e(ht,Cd),e(Cd,Nd),e(Nd,i4),e(Cd,c4),e(ht,l4),e(ht,Xd),f(ti,Xd,null),m(t,Jb,p),m(t,gt,p),f(oi,gt,null),e(gt,d4),e(gt,Le),e(Le,Rd),e(Rd,p4),e(Le,m4),e(Le,uu),e(uu,h4),e(Le,g4),e(Le,fu),e(fu,u4),e(Le,f4),e(Le,_u),e(_u,_4),e(Le,b4),e(gt,v4),e(gt,Od),f(si,Od,null),m(t,Ib,p),m(t,ut,p),f(ri,ut,null),e(ut,y4),e(ut,ni),e(ni,T4),e(ni,bu),e(bu,w4),e(ni,$4),e(ut,k4),e(ut,Ad),f(ai,Ad,null),m(t,Ub,p),m(t,ft,p),f(ii,ft,null),e(ft,x4),e(ft,Hd),e(Hd,Qd),e(Qd,M4),e(Hd,E4),e(ft,j4),e(ft,Yd),f(ci,Yd,null),m(t,Bb,p),m(t,_t,p),f(li,_t,null),e(_t,F4),e(_t,Kd),e(Kd,ep),e(ep,L4),e(Kd,z4),e(_t,J4),e(_t,tp),f(di,tp,null),m(t,qb,p),m(t,bt,p),f(pi,bt,null),e(bt,I4),e(bt,op),e(op,sp),e(sp,U4),e(op,B4),e(bt,q4),e(bt,rp),f(mi,rp,null),m(t,Db,p),m(t,Bo,p),e(Bo,qs),e(qs,vu),f(hi,vu,null),e(Bo,D4),e(Bo,yu),e(yu,S4),m(t,Sb,p),m(t,vt,p),f(gi,vt,null),e(vt,P4),e(vt,np),e(np,ap),e(ap,W4),e(np,V4),e(vt,Z4),e(vt,ip),f(ui,ip,null),m(t,Pb,p),m(t,yt,p),f(fi,yt,null),e(yt,G4),e(yt,Ds),e(Ds,cp),e(cp,C4),e(Ds,N4),e(Ds,Tu),e(Tu,X4),e(Ds,R4),e(yt,O4),e(yt,lp),f(_i,lp,null),m(t,Wb,p),m(t,Tt,p),f(bi,Tt,null),e(Tt,A4),e(Tt,Ss),e(Ss,dp),e(dp,H4),e(Ss,Q4),e(Ss,wu),e(wu,Y4),e(Ss,K4),e(Tt,ex),e(Tt,pp),f(vi,pp,null),m(t,Vb,p),m(t,wt,p),f(yi,wt,null),e(wt,tx),e(wt,$u),e($u,ox),e(wt,sx),e(wt,Ps),f(Ti,Ps,null),e(Ps,rx),e(Ps,ku),e(ku,nx),m(t,Zb,p),m(t,$t,p),f(wi,$t,null),e($t,ax),e($t,C),e(C,ix),e(C,mp),e(mp,cx),e(C,lx),e(C,hp),e(hp,dx),e(C,px),e(C,xu),e(xu,mx),e(C,hx),e(C,Mu),e(Mu,Eu),e(Eu,gx),e(C,ux),e(C,gp),e(gp,fx),e(C,_x),e(C,up),e(up,bx),e(C,vx),e($t,yx),e($t,fp),f($i,fp,null),m(t,Gb,p),m(t,kt,p),f(ki,kt,null),e(kt,Tx),e(kt,ju),e(ju,wx),e(kt,$x),e(kt,Ws),f(xi,Ws,null),e(Ws,kx),e(Ws,Fu),e(Fu,xx),m(t,Cb,p),m(t,xt,p),f(Mi,xt,null),e(xt,Mx),e(xt,_p),e(_p,bp),e(bp,Ex),e(_p,jx),e(xt,Fx),e(xt,vp),f(Ei,vp,null),m(t,Nb,p),m(t,Mt,p),f(ji,Mt,null),e(Mt,Lx),e(Mt,ze),e(ze,yp),e(yp,zx),e(ze,Jx),e(ze,Lu),e(Lu,Ix),e(ze,Ux),e(ze,zu),e(zu,Bx),e(ze,qx),e(ze,Ju),e(Ju,Dx),e(ze,Sx),e(Mt,Px),e(Mt,Tp),f(Fi,Tp,null),m(t,Xb,p),m(t,Et,p),f(Li,Et,null),e(Et,Wx),e(Et,Vs),e(Vs,wp),e(wp,Vx),e(Vs,Zx),e(Vs,Iu),e(Iu,Gx),e(Vs,Cx),e(Et,Nx),e(Et,$p),f(zi,$p,null),m(t,Rb,p),m(t,jt,p),f(Ji,jt,null),e(jt,Xx),e(jt,kp),e(kp,xp),e(xp,Rx),e(kp,Ox),e(jt,Ax),e(jt,Mp),f(Ii,Mp,null),m(t,Ob,p),m(t,Ft,p),f(Ui,Ft,null),e(Ft,Hx),e(Ft,Ep),e(Ep,jp),e(jp,Qx),e(Ep,Yx),e(Ft,Kx),e(Ft,Fp),f(Bi,Fp,null),m(t,Ab,p),m(t,Lt,p),f(qi,Lt,null),e(Lt,eM),e(Lt,Lp),e(Lp,zp),e(zp,tM),e(Lp,oM),e(Lt,sM),e(Lt,Jp),f(Di,Jp,null),m(t,Hb,p),m(t,zt,p),f(Si,zt,null),e(zt,rM),e(zt,Pi),e(Pi,nM),e(Pi,Uu),e(Uu,aM),e(Pi,iM),e(zt,cM),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,lM),e(qo,qu),e(qu,dM),m(t,Yb,p),m(t,Gs,p),e(Gs,pM),e(Gs,Up),e(Up,mM),e(Gs,hM),m(t,Kb,p),m(t,Jt,p),f(Zi,Jt,null),e(Jt,gM),e(Jt,Du),e(Du,uM),e(Jt,fM),e(Jt,Bp),f(Gi,Bp,null),m(t,ev,p),m(t,Do,p),f(Ci,Do,null),e(Do,_M),e(Do,qp),f(Ni,qp,null),m(t,tv,p),m(t,It,p),f(Xi,It,null),e(It,bM),e(It,Ri),e(Ri,vM),e(Ri,Su),e(Su,yM),e(Ri,TM),e(It,wM),e(It,Dp),f(Oi,Dp,null),m(t,ov,p),m(t,Ut,p),f(Ai,Ut,null),e(Ut,$M),e(Ut,Hi),e(Hi,kM),e(Hi,Pu),e(Pu,xM),e(Hi,MM),e(Ut,EM),e(Ut,Sp),f(Qi,Sp,null),m(t,sv,p),m(t,So,p),e(So,Cs),e(Cs,Wu),f(Yi,Wu,null),e(So,jM),e(So,Vu),e(Vu,FM),m(t,rv,p),m(t,Ns,p),e(Ns,LM),e(Ns,Pp),e(Pp,zM),e(Ns,JM),m(t,nv,p),m(t,z,p),f(Ki,z,null),e(z,IM),e(z,Zu),e(Zu,UM),e(z,BM),e(z,Gu),e(Gu,qM),e(z,DM),f(Xs,z,null),e(z,SM),e(z,Cu),e(Cu,PM),e(z,WM),e(z,Rs),f(ec,Rs,null),e(Rs,VM),e(Rs,Nu),e(Nu,ZM),e(z,GM),e(z,Os),f(tc,Os,null),e(Os,CM),e(Os,Xu),e(Xu,NM),e(z,XM),e(z,As),f(oc,As,null),e(As,RM),e(As,Ru),e(Ru,OM),e(z,AM),e(z,Hs),f(sc,Hs,null),e(Hs,HM),e(Hs,rc),e(rc,QM),e(rc,Ou),e(Ou,YM),e(rc,KM),e(z,eE),e(z,Qs),f(nc,Qs,null),e(Qs,tE),e(Qs,Au),e(Au,oE),e(z,sE),e(z,Ys),f(ac,Ys,null),e(Ys,rE),e(Ys,Hu),e(Hu,nE),e(z,aE),e(z,Zt),f(ic,Zt,null),e(Zt,iE),e(Zt,cc),e(cc,cE),e(cc,Qu),e(Qu,lE),e(cc,dE),e(Zt,pE),e(Zt,Yu),e(Yu,mE),m(t,av,p),m(t,Po,p),f(lc,Po,null),e(Po,hE),e(Po,Wp),e(Wp,Vp),e(Vp,gE),e(Wp,uE),m(t,iv,p),m(t,Wo,p),f(dc,Wo,null),e(Wo,fE),e(Wo,pc),e(pc,_E),e(pc,Zp),e(Zp,bE),e(pc,vE),m(t,cv,p),m(t,we,p),f(mc,we,null),e(we,yE),e(we,Ku),e(Ku,TE),e(we,wE),e(we,R),f(hc,R,null),e(R,$E),e(R,ef),e(ef,kE),e(R,xE),e(R,Vo),e(Vo,ME),e(Vo,tf),e(tf,EE),e(Vo,jE),e(Vo,of),e(of,FE),e(Vo,LE),e(R,zE),e(R,sf),e(sf,rf),e(rf,JE),e(R,IE),e(R,Bt),e(Bt,UE),e(Bt,nf),e(nf,BE),e(Bt,qE),e(Bt,af),e(af,DE),e(Bt,SE),e(Bt,cf),e(cf,PE),e(Bt,WE),e(R,VE),e(R,lf),e(lf,ZE),e(we,GE),e(we,Ks),f(gc,Ks,null),e(Ks,CE),e(Ks,df),e(df,NE),m(t,lv,p),m(t,Zo,p),e(Zo,er),e(er,pf),f(uc,pf,null),e(Zo,XE),e(Zo,mf),e(mf,RE),m(t,dv,p),m(t,$e,p),f(fc,$e,null),e($e,OE),e($e,Go),e(Go,AE),e(Go,Gp),e(Gp,HE),e(Go,QE),e(Go,Cp),e(Cp,YE),e(Go,KE),e($e,ej),e($e,Np),f(_c,Np,null),e($e,tj),e($e,Xp),f(bc,Xp,null),m(t,pv,p),m(t,N,p),f(vc,N,null),e(N,oj),e(N,Rp),e(Rp,Op),e(Op,sj),e(Rp,rj),e(N,nj),e(N,yc),e(yc,aj),e(yc,Tc),e(Tc,ij),e(yc,cj),e(N,lj),e(N,Ap),e(Ap,dj),e(Ap,wc),e(wc,pj),e(N,mj),e(N,Hp),f($c,Hp,null),e(N,hj),e(N,Qp),f(kc,Qp,null),m(t,mv,p),m(t,ke,p),f(xc,ke,null),e(ke,gj),e(ke,Yp),e(Yp,Kp),e(Kp,uj),e(Yp,fj),e(ke,_j),e(ke,em),f(Mc,em,null),e(ke,bj),e(ke,tm),f(Ec,tm,null),m(t,hv,p),m(t,Co,p),e(Co,tr),e(tr,hf),f(jc,hf,null),e(Co,vj),e(Co,gf),e(gf,yj),m(t,gv,p),m(t,qt,p),f(Fc,qt,null),e(qt,Tj),e(qt,uf),e(uf,wj),e(qt,$j),e(qt,om),e(om,kj),e(om,Lc),e(Lc,xj),m(t,uv,p),m(t,Dt,p),f(zc,Dt,null),e(Dt,Mj),e(Dt,ff),e(ff,Ej),e(Dt,jj),e(Dt,sm),e(sm,Fj),e(sm,Jc),e(Jc,Lj),m(t,fv,p),m(t,No,p),e(No,or),e(or,_f),f(Ic,_f,null),e(No,zj),e(No,bf),e(bf,Jj),m(t,_v,p),m(t,P,p),f(Uc,P,null),e(P,Ij),e(P,vf),e(vf,Uj),e(P,Bj),f(sr,P,null),e(P,qj),f(rr,P,null),e(P,Dj),e(P,nr),f(Bc,nr,null),e(nr,Sj),e(nr,yf),e(yf,Pj),e(P,Wj),e(P,ar),f(qc,ar,null),e(ar,Vj),e(ar,Tf),e(Tf,Zj),e(P,Gj),e(P,ir),f(Dc,ir,null),e(ir,Cj),e(ir,wf),e(wf,Nj),m(t,bv,p),m(t,te,p),f(Sc,te,null),e(te,Xj),e(te,$f),e($f,Rj),e(te,Oj),f(cr,te,null),e(te,Aj),f(lr,te,null),e(te,Hj),e(te,dr),f(Pc,dr,null),e(dr,Qj),e(dr,kf),e(kf,Yj),vv=!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}),vs.$set(zf);const Jf={};p&2&&(Jf.$$scope={dirty:p,ctx:t}),ys.$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}),sr.$set(St);const Wf={};p&2&&(Wf.$$scope={dirty:p,ctx:t}),rr.$set(Wf);const Vf={};p&2&&(Vf.$$scope={dirty:p,ctx:t}),cr.$set(Vf);const Zf={};p&2&&(Zf.$$scope={dirty:p,ctx:t}),lr.$set(Zf)},i(t){vv||(_(h.$$.fragment,t),_(xr.$$.fragment,t),_(Mr.$$.fragment,t),_(Er.$$.fragment,t),_(jr.$$.fragment,t),_(Fr.$$.fragment,t),_(Lr.$$.fragment,t),_(zr.$$.fragment,t),_(Jr.$$.fragment,t),_(Ir.$$.fragment,t),_(Ur.$$.fragment,t),_(Br.$$.fragment,t),_(qr.$$.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),_(Qr.$$.fragment,t),_(Yr.$$.fragment,t),_(Kr.$$.fragment,t),_(en.$$.fragment,t),_(tn.$$.fragment,t),_(on.$$.fragment,t),_(sn.$$.fragment,t),_(rn.$$.fragment,t),_(nn.$$.fragment,t),_(an.$$.fragment,t),_(cn.$$.fragment,t),_(mn.$$.fragment,t),_(hn.$$.fragment,t),_(un.$$.fragment,t),_(fn.$$.fragment,t),_(_n.$$.fragment,t),_(bn.$$.fragment,t),_(ls.$$.fragment,t),_(yn.$$.fragment,t),_(Tn.$$.fragment,t),_(ds.$$.fragment,t),_($n.$$.fragment,t),_(kn.$$.fragment,t),_(xn.$$.fragment,t),_(Mn.$$.fragment,t),_(En.$$.fragment,t),_(jn.$$.fragment,t),_(Fn.$$.fragment,t),_(Ln.$$.fragment,t),_(Jn.$$.fragment,t),_(In.$$.fragment,t),_(ms.$$.fragment,t),_(hs.$$.fragment,t),_(gs.$$.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),_(fs.$$.fragment,t),_(Qn.$$.fragment,t),_(Yn.$$.fragment,t),_(_s.$$.fragment,t),_(bs.$$.fragment,t),_(Kn.$$.fragment,t),_(ea.$$.fragment,t),_(vs.$$.fragment,t),_(ys.$$.fragment,t),_(oa.$$.fragment,t),_(sa.$$.fragment,t),_(na.$$.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),_(va.$$.fragment,t),_(ya.$$.fragment,t),_(js.$$.fragment,t),_(Ta.$$.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),_(ri.$$.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),_(vi.$$.fragment,t),_(yi.$$.fragment,t),_(Ti.$$.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),_(nc.$$.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),_(vc.$$.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),_(sr.$$.fragment,t),_(rr.$$.fragment,t),_(Bc.$$.fragment,t),_(qc.$$.fragment,t),_(Dc.$$.fragment,t),_(Sc.$$.fragment,t),_(cr.$$.fragment,t),_(lr.$$.fragment,t),_(Pc.$$.fragment,t),vv=!0)},o(t){b(h.$$.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(zr.$$.fragment,t),b(Jr.$$.fragment,t),b(Ir.$$.fragment,t),b(Ur.$$.fragment,t),b(Br.$$.fragment,t),b(qr.$$.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(Qr.$$.fragment,t),b(Yr.$$.fragment,t),b(Kr.$$.fragment,t),b(en.$$.fragment,t),b(tn.$$.fragment,t),b(on.$$.fragment,t),b(sn.$$.fragment,t),b(rn.$$.fragment,t),b(nn.$$.fragment,t),b(an.$$.fragment,t),b(cn.$$.fragment,t),b(mn.$$.fragment,t),b(hn.$$.fragment,t),b(un.$$.fragment,t),b(fn.$$.fragment,t),b(_n.$$.fragment,t),b(bn.$$.fragment,t),b(ls.$$.fragment,t),b(yn.$$.fragment,t),b(Tn.$$.fragment,t),b(ds.$$.fragment,t),b($n.$$.fragment,t),b(kn.$$.fragment,t),b(xn.$$.fragment,t),b(Mn.$$.fragment,t),b(En.$$.fragment,t),b(jn.$$.fragment,t),b(Fn.$$.fragment,t),b(Ln.$$.fragment,t),b(Jn.$$.fragment,t),b(In.$$.fragment,t),b(ms.$$.fragment,t),b(hs.$$.fragment,t),b(gs.$$.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(fs.$$.fragment,t),b(Qn.$$.fragment,t),b(Yn.$$.fragment,t),b(_s.$$.fragment,t),b(bs.$$.fragment,t),b(Kn.$$.fragment,t),b(ea.$$.fragment,t),b(vs.$$.fragment,t),b(ys.$$.fragment,t),b(oa.$$.fragment,t),b(sa.$$.fragment,t),b(na.$$.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(va.$$.fragment,t),b(ya.$$.fragment,t),b(js.$$.fragment,t),b(Ta.$$.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(ri.$$.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(vi.$$.fragment,t),b(yi.$$.fragment,t),b(Ti.$$.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(nc.$$.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(vc.$$.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(sr.$$.fragment,t),b(rr.$$.fragment,t),b(Bc.$$.fragment,t),b(qc.$$.fragment,t),b(Dc.$$.fragment,t),b(Sc.$$.fragment,t),b(cr.$$.fragment,t),b(lr.$$.fragment,t),b(Pc.$$.fragment,t),vv=!1},d(t){o(y),t&&o(x),t&&o($),v(h),t&&o(B),t&&o(F),t&&o(t_),t&&o(Oc),t&&o(o_),t&&o(so),v(xr),t&&o(s_),t&&o(Me),t&&o(r_),t&&o(Yc),t&&o(n_),v(Mr,t),t&&o(a_),t&&o(Pt),t&&o(i_),t&&o(Ee),t&&o(c_),t&&o(V),t&&o(l_),t&&o(re),t&&o(d_),t&&o(ne),t&&o(p_),v(Er,t),t&&o(m_),t&&o(Qo),t&&o(h_),t&&o(ae),t&&o(g_),t&&o(rl),t&&o(u_),t&&o(ro),v(jr),t&&o(f_),t&&o(no),v(Fr),t&&o(__),t&&o(ao),v(Lr),t&&o(b_),t&&o(io),v(zr),t&&o(v_),t&&o(co),v(Jr),t&&o(y_),t&&o(lo),v(Ir),t&&o(T_),t&&o(po),v(Ur),t&&o(w_),t&&o(mo),v(Br),t&&o($_),t&&o(ho),v(qr),t&&o(k_),t&&o(go),v(Dr),t&&o(x_),t&&o(uo),v(Sr),t&&o(M_),t&&o(fo),v(Pr),t&&o(E_),t&&o(_o),v(Wr),t&&o(j_),t&&o(bo),v(Vr),t&&o(F_),t&&o(vo),v(Zr),t&&o(L_),t&&o(yo),v(Gr),t&&o(z_),t&&o(To),v(Cr),t&&o(J_),t&&o(wo),v(Nr),t&&o(I_),t&&o($o),v(Xr),t&&o(U_),t&&o(ko),v(Rr),t&&o(B_),t&&o(xo),v(Or),t&&o(q_),t&&o(Mo),v(Ar),t&&o(D_),t&&o(Eo),v(Hr),t&&o(S_),t&&o(qe),v(Qr),v(Yr),t&&o(P_),t&&o(De),v(Kr),v(en),t&&o(W_),t&&o(Se),v(tn),v(on),t&&o(V_),t&&o(jo),v(sn),t&&o(Z_),t&&o(ns),t&&o(G_),t&&o(Fo),v(rn),t&&o(C_),t&&o(Pe),v(nn),v(an),t&&o(N_),t&&o(ge),v(cn),v(mn),t&&o(X_),t&&o(We),v(hn),v(un),t&&o(R_),t&&o(Ve),v(fn),v(_n),t&&o(O_),t&&o(ue),v(bn),v(ls),v(yn),t&&o(A_),t&&o(fe),v(Tn),v(ds),v($n),t&&o(H_),t&&o(Ze),v(kn),v(xn),t&&o(Q_),t&&o(Ge),v(Mn),v(En),t&&o(Y_),t&&o(Ce),v(jn),v(Fn),t&&o(K_),t&&o(Ne),v(Ln),v(Jn),t&&o(eb),t&&o(L),v(In),v(ms),v(hs),v(gs),v(Dn),t&&o(tb),t&&o(Xe),v(Sn),v(Pn),t&&o(ob),t&&o(Re),v(Wn),v(Vn),t&&o(sb),t&&o(Oe),v(Zn),v(Gn),t&&o(rb),t&&o(Ae),v(Cn),v(Nn),t&&o(nb),t&&o(He),v(Xn),v(Rn),t&&o(ab),t&&o(Qe),v(On),v(An),t&&o(ib),t&&o(_e),v(Hn),v(fs),v(Qn),t&&o(cb),t&&o(H),v(Yn),v(_s),v(bs),v(Kn),t&&o(lb),t&&o(Q),v(ea),v(vs),v(ys),v(oa),t&&o(db),t&&o(Ye),v(sa),v(na),t&&o(pb),t&&o(be),v(aa),v($s),v(ca),t&&o(mb),t&&o(Y),v(la),v(ks),v(xs),v(da),t&&o(hb),t&&o(Ke),v(pa),v(ma),t&&o(gb),t&&o(et),v(ha),v(ua),t&&o(ub),t&&o(K),v(fa),v(Ms),v(Es),v(_a),t&&o(fb),t&&o(tt),v(ba),v(va),t&&o(_b),t&&o(ve),v(ya),v(js),v(Ta),t&&o(bb),t&&o(ot),v(wa),v(ka),t&&o(vb),t&&o(ee),v(xa),v(Ls),v(ja),t&&o(yb),t&&o(ye),v(Fa),v(Ia),t&&o(Tb),t&&o(Io),v(Ua),t&&o(wb),t&&o(rt),v(Ba),v(qa),t&&o($b),t&&o(nt),v(Da),v(Sa),t&&o(kb),t&&o(at),v(Pa),v(Wa),t&&o(xb),t&&o(it),v(Va),v(Za),t&&o(Mb),t&&o(ct),v(Ga),v(Ca),t&&o(Eb),t&&o(lt),v(Na),v(Xa),t&&o(jb),t&&o(dt),v(Ra),v(Oa),t&&o(Fb),t&&o(pt),v(Aa),v(Ha),t&&o(Lb),t&&o(mt),v(Qa),v(Ka),t&&o(zb),t&&o(ht),v(ei),v(ti),t&&o(Jb),t&&o(gt),v(oi),v(si),t&&o(Ib),t&&o(ut),v(ri),v(ai),t&&o(Ub),t&&o(ft),v(ii),v(ci),t&&o(Bb),t&&o(_t),v(li),v(di),t&&o(qb),t&&o(bt),v(pi),v(mi),t&&o(Db),t&&o(Bo),v(hi),t&&o(Sb),t&&o(vt),v(gi),v(ui),t&&o(Pb),t&&o(yt),v(fi),v(_i),t&&o(Wb),t&&o(Tt),v(bi),v(vi),t&&o(Vb),t&&o(wt),v(yi),v(Ti),t&&o(Zb),t&&o($t),v(wi),v($i),t&&o(Gb),t&&o(kt),v(ki),v(xi),t&&o(Cb),t&&o(xt),v(Mi),v(Ei),t&&o(Nb),t&&o(Mt),v(ji),v(Fi),t&&o(Xb),t&&o(Et),v(Li),v(zi),t&&o(Rb),t&&o(jt),v(Ji),v(Ii),t&&o(Ob),t&&o(Ft),v(Ui),v(Bi),t&&o(Ab),t&&o(Lt),v(qi),v(Di),t&&o(Hb),t&&o(zt),v(Si),v(Wi),t&&o(Qb),t&&o(qo),v(Vi),t&&o(Yb),t&&o(Gs),t&&o(Kb),t&&o(Jt),v(Zi),v(Gi),t&&o(ev),t&&o(Do),v(Ci),v(Ni),t&&o(tv),t&&o(It),v(Xi),v(Oi),t&&o(ov),t&&o(Ut),v(Ai),v(Qi),t&&o(sv),t&&o(So),v(Yi),t&&o(rv),t&&o(Ns),t&&o(nv),t&&o(z),v(Ki),v(Xs),v(ec),v(tc),v(oc),v(sc),v(nc),v(ac),v(ic),t&&o(av),t&&o(Po),v(lc),t&&o(iv),t&&o(Wo),v(dc),t&&o(cv),t&&o(we),v(mc),v(hc),v(gc),t&&o(lv),t&&o(Zo),v(uc),t&&o(dv),t&&o($e),v(fc),v(_c),v(bc),t&&o(pv),t&&o(N),v(vc),v($c),v(kc),t&&o(mv),t&&o(ke),v(xc),v(Mc),v(Ec),t&&o(hv),t&&o(Co),v(jc),t&&o(gv),t&&o(qt),v(Fc),t&&o(uv),t&&o(Dt),v(zc),t&&o(fv),t&&o(No),v(Ic),t&&o(_v),t&&o(P),v(Uc),v(sr),v(rr),v(Bc),v(qc),v(Dc),t&&o(bv),t&&o(te),v(Sc),v(cr),v(lr),v(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(y){super();CU(this,y,bB,fB,NU,{})}}export{xB as default,_B as metadata};
