import{S as sB,i as nB,s as rB,e as s,k as c,w as g,t as a,M as aB,c as n,d as o,m as l,a as r,x as u,h as i,b as d,G as e,g as m,y as f,q as _,o as b,B as y,v as iB,L as se}from"../../chunks/vendor-hf-doc-builder.js";import{T as Fn}from"../../chunks/Tip-hf-doc-builder.js";import{D as v}from"../../chunks/Docstring-hf-doc-builder.js";import{C as R}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as he}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as oe}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function cB(E){let T,M,k,w,x;return w=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUyQyUyMHNldF9zZWVkJTBBJTBBc2V0X3NlZWQoMCklMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJkaXN0aWxncHQyJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGdwdDIlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkElMjBzZXF1ZW5jZSUzQSUyMDElMkMlMjAyJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEElMjMlMjBXaXRoJTIwc2FtcGxpbmclMkMlMjB0aGUlMjBvdXRwdXQlMjBpcyUyMHVuZXhwZWN0ZWQlMjAtLSUyMHNvbWV0aW1lcyUyMHRvbyUyMHVuZXhwZWN0ZWQuJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwZG9fc2FtcGxlJTNEVHJ1ZSklMEFwcmludCh0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKG91dHB1dHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklNUIwJTVEKSUwQSUwQSUyMyUyMFdpdGglMjBlcHNpbG9uJTIwc2FtcGxpbmclMkMlMjB0aGUlMjBvdXRwdXQlMjBnZXRzJTIwcmVzdHJpY3RlZCUyMHRvJTIwaGlnaC1wcm9iYWJpbGl0eSUyMHRva2Vucy4lMjBOb3RlJTIwdGhhdCUyMHRoaXMlMjBpcyUyMHNpbWlsYXIlMjB0byUwQSUyMyUyMFRvcCUyMFAlMjBzYW1wbGluZyUyQyUyMHdoaWNoJTIwcmVzdHJpY3RzJTIwdG9rZW5zJTIwYmFzZWQlMjBvbiUyMHRoZWlyJTIwY3VtdWxhdGl2ZSUyMHByb2JhYmlsaXR5LiUwQSUyMyUyMFBybyUyMHRpcCUzQSUyMFRoZSUyMHBhcGVyJTIwcmVjb21lbmRzJTIwdXNpbmclMjAlNjBlcHNpbG9uX2N1dG9mZiU2MCUyMHZhbHVlcyUyMGJldHdlZW4lMjAzZS00JTIwYW5kJTIwOWUtNCUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKmlucHV0cyUyQyUyMGRvX3NhbXBsZSUzRFRydWUlMkMlMjBlcHNpbG9uX2N1dG9mZiUzRDAuMSklMEFwcmludCh0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKG91dHB1dHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklNUIwJTVEKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForCausalLM, set_seed

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># With eta sampling, the output gets restricted to high-probability tokens. You can see it as a dynamic form of</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># epsilon sampling that adapts its cutoff probability based on the entropy (high entropy = lower cutoff).</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Pro tip: The paper recomends using \`eta_cutoff\` values between 3e-4 to 4e-3</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(**inputs, do_sample=<span class="hljs-literal">True</span>, eta_cutoff=<span class="hljs-number">0.1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(outputs, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
A sequence: <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>, <span class="hljs-number">7</span>, <span class="hljs-number">8</span>, <span class="hljs-number">9</span>`}}),{c(){T=s("p"),M=a("Examples:"),k=c(),g(w.$$.fragment)},l(h){T=n(h,"P",{});var $=r(T);M=i($,"Examples:"),$.forEach(o),k=l(h),u(w.$$.fragment,h)},m(h,$){m(h,T,$),e(T,M),m(h,k,$),f(w,h,$),x=!0},p:se,i(h){x||(_(w.$$.fragment,h),x=!0)},o(h){b(w.$$.fragment,h),x=!1},d(h){h&&o(T),h&&o(k),y(w,h)}}}function dB(E){let T,M,k,w,x;return w=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUyQyUyMHNldF9zZWVkJTBBJTBBc2V0X3NlZWQoMSklMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJncHQyJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdwdDIlMjIpJTBBJTBBdGV4dCUyMCUzRCUyMCUyMkp1c3QlMjB3YW50ZWQlMjB0byUyMGxldCUyMHlvdSUyMGtub3clMkMlMjBJJTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMyUyMEdlbmVyYXRlJTIwc2VxdWVuY2VzJTIwd2l0aG91dCUyMGV4cG9uZW50aWFsJTIwcGVuYWx0eS4lMjBXZSUyMHdhbnQlMjBzaG9ydCUyMHNlbnRlbmNlcyUyQyUyMHNvJTIwd2UlMjBsaW1pdCUyMG1heF9sZW5ndGglM0QzMCUwQSUyMyUyMHNlZSUyMHRoYXQlMjB0aGUlMjBhbnN3ZXIlMjB0ZW5kcyUyMHRvJTIwZW5kJTIwYWJydXB0bHklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKippbnB1dHMlMkMlMjBkb19zYW1wbGUlM0RUcnVlJTJDJTIwdGVtcGVyYXR1cmUlM0QwLjklMkMlMjBtYXhfbGVuZ3RoJTNEMzAlMkMlMjBwYWRfdG9rZW5faWQlM0Q1MDI1NiklMEFwcmludCh0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKG91dHB1dHMpJTVCMCU1RCklMEElMEElMjMlMjBHZW5lcmF0ZSUyMHNlcXVlbmNlcyUyMHdpdGglMjBleHBvbmVudGlhbCUyMHBlbmFsdHklMkMlMjB3ZSUyMGFkZCUyMHRoZSUyMGV4cG9uZW50aWFsX2RlY2F5X2xlbmd0aF9wZW5hbHR5JTNEKHN0YXJ0X2luZGV4JTJDJTIwZGVjYXlfZmFjdG9yKSUwQSUyMyUyMFdlJTIwc2VlJTIwdGhhdCUyMGluc3RlYWQlMjBvZiUyMGN1dHRpbmclMjBhdCUyMG1heF90b2tlbnMlMkMlMjB0aGUlMjBvdXRwdXQlMjBjb21lcyUyMHRvJTIwYW4lMjBlbmQlMjBiZWZvcmUlMjAoYXQlMjAyNSUyMHRva2VucyklMjBhbmQlMjB3aXRoJTIwbW9yZSUyMG1lYW5pbmclMEElMjMlMjBXaGF0JTIwaGFwcGVucyUyMGlzJTIwdGhhdCUyMHN0YXJ0aW5nJTIwZnJvbSUyMCU2MHN0YXJ0X2luZGV4JTYwJTIwdGhlJTIwRU9TJTIwdG9rZW4lMjBzY29yZSUyMHdpbGwlMjBiZSUyMGluY3JlYXNlZCUyMGJ5JTIwZGVjYXlfZmFjdG9yJTIwZXhwb25lbnRpYWxseSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSglMEElMjAlMjAlMjAlMjAqKmlucHV0cyUyQyUwQSUyMCUyMCUyMCUyMGRvX3NhbXBsZSUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjB0ZW1wZXJhdHVyZSUzRDAuOSUyQyUwQSUyMCUyMCUyMCUyMG1heF9sZW5ndGglM0QzMCUyQyUwQSUyMCUyMCUyMCUyMHBhZF90b2tlbl9pZCUzRDUwMjU2JTJDJTBBJTIwJTIwJTIwJTIwZXhwb25lbnRpYWxfZGVjYXlfbGVuZ3RoX3BlbmFsdHklM0QoMTUlMkMlMjAxLjYpJTJDJTBBKSUwQXByaW50KHRva2VuaXplci5iYXRjaF9kZWNvZGUob3V0cHV0cyklNUIwJTVEKSUwQSUwQSUyMyUyMEdlbmVyYXRlJTIwc2VxdWVuY2VzJTIwd2l0aCUyMHNtYWxsZXIlMjBkZWNheV9mYWN0b3IlMkMlMjBzdGlsbCUyMGltcHJvdmluZyUyMHRoZSUyMGhhcmQlMjBjdXRvZmYlMjBtaWQtc2VudGVuY2UlMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoJTBBJTIwJTIwJTIwJTIwKippbnB1dHMlMkMlMEElMjAlMjAlMjAlMjBkb19zYW1wbGUlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwdGVtcGVyYXR1cmUlM0QwLjklMkMlMEElMjAlMjAlMjAlMjBtYXhfbGVuZ3RoJTNEMzAlMkMlMEElMjAlMjAlMjAlMjBwYWRfdG9rZW5faWQlM0Q1MDI1NiUyQyUwQSUyMCUyMCUyMCUyMGV4cG9uZW50aWFsX2RlY2F5X2xlbmd0aF9wZW5hbHR5JTNEKDE1JTJDJTIwMS4wNSklMkMlMEEpJTBBcHJpbnQodG9rZW5pemVyLmJhdGNoX2RlY29kZShvdXRwdXRzKSU1QjAlNUQp",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">1</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>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;gpt2&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;Just wanted to let you know, I&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate sequences without exponential penalty. We want short sentences, so we limit max_length=30</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># see that the answer tends to end abruptly</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(**inputs, do_sample=<span class="hljs-literal">True</span>, temperature=<span class="hljs-number">0.9</span>, max_length=<span class="hljs-number">30</span>, pad_token_id=<span class="hljs-number">50256</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(outputs)[<span class="hljs-number">0</span>])
Just wanted to let you know, I<span class="hljs-string">&#x27;m not even a lawyer. I&#x27;</span>m a man. I have no real knowledge of politics. I<span class="hljs-string">&#x27;m a

&gt;&gt;&gt; # Generate sequences with exponential penalty, we add the exponential_decay_length_penalty=(start_index, decay_factor)
&gt;&gt;&gt; # We see that instead of cutting at max_tokens, the output comes to an end before (at 25 tokens) and with more meaning
&gt;&gt;&gt; # What happens is that starting from \`start_index\` the EOS token score will be increased by decay_factor exponentially
&gt;&gt;&gt; outputs = model.generate(
...     **inputs,
...     do_sample=True,
...     temperature=0.9,
...     max_length=30,
...     pad_token_id=50256,
...     exponential_decay_length_penalty=(15, 1.6),
... )
&gt;&gt;&gt; print(tokenizer.batch_decode(outputs)[0])
Just wanted to let you know, I&#x27;</span>ve got a very cool t-shirt educating people on how to use the Internet&lt;|endoftext|&gt;

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate sequences with smaller decay_factor, still improving the hard cutoff mid-sentence</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(
<span class="hljs-meta">... </span>    **inputs,
<span class="hljs-meta">... </span>    do_sample=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    temperature=<span class="hljs-number">0.9</span>,
<span class="hljs-meta">... </span>    max_length=<span class="hljs-number">30</span>,
<span class="hljs-meta">... </span>    pad_token_id=<span class="hljs-number">50256</span>,
<span class="hljs-meta">... </span>    exponential_decay_length_penalty=(<span class="hljs-number">15</span>, <span class="hljs-number">1.05</span>),
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(outputs)[<span class="hljs-number">0</span>])
Just wanted to let you know, I<span class="hljs-string">&#x27;ve been working on it for about 6 months and now it&#x27;</span>s <span class="hljs-keyword">in</span> Alpha.&lt;|endoftext|&gt;`}}),{c(){T=s("p"),M=a("Examples:"),k=c(),g(w.$$.fragment)},l(h){T=n(h,"P",{});var $=r(T);M=i($,"Examples:"),$.forEach(o),k=l(h),u(w.$$.fragment,h)},m(h,$){m(h,T,$),e(T,M),m(h,k,$),f(w,h,$),x=!0},p:se,i(h){x||(_(w.$$.fragment,h),x=!0)},o(h){b(w.$$.fragment,h),x=!1},d(h){h&&o(T),h&&o(k),y(w,h)}}}function pB(E){let T,M;return{c(){T=s("p"),M=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(k){T=n(k,"P",{});var w=r(T);M=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(k,w){m(k,T,w),e(T,M)},d(k){k&&o(T)}}}function mB(E){let T,M;return{c(){T=s("p"),M=a("This logits processor can be resource-intensive, especially when using large models or long sequences.")},l(k){T=n(k,"P",{});var w=r(T);M=i(w,"This logits processor can be resource-intensive, especially when using large models or long sequences."),w.forEach(o)},m(k,w){m(k,T,w),e(T,M)},d(k){k&&o(T)}}}function hB(E){let T,M,k,w,x;return w=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JTZXEyU2VxTE0lMEFpbXBvcnQlMjB0b3JjaCUwQSUwQSUyMyUyMEluaXRpYWxpemUlMjB0aGUlMjBtb2RlbCUyMGFuZCUyMHRva2VuaXplciUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnQ1LWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JTZXEyU2VxTE0uZnJvbV9wcmV0cmFpbmVkKCUyMnQ1LWJhc2UlMjIpJTBBJTBBJTIzJTIwQSUyMGxvbmclMjB0ZXh0JTIwYWJvdXQlMjB0aGUlMjBzb2xhciUyMHN5c3RlbSUwQXRleHQlMjAlM0QlMjAlMjJUaGUlMjBTb2xhciUyMFN5c3RlbSUyMGlzJTIwYSUyMGdyYXZpdGF0aW9uYWxseSUyMGJvdW5kJTIwc3lzdGVtJTIwY29tcHJpc2luZyUyMHRoZSUyMFN1biUyMGFuZCUyMHRoZSUyMG9iamVjdHMlMjB0aGF0JTIwb3JiaXQlMjBpdCUyQyUyMGVpdGhlciUyMGRpcmVjdGx5JTIwb3IlMjBpbmRpcmVjdGx5LiUyME9mJTIwdGhlJTIwb2JqZWN0cyUyMHRoYXQlMjBvcmJpdCUyMHRoZSUyMFN1biUyMGRpcmVjdGx5JTJDJTIwdGhlJTIwbGFyZ2VzdCUyMGFyZSUyMHRoZSUyMGVpZ2h0JTIwcGxhbmV0cyUyQyUyMHdpdGglMjB0aGUlMjByZW1haW5kZXIlMjBiZWluZyUyMHNtYWxsZXIlMjBvYmplY3RzJTJDJTIwc3VjaCUyMGFzJTIwdGhlJTIwZml2ZSUyMGR3YXJmJTIwcGxhbmV0cyUyMGFuZCUyMHNtYWxsJTIwU29sYXIlMjBTeXN0ZW0lMjBib2RpZXMuJTIwVGhlJTIwU29sYXIlMjBTeXN0ZW0lMjBmb3JtZWQlMjA0LjYlMjBiaWxsaW9uJTIweWVhcnMlMjBhZ28lMjBmcm9tJTIwdGhlJTIwZ3Jhdml0YXRpb25hbCUyMGNvbGxhcHNlJTIwb2YlMjBhJTIwZ2lhbnQlMjBpbnRlcnN0ZWxsYXIlMjBtb2xlY3VsYXIlMjBjbG91ZC4lMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyc3VtbWFyaXplJTNBJTIwJTIyJTIwJTJCJTIwdGV4dCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBJTIzJTIwR2VuZXJhdGUlMjBkaXZlcnNlJTIwc3VtbWFyeSUwQW91dHB1dHNfZGl2ZXJzZSUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCUwQSUyMCUyMCUyMCUyMCoqaW5wdXRzJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2JlYW1fZ3JvdXBzJTNEMiUyQyUwQSUyMCUyMCUyMCUyMGRpdmVyc2l0eV9wZW5hbHR5JTNEMTAuMCUyQyUwQSUyMCUyMCUyMCUyMG1heF9sZW5ndGglM0QxMDAlMkMlMEElMjAlMjAlMjAlMjBudW1fYmVhbXMlM0Q0JTJDJTBBJTIwJTIwJTIwJTIwbnVtX3JldHVybl9zZXF1ZW5jZXMlM0QyJTJDJTBBKSUwQXN1bW1hcmllc19kaXZlcnNlJTIwJTNEJTIwdG9rZW5pemVyLmJhdGNoX2RlY29kZShvdXRwdXRzX2RpdmVyc2UlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklMEElMEElMjMlMjBHZW5lcmF0ZSUyMG5vbi1kaXZlcnNlJTIwc3VtbWFyeSUwQW91dHB1dHNfbm9uX2RpdmVyc2UlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSglMEElMjAlMjAlMjAlMjAqKmlucHV0cyUyQyUwQSUyMCUyMCUyMCUyMG1heF9sZW5ndGglM0QxMDAlMkMlMEElMjAlMjAlMjAlMjBudW1fYmVhbXMlM0Q0JTJDJTBBJTIwJTIwJTIwJTIwbnVtX3JldHVybl9zZXF1ZW5jZXMlM0QyJTJDJTBBKSUwQXN1bW1hcnlfbm9uX2RpdmVyc2UlMjAlM0QlMjB0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKG91dHB1dHNfbm9uX2RpdmVyc2UlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklMEElMEElMjMlMjBXaXRoJTIwJTYwZGl2ZXJzaXR5X3BlbmFsdHklNjAlMkMlMjB0aGUlMjByZXN1bHRpbmclMjBiZWFtcyUyMGFyZSUyMG11Y2glMjBtb3JlJTIwZGl2ZXJzZSUwQXByaW50KHN1bW1hcnlfbm9uX2RpdmVyc2UpJTBBJTBBcHJpbnQoc3VtbWFyaWVzX2RpdmVyc2Up",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForSeq2SeqLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

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

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

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

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

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

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

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

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

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

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

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

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

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


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


<span class="hljs-meta">&gt;&gt;&gt; </span>bad_words_ids = get_tokens_as_list(word_list=[<span class="hljs-string">&quot;mess&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>output_ids = model.generate(
<span class="hljs-meta">... </span>    inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], max_new_tokens=<span class="hljs-number">5</span>, bad_words_ids=bad_words_ids, pad_token_id=tokenizer.eos_token_id
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(tokenizer.batch_decode(output_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>])
In a word, the cake <span class="hljs-keyword">is</span> a bit of a surprise.`}}),{c(){T=s("p"),M=a("Examples:"),k=c(),g(w.$$.fragment)},l(h){T=n(h,"P",{});var $=r(T);M=i($,"Examples:"),$.forEach(o),k=l(h),u(w.$$.fragment,h)},m(h,$){m(h,T,$),e(T,M),m(h,k,$),f(w,h,$),x=!0},p:se,i(h){x||(_(w.$$.fragment,h),x=!0)},o(h){b(w.$$.fragment,h),x=!1},d(h){h&&o(T),h&&o(k),y(w,h)}}}function _B(E){let T,M,k,w;return{c(){T=s("p"),M=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.
`),k=s("a"),w=a("Reference"),this.h()},l(x){T=n(x,"P",{});var h=r(T);M=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.
`),k=n(h,"A",{href:!0,rel:!0});var $=r(k);w=i($,"Reference"),$.forEach(o),h.forEach(o),this.h()},h(){d(k,"href","https://huggingface.co/blog/how-to-generate"),d(k,"rel","nofollow")},m(x,h){m(x,T,h),e(T,M),e(T,k),e(k,w)},d(x){x&&o(T)}}}function bB(E){let T,M,k,w,x;return w=new R({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGdwdDIlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsZ3B0MiUyMiklMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCJTIyVG9kYXklMjBJJTIyJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEFvdXRwdXQlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKmlucHV0cyklMEFwcmludCh0b2tlbml6ZXIuZGVjb2RlKG91dHB1dCU1QjAlNUQlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSkpJTBBJTBBJTIzJTIwTm93JTIwbGV0J3MlMjBhZGQlMjBuZ3JhbSUyMHNpemUlMjB1c2luZyUyMCU2MG5vX3JlcGVhdF9uZ3JhbV9zaXplJTYwLiUyMFRoaXMlMjBzdG9wcyUyMHRoZSUyMHJlcGV0aXRpb25zJTIwKCUyMkklRTIlODAlOTltJTIyKSUyMGluJTIwdGhlJTIwb3V0cHV0LiUwQW91dHB1dCUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwbm9fcmVwZWF0X25ncmFtX3NpemUlM0QyKSUwQXByaW50KHRva2VuaXplci5kZWNvZGUob3V0cHV0JTVCMCU1RCUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForCausalLM

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

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

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

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

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

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

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

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

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


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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Run the generation in a separate thread, so that we can fetch the generated text in a non-blocking way.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generation_kwargs = <span class="hljs-built_in">dict</span>(inputs, streamer=streamer, max_new_tokens=<span class="hljs-number">20</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>thread = Thread(target=model.generate, kwargs=generation_kwargs)
<span class="hljs-meta">&gt;&gt;&gt; </span>thread.start()
<span class="hljs-meta">&gt;&gt;&gt; </span>generated_text = <span class="hljs-string">&quot;&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> new_text <span class="hljs-keyword">in</span> streamer:
<span class="hljs-meta">... </span>    generated_text += new_text
<span class="hljs-meta">&gt;&gt;&gt; </span>generated_text
<span class="hljs-string">&#x27;An increasing sequence: one, two, three, four, five, six, seven, eight, nine, ten, eleven,&#x27;</span>`}}),{c(){T=s("p"),M=a("Examples:"),k=c(),g(w.$$.fragment)},l(h){T=n(h,"P",{});var $=r(T);M=i($,"Examples:"),$.forEach(o),k=l(h),u(w.$$.fragment,h)},m(h,$){m(h,T,$),e(T,M),m(h,k,$),f(w,h,$),x=!0},p:se,i(h){x||(_(w.$$.fragment,h),x=!0)},o(h){b(w.$$.fragment,h),x=!1},d(h){h&&o(T),h&&o(k),y(w,h)}}}function zB(E){let T,M,k,w,x,h,$,Z,I,B,F,P,ne,qe,W,re,Se,A,j,eo,to,xe,oo,so,Oc,XT,RT,Ac,OT,AT,Hc,HT,QT,Qc,YT,KT,i_,Yc,ev,c_,no,Yo,gh,Ln,tv,uh,ov,l_,Ee,sv,Kc,nv,rv,el,av,iv,tl,cv,lv,d_,ol,dv,p_,zn,m_,Pt,pv,fh,mv,hv,sl,gv,uv,h_,je,nl,_h,fv,_v,bv,rl,bh,yv,Tv,vv,al,yh,wv,kv,$v,il,Th,Mv,xv,g_,V,Ev,vh,jv,Fv,wh,Lv,zv,kh,Uv,Jv,$h,Iv,Bv,Mh,qv,Sv,xh,Wv,Dv,u_,ae,Pv,Eh,Vv,Zv,jh,Gv,Cv,Fh,Nv,Xv,Lh,Rv,Ov,f_,ie,Av,zh,Hv,Qv,Uh,Yv,Kv,Jh,e1,t1,Ih,o1,s1,__,Un,b_,Ko,n1,Bh,r1,a1,y_,ce,i1,qh,c1,l1,Sh,d1,p1,Wh,m1,h1,Dh,g1,u1,T_,cl,f1,v_,ro,es,Ph,Jn,_1,Vh,b1,w_,ao,In,y1,Zh,T1,k_,io,Bn,v1,Gh,w1,$_,co,qn,k1,Ch,$1,M_,lo,Sn,M1,Nh,x1,x_,po,Wn,E1,Xh,j1,E_,mo,Dn,F1,Rh,L1,j_,ho,Pn,z1,Oh,U1,F_,go,Vn,J1,Ah,I1,L_,uo,Zn,B1,Hh,q1,z_,fo,Gn,S1,Qh,W1,U_,_o,ts,Yh,Cn,D1,Kh,P1,J_,bo,Nn,V1,eg,Z1,I_,yo,Xn,G1,tg,C1,B_,To,Rn,N1,og,X1,q_,vo,On,R1,sg,O1,S_,wo,An,A1,ng,H1,W_,ko,Hn,Q1,rg,Y1,D_,$o,Qn,K1,ag,ew,P_,Mo,Yn,tw,ig,ow,V_,xo,Kn,sw,cg,nw,Z_,Eo,er,rw,lg,aw,G_,jo,os,dg,tr,iw,pg,cw,C_,We,or,lw,mg,dw,pw,ss,sr,mw,hg,hw,N_,De,nr,gw,gg,uw,fw,ns,rr,_w,ug,bw,X_,Pe,ar,yw,fg,Tw,vw,rs,ir,ww,_g,kw,R_,Fo,as,bg,cr,$w,yg,Mw,O_,is,xw,ll,Ew,jw,A_,Lo,cs,Tg,lr,Fw,vg,Lw,H_,Ve,dr,zw,ls,dl,Uw,Jw,wg,Iw,Bw,qw,pl,pr,Q_,ge,mr,Sw,hr,Ww,kg,Dw,Pw,Vw,gr,Zw,ur,Gw,Cw,Nw,ml,fr,Y_,Ze,_r,Xw,ds,hl,Rw,Ow,br,Aw,Hw,Qw,gl,yr,K_,Ge,Tr,Yw,ul,fl,Kw,e2,t2,_l,vr,eb,ue,wr,o2,Vt,bl,s2,n2,$g,r2,a2,kr,i2,c2,l2,ps,d2,yl,$r,tb,fe,Mr,p2,S,Tl,m2,h2,Mg,g2,u2,xg,f2,_2,Eg,b2,y2,xr,T2,v2,jg,w2,k2,Fg,$2,M2,Lg,x2,E2,j2,ms,F2,vl,Er,ob,_e,jr,L2,Fe,wl,z2,U2,zg,J2,I2,Ug,B2,q2,Jg,S2,W2,D2,hs,P2,kl,Fr,sb,Ce,Lr,V2,$l,Ml,Z2,G2,C2,xl,zr,nb,Ne,Ur,N2,gs,El,X2,R2,Ig,O2,A2,H2,jl,Jr,rb,Xe,Ir,Q2,Br,Y2,Bg,K2,ek,tk,Fl,qr,ab,L,Sr,ok,Ll,zl,sk,nk,rk,zo,ak,Ul,ik,ck,Wr,lk,dk,pk,us,mk,fs,hk,Dr,gk,qg,uk,fk,_k,Sg,bk,yk,Uo,Jl,Wg,Tk,vk,wk,Il,Dg,kk,$k,Mk,Bl,Pg,xk,Ek,jk,Vg,Fk,Lk,Pr,ql,Zg,zk,Uk,Jk,Sl,Gg,Ik,Bk,qk,_s,Sk,Wl,Vr,ib,Re,Zr,Wk,Zt,Dl,Dk,Pk,Cg,Vk,Zk,Ng,Gk,Ck,Nk,Pl,Gr,cb,Oe,Cr,Xk,bs,Vl,Rk,Ok,Zl,Ak,Hk,Qk,Gl,Nr,lb,Ae,Xr,Yk,Xg,Kk,e$,Cl,Rr,db,He,Or,t$,G,o$,Nl,s$,n$,Xl,r$,a$,Rg,i$,c$,Og,Ag,l$,d$,Rl,p$,m$,Ol,h$,g$,u$,Al,Ar,pb,Qe,Hr,f$,Hg,_$,b$,Hl,Qr,mb,Ye,Yr,y$,Ql,Yl,T$,v$,w$,Kl,Kr,hb,be,ea,k$,Le,ed,$$,M$,Qg,x$,E$,Yg,j$,F$,Kg,L$,z$,U$,ys,J$,td,ta,gb,H,oa,I$,od,sd,B$,q$,S$,Ts,W$,vs,D$,nd,sa,ub,Q,na,P$,Jo,V$,rd,Z$,G$,ra,C$,N$,X$,ws,R$,ks,O$,ad,aa,fb,Ke,ia,A$,$s,id,H$,Q$,ca,Y$,K$,e0,cd,la,_b,ye,da,t0,Ms,ld,o0,s0,pa,n0,r0,a0,xs,i0,dd,ma,bb,Y,ha,c0,pd,md,l0,d0,p0,Es,m0,js,h0,hd,ga,yb,et,ua,g0,ze,gd,u0,f0,eu,_0,b0,tu,y0,T0,ou,v0,w0,k0,ud,fa,Tb,tt,_a,$0,ba,M0,su,x0,E0,j0,fd,ya,vb,K,Ta,F0,_d,bd,L0,z0,U0,Fs,J0,Ls,I0,yd,va,wb,ot,wa,B0,Td,vd,q0,S0,W0,wd,ka,kb,Te,$a,D0,kd,$d,P0,V0,Z0,zs,G0,Md,Ma,$b,st,xa,C0,Us,xd,N0,X0,Ea,R0,O0,A0,Ed,ja,Mb,ee,Fa,H0,nt,Q0,nu,Y0,K0,ru,eM,tM,au,oM,sM,nM,La,rM,za,aM,iM,cM,Js,lM,jd,Ua,xb,ve,Ja,dM,Ia,pM,iu,mM,hM,gM,Ba,uM,qa,fM,_M,bM,Fd,Sa,Eb,Io,Is,cu,Wa,yM,lu,TM,jb,rt,Da,vM,Ld,zd,wM,kM,$M,Ud,Pa,Fb,at,Va,MM,Bs,Jd,xM,EM,du,jM,FM,LM,Id,Za,Lb,it,Ga,zM,Bo,UM,pu,JM,IM,mu,BM,qM,SM,Bd,Ca,zb,ct,Na,WM,hu,DM,PM,qs,Xa,VM,gu,ZM,Ub,lt,Ra,GM,we,CM,qd,NM,XM,uu,RM,OM,fu,_u,AM,HM,Sd,QM,YM,KM,Wd,Oa,Jb,dt,Aa,ex,bu,tx,ox,Ss,Ha,sx,yu,nx,Ib,pt,Qa,rx,Dd,Pd,ax,ix,cx,Vd,Ya,Bb,mt,Ka,lx,Zd,Gd,dx,px,mx,Cd,ei,qb,ht,ti,hx,Ws,Nd,gx,ux,oi,fx,_x,bx,Xd,si,Sb,gt,ni,yx,Rd,Od,Tx,vx,wx,Ad,ri,Wb,ut,ai,kx,Ue,Hd,$x,Mx,Tu,xx,Ex,vu,jx,Fx,wu,Lx,zx,Ux,Qd,ii,Db,ft,ci,Jx,li,Ix,ku,Bx,qx,Sx,Yd,di,Pb,_t,pi,Wx,Kd,ep,Dx,Px,Vx,tp,mi,Vb,bt,hi,Zx,op,sp,Gx,Cx,Nx,np,gi,Zb,yt,ui,Xx,rp,ap,Rx,Ox,Ax,ip,fi,Gb,qo,Ds,$u,_i,Hx,Mu,Qx,Cb,Tt,bi,Yx,cp,lp,Kx,e4,t4,dp,yi,Nb,vt,Ti,o4,Ps,pp,s4,n4,xu,r4,a4,i4,mp,vi,Xb,wt,wi,c4,Vs,hp,l4,d4,Eu,p4,m4,h4,gp,ki,Rb,kt,$i,g4,ju,u4,f4,Zs,Mi,_4,Fu,b4,Ob,$t,xi,y4,C,T4,up,v4,w4,fp,k4,$4,Lu,M4,x4,zu,Uu,E4,j4,_p,F4,L4,bp,z4,U4,J4,yp,Ei,Ab,Mt,ji,I4,Ju,B4,q4,Gs,Fi,S4,Iu,W4,Hb,xt,Li,D4,Tp,vp,P4,V4,Z4,wp,zi,Qb,Et,Ui,G4,Je,kp,C4,N4,Bu,X4,R4,qu,O4,A4,Su,H4,Q4,Y4,$p,Ji,Yb,jt,Ii,K4,Cs,Mp,eE,tE,Wu,oE,sE,nE,xp,Bi,Kb,Ft,qi,rE,Ep,jp,aE,iE,cE,Fp,Si,ey,Lt,Wi,lE,Lp,zp,dE,pE,mE,Up,Di,ty,zt,Pi,hE,Jp,Ip,gE,uE,fE,Bp,Vi,oy,Ut,Zi,_E,Gi,bE,Du,yE,TE,vE,qp,Ci,sy,So,Ns,Pu,Ni,wE,Vu,kE,ny,Xs,$E,Sp,ME,xE,ry,Jt,Xi,EE,Zu,jE,FE,Wp,Ri,ay,Wo,Oi,LE,Dp,Ai,iy,It,Hi,zE,Qi,UE,Gu,JE,IE,BE,Pp,Yi,cy,Bt,Ki,qE,ec,SE,Cu,WE,DE,PE,Vp,tc,ly,Do,Rs,Nu,oc,VE,Xu,ZE,dy,Os,GE,Zp,CE,NE,py,z,sc,XE,Ru,RE,OE,Ou,AE,HE,As,QE,Au,YE,KE,Hs,nc,ej,Hu,tj,oj,Qs,rc,sj,Qu,nj,rj,Ys,ac,aj,Yu,ij,cj,Ks,ic,lj,cc,dj,Ku,pj,mj,hj,en,lc,gj,ef,uj,fj,tn,dc,_j,tf,bj,yj,Gt,pc,Tj,mc,vj,of,wj,kj,$j,sf,Mj,my,Po,hc,xj,Gp,Cp,Ej,jj,hy,Vo,gc,Fj,uc,Lj,Np,zj,Uj,gy,ke,fc,Jj,nf,Ij,Bj,O,_c,qj,rf,Sj,Wj,Zo,Dj,af,Pj,Vj,cf,Zj,Gj,Cj,lf,df,Nj,Xj,qt,Rj,pf,Oj,Aj,mf,Hj,Qj,hf,Yj,Kj,eF,gf,tF,oF,on,bc,sF,uf,nF,uy,Go,sn,ff,yc,rF,_f,aF,fy,$e,Tc,iF,Co,cF,Xp,lF,dF,Rp,pF,mF,hF,Op,vc,gF,Ap,wc,_y,N,kc,uF,Hp,Qp,fF,_F,bF,$c,yF,Mc,TF,vF,wF,Yp,kF,xc,$F,MF,Kp,Ec,xF,em,jc,by,Me,Fc,EF,tm,om,jF,FF,LF,sm,Lc,zF,nm,zc,yy,No,nn,bf,Uc,UF,yf,JF,Ty,St,Jc,IF,Tf,BF,qF,rm,SF,Ic,WF,vy,Wt,Bc,DF,vf,PF,VF,am,ZF,qc,GF,wy,Xo,rn,wf,Sc,CF,kf,NF,ky,D,Wc,XF,$f,RF,OF,an,AF,cn,HF,ln,Dc,QF,Mf,YF,KF,dn,Pc,e5,xf,t5,o5,pn,Vc,s5,Ef,n5,$y,te,Zc,r5,jf,a5,i5,mn,c5,hn,l5,gn,Gc,d5,Ff,p5,My;return h=new he({}),Ln=new he({}),zn=new R({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>)`}}),Un=new R({props:{code:"Z2VuZXJhdGlvbl9vdXRwdXQlNUIlM0EyJTVE",highlighted:'generation_output[:<span class="hljs-number">2</span>]'}}),Jn=new he({}),In=new v({props:{name:"class transformers.generation.GreedySearchEncoderDecoderOutput",anchor:"transformers.generation.GreedySearchEncoderDecoderOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for
each generated token), with each tensor of shape <code>(batch_size, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.GreedySearchEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L184"}}),Bn=new v({props:{name:"class transformers.generation.GreedySearchDecoderOnlyOutput",anchor:"transformers.generation.GreedySearchDecoderOnlyOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.GreedySearchDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.GreedySearchDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for
each generated token), with each tensor of shape <code>(batch_size, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.GreedySearchDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.GreedySearchDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L88"}}),qn=new v({props:{name:"class transformers.generation.SampleEncoderDecoderOutput",anchor:"transformers.generation.SampleEncoderDecoderOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.SampleEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for
each generated token), with each tensor of shape <code>(batch_size*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer of the decoder) of shape
<code>(batch_size*num_return_sequences, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size*num_return_sequences, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_return_sequences, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.SampleEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_return_sequences, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L255"}}),Sn=new v({props:{name:"class transformers.generation.SampleDecoderOnlyOutput",anchor:"transformers.generation.SampleDecoderOnlyOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.SampleDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.SampleDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for
each generated token), with each tensor of shape <code>(batch_size*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.SampleDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(num_return_sequences*batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.SampleDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(num_return_sequences*batch_size, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L226"}}),Wn=new v({props:{name:"class transformers.generation.BeamSearchEncoderDecoderOutput",anchor:"transformers.generation.BeamSearchEncoderDecoderOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"sequences_scores",val:": typing.Optional[torch.FloatTensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size*num_return_sequences)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam transition scores for each vocabulary token at each generation step. Beam transition scores consisting
of log probabilities of tokens conditioned on log softmax of previously generated tokens in this beam.
Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>torch.LongTensor</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>torch.LongTensor</code> of shape
<code>(batch_size*num_return_sequences, sequence_length)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size*num_beams*num_return_sequences, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams*num_return_sequences, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.BeamSearchEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams*num_return_sequences, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L333"}}),Dn=new v({props:{name:"class transformers.generation.BeamSearchDecoderOnlyOutput",anchor:"transformers.generation.BeamSearchDecoderOnlyOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"sequences_scores",val:": typing.Optional[torch.FloatTensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size*num_return_sequences)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam transition scores for each vocabulary token at each generation step. Beam transition scores consisting
of log probabilities of tokens conditioned on log softmax of previously generated tokens in this beam.
Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>torch.LongTensor</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>torch.LongTensor</code> of shape
<code>(batch_size*num_return_sequences, sequence_length)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.BeamSearchDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams*num_return_sequences, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L298"}}),Pn=new v({props:{name:"class transformers.generation.BeamSampleEncoderDecoderOutput",anchor:"transformers.generation.BeamSampleEncoderDecoderOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"sequences_scores",val:": typing.Optional[torch.FloatTensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_beams, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_return_sequence)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam transition scores for each vocabulary token at each generation step. Beam transition scores consisting
of log probabilities of tokens conditioned on log softmax of previously generated tokens in this beam.
Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams, config.vocab_size)</code>).`,name:"scores"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>torch.LongTensor</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>torch.LongTensor</code> of shape
<code>(batch_size*num_return_sequences, sequence_length)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size*num_beams, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.BeamSampleEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L418"}}),Vn=new v({props:{name:"class transformers.generation.BeamSampleDecoderOnlyOutput",anchor:"transformers.generation.BeamSampleDecoderOnlyOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"sequences_scores",val:": typing.Optional[torch.FloatTensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_return_sequence)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam transition scores for each vocabulary token at each generation step. Beam transition scores consisting
of log probabilities of tokens conditioned on log softmax of previously generated tokens in this beam.
Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>torch.LongTensor</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>torch.LongTensor</code> of shape
<code>(batch_size*num_return_sequences, sequence_length)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.BeamSampleDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size*num_beams, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L383"}}),Zn=new v({props:{name:"class transformers.generation.ContrastiveSearchEncoderDecoderOutput",anchor:"transformers.generation.ContrastiveSearchEncoderDecoderOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.ContrastiveSearchEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.ContrastiveSearchEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for
each generated token), with each tensor of shape <code>(batch_size, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.ContrastiveSearchEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.ContrastiveSearchEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.ContrastiveSearchEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.ContrastiveSearchEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.ContrastiveSearchEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L116"}}),Gn=new v({props:{name:"class transformers.generation.ContrastiveSearchDecoderOnlyOutput",anchor:"transformers.generation.ContrastiveSearchDecoderOnlyOutput",parameters:[{name:"sequences",val:": LongTensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.ContrastiveSearchDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.ContrastiveSearchDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(torch.FloatTensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when &#x2014;
<code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>torch.FloatTensor</code> with up to <code>max_new_tokens</code> elements (one element for
each generated token), with each tensor of shape <code>(batch_size, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.ContrastiveSearchDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.ContrastiveSearchDecoderOnlyOutput.hidden_states",description:"<strong>hidden_states</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is &#x2014;",name:"hidden_states"},{anchor:"transformers.generation.ContrastiveSearchDecoderOnlyOutput.passed",description:`<strong>passed</strong> or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>torch.FloatTensor</code> of shape <code>(batch_size, generated_length, hidden_size)</code>.`,name:"passed"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L155"}}),Cn=new he({}),Nn=new v({props:{name:"class transformers.generation.TFGreedySearchEncoderDecoderOutput",anchor:"transformers.generation.TFGreedySearchEncoderDecoderOutput",parameters:[{name:"sequences",val:": Tensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.TFGreedySearchEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.TFGreedySearchEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(tf.Tensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>tf.Tensor</code> with up to <code>max_new_tokens</code> elements (one element for each
generated token), with each tensor of shape <code>(batch_size, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.TFGreedySearchEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.TFGreedySearchEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.TFGreedySearchEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.TFGreedySearchEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.TFGreedySearchEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L86"}}),Xn=new v({props:{name:"class transformers.generation.TFGreedySearchDecoderOnlyOutput",anchor:"transformers.generation.TFGreedySearchDecoderOnlyOutput",parameters:[{name:"sequences",val:": Tensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.TFGreedySearchDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.TFGreedySearchDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(tf.Tensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>tf.Tensor</code> with up to <code>max_new_tokens</code> elements (one element for each
generated token), with each tensor of shape <code>(batch_size, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.TFGreedySearchDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.TFGreedySearchDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L58"}}),Rn=new v({props:{name:"class transformers.generation.TFSampleEncoderDecoderOutput",anchor:"transformers.generation.TFSampleEncoderDecoderOutput",parameters:[{name:"sequences",val:": Tensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.TFSampleEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>tf.Tensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.TFSampleEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(tf.Tensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>tf.Tensor</code> with up to <code>max_new_tokens</code> elements (one element for each
generated token), with each tensor of shape <code>(batch_size*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.TFSampleEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer of the decoder) of shape <code>(batch_size*num_return_sequences, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.TFSampleEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size*num_return_sequences, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.TFSampleEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size*num_return_sequences, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.TFSampleEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.TFSampleEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size*num_return_sequences, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L156"}}),On=new v({props:{name:"class transformers.generation.TFSampleDecoderOnlyOutput",anchor:"transformers.generation.TFSampleDecoderOnlyOutput",parameters:[{name:"sequences",val:": Tensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.TFSampleDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>tf.Tensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.TFSampleDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(tf.Tensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>tf.Tensor</code> with up to <code>max_new_tokens</code> elements (one element for each
generated token), with each tensor of shape <code>(batch_size*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.TFSampleDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(num_return_sequences*batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.TFSampleDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(num_return_sequences*batch_size, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L128"}}),An=new v({props:{name:"class transformers.generation.TFBeamSearchEncoderDecoderOutput",anchor:"transformers.generation.TFBeamSearchEncoderDecoderOutput",parameters:[{name:"sequences",val:": Tensor = None"},{name:"sequences_scores",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"beam_indices",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.TFBeamSearchEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>tf.Tensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.TFBeamSearchEncoderDecoderOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size*num_return_sequences)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.TFBeamSearchEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(tf.Tensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed beam scores for each vocabulary token at each generation step. Beam scores consisting of log
softmax scores for each vocabulary token and sum of log softmax of previously generated tokens in this
beam. <code>Tuple of </code>tf.Tensor<code>with up to</code>max_new_tokens<code>elements (one element for each generated token), with each tensor of shape</code>(batch_size*num_beams, config.vocab_size)\`.`,name:"scores"},{anchor:"transformers.generation.TFBeamSearchEncoderDecoderOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>tf.Tensor</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>tf.Tensor</code> of shape
<code>(batch_size*num_return_sequences, sequence_length)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.TFBeamSearchEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.TFBeamSearchEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size*num_beams*num_return_sequences, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.TFBeamSearchEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size*num_beams*num_return_sequences, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.TFBeamSearchEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.TFBeamSearchEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size*num_beams*num_return_sequences, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L233"}}),Hn=new v({props:{name:"class transformers.generation.TFBeamSearchDecoderOnlyOutput",anchor:"transformers.generation.TFBeamSearchDecoderOnlyOutput",parameters:[{name:"sequences",val:": Tensor = None"},{name:"sequences_scores",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"beam_indices",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.TFBeamSearchDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>tf.Tensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.TFBeamSearchDecoderOnlyOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size*num_return_sequences)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.TFBeamSearchDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(tf.Tensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed beam scores for each vocabulary token at each generation step. Beam scores consisting of log
softmax scores for each vocabulary token and sum of log softmax of previously generated tokens in this
beam. Tuple of <code>tf.Tensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.TFBeamSearchDecoderOnlyOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>tf.Tensor</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>tf.Tensor</code> of shape
<code>(batch_size*num_return_sequences, sequence_length)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.TFBeamSearchDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size*num_beams, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.TFBeamSearchDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size*num_beams*num_return_sequences, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L198"}}),Qn=new v({props:{name:"class transformers.generation.TFBeamSampleEncoderDecoderOutput",anchor:"transformers.generation.TFBeamSampleEncoderDecoderOutput",parameters:[{name:"sequences",val:": Tensor = None"},{name:"sequences_scores",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"beam_indices",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.TFBeamSampleEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>tf.Tensor</code> of shape <code>(batch_size*num_beams, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.TFBeamSampleEncoderDecoderOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size * num_return_sequence)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.TFBeamSampleEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(tf.Tensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed beam scores for each vocabulary token at each generation step. Beam scores consisting of log
softmax scores for each vocabulary token and sum of log softmax of previously generated tokens in this
beam. Tuple of <code>tf.Tensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.TFBeamSampleEncoderDecoderOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>tf.Tensor</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>tf.Tensor</code> of shape
<code>(batch_size*num_return_sequences, sequence_length)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.TFBeamSampleEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.TFBeamSampleEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size*num_beams, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.TFBeamSampleEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size*num_beams, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.TFBeamSampleEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.TFBeamSampleEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size*num_beams, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L318"}}),Yn=new v({props:{name:"class transformers.generation.TFBeamSampleDecoderOnlyOutput",anchor:"transformers.generation.TFBeamSampleDecoderOnlyOutput",parameters:[{name:"sequences",val:": Tensor = None"},{name:"sequences_scores",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"scores",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"beam_indices",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.TFBeamSampleDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>tf.Tensor</code> of shape <code>(batch_size*num_return_sequences, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.TFBeamSampleDecoderOnlyOutput.sequences_scores",description:`<strong>sequences_scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size * num_return_sequence)</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Final beam scores of the generated <code>sequences</code>.`,name:"sequences_scores"},{anchor:"transformers.generation.TFBeamSampleDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(tf.Tensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed beam scores for each vocabulary token at each generation step. Beam scores consisting of log
softmax scores for each vocabulary token and sum of log softmax of previously generated tokens in this
beam. Tuple of <code>tf.Tensor</code> with up to <code>max_new_tokens</code> elements (one element for each generated token),
with each tensor of shape <code>(batch_size*num_beams*num_return_sequences, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.TFBeamSampleDecoderOnlyOutput.beam_indices",description:`<strong>beam_indices</strong> (<code>tf.Tensor</code>, <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Beam indices of generated token id at each generation step. <code>tf.Tensor</code> of shape
<code>(batch_size*num_return_sequences, sequence_length)</code>.`,name:"beam_indices"},{anchor:"transformers.generation.TFBeamSampleDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size*num_beams, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.TFBeamSampleDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size*num_beams, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L283"}}),Kn=new v({props:{name:"class transformers.generation.TFContrastiveSearchEncoderDecoderOutput",anchor:"transformers.generation.TFContrastiveSearchEncoderDecoderOutput",parameters:[{name:"sequences",val:": Tensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"encoder_hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"decoder_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"cross_attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"decoder_hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.TFContrastiveSearchEncoderDecoderOutput.sequences",description:`<strong>sequences</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.TFContrastiveSearchEncoderDecoderOutput.scores",description:`<strong>scores</strong> (<code>tuple(tf.Tensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>tf.Tensor</code> with up to <code>max_new_tokens</code> elements (one element for each
generated token), with each tensor of shape <code>(batch_size, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.TFContrastiveSearchEncoderDecoderOutput.encoder_attentions",description:`<strong>encoder_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for each layer of the decoder) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.`,name:"encoder_attentions"},{anchor:"transformers.generation.TFContrastiveSearchEncoderDecoderOutput.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.`,name:"encoder_hidden_states"},{anchor:"transformers.generation.TFContrastiveSearchEncoderDecoderOutput.decoder_attentions",description:`<strong>decoder_attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"decoder_attentions"},{anchor:"transformers.generation.TFContrastiveSearchEncoderDecoderOutput.cross_attentions",description:`<strong>cross_attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"cross_attentions"},{anchor:"transformers.generation.TFContrastiveSearchEncoderDecoderOutput.decoder_hidden_states",description:`<strong>decoder_hidden_states</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, generated_length, hidden_size)</code>.`,name:"decoder_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L394"}}),er=new v({props:{name:"class transformers.generation.TFContrastiveSearchDecoderOnlyOutput",anchor:"transformers.generation.TFContrastiveSearchDecoderOnlyOutput",parameters:[{name:"sequences",val:": Tensor = None"},{name:"scores",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[typing.Tuple[tensorflow.python.framework.ops.Tensor]]] = None"}],parametersDescription:[{anchor:"transformers.generation.TFContrastiveSearchDecoderOnlyOutput.sequences",description:`<strong>sequences</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
The generated sequences. The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter
if all batches finished early due to the <code>eos_token_id</code>.`,name:"sequences"},{anchor:"transformers.generation.TFContrastiveSearchDecoderOnlyOutput.scores",description:`<strong>scores</strong> (<code>tuple(tf.Tensor)</code> <em>optional</em>, returned when <code>output_scores=True</code> is passed or when <code>config.output_scores=True</code>) &#x2014;
Processed prediction scores of the language modeling head (scores for each vocabulary token before SoftMax)
at each generation step. Tuple of <code>tf.Tensor</code> with up to <code>max_new_tokens</code> elements (one element for each
generated token), with each tensor of shape <code>(batch_size, config.vocab_size)</code>.`,name:"scores"},{anchor:"transformers.generation.TFContrastiveSearchDecoderOnlyOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or <code>config.output_attentions=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, num_heads, generated_length, sequence_length)</code>.`,name:"attentions"},{anchor:"transformers.generation.TFContrastiveSearchDecoderOnlyOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tuple(tf.Tensor))</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple (one element for each generated token) of tuples (one element for each layer of the decoder) of
<code>tf.Tensor</code> of shape <code>(batch_size, generated_length, hidden_size)</code>.`,name:"hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L367"}}),tr=new he({}),or=new v({props:{name:"class transformers.generation.FlaxSampleOutput",anchor:"transformers.generation.FlaxSampleOutput",parameters:[{name:"sequences",val:": Array = None"}],parametersDescription:[{anchor:"transformers.generation.FlaxSampleOutput.sequences",description:`<strong>sequences</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, max_length)</code>) &#x2014;
The generated sequences.`,name:"sequences"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_utils.py#L69"}}),sr=new v({props:{name:"replace",anchor:"transformers.generation.FlaxSampleOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/flax/struct.py#L111"}}),nr=new v({props:{name:"class transformers.generation.FlaxGreedySearchOutput",anchor:"transformers.generation.FlaxGreedySearchOutput",parameters:[{name:"sequences",val:": Array = None"}],parametersDescription:[{anchor:"transformers.generation.FlaxGreedySearchOutput.sequences",description:`<strong>sequences</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, max_length)</code>) &#x2014;
The generated sequences.`,name:"sequences"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_utils.py#L55"}}),rr=new v({props:{name:"replace",anchor:"transformers.generation.FlaxGreedySearchOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/flax/struct.py#L111"}}),ar=new v({props:{name:"class transformers.generation.FlaxBeamSearchOutput",anchor:"transformers.generation.FlaxBeamSearchOutput",parameters:[{name:"sequences",val:": Array = None"},{name:"scores",val:": Array = None"}],parametersDescription:[{anchor:"transformers.generation.FlaxBeamSearchOutput.sequences",description:`<strong>sequences</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, max_length)</code>) &#x2014;
The generated sequences.`,name:"sequences"},{anchor:"transformers.generation.FlaxBeamSearchOutput.scores",description:`<strong>scores</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size,)</code>) &#x2014;
The scores (log probabilities) of the generated sequences.`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_utils.py#L83"}}),ir=new v({props:{name:"replace",anchor:"transformers.generation.FlaxBeamSearchOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/flax/struct.py#L111"}}),cr=new he({}),lr=new he({}),dr=new v({props:{name:"class transformers.AlternatingCodebooksLogitsProcessor",anchor:"transformers.AlternatingCodebooksLogitsProcessor",parameters:[{name:"input_start_len",val:": int"},{name:"semantic_vocab_size",val:": int"},{name:"codebook_size",val:": int"}],parametersDescription:[{anchor:"transformers.AlternatingCodebooksLogitsProcessor.input_start_len",description:`<strong>input_start_len</strong> (<code>int</code>) &#x2014;
The length of the initial input sequence.`,name:"input_start_len"},{anchor:"transformers.AlternatingCodebooksLogitsProcessor.semantic_vocab_size",description:`<strong>semantic_vocab_size</strong> (<code>int</code>) &#x2014;
Vocabulary size of the semantic part, i.e number of tokens associated to the semantic vocabulary.`,name:"semantic_vocab_size"},{anchor:"transformers.AlternatingCodebooksLogitsProcessor.codebook_size",description:`<strong>codebook_size</strong> (<code>int</code>) &#x2014;
Number of tokens associated to the codebook.`,name:"codebook_size"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1553"}}),pr=new v({props:{name:"__call__",anchor:"transformers.AlternatingCodebooksLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1574"}}),mr=new v({props:{name:"class transformers.ClassifierFreeGuidanceLogitsProcessor",anchor:"transformers.ClassifierFreeGuidanceLogitsProcessor",parameters:[{name:"guidance_scale",val:""}],parametersDescription:[{anchor:"transformers.ClassifierFreeGuidanceLogitsProcessor.guidance_scale",description:`<strong>guidance_scale</strong> (float) &#x2014;
The guidance scale for classifier free guidance (CFG). CFG is enabled by setting <code>guidance_scale &gt; 1</code>.
Higher guidance scale encourages the model to generate samples that are more closely linked to the input
prompt, usually at the expense of poorer quality.`,name:"guidance_scale"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1513"}}),fr=new v({props:{name:"__call__",anchor:"transformers.ClassifierFreeGuidanceLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.ClassifierFreeGuidanceLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ClassifierFreeGuidanceLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1537",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),_r=new v({props:{name:"class transformers.EncoderNoRepeatNGramLogitsProcessor",anchor:"transformers.EncoderNoRepeatNGramLogitsProcessor",parameters:[{name:"encoder_ngram_size",val:": int"},{name:"encoder_input_ids",val:": LongTensor"}],parametersDescription:[{anchor:"transformers.EncoderNoRepeatNGramLogitsProcessor.encoder_ngram_size",description:`<strong>encoder_ngram_size</strong> (<code>int</code>) &#x2014;
All ngrams of size <code>ngram_size</code> can only occur within the encoder input ids.`,name:"encoder_ngram_size"},{anchor:"transformers.EncoderNoRepeatNGramLogitsProcessor.encoder_input_ids",description:`<strong>encoder_input_ids</strong> (<code>int</code>) &#x2014;
The encoder_input_ids that should not be repeated within the decoder ids.`,name:"encoder_input_ids"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L763"}}),yr=new v({props:{name:"__call__",anchor:"transformers.EncoderNoRepeatNGramLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.EncoderNoRepeatNGramLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.EncoderNoRepeatNGramLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L786",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Tr=new v({props:{name:"class transformers.EncoderRepetitionPenaltyLogitsProcessor",anchor:"transformers.EncoderRepetitionPenaltyLogitsProcessor",parameters:[{name:"penalty",val:": float"},{name:"encoder_input_ids",val:": LongTensor"}],parametersDescription:[{anchor:"transformers.EncoderRepetitionPenaltyLogitsProcessor.hallucination_penalty",description:`<strong>hallucination_penalty</strong> (<code>float</code>) &#x2014;
The parameter for hallucination penalty. 1.0 means no penalty.`,name:"hallucination_penalty"},{anchor:"transformers.EncoderRepetitionPenaltyLogitsProcessor.encoder_input_ids",description:`<strong>encoder_input_ids</strong> (<code>torch.LongTensor</code>) &#x2014;
The encoder_input_ids that should be repeated within the decoder ids.`,name:"encoder_input_ids"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L323"}}),vr=new v({props:{name:"__call__",anchor:"transformers.EncoderRepetitionPenaltyLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.EncoderRepetitionPenaltyLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.EncoderRepetitionPenaltyLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L341",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),wr=new v({props:{name:"class transformers.EpsilonLogitsWarper",anchor:"transformers.EpsilonLogitsWarper",parameters:[{name:"epsilon",val:": float"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.EpsilonLogitsWarper.epsilon",description:`<strong>epsilon</strong> (<code>float</code>) &#x2014;
If set to &gt; 0, only the most tokens with probabilities <code>epsilon</code> or higher are kept for generation.`,name:"epsilon"},{anchor:"transformers.EpsilonLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.EpsilonLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L493"}}),ps=new oe({props:{anchor:"transformers.EpsilonLogitsWarper.example",$$slots:{default:[cB]},$$scope:{ctx:E}}}),$r=new v({props:{name:"__call__",anchor:"transformers.EpsilonLogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.EpsilonLogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.EpsilonLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L546",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Mr=new v({props:{name:"class transformers.EtaLogitsWarper",anchor:"transformers.EtaLogitsWarper",parameters:[{name:"epsilon",val:": float"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.EtaLogitsWarper.epsilon",description:`<strong>epsilon</strong> (<code>float</code>) &#x2014;
A float value in the range (0, 1). Hyperparameter used to calculate the dynamic cutoff value, <code>eta</code>. The
suggested values from the paper ranges from 3e-4 to 4e-3 depending on the size of the model.`,name:"epsilon"},{anchor:"transformers.EtaLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All values that are found to be below the dynamic cutoff value, <code>eta</code>, are set to this float value. This
parameter is useful when logits need to be modified for very low probability tokens that should be excluded
from generation entirely.`,name:"filter_value"},{anchor:"transformers.EtaLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Specifies the minimum number of tokens that must be kept for generation, regardless of their probabilities.
For example, if <code>min_tokens_to_keep</code> is set to 1, at least one token will always be kept for generation,
even if all tokens have probabilities below the cutoff <code>eta</code>.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L560"}}),ms=new oe({props:{anchor:"transformers.EtaLogitsWarper.example",$$slots:{default:[lB]},$$scope:{ctx:E}}}),Er=new v({props:{name:"__call__",anchor:"transformers.EtaLogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.EtaLogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.EtaLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L623",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),jr=new v({props:{name:"class transformers.ExponentialDecayLengthPenalty",anchor:"transformers.ExponentialDecayLengthPenalty",parameters:[{name:"exponential_decay_length_penalty",val:": typing.Tuple[int, float]"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int]]"},{name:"input_ids_seq_length",val:": int"}],parametersDescription:[{anchor:"transformers.ExponentialDecayLengthPenalty.exponential_decay_length_penalty",description:`<strong>exponential_decay_length_penalty</strong> (<code>tuple(int, float)</code>) &#x2014;
This tuple shall consist of: <code>(start_index, decay_factor)</code> where <code>start_index</code> indicates where penalty
starts and <code>decay_factor</code> represents the factor of exponential decay`,name:"exponential_decay_length_penalty"},{anchor:"transformers.ExponentialDecayLengthPenalty.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"},{anchor:"transformers.ExponentialDecayLengthPenalty.input_ids_seq_length",description:`<strong>input_ids_seq_length</strong> (<code>int</code>) &#x2014;
The length of the input sequence.`,name:"input_ids_seq_length"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1298"}}),hs=new oe({props:{anchor:"transformers.ExponentialDecayLengthPenalty.example",$$slots:{default:[dB]},$$scope:{ctx:E}}}),Fr=new v({props:{name:"__call__",anchor:"transformers.ExponentialDecayLengthPenalty.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.ExponentialDecayLengthPenalty.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ExponentialDecayLengthPenalty.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1371",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Lr=new v({props:{name:"class transformers.ForcedBOSTokenLogitsProcessor",anchor:"transformers.ForcedBOSTokenLogitsProcessor",parameters:[{name:"bos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.ForcedBOSTokenLogitsProcessor.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>) &#x2014;
The id of the token to force as the first generated token.`,name:"bos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1230"}}),zr=new v({props:{name:"__call__",anchor:"transformers.ForcedBOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.ForcedBOSTokenLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ForcedBOSTokenLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1242",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Ur=new v({props:{name:"class transformers.ForcedEOSTokenLogitsProcessor",anchor:"transformers.ForcedEOSTokenLogitsProcessor",parameters:[{name:"max_length",val:": int"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int]]"}],parametersDescription:[{anchor:"transformers.ForcedEOSTokenLogitsProcessor.max_length",description:`<strong>max_length</strong> (<code>int</code>) &#x2014;
The maximum length of the sequence to be generated.`,name:"max_length"},{anchor:"transformers.ForcedEOSTokenLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>) &#x2014;
The id of the token to force as the last generated token when <code>max_length</code> is reached. Optionally, use a
list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1252"}}),Jr=new v({props:{name:"__call__",anchor:"transformers.ForcedEOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.ForcedEOSTokenLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ForcedEOSTokenLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1270",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Ir=new v({props:{name:"class transformers.ForceTokensLogitsProcessor",anchor:"transformers.ForceTokensLogitsProcessor",parameters:[{name:"force_token_map",val:": typing.List[typing.List[int]]"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1428"}}),qr=new v({props:{name:"__call__",anchor:"transformers.ForceTokensLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.ForceTokensLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ForceTokensLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1436",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Sr=new v({props:{name:"class transformers.HammingDiversityLogitsProcessor",anchor:"transformers.HammingDiversityLogitsProcessor",parameters:[{name:"diversity_penalty",val:": float"},{name:"num_beams",val:": int"},{name:"num_beam_groups",val:": int"}],parametersDescription:[{anchor:"transformers.HammingDiversityLogitsProcessor.diversity_penalty",description:`<strong>diversity_penalty</strong> (<code>float</code>) &#x2014;
This value is subtracted from a beam&#x2019;s score if it generates a token same as any beam from other group at a
particular time. Note that <code>diversity_penalty</code> is only effective if group beam search is enabled. The
penalty applied to a beam&#x2019;s score when it generates a token that has already been chosen by another beam
within the same group during the same time step. A higher <code>diversity_penalty</code> will enforce greater
diversity among the beams, making it less likely for multiple beams to choose the same token. Conversely, a
lower penalty will allow beams to more freely choose similar tokens. Adjusting this value can help strike a
balance between diversity and natural likelihood.`,name:"diversity_penalty"},{anchor:"transformers.HammingDiversityLogitsProcessor.num_beams",description:`<strong>num_beams</strong> (<code>int</code>) &#x2014;
Number of beams used for group beam search. Beam search is a method used that maintains beams (or &#x201C;multiple
hypotheses&#x201D;) at each step, expanding each one and keeping the top-scoring sequences. A higher <code>num_beams</code>
will explore more potential sequences. This can increase chances of finding a high-quality output but also
increases computational cost.`,name:"num_beams"},{anchor:"transformers.HammingDiversityLogitsProcessor.num_beam_groups",description:`<strong>num_beam_groups</strong> (<code>int</code>) &#x2014;
Number of groups to divide <code>num_beams</code> into in order to ensure diversity among different groups of beams.
Each group of beams will operate independently, selecting tokens without considering the choices of other
groups. This division promotes diversity by ensuring that beams within different groups explore different
paths. For instance, if <code>num_beams</code> is 6 and <code>num_beam_groups</code> is 2, there will be 2 groups each containing
3 beams. The choice of <code>num_beam_groups</code> should be made considering the desired level of output diversity
and the total number of beams. See <a href="https://arxiv.org/pdf/1610.02424.pdf" rel="nofollow">this paper</a> for more details.`,name:"num_beam_groups"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1067"}}),us=new Fn({props:{$$slots:{default:[pB]},$$scope:{ctx:E}}}),fs=new Fn({props:{warning:!0,$$slots:{default:[mB]},$$scope:{ctx:E}}}),_s=new oe({props:{anchor:"transformers.HammingDiversityLogitsProcessor.example",$$slots:{default:[hB]},$$scope:{ctx:E}}}),Vr=new v({props:{name:"__call__",anchor:"transformers.HammingDiversityLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"current_tokens",val:": LongTensor"},{name:"beam_group_idx",val:": int"}],parametersDescription:[{anchor:"transformers.HammingDiversityLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.HammingDiversityLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using
beam search or log softmax for each vocabulary token when using beam search`,name:"scores"},{anchor:"transformers.HammingDiversityLogitsProcessor.__call__.current_tokens",description:`<strong>current_tokens</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary, corresponding to the tokens selected by the other
beam groups in the current generation step.`,name:"current_tokens"},{anchor:"transformers.HammingDiversityLogitsProcessor.__call__.beam_group_idx",description:`<strong>beam_group_idx</strong> (<code>int</code>) &#x2014;
The index of the beam group currently being processed.`,name:"beam_group_idx"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1184",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Zr=new v({props:{name:"class transformers.InfNanRemoveLogitsProcessor",anchor:"transformers.InfNanRemoveLogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1281"}}),Gr=new v({props:{name:"__call__",anchor:"transformers.InfNanRemoveLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.InfNanRemoveLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.InfNanRemoveLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1287",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Cr=new v({props:{name:"class transformers.LogitNormalization",anchor:"transformers.LogitNormalization",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1382"}}),Nr=new v({props:{name:"__call__",anchor:"transformers.LogitNormalization.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.LogitNormalization.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LogitNormalization.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1390",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Xr=new v({props:{name:"class transformers.LogitsProcessor",anchor:"transformers.LogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L44"}}),Rr=new v({props:{name:"__call__",anchor:"transformers.LogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.LogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L47",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Or=new v({props:{name:"class transformers.LogitsProcessorList",anchor:"transformers.LogitsProcessorList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L64"}}),Ar=new v({props:{name:"__call__",anchor:"transformers.LogitsProcessorList.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LogitsProcessorList.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LogitsProcessorList.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using
beam search or log softmax for each vocabulary token when using beam search`,name:"scores"},{anchor:"transformers.LogitsProcessorList.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional kwargs that are specific to a logits processor.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L71",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Hr=new v({props:{name:"class transformers.LogitsWarper",anchor:"transformers.LogitsWarper",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L54"}}),Qr=new v({props:{name:"__call__",anchor:"transformers.LogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.LogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L57",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Yr=new v({props:{name:"class transformers.MinLengthLogitsProcessor",anchor:"transformers.MinLengthLogitsProcessor",parameters:[{name:"min_length",val:": int"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int]]"}],parametersDescription:[{anchor:"transformers.MinLengthLogitsProcessor.min_length",description:`<strong>min_length</strong> (<code>int</code>) &#x2014;
The minimum length below which the score of <code>eos_token_id</code> is set to <code>-float(&quot;Inf&quot;)</code>.`,name:"min_length"},{anchor:"transformers.MinLengthLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L101"}}),Kr=new v({props:{name:"__call__",anchor:"transformers.MinLengthLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.MinLengthLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.MinLengthLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L124",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),ea=new v({props:{name:"class transformers.MinNewTokensLengthLogitsProcessor",anchor:"transformers.MinNewTokensLengthLogitsProcessor",parameters:[{name:"prompt_length_to_skip",val:": int"},{name:"min_new_tokens",val:": int"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int]]"}],parametersDescription:[{anchor:"transformers.MinNewTokensLengthLogitsProcessor.prompt_length_to_skip",description:`<strong>prompt_length_to_skip</strong> (<code>int</code>) &#x2014;
The input tokens length. Not a valid argument when used with <code>generate</code> as it will automatically assign the
input length.`,name:"prompt_length_to_skip"},{anchor:"transformers.MinNewTokensLengthLogitsProcessor.min_new_tokens",description:`<strong>min_new_tokens</strong> (<code>int</code>) &#x2014;
The minimum <em>new</em> tokens length below which the score of <code>eos_token_id</code> is set to <code>-float(&quot;Inf&quot;)</code>.`,name:"min_new_tokens"},{anchor:"transformers.MinNewTokensLengthLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L133"}}),ys=new oe({props:{anchor:"transformers.MinNewTokensLengthLogitsProcessor.example",$$slots:{default:[gB]},$$scope:{ctx:E}}}),ta=new v({props:{name:"__call__",anchor:"transformers.MinNewTokensLengthLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.MinNewTokensLengthLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.MinNewTokensLengthLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L195",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),oa=new v({props:{name:"class transformers.NoBadWordsLogitsProcessor",anchor:"transformers.NoBadWordsLogitsProcessor",parameters:[{name:"bad_words_ids",val:": typing.List[typing.List[int]]"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int]]"}],parametersDescription:[{anchor:"transformers.NoBadWordsLogitsProcessor.bad_words_ids",description:`<strong>bad_words_ids</strong> (<code>List[List[int]]</code>) &#x2014;
List of list of token ids that are not allowed to be generated.`,name:"bad_words_ids"},{anchor:"transformers.NoBadWordsLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L953"}}),Ts=new Fn({props:{$$slots:{default:[uB]},$$scope:{ctx:E}}}),vs=new oe({props:{anchor:"transformers.NoBadWordsLogitsProcessor.example",$$slots:{default:[fB]},$$scope:{ctx:E}}}),sa=new v({props:{name:"__call__",anchor:"transformers.NoBadWordsLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.NoBadWordsLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.NoBadWordsLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L876",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),na=new v({props:{name:"class transformers.NoRepeatNGramLogitsProcessor",anchor:"transformers.NoRepeatNGramLogitsProcessor",parameters:[{name:"ngram_size",val:": int"}],parametersDescription:[{anchor:"transformers.NoRepeatNGramLogitsProcessor.ngram_size",description:`<strong>ngram_size</strong> (<code>int</code>) &#x2014;
All ngrams of size <code>ngram_size</code> can only occur once.`,name:"ngram_size"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L706"}}),ws=new Fn({props:{$$slots:{default:[_B]},$$scope:{ctx:E}}}),ks=new oe({props:{anchor:"transformers.NoRepeatNGramLogitsProcessor.example",$$slots:{default:[bB]},$$scope:{ctx:E}}}),aa=new v({props:{name:"__call__",anchor:"transformers.NoRepeatNGramLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.NoRepeatNGramLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.NoRepeatNGramLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L752",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),ia=new v({props:{name:"class transformers.PrefixConstrainedLogitsProcessor",anchor:"transformers.PrefixConstrainedLogitsProcessor",parameters:[{name:"prefix_allowed_tokens_fn",val:": typing.Callable[[int, torch.Tensor], typing.List[int]]"},{name:"num_beams",val:": int"}],parametersDescription:[{anchor:"transformers.PrefixConstrainedLogitsProcessor.prefix_allowed_tokens_fn",description:`<strong>prefix_allowed_tokens_fn</strong> (<code>Callable[[int, torch.Tensor], List[int]]</code>) &#x2014;
This function constraints the beam search to allowed tokens only at each step. This function takes 2
arguments <code>inputs_ids</code> and the batch ID <code>batch_id</code>. It has to return a list with the allowed tokens for the
next generation step conditioned on the previously generated tokens <code>inputs_ids</code> and the batch ID
<code>batch_id</code>.`,name:"prefix_allowed_tokens_fn"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1040"}}),la=new v({props:{name:"__call__",anchor:"transformers.PrefixConstrainedLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.PrefixConstrainedLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.PrefixConstrainedLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1057",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),da=new v({props:{name:"class transformers.RepetitionPenaltyLogitsProcessor",anchor:"transformers.RepetitionPenaltyLogitsProcessor",parameters:[{name:"penalty",val:": float"}],parametersDescription:[{anchor:"transformers.RepetitionPenaltyLogitsProcessor.repetition_penalty",description:`<strong>repetition_penalty</strong> (<code>float</code>) &#x2014;
The parameter for repetition penalty. 1.0 means no penalty. See <a href="https://arxiv.org/pdf/1909.05858.pdf" rel="nofollow">this
paper</a> for more details.`,name:"repetition_penalty"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L270"}}),xs=new oe({props:{anchor:"transformers.RepetitionPenaltyLogitsProcessor.example",$$slots:{default:[yB]},$$scope:{ctx:E}}}),ma=new v({props:{name:"__call__",anchor:"transformers.RepetitionPenaltyLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.RepetitionPenaltyLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.RepetitionPenaltyLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L312",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),ha=new v({props:{name:"class transformers.SequenceBiasLogitsProcessor",anchor:"transformers.SequenceBiasLogitsProcessor",parameters:[{name:"sequence_bias",val:": typing.Dict[typing.Tuple[int], float]"}],parametersDescription:[{anchor:"transformers.SequenceBiasLogitsProcessor.sequence_bias",description:`<strong>sequence_bias</strong> (<code>Dict[Tuple[int], float]</code>) &#x2014;
Dictionary that maps a sequence of tokens to its bias term. Positive biases increase the odds of the
sequence being selected, while negative biases do the opposite. If a sequence has a length of 1, its bias
will always be applied. Otherwise, the bias will only be applied if the sequence in question is about to be
completed (in the token selection step after this processor is applied).`,name:"sequence_bias"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L805"}}),Es=new Fn({props:{$$slots:{default:[TB]},$$scope:{ctx:E}}}),js=new oe({props:{anchor:"transformers.SequenceBiasLogitsProcessor.example",$$slots:{default:[vB]},$$scope:{ctx:E}}}),ga=new v({props:{name:"__call__",anchor:"transformers.SequenceBiasLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.SequenceBiasLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SequenceBiasLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L876",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),ua=new v({props:{name:"class transformers.SuppressTokensAtBeginLogitsProcessor",anchor:"transformers.SuppressTokensAtBeginLogitsProcessor",parameters:[{name:"begin_suppress_tokens",val:""},{name:"begin_index",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1396"}}),fa=new v({props:{name:"__call__",anchor:"transformers.SuppressTokensAtBeginLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.SuppressTokensAtBeginLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SuppressTokensAtBeginLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1407",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),_a=new v({props:{name:"class transformers.SuppressTokensLogitsProcessor",anchor:"transformers.SuppressTokensLogitsProcessor",parameters:[{name:"suppress_tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1415"}}),ya=new v({props:{name:"__call__",anchor:"transformers.SuppressTokensLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.SuppressTokensLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SuppressTokensLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1422",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Ta=new v({props:{name:"class transformers.TemperatureLogitsWarper",anchor:"transformers.TemperatureLogitsWarper",parameters:[{name:"temperature",val:": float"}],parametersDescription:[{anchor:"transformers.TemperatureLogitsWarper.temperature",description:`<strong>temperature</strong> (<code>float</code>) &#x2014;
Strictly positive float value used to modulate the logits distribution. A value smaller than <code>1</code> decreases
randomness (and vice versa), with <code>0</code> being equivalent to shifting all probability mass to the most likely
token.`,name:"temperature"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L205"}}),Fs=new Fn({props:{$$slots:{default:[wB]},$$scope:{ctx:E}}}),Ls=new oe({props:{anchor:"transformers.TemperatureLogitsWarper.example",$$slots:{default:[kB]},$$scope:{ctx:E}}}),va=new v({props:{name:"__call__",anchor:"transformers.TemperatureLogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.TemperatureLogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TemperatureLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L264",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),wa=new v({props:{name:"class transformers.TopKLogitsWarper",anchor:"transformers.TopKLogitsWarper",parameters:[{name:"top_k",val:": int"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.TopKLogitsWarper.top_k",description:`<strong>top_k</strong> (<code>int</code>) &#x2014;
The number of highest probability vocabulary tokens to keep for top-k-filtering.`,name:"top_k"},{anchor:"transformers.TopKLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.TopKLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L415"}}),ka=new v({props:{name:"__call__",anchor:"transformers.TopKLogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.TopKLogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TopKLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L435",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),$a=new v({props:{name:"class transformers.TopPLogitsWarper",anchor:"transformers.TopPLogitsWarper",parameters:[{name:"top_p",val:": float"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.TopPLogitsWarper.top_p",description:`<strong>top_p</strong> (<code>float</code>) &#x2014;
If set to &lt; 1, only the smallest set of most probable tokens with probabilities that add up to <code>top_p</code> or
higher are kept for generation.`,name:"top_p"},{anchor:"transformers.TopPLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.TopPLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L352"}}),zs=new oe({props:{anchor:"transformers.TopPLogitsWarper.example",$$slots:{default:[$B]},$$scope:{ctx:E}}}),Ma=new v({props:{name:"__call__",anchor:"transformers.TopPLogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.TopPLogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TopPLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L399",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),xa=new v({props:{name:"class transformers.TypicalLogitsWarper",anchor:"transformers.TypicalLogitsWarper",parameters:[{name:"mass",val:": float = 0.9"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.TypicalLogitsWarper.mass",description:`<strong>mass</strong> (<code>float</code>) &#x2014;
Value of typical_p between 0 and 1 inclusive, defaults to 0.9.`,name:"mass"},{anchor:"transformers.TypicalLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.TypicalLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L444"}}),ja=new v({props:{name:"__call__",anchor:"transformers.TypicalLogitsWarper.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.TypicalLogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TypicalLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L469",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Fa=new v({props:{name:"class transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor",anchor:"transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor",parameters:[{name:"guidance_scale",val:": float"},{name:"model",val:""},{name:"unconditional_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"unconditional_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = True"}],parametersDescription:[{anchor:"transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>) &#x2014;
The guidance scale for classifier free guidance (CFG). CFG is enabled by setting <code>guidance_scale != 1</code>.
Higher guidance scale encourages the model to generate samples that are more closely linked to the input
prompt, usually at the expense of poorer quality. A value smaller than 1 has the opposite effect, while
making the negative prompt provided with negative_prompt_ids (if any) act as a positive prompt.`,name:"guidance_scale"},{anchor:"transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor.unconditional_ids",description:`<strong>unconditional_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary for the unconditional branch. If unset, will default to
the last token of the prompt.`,name:"unconditional_ids"},{anchor:"transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor.unconditional_attention_mask",description:`<strong>unconditional_attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <strong>optional</strong>) &#x2014;
Attention mask for unconditional_ids.`,name:"unconditional_attention_mask"},{anchor:"transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor.model",description:`<strong>model</strong> (<code>PreTrainedModel</code>) &#x2014;
The model computing the unconditional scores. Supposedly the same as the one computing the conditional
scores. Both models must use the same tokenizer.`,name:"model"},{anchor:"transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor.smooth_factor",description:`<strong>smooth_factor</strong> (<code>float</code>, <strong>optional</strong>) &#x2014;
The interpolation weight for CFG Rescale. 1 means no rescaling, 0 reduces to the conditional scores without
CFG. Turn it lower if the output degenerates.`,name:"smooth_factor"},{anchor:"transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <strong>optional</strong>) &#x2014;
Whether to cache key/values during the negative prompt forward pass.`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1589"}}),Js=new oe({props:{anchor:"transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor.example",$$slots:{default:[MB]},$$scope:{ctx:E}}}),Ua=new v({props:{name:"__call__",anchor:"transformers.UnbatchedClassifierFreeGuidanceLogitsProcessor.__call__",parameters:[{name:"input_ids",val:""},{name:"scores",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1698"}}),Ja=new v({props:{name:"class transformers.WhisperTimeStampLogitsProcessor",anchor:"transformers.WhisperTimeStampLogitsProcessor",parameters:[{name:"generate_config",val:""}],parametersDescription:[{anchor:"transformers.WhisperTimeStampLogitsProcessor.generate_config",description:`<strong>generate_config</strong> (<code>GenerateConfig</code>) &#x2014;
The generate config used to generate the output. The following parameters are required:
eos_token_id (<code>int</code>, <em>optional</em>, defaults to 50257):
The id of the <em>end-of-sequence</em> token.
no_timestamps_token_id (<code>int</code>, <em>optional</em>, defaults to 50363):
The id of the <code>&quot;&lt;|notimestamps|&gt;&quot;</code> token.
max_initial_timestamp_index (<code>int</code>, <em>optional</em>, defaults to 1):
Used to set the maximum value of the initial timestamp. This is used to prevent the model from
predicting timestamps that are too far in the future.`,name:"generate_config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1446"}}),Sa=new v({props:{name:"__call__",anchor:"transformers.WhisperTimeStampLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"}],parametersDescription:[{anchor:"transformers.WhisperTimeStampLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.WhisperTimeStampLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L1475",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 he({}),Da=new v({props:{name:"class transformers.TFForcedBOSTokenLogitsProcessor",anchor:"transformers.TFForcedBOSTokenLogitsProcessor",parameters:[{name:"bos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.TFForcedBOSTokenLogitsProcessor.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>) &#x2014;
The id of the token to force as the first generated token.`,name:"bos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L448"}}),Pa=new v({props:{name:"__call__",anchor:"transformers.TFForcedBOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L462"}}),Va=new v({props:{name:"class transformers.TFForcedEOSTokenLogitsProcessor",anchor:"transformers.TFForcedEOSTokenLogitsProcessor",parameters:[{name:"max_length",val:": int"},{name:"eos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.TFForcedEOSTokenLogitsProcessor.max_length",description:`<strong>max_length</strong> (<code>int</code>) &#x2014;
The maximum length of the sequence to be generated.`,name:"max_length"},{anchor:"transformers.TFForcedEOSTokenLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>) &#x2014;
The id of the token to force as the last generated token when <code>max_length</code> is reached.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L478"}}),Za=new v({props:{name:"__call__",anchor:"transformers.TFForcedEOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L495"}}),Ga=new v({props:{name:"class transformers.TFForceTokensLogitsProcessor",anchor:"transformers.TFForceTokensLogitsProcessor",parameters:[{name:"force_token_map",val:": typing.List[typing.List[int]]"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L551"}}),Ca=new v({props:{name:"__call__",anchor:"transformers.TFForceTokensLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L567"}}),Na=new v({props:{name:"class transformers.TFLogitsProcessor",anchor:"transformers.TFLogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L53"}}),Xa=new v({props:{name:"__call__",anchor:"transformers.TFLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],parametersDescription:[{anchor:"transformers.TFLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search.`,name:"scores"},{anchor:"transformers.TFLogitsProcessor.__call__.cur_len",description:`<strong>cur_len</strong> (<code>int</code>) &#x2014;
The current length of valid input sequence tokens. In the TF implementation, the input_ids&#x2019; sequence length
is the maximum length generate can produce, and we need to know which of its tokens are valid.`,name:"cur_len"},{anchor:"transformers.TFLogitsProcessor.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional logits processor specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L56",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Ra=new v({props:{name:"class transformers.TFLogitsProcessorList",anchor:"transformers.TFLogitsProcessorList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L75"}}),Oa=new v({props:{name:"__call__",anchor:"transformers.TFLogitsProcessorList.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFLogitsProcessorList.__call__.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFLogitsProcessorList.__call__.scores",description:`<strong>scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search.`,name:"scores"},{anchor:"transformers.TFLogitsProcessorList.__call__.cur_len",description:`<strong>cur_len</strong> (<code>int</code>) &#x2014;
The current length of valid input sequence tokens. In the TF implementation, the input_ids&#x2019; sequence length
is the maximum length generate can produce, and we need to know which of its tokens are valid.`,name:"cur_len"},{anchor:"transformers.TFLogitsProcessorList.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional logits processor specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L82",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Aa=new v({props:{name:"class transformers.TFLogitsWarper",anchor:"transformers.TFLogitsWarper",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L64"}}),Ha=new v({props:{name:"__call__",anchor:"transformers.TFLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],parametersDescription:[{anchor:"transformers.TFLogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search.`,name:"scores"},{anchor:"transformers.TFLogitsWarper.__call__.cur_len",description:`<strong>cur_len</strong> (<code>int</code>) &#x2014;
The current length of valid input sequence tokens. In the TF implementation, the input_ids&#x2019; sequence length
is the maximum length generate can produce, and we need to know which of its tokens are valid.`,name:"cur_len"},{anchor:"transformers.TFLogitsWarper.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional logits processor specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L67",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>tf.Tensor</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Qa=new v({props:{name:"class transformers.TFMinLengthLogitsProcessor",anchor:"transformers.TFMinLengthLogitsProcessor",parameters:[{name:"min_length",val:": int"},{name:"eos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.TFMinLengthLogitsProcessor.min_length",description:`<strong>min_length</strong> (<code>int</code>) &#x2014;
The minimum length below which the score of <code>eos_token_id</code> is set to <code>-float(&quot;Inf&quot;)</code>.`,name:"min_length"},{anchor:"transformers.TFMinLengthLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>) &#x2014;
The id of the <em>end-of-sequence</em> token.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L202"}}),Ya=new v({props:{name:"__call__",anchor:"transformers.TFMinLengthLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L228"}}),Ka=new v({props:{name:"class transformers.TFNoBadWordsLogitsProcessor",anchor:"transformers.TFNoBadWordsLogitsProcessor",parameters:[{name:"bad_words_ids",val:": typing.List[typing.List[int]]"},{name:"eos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.TFNoBadWordsLogitsProcessor.bad_words_ids",description:`<strong>bad_words_ids</strong> (<code>List[List[int]]</code>) &#x2014;
List of list of token ids that are not allowed to be generated. In order to get the tokens of the words
that should not appear in the generated text, make sure to set <code>add_prefix_space=True</code> when initializing
the tokenizer, and use <code>tokenizer(bad_words, add_special_tokens=False).input_ids</code>. The <code>add_prefix_space</code>
argument is only supported for some slow tokenizers, as fast tokenizers&#x2019; prefixing behaviours come from
<code>pre tokenizers</code>. Read more <a href="https://huggingface.co/docs/tokenizers/api/pre-tokenizers" rel="nofollow">here</a>.`,name:"bad_words_ids"},{anchor:"transformers.TFNoBadWordsLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>) &#x2014;
The id of the <em>end-of-sequence</em> token.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L288"}}),ei=new v({props:{name:"__call__",anchor:"transformers.TFNoBadWordsLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L367"}}),ti=new v({props:{name:"class transformers.TFNoRepeatNGramLogitsProcessor",anchor:"transformers.TFNoRepeatNGramLogitsProcessor",parameters:[{name:"ngram_size",val:": int"}],parametersDescription:[{anchor:"transformers.TFNoRepeatNGramLogitsProcessor.ngram_size",description:`<strong>ngram_size</strong> (<code>int</code>) &#x2014;
All ngrams of size <code>ngram_size</code> can only occur once.`,name:"ngram_size"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L388"}}),si=new v({props:{name:"__call__",anchor:"transformers.TFNoRepeatNGramLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L427"}}),ni=new v({props:{name:"class transformers.TFRepetitionPenaltyLogitsProcessor",anchor:"transformers.TFRepetitionPenaltyLogitsProcessor",parameters:[{name:"penalty",val:": float"}],parametersDescription:[{anchor:"transformers.TFRepetitionPenaltyLogitsProcessor.repetition_penalty",description:`<strong>repetition_penalty</strong> (<code>float</code>) &#x2014;
The parameter for repetition penalty. 1.0 means no penalty. See <a href="https://arxiv.org/pdf/1909.05858.pdf" rel="nofollow">this
paper</a> for more details.`,name:"repetition_penalty"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L238"}}),ri=new v({props:{name:"__call__",anchor:"transformers.TFRepetitionPenaltyLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L280"}}),ai=new v({props:{name:"class transformers.TFSuppressTokensAtBeginLogitsProcessor",anchor:"transformers.TFSuppressTokensAtBeginLogitsProcessor",parameters:[{name:"begin_suppress_tokens",val:""},{name:"begin_index",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L511"}}),ii=new v({props:{name:"__call__",anchor:"transformers.TFSuppressTokensAtBeginLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L522"}}),ci=new v({props:{name:"class transformers.TFSuppressTokensLogitsProcessor",anchor:"transformers.TFSuppressTokensLogitsProcessor",parameters:[{name:"suppress_tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L535"}}),di=new v({props:{name:"__call__",anchor:"transformers.TFSuppressTokensLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L542"}}),pi=new v({props:{name:"class transformers.TFTemperatureLogitsWarper",anchor:"transformers.TFTemperatureLogitsWarper",parameters:[{name:"temperature",val:": float"}],parametersDescription:[{anchor:"transformers.TFTemperatureLogitsWarper.temperature",description:`<strong>temperature</strong> (<code>float</code>) &#x2014;
The value used to module the logits distribution.`,name:"temperature"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L98"}}),mi=new v({props:{name:"__call__",anchor:"transformers.TFTemperatureLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L113"}}),hi=new v({props:{name:"class transformers.TFTopKLogitsWarper",anchor:"transformers.TFTopKLogitsWarper",parameters:[{name:"top_k",val:": int"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.TFTopKLogitsWarper.top_k",description:`<strong>top_k</strong> (<code>int</code>) &#x2014;
The number of highest probability vocabulary tokens to keep for top-k-filtering.`,name:"top_k"},{anchor:"transformers.TFTopKLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.TFTopKLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L118"}}),gi=new v({props:{name:"__call__",anchor:"transformers.TFTopKLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L138"}}),ui=new v({props:{name:"class transformers.TFTopPLogitsWarper",anchor:"transformers.TFTopPLogitsWarper",parameters:[{name:"top_p",val:": float"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.TFTopPLogitsWarper.top_p",description:`<strong>top_p</strong> (<code>float</code>) &#x2014;
If set to &lt; 1, only the smallest set of most probable tokens with probabilities that add up to <code>top_p</code> or
higher are kept for generation.`,name:"top_p"},{anchor:"transformers.TFTopPLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.TFTopPLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L146"}}),fi=new v({props:{name:"__call__",anchor:"transformers.TFTopPLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Tensor"},{name:"scores",val:": Tensor"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_logits_process.py#L170"}}),_i=new he({}),bi=new v({props:{name:"class transformers.FlaxForcedBOSTokenLogitsProcessor",anchor:"transformers.FlaxForcedBOSTokenLogitsProcessor",parameters:[{name:"bos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.FlaxForcedBOSTokenLogitsProcessor.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>) &#x2014;
The id of the token to force as the first generated token.`,name:"bos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L194"}}),yi=new v({props:{name:"__call__",anchor:"transformers.FlaxForcedBOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L206"}}),Ti=new v({props:{name:"class transformers.FlaxForcedEOSTokenLogitsProcessor",anchor:"transformers.FlaxForcedEOSTokenLogitsProcessor",parameters:[{name:"max_length",val:": int"},{name:"eos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.FlaxForcedEOSTokenLogitsProcessor.max_length",description:`<strong>max_length</strong> (<code>int</code>) &#x2014;
The maximum length of the sequence to be generated.`,name:"max_length"},{anchor:"transformers.FlaxForcedEOSTokenLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>) &#x2014;
The id of the token to force as the last generated token when <code>max_length</code> is reached.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L216"}}),vi=new v({props:{name:"__call__",anchor:"transformers.FlaxForcedEOSTokenLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L231"}}),wi=new v({props:{name:"class transformers.FlaxForceTokensLogitsProcessor",anchor:"transformers.FlaxForceTokensLogitsProcessor",parameters:[{name:"force_token_map",val:""}],parametersDescription:[{anchor:"transformers.FlaxForceTokensLogitsProcessor.force_token_map",description:`<strong>force_token_map</strong> (<code>list</code>) &#x2014;
Map giving token ids and indices where they will be forced to be sampled.`,name:"force_token_map"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L315"}}),ki=new v({props:{name:"__call__",anchor:"transformers.FlaxForceTokensLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L337"}}),$i=new v({props:{name:"class transformers.FlaxLogitsProcessor",anchor:"transformers.FlaxLogitsProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L50"}}),Mi=new v({props:{name:"__call__",anchor:"transformers.FlaxLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"}],parametersDescription:[{anchor:"transformers.FlaxLogitsProcessor.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxLogitsProcessor.__call__.scores",description:`<strong>scores</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"},{anchor:"transformers.FlaxLogitsProcessor.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional logits processor specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L53",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),xi=new v({props:{name:"class transformers.FlaxLogitsProcessorList",anchor:"transformers.FlaxLogitsProcessorList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L72"}}),Ei=new v({props:{name:"__call__",anchor:"transformers.FlaxLogitsProcessorList.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxLogitsProcessorList.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxLogitsProcessorList.__call__.scores",description:`<strong>scores</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"},{anchor:"transformers.FlaxLogitsProcessorList.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional logits processor specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L79",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),ji=new v({props:{name:"class transformers.FlaxLogitsWarper",anchor:"transformers.FlaxLogitsWarper",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L61"}}),Fi=new v({props:{name:"__call__",anchor:"transformers.FlaxLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"}],parametersDescription:[{anchor:"transformers.FlaxLogitsWarper.__call__.input_ids",description:`<strong>input_ids</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FlaxLogitsWarper.__call__.scores",description:`<strong>scores</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam
search or log softmax for each vocabulary token when using beam search`,name:"scores"},{anchor:"transformers.FlaxLogitsWarper.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional logits processor specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L64",returnDescription:`
<p>The processed prediction scores.</p>
`,returnType:`
<p><code>jnp.ndarray</code> of shape <code>(batch_size, config.vocab_size)</code></p>
`}}),Li=new v({props:{name:"class transformers.FlaxMinLengthLogitsProcessor",anchor:"transformers.FlaxMinLengthLogitsProcessor",parameters:[{name:"min_length",val:": int"},{name:"eos_token_id",val:": int"}],parametersDescription:[{anchor:"transformers.FlaxMinLengthLogitsProcessor.min_length",description:`<strong>min_length</strong> (<code>int</code>) &#x2014;
The minimum length below which the score of <code>eos_token_id</code> is set to <code>-float(&quot;Inf&quot;)</code>.`,name:"min_length"},{anchor:"transformers.FlaxMinLengthLogitsProcessor.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>) &#x2014;
The id of the <em>end-of-sequence</em> token.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L241"}}),zi=new v({props:{name:"__call__",anchor:"transformers.FlaxMinLengthLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L262"}}),Ui=new v({props:{name:"class transformers.FlaxSuppressTokensAtBeginLogitsProcessor",anchor:"transformers.FlaxSuppressTokensAtBeginLogitsProcessor",parameters:[{name:"begin_suppress_tokens",val:""},{name:"begin_index",val:""}],parametersDescription:[{anchor:"transformers.FlaxSuppressTokensAtBeginLogitsProcessor.begin_suppress_tokens",description:`<strong>begin_suppress_tokens</strong> (<code>List[int]</code>) &#x2014;
Tokens to not sample.`,name:"begin_suppress_tokens"},{anchor:"transformers.FlaxSuppressTokensAtBeginLogitsProcessor.begin_index",description:`<strong>begin_index</strong> (<code>int</code>) &#x2014;
Index where the tokens are suppressed.`,name:"begin_index"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L271"}}),Ji=new v({props:{name:"__call__",anchor:"transformers.FlaxSuppressTokensAtBeginLogitsProcessor.__call__",parameters:[{name:"input_ids",val:""},{name:"scores",val:""},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L288"}}),Ii=new v({props:{name:"class transformers.FlaxSuppressTokensLogitsProcessor",anchor:"transformers.FlaxSuppressTokensLogitsProcessor",parameters:[{name:"suppress_tokens",val:": list"}],parametersDescription:[{anchor:"transformers.FlaxSuppressTokensLogitsProcessor.suppress_tokens",description:`<strong>suppress_tokens</strong> (<code>list</code>) &#x2014;
Tokens to not sample.`,name:"suppress_tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L296"}}),Bi=new v({props:{name:"__call__",anchor:"transformers.FlaxSuppressTokensLogitsProcessor.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L309"}}),qi=new v({props:{name:"class transformers.FlaxTemperatureLogitsWarper",anchor:"transformers.FlaxTemperatureLogitsWarper",parameters:[{name:"temperature",val:": float"}],parametersDescription:[{anchor:"transformers.FlaxTemperatureLogitsWarper.temperature",description:`<strong>temperature</strong> (<code>float</code>) &#x2014;
The value used to module the logits distribution.`,name:"temperature"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L95"}}),Si=new v({props:{name:"__call__",anchor:"transformers.FlaxTemperatureLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L110"}}),Wi=new v({props:{name:"class transformers.FlaxTopKLogitsWarper",anchor:"transformers.FlaxTopKLogitsWarper",parameters:[{name:"top_k",val:": int"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.FlaxTopKLogitsWarper.top_k",description:`<strong>top_k</strong> (<code>int</code>) &#x2014;
The number of highest probability vocabulary tokens to keep for top-k-filtering.`,name:"top_k"},{anchor:"transformers.FlaxTopKLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.FlaxTopKLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L159"}}),Di=new v({props:{name:"__call__",anchor:"transformers.FlaxTopKLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L179"}}),Pi=new v({props:{name:"class transformers.FlaxTopPLogitsWarper",anchor:"transformers.FlaxTopPLogitsWarper",parameters:[{name:"top_p",val:": float"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.FlaxTopPLogitsWarper.top_p",description:`<strong>top_p</strong> (<code>float</code>) &#x2014;
If set to &lt; 1, only the smallest set of most probable tokens with probabilities that add up to <code>top_p</code> or
higher are kept for generation.`,name:"top_p"},{anchor:"transformers.FlaxTopPLogitsWarper.filter_value",description:`<strong>filter_value</strong> (<code>float</code>, <em>optional</em>, defaults to <code>-float(&quot;Inf&quot;)</code>) &#x2014;
All filtered values will be set to this float value.`,name:"filter_value"},{anchor:"transformers.FlaxTopPLogitsWarper.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimum number of tokens that cannot be filtered.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L115"}}),Vi=new v({props:{name:"__call__",anchor:"transformers.FlaxTopPLogitsWarper.__call__",parameters:[{name:"input_ids",val:": Array"},{name:"scores",val:": Array"},{name:"cur_len",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L139"}}),Zi=new v({props:{name:"class transformers.FlaxWhisperTimeStampLogitsProcessor",anchor:"transformers.FlaxWhisperTimeStampLogitsProcessor",parameters:[{name:"generate_config",val:""},{name:"model_config",val:""},{name:"decoder_input_length",val:""}],parametersDescription:[{anchor:"transformers.FlaxWhisperTimeStampLogitsProcessor.generate_config",description:`<strong>generate_config</strong> (<code>GenerateConfig</code>) &#x2014;
The generate config used to generate the output. The following parameters are required:
eos_token_id (<code>int</code>, <em>optional</em>, defaults to 50257):
The id of the <em>end-of-sequence</em> token.
no_timestamps_token_id (<code>int</code>, <em>optional</em>, defaults to 50363):
The id of the <code>&quot;&lt;|notimestamps|&gt;&quot;</code> token.
max_initial_timestamp_index (<code>int</code>, <em>optional</em>, defaults to 1):
Used to set the maximum value of the initial timestamp. This is used to prevent the model from
predicting timestamps that are too far in the future.`,name:"generate_config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L363"}}),Ci=new v({props:{name:"__call__",anchor:"transformers.FlaxWhisperTimeStampLogitsProcessor.__call__",parameters:[{name:"input_ids",val:""},{name:"scores",val:""},{name:"cur_len",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/flax_logits_process.py#L397"}}),Ni=new he({}),Xi=new v({props:{name:"class transformers.StoppingCriteria",anchor:"transformers.StoppingCriteria",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L36"}}),Ri=new v({props:{name:"__call__",anchor:"transformers.StoppingCriteria.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.StoppingCriteria.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.StoppingCriteria.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be scores for each vocabulary token before SoftMax
or scores for each vocabulary token after SoftMax.`,name:"scores"},{anchor:"transformers.StoppingCriteria.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional stopping criteria specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L39",returnDescription:`
<p><code>bool</code>. <code>False</code> indicates we should continue, <code>True</code> indicates we should stop.</p>
`}}),Oi=new v({props:{name:"class transformers.StoppingCriteriaList",anchor:"transformers.StoppingCriteriaList",parameters:[{name:"iterable",val:" = ()"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L124"}}),Ai=new v({props:{name:"__call__",anchor:"transformers.StoppingCriteriaList.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.StoppingCriteriaList.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.StoppingCriteriaList.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be scores for each vocabulary token before SoftMax
or scores for each vocabulary token after SoftMax.`,name:"scores"},{anchor:"transformers.StoppingCriteriaList.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional stopping criteria specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L125",returnDescription:`
<p><code>bool</code>. <code>False</code> indicates we should continue, <code>True</code> indicates we should stop.</p>
`}}),Hi=new v({props:{name:"class transformers.MaxLengthCriteria",anchor:"transformers.MaxLengthCriteria",parameters:[{name:"max_length",val:": int"},{name:"max_position_embeddings",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.MaxLengthCriteria.max_length",description:`<strong>max_length</strong> (<code>int</code>) &#x2014;
The maximum length that the output sequence can have in number of tokens.`,name:"max_length"},{anchor:"transformers.MaxLengthCriteria.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <code>optional</code>) &#x2014;
The maximum model length, as defined by the model&#x2019;s <code>config.max_position_embeddings</code> attribute.`,name:"max_position_embeddings"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L44"}}),Yi=new v({props:{name:"__call__",anchor:"transformers.MaxLengthCriteria.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MaxLengthCriteria.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.MaxLengthCriteria.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be scores for each vocabulary token before SoftMax
or scores for each vocabulary token after SoftMax.`,name:"scores"},{anchor:"transformers.MaxLengthCriteria.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional stopping criteria specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L60",returnDescription:`
<p><code>bool</code>. <code>False</code> indicates we should continue, <code>True</code> indicates we should stop.</p>
`}}),Ki=new v({props:{name:"class transformers.MaxTimeCriteria",anchor:"transformers.MaxTimeCriteria",parameters:[{name:"max_time",val:": float"},{name:"initial_timestamp",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"transformers.MaxTimeCriteria.max_time",description:`<strong>max_time</strong> (<code>float</code>) &#x2014;
The maximum allowed time in seconds for the generation.`,name:"max_time"},{anchor:"transformers.MaxTimeCriteria.initial_time",description:`<strong>initial_time</strong> (<code>float</code>, <em>optional</em>, defaults to <code>time.time()</code>) &#x2014;
The start of the generation allowed time.`,name:"initial_time"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L102"}}),tc=new v({props:{name:"__call__",anchor:"transformers.MaxTimeCriteria.__call__",parameters:[{name:"input_ids",val:": LongTensor"},{name:"scores",val:": FloatTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MaxTimeCriteria.__call__.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.MaxTimeCriteria.__call__.scores",description:`<strong>scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.vocab_size)</code>) &#x2014;
Prediction scores of a language modeling head. These can be scores for each vocabulary token before SoftMax
or scores for each vocabulary token after SoftMax.`,name:"scores"},{anchor:"transformers.MaxTimeCriteria.__call__.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional stopping criteria specific kwargs.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py#L119",returnDescription:`
<p><code>bool</code>. <code>False</code> indicates we should continue, <code>True</code> indicates we should stop.</p>
`}}),oc=new he({}),sc=new v({props:{name:"class transformers.Constraint",anchor:"transformers.Constraint",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L5"}}),As=new oe({props:{anchor:"transformers.Constraint.example",$$slots:{default:[xB]},$$scope:{ctx:E}}}),nc=new v({props:{name:"advance",anchor:"transformers.Constraint.advance",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L48",returnDescription:`
<p>Must be a tensor of a list of indexable tokens, not some integer.</p>
`,returnType:`
<p>token_ids(<code>torch.tensor</code>)</p>
`}}),rc=new v({props:{name:"copy",anchor:"transformers.Constraint.copy",parameters:[{name:"stateful",val:" = False"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L113",returnDescription:`
<p>The same constraint as the one being called from.</p>
`,returnType:`
<p>constraint(<code>Constraint</code>)</p>
`}}),ac=new v({props:{name:"does_advance",anchor:"transformers.Constraint.does_advance",parameters:[{name:"token_id",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L60"}}),ic=new v({props:{name:"remaining",anchor:"transformers.Constraint.remaining",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L104"}}),lc=new v({props:{name:"reset",anchor:"transformers.Constraint.reset",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L94"}}),dc=new v({props:{name:"test",anchor:"transformers.Constraint.test",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L24"}}),pc=new v({props:{name:"update",anchor:"transformers.Constraint.update",parameters:[{name:"token_id",val:": int"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L69",returnDescription:`
<p>Whether this constraint has become one step closer to being fulfuilled.
completed(<code>bool</code>):
Whether this constraint has been completely fulfilled by this token being generated.
reset (<code>bool</code>):
Whether this constraint has reset its progress by this token being generated.</p>
`,returnType:`
<p>stepped(<code>bool</code>)</p>
`}}),hc=new v({props:{name:"class transformers.PhrasalConstraint",anchor:"transformers.PhrasalConstraint",parameters:[{name:"token_ids",val:": typing.List[int]"}],parametersDescription:[{anchor:"transformers.PhrasalConstraint.token_ids",description:`<strong>token_ids</strong> (<code>List[int]</code>) &#x2014;
The id of the token that must be generated by the output.`,name:"token_ids"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L129"}}),gc=new v({props:{name:"class transformers.DisjunctiveConstraint",anchor:"transformers.DisjunctiveConstraint",parameters:[{name:"nested_token_ids",val:": typing.List[typing.List[int]]"}],parametersDescription:[{anchor:"transformers.DisjunctiveConstraint.nested_token_ids",description:"<strong>nested_token_ids</strong> (<code>List[List[int]]</code>) &#x2014; a list of words, where each word is a list of ids. This constraint",name:"nested_token_ids"},{anchor:"transformers.DisjunctiveConstraint.is",description:"<strong>is</strong> fulfilled by generating just one from the list of words. &#x2014;",name:"is"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L261"}}),fc=new v({props:{name:"class transformers.ConstraintListState",anchor:"transformers.ConstraintListState",parameters:[{name:"constraints",val:": typing.List[transformers.generation.beam_constraints.Constraint]"}],parametersDescription:[{anchor:"transformers.ConstraintListState.constraints",description:`<strong>constraints</strong> (<code>List[Constraint]</code>) &#x2014;
A list of <a href="/docs/transformers/main/en/internal/generation_utils#transformers.Constraint">Constraint</a> objects that must be fulfilled by the beam scorer.`,name:"constraints"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L350"}}),_c=new v({props:{name:"advance",anchor:"transformers.ConstraintListState.advance",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L382"}}),bc=new v({props:{name:"reset",anchor:"transformers.ConstraintListState.reset",parameters:[{name:"token_ids",val:": typing.Optional[typing.List[int]]"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_constraints.py#L417"}}),yc=new he({}),Tc=new v({props:{name:"class transformers.BeamScorer",anchor:"transformers.BeamScorer",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L91"}}),vc=new v({props:{name:"process",anchor:"transformers.BeamScorer.process",parameters:[{name:"input_ids",val:": LongTensor"},{name:"next_scores",val:": FloatTensor"},{name:"next_tokens",val:": LongTensor"},{name:"next_indices",val:": LongTensor"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BeamScorer.process.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size * num_beams, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using any class inheriting from <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BeamScorer.process.next_scores",description:`<strong>next_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
Current scores of the top <code>2 * num_beams</code> non-finished beam hypotheses.`,name:"next_scores"},{anchor:"transformers.BeamScorer.process.next_tokens",description:`<strong>next_tokens</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
<code>input_ids</code> of the tokens corresponding to the top <code>2 * num_beams</code> non-finished beam hypotheses.`,name:"next_tokens"},{anchor:"transformers.BeamScorer.process.next_indices",description:`<strong>next_indices</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
Beam indices indicating to which beam hypothesis the <code>next_tokens</code> correspond.`,name:"next_indices"},{anchor:"transformers.BeamScorer.process.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The id of the <em>padding</em> token.`,name:"pad_token_id"},{anchor:"transformers.BeamScorer.process.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>, <em>optional</em>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"},{anchor:"transformers.BeamScorer.process.beam_indices",description:`<strong>beam_indices</strong> (<code>torch.LongTensor</code>, <em>optional</em>) &#x2014;
Beam indices indicating to which beam hypothesis each token correspond.`,name:"beam_indices"},{anchor:"transformers.BeamScorer.process.group_index",description:`<strong>group_index</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The index of the group of beams. Used with <a href="/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.group_beam_search">group_beam_search()</a>.`,name:"group_index"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L97",returnDescription:`
<p>A dictionary composed of the fields as defined above:</p>
<ul>
<li><strong>next_beam_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Updated scores of all
non-finished beams.</li>
<li><strong>next_beam_tokens</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Next tokens to be added
to the non-finished beam_hypotheses.</li>
<li><strong>next_beam_indices</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Beam indices
indicating to which beam the next tokens shall be added.</li>
</ul>
`,returnType:`
<p><code>UserDict</code></p>
`}}),wc=new v({props:{name:"finalize",anchor:"transformers.BeamScorer.finalize",parameters:[{name:"input_ids",val:": LongTensor"},{name:"next_scores",val:": FloatTensor"},{name:"next_tokens",val:": LongTensor"},{name:"next_indices",val:": LongTensor"},{name:"max_length",val:": int"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BeamScorer.finalize.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size * num_beams, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using any class inheriting from <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BeamScorer.finalize.final_beam_scores",description:`<strong>final_beam_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) &#x2014;
The final scores of all non-finished beams.`,name:"final_beam_scores"},{anchor:"transformers.BeamScorer.finalize.final_beam_tokens",description:`<strong>final_beam_tokens</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) &#x2014;
The last tokens to be added to the non-finished beam_hypotheses.`,name:"final_beam_tokens"},{anchor:"transformers.BeamScorer.finalize.final_beam_indices",description:`<strong>final_beam_indices</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) &#x2014;
The beam indices indicating to which beam the <code>final_beam_tokens</code> shall be added.`,name:"final_beam_indices"},{anchor:"transformers.BeamScorer.finalize.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The id of the <em>padding</em> token.`,name:"pad_token_id"},{anchor:"transformers.BeamScorer.finalize.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>, <em>optional</em>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L109",returnDescription:`
<p>The generated sequences.
The second dimension (sequence_length) is either equal to <code>max_length</code> or shorter if all batches finished early
due to the <code>eos_token_id</code>.</p>
`,returnType:`
<p><code>torch.LongTensor</code> of shape <code>(batch_size * num_return_sequences, sequence_length)</code></p>
`}}),kc=new v({props:{name:"class transformers.BeamSearchScorer",anchor:"transformers.BeamSearchScorer",parameters:[{name:"batch_size",val:": int"},{name:"num_beams",val:": int"},{name:"device",val:": device"},{name:"length_penalty",val:": typing.Optional[float] = 1.0"},{name:"do_early_stopping",val:": typing.Union[bool, str, NoneType] = False"},{name:"num_beam_hyps_to_keep",val:": typing.Optional[int] = 1"},{name:"num_beam_groups",val:": typing.Optional[int] = 1"},{name:"max_length",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.BeamSearchScorer.batch_size",description:`<strong>batch_size</strong> (<code>int</code>) &#x2014;
Batch Size of <code>input_ids</code> for which standard beam search decoding is run in parallel.`,name:"batch_size"},{anchor:"transformers.BeamSearchScorer.num_beams",description:`<strong>num_beams</strong> (<code>int</code>) &#x2014;
Number of beams for beam search.`,name:"num_beams"},{anchor:"transformers.BeamSearchScorer.device",description:`<strong>device</strong> (<code>torch.device</code>) &#x2014;
Defines the device type (<em>e.g.</em>, <code>&quot;cpu&quot;</code> or <code>&quot;cuda&quot;</code>) on which this instance of <code>BeamSearchScorer</code> will be
allocated.`,name:"device"},{anchor:"transformers.BeamSearchScorer.length_penalty",description:`<strong>length_penalty</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Exponential penalty to the length that is used with beam-based generation. It is applied as an exponent to
the sequence length, which in turn is used to divide the score of the sequence. Since the score is the log
likelihood of the sequence (i.e. negative), <code>length_penalty</code> &gt; 0.0 promotes longer sequences, while
<code>length_penalty</code> &lt; 0.0 encourages shorter sequences.`,name:"length_penalty"},{anchor:"transformers.BeamSearchScorer.do_early_stopping",description:`<strong>do_early_stopping</strong> (<code>bool</code> or <code>str</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Controls the stopping condition for beam-based methods, like beam-search. It accepts the following values:
<code>True</code>, where the generation stops as soon as there are <code>num_beams</code> complete candidates; <code>False</code>, where an
heuristic is applied and the generation stops when is it very unlikely to find better candidates;
<code>&quot;never&quot;</code>, where the beam search procedure only stops when there cannot be better candidates (canonical
beam search algorithm).`,name:"do_early_stopping"},{anchor:"transformers.BeamSearchScorer.num_beam_hyps_to_keep",description:`<strong>num_beam_hyps_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of beam hypotheses that shall be returned upon calling
<code>~transformer.BeamSearchScorer.finalize</code>.`,name:"num_beam_hyps_to_keep"},{anchor:"transformers.BeamSearchScorer.num_beam_groups",description:`<strong>num_beam_groups</strong> (<code>int</code>) &#x2014;
Number of groups to divide <code>num_beams</code> into in order to ensure diversity among different groups of beams.
See <a href="https://arxiv.org/pdf/1610.02424.pdf" rel="nofollow">this paper</a> for more details.`,name:"num_beam_groups"},{anchor:"transformers.BeamSearchScorer.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The maximum length of the sequence to be generated.`,name:"max_length"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L123"}}),Ec=new v({props:{name:"process",anchor:"transformers.BeamSearchScorer.process",parameters:[{name:"input_ids",val:": LongTensor"},{name:"next_scores",val:": FloatTensor"},{name:"next_tokens",val:": LongTensor"},{name:"next_indices",val:": LongTensor"},{name:"pad_token_id",val:": typing.Optional[int] = None"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int], NoneType] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"},{name:"group_index",val:": typing.Optional[int] = 0"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L215"}}),jc=new v({props:{name:"finalize",anchor:"transformers.BeamSearchScorer.finalize",parameters:[{name:"input_ids",val:": LongTensor"},{name:"final_beam_scores",val:": FloatTensor"},{name:"final_beam_tokens",val:": LongTensor"},{name:"final_beam_indices",val:": LongTensor"},{name:"max_length",val:": int"},{name:"pad_token_id",val:": typing.Optional[int] = None"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int], NoneType] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L315"}}),Fc=new v({props:{name:"class transformers.ConstrainedBeamSearchScorer",anchor:"transformers.ConstrainedBeamSearchScorer",parameters:[{name:"batch_size",val:": int"},{name:"num_beams",val:": int"},{name:"constraints",val:": typing.List[transformers.generation.beam_constraints.Constraint]"},{name:"device",val:": device"},{name:"length_penalty",val:": typing.Optional[float] = 1.0"},{name:"do_early_stopping",val:": typing.Union[bool, str, NoneType] = False"},{name:"num_beam_hyps_to_keep",val:": typing.Optional[int] = 1"},{name:"num_beam_groups",val:": typing.Optional[int] = 1"},{name:"max_length",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.ConstrainedBeamSearchScorer.batch_size",description:`<strong>batch_size</strong> (<code>int</code>) &#x2014;
Batch Size of <code>input_ids</code> for which standard beam search decoding is run in parallel.`,name:"batch_size"},{anchor:"transformers.ConstrainedBeamSearchScorer.num_beams",description:`<strong>num_beams</strong> (<code>int</code>) &#x2014;
Number of beams for beam search.`,name:"num_beams"},{anchor:"transformers.ConstrainedBeamSearchScorer.constraints",description:`<strong>constraints</strong> (<code>List[Constraint]</code>) &#x2014;
A list of positive constraints represented as <code>Constraint</code> objects that must be fulfilled in the generation
output. For more information, the documentation of <a href="/docs/transformers/main/en/internal/generation_utils#transformers.Constraint">Constraint</a> should be read.`,name:"constraints"},{anchor:"transformers.ConstrainedBeamSearchScorer.device",description:`<strong>device</strong> (<code>torch.device</code>) &#x2014;
Defines the device type (<em>e.g.</em>, <code>&quot;cpu&quot;</code> or <code>&quot;cuda&quot;</code>) on which this instance of <code>BeamSearchScorer</code> will be
allocated.`,name:"device"},{anchor:"transformers.ConstrainedBeamSearchScorer.length_penalty",description:`<strong>length_penalty</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Exponential penalty to the length that is used with beam-based generation. It is applied as an exponent to
the sequence length, which in turn is used to divide the score of the sequence. Since the score is the log
likelihood of the sequence (i.e. negative), <code>length_penalty</code> &gt; 0.0 promotes longer sequences, while
<code>length_penalty</code> &lt; 0.0 encourages shorter sequences.`,name:"length_penalty"},{anchor:"transformers.ConstrainedBeamSearchScorer.do_early_stopping",description:`<strong>do_early_stopping</strong> (<code>bool</code> or <code>str</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Controls the stopping condition for beam-based methods, like beam-search. It accepts the following values:
<code>True</code>, where the generation stops as soon as there are <code>num_beams</code> complete candidates; <code>False</code>, where an
heuristic is applied and the generation stops when is it very unlikely to find better candidates;
<code>&quot;never&quot;</code>, where the beam search procedure only stops when there cannot be better candidates (canonical
beam search algorithm).`,name:"do_early_stopping"},{anchor:"transformers.ConstrainedBeamSearchScorer.num_beam_hyps_to_keep",description:`<strong>num_beam_hyps_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of beam hypotheses that shall be returned upon calling
<code>~transformer.BeamSearchScorer.finalize</code>.`,name:"num_beam_hyps_to_keep"},{anchor:"transformers.ConstrainedBeamSearchScorer.num_beam_groups",description:`<strong>num_beam_groups</strong> (<code>int</code>) &#x2014;
Number of groups to divide <code>num_beams</code> into in order to ensure diversity among different groups of beams.
See <a href="https://arxiv.org/pdf/1610.02424.pdf" rel="nofollow">this paper</a> for more details.`,name:"num_beam_groups"},{anchor:"transformers.ConstrainedBeamSearchScorer.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The maximum length of the sequence to be generated.`,name:"max_length"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L410"}}),Lc=new v({props:{name:"process",anchor:"transformers.ConstrainedBeamSearchScorer.process",parameters:[{name:"input_ids",val:": LongTensor"},{name:"next_scores",val:": FloatTensor"},{name:"next_tokens",val:": LongTensor"},{name:"next_indices",val:": LongTensor"},{name:"scores_for_all_vocab",val:": FloatTensor"},{name:"pad_token_id",val:": typing.Optional[int] = None"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int], NoneType] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"}],parametersDescription:[{anchor:"transformers.ConstrainedBeamSearchScorer.process.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size * num_beams, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using any class inheriting from <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>. See
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.next_scores",description:`<strong>next_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
Current scores of the top <code>2 * num_beams</code> non-finished beam hypotheses.`,name:"next_scores"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.next_tokens",description:`<strong>next_tokens</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
<code>input_ids</code> of the tokens corresponding to the top <code>2 * num_beams</code> non-finished beam hypotheses.`,name:"next_tokens"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.next_indices",description:`<strong>next_indices</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2 * num_beams)</code>) &#x2014;
Beam indices indicating to which beam hypothesis the <code>next_tokens</code> correspond.`,name:"next_indices"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.scores_for_all_vocab",description:`<strong>scores_for_all_vocab</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams, sequence_length)</code>) &#x2014;
The scores of all tokens in the vocabulary for each of the beam hypotheses.`,name:"scores_for_all_vocab"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The id of the <em>padding</em> token.`,name:"pad_token_id"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, List[int]]</code>, <em>optional</em>) &#x2014;
The id of the <em>end-of-sequence</em> token. Optionally, use a list to set multiple <em>end-of-sequence</em> tokens.`,name:"eos_token_id"},{anchor:"transformers.ConstrainedBeamSearchScorer.process.beam_indices",description:`<strong>beam_indices</strong> (<code>torch.LongTensor</code>, <em>optional</em>) &#x2014;
Beam indices indicating to which beam hypothesis each token correspond.`,name:"beam_indices"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L504",returnDescription:`
<p>A dictionary composed of the fields as defined above:</p>
<ul>
<li>
<p><strong>next_beam_scores</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Updated scores of
all
non-finished beams.</p>
</li>
<li>
<p><strong>next_beam_tokens</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Next tokens to be
added
to the non-finished beam_hypotheses.</p>
</li>
<li>
<p><strong>next_beam_indices</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_beams)</code>) \u2014 Beam indices
indicating to which beam the next tokens shall be added.</p>
</li>
</ul>
`,returnType:`
<p><code>UserDict</code></p>
`}}),zc=new v({props:{name:"finalize",anchor:"transformers.ConstrainedBeamSearchScorer.finalize",parameters:[{name:"input_ids",val:": LongTensor"},{name:"final_beam_scores",val:": FloatTensor"},{name:"final_beam_tokens",val:": LongTensor"},{name:"final_beam_indices",val:": LongTensor"},{name:"max_length",val:": int"},{name:"pad_token_id",val:": typing.Optional[int] = None"},{name:"eos_token_id",val:": typing.Union[int, typing.List[int], NoneType] = None"},{name:"beam_indices",val:": typing.Optional[torch.LongTensor] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/beam_search.py#L798"}}),Uc=new he({}),Jc=new v({props:{name:"transformers.top_k_top_p_filtering",anchor:"transformers.top_k_top_p_filtering",parameters:[{name:"logits",val:": FloatTensor"},{name:"top_k",val:": int = 0"},{name:"top_p",val:": float = 1.0"},{name:"filter_value",val:": float = -inf"},{name:"min_tokens_to_keep",val:": int = 1"}],parametersDescription:[{anchor:"transformers.top_k_top_p_filtering.top_k",description:`<strong>top_k</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If &gt; 0, only keep the top k tokens with highest probability (top-k filtering)`,name:"top_k"},{anchor:"transformers.top_k_top_p_filtering.top_p",description:`<strong>top_p</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
If &lt; 1.0, only keep the top tokens with cumulative probability &gt;= top_p (nucleus filtering). Nucleus
filtering is described in Holtzman et al. (<a href="http://arxiv.org/abs/1904.09751" rel="nofollow">http://arxiv.org/abs/1904.09751</a>)`,name:"top_p"},{anchor:"transformers.top_k_top_p_filtering.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimumber of tokens we keep per batch example in the output.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/utils.py#L4706"}}),Bc=new v({props:{name:"transformers.tf_top_k_top_p_filtering",anchor:"transformers.tf_top_k_top_p_filtering",parameters:[{name:"logits",val:""},{name:"top_k",val:" = 0"},{name:"top_p",val:" = 1.0"},{name:"filter_value",val:" = -inf"},{name:"min_tokens_to_keep",val:" = 1"}],parametersDescription:[{anchor:"transformers.tf_top_k_top_p_filtering.top_k",description:`<strong>top_k</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If &gt; 0, only keep the top k tokens with highest probability (top-k filtering)`,name:"top_k"},{anchor:"transformers.tf_top_k_top_p_filtering.top_p",description:`<strong>top_p</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
If &lt; 1.0, only keep the top tokens with cumulative probability &gt;= top_p (nucleus filtering). Nucleus
filtering is described in Holtzman et al. (<a href="http://arxiv.org/abs/1904.09751" rel="nofollow">http://arxiv.org/abs/1904.09751</a>)`,name:"top_p"},{anchor:"transformers.tf_top_k_top_p_filtering.min_tokens_to_keep",description:`<strong>min_tokens_to_keep</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Minimumber of tokens we keep per batch example in the output.`,name:"min_tokens_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/tf_utils.py#L3063"}}),Sc=new he({}),Wc=new v({props:{name:"class transformers.TextStreamer",anchor:"transformers.TextStreamer",parameters:[{name:"tokenizer",val:": AutoTokenizer"},{name:"skip_prompt",val:": bool = False"},{name:"**decode_kwargs",val:""}],parametersDescription:[{anchor:"transformers.TextStreamer.tokenizer",description:`<strong>tokenizer</strong> (<code>AutoTokenizer</code>) &#x2014;
The tokenized used to decode the tokens.`,name:"tokenizer"},{anchor:"transformers.TextStreamer.skip_prompt",description:`<strong>skip_prompt</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to skip the prompt to <code>.generate()</code> or not. Useful e.g. for chatbots.`,name:"skip_prompt"},{anchor:"transformers.TextStreamer.decode_kwargs",description:`<strong>decode_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Additional keyword arguments to pass to the tokenizer&#x2019;s <code>decode</code> method.`,name:"decode_kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/streamers.py#L38"}}),an=new Fn({props:{warning:!0,$$slots:{default:[EB]},$$scope:{ctx:E}}}),cn=new oe({props:{anchor:"transformers.TextStreamer.example",$$slots:{default:[jB]},$$scope:{ctx:E}}}),Dc=new v({props:{name:"end",anchor:"transformers.TextStreamer.end",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/streamers.py#L116"}}),Pc=new v({props:{name:"on_finalized_text",anchor:"transformers.TextStreamer.on_finalized_text",parameters:[{name:"text",val:": str"},{name:"stream_end",val:": bool = False"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/streamers.py#L130"}}),Vc=new v({props:{name:"put",anchor:"transformers.TextStreamer.put",parameters:[{name:"value",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/streamers.py#L82"}}),Zc=new v({props:{name:"class transformers.TextIteratorStreamer",anchor:"transformers.TextIteratorStreamer",parameters:[{name:"tokenizer",val:": AutoTokenizer"},{name:"skip_prompt",val:": bool = False"},{name:"timeout",val:": typing.Optional[float] = None"},{name:"**decode_kwargs",val:""}],parametersDescription:[{anchor:"transformers.TextIteratorStreamer.tokenizer",description:`<strong>tokenizer</strong> (<code>AutoTokenizer</code>) &#x2014;
The tokenized used to decode the tokens.`,name:"tokenizer"},{anchor:"transformers.TextIteratorStreamer.skip_prompt",description:`<strong>skip_prompt</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to skip the prompt to <code>.generate()</code> or not. Useful e.g. for chatbots.`,name:"skip_prompt"},{anchor:"transformers.TextIteratorStreamer.timeout",description:`<strong>timeout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The timeout for the text queue. If <code>None</code>, the queue will block indefinitely. Useful to handle exceptions
in <code>.generate()</code>, when it is called in a separate thread.`,name:"timeout"},{anchor:"transformers.TextIteratorStreamer.decode_kwargs",description:`<strong>decode_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Additional keyword arguments to pass to the tokenizer&#x2019;s <code>decode</code> method.`,name:"decode_kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/streamers.py#L159"}}),mn=new Fn({props:{warning:!0,$$slots:{default:[FB]},$$scope:{ctx:E}}}),hn=new oe({props:{anchor:"transformers.TextIteratorStreamer.example",$$slots:{default:[LB]},$$scope:{ctx:E}}}),Gc=new v({props:{name:"on_finalized_text",anchor:"transformers.TextIteratorStreamer.on_finalized_text",parameters:[{name:"text",val:": str"},{name:"stream_end",val:": bool = False"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/generation/streamers.py#L213"}}),{c(){T=s("meta"),M=c(),k=s("h1"),w=s("a"),x=s("span"),g(h.$$.fragment),$=c(),Z=s("span"),I=a("Utilities for Generation"),B=c(),F=s("p"),P=a("This page lists all the utility functions used by "),ne=s("a"),qe=a("generate()"),W=a(`,
`),re=s("a"),Se=a("greedy_search()"),A=a(`,
`),j=s("a"),eo=a("contrastive_search()"),to=a(`,
`),xe=s("a"),oo=a("sample()"),so=a(`,
`),Oc=s("a"),XT=a("beam_search()"),RT=a(`,
`),Ac=s("a"),OT=a("beam_sample()"),AT=a(`,
`),Hc=s("a"),HT=a("group_beam_search()"),QT=a(`, and
`),Qc=s("a"),YT=a("constrained_beam_search()"),KT=a("."),i_=c(),Yc=s("p"),ev=a("Most of those are only useful if you are studying the code of the generate methods in the library."),c_=c(),no=s("h2"),Yo=s("a"),gh=s("span"),g(Ln.$$.fragment),tv=c(),uh=s("span"),ov=a("Generate Outputs"),l_=c(),Ee=s("p"),sv=a("The output of "),Kc=s("a"),nv=a("generate()"),rv=a(` is an instance of a subclass of
`),el=s("a"),av=a("ModelOutput"),iv=a(`. This output is a data structure containing all the information returned
by `),tl=s("a"),cv=a("generate()"),lv=a(", but that can also be used as tuple or dictionary."),d_=c(),ol=s("p"),dv=a("Here\u2019s an example:"),p_=c(),g(zn.$$.fragment),m_=c(),Pt=s("p"),pv=a("The "),fh=s("code"),mv=a("generation_output"),hv=a(" object is a "),sl=s("a"),gv=a("GreedySearchDecoderOnlyOutput"),uv=a(`, as we can
see in the documentation of that class below, it means it has the following attributes:`),h_=c(),je=s("ul"),nl=s("li"),_h=s("code"),fv=a("sequences"),_v=a(": the generated sequences of tokens"),bv=c(),rl=s("li"),bh=s("code"),yv=a("scores"),Tv=a(" (optional): the prediction scores of the language modelling head, for each generation step"),vv=c(),al=s("li"),yh=s("code"),wv=a("hidden_states"),kv=a(" (optional): the hidden states of the model, for each generation step"),$v=c(),il=s("li"),Th=s("code"),Mv=a("attentions"),xv=a(" (optional): the attention weights of the model, for each generation step"),g_=c(),V=s("p"),Ev=a("Here we have the "),vh=s("code"),jv=a("scores"),Fv=a(" since we passed along "),wh=s("code"),Lv=a("output_scores=True"),zv=a(", but we don\u2019t have "),kh=s("code"),Uv=a("hidden_states"),Jv=a(` and
`),$h=s("code"),Iv=a("attentions"),Bv=a(" because we didn\u2019t pass "),Mh=s("code"),qv=a("output_hidden_states=True"),Sv=a(" or "),xh=s("code"),Wv=a("output_attentions=True"),Dv=a("."),u_=c(),ae=s("p"),Pv=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 `),Eh=s("code"),Vv=a("None"),Zv=a(". Here for instance "),jh=s("code"),Gv=a("generation_output.scores"),Cv=a(` are all the generated prediction scores of the
language modeling head, and `),Fh=s("code"),Nv=a("generation_output.attentions"),Xv=a(" is "),Lh=s("code"),Rv=a("None"),Ov=a("."),f_=c(),ie=s("p"),Av=a("When using our "),zh=s("code"),Hv=a("generation_output"),Qv=a(" object as a tuple, it only keeps the attributes that don\u2019t have "),Uh=s("code"),Yv=a("None"),Kv=a(` values.
Here, for instance, it has two elements, `),Jh=s("code"),e1=a("loss"),t1=a(" then "),Ih=s("code"),o1=a("logits"),s1=a(", so"),__=c(),g(Un.$$.fragment),b_=c(),Ko=s("p"),n1=a("will return the tuple "),Bh=s("code"),r1=a("(generation_output.sequences, generation_output.scores)"),a1=a(" for instance."),y_=c(),ce=s("p"),i1=a("When using our "),qh=s("code"),c1=a("generation_output"),l1=a(" object as a dictionary, it only keeps the attributes that don\u2019t have "),Sh=s("code"),d1=a("None"),p1=a(`
values. Here, for instance, it has two keys that are `),Wh=s("code"),m1=a("sequences"),h1=a(" and "),Dh=s("code"),g1=a("scores"),u1=a("."),T_=c(),cl=s("p"),f1=a("We document here all output types."),v_=c(),ro=s("h3"),es=s("a"),Ph=s("span"),g(Jn.$$.fragment),_1=c(),Vh=s("span"),b1=a("PyTorch"),w_=c(),ao=s("div"),g(In.$$.fragment),y1=c(),Zh=s("p"),T1=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)`),k_=c(),io=s("div"),g(Bn.$$.fragment),v1=c(),Gh=s("p"),w1=a("Base class for outputs of decoder-only generation models using greedy search."),$_=c(),co=s("div"),g(qn.$$.fragment),k1=c(),Ch=s("p"),$1=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)`),M_=c(),lo=s("div"),g(Sn.$$.fragment),M1=c(),Nh=s("p"),x1=a("Base class for outputs of decoder-only generation models using sampling."),x_=c(),po=s("div"),g(Wn.$$.fragment),E1=c(),Xh=s("p"),j1=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)`),E_=c(),mo=s("div"),g(Dn.$$.fragment),F1=c(),Rh=s("p"),L1=a("Base class for outputs of decoder-only generation models using beam search."),j_=c(),ho=s("div"),g(Pn.$$.fragment),z1=c(),Oh=s("p"),U1=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)`),F_=c(),go=s("div"),g(Vn.$$.fragment),J1=c(),Ah=s("p"),I1=a("Base class for outputs of decoder-only generation models using beam sample."),L_=c(),uo=s("div"),g(Zn.$$.fragment),B1=c(),Hh=s("p"),q1=a("Base class for outputs of decoder-only generation models using contrastive search."),z_=c(),fo=s("div"),g(Gn.$$.fragment),S1=c(),Qh=s("p"),W1=a("Base class for outputs of decoder-only generation models using contrastive search."),U_=c(),_o=s("h3"),ts=s("a"),Yh=s("span"),g(Cn.$$.fragment),D1=c(),Kh=s("span"),P1=a("TensorFlow"),J_=c(),bo=s("div"),g(Nn.$$.fragment),V1=c(),eg=s("p"),Z1=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)`),I_=c(),yo=s("div"),g(Xn.$$.fragment),G1=c(),tg=s("p"),C1=a("Base class for outputs of decoder-only generation models using greedy search."),B_=c(),To=s("div"),g(Rn.$$.fragment),N1=c(),og=s("p"),X1=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)`),q_=c(),vo=s("div"),g(On.$$.fragment),R1=c(),sg=s("p"),O1=a("Base class for outputs of decoder-only generation models using sampling."),S_=c(),wo=s("div"),g(An.$$.fragment),A1=c(),ng=s("p"),H1=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)`),W_=c(),ko=s("div"),g(Hn.$$.fragment),Q1=c(),rg=s("p"),Y1=a("Base class for outputs of decoder-only generation models using beam search."),D_=c(),$o=s("div"),g(Qn.$$.fragment),K1=c(),ag=s("p"),ew=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)`),P_=c(),Mo=s("div"),g(Yn.$$.fragment),tw=c(),ig=s("p"),ow=a("Base class for outputs of decoder-only generation models using beam sample."),V_=c(),xo=s("div"),g(Kn.$$.fragment),sw=c(),cg=s("p"),nw=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)`),Z_=c(),Eo=s("div"),g(er.$$.fragment),rw=c(),lg=s("p"),aw=a("Base class for outputs of decoder-only generation models using contrastive search."),G_=c(),jo=s("h3"),os=s("a"),dg=s("span"),g(tr.$$.fragment),iw=c(),pg=s("span"),cw=a("FLAX"),C_=c(),We=s("div"),g(or.$$.fragment),lw=c(),mg=s("p"),dw=a("Flax Base class for outputs of decoder-only generation models using sampling."),pw=c(),ss=s("div"),g(sr.$$.fragment),mw=c(),hg=s("p"),hw=a("\u201CReturns a new object replacing the specified fields with new values."),N_=c(),De=s("div"),g(nr.$$.fragment),gw=c(),gg=s("p"),uw=a("Flax Base class for outputs of decoder-only generation models using greedy search."),fw=c(),ns=s("div"),g(rr.$$.fragment),_w=c(),ug=s("p"),bw=a("\u201CReturns a new object replacing the specified fields with new values."),X_=c(),Pe=s("div"),g(ar.$$.fragment),yw=c(),fg=s("p"),Tw=a("Flax Base class for outputs of decoder-only generation models using greedy search."),vw=c(),rs=s("div"),g(ir.$$.fragment),ww=c(),_g=s("p"),kw=a("\u201CReturns a new object replacing the specified fields with new values."),R_=c(),Fo=s("h2"),as=s("a"),bg=s("span"),g(cr.$$.fragment),$w=c(),yg=s("span"),Mw=a("LogitsProcessor"),O_=c(),is=s("p"),xw=a("A "),ll=s("a"),Ew=a("LogitsProcessor"),jw=a(` can be used to modify the prediction scores of a language model head for
generation.`),A_=c(),Lo=s("h3"),cs=s("a"),Tg=s("span"),g(lr.$$.fragment),Fw=c(),vg=s("span"),Lw=a("PyTorch"),H_=c(),Ve=s("div"),g(dr.$$.fragment),zw=c(),ls=s("p"),dl=s("a"),Uw=a("LogitsProcessor"),Jw=a(" enforcing alternated generation between the two codebooks of "),wg=s("code"),Iw=a("Bark"),Bw=a("\u2019s fine submodel."),qw=c(),pl=s("div"),g(pr.$$.fragment),Q_=c(),ge=s("div"),g(mr.$$.fragment),Sw=c(),hr=s("p"),Ww=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 `),kg=s("code"),Dw=a("guidance_scale"),Pw=a("."),Vw=c(),gr=s("p"),Zw=a("See "),ur=s("a"),Gw=a("the paper"),Cw=a(" for more information."),Nw=c(),ml=s("div"),g(fr.$$.fragment),Y_=c(),Ze=s("div"),g(_r.$$.fragment),Xw=c(),ds=s("p"),hl=s("a"),Rw=a("LogitsProcessor"),Ow=a(` that enforces no repetition of encoder input ids n-grams for the decoder ids. See
`),br=s("a"),Aw=a("ParlAI"),Hw=a("."),Qw=c(),gl=s("div"),g(yr.$$.fragment),K_=c(),Ge=s("div"),g(Tr.$$.fragment),Yw=c(),ul=s("p"),fl=s("a"),Kw=a("LogitsProcessor"),e2=a(" enforcing an exponential penalty on tokens that are not in the original input."),t2=c(),_l=s("div"),g(vr.$$.fragment),eb=c(),ue=s("div"),g(wr.$$.fragment),o2=c(),Vt=s("p"),bl=s("a"),s2=a("LogitsWarper"),n2=a(" that performs epsilon-sampling, i.e. restricting to tokens with "),$g=s("code"),r2=a("prob >= epsilon"),a2=a(`. Takes the
largest min_tokens_to_keep tokens if no tokens satisfy this constraint. See `),kr=s("a"),i2=a(`Truncation Sampling as Language Model
Desmoothing`),c2=a(" for more information."),l2=c(),g(ps.$$.fragment),d2=c(),yl=s("div"),g($r.$$.fragment),tb=c(),fe=s("div"),g(Mr.$$.fragment),p2=c(),S=s("p"),Tl=s("a"),m2=a("LogitsWarper"),h2=a(` that performs eta-sampling, a technique to filter out tokens with probabilities below a dynamic
cutoff value, `),Mg=s("code"),g2=a("eta"),u2=a(", which is calculated based on a combination of the hyperparameter "),xg=s("code"),f2=a("epsilon"),_2=a(` and the entropy of
the token probabilities, i.e. `),Eg=s("code"),b2=a("eta := min(epsilon, sqrt(epsilon * e^-entropy(probabilities)))"),y2=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 `),xr=s("a"),T2=a(`Truncation
Sampling as Language Model Desmoothing`),v2=a(" for more information. Note: "),jg=s("code"),w2=a("do_sample"),k2=a(`
must be set to `),Fg=s("code"),$2=a("True"),M2=a(" for this "),Lg=s("code"),x2=a("LogitsWarper"),E2=a(" to work."),j2=c(),g(ms.$$.fragment),F2=c(),vl=s("div"),g(Er.$$.fragment),ob=c(),_e=s("div"),g(jr.$$.fragment),L2=c(),Fe=s("p"),wl=s("a"),z2=a("LogitsProcessor"),U2=a(" that exponentially increases the score of the "),zg=s("code"),J2=a("eos_token_id"),I2=a(" after "),Ug=s("code"),B2=a("start_index"),q2=a(` has been
reached. This allows generating shorter sequences without having a hard cutoff, allowing the `),Jg=s("code"),S2=a("eos_token"),W2=a(` to be
predicted in a meaningful position.`),D2=c(),g(hs.$$.fragment),P2=c(),kl=s("div"),g(Fr.$$.fragment),sb=c(),Ce=s("div"),g(Lr.$$.fragment),V2=c(),$l=s("p"),Ml=s("a"),Z2=a("LogitsProcessor"),G2=a(" that enforces the specified token as the first generated token."),C2=c(),xl=s("div"),g(zr.$$.fragment),nb=c(),Ne=s("div"),g(Ur.$$.fragment),N2=c(),gs=s("p"),El=s("a"),X2=a("LogitsProcessor"),R2=a(" that enforces the specified token as the last generated token when "),Ig=s("code"),O2=a("max_length"),A2=a(" is reached."),H2=c(),jl=s("div"),g(Jr.$$.fragment),rb=c(),Xe=s("div"),g(Ir.$$.fragment),Q2=c(),Br=s("p"),Y2=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 `),Bg=s("code"),K2=a("inf"),ek=a(` so that they are
sampled at their corresponding index.`),tk=c(),Fl=s("div"),g(qr.$$.fragment),ab=c(),L=s("div"),g(Sr.$$.fragment),ok=c(),Ll=s("p"),zl=s("a"),sk=a("LogitsProcessor"),nk=a(" that enforces diverse beam search."),rk=c(),zo=s("p"),ak=a("Note that this logits processor is only effective for "),Ul=s("a"),ik=a("PreTrainedModel.group_beam_search()"),ck=a(". See "),Wr=s("a"),lk=a(`Diverse Beam
Search: Decoding Diverse Solutions from Neural Sequence Models`),dk=a(` for more
details.`),pk=c(),g(us.$$.fragment),mk=c(),g(fs.$$.fragment),hk=c(),Dr=s("p"),gk=a(`Traditional beam search often generates very similar sequences across different beams.
`),qg=s("code"),uk=a("HammingDiversityLogitsProcessor"),fk=a(` addresses this by penalizing beams that generate tokens already chosen by other
beams in the same time step.`),_k=c(),Sg=s("p"),bk=a("How It Works:"),yk=c(),Uo=s("ul"),Jl=s("li"),Wg=s("strong"),Tk=a("Grouping Beams"),vk=a(": Beams are divided into groups. Each group selects tokens independently of the others."),wk=c(),Il=s("li"),Dg=s("strong"),kk=a("Penalizing Repeated Tokens"),$k=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.`),Mk=c(),Bl=s("li"),Pg=s("strong"),xk=a("Promoting Diversity"),Ek=a(`: This penalty discourages beams within a group from selecting the same tokens as
beams in other groups.`),jk=c(),Vg=s("p"),Fk=a("Benefits:"),Lk=c(),Pr=s("ul"),ql=s("li"),Zg=s("strong"),zk=a("Diverse Outputs"),Uk=a(": Produces a variety of different sequences."),Jk=c(),Sl=s("li"),Gg=s("strong"),Ik=a("Exploration"),Bk=a(": Allows the model to explore different paths."),qk=c(),g(_s.$$.fragment),Sk=c(),Wl=s("div"),g(Vr.$$.fragment),ib=c(),Re=s("div"),g(Zr.$$.fragment),Wk=c(),Zt=s("p"),Dl=s("a"),Dk=a("LogitsProcessor"),Pk=a(" that removes all "),Cg=s("code"),Vk=a("nan"),Zk=a(" and "),Ng=s("code"),Gk=a("inf"),Ck=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.`),Nk=c(),Pl=s("div"),g(Gr.$$.fragment),cb=c(),Oe=s("div"),g(Cr.$$.fragment),Xk=c(),bs=s("p"),Vl=s("a"),Rk=a("LogitsWarper"),Ok=a(" and "),Zl=s("a"),Ak=a("LogitsProcessor"),Hk=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.`),Qk=c(),Gl=s("div"),g(Nr.$$.fragment),lb=c(),Ae=s("div"),g(Xr.$$.fragment),Yk=c(),Xg=s("p"),Kk=a("Abstract base class for all logit processors that can be applied during generation."),e$=c(),Cl=s("div"),g(Rr.$$.fragment),db=c(),He=s("div"),g(Or.$$.fragment),t$=c(),G=s("p"),o$=a("This class can be used to create a list of "),Nl=s("a"),s$=a("LogitsProcessor"),n$=a(" or "),Xl=s("a"),r$=a("LogitsWarper"),a$=a(` to subsequently process a
`),Rg=s("code"),i$=a("scores"),c$=a(" input tensor. This class inherits from list and adds a specific "),Og=s("em"),Ag=s("strong"),l$=a("call"),d$=a(` method to apply each
`),Rl=s("a"),p$=a("LogitsProcessor"),m$=a(" or "),Ol=s("a"),h$=a("LogitsWarper"),g$=a(" to the inputs."),u$=c(),Al=s("div"),g(Ar.$$.fragment),pb=c(),Qe=s("div"),g(Hr.$$.fragment),f$=c(),Hg=s("p"),_$=a("Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),b$=c(),Hl=s("div"),g(Qr.$$.fragment),mb=c(),Ye=s("div"),g(Yr.$$.fragment),y$=c(),Ql=s("p"),Yl=s("a"),T$=a("LogitsProcessor"),v$=a(" enforcing a min-length by setting EOS probability to 0."),w$=c(),Kl=s("div"),g(Kr.$$.fragment),hb=c(),be=s("div"),g(ea.$$.fragment),k$=c(),Le=s("p"),ed=s("a"),$$=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, `),Qg=s("code"),x$=a("min_length"),E$=a(" will compute the length of "),Yg=s("code"),j$=a("prompt + newly generated tokens"),F$=a(" whereas for other models it will behave as "),Kg=s("code"),L$=a("min_new_tokens"),z$=a(`, that is, taking only into account
the newly generated ones.`),U$=c(),g(ys.$$.fragment),J$=c(),td=s("div"),g(ta.$$.fragment),gb=c(),H=s("div"),g(oa.$$.fragment),I$=c(),od=s("p"),sd=s("a"),B$=a("LogitsProcessor"),q$=a(" that enforces that specified sequences will never be selected."),S$=c(),g(Ts.$$.fragment),W$=c(),g(vs.$$.fragment),D$=c(),nd=s("div"),g(sa.$$.fragment),ub=c(),Q=s("div"),g(na.$$.fragment),P$=c(),Jo=s("p"),V$=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 `),rd=s("a"),Z$=a("LogitsProcessor"),G$=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.
`),ra=s("a"),C$=a("Fairseq"),N$=a("."),X$=c(),g(ws.$$.fragment),R$=c(),g(ks.$$.fragment),O$=c(),ad=s("div"),g(aa.$$.fragment),fb=c(),Ke=s("div"),g(ia.$$.fragment),A$=c(),$s=s("p"),id=s("a"),H$=a("LogitsProcessor"),Q$=a(` that enforces constrained generation and is useful for prefix-conditioned constrained
generation. See `),ca=s("a"),Y$=a("Autoregressive Entity Retrieval"),K$=a(" for more information."),e0=c(),cd=s("div"),g(la.$$.fragment),_b=c(),ye=s("div"),g(da.$$.fragment),t0=c(),Ms=s("p"),ld=s("a"),o0=a("LogitsProcessor"),s0=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 more likely to be
selected. The formula can be seen in the original `),pa=s("a"),n0=a("paper"),r0=a(`. According to the
paper a penalty of around 1.2 yields a good balance between truthful generation and lack of repetition.`),a0=c(),g(xs.$$.fragment),i0=c(),dd=s("div"),g(ma.$$.fragment),bb=c(),Y=s("div"),g(ha.$$.fragment),c0=c(),pd=s("p"),md=s("a"),l0=a("LogitsProcessor"),d0=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).`),p0=c(),g(Es.$$.fragment),m0=c(),g(js.$$.fragment),h0=c(),hd=s("div"),g(ga.$$.fragment),yb=c(),et=s("div"),g(ua.$$.fragment),g0=c(),ze=s("p"),gd=s("a"),u0=a("SuppressTokensAtBeginLogitsProcessor"),f0=a(" supresses a list of tokens as soon as the "),eu=s("code"),_0=a("generate"),b0=a(` function starts
generating using `),tu=s("code"),y0=a("begin_index"),T0=a(" tokens. This should ensure that the tokens defined by "),ou=s("code"),v0=a("begin_suppress_tokens"),w0=a(` at not
sampled at the begining of the generation.`),k0=c(),ud=s("div"),g(fa.$$.fragment),Tb=c(),tt=s("div"),g(_a.$$.fragment),$0=c(),ba=s("p"),M0=a("This processor can be used to suppress a list of tokens. The processor will set their log probs to "),su=s("code"),x0=a("-inf"),E0=a(` so that they
are not sampled.`),j0=c(),fd=s("div"),g(ya.$$.fragment),vb=c(),K=s("div"),g(Ta.$$.fragment),F0=c(),_d=s("p"),bd=s("a"),L0=a("LogitsWarper"),z0=a(` for temperature (exponential scaling output probability distribution), which effectively means
that it can control the randomness of the predicted tokens.`),U0=c(),g(Fs.$$.fragment),J0=c(),g(Ls.$$.fragment),I0=c(),yd=s("div"),g(va.$$.fragment),wb=c(),ot=s("div"),g(wa.$$.fragment),B0=c(),Td=s("p"),vd=s("a"),q0=a("LogitsWarper"),S0=a(" that performs top-k, i.e. restricting to the k highest probability elements."),W0=c(),wd=s("div"),g(ka.$$.fragment),kb=c(),Te=s("div"),g($a.$$.fragment),D0=c(),kd=s("p"),$d=s("a"),P0=a("LogitsWarper"),V0=a(" that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),Z0=c(),g(zs.$$.fragment),G0=c(),Md=s("div"),g(Ma.$$.fragment),$b=c(),st=s("div"),g(xa.$$.fragment),C0=c(),Us=s("p"),xd=s("a"),N0=a("LogitsWarper"),X0=a(" that performs typical decoding. See "),Ea=s("a"),R0=a(`Typical Decoding for Natural Language
Generation`),O0=a(" for more information."),A0=c(),Ed=s("div"),g(ja.$$.fragment),Mb=c(),ee=s("div"),g(Fa.$$.fragment),H0=c(),nt=s("p"),Q0=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 `),nu=s("code"),Y0=a("guidance_scale"),K0=a(". The unconditional scores are computed internally by prompting "),ru=s("code"),eM=a("model"),tM=a(` with
the `),au=s("code"),oM=a("unconditional_ids"),sM=a(" branch."),nM=c(),La=s("p"),rM=a("See "),za=s("a"),aM=a("the paper"),iM=a(" for more information."),cM=c(),g(Js.$$.fragment),lM=c(),jd=s("div"),g(Ua.$$.fragment),xb=c(),ve=s("div"),g(Ja.$$.fragment),dM=c(),Ia=s("p"),pM=a(`Whisper specific Processor. This processor can be used to force a list of tokens. The processor will set their log
probs to `),iu=s("code"),mM=a("inf"),hM=a(" so that they are sampled at their corresponding index."),gM=c(),Ba=s("p"),uM=a("See "),qa=s("a"),fM=a("the paper"),_M=a(" for more information."),bM=c(),Fd=s("div"),g(Sa.$$.fragment),Eb=c(),Io=s("h3"),Is=s("a"),cu=s("span"),g(Wa.$$.fragment),yM=c(),lu=s("span"),TM=a("TensorFlow"),jb=c(),rt=s("div"),g(Da.$$.fragment),vM=c(),Ld=s("p"),zd=s("a"),wM=a("TFLogitsProcessor"),kM=a(" that enforces the specified token as the first generated token."),$M=c(),Ud=s("div"),g(Pa.$$.fragment),Fb=c(),at=s("div"),g(Va.$$.fragment),MM=c(),Bs=s("p"),Jd=s("a"),xM=a("TFLogitsProcessor"),EM=a(" that enforces the specified token as the last generated token when "),du=s("code"),jM=a("max_length"),FM=a(" is reached."),LM=c(),Id=s("div"),g(Za.$$.fragment),Lb=c(),it=s("div"),g(Ga.$$.fragment),zM=c(),Bo=s("p"),UM=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 `),pu=s("code"),JM=a("0"),IM=a(` and all other tokens to
`),mu=s("code"),BM=a("-inf"),qM=a(" so that they are sampled at their corresponding index."),SM=c(),Bd=s("div"),g(Ca.$$.fragment),zb=c(),ct=s("div"),g(Na.$$.fragment),WM=c(),hu=s("p"),DM=a("Abstract base class for all logit processors that can be applied during generation."),PM=c(),qs=s("div"),g(Xa.$$.fragment),VM=c(),gu=s("p"),ZM=a("TF method for processing logits."),Ub=c(),lt=s("div"),g(Ra.$$.fragment),GM=c(),we=s("p"),CM=a("This class can be used to create a list of "),qd=s("a"),NM=a("TFLogitsProcessor"),XM=a(" to subsequently process a "),uu=s("code"),RM=a("scores"),OM=a(` input tensor.
This class inherits from list and adds a specific `),fu=s("em"),_u=s("strong"),AM=a("call"),HM=a(" method to apply each "),Sd=s("a"),QM=a("TFLogitsProcessor"),YM=a(` to the
inputs.`),KM=c(),Wd=s("div"),g(Oa.$$.fragment),Jb=c(),dt=s("div"),g(Aa.$$.fragment),ex=c(),bu=s("p"),tx=a("Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),ox=c(),Ss=s("div"),g(Ha.$$.fragment),sx=c(),yu=s("p"),nx=a("TF method for warping logits."),Ib=c(),pt=s("div"),g(Qa.$$.fragment),rx=c(),Dd=s("p"),Pd=s("a"),ax=a("TFLogitsProcessor"),ix=a(" enforcing a min-length by setting EOS probability to 0."),cx=c(),Vd=s("div"),g(Ya.$$.fragment),Bb=c(),mt=s("div"),g(Ka.$$.fragment),lx=c(),Zd=s("p"),Gd=s("a"),dx=a("TFLogitsProcessor"),px=a(" that enforces that specified sequences will never be sampled."),mx=c(),Cd=s("div"),g(ei.$$.fragment),qb=c(),ht=s("div"),g(ti.$$.fragment),hx=c(),Ws=s("p"),Nd=s("a"),gx=a("TFLogitsProcessor"),ux=a(` that enforces no repetition of n-grams. See
`),oi=s("a"),fx=a("Fairseq"),_x=a("."),bx=c(),Xd=s("div"),g(si.$$.fragment),Sb=c(),gt=s("div"),g(ni.$$.fragment),yx=c(),Rd=s("p"),Od=s("a"),Tx=a("TFLogitsProcessor"),vx=a(" enforcing an exponential penalty on repeated sequences."),wx=c(),Ad=s("div"),g(ri.$$.fragment),Wb=c(),ut=s("div"),g(ai.$$.fragment),kx=c(),Ue=s("p"),Hd=s("a"),$x=a("TFSuppressTokensAtBeginLogitsProcessor"),Mx=a(" suppresses a list of tokens as soon as the "),Tu=s("code"),xx=a("generate"),Ex=a(` function starts
generating using `),vu=s("code"),jx=a("begin_index"),Fx=a(" tokens. This should ensure that the tokens defined by "),wu=s("code"),Lx=a("begin_suppress_tokens"),zx=a(` at not
sampled at the begining of the generation.`),Ux=c(),Qd=s("div"),g(ii.$$.fragment),Db=c(),ft=s("div"),g(ci.$$.fragment),Jx=c(),li=s("p"),Ix=a("This processor can be used to suppress a list of tokens. The processor will set their log probs to "),ku=s("code"),Bx=a("-inf"),qx=a(` so that they
are not sampled.`),Sx=c(),Yd=s("div"),g(di.$$.fragment),Pb=c(),_t=s("div"),g(pi.$$.fragment),Wx=c(),Kd=s("p"),ep=s("a"),Dx=a("TFLogitsWarper"),Px=a(" for temperature (exponential scaling output probability distribution)."),Vx=c(),tp=s("div"),g(mi.$$.fragment),Vb=c(),bt=s("div"),g(hi.$$.fragment),Zx=c(),op=s("p"),sp=s("a"),Gx=a("TFLogitsWarper"),Cx=a(" that performs top-k, i.e. restricting to the k highest probability elements."),Nx=c(),np=s("div"),g(gi.$$.fragment),Zb=c(),yt=s("div"),g(ui.$$.fragment),Xx=c(),rp=s("p"),ap=s("a"),Rx=a("TFLogitsWarper"),Ox=a(" that performs top-p, i.e. restricting to top tokens summing to <= prob_cut_off."),Ax=c(),ip=s("div"),g(fi.$$.fragment),Gb=c(),qo=s("h3"),Ds=s("a"),$u=s("span"),g(_i.$$.fragment),Hx=c(),Mu=s("span"),Qx=a("FLAX"),Cb=c(),Tt=s("div"),g(bi.$$.fragment),Yx=c(),cp=s("p"),lp=s("a"),Kx=a("FlaxLogitsProcessor"),e4=a(" that enforces the specified token as the first generated token."),t4=c(),dp=s("div"),g(yi.$$.fragment),Nb=c(),vt=s("div"),g(Ti.$$.fragment),o4=c(),Ps=s("p"),pp=s("a"),s4=a("FlaxLogitsProcessor"),n4=a(" that enforces the specified token as the last generated token when "),xu=s("code"),r4=a("max_length"),a4=a(" is reached."),i4=c(),mp=s("div"),g(vi.$$.fragment),Xb=c(),wt=s("div"),g(wi.$$.fragment),c4=c(),Vs=s("p"),hp=s("a"),l4=a("FlaxLogitsProcessor"),d4=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 `),Eu=s("code"),p4=a("-inf"),m4=a(" so that they are sampled at their corresponding index."),h4=c(),gp=s("div"),g(ki.$$.fragment),Rb=c(),kt=s("div"),g($i.$$.fragment),g4=c(),ju=s("p"),u4=a("Abstract base class for all logit processors that can be applied during generation."),f4=c(),Zs=s("div"),g(Mi.$$.fragment),_4=c(),Fu=s("p"),b4=a("Flax method for processing logits."),Ob=c(),$t=s("div"),g(xi.$$.fragment),y4=c(),C=s("p"),T4=a("This class can be used to create a list of "),up=s("a"),v4=a("FlaxLogitsProcessor"),w4=a(" or "),fp=s("a"),k4=a("FlaxLogitsWarper"),$4=a(` to subsequently process
a `),Lu=s("code"),M4=a("scores"),x4=a(" input tensor. This class inherits from list and adds a specific "),zu=s("em"),Uu=s("strong"),E4=a("call"),j4=a(` method to apply each
`),_p=s("a"),F4=a("FlaxLogitsProcessor"),L4=a(" or "),bp=s("a"),z4=a("FlaxLogitsWarper"),U4=a(" to the inputs."),J4=c(),yp=s("div"),g(Ei.$$.fragment),Ab=c(),Mt=s("div"),g(ji.$$.fragment),I4=c(),Ju=s("p"),B4=a("Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),q4=c(),Gs=s("div"),g(Fi.$$.fragment),S4=c(),Iu=s("p"),W4=a("Flax method for warping logits."),Hb=c(),xt=s("div"),g(Li.$$.fragment),D4=c(),Tp=s("p"),vp=s("a"),P4=a("FlaxLogitsProcessor"),V4=a(" enforcing a min-length by setting EOS probability to 0."),Z4=c(),wp=s("div"),g(zi.$$.fragment),Qb=c(),Et=s("div"),g(Ui.$$.fragment),G4=c(),Je=s("p"),kp=s("a"),C4=a("FlaxLogitsProcessor"),N4=a(" supressing a list of tokens as soon as the "),Bu=s("code"),X4=a("generate"),R4=a(` function starts generating using
`),qu=s("code"),O4=a("begin_index"),A4=a(" tokens. This should ensure that the tokens defined by "),Su=s("code"),H4=a("begin_suppress_tokens"),Q4=a(` are not sampled at the
begining of the generation.`),Y4=c(),$p=s("div"),g(Ji.$$.fragment),Yb=c(),jt=s("div"),g(Ii.$$.fragment),K4=c(),Cs=s("p"),Mp=s("a"),eE=a("FlaxLogitsProcessor"),tE=a(` suppressing a list of tokens at each decoding step. The processor will set their log probs
to be `),Wu=s("code"),oE=a("-inf"),sE=a(" so they are not sampled."),nE=c(),xp=s("div"),g(Bi.$$.fragment),Kb=c(),Ft=s("div"),g(qi.$$.fragment),rE=c(),Ep=s("p"),jp=s("a"),aE=a("FlaxLogitsWarper"),iE=a(" for temperature (exponential scaling output probability distribution)."),cE=c(),Fp=s("div"),g(Si.$$.fragment),ey=c(),Lt=s("div"),g(Wi.$$.fragment),lE=c(),Lp=s("p"),zp=s("a"),dE=a("FlaxLogitsWarper"),pE=a(" that performs top-k, i.e. restricting to the k highest probability elements."),mE=c(),Up=s("div"),g(Di.$$.fragment),ty=c(),zt=s("div"),g(Pi.$$.fragment),hE=c(),Jp=s("p"),Ip=s("a"),gE=a("FlaxLogitsWarper"),uE=a(" that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),fE=c(),Bp=s("div"),g(Vi.$$.fragment),oy=c(),Ut=s("div"),g(Zi.$$.fragment),_E=c(),Gi=s("p"),bE=a(`Whisper specific Processor. This processor can be used to force a list of tokens. The processor will set their log
probs to `),Du=s("code"),yE=a("inf"),TE=a(" so that they are sampled at their corresponding index."),vE=c(),qp=s("div"),g(Ci.$$.fragment),sy=c(),So=s("h2"),Ns=s("a"),Pu=s("span"),g(Ni.$$.fragment),wE=c(),Vu=s("span"),kE=a("StoppingCriteria"),ny=c(),Xs=s("p"),$E=a("A "),Sp=s("a"),ME=a("StoppingCriteria"),xE=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."),ry=c(),Jt=s("div"),g(Xi.$$.fragment),EE=c(),Zu=s("p"),jE=a("Abstract base class for all stopping criteria that can be applied during generation."),FE=c(),Wp=s("div"),g(Ri.$$.fragment),ay=c(),Wo=s("div"),g(Oi.$$.fragment),LE=c(),Dp=s("div"),g(Ai.$$.fragment),iy=c(),It=s("div"),g(Hi.$$.fragment),zE=c(),Qi=s("p"),UE=a("This class can be used to stop generation whenever the full generated number of tokens exceeds "),Gu=s("code"),JE=a("max_length"),IE=a(`. Keep
in mind for decoder-only type of transformers, this will include the initial prompted tokens.`),BE=c(),Pp=s("div"),g(Yi.$$.fragment),cy=c(),Bt=s("div"),g(Ki.$$.fragment),qE=c(),ec=s("p"),SE=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
`),Cu=s("code"),WE=a("initial_time"),DE=a("."),PE=c(),Vp=s("div"),g(tc.$$.fragment),ly=c(),Do=s("h2"),Rs=s("a"),Nu=s("span"),g(oc.$$.fragment),VE=c(),Xu=s("span"),ZE=a("Constraints"),dy=c(),Os=s("p"),GE=a("A "),Zp=s("a"),CE=a("Constraint"),NE=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."),py=c(),z=s("div"),g(sc.$$.fragment),XE=c(),Ru=s("p"),RE=a(`Abstract base class for all constraints that can be applied during generation.
It must define how the constraint can be satisfied.`),OE=c(),Ou=s("p"),AE=a("All classes that inherit Constraint must follow the requirement that"),HE=c(),g(As.$$.fragment),QE=c(),Au=s("p"),YE=a("will always terminate (halt)."),KE=c(),Hs=s("div"),g(nc.$$.fragment),ej=c(),Hu=s("p"),tj=a("When called, returns the token that would take this constraint one step closer to being fulfilled."),oj=c(),Qs=s("div"),g(rc.$$.fragment),sj=c(),Qu=s("p"),nj=a("Creates a new instance of this constraint."),rj=c(),Ys=s("div"),g(ac.$$.fragment),aj=c(),Yu=s("p"),ij=a("Reads in a token and returns whether it creates progress."),cj=c(),Ks=s("div"),g(ic.$$.fragment),lj=c(),cc=s("p"),dj=a("Returns the number of remaining steps of "),Ku=s("code"),pj=a("advance()"),mj=a(" in order to complete this constraint."),hj=c(),en=s("div"),g(lc.$$.fragment),gj=c(),ef=s("p"),uj=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.`),fj=c(),tn=s("div"),g(dc.$$.fragment),_j=c(),tf=s("p"),bj=a("Tests whether this constraint has been properly defined."),yj=c(),Gt=s("div"),g(pc.$$.fragment),Tj=c(),mc=s("p"),vj=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 `),of=s("code"),wj=a("does_advance(self, token_id: int)"),kj=a("."),$j=c(),sf=s("p"),Mj=a(`This isn\u2019t to test whether a certain token will advance the progress; it\u2019s to update its state as if it has
been generated. This becomes important if token_id != desired token (refer to else statement in
PhrasalConstraint)`),my=c(),Po=s("div"),g(hc.$$.fragment),xj=c(),Gp=s("p"),Cp=s("a"),Ej=a("Constraint"),jj=a(" enforcing that an ordered sequence of tokens is included in the output."),hy=c(),Vo=s("div"),g(gc.$$.fragment),Fj=c(),uc=s("p"),Lj=a("A special "),Np=s("a"),zj=a("Constraint"),Uj=a(" that is fulfilled by fulfilling just one of several constraints."),gy=c(),ke=s("div"),g(fc.$$.fragment),Jj=c(),nf=s("p"),Ij=a("A class for beam scorers to track its progress through a list of constraints."),Bj=c(),O=s("div"),g(_c.$$.fragment),qj=c(),rf=s("p"),Sj=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.`),Wj=c(),Zo=s("p"),Dj=a("Given constraints "),af=s("code"),Pj=a("c_i = {t_ij | j == # of tokens}"),Vj=a(`, If we\u2019re not in the middle of progressing through a
specific constraint `),cf=s("code"),Zj=a("c_i"),Gj=a(", we return:"),Cj=c(),lf=s("p"),df=s("code"),Nj=a("[t_k1 for k in indices of unfulfilled constraints]"),Xj=c(),qt=s("p"),Rj=a(`If we are in the middle of a constraint, then we return:
`),pf=s("code"),Oj=a("[t_ij]"),Aj=a(", where "),mf=s("code"),Hj=a("i"),Qj=a(" is the index of the inprogress constraint, "),hf=s("code"),Yj=a("j"),Kj=a(" is the next step for the constraint."),eF=c(),gf=s("p"),tF=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.`),oF=c(),on=s("div"),g(bc.$$.fragment),sF=c(),uf=s("p"),nF=a("token_ids: the tokens generated thus far to reset the state of the progress through constraints."),uy=c(),Go=s("h2"),sn=s("a"),ff=s("span"),g(yc.$$.fragment),rF=c(),_f=s("span"),aF=a("BeamSearch"),fy=c(),$e=s("div"),g(Tc.$$.fragment),iF=c(),Co=s("p"),cF=a("Abstract base class for all beam scorers that are used for "),Xp=s("a"),lF=a("beam_search()"),dF=a(` and
`),Rp=s("a"),pF=a("beam_sample()"),mF=a("."),hF=c(),Op=s("div"),g(vc.$$.fragment),gF=c(),Ap=s("div"),g(wc.$$.fragment),_y=c(),N=s("div"),g(kc.$$.fragment),uF=c(),Hp=s("p"),Qp=s("a"),fF=a("BeamScorer"),_F=a(" implementing standard beam search decoding."),bF=c(),$c=s("p"),yF=a("Adapted in part from "),Mc=s("a"),TF=a(`Facebook\u2019s XLM beam search
code`),vF=a("."),wF=c(),Yp=s("p"),kF=a("Reference for the diverse beam search algorithm and implementation "),xc=s("a"),$F=a(`Ashwin Kalyan\u2019s DBS
implementation`),MF=c(),Kp=s("div"),g(Ec.$$.fragment),xF=c(),em=s("div"),g(jc.$$.fragment),by=c(),Me=s("div"),g(Fc.$$.fragment),EF=c(),tm=s("p"),om=s("a"),jF=a("BeamScorer"),FF=a(" implementing constrained beam search decoding."),LF=c(),sm=s("div"),g(Lc.$$.fragment),zF=c(),nm=s("div"),g(zc.$$.fragment),yy=c(),No=s("h2"),nn=s("a"),bf=s("span"),g(Uc.$$.fragment),UF=c(),yf=s("span"),JF=a("Utilities"),Ty=c(),St=s("div"),g(Jc.$$.fragment),IF=c(),Tf=s("p"),BF=a("Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),qF=c(),rm=s("p"),SF=a("From: "),Ic=s("a"),WF=a("https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),vy=c(),Wt=s("div"),g(Bc.$$.fragment),DF=c(),vf=s("p"),PF=a("Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),VF=c(),am=s("p"),ZF=a("From: "),qc=s("a"),GF=a("https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),wy=c(),Xo=s("h2"),rn=s("a"),wf=s("span"),g(Sc.$$.fragment),CF=c(),kf=s("span"),NF=a("Streamers"),ky=c(),D=s("div"),g(Wc.$$.fragment),XF=c(),$f=s("p"),RF=a("Simple text streamer that prints the token(s) to stdout as soon as entire words are formed."),OF=c(),g(an.$$.fragment),AF=c(),g(cn.$$.fragment),HF=c(),ln=s("div"),g(Dc.$$.fragment),QF=c(),Mf=s("p"),YF=a("Flushes any remaining cache and prints a newline to stdout."),KF=c(),dn=s("div"),g(Pc.$$.fragment),e5=c(),xf=s("p"),t5=a("Prints the new text to stdout. If the stream is ending, also prints a newline."),o5=c(),pn=s("div"),g(Vc.$$.fragment),s5=c(),Ef=s("p"),n5=a("Receives tokens, decodes them, and prints them to stdout as soon as they form entire words."),$y=c(),te=s("div"),g(Zc.$$.fragment),r5=c(),jf=s("p"),a5=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).`),i5=c(),g(mn.$$.fragment),c5=c(),g(hn.$$.fragment),l5=c(),gn=s("div"),g(Gc.$$.fragment),d5=c(),Ff=s("p"),p5=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=aB('[data-svelte="svelte-1phssyn"]',document.head);T=n(p,"META",{name:!0,content:!0}),p.forEach(o),M=l(t),k=n(t,"H1",{class:!0});var Cc=r(k);w=n(Cc,"A",{id:!0,class:!0,href:!0});var Lf=r(w);x=n(Lf,"SPAN",{});var zf=r(x);u(h.$$.fragment,zf),zf.forEach(o),Lf.forEach(o),$=l(Cc),Z=n(Cc,"SPAN",{});var Uf=r(Z);I=i(Uf,"Utilities for Generation"),Uf.forEach(o),Cc.forEach(o),B=l(t),F=n(t,"P",{});var q=r(F);P=i(q,"This page lists all the utility functions used by "),ne=n(q,"A",{href:!0});var Jf=r(ne);qe=i(Jf,"generate()"),Jf.forEach(o),W=i(q,`,
`),re=n(q,"A",{href:!0});var If=r(re);Se=i(If,"greedy_search()"),If.forEach(o),A=i(q,`,
`),j=n(q,"A",{href:!0});var Bf=r(j);eo=i(Bf,"contrastive_search()"),Bf.forEach(o),to=i(q,`,
`),xe=n(q,"A",{href:!0});var qf=r(xe);oo=i(qf,"sample()"),qf.forEach(o),so=i(q,`,
`),Oc=n(q,"A",{href:!0});var Sf=r(Oc);XT=i(Sf,"beam_search()"),Sf.forEach(o),RT=i(q,`,
`),Ac=n(q,"A",{href:!0});var Wf=r(Ac);OT=i(Wf,"beam_sample()"),Wf.forEach(o),AT=i(q,`,
`),Hc=n(q,"A",{href:!0});var Df=r(Hc);HT=i(Df,"group_beam_search()"),Df.forEach(o),QT=i(q,`, and
`),Qc=n(q,"A",{href:!0});var Pf=r(Qc);YT=i(Pf,"constrained_beam_search()"),Pf.forEach(o),KT=i(q,"."),q.forEach(o),i_=l(t),Yc=n(t,"P",{});var Vf=r(Yc);ev=i(Vf,"Most of those are only useful if you are studying the code of the generate methods in the library."),Vf.forEach(o),c_=l(t),no=n(t,"H2",{class:!0});var Nc=r(no);Yo=n(Nc,"A",{id:!0,class:!0,href:!0});var Zf=r(Yo);gh=n(Zf,"SPAN",{});var Gf=r(gh);u(Ln.$$.fragment,Gf),Gf.forEach(o),Zf.forEach(o),tv=l(Nc),uh=n(Nc,"SPAN",{});var Cf=r(uh);ov=i(Cf,"Generate Outputs"),Cf.forEach(o),Nc.forEach(o),l_=l(t),Ee=n(t,"P",{});var Dt=r(Ee);sv=i(Dt,"The output of "),Kc=n(Dt,"A",{href:!0});var Nf=r(Kc);nv=i(Nf,"generate()"),Nf.forEach(o),rv=i(Dt,` is an instance of a subclass of
`),el=n(Dt,"A",{href:!0});var Xf=r(el);av=i(Xf,"ModelOutput"),Xf.forEach(o),iv=i(Dt,`. This output is a data structure containing all the information returned
by `),tl=n(Dt,"A",{href:!0});var Rf=r(tl);cv=i(Rf,"generate()"),Rf.forEach(o),lv=i(Dt,", but that can also be used as tuple or dictionary."),Dt.forEach(o),d_=l(t),ol=n(t,"P",{});var Of=r(ol);dv=i(Of,"Here\u2019s an example:"),Of.forEach(o),p_=l(t),u(zn.$$.fragment,t),m_=l(t),Pt=n(t,"P",{});var im=r(Pt);pv=i(im,"The "),fh=n(im,"CODE",{});var O5=r(fh);mv=i(O5,"generation_output"),O5.forEach(o),hv=i(im," object is a "),sl=n(im,"A",{href:!0});var A5=r(sl);gv=i(A5,"GreedySearchDecoderOnlyOutput"),A5.forEach(o),uv=i(im,`, as we can
see in the documentation of that class below, it means it has the following attributes:`),im.forEach(o),h_=l(t),je=n(t,"UL",{});var un=r(je);nl=n(un,"LI",{});var m5=r(nl);_h=n(m5,"CODE",{});var H5=r(_h);fv=i(H5,"sequences"),H5.forEach(o),_v=i(m5,": the generated sequences of tokens"),m5.forEach(o),bv=l(un),rl=n(un,"LI",{});var h5=r(rl);bh=n(h5,"CODE",{});var Q5=r(bh);yv=i(Q5,"scores"),Q5.forEach(o),Tv=i(h5," (optional): the prediction scores of the language modelling head, for each generation step"),h5.forEach(o),vv=l(un),al=n(un,"LI",{});var g5=r(al);yh=n(g5,"CODE",{});var Y5=r(yh);wv=i(Y5,"hidden_states"),Y5.forEach(o),kv=i(g5," (optional): the hidden states of the model, for each generation step"),g5.forEach(o),$v=l(un),il=n(un,"LI",{});var u5=r(il);Th=n(u5,"CODE",{});var K5=r(Th);Mv=i(K5,"attentions"),K5.forEach(o),xv=i(u5," (optional): the attention weights of the model, for each generation step"),u5.forEach(o),un.forEach(o),g_=l(t),V=n(t,"P",{});var le=r(V);Ev=i(le,"Here we have the "),vh=n(le,"CODE",{});var e3=r(vh);jv=i(e3,"scores"),e3.forEach(o),Fv=i(le," since we passed along "),wh=n(le,"CODE",{});var t3=r(wh);Lv=i(t3,"output_scores=True"),t3.forEach(o),zv=i(le,", but we don\u2019t have "),kh=n(le,"CODE",{});var o3=r(kh);Uv=i(o3,"hidden_states"),o3.forEach(o),Jv=i(le,` and
`),$h=n(le,"CODE",{});var s3=r($h);Iv=i(s3,"attentions"),s3.forEach(o),Bv=i(le," because we didn\u2019t pass "),Mh=n(le,"CODE",{});var n3=r(Mh);qv=i(n3,"output_hidden_states=True"),n3.forEach(o),Sv=i(le," or "),xh=n(le,"CODE",{});var r3=r(xh);Wv=i(r3,"output_attentions=True"),r3.forEach(o),Dv=i(le,"."),le.forEach(o),u_=l(t),ae=n(t,"P",{});var Ct=r(ae);Pv=i(Ct,`You can access each attribute as you would usually do, and if that attribute has not been returned by the model, you
will get `),Eh=n(Ct,"CODE",{});var a3=r(Eh);Vv=i(a3,"None"),a3.forEach(o),Zv=i(Ct,". Here for instance "),jh=n(Ct,"CODE",{});var i3=r(jh);Gv=i(i3,"generation_output.scores"),i3.forEach(o),Cv=i(Ct,` are all the generated prediction scores of the
language modeling head, and `),Fh=n(Ct,"CODE",{});var c3=r(Fh);Nv=i(c3,"generation_output.attentions"),c3.forEach(o),Xv=i(Ct," is "),Lh=n(Ct,"CODE",{});var l3=r(Lh);Rv=i(l3,"None"),l3.forEach(o),Ov=i(Ct,"."),Ct.forEach(o),f_=l(t),ie=n(t,"P",{});var Nt=r(ie);Av=i(Nt,"When using our "),zh=n(Nt,"CODE",{});var d3=r(zh);Hv=i(d3,"generation_output"),d3.forEach(o),Qv=i(Nt," object as a tuple, it only keeps the attributes that don\u2019t have "),Uh=n(Nt,"CODE",{});var p3=r(Uh);Yv=i(p3,"None"),p3.forEach(o),Kv=i(Nt,` values.
Here, for instance, it has two elements, `),Jh=n(Nt,"CODE",{});var m3=r(Jh);e1=i(m3,"loss"),m3.forEach(o),t1=i(Nt," then "),Ih=n(Nt,"CODE",{});var h3=r(Ih);o1=i(h3,"logits"),h3.forEach(o),s1=i(Nt,", so"),Nt.forEach(o),__=l(t),u(Un.$$.fragment,t),b_=l(t),Ko=n(t,"P",{});var xy=r(Ko);n1=i(xy,"will return the tuple "),Bh=n(xy,"CODE",{});var g3=r(Bh);r1=i(g3,"(generation_output.sequences, generation_output.scores)"),g3.forEach(o),a1=i(xy," for instance."),xy.forEach(o),y_=l(t),ce=n(t,"P",{});var Xt=r(ce);i1=i(Xt,"When using our "),qh=n(Xt,"CODE",{});var u3=r(qh);c1=i(u3,"generation_output"),u3.forEach(o),l1=i(Xt," object as a dictionary, it only keeps the attributes that don\u2019t have "),Sh=n(Xt,"CODE",{});var f3=r(Sh);d1=i(f3,"None"),f3.forEach(o),p1=i(Xt,`
values. Here, for instance, it has two keys that are `),Wh=n(Xt,"CODE",{});var _3=r(Wh);m1=i(_3,"sequences"),_3.forEach(o),h1=i(Xt," and "),Dh=n(Xt,"CODE",{});var b3=r(Dh);g1=i(b3,"scores"),b3.forEach(o),u1=i(Xt,"."),Xt.forEach(o),T_=l(t),cl=n(t,"P",{});var y3=r(cl);f1=i(y3,"We document here all output types."),y3.forEach(o),v_=l(t),ro=n(t,"H3",{class:!0});var Ey=r(ro);es=n(Ey,"A",{id:!0,class:!0,href:!0});var T3=r(es);Ph=n(T3,"SPAN",{});var v3=r(Ph);u(Jn.$$.fragment,v3),v3.forEach(o),T3.forEach(o),_1=l(Ey),Vh=n(Ey,"SPAN",{});var w3=r(Vh);b1=i(w3,"PyTorch"),w3.forEach(o),Ey.forEach(o),w_=l(t),ao=n(t,"DIV",{class:!0});var jy=r(ao);u(In.$$.fragment,jy),y1=l(jy),Zh=n(jy,"P",{});var k3=r(Zh);T1=i(k3,`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)`),k3.forEach(o),jy.forEach(o),k_=l(t),io=n(t,"DIV",{class:!0});var Fy=r(io);u(Bn.$$.fragment,Fy),v1=l(Fy),Gh=n(Fy,"P",{});var $3=r(Gh);w1=i($3,"Base class for outputs of decoder-only generation models using greedy search."),$3.forEach(o),Fy.forEach(o),$_=l(t),co=n(t,"DIV",{class:!0});var Ly=r(co);u(qn.$$.fragment,Ly),k1=l(Ly),Ch=n(Ly,"P",{});var M3=r(Ch);$1=i(M3,`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)`),M3.forEach(o),Ly.forEach(o),M_=l(t),lo=n(t,"DIV",{class:!0});var zy=r(lo);u(Sn.$$.fragment,zy),M1=l(zy),Nh=n(zy,"P",{});var x3=r(Nh);x1=i(x3,"Base class for outputs of decoder-only generation models using sampling."),x3.forEach(o),zy.forEach(o),x_=l(t),po=n(t,"DIV",{class:!0});var Uy=r(po);u(Wn.$$.fragment,Uy),E1=l(Uy),Xh=n(Uy,"P",{});var E3=r(Xh);j1=i(E3,`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)`),E3.forEach(o),Uy.forEach(o),E_=l(t),mo=n(t,"DIV",{class:!0});var Jy=r(mo);u(Dn.$$.fragment,Jy),F1=l(Jy),Rh=n(Jy,"P",{});var j3=r(Rh);L1=i(j3,"Base class for outputs of decoder-only generation models using beam search."),j3.forEach(o),Jy.forEach(o),j_=l(t),ho=n(t,"DIV",{class:!0});var Iy=r(ho);u(Pn.$$.fragment,Iy),z1=l(Iy),Oh=n(Iy,"P",{});var F3=r(Oh);U1=i(F3,`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)`),F3.forEach(o),Iy.forEach(o),F_=l(t),go=n(t,"DIV",{class:!0});var By=r(go);u(Vn.$$.fragment,By),J1=l(By),Ah=n(By,"P",{});var L3=r(Ah);I1=i(L3,"Base class for outputs of decoder-only generation models using beam sample."),L3.forEach(o),By.forEach(o),L_=l(t),uo=n(t,"DIV",{class:!0});var qy=r(uo);u(Zn.$$.fragment,qy),B1=l(qy),Hh=n(qy,"P",{});var z3=r(Hh);q1=i(z3,"Base class for outputs of decoder-only generation models using contrastive search."),z3.forEach(o),qy.forEach(o),z_=l(t),fo=n(t,"DIV",{class:!0});var Sy=r(fo);u(Gn.$$.fragment,Sy),S1=l(Sy),Qh=n(Sy,"P",{});var U3=r(Qh);W1=i(U3,"Base class for outputs of decoder-only generation models using contrastive search."),U3.forEach(o),Sy.forEach(o),U_=l(t),_o=n(t,"H3",{class:!0});var Wy=r(_o);ts=n(Wy,"A",{id:!0,class:!0,href:!0});var J3=r(ts);Yh=n(J3,"SPAN",{});var I3=r(Yh);u(Cn.$$.fragment,I3),I3.forEach(o),J3.forEach(o),D1=l(Wy),Kh=n(Wy,"SPAN",{});var B3=r(Kh);P1=i(B3,"TensorFlow"),B3.forEach(o),Wy.forEach(o),J_=l(t),bo=n(t,"DIV",{class:!0});var Dy=r(bo);u(Nn.$$.fragment,Dy),V1=l(Dy),eg=n(Dy,"P",{});var q3=r(eg);Z1=i(q3,`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)`),q3.forEach(o),Dy.forEach(o),I_=l(t),yo=n(t,"DIV",{class:!0});var Py=r(yo);u(Xn.$$.fragment,Py),G1=l(Py),tg=n(Py,"P",{});var S3=r(tg);C1=i(S3,"Base class for outputs of decoder-only generation models using greedy search."),S3.forEach(o),Py.forEach(o),B_=l(t),To=n(t,"DIV",{class:!0});var Vy=r(To);u(Rn.$$.fragment,Vy),N1=l(Vy),og=n(Vy,"P",{});var W3=r(og);X1=i(W3,`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)`),W3.forEach(o),Vy.forEach(o),q_=l(t),vo=n(t,"DIV",{class:!0});var Zy=r(vo);u(On.$$.fragment,Zy),R1=l(Zy),sg=n(Zy,"P",{});var D3=r(sg);O1=i(D3,"Base class for outputs of decoder-only generation models using sampling."),D3.forEach(o),Zy.forEach(o),S_=l(t),wo=n(t,"DIV",{class:!0});var Gy=r(wo);u(An.$$.fragment,Gy),A1=l(Gy),ng=n(Gy,"P",{});var P3=r(ng);H1=i(P3,`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)`),P3.forEach(o),Gy.forEach(o),W_=l(t),ko=n(t,"DIV",{class:!0});var Cy=r(ko);u(Hn.$$.fragment,Cy),Q1=l(Cy),rg=n(Cy,"P",{});var V3=r(rg);Y1=i(V3,"Base class for outputs of decoder-only generation models using beam search."),V3.forEach(o),Cy.forEach(o),D_=l(t),$o=n(t,"DIV",{class:!0});var Ny=r($o);u(Qn.$$.fragment,Ny),K1=l(Ny),ag=n(Ny,"P",{});var Z3=r(ag);ew=i(Z3,`Base class for outputs of encoder-decoder generation models using beam sampling. Hidden states and attention
weights of the decoder (respectively the encoder) can be accessed via the encoder_attentions and the
encoder_hidden_states attributes (respectively the decoder_attentions and the decoder_hidden_states attributes)`),Z3.forEach(o),Ny.forEach(o),P_=l(t),Mo=n(t,"DIV",{class:!0});var Xy=r(Mo);u(Yn.$$.fragment,Xy),tw=l(Xy),ig=n(Xy,"P",{});var G3=r(ig);ow=i(G3,"Base class for outputs of decoder-only generation models using beam sample."),G3.forEach(o),Xy.forEach(o),V_=l(t),xo=n(t,"DIV",{class:!0});var Ry=r(xo);u(Kn.$$.fragment,Ry),sw=l(Ry),cg=n(Ry,"P",{});var C3=r(cg);nw=i(C3,`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)`),C3.forEach(o),Ry.forEach(o),Z_=l(t),Eo=n(t,"DIV",{class:!0});var Oy=r(Eo);u(er.$$.fragment,Oy),rw=l(Oy),lg=n(Oy,"P",{});var N3=r(lg);aw=i(N3,"Base class for outputs of decoder-only generation models using contrastive search."),N3.forEach(o),Oy.forEach(o),G_=l(t),jo=n(t,"H3",{class:!0});var Ay=r(jo);os=n(Ay,"A",{id:!0,class:!0,href:!0});var X3=r(os);dg=n(X3,"SPAN",{});var R3=r(dg);u(tr.$$.fragment,R3),R3.forEach(o),X3.forEach(o),iw=l(Ay),pg=n(Ay,"SPAN",{});var O3=r(pg);cw=i(O3,"FLAX"),O3.forEach(o),Ay.forEach(o),C_=l(t),We=n(t,"DIV",{class:!0});var cm=r(We);u(or.$$.fragment,cm),lw=l(cm),mg=n(cm,"P",{});var A3=r(mg);dw=i(A3,"Flax Base class for outputs of decoder-only generation models using sampling."),A3.forEach(o),pw=l(cm),ss=n(cm,"DIV",{class:!0});var Hy=r(ss);u(sr.$$.fragment,Hy),mw=l(Hy),hg=n(Hy,"P",{});var H3=r(hg);hw=i(H3,"\u201CReturns a new object replacing the specified fields with new values."),H3.forEach(o),Hy.forEach(o),cm.forEach(o),N_=l(t),De=n(t,"DIV",{class:!0});var lm=r(De);u(nr.$$.fragment,lm),gw=l(lm),gg=n(lm,"P",{});var Q3=r(gg);uw=i(Q3,"Flax Base class for outputs of decoder-only generation models using greedy search."),Q3.forEach(o),fw=l(lm),ns=n(lm,"DIV",{class:!0});var Qy=r(ns);u(rr.$$.fragment,Qy),_w=l(Qy),ug=n(Qy,"P",{});var Y3=r(ug);bw=i(Y3,"\u201CReturns a new object replacing the specified fields with new values."),Y3.forEach(o),Qy.forEach(o),lm.forEach(o),X_=l(t),Pe=n(t,"DIV",{class:!0});var dm=r(Pe);u(ar.$$.fragment,dm),yw=l(dm),fg=n(dm,"P",{});var K3=r(fg);Tw=i(K3,"Flax Base class for outputs of decoder-only generation models using greedy search."),K3.forEach(o),vw=l(dm),rs=n(dm,"DIV",{class:!0});var Yy=r(rs);u(ir.$$.fragment,Yy),ww=l(Yy),_g=n(Yy,"P",{});var eL=r(_g);kw=i(eL,"\u201CReturns a new object replacing the specified fields with new values."),eL.forEach(o),Yy.forEach(o),dm.forEach(o),R_=l(t),Fo=n(t,"H2",{class:!0});var Ky=r(Fo);as=n(Ky,"A",{id:!0,class:!0,href:!0});var tL=r(as);bg=n(tL,"SPAN",{});var oL=r(bg);u(cr.$$.fragment,oL),oL.forEach(o),tL.forEach(o),$w=l(Ky),yg=n(Ky,"SPAN",{});var sL=r(yg);Mw=i(sL,"LogitsProcessor"),sL.forEach(o),Ky.forEach(o),O_=l(t),is=n(t,"P",{});var eT=r(is);xw=i(eT,"A "),ll=n(eT,"A",{href:!0});var nL=r(ll);Ew=i(nL,"LogitsProcessor"),nL.forEach(o),jw=i(eT,` can be used to modify the prediction scores of a language model head for
generation.`),eT.forEach(o),A_=l(t),Lo=n(t,"H3",{class:!0});var tT=r(Lo);cs=n(tT,"A",{id:!0,class:!0,href:!0});var rL=r(cs);Tg=n(rL,"SPAN",{});var aL=r(Tg);u(lr.$$.fragment,aL),aL.forEach(o),rL.forEach(o),Fw=l(tT),vg=n(tT,"SPAN",{});var iL=r(vg);Lw=i(iL,"PyTorch"),iL.forEach(o),tT.forEach(o),H_=l(t),Ve=n(t,"DIV",{class:!0});var pm=r(Ve);u(dr.$$.fragment,pm),zw=l(pm),ls=n(pm,"P",{});var Af=r(ls);dl=n(Af,"A",{href:!0});var cL=r(dl);Uw=i(cL,"LogitsProcessor"),cL.forEach(o),Jw=i(Af," enforcing alternated generation between the two codebooks of "),wg=n(Af,"CODE",{});var lL=r(wg);Iw=i(lL,"Bark"),lL.forEach(o),Bw=i(Af,"\u2019s fine submodel."),Af.forEach(o),qw=l(pm),pl=n(pm,"DIV",{class:!0});var dL=r(pl);u(pr.$$.fragment,dL),dL.forEach(o),pm.forEach(o),Q_=l(t),ge=n(t,"DIV",{class:!0});var fn=r(ge);u(mr.$$.fragment,fn),Sw=l(fn),hr=n(fn,"P",{});var oT=r(hr);Ww=i(oT,`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 `),kg=n(oT,"CODE",{});var pL=r(kg);Dw=i(pL,"guidance_scale"),pL.forEach(o),Pw=i(oT,"."),oT.forEach(o),Vw=l(fn),gr=n(fn,"P",{});var sT=r(gr);Zw=i(sT,"See "),ur=n(sT,"A",{href:!0,rel:!0});var mL=r(ur);Gw=i(mL,"the paper"),mL.forEach(o),Cw=i(sT," for more information."),sT.forEach(o),Nw=l(fn),ml=n(fn,"DIV",{class:!0});var hL=r(ml);u(fr.$$.fragment,hL),hL.forEach(o),fn.forEach(o),Y_=l(t),Ze=n(t,"DIV",{class:!0});var mm=r(Ze);u(_r.$$.fragment,mm),Xw=l(mm),ds=n(mm,"P",{});var Hf=r(ds);hl=n(Hf,"A",{href:!0});var gL=r(hl);Rw=i(gL,"LogitsProcessor"),gL.forEach(o),Ow=i(Hf,` that enforces no repetition of encoder input ids n-grams for the decoder ids. See
`),br=n(Hf,"A",{href:!0,rel:!0});var uL=r(br);Aw=i(uL,"ParlAI"),uL.forEach(o),Hw=i(Hf,"."),Hf.forEach(o),Qw=l(mm),gl=n(mm,"DIV",{class:!0});var fL=r(gl);u(yr.$$.fragment,fL),fL.forEach(o),mm.forEach(o),K_=l(t),Ge=n(t,"DIV",{class:!0});var hm=r(Ge);u(Tr.$$.fragment,hm),Yw=l(hm),ul=n(hm,"P",{});var f5=r(ul);fl=n(f5,"A",{href:!0});var _L=r(fl);Kw=i(_L,"LogitsProcessor"),_L.forEach(o),e2=i(f5," enforcing an exponential penalty on tokens that are not in the original input."),f5.forEach(o),t2=l(hm),_l=n(hm,"DIV",{class:!0});var bL=r(_l);u(vr.$$.fragment,bL),bL.forEach(o),hm.forEach(o),eb=l(t),ue=n(t,"DIV",{class:!0});var _n=r(ue);u(wr.$$.fragment,_n),o2=l(_n),Vt=n(_n,"P",{});var Xc=r(Vt);bl=n(Xc,"A",{href:!0});var yL=r(bl);s2=i(yL,"LogitsWarper"),yL.forEach(o),n2=i(Xc," that performs epsilon-sampling, i.e. restricting to tokens with "),$g=n(Xc,"CODE",{});var TL=r($g);r2=i(TL,"prob >= epsilon"),TL.forEach(o),a2=i(Xc,`. Takes the
largest min_tokens_to_keep tokens if no tokens satisfy this constraint. See `),kr=n(Xc,"A",{href:!0,rel:!0});var vL=r(kr);i2=i(vL,`Truncation Sampling as Language Model
Desmoothing`),vL.forEach(o),c2=i(Xc," for more information."),Xc.forEach(o),l2=l(_n),u(ps.$$.fragment,_n),d2=l(_n),yl=n(_n,"DIV",{class:!0});var wL=r(yl);u($r.$$.fragment,wL),wL.forEach(o),_n.forEach(o),tb=l(t),fe=n(t,"DIV",{class:!0});var bn=r(fe);u(Mr.$$.fragment,bn),p2=l(bn),S=n(bn,"P",{});var X=r(S);Tl=n(X,"A",{href:!0});var kL=r(Tl);m2=i(kL,"LogitsWarper"),kL.forEach(o),h2=i(X,` that performs eta-sampling, a technique to filter out tokens with probabilities below a dynamic
cutoff value, `),Mg=n(X,"CODE",{});var $L=r(Mg);g2=i($L,"eta"),$L.forEach(o),u2=i(X,", which is calculated based on a combination of the hyperparameter "),xg=n(X,"CODE",{});var ML=r(xg);f2=i(ML,"epsilon"),ML.forEach(o),_2=i(X,` and the entropy of
the token probabilities, i.e. `),Eg=n(X,"CODE",{});var xL=r(Eg);b2=i(xL,"eta := min(epsilon, sqrt(epsilon * e^-entropy(probabilities)))"),xL.forEach(o),y2=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 `),xr=n(X,"A",{href:!0,rel:!0});var EL=r(xr);T2=i(EL,`Truncation
Sampling as Language Model Desmoothing`),EL.forEach(o),v2=i(X," for more information. Note: "),jg=n(X,"CODE",{});var jL=r(jg);w2=i(jL,"do_sample"),jL.forEach(o),k2=i(X,`
must be set to `),Fg=n(X,"CODE",{});var FL=r(Fg);$2=i(FL,"True"),FL.forEach(o),M2=i(X," for this "),Lg=n(X,"CODE",{});var LL=r(Lg);x2=i(LL,"LogitsWarper"),LL.forEach(o),E2=i(X," to work."),X.forEach(o),j2=l(bn),u(ms.$$.fragment,bn),F2=l(bn),vl=n(bn,"DIV",{class:!0});var zL=r(vl);u(Er.$$.fragment,zL),zL.forEach(o),bn.forEach(o),ob=l(t),_e=n(t,"DIV",{class:!0});var yn=r(_e);u(jr.$$.fragment,yn),L2=l(yn),Fe=n(yn,"P",{});var Ro=r(Fe);wl=n(Ro,"A",{href:!0});var UL=r(wl);z2=i(UL,"LogitsProcessor"),UL.forEach(o),U2=i(Ro," that exponentially increases the score of the "),zg=n(Ro,"CODE",{});var JL=r(zg);J2=i(JL,"eos_token_id"),JL.forEach(o),I2=i(Ro," after "),Ug=n(Ro,"CODE",{});var IL=r(Ug);B2=i(IL,"start_index"),IL.forEach(o),q2=i(Ro,` has been
reached. This allows generating shorter sequences without having a hard cutoff, allowing the `),Jg=n(Ro,"CODE",{});var BL=r(Jg);S2=i(BL,"eos_token"),BL.forEach(o),W2=i(Ro,` to be
predicted in a meaningful position.`),Ro.forEach(o),D2=l(yn),u(hs.$$.fragment,yn),P2=l(yn),kl=n(yn,"DIV",{class:!0});var qL=r(kl);u(Fr.$$.fragment,qL),qL.forEach(o),yn.forEach(o),sb=l(t),Ce=n(t,"DIV",{class:!0});var gm=r(Ce);u(Lr.$$.fragment,gm),V2=l(gm),$l=n(gm,"P",{});var _5=r($l);Ml=n(_5,"A",{href:!0});var SL=r(Ml);Z2=i(SL,"LogitsProcessor"),SL.forEach(o),G2=i(_5," that enforces the specified token as the first generated token."),_5.forEach(o),C2=l(gm),xl=n(gm,"DIV",{class:!0});var WL=r(xl);u(zr.$$.fragment,WL),WL.forEach(o),gm.forEach(o),nb=l(t),Ne=n(t,"DIV",{class:!0});var um=r(Ne);u(Ur.$$.fragment,um),N2=l(um),gs=n(um,"P",{});var Qf=r(gs);El=n(Qf,"A",{href:!0});var DL=r(El);X2=i(DL,"LogitsProcessor"),DL.forEach(o),R2=i(Qf," that enforces the specified token as the last generated token when "),Ig=n(Qf,"CODE",{});var PL=r(Ig);O2=i(PL,"max_length"),PL.forEach(o),A2=i(Qf," is reached."),Qf.forEach(o),H2=l(um),jl=n(um,"DIV",{class:!0});var VL=r(jl);u(Jr.$$.fragment,VL),VL.forEach(o),um.forEach(o),rb=l(t),Xe=n(t,"DIV",{class:!0});var fm=r(Xe);u(Ir.$$.fragment,fm),Q2=l(fm),Br=n(fm,"P",{});var nT=r(Br);Y2=i(nT,`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 `),Bg=n(nT,"CODE",{});var ZL=r(Bg);K2=i(ZL,"inf"),ZL.forEach(o),ek=i(nT,` so that they are
sampled at their corresponding index.`),nT.forEach(o),tk=l(fm),Fl=n(fm,"DIV",{class:!0});var GL=r(Fl);u(qr.$$.fragment,GL),GL.forEach(o),fm.forEach(o),ab=l(t),L=n(t,"DIV",{class:!0});var U=r(L);u(Sr.$$.fragment,U),ok=l(U),Ll=n(U,"P",{});var b5=r(Ll);zl=n(b5,"A",{href:!0});var CL=r(zl);sk=i(CL,"LogitsProcessor"),CL.forEach(o),nk=i(b5," that enforces diverse beam search."),b5.forEach(o),rk=l(U),zo=n(U,"P",{});var _m=r(zo);ak=i(_m,"Note that this logits processor is only effective for "),Ul=n(_m,"A",{href:!0});var NL=r(Ul);ik=i(NL,"PreTrainedModel.group_beam_search()"),NL.forEach(o),ck=i(_m,". See "),Wr=n(_m,"A",{href:!0,rel:!0});var XL=r(Wr);lk=i(XL,`Diverse Beam
Search: Decoding Diverse Solutions from Neural Sequence Models`),XL.forEach(o),dk=i(_m,` for more
details.`),_m.forEach(o),pk=l(U),u(us.$$.fragment,U),mk=l(U),u(fs.$$.fragment,U),hk=l(U),Dr=n(U,"P",{});var rT=r(Dr);gk=i(rT,`Traditional beam search often generates very similar sequences across different beams.
`),qg=n(rT,"CODE",{});var RL=r(qg);uk=i(RL,"HammingDiversityLogitsProcessor"),RL.forEach(o),fk=i(rT,` addresses this by penalizing beams that generate tokens already chosen by other
beams in the same time step.`),rT.forEach(o),_k=l(U),Sg=n(U,"P",{});var OL=r(Sg);bk=i(OL,"How It Works:"),OL.forEach(o),yk=l(U),Uo=n(U,"UL",{});var bm=r(Uo);Jl=n(bm,"LI",{});var y5=r(Jl);Wg=n(y5,"STRONG",{});var AL=r(Wg);Tk=i(AL,"Grouping Beams"),AL.forEach(o),vk=i(y5,": Beams are divided into groups. Each group selects tokens independently of the others."),y5.forEach(o),wk=l(bm),Il=n(bm,"LI",{});var T5=r(Il);Dg=n(T5,"STRONG",{});var HL=r(Dg);kk=i(HL,"Penalizing Repeated Tokens"),HL.forEach(o),$k=i(T5,`: 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.`),T5.forEach(o),Mk=l(bm),Bl=n(bm,"LI",{});var v5=r(Bl);Pg=n(v5,"STRONG",{});var QL=r(Pg);xk=i(QL,"Promoting Diversity"),QL.forEach(o),Ek=i(v5,`: This penalty discourages beams within a group from selecting the same tokens as
beams in other groups.`),v5.forEach(o),bm.forEach(o),jk=l(U),Vg=n(U,"P",{});var YL=r(Vg);Fk=i(YL,"Benefits:"),YL.forEach(o),Lk=l(U),Pr=n(U,"UL",{});var aT=r(Pr);ql=n(aT,"LI",{});var w5=r(ql);Zg=n(w5,"STRONG",{});var KL=r(Zg);zk=i(KL,"Diverse Outputs"),KL.forEach(o),Uk=i(w5,": Produces a variety of different sequences."),w5.forEach(o),Jk=l(aT),Sl=n(aT,"LI",{});var k5=r(Sl);Gg=n(k5,"STRONG",{});var ez=r(Gg);Ik=i(ez,"Exploration"),ez.forEach(o),Bk=i(k5,": Allows the model to explore different paths."),k5.forEach(o),aT.forEach(o),qk=l(U),u(_s.$$.fragment,U),Sk=l(U),Wl=n(U,"DIV",{class:!0});var tz=r(Wl);u(Vr.$$.fragment,tz),tz.forEach(o),U.forEach(o),ib=l(t),Re=n(t,"DIV",{class:!0});var ym=r(Re);u(Zr.$$.fragment,ym),Wk=l(ym),Zt=n(ym,"P",{});var Rc=r(Zt);Dl=n(Rc,"A",{href:!0});var oz=r(Dl);Dk=i(oz,"LogitsProcessor"),oz.forEach(o),Pk=i(Rc," that removes all "),Cg=n(Rc,"CODE",{});var sz=r(Cg);Vk=i(sz,"nan"),sz.forEach(o),Zk=i(Rc," and "),Ng=n(Rc,"CODE",{});var nz=r(Ng);Gk=i(nz,"inf"),nz.forEach(o),Ck=i(Rc,` 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.`),Rc.forEach(o),Nk=l(ym),Pl=n(ym,"DIV",{class:!0});var rz=r(Pl);u(Gr.$$.fragment,rz),rz.forEach(o),ym.forEach(o),cb=l(t),Oe=n(t,"DIV",{class:!0});var Tm=r(Oe);u(Cr.$$.fragment,Tm),Xk=l(Tm),bs=n(Tm,"P",{});var Yf=r(bs);Vl=n(Yf,"A",{href:!0});var az=r(Vl);Rk=i(az,"LogitsWarper"),az.forEach(o),Ok=i(Yf," and "),Zl=n(Yf,"A",{href:!0});var iz=r(Zl);Ak=i(iz,"LogitsProcessor"),iz.forEach(o),Hk=i(Yf,` 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.`),Yf.forEach(o),Qk=l(Tm),Gl=n(Tm,"DIV",{class:!0});var cz=r(Gl);u(Nr.$$.fragment,cz),cz.forEach(o),Tm.forEach(o),lb=l(t),Ae=n(t,"DIV",{class:!0});var vm=r(Ae);u(Xr.$$.fragment,vm),Yk=l(vm),Xg=n(vm,"P",{});var lz=r(Xg);Kk=i(lz,"Abstract base class for all logit processors that can be applied during generation."),lz.forEach(o),e$=l(vm),Cl=n(vm,"DIV",{class:!0});var dz=r(Cl);u(Rr.$$.fragment,dz),dz.forEach(o),vm.forEach(o),db=l(t),He=n(t,"DIV",{class:!0});var wm=r(He);u(Or.$$.fragment,wm),t$=l(wm),G=n(wm,"P",{});var de=r(G);o$=i(de,"This class can be used to create a list of "),Nl=n(de,"A",{href:!0});var pz=r(Nl);s$=i(pz,"LogitsProcessor"),pz.forEach(o),n$=i(de," or "),Xl=n(de,"A",{href:!0});var mz=r(Xl);r$=i(mz,"LogitsWarper"),mz.forEach(o),a$=i(de,` to subsequently process a
`),Rg=n(de,"CODE",{});var hz=r(Rg);i$=i(hz,"scores"),hz.forEach(o),c$=i(de," input tensor. This class inherits from list and adds a specific "),Og=n(de,"EM",{});var gz=r(Og);Ag=n(gz,"STRONG",{});var uz=r(Ag);l$=i(uz,"call"),uz.forEach(o),gz.forEach(o),d$=i(de,` method to apply each
`),Rl=n(de,"A",{href:!0});var fz=r(Rl);p$=i(fz,"LogitsProcessor"),fz.forEach(o),m$=i(de," or "),Ol=n(de,"A",{href:!0});var _z=r(Ol);h$=i(_z,"LogitsWarper"),_z.forEach(o),g$=i(de," to the inputs."),de.forEach(o),u$=l(wm),Al=n(wm,"DIV",{class:!0});var bz=r(Al);u(Ar.$$.fragment,bz),bz.forEach(o),wm.forEach(o),pb=l(t),Qe=n(t,"DIV",{class:!0});var km=r(Qe);u(Hr.$$.fragment,km),f$=l(km),Hg=n(km,"P",{});var yz=r(Hg);_$=i(yz,"Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),yz.forEach(o),b$=l(km),Hl=n(km,"DIV",{class:!0});var Tz=r(Hl);u(Qr.$$.fragment,Tz),Tz.forEach(o),km.forEach(o),mb=l(t),Ye=n(t,"DIV",{class:!0});var $m=r(Ye);u(Yr.$$.fragment,$m),y$=l($m),Ql=n($m,"P",{});var $5=r(Ql);Yl=n($5,"A",{href:!0});var vz=r(Yl);T$=i(vz,"LogitsProcessor"),vz.forEach(o),v$=i($5," enforcing a min-length by setting EOS probability to 0."),$5.forEach(o),w$=l($m),Kl=n($m,"DIV",{class:!0});var wz=r(Kl);u(Kr.$$.fragment,wz),wz.forEach(o),$m.forEach(o),hb=l(t),be=n(t,"DIV",{class:!0});var Tn=r(be);u(ea.$$.fragment,Tn),k$=l(Tn),Le=n(Tn,"P",{});var Oo=r(Le);ed=n(Oo,"A",{href:!0});var kz=r(ed);$$=i(kz,"LogitsProcessor"),kz.forEach(o),M$=i(Oo,` 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, `),Qg=n(Oo,"CODE",{});var $z=r(Qg);x$=i($z,"min_length"),$z.forEach(o),E$=i(Oo," will compute the length of "),Yg=n(Oo,"CODE",{});var Mz=r(Yg);j$=i(Mz,"prompt + newly generated tokens"),Mz.forEach(o),F$=i(Oo," whereas for other models it will behave as "),Kg=n(Oo,"CODE",{});var xz=r(Kg);L$=i(xz,"min_new_tokens"),xz.forEach(o),z$=i(Oo,`, that is, taking only into account
the newly generated ones.`),Oo.forEach(o),U$=l(Tn),u(ys.$$.fragment,Tn),J$=l(Tn),td=n(Tn,"DIV",{class:!0});var Ez=r(td);u(ta.$$.fragment,Ez),Ez.forEach(o),Tn.forEach(o),gb=l(t),H=n(t,"DIV",{class:!0});var Rt=r(H);u(oa.$$.fragment,Rt),I$=l(Rt),od=n(Rt,"P",{});var M5=r(od);sd=n(M5,"A",{href:!0});var jz=r(sd);B$=i(jz,"LogitsProcessor"),jz.forEach(o),q$=i(M5," that enforces that specified sequences will never be selected."),M5.forEach(o),S$=l(Rt),u(Ts.$$.fragment,Rt),W$=l(Rt),u(vs.$$.fragment,Rt),D$=l(Rt),nd=n(Rt,"DIV",{class:!0});var Fz=r(nd);u(sa.$$.fragment,Fz),Fz.forEach(o),Rt.forEach(o),ub=l(t),Q=n(t,"DIV",{class:!0});var Ot=r(Q);u(na.$$.fragment,Ot),P$=l(Ot),Jo=n(Ot,"P",{});var Mm=r(Jo);V$=i(Mm,`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 `),rd=n(Mm,"A",{href:!0});var Lz=r(rd);Z$=i(Lz,"LogitsProcessor"),Lz.forEach(o),G$=i(Mm,` 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.
`),ra=n(Mm,"A",{href:!0,rel:!0});var zz=r(ra);C$=i(zz,"Fairseq"),zz.forEach(o),N$=i(Mm,"."),Mm.forEach(o),X$=l(Ot),u(ws.$$.fragment,Ot),R$=l(Ot),u(ks.$$.fragment,Ot),O$=l(Ot),ad=n(Ot,"DIV",{class:!0});var Uz=r(ad);u(aa.$$.fragment,Uz),Uz.forEach(o),Ot.forEach(o),fb=l(t),Ke=n(t,"DIV",{class:!0});var xm=r(Ke);u(ia.$$.fragment,xm),A$=l(xm),$s=n(xm,"P",{});var Kf=r($s);id=n(Kf,"A",{href:!0});var Jz=r(id);H$=i(Jz,"LogitsProcessor"),Jz.forEach(o),Q$=i(Kf,` that enforces constrained generation and is useful for prefix-conditioned constrained
generation. See `),ca=n(Kf,"A",{href:!0,rel:!0});var Iz=r(ca);Y$=i(Iz,"Autoregressive Entity Retrieval"),Iz.forEach(o),K$=i(Kf," for more information."),Kf.forEach(o),e0=l(xm),cd=n(xm,"DIV",{class:!0});var Bz=r(cd);u(la.$$.fragment,Bz),Bz.forEach(o),xm.forEach(o),_b=l(t),ye=n(t,"DIV",{class:!0});var vn=r(ye);u(da.$$.fragment,vn),t0=l(vn),Ms=n(vn,"P",{});var e_=r(Ms);ld=n(e_,"A",{href:!0});var qz=r(ld);o0=i(qz,"LogitsProcessor"),qz.forEach(o),s0=i(e_,` 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 more likely to be
selected. The formula can be seen in the original `),pa=n(e_,"A",{href:!0,rel:!0});var Sz=r(pa);n0=i(Sz,"paper"),Sz.forEach(o),r0=i(e_,`. According to the
paper a penalty of around 1.2 yields a good balance between truthful generation and lack of repetition.`),e_.forEach(o),a0=l(vn),u(xs.$$.fragment,vn),i0=l(vn),dd=n(vn,"DIV",{class:!0});var Wz=r(dd);u(ma.$$.fragment,Wz),Wz.forEach(o),vn.forEach(o),bb=l(t),Y=n(t,"DIV",{class:!0});var At=r(Y);u(ha.$$.fragment,At),c0=l(At),pd=n(At,"P",{});var x5=r(pd);md=n(x5,"A",{href:!0});var Dz=r(md);l0=i(Dz,"LogitsProcessor"),Dz.forEach(o),d0=i(x5,` 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).`),x5.forEach(o),p0=l(At),u(Es.$$.fragment,At),m0=l(At),u(js.$$.fragment,At),h0=l(At),hd=n(At,"DIV",{class:!0});var Pz=r(hd);u(ga.$$.fragment,Pz),Pz.forEach(o),At.forEach(o),yb=l(t),et=n(t,"DIV",{class:!0});var Em=r(et);u(ua.$$.fragment,Em),g0=l(Em),ze=n(Em,"P",{});var Ao=r(ze);gd=n(Ao,"A",{href:!0});var Vz=r(gd);u0=i(Vz,"SuppressTokensAtBeginLogitsProcessor"),Vz.forEach(o),f0=i(Ao," supresses a list of tokens as soon as the "),eu=n(Ao,"CODE",{});var Zz=r(eu);_0=i(Zz,"generate"),Zz.forEach(o),b0=i(Ao,` function starts
generating using `),tu=n(Ao,"CODE",{});var Gz=r(tu);y0=i(Gz,"begin_index"),Gz.forEach(o),T0=i(Ao," tokens. This should ensure that the tokens defined by "),ou=n(Ao,"CODE",{});var Cz=r(ou);v0=i(Cz,"begin_suppress_tokens"),Cz.forEach(o),w0=i(Ao,` at not
sampled at the begining of the generation.`),Ao.forEach(o),k0=l(Em),ud=n(Em,"DIV",{class:!0});var Nz=r(ud);u(fa.$$.fragment,Nz),Nz.forEach(o),Em.forEach(o),Tb=l(t),tt=n(t,"DIV",{class:!0});var jm=r(tt);u(_a.$$.fragment,jm),$0=l(jm),ba=n(jm,"P",{});var iT=r(ba);M0=i(iT,"This processor can be used to suppress a list of tokens. The processor will set their log probs to "),su=n(iT,"CODE",{});var Xz=r(su);x0=i(Xz,"-inf"),Xz.forEach(o),E0=i(iT,` so that they
are not sampled.`),iT.forEach(o),j0=l(jm),fd=n(jm,"DIV",{class:!0});var Rz=r(fd);u(ya.$$.fragment,Rz),Rz.forEach(o),jm.forEach(o),vb=l(t),K=n(t,"DIV",{class:!0});var Ht=r(K);u(Ta.$$.fragment,Ht),F0=l(Ht),_d=n(Ht,"P",{});var E5=r(_d);bd=n(E5,"A",{href:!0});var Oz=r(bd);L0=i(Oz,"LogitsWarper"),Oz.forEach(o),z0=i(E5,` for temperature (exponential scaling output probability distribution), which effectively means
that it can control the randomness of the predicted tokens.`),E5.forEach(o),U0=l(Ht),u(Fs.$$.fragment,Ht),J0=l(Ht),u(Ls.$$.fragment,Ht),I0=l(Ht),yd=n(Ht,"DIV",{class:!0});var Az=r(yd);u(va.$$.fragment,Az),Az.forEach(o),Ht.forEach(o),wb=l(t),ot=n(t,"DIV",{class:!0});var Fm=r(ot);u(wa.$$.fragment,Fm),B0=l(Fm),Td=n(Fm,"P",{});var j5=r(Td);vd=n(j5,"A",{href:!0});var Hz=r(vd);q0=i(Hz,"LogitsWarper"),Hz.forEach(o),S0=i(j5," that performs top-k, i.e. restricting to the k highest probability elements."),j5.forEach(o),W0=l(Fm),wd=n(Fm,"DIV",{class:!0});var Qz=r(wd);u(ka.$$.fragment,Qz),Qz.forEach(o),Fm.forEach(o),kb=l(t),Te=n(t,"DIV",{class:!0});var wn=r(Te);u($a.$$.fragment,wn),D0=l(wn),kd=n(wn,"P",{});var F5=r(kd);$d=n(F5,"A",{href:!0});var Yz=r($d);P0=i(Yz,"LogitsWarper"),Yz.forEach(o),V0=i(F5," that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),F5.forEach(o),Z0=l(wn),u(zs.$$.fragment,wn),G0=l(wn),Md=n(wn,"DIV",{class:!0});var Kz=r(Md);u(Ma.$$.fragment,Kz),Kz.forEach(o),wn.forEach(o),$b=l(t),st=n(t,"DIV",{class:!0});var Lm=r(st);u(xa.$$.fragment,Lm),C0=l(Lm),Us=n(Lm,"P",{});var t_=r(Us);xd=n(t_,"A",{href:!0});var eU=r(xd);N0=i(eU,"LogitsWarper"),eU.forEach(o),X0=i(t_," that performs typical decoding. See "),Ea=n(t_,"A",{href:!0,rel:!0});var tU=r(Ea);R0=i(tU,`Typical Decoding for Natural Language
Generation`),tU.forEach(o),O0=i(t_," for more information."),t_.forEach(o),A0=l(Lm),Ed=n(Lm,"DIV",{class:!0});var oU=r(Ed);u(ja.$$.fragment,oU),oU.forEach(o),Lm.forEach(o),Mb=l(t),ee=n(t,"DIV",{class:!0});var Qt=r(ee);u(Fa.$$.fragment,Qt),H0=l(Qt),nt=n(Qt,"P",{});var kn=r(nt);Q0=i(kn,`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 `),nu=n(kn,"CODE",{});var sU=r(nu);Y0=i(sU,"guidance_scale"),sU.forEach(o),K0=i(kn,". The unconditional scores are computed internally by prompting "),ru=n(kn,"CODE",{});var nU=r(ru);eM=i(nU,"model"),nU.forEach(o),tM=i(kn,` with
the `),au=n(kn,"CODE",{});var rU=r(au);oM=i(rU,"unconditional_ids"),rU.forEach(o),sM=i(kn," branch."),kn.forEach(o),nM=l(Qt),La=n(Qt,"P",{});var cT=r(La);rM=i(cT,"See "),za=n(cT,"A",{href:!0,rel:!0});var aU=r(za);aM=i(aU,"the paper"),aU.forEach(o),iM=i(cT," for more information."),cT.forEach(o),cM=l(Qt),u(Js.$$.fragment,Qt),lM=l(Qt),jd=n(Qt,"DIV",{class:!0});var iU=r(jd);u(Ua.$$.fragment,iU),iU.forEach(o),Qt.forEach(o),xb=l(t),ve=n(t,"DIV",{class:!0});var $n=r(ve);u(Ja.$$.fragment,$n),dM=l($n),Ia=n($n,"P",{});var lT=r(Ia);pM=i(lT,`Whisper specific Processor. This processor can be used to force a list of tokens. The processor will set their log
probs to `),iu=n(lT,"CODE",{});var cU=r(iu);mM=i(cU,"inf"),cU.forEach(o),hM=i(lT," so that they are sampled at their corresponding index."),lT.forEach(o),gM=l($n),Ba=n($n,"P",{});var dT=r(Ba);uM=i(dT,"See "),qa=n(dT,"A",{href:!0,rel:!0});var lU=r(qa);fM=i(lU,"the paper"),lU.forEach(o),_M=i(dT," for more information."),dT.forEach(o),bM=l($n),Fd=n($n,"DIV",{class:!0});var dU=r(Fd);u(Sa.$$.fragment,dU),dU.forEach(o),$n.forEach(o),Eb=l(t),Io=n(t,"H3",{class:!0});var pT=r(Io);Is=n(pT,"A",{id:!0,class:!0,href:!0});var pU=r(Is);cu=n(pU,"SPAN",{});var mU=r(cu);u(Wa.$$.fragment,mU),mU.forEach(o),pU.forEach(o),yM=l(pT),lu=n(pT,"SPAN",{});var hU=r(lu);TM=i(hU,"TensorFlow"),hU.forEach(o),pT.forEach(o),jb=l(t),rt=n(t,"DIV",{class:!0});var zm=r(rt);u(Da.$$.fragment,zm),vM=l(zm),Ld=n(zm,"P",{});var L5=r(Ld);zd=n(L5,"A",{href:!0});var gU=r(zd);wM=i(gU,"TFLogitsProcessor"),gU.forEach(o),kM=i(L5," that enforces the specified token as the first generated token."),L5.forEach(o),$M=l(zm),Ud=n(zm,"DIV",{class:!0});var uU=r(Ud);u(Pa.$$.fragment,uU),uU.forEach(o),zm.forEach(o),Fb=l(t),at=n(t,"DIV",{class:!0});var Um=r(at);u(Va.$$.fragment,Um),MM=l(Um),Bs=n(Um,"P",{});var o_=r(Bs);Jd=n(o_,"A",{href:!0});var fU=r(Jd);xM=i(fU,"TFLogitsProcessor"),fU.forEach(o),EM=i(o_," that enforces the specified token as the last generated token when "),du=n(o_,"CODE",{});var _U=r(du);jM=i(_U,"max_length"),_U.forEach(o),FM=i(o_," is reached."),o_.forEach(o),LM=l(Um),Id=n(Um,"DIV",{class:!0});var bU=r(Id);u(Za.$$.fragment,bU),bU.forEach(o),Um.forEach(o),Lb=l(t),it=n(t,"DIV",{class:!0});var Jm=r(it);u(Ga.$$.fragment,Jm),zM=l(Jm),Bo=n(Jm,"P",{});var Im=r(Bo);UM=i(Im,`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 `),pu=n(Im,"CODE",{});var yU=r(pu);JM=i(yU,"0"),yU.forEach(o),IM=i(Im,` and all other tokens to
`),mu=n(Im,"CODE",{});var TU=r(mu);BM=i(TU,"-inf"),TU.forEach(o),qM=i(Im," so that they are sampled at their corresponding index."),Im.forEach(o),SM=l(Jm),Bd=n(Jm,"DIV",{class:!0});var vU=r(Bd);u(Ca.$$.fragment,vU),vU.forEach(o),Jm.forEach(o),zb=l(t),ct=n(t,"DIV",{class:!0});var Bm=r(ct);u(Na.$$.fragment,Bm),WM=l(Bm),hu=n(Bm,"P",{});var wU=r(hu);DM=i(wU,"Abstract base class for all logit processors that can be applied during generation."),wU.forEach(o),PM=l(Bm),qs=n(Bm,"DIV",{class:!0});var mT=r(qs);u(Xa.$$.fragment,mT),VM=l(mT),gu=n(mT,"P",{});var kU=r(gu);ZM=i(kU,"TF method for processing logits."),kU.forEach(o),mT.forEach(o),Bm.forEach(o),Ub=l(t),lt=n(t,"DIV",{class:!0});var qm=r(lt);u(Ra.$$.fragment,qm),GM=l(qm),we=n(qm,"P",{});var Yt=r(we);CM=i(Yt,"This class can be used to create a list of "),qd=n(Yt,"A",{href:!0});var $U=r(qd);NM=i($U,"TFLogitsProcessor"),$U.forEach(o),XM=i(Yt," to subsequently process a "),uu=n(Yt,"CODE",{});var MU=r(uu);RM=i(MU,"scores"),MU.forEach(o),OM=i(Yt,` input tensor.
This class inherits from list and adds a specific `),fu=n(Yt,"EM",{});var xU=r(fu);_u=n(xU,"STRONG",{});var EU=r(_u);AM=i(EU,"call"),EU.forEach(o),xU.forEach(o),HM=i(Yt," method to apply each "),Sd=n(Yt,"A",{href:!0});var jU=r(Sd);QM=i(jU,"TFLogitsProcessor"),jU.forEach(o),YM=i(Yt,` to the
inputs.`),Yt.forEach(o),KM=l(qm),Wd=n(qm,"DIV",{class:!0});var FU=r(Wd);u(Oa.$$.fragment,FU),FU.forEach(o),qm.forEach(o),Jb=l(t),dt=n(t,"DIV",{class:!0});var Sm=r(dt);u(Aa.$$.fragment,Sm),ex=l(Sm),bu=n(Sm,"P",{});var LU=r(bu);tx=i(LU,"Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),LU.forEach(o),ox=l(Sm),Ss=n(Sm,"DIV",{class:!0});var hT=r(Ss);u(Ha.$$.fragment,hT),sx=l(hT),yu=n(hT,"P",{});var zU=r(yu);nx=i(zU,"TF method for warping logits."),zU.forEach(o),hT.forEach(o),Sm.forEach(o),Ib=l(t),pt=n(t,"DIV",{class:!0});var Wm=r(pt);u(Qa.$$.fragment,Wm),rx=l(Wm),Dd=n(Wm,"P",{});var z5=r(Dd);Pd=n(z5,"A",{href:!0});var UU=r(Pd);ax=i(UU,"TFLogitsProcessor"),UU.forEach(o),ix=i(z5," enforcing a min-length by setting EOS probability to 0."),z5.forEach(o),cx=l(Wm),Vd=n(Wm,"DIV",{class:!0});var JU=r(Vd);u(Ya.$$.fragment,JU),JU.forEach(o),Wm.forEach(o),Bb=l(t),mt=n(t,"DIV",{class:!0});var Dm=r(mt);u(Ka.$$.fragment,Dm),lx=l(Dm),Zd=n(Dm,"P",{});var U5=r(Zd);Gd=n(U5,"A",{href:!0});var IU=r(Gd);dx=i(IU,"TFLogitsProcessor"),IU.forEach(o),px=i(U5," that enforces that specified sequences will never be sampled."),U5.forEach(o),mx=l(Dm),Cd=n(Dm,"DIV",{class:!0});var BU=r(Cd);u(ei.$$.fragment,BU),BU.forEach(o),Dm.forEach(o),qb=l(t),ht=n(t,"DIV",{class:!0});var Pm=r(ht);u(ti.$$.fragment,Pm),hx=l(Pm),Ws=n(Pm,"P",{});var s_=r(Ws);Nd=n(s_,"A",{href:!0});var qU=r(Nd);gx=i(qU,"TFLogitsProcessor"),qU.forEach(o),ux=i(s_,` that enforces no repetition of n-grams. See
`),oi=n(s_,"A",{href:!0,rel:!0});var SU=r(oi);fx=i(SU,"Fairseq"),SU.forEach(o),_x=i(s_,"."),s_.forEach(o),bx=l(Pm),Xd=n(Pm,"DIV",{class:!0});var WU=r(Xd);u(si.$$.fragment,WU),WU.forEach(o),Pm.forEach(o),Sb=l(t),gt=n(t,"DIV",{class:!0});var Vm=r(gt);u(ni.$$.fragment,Vm),yx=l(Vm),Rd=n(Vm,"P",{});var J5=r(Rd);Od=n(J5,"A",{href:!0});var DU=r(Od);Tx=i(DU,"TFLogitsProcessor"),DU.forEach(o),vx=i(J5," enforcing an exponential penalty on repeated sequences."),J5.forEach(o),wx=l(Vm),Ad=n(Vm,"DIV",{class:!0});var PU=r(Ad);u(ri.$$.fragment,PU),PU.forEach(o),Vm.forEach(o),Wb=l(t),ut=n(t,"DIV",{class:!0});var Zm=r(ut);u(ai.$$.fragment,Zm),kx=l(Zm),Ue=n(Zm,"P",{});var Ho=r(Ue);Hd=n(Ho,"A",{href:!0});var VU=r(Hd);$x=i(VU,"TFSuppressTokensAtBeginLogitsProcessor"),VU.forEach(o),Mx=i(Ho," suppresses a list of tokens as soon as the "),Tu=n(Ho,"CODE",{});var ZU=r(Tu);xx=i(ZU,"generate"),ZU.forEach(o),Ex=i(Ho,` function starts
generating using `),vu=n(Ho,"CODE",{});var GU=r(vu);jx=i(GU,"begin_index"),GU.forEach(o),Fx=i(Ho," tokens. This should ensure that the tokens defined by "),wu=n(Ho,"CODE",{});var CU=r(wu);Lx=i(CU,"begin_suppress_tokens"),CU.forEach(o),zx=i(Ho,` at not
sampled at the begining of the generation.`),Ho.forEach(o),Ux=l(Zm),Qd=n(Zm,"DIV",{class:!0});var NU=r(Qd);u(ii.$$.fragment,NU),NU.forEach(o),Zm.forEach(o),Db=l(t),ft=n(t,"DIV",{class:!0});var Gm=r(ft);u(ci.$$.fragment,Gm),Jx=l(Gm),li=n(Gm,"P",{});var gT=r(li);Ix=i(gT,"This processor can be used to suppress a list of tokens. The processor will set their log probs to "),ku=n(gT,"CODE",{});var XU=r(ku);Bx=i(XU,"-inf"),XU.forEach(o),qx=i(gT,` so that they
are not sampled.`),gT.forEach(o),Sx=l(Gm),Yd=n(Gm,"DIV",{class:!0});var RU=r(Yd);u(di.$$.fragment,RU),RU.forEach(o),Gm.forEach(o),Pb=l(t),_t=n(t,"DIV",{class:!0});var Cm=r(_t);u(pi.$$.fragment,Cm),Wx=l(Cm),Kd=n(Cm,"P",{});var I5=r(Kd);ep=n(I5,"A",{href:!0});var OU=r(ep);Dx=i(OU,"TFLogitsWarper"),OU.forEach(o),Px=i(I5," for temperature (exponential scaling output probability distribution)."),I5.forEach(o),Vx=l(Cm),tp=n(Cm,"DIV",{class:!0});var AU=r(tp);u(mi.$$.fragment,AU),AU.forEach(o),Cm.forEach(o),Vb=l(t),bt=n(t,"DIV",{class:!0});var Nm=r(bt);u(hi.$$.fragment,Nm),Zx=l(Nm),op=n(Nm,"P",{});var B5=r(op);sp=n(B5,"A",{href:!0});var HU=r(sp);Gx=i(HU,"TFLogitsWarper"),HU.forEach(o),Cx=i(B5," that performs top-k, i.e. restricting to the k highest probability elements."),B5.forEach(o),Nx=l(Nm),np=n(Nm,"DIV",{class:!0});var QU=r(np);u(gi.$$.fragment,QU),QU.forEach(o),Nm.forEach(o),Zb=l(t),yt=n(t,"DIV",{class:!0});var Xm=r(yt);u(ui.$$.fragment,Xm),Xx=l(Xm),rp=n(Xm,"P",{});var q5=r(rp);ap=n(q5,"A",{href:!0});var YU=r(ap);Rx=i(YU,"TFLogitsWarper"),YU.forEach(o),Ox=i(q5," that performs top-p, i.e. restricting to top tokens summing to <= prob_cut_off."),q5.forEach(o),Ax=l(Xm),ip=n(Xm,"DIV",{class:!0});var KU=r(ip);u(fi.$$.fragment,KU),KU.forEach(o),Xm.forEach(o),Gb=l(t),qo=n(t,"H3",{class:!0});var uT=r(qo);Ds=n(uT,"A",{id:!0,class:!0,href:!0});var eJ=r(Ds);$u=n(eJ,"SPAN",{});var tJ=r($u);u(_i.$$.fragment,tJ),tJ.forEach(o),eJ.forEach(o),Hx=l(uT),Mu=n(uT,"SPAN",{});var oJ=r(Mu);Qx=i(oJ,"FLAX"),oJ.forEach(o),uT.forEach(o),Cb=l(t),Tt=n(t,"DIV",{class:!0});var Rm=r(Tt);u(bi.$$.fragment,Rm),Yx=l(Rm),cp=n(Rm,"P",{});var S5=r(cp);lp=n(S5,"A",{href:!0});var sJ=r(lp);Kx=i(sJ,"FlaxLogitsProcessor"),sJ.forEach(o),e4=i(S5," that enforces the specified token as the first generated token."),S5.forEach(o),t4=l(Rm),dp=n(Rm,"DIV",{class:!0});var nJ=r(dp);u(yi.$$.fragment,nJ),nJ.forEach(o),Rm.forEach(o),Nb=l(t),vt=n(t,"DIV",{class:!0});var Om=r(vt);u(Ti.$$.fragment,Om),o4=l(Om),Ps=n(Om,"P",{});var n_=r(Ps);pp=n(n_,"A",{href:!0});var rJ=r(pp);s4=i(rJ,"FlaxLogitsProcessor"),rJ.forEach(o),n4=i(n_," that enforces the specified token as the last generated token when "),xu=n(n_,"CODE",{});var aJ=r(xu);r4=i(aJ,"max_length"),aJ.forEach(o),a4=i(n_," is reached."),n_.forEach(o),i4=l(Om),mp=n(Om,"DIV",{class:!0});var iJ=r(mp);u(vi.$$.fragment,iJ),iJ.forEach(o),Om.forEach(o),Xb=l(t),wt=n(t,"DIV",{class:!0});var Am=r(wt);u(wi.$$.fragment,Am),c4=l(Am),Vs=n(Am,"P",{});var r_=r(Vs);hp=n(r_,"A",{href:!0});var cJ=r(hp);l4=i(cJ,"FlaxLogitsProcessor"),cJ.forEach(o),d4=i(r_,` 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 `),Eu=n(r_,"CODE",{});var lJ=r(Eu);p4=i(lJ,"-inf"),lJ.forEach(o),m4=i(r_," so that they are sampled at their corresponding index."),r_.forEach(o),h4=l(Am),gp=n(Am,"DIV",{class:!0});var dJ=r(gp);u(ki.$$.fragment,dJ),dJ.forEach(o),Am.forEach(o),Rb=l(t),kt=n(t,"DIV",{class:!0});var Hm=r(kt);u($i.$$.fragment,Hm),g4=l(Hm),ju=n(Hm,"P",{});var pJ=r(ju);u4=i(pJ,"Abstract base class for all logit processors that can be applied during generation."),pJ.forEach(o),f4=l(Hm),Zs=n(Hm,"DIV",{class:!0});var fT=r(Zs);u(Mi.$$.fragment,fT),_4=l(fT),Fu=n(fT,"P",{});var mJ=r(Fu);b4=i(mJ,"Flax method for processing logits."),mJ.forEach(o),fT.forEach(o),Hm.forEach(o),Ob=l(t),$t=n(t,"DIV",{class:!0});var Qm=r($t);u(xi.$$.fragment,Qm),y4=l(Qm),C=n(Qm,"P",{});var pe=r(C);T4=i(pe,"This class can be used to create a list of "),up=n(pe,"A",{href:!0});var hJ=r(up);v4=i(hJ,"FlaxLogitsProcessor"),hJ.forEach(o),w4=i(pe," or "),fp=n(pe,"A",{href:!0});var gJ=r(fp);k4=i(gJ,"FlaxLogitsWarper"),gJ.forEach(o),$4=i(pe,` to subsequently process
a `),Lu=n(pe,"CODE",{});var uJ=r(Lu);M4=i(uJ,"scores"),uJ.forEach(o),x4=i(pe," input tensor. This class inherits from list and adds a specific "),zu=n(pe,"EM",{});var fJ=r(zu);Uu=n(fJ,"STRONG",{});var _J=r(Uu);E4=i(_J,"call"),_J.forEach(o),fJ.forEach(o),j4=i(pe,` method to apply each
`),_p=n(pe,"A",{href:!0});var bJ=r(_p);F4=i(bJ,"FlaxLogitsProcessor"),bJ.forEach(o),L4=i(pe," or "),bp=n(pe,"A",{href:!0});var yJ=r(bp);z4=i(yJ,"FlaxLogitsWarper"),yJ.forEach(o),U4=i(pe," to the inputs."),pe.forEach(o),J4=l(Qm),yp=n(Qm,"DIV",{class:!0});var TJ=r(yp);u(Ei.$$.fragment,TJ),TJ.forEach(o),Qm.forEach(o),Ab=l(t),Mt=n(t,"DIV",{class:!0});var Ym=r(Mt);u(ji.$$.fragment,Ym),I4=l(Ym),Ju=n(Ym,"P",{});var vJ=r(Ju);B4=i(vJ,"Abstract base class for all logit warpers that can be applied during generation with multinomial sampling."),vJ.forEach(o),q4=l(Ym),Gs=n(Ym,"DIV",{class:!0});var _T=r(Gs);u(Fi.$$.fragment,_T),S4=l(_T),Iu=n(_T,"P",{});var wJ=r(Iu);W4=i(wJ,"Flax method for warping logits."),wJ.forEach(o),_T.forEach(o),Ym.forEach(o),Hb=l(t),xt=n(t,"DIV",{class:!0});var Km=r(xt);u(Li.$$.fragment,Km),D4=l(Km),Tp=n(Km,"P",{});var W5=r(Tp);vp=n(W5,"A",{href:!0});var kJ=r(vp);P4=i(kJ,"FlaxLogitsProcessor"),kJ.forEach(o),V4=i(W5," enforcing a min-length by setting EOS probability to 0."),W5.forEach(o),Z4=l(Km),wp=n(Km,"DIV",{class:!0});var $J=r(wp);u(zi.$$.fragment,$J),$J.forEach(o),Km.forEach(o),Qb=l(t),Et=n(t,"DIV",{class:!0});var eh=r(Et);u(Ui.$$.fragment,eh),G4=l(eh),Je=n(eh,"P",{});var Qo=r(Je);kp=n(Qo,"A",{href:!0});var MJ=r(kp);C4=i(MJ,"FlaxLogitsProcessor"),MJ.forEach(o),N4=i(Qo," supressing a list of tokens as soon as the "),Bu=n(Qo,"CODE",{});var xJ=r(Bu);X4=i(xJ,"generate"),xJ.forEach(o),R4=i(Qo,` function starts generating using
`),qu=n(Qo,"CODE",{});var EJ=r(qu);O4=i(EJ,"begin_index"),EJ.forEach(o),A4=i(Qo," tokens. This should ensure that the tokens defined by "),Su=n(Qo,"CODE",{});var jJ=r(Su);H4=i(jJ,"begin_suppress_tokens"),jJ.forEach(o),Q4=i(Qo,` are not sampled at the
begining of the generation.`),Qo.forEach(o),Y4=l(eh),$p=n(eh,"DIV",{class:!0});var FJ=r($p);u(Ji.$$.fragment,FJ),FJ.forEach(o),eh.forEach(o),Yb=l(t),jt=n(t,"DIV",{class:!0});var th=r(jt);u(Ii.$$.fragment,th),K4=l(th),Cs=n(th,"P",{});var a_=r(Cs);Mp=n(a_,"A",{href:!0});var LJ=r(Mp);eE=i(LJ,"FlaxLogitsProcessor"),LJ.forEach(o),tE=i(a_,` suppressing a list of tokens at each decoding step. The processor will set their log probs
to be `),Wu=n(a_,"CODE",{});var zJ=r(Wu);oE=i(zJ,"-inf"),zJ.forEach(o),sE=i(a_," so they are not sampled."),a_.forEach(o),nE=l(th),xp=n(th,"DIV",{class:!0});var UJ=r(xp);u(Bi.$$.fragment,UJ),UJ.forEach(o),th.forEach(o),Kb=l(t),Ft=n(t,"DIV",{class:!0});var oh=r(Ft);u(qi.$$.fragment,oh),rE=l(oh),Ep=n(oh,"P",{});var D5=r(Ep);jp=n(D5,"A",{href:!0});var JJ=r(jp);aE=i(JJ,"FlaxLogitsWarper"),JJ.forEach(o),iE=i(D5," for temperature (exponential scaling output probability distribution)."),D5.forEach(o),cE=l(oh),Fp=n(oh,"DIV",{class:!0});var IJ=r(Fp);u(Si.$$.fragment,IJ),IJ.forEach(o),oh.forEach(o),ey=l(t),Lt=n(t,"DIV",{class:!0});var sh=r(Lt);u(Wi.$$.fragment,sh),lE=l(sh),Lp=n(sh,"P",{});var P5=r(Lp);zp=n(P5,"A",{href:!0});var BJ=r(zp);dE=i(BJ,"FlaxLogitsWarper"),BJ.forEach(o),pE=i(P5," that performs top-k, i.e. restricting to the k highest probability elements."),P5.forEach(o),mE=l(sh),Up=n(sh,"DIV",{class:!0});var qJ=r(Up);u(Di.$$.fragment,qJ),qJ.forEach(o),sh.forEach(o),ty=l(t),zt=n(t,"DIV",{class:!0});var nh=r(zt);u(Pi.$$.fragment,nh),hE=l(nh),Jp=n(nh,"P",{});var V5=r(Jp);Ip=n(V5,"A",{href:!0});var SJ=r(Ip);gE=i(SJ,"FlaxLogitsWarper"),SJ.forEach(o),uE=i(V5," that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off."),V5.forEach(o),fE=l(nh),Bp=n(nh,"DIV",{class:!0});var WJ=r(Bp);u(Vi.$$.fragment,WJ),WJ.forEach(o),nh.forEach(o),oy=l(t),Ut=n(t,"DIV",{class:!0});var rh=r(Ut);u(Zi.$$.fragment,rh),_E=l(rh),Gi=n(rh,"P",{});var bT=r(Gi);bE=i(bT,`Whisper specific Processor. This processor can be used to force a list of tokens. The processor will set their log
probs to `),Du=n(bT,"CODE",{});var DJ=r(Du);yE=i(DJ,"inf"),DJ.forEach(o),TE=i(bT," so that they are sampled at their corresponding index."),bT.forEach(o),vE=l(rh),qp=n(rh,"DIV",{class:!0});var PJ=r(qp);u(Ci.$$.fragment,PJ),PJ.forEach(o),rh.forEach(o),sy=l(t),So=n(t,"H2",{class:!0});var yT=r(So);Ns=n(yT,"A",{id:!0,class:!0,href:!0});var VJ=r(Ns);Pu=n(VJ,"SPAN",{});var ZJ=r(Pu);u(Ni.$$.fragment,ZJ),ZJ.forEach(o),VJ.forEach(o),wE=l(yT),Vu=n(yT,"SPAN",{});var GJ=r(Vu);kE=i(GJ,"StoppingCriteria"),GJ.forEach(o),yT.forEach(o),ny=l(t),Xs=n(t,"P",{});var TT=r(Xs);$E=i(TT,"A "),Sp=n(TT,"A",{href:!0});var CJ=r(Sp);ME=i(CJ,"StoppingCriteria"),CJ.forEach(o),xE=i(TT," can be used to change when to stop generation (other than EOS token). Please note that this is exclusivelly available to our PyTorch implementations."),TT.forEach(o),ry=l(t),Jt=n(t,"DIV",{class:!0});var ah=r(Jt);u(Xi.$$.fragment,ah),EE=l(ah),Zu=n(ah,"P",{});var NJ=r(Zu);jE=i(NJ,"Abstract base class for all stopping criteria that can be applied during generation."),NJ.forEach(o),FE=l(ah),Wp=n(ah,"DIV",{class:!0});var XJ=r(Wp);u(Ri.$$.fragment,XJ),XJ.forEach(o),ah.forEach(o),ay=l(t),Wo=n(t,"DIV",{class:!0});var vT=r(Wo);u(Oi.$$.fragment,vT),LE=l(vT),Dp=n(vT,"DIV",{class:!0});var RJ=r(Dp);u(Ai.$$.fragment,RJ),RJ.forEach(o),vT.forEach(o),iy=l(t),It=n(t,"DIV",{class:!0});var ih=r(It);u(Hi.$$.fragment,ih),zE=l(ih),Qi=n(ih,"P",{});var wT=r(Qi);UE=i(wT,"This class can be used to stop generation whenever the full generated number of tokens exceeds "),Gu=n(wT,"CODE",{});var OJ=r(Gu);JE=i(OJ,"max_length"),OJ.forEach(o),IE=i(wT,`. Keep
in mind for decoder-only type of transformers, this will include the initial prompted tokens.`),wT.forEach(o),BE=l(ih),Pp=n(ih,"DIV",{class:!0});var AJ=r(Pp);u(Yi.$$.fragment,AJ),AJ.forEach(o),ih.forEach(o),cy=l(t),Bt=n(t,"DIV",{class:!0});var ch=r(Bt);u(Ki.$$.fragment,ch),qE=l(ch),ec=n(ch,"P",{});var kT=r(ec);SE=i(kT,`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
`),Cu=n(kT,"CODE",{});var HJ=r(Cu);WE=i(HJ,"initial_time"),HJ.forEach(o),DE=i(kT,"."),kT.forEach(o),PE=l(ch),Vp=n(ch,"DIV",{class:!0});var QJ=r(Vp);u(tc.$$.fragment,QJ),QJ.forEach(o),ch.forEach(o),ly=l(t),Do=n(t,"H2",{class:!0});var $T=r(Do);Rs=n($T,"A",{id:!0,class:!0,href:!0});var YJ=r(Rs);Nu=n(YJ,"SPAN",{});var KJ=r(Nu);u(oc.$$.fragment,KJ),KJ.forEach(o),YJ.forEach(o),VE=l($T),Xu=n($T,"SPAN",{});var eI=r(Xu);ZE=i(eI,"Constraints"),eI.forEach(o),$T.forEach(o),dy=l(t),Os=n(t,"P",{});var MT=r(Os);GE=i(MT,"A "),Zp=n(MT,"A",{href:!0});var tI=r(Zp);CE=i(tI,"Constraint"),tI.forEach(o),NE=i(MT," 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."),MT.forEach(o),py=l(t),z=n(t,"DIV",{class:!0});var J=r(z);u(sc.$$.fragment,J),XE=l(J),Ru=n(J,"P",{});var oI=r(Ru);RE=i(oI,`Abstract base class for all constraints that can be applied during generation.
It must define how the constraint can be satisfied.`),oI.forEach(o),OE=l(J),Ou=n(J,"P",{});var sI=r(Ou);AE=i(sI,"All classes that inherit Constraint must follow the requirement that"),sI.forEach(o),HE=l(J),u(As.$$.fragment,J),QE=l(J),Au=n(J,"P",{});var nI=r(Au);YE=i(nI,"will always terminate (halt)."),nI.forEach(o),KE=l(J),Hs=n(J,"DIV",{class:!0});var xT=r(Hs);u(nc.$$.fragment,xT),ej=l(xT),Hu=n(xT,"P",{});var rI=r(Hu);tj=i(rI,"When called, returns the token that would take this constraint one step closer to being fulfilled."),rI.forEach(o),xT.forEach(o),oj=l(J),Qs=n(J,"DIV",{class:!0});var ET=r(Qs);u(rc.$$.fragment,ET),sj=l(ET),Qu=n(ET,"P",{});var aI=r(Qu);nj=i(aI,"Creates a new instance of this constraint."),aI.forEach(o),ET.forEach(o),rj=l(J),Ys=n(J,"DIV",{class:!0});var jT=r(Ys);u(ac.$$.fragment,jT),aj=l(jT),Yu=n(jT,"P",{});var iI=r(Yu);ij=i(iI,"Reads in a token and returns whether it creates progress."),iI.forEach(o),jT.forEach(o),cj=l(J),Ks=n(J,"DIV",{class:!0});var FT=r(Ks);u(ic.$$.fragment,FT),lj=l(FT),cc=n(FT,"P",{});var LT=r(cc);dj=i(LT,"Returns the number of remaining steps of "),Ku=n(LT,"CODE",{});var cI=r(Ku);pj=i(cI,"advance()"),cI.forEach(o),mj=i(LT," in order to complete this constraint."),LT.forEach(o),FT.forEach(o),hj=l(J),en=n(J,"DIV",{class:!0});var zT=r(en);u(lc.$$.fragment,zT),gj=l(zT),ef=n(zT,"P",{});var lI=r(ef);uj=i(lI,`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.`),lI.forEach(o),zT.forEach(o),fj=l(J),tn=n(J,"DIV",{class:!0});var UT=r(tn);u(dc.$$.fragment,UT),_j=l(UT),tf=n(UT,"P",{});var dI=r(tf);bj=i(dI,"Tests whether this constraint has been properly defined."),dI.forEach(o),UT.forEach(o),yj=l(J),Gt=n(J,"DIV",{class:!0});var lh=r(Gt);u(pc.$$.fragment,lh),Tj=l(lh),mc=n(lh,"P",{});var JT=r(mc);vj=i(JT,`Reads in a token and returns booleans that indicate the progress made by it. This function will update the
state of this object unlikes `),of=n(JT,"CODE",{});var pI=r(of);wj=i(pI,"does_advance(self, token_id: int)"),pI.forEach(o),kj=i(JT,"."),JT.forEach(o),$j=l(lh),sf=n(lh,"P",{});var mI=r(sf);Mj=i(mI,`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)`),mI.forEach(o),lh.forEach(o),J.forEach(o),my=l(t),Po=n(t,"DIV",{class:!0});var IT=r(Po);u(hc.$$.fragment,IT),xj=l(IT),Gp=n(IT,"P",{});var Z5=r(Gp);Cp=n(Z5,"A",{href:!0});var hI=r(Cp);Ej=i(hI,"Constraint"),hI.forEach(o),jj=i(Z5," enforcing that an ordered sequence of tokens is included in the output."),Z5.forEach(o),IT.forEach(o),hy=l(t),Vo=n(t,"DIV",{class:!0});var BT=r(Vo);u(gc.$$.fragment,BT),Fj=l(BT),uc=n(BT,"P",{});var qT=r(uc);Lj=i(qT,"A special "),Np=n(qT,"A",{href:!0});var gI=r(Np);zj=i(gI,"Constraint"),gI.forEach(o),Uj=i(qT," that is fulfilled by fulfilling just one of several constraints."),qT.forEach(o),BT.forEach(o),gy=l(t),ke=n(t,"DIV",{class:!0});var Mn=r(ke);u(fc.$$.fragment,Mn),Jj=l(Mn),nf=n(Mn,"P",{});var uI=r(nf);Ij=i(uI,"A class for beam scorers to track its progress through a list of constraints."),uI.forEach(o),Bj=l(Mn),O=n(Mn,"DIV",{class:!0});var Ie=r(O);u(_c.$$.fragment,Ie),qj=l(Ie),rf=n(Ie,"P",{});var fI=r(rf);Sj=i(fI,`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.`),fI.forEach(o),Wj=l(Ie),Zo=n(Ie,"P",{});var dh=r(Zo);Dj=i(dh,"Given constraints "),af=n(dh,"CODE",{});var _I=r(af);Pj=i(_I,"c_i = {t_ij | j == # of tokens}"),_I.forEach(o),Vj=i(dh,`, If we\u2019re not in the middle of progressing through a
specific constraint `),cf=n(dh,"CODE",{});var bI=r(cf);Zj=i(bI,"c_i"),bI.forEach(o),Gj=i(dh,", we return:"),dh.forEach(o),Cj=l(Ie),lf=n(Ie,"P",{});var yI=r(lf);df=n(yI,"CODE",{});var TI=r(df);Nj=i(TI,"[t_k1 for k in indices of unfulfilled constraints]"),TI.forEach(o),yI.forEach(o),Xj=l(Ie),qt=n(Ie,"P",{});var xn=r(qt);Rj=i(xn,`If we are in the middle of a constraint, then we return:
`),pf=n(xn,"CODE",{});var vI=r(pf);Oj=i(vI,"[t_ij]"),vI.forEach(o),Aj=i(xn,", where "),mf=n(xn,"CODE",{});var wI=r(mf);Hj=i(wI,"i"),wI.forEach(o),Qj=i(xn," is the index of the inprogress constraint, "),hf=n(xn,"CODE",{});var kI=r(hf);Yj=i(kI,"j"),kI.forEach(o),Kj=i(xn," is the next step for the constraint."),xn.forEach(o),eF=l(Ie),gf=n(Ie,"P",{});var $I=r(gf);tF=i($I,`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.`),$I.forEach(o),Ie.forEach(o),oF=l(Mn),on=n(Mn,"DIV",{class:!0});var ST=r(on);u(bc.$$.fragment,ST),sF=l(ST),uf=n(ST,"P",{});var MI=r(uf);nF=i(MI,"token_ids: the tokens generated thus far to reset the state of the progress through constraints."),MI.forEach(o),ST.forEach(o),Mn.forEach(o),uy=l(t),Go=n(t,"H2",{class:!0});var WT=r(Go);sn=n(WT,"A",{id:!0,class:!0,href:!0});var xI=r(sn);ff=n(xI,"SPAN",{});var EI=r(ff);u(yc.$$.fragment,EI),EI.forEach(o),xI.forEach(o),rF=l(WT),_f=n(WT,"SPAN",{});var jI=r(_f);aF=i(jI,"BeamSearch"),jI.forEach(o),WT.forEach(o),fy=l(t),$e=n(t,"DIV",{class:!0});var En=r($e);u(Tc.$$.fragment,En),iF=l(En),Co=n(En,"P",{});var ph=r(Co);cF=i(ph,"Abstract base class for all beam scorers that are used for "),Xp=n(ph,"A",{href:!0});var FI=r(Xp);lF=i(FI,"beam_search()"),FI.forEach(o),dF=i(ph,` and
`),Rp=n(ph,"A",{href:!0});var LI=r(Rp);pF=i(LI,"beam_sample()"),LI.forEach(o),mF=i(ph,"."),ph.forEach(o),hF=l(En),Op=n(En,"DIV",{class:!0});var zI=r(Op);u(vc.$$.fragment,zI),zI.forEach(o),gF=l(En),Ap=n(En,"DIV",{class:!0});var UI=r(Ap);u(wc.$$.fragment,UI),UI.forEach(o),En.forEach(o),_y=l(t),N=n(t,"DIV",{class:!0});var Be=r(N);u(kc.$$.fragment,Be),uF=l(Be),Hp=n(Be,"P",{});var G5=r(Hp);Qp=n(G5,"A",{href:!0});var JI=r(Qp);fF=i(JI,"BeamScorer"),JI.forEach(o),_F=i(G5," implementing standard beam search decoding."),G5.forEach(o),bF=l(Be),$c=n(Be,"P",{});var DT=r($c);yF=i(DT,"Adapted in part from "),Mc=n(DT,"A",{href:!0,rel:!0});var II=r(Mc);TF=i(II,`Facebook\u2019s XLM beam search
code`),II.forEach(o),vF=i(DT,"."),DT.forEach(o),wF=l(Be),Yp=n(Be,"P",{});var C5=r(Yp);kF=i(C5,"Reference for the diverse beam search algorithm and implementation "),xc=n(C5,"A",{href:!0,rel:!0});var BI=r(xc);$F=i(BI,`Ashwin Kalyan\u2019s DBS
implementation`),BI.forEach(o),C5.forEach(o),MF=l(Be),Kp=n(Be,"DIV",{class:!0});var qI=r(Kp);u(Ec.$$.fragment,qI),qI.forEach(o),xF=l(Be),em=n(Be,"DIV",{class:!0});var SI=r(em);u(jc.$$.fragment,SI),SI.forEach(o),Be.forEach(o),by=l(t),Me=n(t,"DIV",{class:!0});var jn=r(Me);u(Fc.$$.fragment,jn),EF=l(jn),tm=n(jn,"P",{});var N5=r(tm);om=n(N5,"A",{href:!0});var WI=r(om);jF=i(WI,"BeamScorer"),WI.forEach(o),FF=i(N5," implementing constrained beam search decoding."),N5.forEach(o),LF=l(jn),sm=n(jn,"DIV",{class:!0});var DI=r(sm);u(Lc.$$.fragment,DI),DI.forEach(o),zF=l(jn),nm=n(jn,"DIV",{class:!0});var PI=r(nm);u(zc.$$.fragment,PI),PI.forEach(o),jn.forEach(o),yy=l(t),No=n(t,"H2",{class:!0});var PT=r(No);nn=n(PT,"A",{id:!0,class:!0,href:!0});var VI=r(nn);bf=n(VI,"SPAN",{});var ZI=r(bf);u(Uc.$$.fragment,ZI),ZI.forEach(o),VI.forEach(o),UF=l(PT),yf=n(PT,"SPAN",{});var GI=r(yf);JF=i(GI,"Utilities"),GI.forEach(o),PT.forEach(o),Ty=l(t),St=n(t,"DIV",{class:!0});var mh=r(St);u(Jc.$$.fragment,mh),IF=l(mh),Tf=n(mh,"P",{});var CI=r(Tf);BF=i(CI,"Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),CI.forEach(o),qF=l(mh),rm=n(mh,"P",{});var X5=r(rm);SF=i(X5,"From: "),Ic=n(X5,"A",{href:!0,rel:!0});var NI=r(Ic);WF=i(NI,"https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),NI.forEach(o),X5.forEach(o),mh.forEach(o),vy=l(t),Wt=n(t,"DIV",{class:!0});var hh=r(Wt);u(Bc.$$.fragment,hh),DF=l(hh),vf=n(hh,"P",{});var XI=r(vf);PF=i(XI,"Filter a distribution of logits using top-k and/or nucleus (top-p) filtering"),XI.forEach(o),VF=l(hh),am=n(hh,"P",{});var R5=r(am);ZF=i(R5,"From: "),qc=n(R5,"A",{href:!0,rel:!0});var RI=r(qc);GF=i(RI,"https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),RI.forEach(o),R5.forEach(o),hh.forEach(o),wy=l(t),Xo=n(t,"H2",{class:!0});var VT=r(Xo);rn=n(VT,"A",{id:!0,class:!0,href:!0});var OI=r(rn);wf=n(OI,"SPAN",{});var AI=r(wf);u(Sc.$$.fragment,AI),AI.forEach(o),OI.forEach(o),CF=l(VT),kf=n(VT,"SPAN",{});var HI=r(kf);NF=i(HI,"Streamers"),HI.forEach(o),VT.forEach(o),ky=l(t),D=n(t,"DIV",{class:!0});var me=r(D);u(Wc.$$.fragment,me),XF=l(me),$f=n(me,"P",{});var QI=r($f);RF=i(QI,"Simple text streamer that prints the token(s) to stdout as soon as entire words are formed."),QI.forEach(o),OF=l(me),u(an.$$.fragment,me),AF=l(me),u(cn.$$.fragment,me),HF=l(me),ln=n(me,"DIV",{class:!0});var ZT=r(ln);u(Dc.$$.fragment,ZT),QF=l(ZT),Mf=n(ZT,"P",{});var YI=r(Mf);YF=i(YI,"Flushes any remaining cache and prints a newline to stdout."),YI.forEach(o),ZT.forEach(o),KF=l(me),dn=n(me,"DIV",{class:!0});var GT=r(dn);u(Pc.$$.fragment,GT),e5=l(GT),xf=n(GT,"P",{});var KI=r(xf);t5=i(KI,"Prints the new text to stdout. If the stream is ending, also prints a newline."),KI.forEach(o),GT.forEach(o),o5=l(me),pn=n(me,"DIV",{class:!0});var CT=r(pn);u(Vc.$$.fragment,CT),s5=l(CT),Ef=n(CT,"P",{});var eB=r(Ef);n5=i(eB,"Receives tokens, decodes them, and prints them to stdout as soon as they form entire words."),eB.forEach(o),CT.forEach(o),me.forEach(o),$y=l(t),te=n(t,"DIV",{class:!0});var Kt=r(te);u(Zc.$$.fragment,Kt),r5=l(Kt),jf=n(Kt,"P",{});var tB=r(jf);a5=i(tB,`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).`),tB.forEach(o),i5=l(Kt),u(mn.$$.fragment,Kt),c5=l(Kt),u(hn.$$.fragment,Kt),l5=l(Kt),gn=n(Kt,"DIV",{class:!0});var NT=r(gn);u(Gc.$$.fragment,NT),d5=l(NT),Ff=n(NT,"P",{});var oB=r(Ff);p5=i(oB,"Put the new text in the queue. If the stream is ending, also put a stop signal in the queue."),oB.forEach(o),NT.forEach(o),Kt.forEach(o),this.h()},h(){d(T,"name","hf:doc:metadata"),d(T,"content",JSON.stringify(UB)),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(k,"class","relative group"),d(ne,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.generate"),d(re,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.greedy_search"),d(j,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.contrastive_search"),d(xe,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.sample"),d(Oc,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.beam_search"),d(Ac,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.beam_sample"),d(Hc,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.group_beam_search"),d(Qc,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.constrained_beam_search"),d(Yo,"id","generate-outputs"),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","#generate-outputs"),d(no,"class","relative group"),d(Kc,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.generate"),d(el,"href","/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput"),d(tl,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.generate"),d(sl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.generation.GreedySearchDecoderOnlyOutput"),d(es,"id","transformers.generation.GreedySearchEncoderDecoderOutput"),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.GreedySearchEncoderDecoderOutput"),d(ro,"class","relative group"),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(fo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ts,"id","transformers.generation.TFGreedySearchEncoderDecoderOutput"),d(ts,"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(ts,"href","#transformers.generation.TFGreedySearchEncoderDecoderOutput"),d(_o,"class","relative group"),d(bo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(yo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(To,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(vo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(wo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(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($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(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(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(Eo,"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,"id","transformers.generation.FlaxSampleOutput"),d(os,"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(os,"href","#transformers.generation.FlaxSampleOutput"),d(jo,"class","relative group"),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(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(ns,"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(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(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(as,"id","logitsprocessor"),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","#logitsprocessor"),d(Fo,"class","relative group"),d(ll,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(cs,"id","transformers.AlternatingCodebooksLogitsProcessor"),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.AlternatingCodebooksLogitsProcessor"),d(Lo,"class","relative group"),d(dl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(pl,"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(ur,"href","https://arxiv.org/abs/2306.05284"),d(ur,"rel","nofollow"),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(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(hl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(br,"href","https://github.com/facebookresearch/ParlAI/blob/master/parlai/core/torch_generator_agent.py#L1350"),d(br,"rel","nofollow"),d(gl,"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(fl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(_l,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(bl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(kr,"href","https://arxiv.org/abs/2210.15191"),d(kr,"rel","nofollow"),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(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(Tl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(xr,"href","https://arxiv.org/abs/2210.15191"),d(xr,"rel","nofollow"),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(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(wl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(kl,"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(Ml,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(xl,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(El,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(jl,"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(Fl,"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(zl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Ul,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.group_beam_search"),d(Wr,"href","https://arxiv.org/pdf/1610.02424.pdf"),d(Wr,"rel","nofollow"),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(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(Dl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Pl,"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,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(Zl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Gl,"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(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(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(Nl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Xl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(Rl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Ol,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(Al,"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(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(Yl,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(Kl,"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(ed,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(td,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(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(sd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),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(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(rd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(ra,"href","https://github.com/pytorch/fairseq/blob/a07cb6f40480928c9e0548b737aadd36ee66ac76/fairseq/sequence_generator.py#L345"),d(ra,"rel","nofollow"),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(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(id,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(ca,"href","https://arxiv.org/abs/2010.00904"),d(ca,"rel","nofollow"),d(cd,"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(ld,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),d(pa,"href","https://arxiv.org/pdf/1909.05858.pdf"),d(pa,"rel","nofollow"),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(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(md,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsProcessor"),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(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(gd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.SuppressTokensAtBeginLogitsProcessor"),d(ud,"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(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(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(bd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(yd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(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(vd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(wd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(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($d,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(Md,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(xd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.LogitsWarper"),d(Ea,"href","https://arxiv.org/abs/2202.00666"),d(Ea,"rel","nofollow"),d(Ed,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(za,"href","https://arxiv.org/abs/2306.17806"),d(za,"rel","nofollow"),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(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(qa,"href","https://arxiv.org/abs/2212.04356"),d(qa,"rel","nofollow"),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(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(Is,"id","transformers.TFForcedBOSTokenLogitsProcessor"),d(Is,"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(Is,"href","#transformers.TFForcedBOSTokenLogitsProcessor"),d(Io,"class","relative group"),d(zd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(Ud,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Jd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),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(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(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(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(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(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(qd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(Sd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),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(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(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(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(Pd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(Vd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Gd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(Cd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Nd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),d(oi,"href","https://github.com/pytorch/fairseq/blob/a07cb6f40480928c9e0548b737aadd36ee66ac76/fairseq/sequence_generator.py#L345"),d(oi,"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(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(Od,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsProcessor"),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(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(Hd,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFSuppressTokensAtBeginLogitsProcessor"),d(Qd,"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(Yd,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ep,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsWarper"),d(tp,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(_t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(sp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsWarper"),d(np,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ap,"href","/docs/transformers/main/en/internal/generation_utils#transformers.TFLogitsWarper"),d(ip,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ds,"id","transformers.FlaxForcedBOSTokenLogitsProcessor"),d(Ds,"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(Ds,"href","#transformers.FlaxForcedBOSTokenLogitsProcessor"),d(qo,"class","relative group"),d(lp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),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(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(pp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),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(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(hp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(gp,"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(Zs,"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(up,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(fp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(_p,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(bp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(yp,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d($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(Gs,"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(vp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d(wp,"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(kp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),d($p,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Mp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsProcessor"),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(jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(jp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(Fp,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(zp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsWarper"),d(Up,"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,"href","/docs/transformers/main/en/internal/generation_utils#transformers.FlaxLogitsWarper"),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(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(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(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(Ns,"id","transformers.StoppingCriteria"),d(Ns,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ns,"href","#transformers.StoppingCriteria"),d(So,"class","relative group"),d(Sp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.StoppingCriteria"),d(Wp,"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(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(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(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(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(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(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(Rs,"id","transformers.Constraint"),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","#transformers.Constraint"),d(Do,"class","relative group"),d(Zp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.Constraint"),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(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(en,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(tn,"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(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(Cp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.Constraint"),d(Po,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Np,"href","/docs/transformers/main/en/internal/generation_utils#transformers.Constraint"),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(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(on,"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(sn,"id","transformers.BeamScorer"),d(sn,"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(sn,"href","#transformers.BeamScorer"),d(Go,"class","relative group"),d(Xp,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.beam_search"),d(Rp,"href","/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.beam_sample"),d(Op,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ap,"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(Qp,"href","/docs/transformers/main/en/internal/generation_utils#transformers.BeamScorer"),d(Mc,"href","https://github.com/facebookresearch/XLM/blob/9e6f6814d17be4fe5b15f2e6c43eb2b2d76daeb4/src/model/transformer.py#L529"),d(Mc,"rel","nofollow"),d(xc,"href","https://github.com/ashwinkalyan/dbs/blob/master/dbs/beam_utils.lua"),d(xc,"rel","nofollow"),d(Kp,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(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(om,"href","/docs/transformers/main/en/internal/generation_utils#transformers.BeamScorer"),d(sm,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(nm,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(nn,"id","transformers.top_k_top_p_filtering"),d(nn,"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(nn,"href","#transformers.top_k_top_p_filtering"),d(No,"class","relative group"),d(Ic,"href","https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),d(Ic,"rel","nofollow"),d(St,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(qc,"href","https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317"),d(qc,"rel","nofollow"),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(rn,"id","transformers.TextStreamer"),d(rn,"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(rn,"href","#transformers.TextStreamer"),d(Xo,"class","relative group"),d(ln,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(dn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(pn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(gn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,p){e(document.head,T),m(t,M,p),m(t,k,p),e(k,w),e(w,x),f(h,x,null),e(k,$),e(k,Z),e(Z,I),m(t,B,p),m(t,F,p),e(F,P),e(F,ne),e(ne,qe),e(F,W),e(F,re),e(re,Se),e(F,A),e(F,j),e(j,eo),e(F,to),e(F,xe),e(xe,oo),e(F,so),e(F,Oc),e(Oc,XT),e(F,RT),e(F,Ac),e(Ac,OT),e(F,AT),e(F,Hc),e(Hc,HT),e(F,QT),e(F,Qc),e(Qc,YT),e(F,KT),m(t,i_,p),m(t,Yc,p),e(Yc,ev),m(t,c_,p),m(t,no,p),e(no,Yo),e(Yo,gh),f(Ln,gh,null),e(no,tv),e(no,uh),e(uh,ov),m(t,l_,p),m(t,Ee,p),e(Ee,sv),e(Ee,Kc),e(Kc,nv),e(Ee,rv),e(Ee,el),e(el,av),e(Ee,iv),e(Ee,tl),e(tl,cv),e(Ee,lv),m(t,d_,p),m(t,ol,p),e(ol,dv),m(t,p_,p),f(zn,t,p),m(t,m_,p),m(t,Pt,p),e(Pt,pv),e(Pt,fh),e(fh,mv),e(Pt,hv),e(Pt,sl),e(sl,gv),e(Pt,uv),m(t,h_,p),m(t,je,p),e(je,nl),e(nl,_h),e(_h,fv),e(nl,_v),e(je,bv),e(je,rl),e(rl,bh),e(bh,yv),e(rl,Tv),e(je,vv),e(je,al),e(al,yh),e(yh,wv),e(al,kv),e(je,$v),e(je,il),e(il,Th),e(Th,Mv),e(il,xv),m(t,g_,p),m(t,V,p),e(V,Ev),e(V,vh),e(vh,jv),e(V,Fv),e(V,wh),e(wh,Lv),e(V,zv),e(V,kh),e(kh,Uv),e(V,Jv),e(V,$h),e($h,Iv),e(V,Bv),e(V,Mh),e(Mh,qv),e(V,Sv),e(V,xh),e(xh,Wv),e(V,Dv),m(t,u_,p),m(t,ae,p),e(ae,Pv),e(ae,Eh),e(Eh,Vv),e(ae,Zv),e(ae,jh),e(jh,Gv),e(ae,Cv),e(ae,Fh),e(Fh,Nv),e(ae,Xv),e(ae,Lh),e(Lh,Rv),e(ae,Ov),m(t,f_,p),m(t,ie,p),e(ie,Av),e(ie,zh),e(zh,Hv),e(ie,Qv),e(ie,Uh),e(Uh,Yv),e(ie,Kv),e(ie,Jh),e(Jh,e1),e(ie,t1),e(ie,Ih),e(Ih,o1),e(ie,s1),m(t,__,p),f(Un,t,p),m(t,b_,p),m(t,Ko,p),e(Ko,n1),e(Ko,Bh),e(Bh,r1),e(Ko,a1),m(t,y_,p),m(t,ce,p),e(ce,i1),e(ce,qh),e(qh,c1),e(ce,l1),e(ce,Sh),e(Sh,d1),e(ce,p1),e(ce,Wh),e(Wh,m1),e(ce,h1),e(ce,Dh),e(Dh,g1),e(ce,u1),m(t,T_,p),m(t,cl,p),e(cl,f1),m(t,v_,p),m(t,ro,p),e(ro,es),e(es,Ph),f(Jn,Ph,null),e(ro,_1),e(ro,Vh),e(Vh,b1),m(t,w_,p),m(t,ao,p),f(In,ao,null),e(ao,y1),e(ao,Zh),e(Zh,T1),m(t,k_,p),m(t,io,p),f(Bn,io,null),e(io,v1),e(io,Gh),e(Gh,w1),m(t,$_,p),m(t,co,p),f(qn,co,null),e(co,k1),e(co,Ch),e(Ch,$1),m(t,M_,p),m(t,lo,p),f(Sn,lo,null),e(lo,M1),e(lo,Nh),e(Nh,x1),m(t,x_,p),m(t,po,p),f(Wn,po,null),e(po,E1),e(po,Xh),e(Xh,j1),m(t,E_,p),m(t,mo,p),f(Dn,mo,null),e(mo,F1),e(mo,Rh),e(Rh,L1),m(t,j_,p),m(t,ho,p),f(Pn,ho,null),e(ho,z1),e(ho,Oh),e(Oh,U1),m(t,F_,p),m(t,go,p),f(Vn,go,null),e(go,J1),e(go,Ah),e(Ah,I1),m(t,L_,p),m(t,uo,p),f(Zn,uo,null),e(uo,B1),e(uo,Hh),e(Hh,q1),m(t,z_,p),m(t,fo,p),f(Gn,fo,null),e(fo,S1),e(fo,Qh),e(Qh,W1),m(t,U_,p),m(t,_o,p),e(_o,ts),e(ts,Yh),f(Cn,Yh,null),e(_o,D1),e(_o,Kh),e(Kh,P1),m(t,J_,p),m(t,bo,p),f(Nn,bo,null),e(bo,V1),e(bo,eg),e(eg,Z1),m(t,I_,p),m(t,yo,p),f(Xn,yo,null),e(yo,G1),e(yo,tg),e(tg,C1),m(t,B_,p),m(t,To,p),f(Rn,To,null),e(To,N1),e(To,og),e(og,X1),m(t,q_,p),m(t,vo,p),f(On,vo,null),e(vo,R1),e(vo,sg),e(sg,O1),m(t,S_,p),m(t,wo,p),f(An,wo,null),e(wo,A1),e(wo,ng),e(ng,H1),m(t,W_,p),m(t,ko,p),f(Hn,ko,null),e(ko,Q1),e(ko,rg),e(rg,Y1),m(t,D_,p),m(t,$o,p),f(Qn,$o,null),e($o,K1),e($o,ag),e(ag,ew),m(t,P_,p),m(t,Mo,p),f(Yn,Mo,null),e(Mo,tw),e(Mo,ig),e(ig,ow),m(t,V_,p),m(t,xo,p),f(Kn,xo,null),e(xo,sw),e(xo,cg),e(cg,nw),m(t,Z_,p),m(t,Eo,p),f(er,Eo,null),e(Eo,rw),e(Eo,lg),e(lg,aw),m(t,G_,p),m(t,jo,p),e(jo,os),e(os,dg),f(tr,dg,null),e(jo,iw),e(jo,pg),e(pg,cw),m(t,C_,p),m(t,We,p),f(or,We,null),e(We,lw),e(We,mg),e(mg,dw),e(We,pw),e(We,ss),f(sr,ss,null),e(ss,mw),e(ss,hg),e(hg,hw),m(t,N_,p),m(t,De,p),f(nr,De,null),e(De,gw),e(De,gg),e(gg,uw),e(De,fw),e(De,ns),f(rr,ns,null),e(ns,_w),e(ns,ug),e(ug,bw),m(t,X_,p),m(t,Pe,p),f(ar,Pe,null),e(Pe,yw),e(Pe,fg),e(fg,Tw),e(Pe,vw),e(Pe,rs),f(ir,rs,null),e(rs,ww),e(rs,_g),e(_g,kw),m(t,R_,p),m(t,Fo,p),e(Fo,as),e(as,bg),f(cr,bg,null),e(Fo,$w),e(Fo,yg),e(yg,Mw),m(t,O_,p),m(t,is,p),e(is,xw),e(is,ll),e(ll,Ew),e(is,jw),m(t,A_,p),m(t,Lo,p),e(Lo,cs),e(cs,Tg),f(lr,Tg,null),e(Lo,Fw),e(Lo,vg),e(vg,Lw),m(t,H_,p),m(t,Ve,p),f(dr,Ve,null),e(Ve,zw),e(Ve,ls),e(ls,dl),e(dl,Uw),e(ls,Jw),e(ls,wg),e(wg,Iw),e(ls,Bw),e(Ve,qw),e(Ve,pl),f(pr,pl,null),m(t,Q_,p),m(t,ge,p),f(mr,ge,null),e(ge,Sw),e(ge,hr),e(hr,Ww),e(hr,kg),e(kg,Dw),e(hr,Pw),e(ge,Vw),e(ge,gr),e(gr,Zw),e(gr,ur),e(ur,Gw),e(gr,Cw),e(ge,Nw),e(ge,ml),f(fr,ml,null),m(t,Y_,p),m(t,Ze,p),f(_r,Ze,null),e(Ze,Xw),e(Ze,ds),e(ds,hl),e(hl,Rw),e(ds,Ow),e(ds,br),e(br,Aw),e(ds,Hw),e(Ze,Qw),e(Ze,gl),f(yr,gl,null),m(t,K_,p),m(t,Ge,p),f(Tr,Ge,null),e(Ge,Yw),e(Ge,ul),e(ul,fl),e(fl,Kw),e(ul,e2),e(Ge,t2),e(Ge,_l),f(vr,_l,null),m(t,eb,p),m(t,ue,p),f(wr,ue,null),e(ue,o2),e(ue,Vt),e(Vt,bl),e(bl,s2),e(Vt,n2),e(Vt,$g),e($g,r2),e(Vt,a2),e(Vt,kr),e(kr,i2),e(Vt,c2),e(ue,l2),f(ps,ue,null),e(ue,d2),e(ue,yl),f($r,yl,null),m(t,tb,p),m(t,fe,p),f(Mr,fe,null),e(fe,p2),e(fe,S),e(S,Tl),e(Tl,m2),e(S,h2),e(S,Mg),e(Mg,g2),e(S,u2),e(S,xg),e(xg,f2),e(S,_2),e(S,Eg),e(Eg,b2),e(S,y2),e(S,xr),e(xr,T2),e(S,v2),e(S,jg),e(jg,w2),e(S,k2),e(S,Fg),e(Fg,$2),e(S,M2),e(S,Lg),e(Lg,x2),e(S,E2),e(fe,j2),f(ms,fe,null),e(fe,F2),e(fe,vl),f(Er,vl,null),m(t,ob,p),m(t,_e,p),f(jr,_e,null),e(_e,L2),e(_e,Fe),e(Fe,wl),e(wl,z2),e(Fe,U2),e(Fe,zg),e(zg,J2),e(Fe,I2),e(Fe,Ug),e(Ug,B2),e(Fe,q2),e(Fe,Jg),e(Jg,S2),e(Fe,W2),e(_e,D2),f(hs,_e,null),e(_e,P2),e(_e,kl),f(Fr,kl,null),m(t,sb,p),m(t,Ce,p),f(Lr,Ce,null),e(Ce,V2),e(Ce,$l),e($l,Ml),e(Ml,Z2),e($l,G2),e(Ce,C2),e(Ce,xl),f(zr,xl,null),m(t,nb,p),m(t,Ne,p),f(Ur,Ne,null),e(Ne,N2),e(Ne,gs),e(gs,El),e(El,X2),e(gs,R2),e(gs,Ig),e(Ig,O2),e(gs,A2),e(Ne,H2),e(Ne,jl),f(Jr,jl,null),m(t,rb,p),m(t,Xe,p),f(Ir,Xe,null),e(Xe,Q2),e(Xe,Br),e(Br,Y2),e(Br,Bg),e(Bg,K2),e(Br,ek),e(Xe,tk),e(Xe,Fl),f(qr,Fl,null),m(t,ab,p),m(t,L,p),f(Sr,L,null),e(L,ok),e(L,Ll),e(Ll,zl),e(zl,sk),e(Ll,nk),e(L,rk),e(L,zo),e(zo,ak),e(zo,Ul),e(Ul,ik),e(zo,ck),e(zo,Wr),e(Wr,lk),e(zo,dk),e(L,pk),f(us,L,null),e(L,mk),f(fs,L,null),e(L,hk),e(L,Dr),e(Dr,gk),e(Dr,qg),e(qg,uk),e(Dr,fk),e(L,_k),e(L,Sg),e(Sg,bk),e(L,yk),e(L,Uo),e(Uo,Jl),e(Jl,Wg),e(Wg,Tk),e(Jl,vk),e(Uo,wk),e(Uo,Il),e(Il,Dg),e(Dg,kk),e(Il,$k),e(Uo,Mk),e(Uo,Bl),e(Bl,Pg),e(Pg,xk),e(Bl,Ek),e(L,jk),e(L,Vg),e(Vg,Fk),e(L,Lk),e(L,Pr),e(Pr,ql),e(ql,Zg),e(Zg,zk),e(ql,Uk),e(Pr,Jk),e(Pr,Sl),e(Sl,Gg),e(Gg,Ik),e(Sl,Bk),e(L,qk),f(_s,L,null),e(L,Sk),e(L,Wl),f(Vr,Wl,null),m(t,ib,p),m(t,Re,p),f(Zr,Re,null),e(Re,Wk),e(Re,Zt),e(Zt,Dl),e(Dl,Dk),e(Zt,Pk),e(Zt,Cg),e(Cg,Vk),e(Zt,Zk),e(Zt,Ng),e(Ng,Gk),e(Zt,Ck),e(Re,Nk),e(Re,Pl),f(Gr,Pl,null),m(t,cb,p),m(t,Oe,p),f(Cr,Oe,null),e(Oe,Xk),e(Oe,bs),e(bs,Vl),e(Vl,Rk),e(bs,Ok),e(bs,Zl),e(Zl,Ak),e(bs,Hk),e(Oe,Qk),e(Oe,Gl),f(Nr,Gl,null),m(t,lb,p),m(t,Ae,p),f(Xr,Ae,null),e(Ae,Yk),e(Ae,Xg),e(Xg,Kk),e(Ae,e$),e(Ae,Cl),f(Rr,Cl,null),m(t,db,p),m(t,He,p),f(Or,He,null),e(He,t$),e(He,G),e(G,o$),e(G,Nl),e(Nl,s$),e(G,n$),e(G,Xl),e(Xl,r$),e(G,a$),e(G,Rg),e(Rg,i$),e(G,c$),e(G,Og),e(Og,Ag),e(Ag,l$),e(G,d$),e(G,Rl),e(Rl,p$),e(G,m$),e(G,Ol),e(Ol,h$),e(G,g$),e(He,u$),e(He,Al),f(Ar,Al,null),m(t,pb,p),m(t,Qe,p),f(Hr,Qe,null),e(Qe,f$),e(Qe,Hg),e(Hg,_$),e(Qe,b$),e(Qe,Hl),f(Qr,Hl,null),m(t,mb,p),m(t,Ye,p),f(Yr,Ye,null),e(Ye,y$),e(Ye,Ql),e(Ql,Yl),e(Yl,T$),e(Ql,v$),e(Ye,w$),e(Ye,Kl),f(Kr,Kl,null),m(t,hb,p),m(t,be,p),f(ea,be,null),e(be,k$),e(be,Le),e(Le,ed),e(ed,$$),e(Le,M$),e(Le,Qg),e(Qg,x$),e(Le,E$),e(Le,Yg),e(Yg,j$),e(Le,F$),e(Le,Kg),e(Kg,L$),e(Le,z$),e(be,U$),f(ys,be,null),e(be,J$),e(be,td),f(ta,td,null),m(t,gb,p),m(t,H,p),f(oa,H,null),e(H,I$),e(H,od),e(od,sd),e(sd,B$),e(od,q$),e(H,S$),f(Ts,H,null),e(H,W$),f(vs,H,null),e(H,D$),e(H,nd),f(sa,nd,null),m(t,ub,p),m(t,Q,p),f(na,Q,null),e(Q,P$),e(Q,Jo),e(Jo,V$),e(Jo,rd),e(rd,Z$),e(Jo,G$),e(Jo,ra),e(ra,C$),e(Jo,N$),e(Q,X$),f(ws,Q,null),e(Q,R$),f(ks,Q,null),e(Q,O$),e(Q,ad),f(aa,ad,null),m(t,fb,p),m(t,Ke,p),f(ia,Ke,null),e(Ke,A$),e(Ke,$s),e($s,id),e(id,H$),e($s,Q$),e($s,ca),e(ca,Y$),e($s,K$),e(Ke,e0),e(Ke,cd),f(la,cd,null),m(t,_b,p),m(t,ye,p),f(da,ye,null),e(ye,t0),e(ye,Ms),e(Ms,ld),e(ld,o0),e(Ms,s0),e(Ms,pa),e(pa,n0),e(Ms,r0),e(ye,a0),f(xs,ye,null),e(ye,i0),e(ye,dd),f(ma,dd,null),m(t,bb,p),m(t,Y,p),f(ha,Y,null),e(Y,c0),e(Y,pd),e(pd,md),e(md,l0),e(pd,d0),e(Y,p0),f(Es,Y,null),e(Y,m0),f(js,Y,null),e(Y,h0),e(Y,hd),f(ga,hd,null),m(t,yb,p),m(t,et,p),f(ua,et,null),e(et,g0),e(et,ze),e(ze,gd),e(gd,u0),e(ze,f0),e(ze,eu),e(eu,_0),e(ze,b0),e(ze,tu),e(tu,y0),e(ze,T0),e(ze,ou),e(ou,v0),e(ze,w0),e(et,k0),e(et,ud),f(fa,ud,null),m(t,Tb,p),m(t,tt,p),f(_a,tt,null),e(tt,$0),e(tt,ba),e(ba,M0),e(ba,su),e(su,x0),e(ba,E0),e(tt,j0),e(tt,fd),f(ya,fd,null),m(t,vb,p),m(t,K,p),f(Ta,K,null),e(K,F0),e(K,_d),e(_d,bd),e(bd,L0),e(_d,z0),e(K,U0),f(Fs,K,null),e(K,J0),f(Ls,K,null),e(K,I0),e(K,yd),f(va,yd,null),m(t,wb,p),m(t,ot,p),f(wa,ot,null),e(ot,B0),e(ot,Td),e(Td,vd),e(vd,q0),e(Td,S0),e(ot,W0),e(ot,wd),f(ka,wd,null),m(t,kb,p),m(t,Te,p),f($a,Te,null),e(Te,D0),e(Te,kd),e(kd,$d),e($d,P0),e(kd,V0),e(Te,Z0),f(zs,Te,null),e(Te,G0),e(Te,Md),f(Ma,Md,null),m(t,$b,p),m(t,st,p),f(xa,st,null),e(st,C0),e(st,Us),e(Us,xd),e(xd,N0),e(Us,X0),e(Us,Ea),e(Ea,R0),e(Us,O0),e(st,A0),e(st,Ed),f(ja,Ed,null),m(t,Mb,p),m(t,ee,p),f(Fa,ee,null),e(ee,H0),e(ee,nt),e(nt,Q0),e(nt,nu),e(nu,Y0),e(nt,K0),e(nt,ru),e(ru,eM),e(nt,tM),e(nt,au),e(au,oM),e(nt,sM),e(ee,nM),e(ee,La),e(La,rM),e(La,za),e(za,aM),e(La,iM),e(ee,cM),f(Js,ee,null),e(ee,lM),e(ee,jd),f(Ua,jd,null),m(t,xb,p),m(t,ve,p),f(Ja,ve,null),e(ve,dM),e(ve,Ia),e(Ia,pM),e(Ia,iu),e(iu,mM),e(Ia,hM),e(ve,gM),e(ve,Ba),e(Ba,uM),e(Ba,qa),e(qa,fM),e(Ba,_M),e(ve,bM),e(ve,Fd),f(Sa,Fd,null),m(t,Eb,p),m(t,Io,p),e(Io,Is),e(Is,cu),f(Wa,cu,null),e(Io,yM),e(Io,lu),e(lu,TM),m(t,jb,p),m(t,rt,p),f(Da,rt,null),e(rt,vM),e(rt,Ld),e(Ld,zd),e(zd,wM),e(Ld,kM),e(rt,$M),e(rt,Ud),f(Pa,Ud,null),m(t,Fb,p),m(t,at,p),f(Va,at,null),e(at,MM),e(at,Bs),e(Bs,Jd),e(Jd,xM),e(Bs,EM),e(Bs,du),e(du,jM),e(Bs,FM),e(at,LM),e(at,Id),f(Za,Id,null),m(t,Lb,p),m(t,it,p),f(Ga,it,null),e(it,zM),e(it,Bo),e(Bo,UM),e(Bo,pu),e(pu,JM),e(Bo,IM),e(Bo,mu),e(mu,BM),e(Bo,qM),e(it,SM),e(it,Bd),f(Ca,Bd,null),m(t,zb,p),m(t,ct,p),f(Na,ct,null),e(ct,WM),e(ct,hu),e(hu,DM),e(ct,PM),e(ct,qs),f(Xa,qs,null),e(qs,VM),e(qs,gu),e(gu,ZM),m(t,Ub,p),m(t,lt,p),f(Ra,lt,null),e(lt,GM),e(lt,we),e(we,CM),e(we,qd),e(qd,NM),e(we,XM),e(we,uu),e(uu,RM),e(we,OM),e(we,fu),e(fu,_u),e(_u,AM),e(we,HM),e(we,Sd),e(Sd,QM),e(we,YM),e(lt,KM),e(lt,Wd),f(Oa,Wd,null),m(t,Jb,p),m(t,dt,p),f(Aa,dt,null),e(dt,ex),e(dt,bu),e(bu,tx),e(dt,ox),e(dt,Ss),f(Ha,Ss,null),e(Ss,sx),e(Ss,yu),e(yu,nx),m(t,Ib,p),m(t,pt,p),f(Qa,pt,null),e(pt,rx),e(pt,Dd),e(Dd,Pd),e(Pd,ax),e(Dd,ix),e(pt,cx),e(pt,Vd),f(Ya,Vd,null),m(t,Bb,p),m(t,mt,p),f(Ka,mt,null),e(mt,lx),e(mt,Zd),e(Zd,Gd),e(Gd,dx),e(Zd,px),e(mt,mx),e(mt,Cd),f(ei,Cd,null),m(t,qb,p),m(t,ht,p),f(ti,ht,null),e(ht,hx),e(ht,Ws),e(Ws,Nd),e(Nd,gx),e(Ws,ux),e(Ws,oi),e(oi,fx),e(Ws,_x),e(ht,bx),e(ht,Xd),f(si,Xd,null),m(t,Sb,p),m(t,gt,p),f(ni,gt,null),e(gt,yx),e(gt,Rd),e(Rd,Od),e(Od,Tx),e(Rd,vx),e(gt,wx),e(gt,Ad),f(ri,Ad,null),m(t,Wb,p),m(t,ut,p),f(ai,ut,null),e(ut,kx),e(ut,Ue),e(Ue,Hd),e(Hd,$x),e(Ue,Mx),e(Ue,Tu),e(Tu,xx),e(Ue,Ex),e(Ue,vu),e(vu,jx),e(Ue,Fx),e(Ue,wu),e(wu,Lx),e(Ue,zx),e(ut,Ux),e(ut,Qd),f(ii,Qd,null),m(t,Db,p),m(t,ft,p),f(ci,ft,null),e(ft,Jx),e(ft,li),e(li,Ix),e(li,ku),e(ku,Bx),e(li,qx),e(ft,Sx),e(ft,Yd),f(di,Yd,null),m(t,Pb,p),m(t,_t,p),f(pi,_t,null),e(_t,Wx),e(_t,Kd),e(Kd,ep),e(ep,Dx),e(Kd,Px),e(_t,Vx),e(_t,tp),f(mi,tp,null),m(t,Vb,p),m(t,bt,p),f(hi,bt,null),e(bt,Zx),e(bt,op),e(op,sp),e(sp,Gx),e(op,Cx),e(bt,Nx),e(bt,np),f(gi,np,null),m(t,Zb,p),m(t,yt,p),f(ui,yt,null),e(yt,Xx),e(yt,rp),e(rp,ap),e(ap,Rx),e(rp,Ox),e(yt,Ax),e(yt,ip),f(fi,ip,null),m(t,Gb,p),m(t,qo,p),e(qo,Ds),e(Ds,$u),f(_i,$u,null),e(qo,Hx),e(qo,Mu),e(Mu,Qx),m(t,Cb,p),m(t,Tt,p),f(bi,Tt,null),e(Tt,Yx),e(Tt,cp),e(cp,lp),e(lp,Kx),e(cp,e4),e(Tt,t4),e(Tt,dp),f(yi,dp,null),m(t,Nb,p),m(t,vt,p),f(Ti,vt,null),e(vt,o4),e(vt,Ps),e(Ps,pp),e(pp,s4),e(Ps,n4),e(Ps,xu),e(xu,r4),e(Ps,a4),e(vt,i4),e(vt,mp),f(vi,mp,null),m(t,Xb,p),m(t,wt,p),f(wi,wt,null),e(wt,c4),e(wt,Vs),e(Vs,hp),e(hp,l4),e(Vs,d4),e(Vs,Eu),e(Eu,p4),e(Vs,m4),e(wt,h4),e(wt,gp),f(ki,gp,null),m(t,Rb,p),m(t,kt,p),f($i,kt,null),e(kt,g4),e(kt,ju),e(ju,u4),e(kt,f4),e(kt,Zs),f(Mi,Zs,null),e(Zs,_4),e(Zs,Fu),e(Fu,b4),m(t,Ob,p),m(t,$t,p),f(xi,$t,null),e($t,y4),e($t,C),e(C,T4),e(C,up),e(up,v4),e(C,w4),e(C,fp),e(fp,k4),e(C,$4),e(C,Lu),e(Lu,M4),e(C,x4),e(C,zu),e(zu,Uu),e(Uu,E4),e(C,j4),e(C,_p),e(_p,F4),e(C,L4),e(C,bp),e(bp,z4),e(C,U4),e($t,J4),e($t,yp),f(Ei,yp,null),m(t,Ab,p),m(t,Mt,p),f(ji,Mt,null),e(Mt,I4),e(Mt,Ju),e(Ju,B4),e(Mt,q4),e(Mt,Gs),f(Fi,Gs,null),e(Gs,S4),e(Gs,Iu),e(Iu,W4),m(t,Hb,p),m(t,xt,p),f(Li,xt,null),e(xt,D4),e(xt,Tp),e(Tp,vp),e(vp,P4),e(Tp,V4),e(xt,Z4),e(xt,wp),f(zi,wp,null),m(t,Qb,p),m(t,Et,p),f(Ui,Et,null),e(Et,G4),e(Et,Je),e(Je,kp),e(kp,C4),e(Je,N4),e(Je,Bu),e(Bu,X4),e(Je,R4),e(Je,qu),e(qu,O4),e(Je,A4),e(Je,Su),e(Su,H4),e(Je,Q4),e(Et,Y4),e(Et,$p),f(Ji,$p,null),m(t,Yb,p),m(t,jt,p),f(Ii,jt,null),e(jt,K4),e(jt,Cs),e(Cs,Mp),e(Mp,eE),e(Cs,tE),e(Cs,Wu),e(Wu,oE),e(Cs,sE),e(jt,nE),e(jt,xp),f(Bi,xp,null),m(t,Kb,p),m(t,Ft,p),f(qi,Ft,null),e(Ft,rE),e(Ft,Ep),e(Ep,jp),e(jp,aE),e(Ep,iE),e(Ft,cE),e(Ft,Fp),f(Si,Fp,null),m(t,ey,p),m(t,Lt,p),f(Wi,Lt,null),e(Lt,lE),e(Lt,Lp),e(Lp,zp),e(zp,dE),e(Lp,pE),e(Lt,mE),e(Lt,Up),f(Di,Up,null),m(t,ty,p),m(t,zt,p),f(Pi,zt,null),e(zt,hE),e(zt,Jp),e(Jp,Ip),e(Ip,gE),e(Jp,uE),e(zt,fE),e(zt,Bp),f(Vi,Bp,null),m(t,oy,p),m(t,Ut,p),f(Zi,Ut,null),e(Ut,_E),e(Ut,Gi),e(Gi,bE),e(Gi,Du),e(Du,yE),e(Gi,TE),e(Ut,vE),e(Ut,qp),f(Ci,qp,null),m(t,sy,p),m(t,So,p),e(So,Ns),e(Ns,Pu),f(Ni,Pu,null),e(So,wE),e(So,Vu),e(Vu,kE),m(t,ny,p),m(t,Xs,p),e(Xs,$E),e(Xs,Sp),e(Sp,ME),e(Xs,xE),m(t,ry,p),m(t,Jt,p),f(Xi,Jt,null),e(Jt,EE),e(Jt,Zu),e(Zu,jE),e(Jt,FE),e(Jt,Wp),f(Ri,Wp,null),m(t,ay,p),m(t,Wo,p),f(Oi,Wo,null),e(Wo,LE),e(Wo,Dp),f(Ai,Dp,null),m(t,iy,p),m(t,It,p),f(Hi,It,null),e(It,zE),e(It,Qi),e(Qi,UE),e(Qi,Gu),e(Gu,JE),e(Qi,IE),e(It,BE),e(It,Pp),f(Yi,Pp,null),m(t,cy,p),m(t,Bt,p),f(Ki,Bt,null),e(Bt,qE),e(Bt,ec),e(ec,SE),e(ec,Cu),e(Cu,WE),e(ec,DE),e(Bt,PE),e(Bt,Vp),f(tc,Vp,null),m(t,ly,p),m(t,Do,p),e(Do,Rs),e(Rs,Nu),f(oc,Nu,null),e(Do,VE),e(Do,Xu),e(Xu,ZE),m(t,dy,p),m(t,Os,p),e(Os,GE),e(Os,Zp),e(Zp,CE),e(Os,NE),m(t,py,p),m(t,z,p),f(sc,z,null),e(z,XE),e(z,Ru),e(Ru,RE),e(z,OE),e(z,Ou),e(Ou,AE),e(z,HE),f(As,z,null),e(z,QE),e(z,Au),e(Au,YE),e(z,KE),e(z,Hs),f(nc,Hs,null),e(Hs,ej),e(Hs,Hu),e(Hu,tj),e(z,oj),e(z,Qs),f(rc,Qs,null),e(Qs,sj),e(Qs,Qu),e(Qu,nj),e(z,rj),e(z,Ys),f(ac,Ys,null),e(Ys,aj),e(Ys,Yu),e(Yu,ij),e(z,cj),e(z,Ks),f(ic,Ks,null),e(Ks,lj),e(Ks,cc),e(cc,dj),e(cc,Ku),e(Ku,pj),e(cc,mj),e(z,hj),e(z,en),f(lc,en,null),e(en,gj),e(en,ef),e(ef,uj),e(z,fj),e(z,tn),f(dc,tn,null),e(tn,_j),e(tn,tf),e(tf,bj),e(z,yj),e(z,Gt),f(pc,Gt,null),e(Gt,Tj),e(Gt,mc),e(mc,vj),e(mc,of),e(of,wj),e(mc,kj),e(Gt,$j),e(Gt,sf),e(sf,Mj),m(t,my,p),m(t,Po,p),f(hc,Po,null),e(Po,xj),e(Po,Gp),e(Gp,Cp),e(Cp,Ej),e(Gp,jj),m(t,hy,p),m(t,Vo,p),f(gc,Vo,null),e(Vo,Fj),e(Vo,uc),e(uc,Lj),e(uc,Np),e(Np,zj),e(uc,Uj),m(t,gy,p),m(t,ke,p),f(fc,ke,null),e(ke,Jj),e(ke,nf),e(nf,Ij),e(ke,Bj),e(ke,O),f(_c,O,null),e(O,qj),e(O,rf),e(rf,Sj),e(O,Wj),e(O,Zo),e(Zo,Dj),e(Zo,af),e(af,Pj),e(Zo,Vj),e(Zo,cf),e(cf,Zj),e(Zo,Gj),e(O,Cj),e(O,lf),e(lf,df),e(df,Nj),e(O,Xj),e(O,qt),e(qt,Rj),e(qt,pf),e(pf,Oj),e(qt,Aj),e(qt,mf),e(mf,Hj),e(qt,Qj),e(qt,hf),e(hf,Yj),e(qt,Kj),e(O,eF),e(O,gf),e(gf,tF),e(ke,oF),e(ke,on),f(bc,on,null),e(on,sF),e(on,uf),e(uf,nF),m(t,uy,p),m(t,Go,p),e(Go,sn),e(sn,ff),f(yc,ff,null),e(Go,rF),e(Go,_f),e(_f,aF),m(t,fy,p),m(t,$e,p),f(Tc,$e,null),e($e,iF),e($e,Co),e(Co,cF),e(Co,Xp),e(Xp,lF),e(Co,dF),e(Co,Rp),e(Rp,pF),e(Co,mF),e($e,hF),e($e,Op),f(vc,Op,null),e($e,gF),e($e,Ap),f(wc,Ap,null),m(t,_y,p),m(t,N,p),f(kc,N,null),e(N,uF),e(N,Hp),e(Hp,Qp),e(Qp,fF),e(Hp,_F),e(N,bF),e(N,$c),e($c,yF),e($c,Mc),e(Mc,TF),e($c,vF),e(N,wF),e(N,Yp),e(Yp,kF),e(Yp,xc),e(xc,$F),e(N,MF),e(N,Kp),f(Ec,Kp,null),e(N,xF),e(N,em),f(jc,em,null),m(t,by,p),m(t,Me,p),f(Fc,Me,null),e(Me,EF),e(Me,tm),e(tm,om),e(om,jF),e(tm,FF),e(Me,LF),e(Me,sm),f(Lc,sm,null),e(Me,zF),e(Me,nm),f(zc,nm,null),m(t,yy,p),m(t,No,p),e(No,nn),e(nn,bf),f(Uc,bf,null),e(No,UF),e(No,yf),e(yf,JF),m(t,Ty,p),m(t,St,p),f(Jc,St,null),e(St,IF),e(St,Tf),e(Tf,BF),e(St,qF),e(St,rm),e(rm,SF),e(rm,Ic),e(Ic,WF),m(t,vy,p),m(t,Wt,p),f(Bc,Wt,null),e(Wt,DF),e(Wt,vf),e(vf,PF),e(Wt,VF),e(Wt,am),e(am,ZF),e(am,qc),e(qc,GF),m(t,wy,p),m(t,Xo,p),e(Xo,rn),e(rn,wf),f(Sc,wf,null),e(Xo,CF),e(Xo,kf),e(kf,NF),m(t,ky,p),m(t,D,p),f(Wc,D,null),e(D,XF),e(D,$f),e($f,RF),e(D,OF),f(an,D,null),e(D,AF),f(cn,D,null),e(D,HF),e(D,ln),f(Dc,ln,null),e(ln,QF),e(ln,Mf),e(Mf,YF),e(D,KF),e(D,dn),f(Pc,dn,null),e(dn,e5),e(dn,xf),e(xf,t5),e(D,o5),e(D,pn),f(Vc,pn,null),e(pn,s5),e(pn,Ef),e(Ef,n5),m(t,$y,p),m(t,te,p),f(Zc,te,null),e(te,r5),e(te,jf),e(jf,a5),e(te,i5),f(mn,te,null),e(te,c5),f(hn,te,null),e(te,l5),e(te,gn),f(Gc,gn,null),e(gn,d5),e(gn,Ff),e(Ff,p5),My=!0},p(t,[p]){const Cc={};p&2&&(Cc.$$scope={dirty:p,ctx:t}),ps.$set(Cc);const Lf={};p&2&&(Lf.$$scope={dirty:p,ctx:t}),ms.$set(Lf);const zf={};p&2&&(zf.$$scope={dirty:p,ctx:t}),hs.$set(zf);const Uf={};p&2&&(Uf.$$scope={dirty:p,ctx:t}),us.$set(Uf);const q={};p&2&&(q.$$scope={dirty:p,ctx:t}),fs.$set(q);const Jf={};p&2&&(Jf.$$scope={dirty:p,ctx:t}),_s.$set(Jf);const If={};p&2&&(If.$$scope={dirty:p,ctx:t}),ys.$set(If);const Bf={};p&2&&(Bf.$$scope={dirty:p,ctx:t}),Ts.$set(Bf);const qf={};p&2&&(qf.$$scope={dirty:p,ctx:t}),vs.$set(qf);const Sf={};p&2&&(Sf.$$scope={dirty:p,ctx:t}),ws.$set(Sf);const Wf={};p&2&&(Wf.$$scope={dirty:p,ctx:t}),ks.$set(Wf);const Df={};p&2&&(Df.$$scope={dirty:p,ctx:t}),xs.$set(Df);const Pf={};p&2&&(Pf.$$scope={dirty:p,ctx:t}),Es.$set(Pf);const Vf={};p&2&&(Vf.$$scope={dirty:p,ctx:t}),js.$set(Vf);const Nc={};p&2&&(Nc.$$scope={dirty:p,ctx:t}),Fs.$set(Nc);const Zf={};p&2&&(Zf.$$scope={dirty:p,ctx:t}),Ls.$set(Zf);const Gf={};p&2&&(Gf.$$scope={dirty:p,ctx:t}),zs.$set(Gf);const Cf={};p&2&&(Cf.$$scope={dirty:p,ctx:t}),Js.$set(Cf);const Dt={};p&2&&(Dt.$$scope={dirty:p,ctx:t}),As.$set(Dt);const Nf={};p&2&&(Nf.$$scope={dirty:p,ctx:t}),an.$set(Nf);const Xf={};p&2&&(Xf.$$scope={dirty:p,ctx:t}),cn.$set(Xf);const Rf={};p&2&&(Rf.$$scope={dirty:p,ctx:t}),mn.$set(Rf);const Of={};p&2&&(Of.$$scope={dirty:p,ctx:t}),hn.$set(Of)},i(t){My||(_(h.$$.fragment,t),_(Ln.$$.fragment,t),_(zn.$$.fragment,t),_(Un.$$.fragment,t),_(Jn.$$.fragment,t),_(In.$$.fragment,t),_(Bn.$$.fragment,t),_(qn.$$.fragment,t),_(Sn.$$.fragment,t),_(Wn.$$.fragment,t),_(Dn.$$.fragment,t),_(Pn.$$.fragment,t),_(Vn.$$.fragment,t),_(Zn.$$.fragment,t),_(Gn.$$.fragment,t),_(Cn.$$.fragment,t),_(Nn.$$.fragment,t),_(Xn.$$.fragment,t),_(Rn.$$.fragment,t),_(On.$$.fragment,t),_(An.$$.fragment,t),_(Hn.$$.fragment,t),_(Qn.$$.fragment,t),_(Yn.$$.fragment,t),_(Kn.$$.fragment,t),_(er.$$.fragment,t),_(tr.$$.fragment,t),_(or.$$.fragment,t),_(sr.$$.fragment,t),_(nr.$$.fragment,t),_(rr.$$.fragment,t),_(ar.$$.fragment,t),_(ir.$$.fragment,t),_(cr.$$.fragment,t),_(lr.$$.fragment,t),_(dr.$$.fragment,t),_(pr.$$.fragment,t),_(mr.$$.fragment,t),_(fr.$$.fragment,t),_(_r.$$.fragment,t),_(yr.$$.fragment,t),_(Tr.$$.fragment,t),_(vr.$$.fragment,t),_(wr.$$.fragment,t),_(ps.$$.fragment,t),_($r.$$.fragment,t),_(Mr.$$.fragment,t),_(ms.$$.fragment,t),_(Er.$$.fragment,t),_(jr.$$.fragment,t),_(hs.$$.fragment,t),_(Fr.$$.fragment,t),_(Lr.$$.fragment,t),_(zr.$$.fragment,t),_(Ur.$$.fragment,t),_(Jr.$$.fragment,t),_(Ir.$$.fragment,t),_(qr.$$.fragment,t),_(Sr.$$.fragment,t),_(us.$$.fragment,t),_(fs.$$.fragment,t),_(_s.$$.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),_(ea.$$.fragment,t),_(ys.$$.fragment,t),_(ta.$$.fragment,t),_(oa.$$.fragment,t),_(Ts.$$.fragment,t),_(vs.$$.fragment,t),_(sa.$$.fragment,t),_(na.$$.fragment,t),_(ws.$$.fragment,t),_(ks.$$.fragment,t),_(aa.$$.fragment,t),_(ia.$$.fragment,t),_(la.$$.fragment,t),_(da.$$.fragment,t),_(xs.$$.fragment,t),_(ma.$$.fragment,t),_(ha.$$.fragment,t),_(Es.$$.fragment,t),_(js.$$.fragment,t),_(ga.$$.fragment,t),_(ua.$$.fragment,t),_(fa.$$.fragment,t),_(_a.$$.fragment,t),_(ya.$$.fragment,t),_(Ta.$$.fragment,t),_(Fs.$$.fragment,t),_(Ls.$$.fragment,t),_(va.$$.fragment,t),_(wa.$$.fragment,t),_(ka.$$.fragment,t),_($a.$$.fragment,t),_(zs.$$.fragment,t),_(Ma.$$.fragment,t),_(xa.$$.fragment,t),_(ja.$$.fragment,t),_(Fa.$$.fragment,t),_(Js.$$.fragment,t),_(Ua.$$.fragment,t),_(Ja.$$.fragment,t),_(Sa.$$.fragment,t),_(Wa.$$.fragment,t),_(Da.$$.fragment,t),_(Pa.$$.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),_(Ya.$$.fragment,t),_(Ka.$$.fragment,t),_(ei.$$.fragment,t),_(ti.$$.fragment,t),_(si.$$.fragment,t),_(ni.$$.fragment,t),_(ri.$$.fragment,t),_(ai.$$.fragment,t),_(ii.$$.fragment,t),_(ci.$$.fragment,t),_(di.$$.fragment,t),_(pi.$$.fragment,t),_(mi.$$.fragment,t),_(hi.$$.fragment,t),_(gi.$$.fragment,t),_(ui.$$.fragment,t),_(fi.$$.fragment,t),_(_i.$$.fragment,t),_(bi.$$.fragment,t),_(yi.$$.fragment,t),_(Ti.$$.fragment,t),_(vi.$$.fragment,t),_(wi.$$.fragment,t),_(ki.$$.fragment,t),_($i.$$.fragment,t),_(Mi.$$.fragment,t),_(xi.$$.fragment,t),_(Ei.$$.fragment,t),_(ji.$$.fragment,t),_(Fi.$$.fragment,t),_(Li.$$.fragment,t),_(zi.$$.fragment,t),_(Ui.$$.fragment,t),_(Ji.$$.fragment,t),_(Ii.$$.fragment,t),_(Bi.$$.fragment,t),_(qi.$$.fragment,t),_(Si.$$.fragment,t),_(Wi.$$.fragment,t),_(Di.$$.fragment,t),_(Pi.$$.fragment,t),_(Vi.$$.fragment,t),_(Zi.$$.fragment,t),_(Ci.$$.fragment,t),_(Ni.$$.fragment,t),_(Xi.$$.fragment,t),_(Ri.$$.fragment,t),_(Oi.$$.fragment,t),_(Ai.$$.fragment,t),_(Hi.$$.fragment,t),_(Yi.$$.fragment,t),_(Ki.$$.fragment,t),_(tc.$$.fragment,t),_(oc.$$.fragment,t),_(sc.$$.fragment,t),_(As.$$.fragment,t),_(nc.$$.fragment,t),_(rc.$$.fragment,t),_(ac.$$.fragment,t),_(ic.$$.fragment,t),_(lc.$$.fragment,t),_(dc.$$.fragment,t),_(pc.$$.fragment,t),_(hc.$$.fragment,t),_(gc.$$.fragment,t),_(fc.$$.fragment,t),_(_c.$$.fragment,t),_(bc.$$.fragment,t),_(yc.$$.fragment,t),_(Tc.$$.fragment,t),_(vc.$$.fragment,t),_(wc.$$.fragment,t),_(kc.$$.fragment,t),_(Ec.$$.fragment,t),_(jc.$$.fragment,t),_(Fc.$$.fragment,t),_(Lc.$$.fragment,t),_(zc.$$.fragment,t),_(Uc.$$.fragment,t),_(Jc.$$.fragment,t),_(Bc.$$.fragment,t),_(Sc.$$.fragment,t),_(Wc.$$.fragment,t),_(an.$$.fragment,t),_(cn.$$.fragment,t),_(Dc.$$.fragment,t),_(Pc.$$.fragment,t),_(Vc.$$.fragment,t),_(Zc.$$.fragment,t),_(mn.$$.fragment,t),_(hn.$$.fragment,t),_(Gc.$$.fragment,t),My=!0)},o(t){b(h.$$.fragment,t),b(Ln.$$.fragment,t),b(zn.$$.fragment,t),b(Un.$$.fragment,t),b(Jn.$$.fragment,t),b(In.$$.fragment,t),b(Bn.$$.fragment,t),b(qn.$$.fragment,t),b(Sn.$$.fragment,t),b(Wn.$$.fragment,t),b(Dn.$$.fragment,t),b(Pn.$$.fragment,t),b(Vn.$$.fragment,t),b(Zn.$$.fragment,t),b(Gn.$$.fragment,t),b(Cn.$$.fragment,t),b(Nn.$$.fragment,t),b(Xn.$$.fragment,t),b(Rn.$$.fragment,t),b(On.$$.fragment,t),b(An.$$.fragment,t),b(Hn.$$.fragment,t),b(Qn.$$.fragment,t),b(Yn.$$.fragment,t),b(Kn.$$.fragment,t),b(er.$$.fragment,t),b(tr.$$.fragment,t),b(or.$$.fragment,t),b(sr.$$.fragment,t),b(nr.$$.fragment,t),b(rr.$$.fragment,t),b(ar.$$.fragment,t),b(ir.$$.fragment,t),b(cr.$$.fragment,t),b(lr.$$.fragment,t),b(dr.$$.fragment,t),b(pr.$$.fragment,t),b(mr.$$.fragment,t),b(fr.$$.fragment,t),b(_r.$$.fragment,t),b(yr.$$.fragment,t),b(Tr.$$.fragment,t),b(vr.$$.fragment,t),b(wr.$$.fragment,t),b(ps.$$.fragment,t),b($r.$$.fragment,t),b(Mr.$$.fragment,t),b(ms.$$.fragment,t),b(Er.$$.fragment,t),b(jr.$$.fragment,t),b(hs.$$.fragment,t),b(Fr.$$.fragment,t),b(Lr.$$.fragment,t),b(zr.$$.fragment,t),b(Ur.$$.fragment,t),b(Jr.$$.fragment,t),b(Ir.$$.fragment,t),b(qr.$$.fragment,t),b(Sr.$$.fragment,t),b(us.$$.fragment,t),b(fs.$$.fragment,t),b(_s.$$.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(ea.$$.fragment,t),b(ys.$$.fragment,t),b(ta.$$.fragment,t),b(oa.$$.fragment,t),b(Ts.$$.fragment,t),b(vs.$$.fragment,t),b(sa.$$.fragment,t),b(na.$$.fragment,t),b(ws.$$.fragment,t),b(ks.$$.fragment,t),b(aa.$$.fragment,t),b(ia.$$.fragment,t),b(la.$$.fragment,t),b(da.$$.fragment,t),b(xs.$$.fragment,t),b(ma.$$.fragment,t),b(ha.$$.fragment,t),b(Es.$$.fragment,t),b(js.$$.fragment,t),b(ga.$$.fragment,t),b(ua.$$.fragment,t),b(fa.$$.fragment,t),b(_a.$$.fragment,t),b(ya.$$.fragment,t),b(Ta.$$.fragment,t),b(Fs.$$.fragment,t),b(Ls.$$.fragment,t),b(va.$$.fragment,t),b(wa.$$.fragment,t),b(ka.$$.fragment,t),b($a.$$.fragment,t),b(zs.$$.fragment,t),b(Ma.$$.fragment,t),b(xa.$$.fragment,t),b(ja.$$.fragment,t),b(Fa.$$.fragment,t),b(Js.$$.fragment,t),b(Ua.$$.fragment,t),b(Ja.$$.fragment,t),b(Sa.$$.fragment,t),b(Wa.$$.fragment,t),b(Da.$$.fragment,t),b(Pa.$$.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(Ya.$$.fragment,t),b(Ka.$$.fragment,t),b(ei.$$.fragment,t),b(ti.$$.fragment,t),b(si.$$.fragment,t),b(ni.$$.fragment,t),b(ri.$$.fragment,t),b(ai.$$.fragment,t),b(ii.$$.fragment,t),b(ci.$$.fragment,t),b(di.$$.fragment,t),b(pi.$$.fragment,t),b(mi.$$.fragment,t),b(hi.$$.fragment,t),b(gi.$$.fragment,t),b(ui.$$.fragment,t),b(fi.$$.fragment,t),b(_i.$$.fragment,t),b(bi.$$.fragment,t),b(yi.$$.fragment,t),b(Ti.$$.fragment,t),b(vi.$$.fragment,t),b(wi.$$.fragment,t),b(ki.$$.fragment,t),b($i.$$.fragment,t),b(Mi.$$.fragment,t),b(xi.$$.fragment,t),b(Ei.$$.fragment,t),b(ji.$$.fragment,t),b(Fi.$$.fragment,t),b(Li.$$.fragment,t),b(zi.$$.fragment,t),b(Ui.$$.fragment,t),b(Ji.$$.fragment,t),b(Ii.$$.fragment,t),b(Bi.$$.fragment,t),b(qi.$$.fragment,t),b(Si.$$.fragment,t),b(Wi.$$.fragment,t),b(Di.$$.fragment,t),b(Pi.$$.fragment,t),b(Vi.$$.fragment,t),b(Zi.$$.fragment,t),b(Ci.$$.fragment,t),b(Ni.$$.fragment,t),b(Xi.$$.fragment,t),b(Ri.$$.fragment,t),b(Oi.$$.fragment,t),b(Ai.$$.fragment,t),b(Hi.$$.fragment,t),b(Yi.$$.fragment,t),b(Ki.$$.fragment,t),b(tc.$$.fragment,t),b(oc.$$.fragment,t),b(sc.$$.fragment,t),b(As.$$.fragment,t),b(nc.$$.fragment,t),b(rc.$$.fragment,t),b(ac.$$.fragment,t),b(ic.$$.fragment,t),b(lc.$$.fragment,t),b(dc.$$.fragment,t),b(pc.$$.fragment,t),b(hc.$$.fragment,t),b(gc.$$.fragment,t),b(fc.$$.fragment,t),b(_c.$$.fragment,t),b(bc.$$.fragment,t),b(yc.$$.fragment,t),b(Tc.$$.fragment,t),b(vc.$$.fragment,t),b(wc.$$.fragment,t),b(kc.$$.fragment,t),b(Ec.$$.fragment,t),b(jc.$$.fragment,t),b(Fc.$$.fragment,t),b(Lc.$$.fragment,t),b(zc.$$.fragment,t),b(Uc.$$.fragment,t),b(Jc.$$.fragment,t),b(Bc.$$.fragment,t),b(Sc.$$.fragment,t),b(Wc.$$.fragment,t),b(an.$$.fragment,t),b(cn.$$.fragment,t),b(Dc.$$.fragment,t),b(Pc.$$.fragment,t),b(Vc.$$.fragment,t),b(Zc.$$.fragment,t),b(mn.$$.fragment,t),b(hn.$$.fragment,t),b(Gc.$$.fragment,t),My=!1},d(t){o(T),t&&o(M),t&&o(k),y(h),t&&o(B),t&&o(F),t&&o(i_),t&&o(Yc),t&&o(c_),t&&o(no),y(Ln),t&&o(l_),t&&o(Ee),t&&o(d_),t&&o(ol),t&&o(p_),y(zn,t),t&&o(m_),t&&o(Pt),t&&o(h_),t&&o(je),t&&o(g_),t&&o(V),t&&o(u_),t&&o(ae),t&&o(f_),t&&o(ie),t&&o(__),y(Un,t),t&&o(b_),t&&o(Ko),t&&o(y_),t&&o(ce),t&&o(T_),t&&o(cl),t&&o(v_),t&&o(ro),y(Jn),t&&o(w_),t&&o(ao),y(In),t&&o(k_),t&&o(io),y(Bn),t&&o($_),t&&o(co),y(qn),t&&o(M_),t&&o(lo),y(Sn),t&&o(x_),t&&o(po),y(Wn),t&&o(E_),t&&o(mo),y(Dn),t&&o(j_),t&&o(ho),y(Pn),t&&o(F_),t&&o(go),y(Vn),t&&o(L_),t&&o(uo),y(Zn),t&&o(z_),t&&o(fo),y(Gn),t&&o(U_),t&&o(_o),y(Cn),t&&o(J_),t&&o(bo),y(Nn),t&&o(I_),t&&o(yo),y(Xn),t&&o(B_),t&&o(To),y(Rn),t&&o(q_),t&&o(vo),y(On),t&&o(S_),t&&o(wo),y(An),t&&o(W_),t&&o(ko),y(Hn),t&&o(D_),t&&o($o),y(Qn),t&&o(P_),t&&o(Mo),y(Yn),t&&o(V_),t&&o(xo),y(Kn),t&&o(Z_),t&&o(Eo),y(er),t&&o(G_),t&&o(jo),y(tr),t&&o(C_),t&&o(We),y(or),y(sr),t&&o(N_),t&&o(De),y(nr),y(rr),t&&o(X_),t&&o(Pe),y(ar),y(ir),t&&o(R_),t&&o(Fo),y(cr),t&&o(O_),t&&o(is),t&&o(A_),t&&o(Lo),y(lr),t&&o(H_),t&&o(Ve),y(dr),y(pr),t&&o(Q_),t&&o(ge),y(mr),y(fr),t&&o(Y_),t&&o(Ze),y(_r),y(yr),t&&o(K_),t&&o(Ge),y(Tr),y(vr),t&&o(eb),t&&o(ue),y(wr),y(ps),y($r),t&&o(tb),t&&o(fe),y(Mr),y(ms),y(Er),t&&o(ob),t&&o(_e),y(jr),y(hs),y(Fr),t&&o(sb),t&&o(Ce),y(Lr),y(zr),t&&o(nb),t&&o(Ne),y(Ur),y(Jr),t&&o(rb),t&&o(Xe),y(Ir),y(qr),t&&o(ab),t&&o(L),y(Sr),y(us),y(fs),y(_s),y(Vr),t&&o(ib),t&&o(Re),y(Zr),y(Gr),t&&o(cb),t&&o(Oe),y(Cr),y(Nr),t&&o(lb),t&&o(Ae),y(Xr),y(Rr),t&&o(db),t&&o(He),y(Or),y(Ar),t&&o(pb),t&&o(Qe),y(Hr),y(Qr),t&&o(mb),t&&o(Ye),y(Yr),y(Kr),t&&o(hb),t&&o(be),y(ea),y(ys),y(ta),t&&o(gb),t&&o(H),y(oa),y(Ts),y(vs),y(sa),t&&o(ub),t&&o(Q),y(na),y(ws),y(ks),y(aa),t&&o(fb),t&&o(Ke),y(ia),y(la),t&&o(_b),t&&o(ye),y(da),y(xs),y(ma),t&&o(bb),t&&o(Y),y(ha),y(Es),y(js),y(ga),t&&o(yb),t&&o(et),y(ua),y(fa),t&&o(Tb),t&&o(tt),y(_a),y(ya),t&&o(vb),t&&o(K),y(Ta),y(Fs),y(Ls),y(va),t&&o(wb),t&&o(ot),y(wa),y(ka),t&&o(kb),t&&o(Te),y($a),y(zs),y(Ma),t&&o($b),t&&o(st),y(xa),y(ja),t&&o(Mb),t&&o(ee),y(Fa),y(Js),y(Ua),t&&o(xb),t&&o(ve),y(Ja),y(Sa),t&&o(Eb),t&&o(Io),y(Wa),t&&o(jb),t&&o(rt),y(Da),y(Pa),t&&o(Fb),t&&o(at),y(Va),y(Za),t&&o(Lb),t&&o(it),y(Ga),y(Ca),t&&o(zb),t&&o(ct),y(Na),y(Xa),t&&o(Ub),t&&o(lt),y(Ra),y(Oa),t&&o(Jb),t&&o(dt),y(Aa),y(Ha),t&&o(Ib),t&&o(pt),y(Qa),y(Ya),t&&o(Bb),t&&o(mt),y(Ka),y(ei),t&&o(qb),t&&o(ht),y(ti),y(si),t&&o(Sb),t&&o(gt),y(ni),y(ri),t&&o(Wb),t&&o(ut),y(ai),y(ii),t&&o(Db),t&&o(ft),y(ci),y(di),t&&o(Pb),t&&o(_t),y(pi),y(mi),t&&o(Vb),t&&o(bt),y(hi),y(gi),t&&o(Zb),t&&o(yt),y(ui),y(fi),t&&o(Gb),t&&o(qo),y(_i),t&&o(Cb),t&&o(Tt),y(bi),y(yi),t&&o(Nb),t&&o(vt),y(Ti),y(vi),t&&o(Xb),t&&o(wt),y(wi),y(ki),t&&o(Rb),t&&o(kt),y($i),y(Mi),t&&o(Ob),t&&o($t),y(xi),y(Ei),t&&o(Ab),t&&o(Mt),y(ji),y(Fi),t&&o(Hb),t&&o(xt),y(Li),y(zi),t&&o(Qb),t&&o(Et),y(Ui),y(Ji),t&&o(Yb),t&&o(jt),y(Ii),y(Bi),t&&o(Kb),t&&o(Ft),y(qi),y(Si),t&&o(ey),t&&o(Lt),y(Wi),y(Di),t&&o(ty),t&&o(zt),y(Pi),y(Vi),t&&o(oy),t&&o(Ut),y(Zi),y(Ci),t&&o(sy),t&&o(So),y(Ni),t&&o(ny),t&&o(Xs),t&&o(ry),t&&o(Jt),y(Xi),y(Ri),t&&o(ay),t&&o(Wo),y(Oi),y(Ai),t&&o(iy),t&&o(It),y(Hi),y(Yi),t&&o(cy),t&&o(Bt),y(Ki),y(tc),t&&o(ly),t&&o(Do),y(oc),t&&o(dy),t&&o(Os),t&&o(py),t&&o(z),y(sc),y(As),y(nc),y(rc),y(ac),y(ic),y(lc),y(dc),y(pc),t&&o(my),t&&o(Po),y(hc),t&&o(hy),t&&o(Vo),y(gc),t&&o(gy),t&&o(ke),y(fc),y(_c),y(bc),t&&o(uy),t&&o(Go),y(yc),t&&o(fy),t&&o($e),y(Tc),y(vc),y(wc),t&&o(_y),t&&o(N),y(kc),y(Ec),y(jc),t&&o(by),t&&o(Me),y(Fc),y(Lc),y(zc),t&&o(yy),t&&o(No),y(Uc),t&&o(Ty),t&&o(St),y(Jc),t&&o(vy),t&&o(Wt),y(Bc),t&&o(wy),t&&o(Xo),y(Sc),t&&o(ky),t&&o(D),y(Wc),y(an),y(cn),y(Dc),y(Pc),y(Vc),t&&o($y),t&&o(te),y(Zc),y(mn),y(hn),y(Gc)}}}const UB={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 JB(E){return iB(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class PB extends sB{constructor(T){super();nB(this,T,JB,zB,rB,{})}}export{PB as default,UB as metadata};
